Previous 15994 Revisions Next

r3116 Friday 29th August, 2008 at 10:52:47 UTC by Nathan Woods
Updated to MAME 0.127u1 core
[docs]messnew.txt
[src/emu]audit.c cpuexec.h cpuintrf.c devintrf.c devintrf.h emu.mak inptport.c mconfig.h rendersw.c romload.c tilemap.c tilemap.h ui.c ui.h uimenu.c uimenu.h video.c
[src/emu/cpu]cpu.mak
[src/emu/cpu/alph8201]8201dasm.c alph8201.c
[src/emu/cpu/cp1610]cp1610.c
[src/emu/cpu/m6502]ill02.h
[src/emu/cpu/m68000]m68k.h m68kcpu.c m68kcpu.h m68kmame.c
[src/emu/cpu/mcs48]mcs48.c* mcs48.h* mcs48dsm.c*
[src/emu/cpu/sh4]sh4.c sh4comn.c sh4comn.h
[src/emu/cpu/tms32025]tms32025.c
[src/emu/debug]debugcpu.c
[src/emu/drivers]xtal.h
[src/emu/machine]at28c16.c at28c16.h generic.c laserdsc.c latch8.c* latch8.h* roc10937.c
[src/emu/sound]disc_dev.c disc_flt.c disc_inp.c disc_mth.c disc_wav.c discrete.c discrete.h
[src/ldplayer]ldpdriv.c ldplayer.c ldplayer.mak
[src/lib/util]aviio.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]asteroid.c carnival.c circus.c cyberbal.c dkong.c firetrk.c harddriv.c mario.c mw8080bw.c n8080.c namcoc7x.c namcoc7x.h phoenix.c poolshrk.c segag80r.c segasnd.c snes.c spacefb.c spiders.c sprint2.c sprint4.c starshp1.c* tank8.c triplhnt.c vicdual.c
[src/mame/drivers]8080bw.c adp.c arcadecl.c argus.c artmagic.c asterix.c asteroid.c asuka.c atarig1.c atarig42.c atarigt.c atarigx2.c atarisy1.c badlands.c balsente.c batman.c bfm_sc2.c bking.c blstroid.c cave.c centiped.c champbas.c chinagat.c cischeat.c couple.c cps1.c cps2.c cps3.c cyberbal.c dacholer.c dcheese.c ddragon.c dec0.c discoboy.c djmain.c dkong.c docastle.c drw80pkr.c eprom.c equites.c finalizr.c foodf.c funkyjet.c galaxold.c gatron.c gauntlet.c genesis.c gijoe.c gyruss.c hal21.c hikaru.c hyhoo.c igs_blit.c igs_m68.c itech32.c itech8.c jpmimpct.c junofrst.c klax.c m63.c m72.c magic10.c marvins.c mayumi.c mcr.c megadriv.c megaplay.c megasys1.c megazone.c mhavoc.c mlanding.c model2.c moo.c mpu4.c mpu4drvr.c ms32.c multigam.c mystwarr.c namcofl.c namconb1.c namcond1.c namcos11.c namcos12.c namcos2.c namcos21.c namcos23.c namcos86.c nbmj8688.c nbmj8891.c nbmj8991.c nemesis.c neodrvr.c neogeo.c news.c nitedrvr.c niyanpai.c nmg5.c nmk16.c nova2001.c nycaptor.c offtwall.c ohmygod.c ojankohs.c olibochu.c omegrace.c onetwo.c opwolf.c othldrby.c overdriv.c pandoras.c panicr.c paradise.c parodius.c pasha2.c pass.c pastelg.c pbaction.c pcktgal.c pengo.c peplus.c pgm.c phoenix.c pingpong.c pipedrm.c pirates.c pitnrun.c pkscram.c pktgaldx.c playch10.c playmark.c pokechmp.c polepos.c policetr.c portrait.c powerbal.c powerins.c ppmast93.c psikyo.c psikyo4.c psikyosh.c pturn.c puckpkmn.c punchout.c pushman.c qdrmfgp.c quasar.c quizdna.c quizo.c quizpani.c r2dtank.c rabbit.c raiden.c raiden2.c rainbow.c rallyx.c rampart.c rastan.c rbmk.c redalert.c relief.c retofinv.c rockrage.c rocnrope.c rohga.c rollerg.c rollrace.c rotaryf.c rpunch.c rungun.c safarir.c sandscrp.c sangho.c sauro.c sbasketb.c sbowling.c sbugger.c scobra.c scotrsht.c scramble.c scregg.c segae.c segag80v.c segahang.c segaorun.c segas16a.c segas16b.c segas24.c segaxbd.c segaybd.c seibuspi.c senjyo.c sg1000a.c shangha3.c shangkid.c shaolins.c shootout.c shougi.c shuuz.c sidepckt.c silkroad.c simpsons.c skullxbo.c skyarmy.c skydiver.c skylncr.c sliver.c snk.c snowbros.c solomon.c sonson.c spacefb.c spbactn.c spcforce.c spdodgeb.c speedbal.c speedspn.c speglsht.c splash.c sprcros2.c sprint4.c spy.c srmp5.c srumbler.c sshangha.c ssingles.c sspeedr.c sstrangr.c ssv.c stactics.c stadhero.c starcrus.c starshp1.c statriv2.c stlforce.c strnskil.c stv.c suna16.c supbtime.c supdrapo.c superchs.c supertnk.c suprgolf.c suprloco.c suprnova.c suprridr.c suprslam.c surpratk.c system1.c system16.c tagteam.c tail2nos.c taito_l.c taito_z.c taitojc.c taitosj.c tank8.c tankbust.c taotaido.c targeth.c tattack.c taxidrvr.c tbowl.c tecmo.c tecmo16.c tecmosys.c tehkanwc.c terracre.c tetrisp2.c thayers.c thepit.c thoop2.c thunderj.c thunderx.c tiamc1.c tigeroad.c timelimt.c tmaster.c tmnt.c tnzs.c toaplan2.c toki.c toobin.c topshoot.c topspeed.c tp84.c trackfld.c trucocl.c trvmadns.c trvquest.c tsamurai.c ttchamp.c tubep.c tumbleb.c tumblep.c twincobr.c ultraman.c ultrsprt.c undrfire.c unico.c usgames.c vamphalf.c vaportra.c vastar.c vball.c vegaeo.c vendetta.c vertigo.c vicdual.c victory.c vigilant.c vindictr.c vulgus.c xybots.c zn.c zr107.c
[src/mame/etc]jrcrypt.c
[src/mame/includes]asteroid.h balsente.h dkong.h galaxold.h iremipt.h megasys1.h mhavoc.h nb1413m3.h nitedrvr.h playch10.h snk.h starshp1.h
[src/mame/layout]poker41.lay* pulltabs.lay*
[src/mame/machine]amiga.c asteroid.c balsente.c bfm_bd1.c dc.c dec0.c decoprot.c fd1089.c fd1089.h galaxold.c gaplus.c harddriv.c mcr.c mhavoc.c nb1413m3.c nitedrvr.c playch10.c scramble.c steppers.c steppers.h stfight.c taitosj.c
[src/mame/video]avgdvg.h cischeat.c cps1.c dkong.c fromance.c gatron.c* hd63484.c konamiic.c marvins.c namconb1.c psikyo.c psx.c quizdna.c rollrace.c snk.c snk68.c tetrisp2.c ygv608.c
[src/mess]mess.mak
[src/osd/windows]drawd3d.c windows.mak
[src/tools]chdman.c

src/mame/audio/spacefb.c
r3115r3116
55****************************************************************************/
66
77#include "driver.h"
8#include "cpu/i8039/i8039.h"
8#include "cpu/mcs48/mcs48.h"
99#include "sound/dac.h"
1010#include "sound/samples.h"
1111#include "includes/spacefb.h"
src/mame/audio/snes.c
r3115r3116
603603#ifdef DBG_INTRP
604604        fprintf(
605605               stderr,
606               "V%d: mixfrac=%d: [%d]*%d + [%d]*%d + [%d]*%d + [%d]*%d "\
607                "= %d\n",
606               "V%d: mixfrac=%d: [%d]*%d + [%d]*%d + [%d]*%d + [%d]*%d = %d\n",
608607               v,
609608               vl,
610609               G1[ vl ],
src/mame/audio/spiders.c
r3115r3116
8888
8989static const discrete_555_desc spiders_super_web_555a =
9090{
91   DISC_555_OUT_DC | DISC_555_OUT_CAP,
91   DISC_555_OUT_CAP | DISC_555_OUT_DC,
9292   5,      // B+ voltage of 555
9393   DEFAULT_555_VALUES
9494};
src/mame/audio/phoenix.c
r3115r3116
238238{
239239   DISC_555_OUT_ENERGY,
240240   5,      // B+ voltage of 555
241   4.0, DEFAULT_555_THRESHOLD, DEFAULT_555_TRIGGER
241   DEFAULT_555_CHARGE,
242   4.0      // loaded output voltage
242243};
243244
244245static const discrete_comp_adder_table phoenix_effect2_cap_sel =
r3115r3116
335336   /* - level 5 spaceship                          */
336337   /************************************************/
337338   /* R22 has been confirmed on real boards as 470 ohm, not 47k in schematics  */
338   DISCRETE_RCDISC4(NODE_20, 1, PHOENIX_EFFECT_1_FREQ, 470, RES_K(100), RES_K(33), CAP_U(6.8), 12, 1)   // R22, R23, R24, C7
339   DISCRETE_555_ASTABLE_CV(NODE_21, 1, RES_K(47), RES_K(47), CAP_U(.001), NODE_20, &phoenix_effect1_555)      // R25, R26, C8
339   DISCRETE_RCDISC4(NODE_20,               /* IC52 output pin 7 */
340                1,                     /* ENAB */
341                PHOENIX_EFFECT_1_FREQ,      /* Input to O.C. inverter */
342                470,                  /* R22 */
343                RES_K(100),            /* R23 */
344                RES_K(33),               /* R24 */
345                CAP_U(6.8),            /* C7 */
346                12,                  /* 12V supply */
347                1)                     /* Circuit type 1 */
348   DISCRETE_555_ASTABLE_CV(NODE_21,         /* IC20 pin 6 */
349                     1,               /* ENAB */
350                     RES_K(47),         /* R25 */
351                     RES_K(47),         /* R26 */
352                     CAP_U(.001),      /* C8 */
353                     NODE_20,         /* IC48 pin 5 input */
354                     &phoenix_effect1_555)
340355   /* LS163 counts rising edge, but the LS14 inverts that */
341   DISCRETE_NOTE(NODE_22, 1, NODE_21, PHOENIX_EFFECT_1_DATA, 0x0f, 1, DISC_CLK_BY_COUNT | DISC_OUT_IS_ENERGY)
356   DISCRETE_NOTE(NODE_22,                  /* IC21 pin 5 output */
357              1,                     /* ENAB */
358              NODE_21,                  /* IC13 pin 2 clock input */
359              PHOENIX_EFFECT_1_DATA,      /* Pre-load data */
360              0x0f,                     /* Maximum count of first counter 0-15 (IC13) */
361              1,                     /* Maximum count of second counter 0-1 (IC21) */
362              DISC_CLK_BY_COUNT | DISC_OUT_IS_ENERGY)   /* Module is clocked externally and we anti-alias output */
342363   /* When FILT is enabled, the effect is filtered.
343364     * While the R20 does decrease the amplitude a little, its main purpose
344365     * is to discharge C5 when the filter is disabled. */
345   DISCRETE_SWITCH(NODE_23, 1, PHOENIX_EFFECT_1_FILT, DEFAULT_TTL_V_LOGIC_1, DEFAULT_TTL_V_LOGIC_1 * RES_K(100) / (RES_K(10) + RES_K(100)))   // R20, R19
346   DISCRETE_MULTIPLY(NODE_24, 1, NODE_22, NODE_23)
347   DISCRETE_RCFILTER(NODE_25, 1, NODE_24, 1.0/(1.0/RES_K(10) + 1.0/RES_K(100)), CAP_U(.047))   // R19, R20, C5
348   DISCRETE_SWITCH(PHOENIX_EFFECT_1_SND, 1, PHOENIX_EFFECT_1_FILT, NODE_24, NODE_25)
366   DISCRETE_SWITCH(NODE_23,
367               1,                     /* ENAB */
368               PHOENIX_EFFECT_1_FILT,
369               DEFAULT_TTL_V_LOGIC_1,
370               DEFAULT_TTL_V_LOGIC_1 * RES_K(100) / (RES_K(10) + RES_K(100)))   /* R20, R19 */
371   DISCRETE_MULTIPLY(NODE_24,
372                 1,                  /* ENAB */
373                 NODE_22,
374                 NODE_23)
375   DISCRETE_RCFILTER(NODE_25,
376                 1,
377                 NODE_24,
378                 1.0/(1.0/RES_K(10) + 1.0/RES_K(100)),   /* R19, R20 */
379                 CAP_U(.047))                     /* C5 */
380   DISCRETE_SWITCH(PHOENIX_EFFECT_1_SND,
381               1,                     /* ENAB */
382               PHOENIX_EFFECT_1_FILT,
383               NODE_24,               /* non-filtered */
384               NODE_25)               /* filtered */
349385
350386   /************************************************/
351387   /* Effect 2                                     */
352388   /* - bird flying, bird/phoenix/spaceship hit    */
353389   /* - phoenix wing hit                           */
354390   /************************************************/
355   DISCRETE_COMP_ADDER(NODE_30, 1, PHOENIX_EFFECT_2_FREQ, &phoenix_effect2_cap_sel)
391   DISCRETE_COMP_ADDER(NODE_30,            /* total capacitance of selected capacitors */
392                  1,                  /* ENAB */
393                  PHOENIX_EFFECT_2_FREQ,   /* passed selection bits */
394                  &phoenix_effect2_cap_sel)
356395   /* Part of the frequency select also effects the gain */
357   DISCRETE_TRANSFORM2(NODE_31, 1, PHOENIX_EFFECT_2_FREQ, 2, "01&1/") // get bit 0x02
358   DISCRETE_SWITCH(NODE_32, 1, NODE_31, DEFAULT_TTL_V_LOGIC_1, DEFAULT_TTL_V_LOGIC_1/2)
359   DISCRETE_555_ASTABLE(NODE_33, 1, RES_K(47), RES_K(100), NODE_30, &phoenix_effect2_555)      // R40, R41
396   DISCRETE_TRANSFORM2(NODE_31,            /* 0/1 state of PHOENIX_EFFECT_2_FREQ high bit */
397                  1,                  /* ENAB */
398                  PHOENIX_EFFECT_2_FREQ, 2, "01&1/") // get bit 0x02
399   DISCRETE_SWITCH(NODE_32,               /* voltage level */
400               1,                     /* ENAB */
401               NODE_31,               /* PHOENIX_EFFECT_2_FREQ high bit determines voltage level */
402               DEFAULT_TTL_V_LOGIC_1,
403               DEFAULT_TTL_V_LOGIC_1 / 2)
404   DISCRETE_555_ASTABLE(NODE_33,            /* pin 3 output of IC44 */
405                   1,                  /* ENAB */
406                   RES_K(47),            /* R40 */
407                   RES_K(100),         /* R41 */
408                   NODE_30,            /* C16, C17, C18 combined */
409                   &phoenix_effect2_555)
360410   /* C20 has been confirmed on real boards as 1uF, not 10uF in schematics  */
361   DISCRETE_555_ASTABLE(NODE_34, 1, RES_K(510), RES_K(510), CAP_U(1), &phoenix_effect2_555)   // R23, R24, C20
411   DISCRETE_555_ASTABLE(NODE_34,            /* pin 3 output of IC51 */
412                   1,                  /* ENAB */
413                   RES_K(510),         /* R23 */
414                   RES_K(510),         /* R24 */
415                   CAP_U(1),            /* C20 */
416                   &phoenix_effect2_555)
362417   /* R45 & R46 have been confirmed on real boards as 5.1k, not 51k in schematics  */
363418   /* We need to work backwards here and calculate the voltage at the junction of R42 & R46 */
364419   /* If you remove C22 from the real PCB, you can WAVELOG NODE_35 with a gain of 1000 and compare
365420     * it against the junction of R42 & R46 on a real PCB. */
366   DISCRETE_MIXER3(NODE_35, 1, NODE_33, NODE_34, 5, &phoenix_effect2_mixer1)
421   DISCRETE_MIXER3(NODE_35,               /* Voltage at junction of R42 & R46 with C22 removed */
422               1,                     /* ENAB */
423               NODE_33,               /* output from IC44 */
424               NODE_34,               /* output from IC51 */
425               5,                     /* B+ connected internally to pin 5 of 555 */
426               &phoenix_effect2_mixer1)
367427   /* Then calculate the voltage going to C22 */
368428   /* If you remove C22 from the real PCB, you can WAVELOG NODE_36 with a gain of 1000 and compare
369429     * it against the junction of R45 & R46 on a real PCB. */
370   DISCRETE_MIXER2(NODE_36, 1, NODE_34, NODE_35, &phoenix_effect2_mixer2)
430   DISCRETE_MIXER2(NODE_36,               /* Voltage at junction of R45 & R46 with C22 removed */
431               1,                     /* ENAB */
432               NODE_34,               /* pin 3 output of IC51 */
433               NODE_35,               /* Voltage at junction of R42 & R46 with C22 removed */
434               &phoenix_effect2_mixer2)
371435   /* C22 charging is R45 in parallel with R46, R42 and the 555 CV internal resistance */
372   DISCRETE_RCFILTER(NODE_37, 1, NODE_36, 1.0/ (1.0/RES_K(5.1) + (1.0/(RES_K(5.1) + 1.0/(1.0/RES_K(10) + 1.0/RES_K(5) + 1.0/RES_K(10)) ))), CAP_U(100))   // R45, R46, R42, internal 555 Rs, C22
436   DISCRETE_RCFILTER(NODE_37,
437                 1,                  /* ENAB */
438                 NODE_36,
439                 1.0/ (1.0/RES_K(5.1) + (1.0/(RES_K(5.1) + 1.0/(1.0/RES_K(10) + 1.0/RES_K(5) + 1.0/RES_K(10)) ))),
440                 CAP_U(100))   /* R45, R46, R42, internal 555 Rs, C22 */
373441   /* Now mix from C22 on */
374442   /* You can WAVELOG NODE_38 with a gain of 1000 and compare it against IC50 pin 5 on a real PCB. */
375   DISCRETE_MIXER3(NODE_38, 1, NODE_33, NODE_37, 5, &phoenix_effect2_mixer3)
376   DISCRETE_555_ASTABLE_CV(NODE_39, 1, RES_K(20), RES_K(20), CAP_U(0.001), NODE_38, &phoenix_effect1_555)   // R47, R48, C23
377   DISCRETE_NOTE(NODE_40, 1, NODE_39, PHOENIX_EFFECT_2_DATA, 0x0f, 1, DISC_CLK_BY_COUNT | DISC_OUT_IS_ENERGY)
378   DISCRETE_MULTIPLY(PHOENIX_EFFECT_2_SND, 1, NODE_40, NODE_32)
443   DISCRETE_MIXER3(NODE_38,               /* control voltage to pin 5 of IC50 */
444               1,                     /* ENAB */
445               NODE_33,               /* pin 3 output of IC44 */
446               NODE_37,               /* voltage on C22 */
447               5,                     /* IC50 internally connected to B+ */
448               &phoenix_effect2_mixer3)
449   DISCRETE_555_ASTABLE_CV(NODE_39,         /* IC20 pin 8 output */
450                     1,               /* ENAB */
451                     RES_K(20),         /* R47 */
452                     RES_K(20),         /* R48 */
453                     CAP_U(0.001),      /* C23 */
454                     NODE_38,         /* IC50 pin 5 input */
455                     &phoenix_effect1_555)
456   DISCRETE_NOTE(NODE_40,                  /* IC21 pin 9 output */
457              1,                     /* ENAB */
458              NODE_39,                  /* IC14 pin 2 clock input */
459              PHOENIX_EFFECT_2_DATA,      /* Pre-load data */
460              0x0f,                     /* Maximum count of first counter 0-15 (IC14) */
461              1,                     /* Maximum count of second counter 0-1 (IC21) */
462              DISC_CLK_BY_COUNT | DISC_OUT_IS_ENERGY)
463   DISCRETE_MULTIPLY(PHOENIX_EFFECT_2_SND,
464                 1,                  /* ENAB */
465                 NODE_40,               /* IC21 pin 9 output */
466                 NODE_32)               /* voltage level selected by high bit of PHOENIX_EFFECT_2_FREQ */
379467
380468   /************************************************/
381469   /* Combine all sound sources.                   */
382470   /************************************************/
383   DISCRETE_MIXER4(NODE_90, 1, PHOENIX_EFFECT_1_SND, PHOENIX_EFFECT_2_SND, PHOENIX_EFFECT_3_SND, PHOENIX_EFFECT_4_SND,&phoenix_mixer)
471   DISCRETE_MIXER4(NODE_90,
472               1,                     /* ENAB */
473               PHOENIX_EFFECT_1_SND,
474               PHOENIX_EFFECT_2_SND,
475               PHOENIX_EFFECT_3_SND,
476               PHOENIX_EFFECT_4_SND,
477               &phoenix_mixer)
384478
385479   DISCRETE_OUTPUT(NODE_90, 1)
386480DISCRETE_SOUND_END
r3115r3116
389483{
390484   discrete_sound_w(machine, PHOENIX_EFFECT_2_DATA, data & 0x0f);
391485   discrete_sound_w(machine, PHOENIX_EFFECT_2_FREQ, (data & 0x30) >> 4);
392//  discrete_sound_w(PHOENIX_EFFECT_3_EN  , data & 0x40);
393//  discrete_sound_w(PHOENIX_EFFECT_4_EN  , data & 0x80);
394
486#if 0
487   /* future handling of noise sounds */
488   discrete_sound_w(PHOENIX_EFFECT_3_EN  , data & 0x40);
489   discrete_sound_w(PHOENIX_EFFECT_4_EN  , data & 0x80);
490#endif
395491   stream_update(channel);
396492   sound_latch_a = data;
397493}
src/mame/audio/n8080.c
r3115r3116
66
77#include "driver.h"
88#include "deprecat.h"
9#include "cpu/i8039/i8039.h"
9#include "cpu/mcs48/mcs48.h"
1010#include "sound/sn76477.h"
1111#include "sound/dac.h"
1212#include "includes/n8080.h"
r3115r3116
523523
524524
525525static ADDRESS_MAP_START( n8080_sound_io_map, ADDRESS_SPACE_IO, 8 )
526   AM_RANGE(I8039_t0, I8039_t0) AM_READ(n8080_8035_t0_r)
527   AM_RANGE(I8039_t1, I8039_t1) AM_READ(n8080_8035_t1_r)
528   AM_RANGE(I8039_p1, I8039_p1) AM_READ(n8080_8035_p1_r)
526   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(n8080_8035_t0_r)
527   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(n8080_8035_t1_r)
528   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ(n8080_8035_p1_r)
529529
530   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(n8080_dac_w)
530   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(n8080_dac_w)
531531ADDRESS_MAP_END
532532
533533
534534static ADDRESS_MAP_START( helifire_sound_io_map, ADDRESS_SPACE_IO, 8 )
535   AM_RANGE(I8039_t0, I8039_t0) AM_READ(helifire_8035_t0_r)
536   AM_RANGE(I8039_t1, I8039_t1) AM_READ(helifire_8035_t1_r)
537   AM_RANGE(I8039_p2, I8039_p2) AM_READ(helifire_8035_p2_r)
535   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(helifire_8035_t0_r)
536   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(helifire_8035_t1_r)
537   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(helifire_8035_p2_r)
538538
539539   AM_RANGE(0x00, 0x7f) AM_READ(helifire_8035_external_ram_r)
540540
541   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(helifire_dac_w)
542   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(helifire_sound_ctrl_w)
541   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(helifire_dac_w)
542   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(helifire_sound_ctrl_w)
543543ADDRESS_MAP_END
544544
545545
src/mame/audio/cyberbal.c
r3115r3116
9797
9898static void update_sound_68k_interrupts(running_machine *machine)
9999{
100   int newstate = 0;
101
102   if (fast_68k_int)
103      newstate |= 6;
104   if (io_68k_int)
105      newstate |= 2;
106
107   if (newstate)
108      cpunum_set_input_line(machine, 3, newstate, ASSERT_LINE);
109   else
110      cpunum_set_input_line(machine, 3, 7, CLEAR_LINE);
100   cpunum_set_input_line(machine, 3, 6, fast_68k_int ? ASSERT_LINE : CLEAR_LINE);
101   cpunum_set_input_line(machine, 3, 2, io_68k_int   ? ASSERT_LINE : CLEAR_LINE);
111102}
112103
113104
src/mame/audio/circus.c
r3115r3116
9595
9696static const discrete_555_desc crash_beeper_555m =
9797{
98   DISC_555_TRIGGER_IS_LOGIC | DISC_555_OUT_DC | DISC_555_OUT_SQW,
98   DISC_555_OUT_SQW | DISC_555_OUT_DC | DISC_555_TRIGGER_IS_LOGIC,
9999   5,      // B+ voltage of 555
100100   DEFAULT_555_VALUES
101101};
102102
103103static const discrete_555_desc crash_beeper_555a =
104104{
105   DISC_555_OUT_DC | DISC_555_OUT_SQW,
105   DISC_555_OUT_SQW | DISC_555_OUT_DC,
106106   5,      // B+ voltage of 555
107107   DEFAULT_555_VALUES
108108};
src/mame/audio/asteroid.c
r3115r3116
4444   DISC_555_OUT_SQW | DISC_555_OUT_AC | DISCRETE_555_CC_TO_CAP,
4545   5,      // B+ voltage of 555
4646   DEFAULT_555_VALUES,
47   5,      // B+ voltage of the Constant Current source
4847   0.8      // VBE 2N3906 (Si)
4948};
5049
src/mame/audio/segasnd.c
r3115r3116
1313#include "streams.h"
1414#include "deprecat.h"
1515#include "segag80v.h"
16#include "cpu/i8039/i8039.h"
16#include "cpu/mcs48/mcs48.h"
1717#include "sound/sp0250.h"
1818#include "segasnd.h"
1919
r3115r3116
250250static ADDRESS_MAP_START( speech_portmap, ADDRESS_SPACE_IO, 8 )
251251   AM_RANGE(0x00, 0xff) AM_READ(speech_rom_r)
252252   AM_RANGE(0x00, 0xff) AM_WRITE(sp0250_w)
253   AM_RANGE(I8039_p1, I8039_p1) AM_READWRITE(speech_p1_r, speech_p1_w)
254   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(speech_p2_w)
255   AM_RANGE(I8039_t0, I8039_t0) AM_READ(speech_t0_r)
256   AM_RANGE(I8039_t1, I8039_t1) AM_READ(speech_t1_r)
253   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(speech_p1_r, speech_p1_w)
254   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(speech_p2_w)
255   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(speech_t0_r)
256   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(speech_t1_r)
257257ADDRESS_MAP_END
258258
259259
r3115r3116
889889
890890static ADDRESS_MAP_START( usb_portmap, ADDRESS_SPACE_IO, 8 )
891891   AM_RANGE(0x00, 0xff) AM_READWRITE(usb_workram_r, usb_workram_w)
892   AM_RANGE(I8039_p1, I8039_p1) AM_READWRITE(usb_p1_r, usb_p1_w)
893   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(usb_p2_w)
894   AM_RANGE(I8039_t1, I8039_t1) AM_READ(usb_t1_r)
892   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(usb_p1_r, usb_p1_w)
893   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(usb_p2_w)
894   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(usb_t1_r)
895895ADDRESS_MAP_END
896896
897897
src/mame/audio/vicdual.c
r3115r3116
3838
3939static const discrete_555_desc frogsZip555m =
4040{
41   DISC_555_TRIGGER_IS_LOGIC | DISC_555_OUT_DC | DISC_555_OUT_CAP,
41   DISC_555_OUT_CAP | DISC_555_OUT_DC | DISC_555_TRIGGER_IS_LOGIC,
4242   12,      // B+ voltage of 555
4343   DEFAULT_555_VALUES
4444};
r3115r3116
4848   DISC_555_OUT_CAP | DISC_555_OUT_DC,
4949   12,      // B+ voltage of 555
5050   DEFAULT_555_VALUES,
51   12,      // B+ voltage of the Constant Current source
5251   0.6      // Q13 Vbe
5352};
5453
r3115r3116
220219
221220
222221static const discrete_mixer_desc headon_mixer =
223   {DISC_MIXER_IS_RESISTOR,
224      {RES_K(130), RES_K(130), RES_K(100), RES_K(100), RES_K(100), RES_K(10)},   // 130 = 390/3, Bonus Res is dummy
225      {0,0,0,0,0},   // no variable resistors
226      {0,0,0,0,CAP_N(470),0},
227      0, RES_K(100),
228      0,
229      CAP_U(1),      // not in schematics, used to suppress DC
230      0, 1};
222{
223   DISC_MIXER_IS_RESISTOR,
224   {RES_K(130), RES_K(130), RES_K(100), RES_K(100), RES_K(100), RES_K(10)},   // 130 = 390/3, Bonus Res is dummy
225   {0,0,0,0,0},   // no variable resistors
226   {0,0,0,0,CAP_N(470),0},
227   0, RES_K(100),
228   0,
229   CAP_U(1),      // not in schematics, used to suppress DC
230   0, 1
231};
231232
232233static const discrete_mixer_desc headon_crash_mixer =
233   {DISC_MIXER_IS_OP_AMP,
234      {RES_K(50), RES_K(10)},   // Resistors, in fact variable resistors (100k)
235      {0,0,0,0,0},   // no variable resistors
236      {CAP_N(100),CAP_U(1)},
237      0, RES_K(100),
238      0,
239      CAP_U(1)*0,      // not in schematics, used to suppress DC
240      0, 1};
234{
235   DISC_MIXER_IS_OP_AMP,
236   {RES_K(50), RES_K(10)},   // Resistors, in fact variable resistors (100k)
237   {0,0,0,0,0},   // no variable resistors
238   {CAP_N(100),CAP_U(1)},
239   0, RES_K(100),
240   0,
241   CAP_U(1)*0,      // not in schematics, used to suppress DC
242   0, 1
243};
241244
242245static const discrete_inverter_osc_desc headon_inverter_osc_1 =
243   {DEFAULT_CD40XX_VALUES(12),
246{
247   DEFAULT_CD40XX_VALUES(12),
244248   DISC_OSC_INVERTER_IS_TYPE4
245   };
249};
246250
247251static const discrete_inverter_osc_desc headon_inverter_osc_2 =
248   {DEFAULT_CD40XX_VALUES(12),
252{
253   DEFAULT_CD40XX_VALUES(12),
249254   DISC_OSC_INVERTER_IS_TYPE5 | DISC_OSC_INVERTER_OUT_IS_LOGIC
250   };
255};
251256
252257static const discrete_555_desc headon_555_bonus =
253   {DISC_555_OUT_DC | DISC_555_OUT_ENERGY,
254      12,
255      12-0.5,12*0.66,12*0.33
256   };
258{
259   DISC_555_OUT_ENERGY | DISC_555_OUT_DC,
260   12,
261   DEFAULT_555_CHARGE,
262   12.0-0.5
263};
257264
258265static const discrete_555_desc headon_555_crash =
259   {DISC_555_OUT_DC | DISC_555_TRIGGER_IS_LOGIC,
260      12,
261      12-0.5,12*0.66,12*0.33
262   };
266{
267   DISC_555_OUT_SQW | DISC_555_OUT_DC | DISC_555_TRIGGER_IS_LOGIC,
268   12,
269   DEFAULT_555_CHARGE,
270   12.0-0.5
271};
263272
264273static const discrete_555_cc_desc headon_555cc =
265274{
266   DISC_555_OUT_DC,
275   DISC_555_OUT_SQW | DISC_555_OUT_DC,
267276   12,      // B+ voltage of 555
268277   DEFAULT_555_VALUES,
269   12,      // B+ voltage of the Constant Current source
270278   0.6      // Q16, Q10 Vbe
271279};
272280
r3115r3116
274282/*
275283 * From : http://www.vego.nl/8/08/03/08_08_03.htm
276284 *
277 * - voeding: -7 V, clock-frequentie: 2.267 Hz
278 *- voeding: -8 V, clock-frequentie: 8.731 Hz
279 *- voeding: -9 V, clock-frequentie: 16,38 kHz
280 *- voeding: -10 V, clock-frequentie: 23,53 kHz
281 *- voeding: -11 V, clock-frequentie: 32,56 kHz
282 *- voeding: -12 V, clock-frequentie: 38,34 kHz
283 *- voeding: -13 V, clock-frequentie: 40,00 kHz
284 *- voeding: -14 V, clock-frequentie: 37,80 kHz
285 *- voeding: -15 V, clock-frequentie: 33,17 kHz
285 *- voeding:  -7 V, clock-frequency:  2.267 Hz
286 *- voeding:  -8 V, clock-frequency:  8.731 Hz
287 *- voeding:  -9 V, clock-frequency: 16,38 kHz
288 *- voeding: -10 V, clock-frequency: 23,53 kHz
289 *- voeding: -11 V, clock-frequency: 32,56 kHz
290 *- voeding: -12 V, clock-frequency: 38,34 kHz
291 *- voeding: -13 V, clock-frequency: 40,00 kHz
292 *- voeding: -14 V, clock-frequency: 37,80 kHz
293 *- voeding: -15 V, clock-frequency: 33,17 kHz
286294 *
287295 *  However all other mame sources say 100kHz.
288296 */
r3115r3116
305313};
306314
307315static const discrete_op_amp_filt_info headon_sallen_key_info =
308   { RES_K(15), RES_K(15), 0, 0, 0,
309     CAP_N(470), CAP_N(47), 0
310   };
316{
317   RES_K(15), RES_K(15), 0, 0, 0,
318   CAP_N(470), CAP_N(47), 0
319};
311320
312321static DISCRETE_SOUND_START(headon)
313322   /************************************************
src/mame/audio/carnival.c
r3115r3116
3737/*****************************************************************************/
3838
3939#include "driver.h"
40#include "cpu/i8039/i8039.h"
40#include "cpu/mcs48/mcs48.h"
4141#include "sound/ay8910.h"
4242#include "sound/samples.h"
4343#include "includes/vicdual.h"
r3115r3116
289289ADDRESS_MAP_END
290290
291291static ADDRESS_MAP_START( carnival_audio_io_map, ADDRESS_SPACE_IO, 8 )
292   AM_RANGE(I8039_t1, I8039_t1) AM_READ(carnival_music_port_t1_r)
293   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(carnival_music_port_1_w)
294   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(carnival_music_port_2_w)
292   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(carnival_music_port_t1_r)
293   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(carnival_music_port_1_w)
294   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(carnival_music_port_2_w)
295295ADDRESS_MAP_END
296296
297297
src/mame/audio/poolshrk.c
r3115r3116
2626   DISC_555_OUT_SQW,
2727   5,      // B+ voltage of 555
2828   DEFAULT_555_VALUES,
29   5,      // B+ voltage of the Constant Current source
3029   0.7      // Q3 junction voltage
3130};
3231
src/mame/audio/sprint2.c
r3115r3116
4242   DISC_555_OUT_DC | DISC_555_OUT_SQW,
4343   5,      // B+ voltage of 555
4444   DEFAULT_555_VALUES,
45   5,      // B+ voltage of the Constant Current source
4645   0.7   // VBE 2N3644 (Si)
4746};
4847
r3115r3116
140139         &sprint2_motor_vco)
141140
142141   /* QB-D of 7492 */
143   DISCRETE_COUNTER_7492(NODE_23, 1, SPRINT2_ATTRACT_EN, NODE_22)
142   DISCRETE_COUNTER_7492(NODE_23, 1, SPRINT2_ATTRACT_EN, NODE_22, DISC_CLK_ON_F_EDGE)
144143
145144   /* Mask the bits and XOR for clock input */
146145   DISCRETE_TRANSFORM2(NODE_24, 1, NODE_23, 1, "01&")
r3115r3116
178177         &sprint2_motor_vco)
179178
180179   /* QB-D of 7492 */
181   DISCRETE_COUNTER_7492(NODE_43, 1, SPRINT2_ATTRACT_EN, NODE_42)
180   DISCRETE_COUNTER_7492(NODE_43, 1, SPRINT2_ATTRACT_EN, NODE_42, DISC_CLK_ON_F_EDGE)
182181
183182   /* Mask the bits and XOR for clock input */
184183   DISCRETE_TRANSFORM2(NODE_44, 1, NODE_43, 1, "01&")
r3115r3116
263262         &sprint2_motor_vco)
264263
265264   /* QB-D of 7492 */
266   DISCRETE_COUNTER_7492(NODE_23, 1, SPRINT2_ATTRACT_EN, NODE_22)
265   DISCRETE_COUNTER_7492(NODE_23, 1, SPRINT2_ATTRACT_EN, NODE_22, DISC_CLK_ON_F_EDGE)
267266
268267   /* Mask the bits and XOR for clock input */
269268   DISCRETE_TRANSFORM2(NODE_24, 1, NODE_23, 1, "01&")
r3115r3116
329328   DISC_555_OUT_DC | DISC_555_OUT_SQW,
330329   5,      // B+ voltage of 555
331330   DEFAULT_555_VALUES,
332   5,      // B+ voltage of the Constant Current source
333331   0.7      // Q1 junction voltage
334332};
335333
r3115r3116
381379   DISCRETE_DAC_R1(NODE_20, 1, DOMINOS_FREQ_DATA, DEFAULT_TTL_V_LOGIC_1, &dominos_tone_vco_dac)
382380   DISCRETE_555_CC(NODE_21, 1, NODE_20, DOMINOS_R23, CAP_U(.01), 0, 0, 0, &dominos_tone_vco)
383381   DISCRETE_COUNTER_7492(NODE_22, 1, DOMINOS_ATTRACT_EN,   // IC D8, QB-QD
384         NODE_21)                           // from IC D7/8, pin 3
382         NODE_21, DISC_CLK_ON_F_EDGE)               // from IC D7/8, pin 3
385383   DISCRETE_TRANSFORM2(NODE_23, 1, NODE_22, 0x01, "01&")   // IC D8, pin 11-QB
386384   DISCRETE_SWITCH(NODE_24, 1, NODE_23, 0,   // Enable gate C5
387385         DOMINOS_AMP_DATA)      // IC C4
src/mame/audio/dkong.c
r3115r3116
11#include "driver.h"
2#include "cpu/i8039/i8039.h"
2#include "cpu/mcs48/mcs48.h"
33#include "cpu/m6502/m6502.h"
44#include "sound/nes_apu.h"
5#include "sound/samples.h"
65#include "sound/discrete.h"
7#include "sound/dac.h"
6#include "machine/latch8.h"
87
98#include "sound/tms5110.h"
109#include "sound/5110intf.h"
r3115r3116
2827 *   sound is completely overmodulated.
2928 */
3029
31// FIXME: Review at a later time
30/* FIXME: Review at a later time */
3231#define      DK_REVIEW      (1)
3332
34#define ACTIVELOW_PORT_BIT(P,A,D)   (((P) & (~(1 << (A)))) | (((D) ^ 1) << (A)))
3533
36/* Needed for dkongjr ... FIXME */
37//#define I8035_T_R(N) ((portT >> (N)) & 1)
38#define I8035_T_R(M,N) ((soundlatch2_r(machine,0) >> (N)) & 1)
39#define I8035_T_W_AL(M,N,D) do { state->portT = ACTIVELOW_PORT_BIT(state->portT,N,D); soundlatch2_w(machine, 0, state->portT); } while (0)
40
41#define I8035_P1_R(M) (soundlatch3_r(M,0))
42#define I8035_P2_R(M) (soundlatch4_r(M,0))
43#define I8035_P1_W(M,D) soundlatch3_w(M,0,D)
44#define I8035_P2_W(M,D) soundlatch4_w(M,0,D)
45
46#define I8035_P1_W_AL(M,B,D) I8035_P1_W(M,ACTIVELOW_PORT_BIT(I8035_P1_R(M),B,(D)))
47#define I8035_P2_W_AL(M,B,D) I8035_P2_W(M,ACTIVELOW_PORT_BIT(I8035_P2_R(M),B,(D)))
48
49
5034/****************************************************************
5135 *
5236 * Discrete Sound defines
r3115r3116
6246#define DS_SOUND7_INV      NODE_05
6347#define DS_SOUND9_INV      NODE_06
6448#define DS_DAC            NODE_07
65#define DS_DAC_DISCHARGE   NODE_08
49#define DS_DISCHARGE_INV   NODE_08
6650
6751#define DS_SOUND0         NODE_208
6852#define DS_SOUND1         NODE_209
r3115r3116
201185};
202186
203187static const discrete_mixer_desc dkong_rc_jump_desc =
204   {DISC_MIXER_IS_RESISTOR,
205      {1, DK_R49+DK_R51,NE555_INTERNAL_R,2*NE555_INTERNAL_R},
206      {NODE_26,0,0,0},
207      {0,0,0,0},  // no node capacitors
208      0, 0,
209      DK_C24,
210      0,
211      0, 1};
188{
189   DISC_MIXER_IS_RESISTOR,
190   {1, DK_R49+DK_R51,NE555_INTERNAL_R,2*NE555_INTERNAL_R},
191   {NODE_26,0,0,0},
192   {0,0,0,0},  /* no node capacitors */
193   0, 0,
194   DK_C24,
195   0,
196   0, 1
197};
212198
213199static const discrete_mixer_desc dkong_rc_walk_desc =
214   {DISC_MIXER_IS_RESISTOR,
215      {1, DK_R45+DK_R44,NE555_INTERNAL_R,2*NE555_INTERNAL_R},
216      {NODE_52,0,0,0},
217      {0,0,0,0},  // no node capacitors
218      0, 0,
219      DK_C29,
220      0,
221      0, 1};
200{
201   DISC_MIXER_IS_RESISTOR,
202   {1, DK_R45+DK_R44,NE555_INTERNAL_R,2*NE555_INTERNAL_R},
203   {NODE_52,0,0,0},
204   {0,0,0,0},  /* no node capacitors */
205   0, 0,
206   DK_C29,
207   0,
208   0, 1
209};
222210
223211static const discrete_mixer_desc dkong_mixer_desc =
224   {DISC_MIXER_IS_RESISTOR,
225      {DK_R2, DK_R24, DK_R1, DK_R14},
226      {0,0,0},   // no variable resistors
227      {0,0,0},  // no node capacitors
212{
213   DISC_MIXER_IS_RESISTOR,
214   {DK_R2, DK_R24, DK_R1, DK_R14},
215   {0,0,0},  /* no variable resistors */
216   {0,0,0},  /* no node capacitors */
228217#if DK_REVIEW
229      0, RES_K(10),
218   0, RES_K(10),
230219#else
231      0, 0,
220   0, 0,
232221#endif
233      DK_C159,
234      DK_C12,
235      0, 1};
222   DK_C159,
223   DK_C12,
224   0, 1
225};
236226
237227/* There is no load on the output for the jump circuit
238228 * For the walk circuit, the voltage does not matter */
239229
240230static const discrete_555_desc dkong_555_vco_desc =
241   {DISC_555_OUT_DC | DISC_555_OUT_ENERGY,
242      DK_SUP_V,
243      DK_SUP_V-0.5,DK_SUP_V*0.66,DK_SUP_V*0.33
244   };
231{
232   DISC_555_OUT_ENERGY | DISC_555_OUT_DC,
233   DK_SUP_V,
234   DEFAULT_555_CHARGE,
235   DK_SUP_V - 0.5
236};
245237
246238static const discrete_inverter_osc_desc dkong_inverter_osc_desc_jump =
247   {DEFAULT_CD40XX_VALUES(DK_SUP_V),
239{
240   DEFAULT_CD40XX_VALUES(DK_SUP_V),
248241   DISC_OSC_INVERTER_IS_TYPE1
249   };
242};
250243
251244static const discrete_inverter_osc_desc dkong_inverter_osc_desc_walk =
252   {DEFAULT_CD40XX_VALUES(DK_SUP_V),
245{
246   DEFAULT_CD40XX_VALUES(DK_SUP_V),
253247   DISC_OSC_INVERTER_IS_TYPE2
254   };
248};
255249
256250static const discrete_op_amp_filt_info dkong_sallen_key_info =
257   { RES_K(5.6), RES_K(5.6), 0, 0, 0,
258     CAP_N(22), CAP_N(10), 0
259   };
251{
252   RES_K(5.6), RES_K(5.6), 0, 0, 0,
253   CAP_N(22), CAP_N(10), 0
254};
260255
261256static DISCRETE_SOUND_START(dkong2b)
262257
r3115r3116
264259   /* Input register mapping for dkong             */
265260   /************************************************/
266261
267   // DISCRETE_INPUT_DATA
262   /* DISCRETE_INPUT_DATA */
268263    DISCRETE_INPUT_NOT(DS_SOUND2_INV)
269264    DISCRETE_INPUT_NOT(DS_SOUND1_INV)
270265    DISCRETE_INPUT_NOT(DS_SOUND0_INV)
271    DISCRETE_INPUT_LOGIC(DS_DAC_DISCHARGE)
266    DISCRETE_INPUT_NOT(DS_DISCHARGE_INV)
272267    DISCRETE_INPUT_DATA(DS_DAC)
273   // Mixing - DAC
268   /* Mixing - DAC */
274269   DISCRETE_ADJUSTMENT_TAG(DS_ADJ_DAC, 0, 1, DISC_LINADJ, "VR2")
275270
276271   /************************************************/
r3115r3116
286281   /************************************************/
287282   /* Noise */
288283   DISCRETE_LFSR_NOISE(NODE_11, 1, 1, CLOCK_2VF, 1.0, 0, 0.5, &dkong_lfsr)
289   DISCRETE_COUNTER(NODE_12, 1, 0, NODE_11, 7, DISC_COUNT_UP, 0, DISC_CLK_ON_R_EDGE)   // LS161, IC 3J
284   DISCRETE_COUNTER(NODE_12, 1, 0, NODE_11, 7, DISC_COUNT_UP, 0, DISC_CLK_ON_R_EDGE)   /* LS161, IC 3J */
290285   DISCRETE_TRANSFORM3(NODE_13,1,NODE_12,3,DK_SUP_V,"01>2*")
291286
292287   /* Stomp */
r3115r3116
296291    DISCRETE_TRANSFORM2(NODE_16, 1, NODE_15, 0.6, "01>")
297292    DISCRETE_RCDISC2(NODE_17,NODE_16,DK_SUP_V,DK_R8+DK_R7,0.0,DK_R7,DK_C20)
298293
299    DISCRETE_DIODE_MIXER2(NODE_18, 1, DK_1N5553_V, NODE_13, NODE_13) // D3
300   DISCRETE_DIODE_MIXER2(NODE_20, 1, DK_1N5553_V, NODE_17, NODE_18) // D1, D2
294    DISCRETE_DIODE_MIXER2(NODE_18, 1, DK_1N5553_V, NODE_13, NODE_13) /* D3 */
295   DISCRETE_DIODE_MIXER2(NODE_20, 1, DK_1N5553_V, NODE_17, NODE_18) /* D1, D2 */
301296
302297    DISCRETE_RCINTEGRATE(NODE_22,1,NODE_20,DK_R5, R_PARALLEL(DK_R4+DK_R3,DK_R6),0,DK_C19,DK_SUP_V,DISC_RC_INTEGRATE_TYPE1)
303298    DISCRETE_MULTIPLY(DS_OUT_SOUND0,1,NODE_22,DK_R3/R_SERIE(DK_R3,DK_R4))
r3115r3116
305300   /************************************************/
306301   /* Jump                                         */
307302   /************************************************/
308
303/*  tt */
309304   DISCRETE_MULTIPLY(NODE_24,1,DS_SOUND1,DK_SUP_V)
310305   /* 4049B Inverter Oscillator build from 3 inverters */
311306   DISCRETE_INVERTER_OSC(NODE_25,1,0,DK_R38,DK_R39,DK_C26,0,&dkong_inverter_osc_desc_jump)
r3115r3116
350345   /************************************************/
351346
352347   /* Signal decay circuit Q7, R20, C32 */
353   DISCRETE_RCDISC(NODE_70, DS_DAC_DISCHARGE, 1, DK_R20, DK_C32)
354   DISCRETE_TRANSFORM4(NODE_71, 1, DS_DAC,  DK_SUP_V/256.0, NODE_70, DS_DAC_DISCHARGE, "01*3!2+*")
348   DISCRETE_RCDISC(NODE_70, DS_DISCHARGE_INV, 1, DK_R20, DK_C32)
349   DISCRETE_TRANSFORM4(NODE_71, 1, DS_DAC,  DK_SUP_V/256.0, NODE_70, DS_DISCHARGE_INV, "01*3!2+*")
355350
356351   /* following the DAC are two opamps. The first is a current-to-voltage changer
357352     * for the DAC08 which delivers a variable output current.
r3115r3116
376371
377372   DISCRETE_MIXER4(NODE_288, 1, DS_OUT_SOUND0, DS_OUT_SOUND1, DS_OUT_DAC, DS_OUT_SOUND2, &dkong_mixer_desc)
378373
379   // Amplifier: internal amplifier
374   /* Amplifier: internal amplifier */
380375   DISCRETE_ADDER2(NODE_289,1,NODE_288,5.0*43.0/(100.0+43.0))
381376    DISCRETE_RCINTEGRATE(NODE_294,1,NODE_289,0,150,1000, CAP_U(33),DK_SUP_V,DISC_RC_INTEGRATE_TYPE3)
382377    DISCRETE_CRFILTER(NODE_295,1,NODE_294, RES_K(50), DK_C13)
383   //DISCRETE_CRFILTER(NODE_295,1,NODE_294, 1000, DK_C13)
384   // EZV20 equivalent filter circuit ...
378   /*DISCRETE_CRFILTER(NODE_295,1,NODE_294, 1000, DK_C13) */
379   /* EZV20 equivalent filter circuit ... */
385380   DISCRETE_CRFILTER(NODE_296,1,NODE_295, RES_K(1), CAP_U(4.7))
386381#if DK_NO_FILTERS
387382   DISCRETE_OUTPUT(NODE_288, 32767.0/5.0 * 10)
r3115r3116
407402#define RS_R8      RES_K(100)
408403#define RS_R9      RES_K(10)
409404#define RS_R14      RES_K(10)
410#define RS_R15      RES_K(5.6)   // ????
405#define RS_R15      RES_K(5.6)   /* ???? */
411406#define RS_R16      RES_K(5.6)
412407#define RS_R18      RES_K(4.7)
413408#define RS_R22      RES_K(5.6)
414409#define RS_R23      RES_K(5.6)
415410#define RS_R25      RES_K(10)
416411#define RS_R26      RES_K(5.1)
417#define RS_R27      RES_K(2) // 10k in schematics - but will oscillate
412#define RS_R27      RES_K(2) /* 10k in schematics - but will oscillate */
418413#define RS_R28      150
419414#define RS_R29      RES_K(4.7)
420415#define RS_R30      RES_K(10)
r3115r3116
433428#define RS_R54      RES_K(1.2)
434429#define RS_R55      RES_K(10)
435430#define RS_R56      RES_K(12)
436#define RS_R57      RES_K(4.3) // ??? 43
431#define RS_R57      RES_K(4.3) /* ??? 43 */
437432#define RS_R58      RES_K(43)
438433#define RS_R59      RES_K(1.2)
439434#define RS_R60      RES_K(10)
r3115r3116
472467static const discrete_mixer_desc radarscp_mixer_desc =
473468   {DISC_MIXER_IS_RESISTOR,
474469      {RS_R14, RS_R25, RS_R2, RS_R42, RS_R1},
475      {0,0,0,0,0},   // no variable resistors
476      {0,0,0,0,0},  // no node capacitors
470      {0,0,0,0,0},   /* no variable resistors */
471      {0,0,0,0,0},  /* no node capacitors */
477472      0, RS_VR2,
478473      0,
479474      RS_C2,
r3115r3116
483478   {DISC_MIXER_IS_RESISTOR,
484479      {RS_R56+RS_R54,NE555_INTERNAL_R,R_PARALLEL(2*NE555_INTERNAL_R,RS_R55) },
485480      {0,0,0},
486      {0,0,0,0},  // no node capacitors
481      {0,0,0,0},  /* no node capacitors */
487482      0, 0,
488483      RS_C51,
489484      0,
r3115r3116
492487static const discrete_mixer_desc radarscp_mixer_desc_7 =
493488   {DISC_MIXER_IS_RESISTOR,
494489      {RS_R63+RS_R59, NE555_INTERNAL_R,R_PARALLEL(2*NE555_INTERNAL_R,RS_R60)},
495      {0,0,0},   // no variable resistors
496      {0,0,0},  // no node capacitors
490      {0,0,0},   /* no variable resistors */
491      {0,0,0},  /* no node capacitors */
497492      0, 0,
498493      RS_C50,
499494      0,
r3115r3116
502497/* There is no load on the output for the jump circuit
503498 * For the walk circuit, the voltage does not matter */
504499
505static const discrete_555_desc radarscp_555_vco_desc =
506   {DISC_555_OUT_DC | DISC_555_OUT_ENERGY,
507      DK_SUP_V,
508      DK_SUP_V-0.5,DK_SUP_V*0.66,DK_SUP_V*0.33
509   };
500#define radarscp_555_vco_desc  dkong_555_vco_desc
510501
511502static const discrete_inverter_osc_desc radarscp_inverter_osc_desc_0 =
512503   {DEFAULT_CD40XX_VALUES(DK_SUP_V),
r3115r3116
524515   /* Input register mapping for radarscp          */
525516   /************************************************/
526517
527   // DISCRETE_INPUT_DATA
518   /* DISCRETE_INPUT_DATA */
528519    DISCRETE_INPUT_NOT(DS_SOUND0_INV)
529520    DISCRETE_INPUT_NOT(DS_SOUND1_INV)
530521    DISCRETE_INPUT_NOT(DS_SOUND2_INV)
531522    DISCRETE_INPUT_NOT(DS_SOUND6_INV)
532523    DISCRETE_INPUT_NOT(DS_SOUND7_INV)
533    DISCRETE_INPUT_LOGIC(DS_DAC_DISCHARGE)
524    DISCRETE_INPUT_NOT(DS_DISCHARGE_INV)
534525    DISCRETE_INPUT_DATA(DS_DAC)
535526
536   // Mixing - DAC
527   /* Mixing - DAC */
537528   DISCRETE_ADJUSTMENT_TAG(DS_ADJ_DAC, 0, 1, DISC_LINADJ, "VR2")
538529
539530   /************************************************/
r3115r3116
548539   /************************************************/
549540
550541   DISCRETE_LFSR_NOISE(NODE_11, 1, 1, CLOCK_2VF, 1.0, 0, 0.5, &dkong_lfsr)
551   // Clear (1) from SOUND6
552   DISCRETE_COUNTER(NODE_12, 1, DS_SOUND6_INV, NODE_11, 15, DISC_COUNT_UP, 0, DISC_CLK_ON_R_EDGE)   // LS161, IC 3J
553   DISCRETE_TRANSFORM3(NODE_13,1,NODE_12,0x04,DK_SUP_V,"01&1=2*")  //QC => SND02
554   DISCRETE_TRANSFORM3(NODE_14,1,NODE_12,0x02,DK_SUP_V,"01&1=2*")  //QB => SND01
542   /* Clear (1) from SOUND6 */
543   DISCRETE_COUNTER(NODE_12, 1, DS_SOUND6_INV, NODE_11, 15, DISC_COUNT_UP, 0, DISC_CLK_ON_R_EDGE)   /* LS161, IC 3J */
544   DISCRETE_TRANSFORM3(NODE_13,1,NODE_12,0x04,DK_SUP_V,"01&1=2*")  /*QC => SND02 */
545   DISCRETE_TRANSFORM3(NODE_14,1,NODE_12,0x02,DK_SUP_V,"01&1=2*")  /*QB => SND01 */
555546
556547   /************************************************/
557548   /* SOUND2                                       */
r3115r3116
560551   /* C21 is discharged via Q5 BE */
561552
562553   DISCRETE_RCDISC_MODULATED(NODE_16,1,DS_SOUND2_INV,0,RS_R_NN01,0,0,RS_R9*2,RS_C20,DK_SUP_V)
563    DISCRETE_TRANSFORM2(NODE_17, 1, NODE_16, 0.6, "01>") // TR2
554    DISCRETE_TRANSFORM2(NODE_17, 1, NODE_16, 0.6, "01>") /* TR2 */
564555    DISCRETE_RCDISC2(NODE_18,NODE_17,DK_SUP_V,RS_R8+RS_R7,0.0,RS_R7,RS_C19)
565556
566    DISCRETE_DIODE_MIXER2(NODE_19, 1, DK_1N5553_V, NODE_13, NODE_13) // D3
567   DISCRETE_DIODE_MIXER2(NODE_20, 1, DK_1N5553_V, NODE_18, NODE_19) // D1, D2
557    DISCRETE_DIODE_MIXER2(NODE_19, 1, DK_1N5553_V, NODE_13, NODE_13) /* D3 */
558   DISCRETE_DIODE_MIXER2(NODE_20, 1, DK_1N5553_V, NODE_18, NODE_19) /* D1, D2 */
568559
569560    DISCRETE_RCINTEGRATE(NODE_22,1,NODE_20,RS_R5, R_PARALLEL(RS_R4+RS_R3,RS_R6),0,RS_C18,DK_SUP_V,DISC_RC_INTEGRATE_TYPE1)
570561    DISCRETE_MULTIPLY(DS_OUT_SOUND2,1,NODE_22,RS_R3/R_SERIE(RS_R3,RS_R4))
r3115r3116
576567   /* C21 is discharged via Q5 BE */
577568
578569   DISCRETE_RCDISC_MODULATED(NODE_26,1,DS_SOUND1_INV,0,RS_R_NN02,0,0,RS_R32,RS_C31,DK_SUP_V)
579    DISCRETE_TRANSFORM2(NODE_27, 1, NODE_26, 0.6, "01>") // TR5
570    DISCRETE_TRANSFORM2(NODE_27, 1, NODE_26, 0.6, "01>") /* TR5 */
580571    DISCRETE_RCDISC2(NODE_28,NODE_27,DK_SUP_V,RS_R31+RS_R30,0.0,RS_R30,RS_C30)
581572
582    DISCRETE_DIODE_MIXER2(NODE_29, 1, DK_1N5553_V, NODE_14, NODE_14) // D3
583   DISCRETE_DIODE_MIXER2(NODE_30, 1, DK_1N5553_V, NODE_28, NODE_29) // D1, D2
573    DISCRETE_DIODE_MIXER2(NODE_29, 1, DK_1N5553_V, NODE_14, NODE_14) /* D3 */
574   DISCRETE_DIODE_MIXER2(NODE_30, 1, DK_1N5553_V, NODE_28, NODE_29) /* D1, D2 */
584575
585576    DISCRETE_RCINTEGRATE(NODE_31,1,NODE_30,RS_R28, R_PARALLEL(RS_R27+RS_R26,RS_R29),0,RS_C29,DK_SUP_V,DISC_RC_INTEGRATE_TYPE1)
586577    DISCRETE_MULTIPLY(DS_OUT_SOUND1,1,NODE_31,RS_R26/R_SERIE(RS_R26,RS_R27))
r3115r3116
620611   /* DAC                                          */
621612   /************************************************/
622613   /* Signal decay circuit Q7, R20, C32 */
623   DISCRETE_RCDISC(NODE_170, DS_DAC_DISCHARGE, 1, RS_R40, RS_C40)
624   DISCRETE_TRANSFORM4(NODE_171, 1, DS_DAC,  DK_SUP_V/256.0, NODE_170, DS_DAC_DISCHARGE, "01*3!2+*")
614   DISCRETE_RCDISC(NODE_170, DS_DISCHARGE_INV, 1, RS_R40, RS_C40)
615   DISCRETE_TRANSFORM4(NODE_171, 1, DS_DAC,  DK_SUP_V/256.0, NODE_170, DS_DISCHARGE_INV, "01*3!2+*")
625616
626617   /* following the DAC are two opamps. The first is a current-to-voltage changer
627618     * for the DAC08 which delivers a variable output current.
r3115r3116
642633
643634   DISCRETE_MIXER5(NODE_288, 1, DS_OUT_SOUND0, DS_OUT_SOUND1, DS_OUT_SOUND2, DS_OUT_SOUND7, DS_OUT_DAC, &radarscp_mixer_desc)
644635
645   // Amplifier: internal amplifier
636   /* Amplifier: internal amplifier */
646637   DISCRETE_ADDER2(NODE_289,1,NODE_288,5.0*43.0/(100.0+43.0))
647638    DISCRETE_RCINTEGRATE(NODE_294,1,NODE_289,0,150,1000, CAP_U(33),DK_SUP_V,DISC_RC_INTEGRATE_TYPE3)
648639   DISCRETE_CRFILTER(NODE_295,1,NODE_294, 1000, DK_C13)
r3115r3116
682673#define JR_C14      CAP_U(4.7)
683674#define JR_C15      CAP_U(22)
684675#define JR_C16      CAP_U(3.3)
685#define JR_C17      CAP_U(3.3) // ??? illegible
676#define JR_C17      CAP_U(3.3) /* ??? illegible */
686677#define JR_C18      CAP_N(22)
687678#define JR_C19      CAP_N(4.7)
688679#define JR_C20      CAP_U(0.12)
r3115r3116
719710static const discrete_mixer_desc dkongjr_mixer_desc =
720711   {DISC_MIXER_IS_RESISTOR,
721712      {JR_R5, JR_R3, JR_R6, JR_R4, JR_R25},
722      {0,0,0,0,0},   // no variable resistors
723      {0,0,0,0,0},  // no node capacitors
713      {0,0,0,0,0},   /* no variable resistors */
714      {0,0,0,0,0},  /* no node capacitors */
724715      0, 0,
725716      JR_C155,
726717      JR_C161,
r3115r3116
729720static const discrete_mixer_desc dkongjr_s1_mixer_desc =
730721   {DISC_MIXER_IS_RESISTOR,
731722      {JR_R13, JR_R12},
732      {0,0},   // no variable resistors
733      {0,0},  // no node capacitors
734      0, RES_K(90), // Internal LS624 resistors ...
723      {0,0},   /* no variable resistors */
724      {0,0},  /* no node capacitors */
725      0, RES_K(90), /* Internal LS624 resistors ... */
735726      JR_C24,
736727      0,
737728      0, 1};
r3115r3116
764755    DISCRETE_INPUT_NOT(DS_SOUND6_INV)
765756    DISCRETE_INPUT_NOT(DS_SOUND7_INV)
766757    DISCRETE_INPUT_NOT(DS_SOUND9_INV)
767    DISCRETE_INPUT_LOGIC(DS_DAC_DISCHARGE)
758    DISCRETE_INPUT_NOT(DS_DISCHARGE_INV)
768759    DISCRETE_INPUT_DATA(DS_DAC)
769760
770761   /************************************************/
r3115r3116
820811
821812   DISCRETE_COUNTER(NODE_100,1,0,NODE_118,0xFFFF,DISC_COUNT_UP,0,DISC_CLK_BY_COUNT)
822813
823   DISCRETE_BITSET(NODE_101, NODE_100, 7)    //LS157 2A
824   DISCRETE_BITSET(NODE_102, NODE_100, 4)    //LS157 2B
825   DISCRETE_BITSET(NODE_103, NODE_100, 13) //LS157 3A
826   DISCRETE_BITSET(NODE_104, NODE_100, 12) //LS157 3B
814   DISCRETE_BITSET(NODE_101, NODE_100, 7)    /*LS157 2A */
815   DISCRETE_BITSET(NODE_102, NODE_100, 4)    /*LS157 2B */
816   DISCRETE_BITSET(NODE_103, NODE_100, 13) /*LS157 3A */
817   DISCRETE_BITSET(NODE_104, NODE_100, 12) /*LS157 3B */
827818
828819   /* LS157 Switches */
829   DISCRETE_SWITCH(NODE_105, 1, DS_SOUND7_INV, GND, NODE_113) // Switch 1 from LS624
830   DISCRETE_SWITCH(NODE_106, 1, DS_SOUND7_INV, NODE_101, NODE_102) // Switch 2
831   DISCRETE_SWITCH(NODE_107, 1, DS_SOUND7_INV, NODE_103, NODE_104) // Switch 3
820   DISCRETE_SWITCH(NODE_105, 1, DS_SOUND7_INV, GND, NODE_113) /* Switch 1 from LS624 */
821   DISCRETE_SWITCH(NODE_106, 1, DS_SOUND7_INV, NODE_101, NODE_102) /* Switch 2 */
822   DISCRETE_SWITCH(NODE_107, 1, DS_SOUND7_INV, NODE_103, NODE_104) /* Switch 3 */
832823
833824   DISCRETE_LS123(NODE_110, DS_SOUND0_INV, JR_R8, JR_C14)
834825   DISCRETE_TRANSFORM2(NODE_111, 1, TTL_HIGH, NODE_110, "01-")
r3115r3116
848839   /* DAC                                          */
849840   /************************************************/
850841   /* Signal decay circuit Q7, R20, C32 */
851   DISCRETE_RCDISC(NODE_170, DS_DAC_DISCHARGE, 1, JR_R20, JR_C32)
852   DISCRETE_TRANSFORM4(NODE_171, 1, DS_DAC,  DK_SUP_V/256.0, NODE_170, DS_DAC_DISCHARGE, "01*3!2+*")
842   DISCRETE_RCDISC(NODE_170, DS_DISCHARGE_INV, 1, JR_R20, JR_C32)
843   DISCRETE_TRANSFORM4(NODE_171, 1, DS_DAC,  DK_SUP_V/256.0, NODE_170, DS_DISCHARGE_INV, "01*3!2+*")
853844
854845   /* following the DAC are two opamps. The first is a current-to-voltage changer
855846     * for the DAC08 which delivers a variable output current.
r3115r3116
882873 *
883874 ****************************************************************/
884875
885static SOUND_START( dkong )
886{
887   dkong_state *state = machine->driver_data;
888876
889   state_save_register_global(state->page);
890   state_save_register_global(state->mcustatus);
891   state_save_register_global(state->portT);
892}
893877
894static SOUND_RESET( dkong )
895{
896   dkong_state *state = machine->driver_data;
897
898   state->mcustatus = 0;
899   state->page = 0x47;
900   state->portT = 0;
901
902   I8035_T_W_AL(machine,0,0);
903   I8035_T_W_AL(machine,1,0);
904   I8035_P1_W(machine,0xFF);
905   I8035_P2_W(machine,0xFF);
906   soundlatch_w(machine,0,0x0F);
907}
908
909static SOUND_RESET( dkongjr )
910{
911   SOUND_RESET_CALL(dkong);
912   soundlatch_w(machine,0,0x00);
913}
914
915878/****************************************************************
916879 *
917880 * M58817 Speech
r3115r3116
1006969
1007970static WRITE8_HANDLER( M58817_command_w )
1008971{
1009   logerror("PA Write %x\n", data);
1010
1011972   tms5110_ctl_w(machine, 0, data & 0x0f);
1012973   tms5110_pdc_w(machine, 0, (data>>4) & 0x01);
1013   // FIXME 0x20 is CS
974   /* FIXME 0x20 is CS */
1014975}
1015976
977
1016978/****************************************************************
1017979 *
1018980 * I/O Handlers - static
1019981 *
1020982 ****************************************************************/
1021983
1022static READ8_HANDLER( dkong_sh_p1_r )
1023{
1024   return I8035_P1_R(machine);
1025}
1026
1027static READ8_HANDLER( dkong_sh_p2_r )
1028{
1029   return I8035_P2_R(machine);
1030}
1031
1032static READ8_HANDLER( dkong_sh_t0_r )
1033{
1034   return I8035_T_R(machine,0);
1035}
1036
1037static READ8_HANDLER( dkong_sh_t1_r )
1038{
1039   return I8035_T_R(machine,1);
1040}
1041
1042984static WRITE8_HANDLER( dkong_voice_w )
1043985{
1044986   /* only provided for documentation purposes
r3115r3116
1055997   return 0;
1056998}
1057999
1058static READ8_HANDLER( dkong_sh_tune_r )
1000static READ8_DEVICE_HANDLER( dkong_tune_r )
10591001{
1060   dkong_state *state = machine->driver_data;
1061   UINT8 *SND = memory_region(machine, "sound");
1002   const device_config *devvp2 = devtag_get_device(device->machine, LATCH8, "virtual_p2");
1003   UINT8 *snd_rom = memory_region(device->machine, "sound");
1004   UINT8 page = latch8_r(devvp2,0) & 0x47;
10621005
1063   if ( state->page & 0x40 )
1006   if ( page & 0x40 )
10641007   {
1065      return (soundlatch_r(machine,0) & 0x0F) | (dkong_voice_status_r(machine,0)<<4);
1008      return (latch8_r(device, 0) & 0x0F) | (dkong_voice_status_r(device->machine,0)<<4);
10661009   }
10671010   else
10681011   {
10691012      /* printf("rom access at pc = %4x\n",activecpu_get_pc()); */
1070      return (SND[0x1000+(state->page & 7)*256+offset]);
1013      return (snd_rom[0x1000+(page & 7)*256+offset]);
10711014   }
10721015}
10731016
1074static READ8_HANDLER( dkongjr_sh_tune_r )
1017static WRITE8_HANDLER( dkong_p1_w )
10751018{
1076   return soundlatch_r(machine,0) & 0x01F;
1077}
1078
1079static WRITE8_HANDLER( dkong_sh_p1_w )
1080{
10811019   discrete_sound_w(machine,DS_DAC,data);
10821020}
10831021
10841022
1085static READ8_HANDLER( radarsc1_sh_p1_r )
1086{
1087   int r;
1088
1089   r = (I8035_P1_R(machine) & 0x80) | (tms5110_status_r(machine,0)<<6);
1090   return r;
1091}
1092
1093static WRITE8_HANDLER( dkong_sh_p2_w )
1094{
1095   dkong_state *state = machine->driver_data;
1096
1097   /*   If P2.Bit7 -> is apparently an external signal decay or other output control
1098     *   If P2.Bit6 -> activates the external compressed sample ROM (not radarsc1)
1099     *   If P2.Bit5 -> Signal ANSN ==> Grid enable (radarsc1)
1100     *   If P2.Bit4 -> status code to main cpu
1101     *   P2.Bit2-0  -> select the 256 byte bank for external ROM
1102     */
1103
1104   state->mcustatus = ((~data & 0x10) >> 4);
1105   radarsc1_ansn_w(machine, 0, (data & 0x20) >> 5);
1106   state->page = (data & 0x47);
1107
1108   discrete_sound_w(machine,DS_DAC_DISCHARGE, (data & 0x80) ? 0 : 1 );
1109}
1110
1111
11121023/****************************************************************
11131024 *
11141025 * I/O Handlers - global
11151026 *
11161027 ****************************************************************/
11171028
1118WRITE8_HANDLER( dkongjr_sh_test6_w )
1119{
1120   I8035_P2_W_AL(machine,6,data & 1);
1121}
1122
1123
1124WRITE8_HANDLER( dkongjr_sh_tuneselect_w )
1125{
1126   soundlatch_w(machine,offset,data);
1127}
1128
1129READ8_HANDLER( dkong_audio_status_r )
1130{
1131   dkong_state *state = machine->driver_data;
1132
1133   return state->mcustatus;
1134}
1135
11361029WRITE8_HANDLER( dkong_audio_irq_w )
11371030{
11381031   if (data)
r3115r3116
11411034      cpunum_set_input_line(machine, 1, 0, CLEAR_LINE);
11421035}
11431036
1144WRITE8_HANDLER( dkong_snd_disc_w )
1145{
1146   dkong_state *state = machine->driver_data;
11471037
1148   switch (offset)
1149   {
1150      case 0:
1151         discrete_sound_w(machine,DS_SOUND0_INP,data & 1);
1152         break;
1153      case 1:
1154         discrete_sound_w(machine,DS_SOUND1_INP,data & 1);
1155         break;
1156      case 2:
1157         discrete_sound_w(machine,DS_SOUND2_INP,data & 1);
1158         radarscp_snd02_w(machine, 0, data & 1);
1159         break;
1160      case 3:
1161         if (state->hardware_type == HARDWARE_TRS01)
1162            //SOUND3 ==> PA7
1163            I8035_P1_W_AL(machine,7,data & 1);
1164         else
1165            I8035_P2_W_AL(machine,5,data & 1);
1166         break;
1167      case 4:
1168         I8035_T_W_AL(machine, 1, data & 1);
1169         break;
1170      case 5:
1171         I8035_T_W_AL(machine, 0, data & 1);
1172         break;
1173      case 6:
1174         discrete_sound_w(machine,DS_SOUND6_INP,data & 1);
1175         break;
1176      case 7:
1177         discrete_sound_w(machine,DS_SOUND7_INP,data & 1);
1178         break;
1179    }
1180   return;
1181}
1182
1183WRITE8_HANDLER( dkong_sh_tuneselect_w )
1184{
1185   soundlatch_w(machine,offset,data ^ 0x0f);
1186}
1187
1188WRITE8_HANDLER( dkongjr_snd_w1 )
1189{
1190   dkong_state *state = machine->driver_data;
1191
1192   switch (offset)
1193   {
1194      case 0:         /* climb */
1195         discrete_sound_w(machine,DS_SOUND0_INP,data & 1);
1196         break;
1197      case 1:         /* jump */
1198         discrete_sound_w(machine,DS_SOUND1_INP,data & 1);
1199         break;
1200      case 2:         /* land */
1201         discrete_sound_w(machine,DS_SOUND2_INP,data & 1);
1202         break;
1203      case 3: /* Port 3 write ==> PB 5 */
1204         I8035_P2_W_AL(machine,5,data & 1);
1205         break;
1206      case 4:         /* Port 4 write */
1207         I8035_T_W_AL(machine,1, data & 1);
1208         break;
1209      case 5:         /* Port 5 write */
1210         I8035_T_W_AL(machine,0, data & 1);
1211         break;
1212      case 6:         /* Port 6 write ==> PB 4 */
1213         I8035_P2_W_AL(machine,4,data & 1);
1214         break;
1215      case 7:         /* walk */
1216         discrete_sound_w(machine,DS_SOUND7_INP,data & 1);
1217         break;
1218   }
1219}
1220
1221WRITE8_HANDLER( dkongjr_snd_w2 )
1222{
1223   switch (offset)
1224   {
1225   case 0:         /* S9 - drop */
1226      discrete_sound_w(machine,DS_SOUND9_INP,data & 1);
1227      break;
1228   }
1229}
1230
12311038/*************************************
12321039 *
12331040 *  Sound CPU memory handlers
r3115r3116
12391046ADDRESS_MAP_END
12401047
12411048static ADDRESS_MAP_START( dkong_sound_io_map, ADDRESS_SPACE_IO, 8 )
1242   AM_RANGE(0x00, 0xff) AM_READWRITE(dkong_sh_tune_r, dkong_voice_w)
1243   AM_RANGE(I8039_bus, I8039_bus) AM_READWRITE(dkong_sh_tune_r, dkong_voice_w)
1244   AM_RANGE(I8039_p1, I8039_p1) AM_READWRITE(dkong_sh_p1_r, dkong_sh_p1_w)
1245   AM_RANGE(I8039_p2, I8039_p2) AM_READWRITE(dkong_sh_p2_r, dkong_sh_p2_w)
1246   AM_RANGE(I8039_t0, I8039_t0) AM_READ(dkong_sh_t0_r)
1247   AM_RANGE(I8039_t1, I8039_t1) AM_READ(dkong_sh_t1_r)
1049   AM_RANGE(0x00, 0xFF) AM_DEVREAD(LATCH8, "ls175.3d", dkong_tune_r)
1050                        AM_WRITE(dkong_voice_w)
1051   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_DEVREAD(LATCH8, "ls175.3d", dkong_tune_r)
1052                                  AM_WRITE(dkong_voice_w)
1053   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(dkong_p1_w) /* only write to dac */
1054   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_LATCH8_READWRITE("virtual_p2")
1055   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_LATCH8_READBIT("ls259.6h", 5)
1056   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4)
12481057ADDRESS_MAP_END
12491058
12501059static ADDRESS_MAP_START( dkongjr_sound_io_map, ADDRESS_SPACE_IO, 8 )
1251   AM_RANGE(0x00, 0xff) AM_READ(dkongjr_sh_tune_r)
1252   AM_RANGE(I8039_p1, I8039_p1) AM_READWRITE(dkong_sh_p1_r, dkong_sh_p1_w)
1253   AM_RANGE(I8039_p2, I8039_p2) AM_READWRITE(dkong_sh_p2_r, dkong_sh_p2_w)
1254   AM_RANGE(I8039_t0, I8039_t0) AM_READ(dkong_sh_t0_r)
1255   AM_RANGE(I8039_t1, I8039_t1) AM_READ(dkong_sh_t1_r)
1060   AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_LATCH8_READ("ls174.3d")
1061   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(dkong_p1_w) /* only write to dac */
1062   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_LATCH8_READWRITE("virtual_p2")
1063   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_LATCH8_READBIT("ls259.6h", 5)
1064   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4)
12561065ADDRESS_MAP_END
12571066
12581067static ADDRESS_MAP_START( radarsc1_sound_io_map, ADDRESS_SPACE_IO, 8 )
1259   AM_RANGE(0x00, 0xff) AM_READ(soundlatch_r)
1260   AM_RANGE(0x00, 0xff) AM_WRITE(dkong_sh_p1_w) // DAC here
1261   AM_RANGE(I8039_p1, I8039_p1) AM_READWRITE(radarsc1_sh_p1_r, M58817_command_w)
1262   AM_RANGE(I8039_p2, I8039_p2) AM_READWRITE(dkong_sh_p2_r, dkong_sh_p2_w)
1263   AM_RANGE(I8039_t0, I8039_t0) AM_READ(dkong_sh_t0_r)
1264   AM_RANGE(I8039_t1, I8039_t1) AM_READ(dkong_sh_t1_r)
1068   AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_DEVREAD(LATCH8, "ls175.3d", latch8_r)
1069   AM_RANGE(0x00, 0xff) AM_WRITE(dkong_p1_w) /* DAC here */
1070   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_LATCH8_READ("virtual_p1")
1071                                AM_WRITE(M58817_command_w)
1072   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_LATCH8_WRITE("virtual_p2")
1073   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_LATCH8_READBIT("ls259.6h", 5)
1074   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4)
12651075ADDRESS_MAP_END
12661076
12671077static ADDRESS_MAP_START( dkong3_sound1_map, ADDRESS_SPACE_PROGRAM, 8 )
12681078   AM_RANGE(0x0000, 0x01ff) AM_RAM
1269   AM_RANGE(0x4016, 0x4016) AM_READ(soundlatch_r)      // overwrite default
1270   AM_RANGE(0x4017, 0x4017) AM_READ(soundlatch2_r)
1079   AM_RANGE(0x4016, 0x4016) AM_LATCH8_READ("latch1")      /* overwrite default */
1080   AM_RANGE(0x4017, 0x4017) AM_LATCH8_READ("latch2")
12711081   AM_RANGE(0x4000, 0x4017) AM_READ(nes_psg_0_r)
12721082   AM_RANGE(0x4000, 0x4017) AM_WRITE(nes_psg_0_w)
12731083   AM_RANGE(0xe000, 0xffff) AM_ROM
r3115r3116
12751085
12761086static ADDRESS_MAP_START( dkong3_sound2_map, ADDRESS_SPACE_PROGRAM, 8 )
12771087   AM_RANGE(0x0000, 0x01ff) AM_RAM
1278   AM_RANGE(0x4016, 0x4016) AM_READ(soundlatch3_r)      // overwrite default
1088   AM_RANGE(0x4016, 0x4016) AM_LATCH8_READ("latch3")      /* overwrite default */
12791089   AM_RANGE(0x4000, 0x4017) AM_READ(nes_psg_1_r)
12801090   AM_RANGE(0x4000, 0x4017) AM_WRITE(nes_psg_1_w)
12811091   AM_RANGE(0xe000, 0xffff) AM_ROM
r3115r3116
12981108
12991109MACHINE_DRIVER_START( dkong2b_audio )
13001110
1111   /* sound latches */
1112
1113   MDRV_LATCH8_ADD("ls175.3d") /* sound cmd latch */
1114   MDRV_LATCH8_MASKOUT(0xf0)
1115   MDRV_LATCH8_INVERT(0x0F)
1116
1117   MDRV_LATCH8_ADD("ls259.6h")
1118   MDRV_LATCH8_DISCRETE_NODE(0, DS_SOUND0_INP)
1119   MDRV_LATCH8_DISCRETE_NODE(1, DS_SOUND1_INP)
1120   MDRV_LATCH8_DISCRETE_NODE(2, DS_SOUND2_INP)
1121   MDRV_LATCH8_DISCRETE_NODE(6, DS_SOUND6_INP)
1122   MDRV_LATCH8_DISCRETE_NODE(7, DS_SOUND7_INP)
1123
1124   /*   If P2.Bit7 -> is apparently an external signal decay or other output control
1125     *   If P2.Bit6 -> activates the external compressed sample ROM (not radarsc1)
1126     *   If P2.Bit5 -> Signal ANSN ==> Grid enable (radarsc1)
1127     *   If P2.Bit4 -> status code to main cpu
1128     *   P2.Bit2-0  -> select the 256 byte bank for external ROM
1129     */
1130
1131   MDRV_LATCH8_ADD( "virtual_p2" )   /* virtual latch for port B */
1132   MDRV_LATCH8_INVERT( 0x20 )      /* signal is inverted       */
1133   MDRV_LATCH8_DEVREAD(5, LATCH8, "ls259.6h", latch8_r, 3)
1134   MDRV_LATCH8_DISCRETE_NODE(7, DS_DISCHARGE_INV)
1135
13011136   MDRV_CPU_ADD("sound", I8035,I8035_CLOCK)
13021137   MDRV_CPU_PROGRAM_MAP(dkong_sound_map,0)
13031138   MDRV_CPU_IO_MAP(dkong_sound_io_map, 0)
13041139
1305   MDRV_SOUND_START(dkong)
1306   MDRV_SOUND_RESET(dkong)
1307
13081140   MDRV_SPEAKER_STANDARD_MONO("mono")
13091141   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
13101142   MDRV_SOUND_CONFIG_DISCRETE(dkong2b)
r3115r3116
13281160   MDRV_CPU_MODIFY("sound")
13291161   MDRV_CPU_IO_MAP(radarsc1_sound_io_map, 0)
13301162
1163   /* virtual_p2 is not read -see memory map-, all bits are output bits */
1164   MDRV_LATCH8_ADD( "virtual_p1" )   /* virtual latch for port A */
1165   MDRV_LATCH8_INVERT( 0x80 )      /* signal is inverted       */
1166   MDRV_LATCH8_DEVREAD(7, LATCH8, "ls259.6h", latch8_r, 3)
1167   MDRV_LATCH8_READ(6, tms5110_status_r, 0)
1168
13311169   MDRV_SOUND_ADD("tms", M58817, XTAL_640kHz)
13321170   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
13331171
r3115r3116
13351173
13361174MACHINE_DRIVER_START( dkongjr_audio )
13371175
1176   /* sound latches */
1177
1178   MDRV_LATCH8_ADD("ls174.3d")
1179   MDRV_LATCH8_MASKOUT(0xE0)
1180
1181   MDRV_LATCH8_ADD( "ls259.6h")
1182   MDRV_LATCH8_DISCRETE_NODE(0, DS_SOUND0_INP)
1183   MDRV_LATCH8_DISCRETE_NODE(1, DS_SOUND1_INP)
1184   MDRV_LATCH8_DISCRETE_NODE(2, DS_SOUND2_INP)
1185   MDRV_LATCH8_DISCRETE_NODE(7, DS_SOUND7_INP)
1186
1187   MDRV_LATCH8_ADD( "ls259.5h")
1188   MDRV_LATCH8_DISCRETE_NODE(1, DS_SOUND9_INP)
1189
1190   MDRV_LATCH8_ADD( "ls259.4h")
1191
1192   MDRV_LATCH8_ADD( "virtual_p2" )   /* virtual latch for port B */
1193   MDRV_LATCH8_INVERT( 0x70 )      /* all signals are inverted */
1194   MDRV_LATCH8_DEVREAD(6, LATCH8, "ls259.4h", latch8_r, 1)
1195   MDRV_LATCH8_DEVREAD(5, LATCH8, "ls259.6h", latch8_r, 3)
1196   MDRV_LATCH8_DEVREAD(4, LATCH8, "ls259.6h", latch8_r, 6)
1197   MDRV_LATCH8_DISCRETE_NODE(7, DS_DISCHARGE_INV)
1198
13381199   MDRV_CPU_ADD("sound", I8035,I8035_CLOCK)
13391200   MDRV_CPU_PROGRAM_MAP(dkong_sound_map,0)
13401201   MDRV_CPU_IO_MAP(dkongjr_sound_io_map, 0)
13411202
1342   MDRV_SOUND_START(dkong)
1343   MDRV_SOUND_RESET(dkongjr)
1344
13451203   MDRV_SPEAKER_STANDARD_MONO("mono")
13461204
13471205   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
r3115r3116
13601218   MDRV_CPU_PROGRAM_MAP(dkong3_sound2_map, 0)
13611219   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
13621220
1221   /* sound latches */
1222   MDRV_LATCH8_ADD( "latch1")
1223   MDRV_LATCH8_ADD( "latch2")
1224   MDRV_LATCH8_ADD( "latch3")
1225
13631226   MDRV_SPEAKER_STANDARD_MONO("mono")
13641227   MDRV_SOUND_ADD("nes1", NES, N2A03_DEFAULTCLOCK)
13651228   MDRV_SOUND_CONFIG(nes_interface_1)
src/mame/audio/harddriv.c
r3115r3116
6767
6868static void update_68k_interrupts(running_machine *machine)
6969{
70   int irqline = 0;
71
72   if (mainflag) irqline = 1;
73   if (irq68k) irqline = 3;
74
75   if (irqline)
76      cpunum_set_input_line(machine, hdcpu_sound, irqline, ASSERT_LINE);
77   else
78      cpunum_set_input_line(machine, hdcpu_sound, 7, CLEAR_LINE);
70   cpunum_set_input_line(machine, hdcpu_sound, 1, mainflag ? ASSERT_LINE : CLEAR_LINE);
71   cpunum_set_input_line(machine, hdcpu_sound, 3, irq68k   ? ASSERT_LINE : CLEAR_LINE);
7972}
8073
8174
src/mame/audio/sprint4.c
r3115r3116
8383   DISC_555_OUT_DC | DISC_555_OUT_SQW,
8484   5,               // B+ voltage of 555
8585   DEFAULT_555_VALUES,
86   5,               // B+ voltage of the Constant Current source
8786   0.7               // Q1 junction voltage
8887};
8988
r3115r3116
191190   DISCRETE_COUNTER_7492(SPRINT4_PLAYER_MOTOR_NODE(4, _plr),   /* IC D9, pins 11,9,8 */            \
192191               1,                                 /* ENAB */                          \
193192               SPRINT4_ATTRACT_EN,                     /* RESET */                         \
194               SPRINT4_PLAYER_MOTOR_NODE(3, _plr))         /* CLK */                           \
193               SPRINT4_PLAYER_MOTOR_NODE(3, _plr),         /* CLK */                           \
194               DISC_CLK_ON_F_EDGE)                                                \
195195   DISCRETE_TRANSFORM3(SPRINT4_PLAYER_MOTOR_NODE(5, _plr),      /* IC B10, pin 3 */                 \
196196               1,                                 /* ENAB */                          \
197197               SPRINT4_PLAYER_MOTOR_NODE(4, _plr),         /* INP0 */                          \
src/mame/audio/firetrk.c
r3115r3116
110110   DISC_555_OUT_DC | DISC_555_OUT_SQW,
111111   5,      // B+ voltage of 555
112112   DEFAULT_555_VALUES,
113   5,      // B+ voltage of the Constant Current source
114113   0.7      // Q2 junction voltage
115114};
116115
r3115r3116
222221         RES_M(1), 0, 0,      // R28, no rGnd, no rDis
223222         &firetrk_motor_vco)
224223   DISCRETE_COUNTER_7492(NODE_23, 1, FIRETRUCK_ATTRACT_EN,   // IC A9, QB-QD
225         NODE_22)                           // from IC B9, pin 3
224         NODE_22, DISC_CLK_ON_F_EDGE)               // from IC B9, pin 3
226225   DISCRETE_TRANSFORM2(NODE_24, 1, NODE_23, 0x04, "01&")   // IC A9, pin 8
227226   DISCRETE_COUNTER(NODE_25, 1, FIRETRUCK_ATTRACT_EN,   // IC A9, pin 12
228227         NODE_24,                           // from IC A9, pin 8
r3115r3116
337336   DISC_555_OUT_DC | DISC_555_OUT_SQW,
338337   5,            // B+ voltage of 555
339338   DEFAULT_555_VALUES,
340   5,            // B+ voltage of the Constant Current source
341339   0.7            // Q1 junction voltage
342340};
343341
r3115r3116
426424         RES_M(3.3), 0, 0,   // R11, no rGnd, no rDis
427425         &superbug_motor_vco)
428426   DISCRETE_COUNTER_7492(NODE_23, 1, SUPERBUG_ATTRACT_EN,   // IC A7, QB-QD
429         NODE_22)                              // from IC A6, pin 3
430   DISCRETE_TRANSFORM2(NODE_24, 1, NODE_23, 0x04, "01&")      // IC A7, pin 8-QD
427         NODE_22, DISC_CLK_ON_F_EDGE)               // from IC A6, pin 3
428   DISCRETE_TRANSFORM2(NODE_24, 1, NODE_23, 0x04, "01&")   // IC A7, pin 8-QD
431429   DISCRETE_TRANSFORM2(NODE_25, 1, NODE_23, 0x01, "01&")   // IC A7, pin 11-QB
432430   DISCRETE_LOGIC_XOR(NODE_26, 1, NODE_24, NODE_25)   // Gate A9, pin 8
433431   DISCRETE_COUNTER(NODE_27, 1, SUPERBUG_ATTRACT_EN,   // IC A7, pin 12-QA
r3115r3116
498496   DISC_555_OUT_DC | DISC_555_OUT_SQW,
499497   5,      // B+ voltage of 555
500498   DEFAULT_555_VALUES,
501   5,      // B+ voltage of the Constant Current source
502499   0.7      // Q1 junction voltage
503500};
504501
r3115r3116
611608         RES_M(1), 0, 0,      // R86, no rGnd, no rDis
612609         &montecar_motor_vco)
613610   DISCRETE_COUNTER_7492(NODE_23, 1, MONTECAR_ATTRACT_EN,   // IC B/C9, QB-QD
614         NODE_22)                              // from IC C9, pin 9
611         NODE_22, DISC_CLK_ON_F_EDGE)                  // from IC C9, pin 9
615612   DISCRETE_TRANSFORM2(NODE_24, 1, NODE_23, 0x04, "01&")   // IC B/C9, pin 8-QD
616613   DISCRETE_TRANSFORM2(NODE_25, 1, NODE_23, 0x01, "01&")   // IC B/C9, pin 11-QB
617614   DISCRETE_LOGIC_XOR(NODE_26, 1, NODE_24, NODE_25)   // Gate A9, pin 11
r3115r3116
646643         RES_M(1), 0, 0,      // R81, no rGnd, no rDis
647644         &montecar_motor_vco)
648645   DISCRETE_COUNTER_7492(NODE_43, 1, MONTECAR_ATTRACT_EN,   // IC A/B9, QB-QD
649         NODE_42)                              // from IC C9, pin 5
646         NODE_42, DISC_CLK_ON_F_EDGE)               // from IC C9, pin 5
650647   DISCRETE_TRANSFORM2(NODE_44, 1, NODE_43, 0x04, "01&")   // IC A/B9, pin 8-QD
651648   DISCRETE_TRANSFORM2(NODE_45, 1, NODE_43, 0x01, "01&")   // IC A/B9, pin 11-QB
652649   DISCRETE_LOGIC_XOR(NODE_46, 1, NODE_44, NODE_45)   // Gate A9, pin 6
src/mame/audio/namcoc7x.c
r3115r3116
4949   COMBINE_DATA(&su_82);
5050}
5151
52WRITE16_HANDLER(namcoc7x_soundram16_w)
53{
54   COMBINE_DATA(namcoc7x_mcuram+offset);
55}
56
57READ16_HANDLER(namcoc7x_soundram16_r)
58{
59   return namcoc7x_mcuram[offset];
60}
61
62WRITE32_HANDLER(namcoc7x_soundram32_w)
63{
64   namcoc7x_soundram16_w(machine, offset*2, data >> 16, mem_mask >> 16);
65   namcoc7x_soundram16_w(machine, offset*2+1, data, mem_mask);
66}
67
68READ32_HANDLER(namcoc7x_soundram32_r)
69{
70   return (namcoc7x_soundram16_r(machine, offset*2, mem_mask >> 16) << 16) |
71      namcoc7x_soundram16_r(machine, offset*2+1, mem_mask);
72}
73
5274void namcoc7x_sound_write16(UINT16 command, UINT32 offset)
5375{
5476   namcoc7x_mcuram[offset] = command;
r3115r3116
5678
5779void namcoc7x_on_driver_init(running_machine *machine)
5880{
59   UINT8 *pROM = (UINT8 *)memory_region(machine, "user4");
81   UINT8 *pROM = (UINT8 *)memory_region(machine, "c7x");
6082   int cpunum;
6183
62   // clear the first page of the data ROM
84   // clear the two 16-bits magic values at the start of the rom
6385   // (prevents external init routines from getting called - they assume a
64   //  RAM layout for a different BIOS and crash ours)
65   memset(pROM, 0xff, 0x100);
86   //  ROM layout for a different BIOS and crash ours)
87   memset(pROM, 0, 4);
6688
6789   // install speedup cheat
6890   for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
r3115r3116
105127ADDRESS_MAP_START( namcoc7x_mcu_map, ADDRESS_SPACE_PROGRAM, 16 )
106128   AM_RANGE(0x002000, 0x002fff) AM_READWRITE( c352_0_r, c352_0_w )
107129   AM_RANGE(0x004000, 0x00bfff) AM_RAM AM_BASE(&namcoc7x_mcuram)
108   AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_REGION("user4", 0x8c000)
109   AM_RANGE(0x080000, 0x0fffff) AM_ROM AM_REGION("user4", 0)
110   AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("user4", 0)
111   AM_RANGE(0x280000, 0x2fffff) AM_ROM AM_REGION("user4", 0)
130   AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_REGION("c7x", 0x8c000)
131   AM_RANGE(0x080000, 0x0fffff) AM_ROM AM_REGION("c7x", 0)
132   AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("c7x", 0)
133   AM_RANGE(0x280000, 0x2fffff) AM_ROM AM_REGION("c7x", 0)
112134   AM_RANGE(0x301000, 0x301001) AM_NOP   // watchdog? LEDs?
113135   AM_RANGE(0x308000, 0x308003) AM_NOP   // volume control IC?
114136ADDRESS_MAP_END
r3115r3116
116138ADDRESS_MAP_START( namcoc7x_mcu_share_map, ADDRESS_SPACE_PROGRAM, 16 )
117139   AM_RANGE(0x002000, 0x002fff) AM_READWRITE( c352_0_r, c352_0_w )
118140   AM_RANGE(0x004000, 0x00bfff) AM_READWRITE( c7x_shared_r, c7x_shared_w ) AM_BASE(&namcoc7x_mcuram)
119   AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_REGION("user4", 0x8c000)
120   AM_RANGE(0x080000, 0x0fffff) AM_ROM AM_REGION("user4", 0)
121   AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("user4", 0)
122   AM_RANGE(0x280000, 0x2fffff) AM_ROM AM_REGION("user4", 0)
141   AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_REGION("c7x", 0x8c000)
142   AM_RANGE(0x080000, 0x0fffff) AM_ROM AM_REGION("c7x", 0)
143   AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("c7x", 0)
144   AM_RANGE(0x280000, 0x2fffff) AM_ROM AM_REGION("c7x", 0)
123145   AM_RANGE(0x301000, 0x301001) AM_NOP   // watchdog? LEDs?
124146   AM_RANGE(0x308000, 0x308003) AM_NOP   // volume control IC?
125147ADDRESS_MAP_END
src/mame/audio/segag80r.c
r3115r3116
1010#include "driver.h"
1111#include "deprecat.h"
1212#include "streams.h"
13#include "cpu/i8039/i8039.h"
13#include "cpu/mcs48/mcs48.h"
1414#include "segag80r.h"
1515#include "machine/8255ppi.h"
1616#include "sound/samples.h"
r3115r3116
799799 *
800800 *************************************/
801801
802static ADDRESS_MAP_START( monsterb_7751_map, ADDRESS_SPACE_PROGRAM, 8 )
803   AM_RANGE(0x0000, 0x03ff) AM_ROM
804ADDRESS_MAP_END
805
806802static ADDRESS_MAP_START( monsterb_7751_portmap, ADDRESS_SPACE_IO, 8 )
807   AM_RANGE(I8039_t1, I8039_t1) AM_READ(n7751_t1_r)
808   AM_RANGE(I8039_p2, I8039_p2) AM_READ(n7751_command_r)
809   AM_RANGE(I8039_bus, I8039_bus) AM_READ(n7751_rom_r)
810   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(dac_0_data_w)
811   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(n7751_busy_w)
812   AM_RANGE(I8039_p4, I8039_p6) AM_WRITE(n7751_rom_offset_w)
813   AM_RANGE(I8039_p7, I8039_p7) AM_WRITE(n7751_rom_select_w)
803   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(n7751_t1_r)
804   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(n7751_command_r)
805   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(n7751_rom_r)
806   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(dac_0_data_w)
807   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(n7751_busy_w)
808   AM_RANGE(MCS48_PORT_P4, MCS48_PORT_P6) AM_WRITE(n7751_rom_offset_w)
809   AM_RANGE(MCS48_PORT_P7, MCS48_PORT_P7) AM_WRITE(n7751_rom_select_w)
814810ADDRESS_MAP_END
815811
816812
r3115r3116
839835
840836   /* basic machine hardware */
841837   MDRV_CPU_ADD("audio", N7751, 6000000)
842   MDRV_CPU_PROGRAM_MAP(monsterb_7751_map,0)
843838   MDRV_CPU_IO_MAP(monsterb_7751_portmap,0)
844839
845840   /* sound hardware */
src/mame/audio/namcoc7x.h
r3115r3116
1919
2020INTERRUPT_GEN( namcoc7x_interrupt );
2121
22WRITE16_HANDLER(namcoc7x_soundram16_w);
23READ16_HANDLER(namcoc7x_soundram16_r);
24WRITE32_HANDLER(namcoc7x_soundram32_w);
25READ32_HANDLER(namcoc7x_soundram32_r);
26
2227void namcoc7x_sound_write16(UINT16 command, UINT32 offset);
2328void namcoc7x_on_driver_init(running_machine *machine);
2429void namcoc7x_set_host_ram(UINT32 *hostram);
src/mame/audio/triplhnt.c
r3115r3116
7777   DISC_555_OUT_DC | DISC_555_OUT_SQW,
7878   5,      // B+ voltage of 555
7979   DEFAULT_555_VALUES,
80   5,      // B+ voltage of the Constant Current source
8180   0.7      // Q2 junction voltage
8281};
8382
src/mame/audio/starshp1.c
r0r3116
1/************************************************************************
2 * starshp1 Sound System Analog emulation
3 * Aug 2008, Derrick Renaud
4 ************************************************************************/
5
6#include "driver.h"
7#include "starshp1.h"
8#include "sound/discrete.h"
9
10
11/* voltage out for each 1/256 step of MC1408 circuit */
12#define MC1408_DAC(v_ref, r, rf)      ((double)v_ref / (double)r * (double)rf / 256.0)
13
14#define OP_AMP_NON_INVERT_GAIN(ri, rf)   ((double)rf / (double)ri + 1)
15
16/*  vin --/\r1/\-- out --/\r2/\-- gnd  */
17#define RES_VOLTAGE_DIVIDER(r1, r2)   ((double)r2 / ((double)r1 + (double)r2))
18
19#define RES_2_PARALLEL(r1, r2)         (1.0 / (1.0 / r1 + 1.0 / r2))
20
21/* Discrete Sound Input Nodes */
22/* see "starshp1.h" */
23
24/* Nodes - Sounds */
25#define STARSHP1_PHASOR_SND      NODE_13
26#define STARSHP1_NOISE_SND      NODE_14
27#define STARSHP1_MOTOR_SND      NODE_15
28#define STARSHP1_SL1_SND      NODE_16
29#define STARSHP1_SL2_SND      NODE_17
30
31/* Timing signals */
32#define STARSHP1_HSYNC   15750   /* per manual */
33#define STARSHP1_S1V   STARSHP1_HSYNC / 2
34#define STARSHP1_S128V   STARSHP1_S1V / 128
35
36/* R/C values */
37#define STARSHP1_R4      RES_K(1)
38#define STARSHP1_R54   RES_K(47)
39#define STARSHP1_R55   RES_K(22)
40#define STARSHP1_R58   RES_K(1)
41#define STARSHP1_R59   RES_K(1)
42#define STARSHP1_R60   RES_K(6.8)
43#define STARSHP1_R61   RES_K(10)
44#define STARSHP1_R62   750
45#define STARSHP1_R63   RES_K(22)
46#define STARSHP1_R64   RES_K(10)
47#define STARSHP1_R65   RES_K(3.3)
48#define STARSHP1_R66   RES_K(33)
49#define STARSHP1_R67   RES_K(1)
50#define STARSHP1_R68   RES_K(3.3)
51#define STARSHP1_R69   RES_K(330)
52#define STARSHP1_R70   RES_K(10)
53#define STARSHP1_R71   RES_K(6.8)
54#define STARSHP1_R72   RES_K(47)
55#define STARSHP1_R74   RES_K(100)
56#define STARSHP1_R75   RES_K(47)
57#define STARSHP1_R76   RES_K(5)
58#define STARSHP1_R123   RES_K(1)
59#define STARSHP1_R124   RES_K(1)
60#define STARSHP1_R126   RES_K(1)
61#define STARSHP1_R151   RES_K(10)
62#define STARSHP1_R152   RES_K(1.5)
63#define STARSHP1_C34   CAP_U(0.1)
64#define STARSHP1_C36   CAP_U(2.2)
65#define STARSHP1_C45   CAP_U(0.1)
66#define STARSHP1_C46   CAP_U(0.1)
67#define STARSHP1_C47   CAP_U(0.015)
68#define STARSHP1_C59   CAP_U(0.22)
69#define STARSHP1_C61   CAP_U(0.01)
70#define STARSHP1_C63   CAP_U(0.1)
71#define STARSHP1_C78   CAP_U(0.1)
72
73/* Convert DAC value to voltage out at IC E10, pin 4 */
74#define STARSHP1_MC1408_GAIN        MC1408_DAC(5.0, STARSHP1_R4, STARSHP1_R62)
75/* Gain at IC E10, pin 12 */
76#define STARSHP1_TONE_PITCH_GAIN   OP_AMP_NON_INVERT_GAIN(STARSHP1_R63, STARSHP1_R64)
77
78#define STARSHP1_NOISE_AMPLITUDE_GAIN   RES_VOLTAGE_DIVIDER(STARSHP1_R124, STARSHP1_R123)
79
80/* tweak to apply compensation filter at pin 6 */
81#define STARSHP1_FAKE_MC3340_COMPENSATION_R      RES_K(6.2)
82
83/* Discrete info structures */
84
85static const discrete_lfsr_desc starshp1_lfsr={
86   DISC_CLK_IS_FREQ,
87   16,               /* Bit Length */
88   0,               /* Reset Value */
89   13,               /* Use Bit 0 as XOR input 0 */
90   14,               /* Use Bit 14 as XOR input 1 */
91   DISC_LFSR_XNOR,      /* Feedback stage1 is XNOR */
92   DISC_LFSR_OR,      /* Feedback stage2 is just stage 1 output OR with external feed */
93   DISC_LFSR_REPLACE,   /* Feedback stage3 replaces the shifted register contents */
94   0x000001,         /* Everything is shifted into the first bit only */
95   0,               /* Output is not inverted */
96   15               /* Output bit */
97};
98
99static const discrete_555_desc starshp1_556_c10 =
100{
101   DISC_555_OUT_ENERGY,
102   5,      /* B+ voltage of 555 */
103   DEFAULT_555_VALUES
104};
105
106/* effect of 556 internal CV resistors at pin 3 */
107static const discrete_mixer_desc starshp1_556_c10_cv =
108{
109   DISC_MIXER_IS_RESISTOR,
110   {STARSHP1_R61, RES_K(5)},
111   {0}, {0}, 0, RES_K(10), 0, 0, 0, 1
112};
113
114static const discrete_mixer_desc starshp1_566_a9_mix_r =
115{
116   DISC_MIXER_IS_RESISTOR,
117   {STARSHP1_R54, STARSHP1_R55},
118   {0}, {0}, 0, 0, 0, 0, 0, 1
119};
120
121static const discrete_566_desc starshp1_566_a9 =
122{
123   DISC_566_OUT_TRIANGLE,
124   5,         /* B+ */
125   -10,      /* B- */
126   NODE_41      /* charge voltage */
127};
128
129static const discrete_mixer_desc starshp1_555_b10_mix_r =
130{
131   DISC_MIXER_IS_RESISTOR,
132   {STARSHP1_R65, STARSHP1_R68},
133   {0}, {0}, 0, 0, 0, 0, 0, 1
134};
135
136static const discrete_555_desc starshp1_555_b10 =
137{
138   DISC_555_OUT_ENERGY,
139   5,                  /* B+ voltage of 555 */
140   NODE_50,            /* charge voltage */
141   DEFAULT_TTL_V_LOGIC_1   /* cheat and use and anti-alias IC A10 level */
142};
143
144static const discrete_mixer_desc starshp1_final_mix =
145{
146   DISC_MIXER_IS_RESISTOR,
147   {STARSHP1_R66, STARSHP1_R126, STARSHP1_R59 + STARSHP1_R60, STARSHP1_R74, STARSHP1_R75},
148   {0},   /* no resistor nodes */
149   {0, STARSHP1_C78, STARSHP1_C36, 0, 0},
150   0,
151   STARSHP1_R76,
152   0,      /* no cF */
153   STARSHP1_C63,
154   0,      /* vRef */
155   1      /* gain */
156};
157
158
159DISCRETE_SOUND_START( starshp1 )
160   /************************************************
161     * Input register mapping
162     ************************************************/
163//  DISCRETE_INPUTX_DATA(STARSHP1_NOISE_AMPLITUDE, STARSHP1_MC1408_GAIN * STARSHP1_NOISE_AMPLITUDE_GAIN, 0, 0)
164   /* Fake the MC1408, no where near correct */
165   DISCRETE_INPUTX_DATA(STARSHP1_NOISE_AMPLITUDE, -4.0/255, 4, 0)
166   DISCRETE_INPUTX_DATA(STARSHP1_TONE_PITCH,      STARSHP1_MC1408_GAIN * STARSHP1_TONE_PITCH_GAIN, 0, 0)
167   DISCRETE_INPUTX_DATA(STARSHP1_MOTOR_SPEED,     STARSHP1_MC1408_GAIN, 0, 0)
168   DISCRETE_INPUT_LOGIC(STARSHP1_NOISE_FREQ)
169   DISCRETE_INPUT_LOGIC(STARSHP1_SL2)
170   DISCRETE_INPUT_LOGIC(STARSHP1_SL1)
171   DISCRETE_INPUT_LOGIC(STARSHP1_KICKER)
172   DISCRETE_INPUT_LOGIC(STARSHP1_PHASOR_ON)
173   DISCRETE_INPUT_NOT  (STARSHP1_ATTRACT)      /* Inverted by Q9 */
174   /* when MOLVL is high, R58 is grounded, reducing the gain by 50% */
175   /* we will cheat and calculate that now */
176#define STARSHP1_MOLVL_GAIN         STARSHP1_MOLVL
177#define STARSHP1_MOLVL_GAIN_VAL      RES_VOLTAGE_DIVIDER(STARSHP1_R59, STARSHP1_R58)
178   DISCRETE_INPUTX_LOGIC(STARSHP1_MOLVL_GAIN, -STARSHP1_MOLVL_GAIN_VAL, STARSHP1_MOLVL_GAIN_VAL, 1)
179
180   /************************************************
181     * Noise
182     ************************************************/
183    DISCRETE_LFSR_NOISE(NODE_20,               /* IC B9, pin 13 */
184                  1,                     /* ENAB */
185                  STARSHP1_KICKER,         /* IC B9 & C9, pin 9 */
186                  STARSHP1_S1V,            /* IC B9 & C9, pin 8 */
187                  1,                     /* 1 p/p */
188                  0,                     /* no feed */
189                  1.0 / 2,               /* shift to 0/1 */
190                  &starshp1_lfsr)
191   /* calculate noise level */
192   DISCRETE_SWITCH(   NODE_21,               /* voltage at R151 & R152 junction */
193                  NODE_20,
194                  STARSHP1_NOISE_FREQ,
195                  DEFAULT_TTL_V_LOGIC_1 * RES_VOLTAGE_DIVIDER(STARSHP1_R151, STARSHP1_R152),
196                  DEFAULT_TTL_V_LOGIC_1)
197   /* fake MC3340 */
198   DISCRETE_MULTIPLY(   NODE_22,
199                  1,                     /* ENAB */
200                  NODE_21,
201                  STARSHP1_NOISE_AMPLITUDE)
202   DISCRETE_RCFILTER(   NODE_23,
203                  1,                     /* ENAB */
204                  NODE_22,
205                  STARSHP1_FAKE_MC3340_COMPENSATION_R,
206                  STARSHP1_C61)
207   /* when NOISE_FREQ is high (NOISE_FREQ_INV is low), C59 is in circuit */
208   DISCRETE_RCFILTER(   NODE_24,
209                  1,                     /* ENAB */
210                  NODE_22,
211                  STARSHP1_FAKE_MC3340_COMPENSATION_R,
212                  STARSHP1_C61 + STARSHP1_C59)
213   DISCRETE_SWITCH(   STARSHP1_NOISE_SND,
214                  1,                     /* ENAB */
215                  STARSHP1_NOISE_FREQ,
216                  NODE_23,
217                  NODE_24)
218
219   /************************************************
220     * Phasor
221     ************************************************/
222   DISCRETE_555_ASTABLE(NODE_30,               /* IC C10, pin 9 */
223                  STARSHP1_PHASOR_ON,         /* RESET */
224                  STARSHP1_R70,
225                  STARSHP1_R69,
226                  STARSHP1_C46,
227                  &starshp1_556_c10)
228   /* compensate for internal 555 CV resistors */
229   DISCRETE_MIXER2(   NODE_31,
230                  1,                     /* ENAB */
231                  NODE_30,               /* IC C10, pin 9 */
232                  5,                     /* 555 B+ */
233                  &starshp1_556_c10_cv)
234   DISCRETE_555_ASTABLE_CV(STARSHP1_PHASOR_SND,   /* IC C10, pin 5 */
235                  STARSHP1_PHASOR_ON,         /* RESET */
236                  STARSHP1_R68,
237                  STARSHP1_R67,
238                  STARSHP1_C45,
239                  NODE_31,               /* IC C10, pin 3 */
240                  &starshp1_556_c10)
241
242   /************************************************
243     * Motor
244     ************************************************/
245   DISCRETE_SQUAREWFIX(NODE_40,               /* S128V signal */
246                  1,                     /* ENAB */
247                  STARSHP1_S128V,
248                  DEFAULT_TTL_V_LOGIC_1,
249                  50,                     /* DUTY */
250                  DEFAULT_TTL_V_LOGIC_1 / 2,   /* BIAS */
251                  0)                     /* PHASE */
252   DISCRETE_MIXER2(   NODE_41,               /* voltage at R54 & R55 junction */
253                  1,                     /* ENAB */
254                  NODE_40,               /* IC E10, pin 12 */
255                  5,                     /* 5V to R55 */
256                  &starshp1_566_a9_mix_r)
257   DISCRETE_566(      NODE_42,               /* IC A9, pin 4 */
258                  1,                     /* ENAB */
259                  STARSHP1_MOTOR_SPEED,      /* IC A9, pin 5 */
260                  RES_2_PARALLEL(STARSHP1_R54, STARSHP1_R55),
261                  STARSHP1_C34,
262                  &starshp1_566_a9)
263   DISCRETE_MULTIPLY(   STARSHP1_MOTOR_SND,
264                  1,                     /* ENAB */
265                  NODE_42,
266                  STARSHP1_MOLVL_GAIN)
267
268   /************************************************
269     * SL1, SL2
270     ************************************************/
271   DISCRETE_MIXER2(   NODE_50,               /* voltage at R65 & R71 junction */
272                  1,                     /* ENAB */
273                  STARSHP1_TONE_PITCH,      /* IC E10, pin 12 */
274                  10,                     /* 10V to R71 */
275                  &starshp1_555_b10_mix_r)
276   DISCRETE_555_ASTABLE(NODE_51,               /* IC B10, pin 3 */
277                  1,                     /* RESET */
278                  RES_2_PARALLEL(STARSHP1_R65, STARSHP1_R71),
279                  STARSHP1_R72,
280                  STARSHP1_C47,
281                  &starshp1_555_b10)
282   /* use switch instead of logic AND, so we can switch between
283     * 0V and the anti-aliased TTL level out that we set NODE_51 to. */
284   DISCRETE_SWITCH(   STARSHP1_SL1_SND,         /* IC A10, pin 11 */
285                  1,                     /* ENAB */
286                  STARSHP1_SL1,
287                  0,
288                  NODE_51)
289   DISCRETE_SWITCH(   STARSHP1_SL2_SND,         /* IC A10, pin 8 */
290                  1,                     /* ENAB */
291                  STARSHP1_SL2,
292                  0,
293                  NODE_51)
294
295   /************************************************
296     * Mixing and output
297     ************************************************/
298   DISCRETE_MIXER5(   NODE_90,
299                  STARSHP1_ATTRACT,         /* ENAB */
300                  STARSHP1_PHASOR_SND,
301                  STARSHP1_NOISE_SND,
302                  STARSHP1_MOTOR_SND,
303                  STARSHP1_SL1_SND,
304                  STARSHP1_SL2_SND,
305                  &starshp1_final_mix)
306
307   /* set a gain that clips the noise some, just like the real board */
308   DISCRETE_OUTPUT(NODE_90, 110000)
309
310DISCRETE_SOUND_END
src/mame/audio/mario.c
r3115r3116
11#include "driver.h"
2#include "cpu/i8039/i8039.h"
2#include "cpu/mcs48/mcs48.h"
33#include "sound/dac.h"
44#include "sound/ay8910.h"
55#include "sound/discrete.h"
r3115r3116
2323#define I8035_P1_R(M) (soundlatch3_r(M,0))
2424#define I8035_P2_R(M) (soundlatch4_r(M,0))
2525#define I8035_P1_W(M,D) soundlatch3_w(M,0,D)
26#define I8035_P2_W(M,D) soundlatch4_w(M,0,D)
26#define I8035_P2_W(M,D) do { soundlatch4_w(M,0,D); cputag_set_input_line(machine, "audio", MCS48_INPUT_EA, ((D) & 0x20) ? ASSERT_LINE : CLEAR_LINE); } while (0)
2727
28
2829#define I8035_P1_W_AH(M,B,D) I8035_P1_W(M,ACTIVEHIGH_PORT_BIT(I8035_P1_R(M),B,(D)))
2930#define I8035_P2_W_AH(M,B,D) I8035_P2_W(M,ACTIVEHIGH_PORT_BIT(I8035_P2_R(M),B,(D)))
3031
r3115r3116
286287   return I8035_T_R(machine,1);
287288}
288289
289static READ8_HANDLER( mario_sh_ea_r )
290{
291#if USE_8039
292   return 1;
293#else
294   int p2 = (I8035_P2_R(machine) >> 5) & 1;
295   return p2 ^ 1;
296#endif
297}
298
299290static READ8_HANDLER( mario_sh_tune_r )
300291{
301292   UINT8 *SND = memory_region(machine, "audio");
r3115r3116
336327   if (state->last == 1 && data == 0)
337328   {
338329      /* setting bit 0 high then low triggers IRQ on the sound CPU */
339      cpunum_set_input_line_and_vector(machine, 1,0,HOLD_LINE,0xff);
330      cputag_set_input_line_and_vector(machine, "audio",0,HOLD_LINE,0xff);
340331   }
341332
342333   state->last = data;
r3115r3116
368359   {
369360      case 0: /* death */
370361         if (data)
371            cpunum_set_input_line(machine, 1,0,ASSERT_LINE);
362            cputag_set_input_line(machine, "audio",0,ASSERT_LINE);
372363         else
373            cpunum_set_input_line(machine, 1,0,CLEAR_LINE);
364            cputag_set_input_line(machine, "audio",0,CLEAR_LINE);
374365         break;
375366      case 1: /* get coin */
376367         I8035_T_W_AH(machine,0,data & 1);
r3115r3116
408399
409400static ADDRESS_MAP_START( mario_sound_io_map, ADDRESS_SPACE_IO, 8 )
410401   AM_RANGE(0x00, 0xff) AM_READWRITE(mario_sh_tune_r, mario_sh_sound_w)
411   AM_RANGE(I8039_p1, I8039_p1) AM_READWRITE(mario_sh_p1_r, mario_sh_p1_w)
412   AM_RANGE(I8039_p2, I8039_p2) AM_READWRITE(mario_sh_p2_r, mario_sh_p2_w)
413   AM_RANGE(I8039_t0, I8039_t0) AM_READ(mario_sh_t0_r)
414   AM_RANGE(I8039_t1, I8039_t1) AM_READ(mario_sh_t1_r)
415   AM_RANGE(I8039_ea, I8039_ea) AM_READ(mario_sh_ea_r)   /* only for documentation purposes right now */
402   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(mario_sh_p1_r, mario_sh_p1_w)
403   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(mario_sh_p2_r, mario_sh_p2_w)
404   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(mario_sh_t0_r)
405   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(mario_sh_t1_r)
416406ADDRESS_MAP_END
417407
418408static ADDRESS_MAP_START( masao_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/audio/tank8.c
r3115r3116
6565
6666static const discrete_555_desc tank8_555_m =
6767{
68   DISC_555_TRIGGER_IS_VOLTAGE | DISC_555_OUT_SQW | DISC_555_OUT_DC,
68   DISC_555_OUT_SQW | DISC_555_OUT_DC | DISC_555_TRIGGER_IS_VOLTAGE,
6969   5,      // B+ voltage of 555
7070   DEFAULT_555_VALUES
7171};
src/mame/audio/mw8080bw.c
r3115r3116
31513151static const discrete_555_desc invaders_thump_555 =
31523152{
31533153   DISC_555_OUT_ENERGY | DISC_555_OUT_DC,
3154   5,
31543155   5.0 - 0.6,            /* 5V - diode drop */
3155   DEFAULT_TTL_V_LOGIC_1,   /* Output of F3 7411 buffer */
3156   DEFAULT_555_THRESHOLD,
3157   DEFAULT_555_TRIGGER
3156   DEFAULT_TTL_V_LOGIC_1   /* Output of F3 7411 buffer */
31583157};
31593158
31603159
r3115r3116
37083707{
37093708   DISC_555_OUT_ENERGY | DISC_555_OUT_DC,
37103709   5,            /* B+ voltage of 555 */
3711   12,            /* the OC buffer H2 converts the output voltage to 12V. */
3712   DEFAULT_555_THRESHOLD, DEFAULT_555_TRIGGER
3710   DEFAULT_555_CHARGE,
3711   12            /* the OC buffer H2 converts the output voltage to 12V. */
37133712};
37143713
37153714
src/mame/machine/fd1089.c
r3115r3116
124124#include "fd1089.h"
125125
126126
127/* 317-0013A FD1089B */
128static const UINT8 key_0013A[0x2000] =
129{
130   /* opcodes */
131   0x69,0xec,0x94,0xf1,0xd8,0x7b,0x71,0xcd,0x2b,0xbd,0x62,0xaf,0x04,0x97,0x8c,0xfb,
132   0x07,0xed,0x12,0x14,0xd9,0xa2,0x19,0x5e,0x1e,0x9b,0xc4,0x3e,0x79,0xbc,0x38,0x18,
133   0x8f,0xe8,0x99,0x4f,0x03,0x03,0x0a,0x48,0x7a,0xf2,0xaf,0x67,0x97,0x99,0xae,0x0f,
134   0x89,0xcb,0x70,0x66,0x75,0xb8,0x98,0xeb,0xd4,0x0c,0x2b,0x99,0xba,0x0f,0xc6,0x7f,
135   0xcd,0x1a,0x95,0xc0,0x3f,0x94,0x54,0x8a,0xd7,0xf7,0x51,0x20,0xe8,0xcb,0x67,0xd1,
136   0xff,0xdb,0x28,0xa4,0x56,0x9d,0x44,0x8b,0x3f,0xc3,0x24,0x28,0x5e,0x2f,0xec,0xde,
137   0x59,0xc8,0xc1,0x12,0xd1,0x70,0xc7,0x27,0x6d,0x0c,0x21,0x82,0xcf,0x7f,0xf3,0x86,
138   0x9b,0xae,0x63,0x98,0x76,0x7c,0x92,0x1c,0x04,0xce,0xa7,0x75,0xe8,0x87,0xc4,0x08,
139   0xc7,0x8c,0x0d,0x38,0x44,0xc1,0xa7,0x6a,0x04,0x09,0xb6,0x01,0xaa,0x48,0x5d,0x62,
140   0xdb,0x64,0xc1,0xf1,0x3b,0x3f,0x05,0x11,0x6d,0xbd,0x4e,0x27,0x16,0xc3,0xc0,0x96,
141   0xd9,0x34,0x7e,0xc3,0x5b,0xf5,0xac,0x11,0x3f,0xea,0x6f,0xe5,0x2a,0xf6,0xeb,0xa2,
142   0xbf,0xfe,0x43,0xad,0xa3,0xe5,0x9c,0x6a,0x7a,0x90,0x19,0x3c,0xe7,0xe3,0xdf,0x88,
143   0x8f,0xc1,0x12,0xb1,0x15,0x0e,0xd5,0x1c,0x1e,0xaf,0x4d,0x2c,0x4d,0x88,0x9d,0x46,
144   0x47,0x7c,0xea,0xce,0xb0,0x70,0x57,0x27,0x2b,0x47,0x09,0xb6,0x5d,0xe6,0x23,0xde,
145   0xe9,0x31,0xca,0x04,0x74,0x0b,0x22,0x8b,0xa1,0x58,0x4e,0xd8,0x15,0xfe,0x73,0x4e,
146   0x73,0xde,0xb4,0x52,0x60,0xdf,0x36,0x48,0x80,0xe2,0x1c,0x93,0x76,0xce,0x8b,0x98,
147   0x56,0xa9,0x04,0xfd,0x97,0x38,0x23,0x16,0xb0,0x32,0x51,0x9b,0x33,0x60,0xab,0x1e,
148   0x46,0x98,0xdd,0x3f,0x9e,0xc5,0x23,0xae,0x7f,0xde,0x4b,0x2b,0xbd,0xec,0xb0,0x88,
149   0xbd,0x08,0xa5,0x73,0x5a,0x76,0x72,0x64,0x1a,0x5f,0xef,0xa5,0x91,0x98,0x2e,0xd9,
150   0x18,0x4e,0x4f,0x36,0x17,0x3b,0x82,0x80,0x06,0xae,0x08,0x0b,0x6e,0x83,0x31,0xbc,
151   0xe8,0x25,0x5e,0x07,0x1c,0x93,0xff,0xf1,0xc2,0x57,0x94,0x0f,0xa4,0x8f,0xaf,0x85,
152   0x98,0xe7,0xf0,0x07,0x89,0x9c,0x07,0xda,0x6f,0x7a,0xb5,0xd2,0x51,0xde,0xca,0x54,
153   0x49,0xb4,0x27,0x55,0x7f,0x78,0xbc,0x58,0x2c,0x38,0x8a,0x73,0x97,0x8f,0xa1,0x49,
154   0x1a,0xaa,0x22,0x11,0x1d,0x46,0x3e,0x8d,0x19,0xaf,0x34,0x12,0x95,0xc2,0x55,0x85,
155   0x2b,0xeb,0x02,0x5b,0x83,0x26,0xab,0x97,0x56,0x01,0xd1,0xcf,0x6c,0x97,0x05,0x27,
156   0x9d,0x96,0xe6,0x53,0xd2,0x39,0x25,0x99,0x04,0x4d,0x83,0xcb,0x3a,0x2f,0xd0,0x4f,
157   0x8e,0xcb,0xee,0x1a,0x29,0x9e,0xcb,0xb0,0x41,0xb4,0x69,0x25,0x21,0xa9,0xd9,0x1e,
158   0x20,0xab,0x3a,0xcf,0xa8,0x75,0xbd,0xfe,0x2f,0x54,0xa4,0xfd,0x25,0x3d,0xb3,0x73,
159   0x54,0xea,0x93,0x6f,0xde,0x1c,0xa1,0xee,0x4f,0x52,0x74,0xb8,0xc4,0x1e,0x2e,0xa5,
160   0xe8,0x1f,0x84,0x9e,0xfa,0x07,0xbb,0x9c,0xc4,0x95,0xa8,0xa7,0xa4,0x9b,0xaf,0xd8,
161   0x87,0xf8,0xc4,0x56,0xe8,0x9e,0x6c,0x5b,0xd4,0x8c,0xbb,0x2f,0xe7,0xd4,0x56,0x2b,
162   0x4f,0x95,0x72,0xb6,0xc8,0x01,0xd2,0x4a,0x9d,0x57,0xcc,0x6f,0xad,0xe9,0x44,0xbe,
163   0xe7,0x85,0xa7,0xba,0x76,0xeb,0x93,0x5e,0xc8,0xe6,0x73,0xe7,0x81,0x57,0x6c,0xba,
164   0x44,0x25,0xa2,0x3b,0xb5,0x31,0x39,0xcd,0x79,0x62,0x53,0xd4,0x34,0x9a,0x17,0xb6,
165   0x89,0xbd,0xa7,0xd4,0x1d,0xb0,0x27,0x95,0x93,0x57,0xbd,0x5b,0x90,0x95,0x8a,0x8a,
166   0xb8,0x4f,0xb5,0x87,0xae,0x68,0x5f,0xb6,0x16,0xc5,0xaf,0x7a,0x95,0x49,0xc7,0x38,
167   0xcf,0xd9,0xcb,0x53,0x67,0x59,0xe0,0x30,0x02,0xac,0xfb,0xdc,0x3c,0x36,0x35,0x87,
168   0xe7,0x16,0x63,0x3d,0xc8,0x64,0x47,0x04,0x21,0xa4,0xa6,0xde,0x37,0x5a,0x44,0xd1,
169   0x4e,0x0b,0xe6,0xe0,0xab,0x39,0x4e,0x0f,0x90,0x69,0x42,0x62,0x43,0x20,0x84,0xdc,
170   0x06,0xe0,0xda,0x83,0x1f,0x2f,0x06,0x5b,0xd1,0x8f,0xce,0x66,0x5f,0x86,0xf5,0xa9,
171   0x0f,0x97,0x3f,0x28,0x24,0x45,0x70,0xe7,0xe2,0x16,0x4c,0xeb,0x8d,0x8d,0x97,0x36,
172   0x69,0x2e,0x15,0xce,0xba,0x7d,0x8a,0xb5,0xc5,0xfe,0xba,0xf1,0xcc,0x35,0x6a,0x85,
173   0x14,0xa7,0x5c,0x74,0xe2,0xd6,0x55,0xc4,0x78,0x47,0x1a,0x78,0x1b,0x7f,0x6d,0x94,
174   0x10,0x00,0x14,0x1c,0x9a,0x50,0xd2,0x14,0xfc,0xf1,0x6a,0x80,0x7c,0x69,0xa2,0x64,
175   0x5d,0x3b,0x3d,0xc5,0xe3,0xeb,0xff,0xa5,0x52,0xfc,0xac,0x09,0xee,0xf4,0x08,0xf6,
176   0xfb,0x56,0xd7,0x6e,0xbd,0xa6,0xdd,0x77,0x78,0x68,0xdf,0x13,0x71,0x21,0x9f,0x48,
177   0xea,0x53,0xe2,0x19,0x28,0x83,0x6d,0x8a,0x70,0x35,0x02,0x9f,0x04,0xee,0x67,0x5b,
178   0x2a,0x30,0x5e,0xc4,0x24,0x81,0xad,0xde,0x38,0x63,0x17,0xab,0xa9,0x5c,0x5f,0x30,
179   0xbb,0xef,0x4b,0x71,0xb2,0xa0,0x9e,0x72,0xd2,0xf2,0x1c,0x38,0x5f,0x6b,0x89,0xc5,
180   0x9d,0x8e,0xa9,0x1f,0xd0,0xdf,0x41,0x48,0x3c,0xe2,0x13,0x46,0x25,0x1c,0xe4,0x1c,
181   0xd0,0x0f,0x78,0xcd,0x7f,0xde,0x5c,0xfc,0xf0,0x17,0x06,0x1d,0x93,0x89,0x1a,0x68,
182   0xb0,0x57,0xfb,0x82,0x2e,0xa6,0x0d,0x0f,0xee,0x99,0xb5,0xb2,0xd7,0x55,0x57,0x10,
183   0xcb,0xfe,0x56,0xcc,0xae,0xb7,0x17,0x8b,0x66,0xa4,0xfe,0xf0,0xd4,0xeb,0x6e,0xa0,
184   0xde,0xad,0xcb,0x3f,0x68,0x11,0x7a,0x70,0x56,0x39,0xdf,0xd8,0x8b,0x49,0x5d,0x1a,
185   0xeb,0x66,0x59,0xdb,0x5b,0xb4,0x36,0xbe,0xbf,0x56,0x59,0x68,0xfa,0x70,0x26,0x7c,
186   0xf1,0x28,0x00,0x9f,0x87,0xa0,0x4b,0x75,0xa1,0xfc,0x6c,0xa1,0x22,0x61,0xc7,0xc8,
187   0xef,0xf2,0xbf,0x8d,0xec,0xd4,0xb9,0x95,0xfc,0x2b,0x19,0x83,0x04,0x1a,0x42,0xfc,
188   0xe7,0xc6,0x98,0xa4,0x8a,0x52,0x80,0x1e,0xd0,0xe3,0x5e,0x0f,0x9e,0x9d,0x95,0x1a,
189   0xd7,0xa3,0x8a,0xe4,0x61,0x19,0xa0,0x10,0x1d,0x24,0x3c,0x43,0xf1,0xe8,0xc1,0x20,
190   0xc1,0x88,0x95,0x4c,0x70,0x29,0x19,0x6b,0xe3,0xef,0xb3,0x20,0xfe,0xfd,0xc7,0x10,
191   0xa4,0x77,0xb8,0xde,0xb9,0x82,0xeb,0x2f,0x22,0x42,0xc3,0xa7,0xc3,0xda,0xa5,0xe9,
192   0x7f,0x6f,0xf5,0x99,0x3b,0x24,0x16,0x5c,0xda,0x1e,0x6d,0xd6,0x41,0x80,0x5d,0xaa,
193   0x54,0x6f,0x4b,0x7d,0xf6,0x0f,0x9a,0xef,0x8d,0x43,0xd9,0x47,0x4a,0xec,0x1a,0x31,
194   0x90,0x27,0x07,0xf0,0xe5,0xba,0xa4,0xc7,0xcb,0x68,0xf5,0xfc,0xc8,0xf5,0xfe,0xd2,
195   0x5f,0x24,0xc3,0x8d,0x14,0xbb,0x48,0x71,0x6a,0x7d,0x92,0xc2,0xe7,0x2e,0xa3,0xc4,
196   0x0e,0x92,0x81,0xbb,0x63,0x6e,0x2e,0xeb,0x6a,0x84,0xb0,0x98,0xa8,0x99,0x0a,0x07,
197   0x9f,0x72,0x3f,0x7a,0xd4,0xd1,0x55,0x37,0xcb,0x7b,0x4f,0x80,0x09,0x35,0x31,0x9b,
198   0x10,0xc2,0xff,0xca,0x66,0xe5,0xbd,0x53,0x8d,0x64,0x6f,0x79,0x0b,0x02,0x19,0x80,
199   0x63,0x83,0xc0,0xab,0x19,0xab,0x66,0x1f,0x1f,0xc9,0x9d,0xf2,0x09,0x1d,0x71,0x60,
200   0x70,0x5f,0x33,0x4e,0x77,0xf2,0x88,0x9f,0x43,0x3a,0x14,0x38,0xf8,0x9d,0x7a,0xfd,
201   0xb9,0x7c,0x5f,0xd1,0xaa,0x3e,0x66,0x98,0xf0,0x45,0x34,0x37,0xaf,0xf5,0x6d,0x92,
202   0x0a,0xb3,0xb4,0x8d,0x26,0xe3,0xae,0x0a,0x27,0xe8,0xfe,0xf0,0x2f,0x27,0x48,0x21,
203   0x65,0x03,0x32,0x81,0xeb,0xe1,0x5e,0xf5,0xe6,0x24,0x70,0x61,0x79,0x31,0x0d,0xa8,
204   0xc9,0x6c,0xd8,0xaf,0xf9,0x38,0x77,0x5a,0x2e,0xf9,0x8b,0x8c,0x8b,0x15,0xba,0x29,
205   0x35,0xed,0xa8,0x16,0x50,0xe8,0xf9,0x37,0xff,0x68,0x50,0x6f,0x67,0xd1,0x51,0xa3,
206   0x26,0x20,0xb0,0x98,0x6c,0x20,0x9b,0x41,0x8d,0x94,0xa2,0xc1,0x4c,0x80,0x0b,0x9b,
207   0x6f,0xe9,0x19,0x53,0xb9,0xd1,0x10,0x6c,0xee,0x3d,0x34,0x6c,0xd2,0x32,0xc9,0xd6,
208   0x29,0xb2,0x13,0x2e,0xb7,0xc3,0x56,0xf8,0x41,0x68,0xd7,0xb9,0x89,0xa4,0xd8,0xf3,
209   0x54,0x7d,0x9e,0x2b,0x67,0xf6,0x6e,0xe5,0x84,0x13,0x8a,0xa6,0x71,0xd8,0x38,0xf0,
210   0xf0,0x49,0xbb,0x49,0xc7,0x6a,0x56,0x33,0xb9,0x3f,0x4f,0x34,0x8a,0xcc,0xe9,0xcf,
211   0xfd,0x15,0x68,0x88,0xd8,0x1f,0x10,0xe2,0xde,0xec,0x25,0x63,0xd3,0x81,0xeb,0x8e,
212   0x7c,0xe3,0xa6,0xe7,0x9b,0x14,0x9a,0xf2,0xf5,0x1a,0x0b,0x34,0x4e,0xf8,0x3e,0x2f,
213   0x6b,0xb2,0x75,0x68,0x0e,0x4b,0xf6,0x63,0xfc,0xc9,0x03,0xa5,0xfa,0x2f,0xe2,0xb0,
214   0xcb,0x81,0xd5,0x0a,0x32,0xc3,0x22,0x35,0xf5,0xf9,0x0c,0xb7,0xd7,0x28,0xd7,0x13,
215   0x9c,0x52,0xc7,0xcd,0x08,0x7c,0x20,0x69,0xdf,0xaa,0x26,0x6a,0xe5,0xe1,0x1d,0x56,
216   0xde,0x23,0x49,0xb0,0x8e,0x76,0xee,0xfd,0xb9,0xdd,0x50,0xbf,0x23,0x5b,0xb4,0x7b,
217   0x91,0xf6,0x5c,0xb5,0xc5,0xb1,0x8d,0xf2,0x85,0x90,0x8c,0xb4,0x93,0x97,0x9b,0x80,
218   0xb5,0xca,0x00,0xdb,0xae,0x2d,0xfe,0x48,0x41,0xc4,0xd9,0x4a,0x34,0x93,0xd4,0x67,
219   0x4a,0x9e,0x35,0x22,0x47,0xea,0x3f,0xff,0xef,0x79,0x36,0x81,0x06,0x50,0x5e,0x2e,
220   0x50,0x74,0xfc,0x89,0x91,0xe7,0x52,0x17,0x8d,0xaf,0xa5,0x5a,0x09,0xcf,0x39,0xd7,
221   0xc7,0x4b,0x53,0x12,0x8d,0x26,0x35,0x90,0x1d,0x66,0x25,0xd3,0x3d,0x0e,0x65,0x60,
222   0xaf,0x22,0x3b,0xbc,0x39,0xa6,0xea,0x6a,0x9e,0x9e,0xb5,0xed,0xa1,0x0f,0xe2,0xcb,
223   0x08,0xfb,0xb4,0x87,0x96,0x67,0x95,0x37,0x5b,0x00,0xfe,0x17,0x05,0x8a,0x82,0xf4,
224   0x1c,0x82,0x06,0xf1,0x05,0x8d,0x6e,0x33,0x24,0x4f,0x9c,0xdd,0xdc,0x6b,0x77,0x14,
225   0x92,0x86,0xe1,0xfc,0xa9,0x43,0xbf,0xb8,0x86,0x47,0xf4,0x6d,0x8d,0x36,0x65,0x3e,
226   0x21,0xb3,0xf5,0x50,0xa6,0x62,0x89,0xc6,0x81,0xe9,0x04,0xc5,0x16,0xe9,0x4b,0x71,
227   0xc8,0x09,0x42,0xed,0xfc,0xea,0xcc,0x5e,0x15,0x33,0xce,0xe7,0x78,0x86,0x2b,0xac,
228   0x89,0x87,0xc8,0xd3,0xab,0xdb,0x88,0x7e,0x43,0x26,0x50,0xd1,0xb4,0x0b,0x03,0xf1,
229   0x63,0x2f,0x86,0x02,0xb3,0x35,0xbd,0x27,0x09,0xc2,0x8b,0x85,0xc8,0x7a,0xd5,0x3f,
230   0x55,0x00,0x7e,0x7a,0x14,0xf8,0x6b,0x59,0x68,0x08,0x80,0x01,0xb6,0xd1,0xa0,0x95,
231   0x61,0xfa,0xaf,0x3b,0xce,0x25,0x92,0x14,0x60,0xf6,0x2d,0x46,0x7c,0x12,0x63,0xf5,
232   0x86,0x1c,0x19,0x44,0xe1,0xba,0x32,0x58,0xf2,0x8d,0x93,0x55,0x1c,0x3b,0x20,0x5e,
233   0xc4,0x68,0xbc,0x97,0x4d,0xb8,0x4b,0x25,0x1c,0xce,0xb3,0x2c,0x94,0x4e,0xd5,0xcf,
234   0x1a,0xdd,0x98,0x33,0x12,0x1f,0xde,0x7c,0xdf,0xb7,0x8b,0xcd,0xe6,0x4a,0x84,0x4a,
235   0x8a,0x7b,0xad,0x18,0x30,0x5e,0xf7,0xd0,0x53,0x19,0x7d,0x2b,0xae,0x05,0x2e,0xb9,
236   0x56,0x67,0x8d,0x3e,0x4e,0x81,0x1f,0x7f,0x99,0x98,0x66,0x3e,0x3d,0xf0,0xe7,0xb4,
237   0x31,0x81,0xbd,0x77,0xca,0x6a,0xb4,0xbf,0x69,0x6a,0x64,0xf0,0xb2,0x66,0xf0,0x6f,
238   0x4a,0x41,0x7d,0xa0,0xd5,0xe0,0x2e,0xe6,0xf6,0x26,0x28,0xa6,0x52,0xf8,0x8f,0x43,
239   0x8c,0x3a,0x86,0x22,0x49,0xcf,0x31,0xa6,0x2c,0x9c,0xb6,0x34,0xda,0x84,0x36,0x30,
240   0xf7,0x6c,0xd8,0xfd,0x26,0x37,0xbe,0xff,0x0c,0xca,0x0c,0x9c,0x4c,0x09,0xe7,0x35,
241   0x8b,0xd7,0x73,0x31,0x6c,0x18,0xd3,0xf2,0x94,0xb1,0x2b,0xdc,0xa6,0x86,0xa1,0x54,
242   0x47,0x7a,0x57,0xbe,0x1b,0x72,0x71,0x7d,0xc5,0x52,0x14,0xf6,0xea,0xfd,0x63,0x8c,
243   0x2d,0x57,0x83,0xa4,0x33,0x45,0x98,0xa1,0x9f,0xab,0xc5,0xe8,0x16,0x6c,0x2f,0xdd,
244   0x3c,0x6d,0xf9,0xe3,0xb4,0x92,0x48,0x5e,0x23,0xbd,0xb8,0xd4,0xac,0x4f,0x5d,0x96,
245   0x6b,0x90,0x88,0x37,0x74,0x94,0xff,0xbd,0x09,0xdd,0x84,0x2b,0x70,0xf0,0xdd,0x85,
246   0xeb,0x52,0xcc,0xcf,0xc0,0x86,0x17,0x0d,0x32,0x0f,0x81,0x44,0x85,0x73,0xce,0x76,
247   0xfd,0x35,0xc2,0xa8,0xde,0xd9,0x21,0xdf,0x6c,0xe3,0xaf,0x1d,0xeb,0xd7,0x30,0x68,
248   0x9f,0x39,0x68,0xc2,0xcc,0x8d,0x1b,0x31,0xb6,0x57,0x0e,0xb7,0xa2,0x1b,0x03,0x5a,
249   0xd2,0x5d,0xbf,0x1d,0x8c,0xa2,0x07,0x04,0x12,0x6c,0x9d,0x13,0xaa,0x41,0x47,0x4e,
250   0x96,0xa3,0xc8,0xb9,0x1c,0x18,0xe3,0x58,0x7f,0x22,0x5e,0x2f,0x03,0x47,0xfc,0x42,
251   0xeb,0x0a,0x81,0x96,0x7d,0xef,0xb1,0x2d,0xfc,0x7a,0x50,0x0d,0xac,0x2f,0x22,0x38,
252   0xd2,0x92,0xeb,0xb4,0xb0,0x27,0x70,0x83,0x8b,0x72,0x73,0xab,0xa7,0xf7,0xb9,0x2f,
253   0x49,0x3a,0x07,0x12,0xb3,0xc0,0x1f,0x5a,0x2b,0x0b,0xc7,0x0a,0xf3,0xa1,0xc1,0x26,
254   0x51,0x04,0xd3,0xb2,0x88,0xba,0xc0,0xb2,0xdb,0x45,0x4c,0x2b,0x90,0x2b,0x3a,0x1f,
255   0xea,0xef,0x50,0x93,0x2d,0x15,0x51,0x8c,0x9d,0x21,0x01,0x0c,0x7e,0x97,0x24,0x19,
256   0x14,0xfb,0x7f,0xb5,0xa4,0xd1,0xd4,0xe6,0x70,0x9d,0xe8,0xae,0xbd,0xe3,0x80,0x13,
257   0xd0,0x27,0x5e,0x18,0xeb,0xee,0x47,0xc1,0x54,0xba,0x00,0x12,0x4d,0x11,0x4c,0x0f,
258   0x1c,0x75,0xee,0xbc,0x03,0x6c,0xac,0x1d,0x48,0x78,0x49,0x36,0x2e,0x1f,0x89,0x0b,
259   0xf9,0xe4,0x30,0xa1,0xed,0x4b,0x02,0xfa,0x4e,0xd8,0xc3,0x1c,0x60,0x0f,0x37,0x09,
260   0x67,0x74,0x22,0xc7,0xa7,0x8b,0x48,0x58,0x65,0xd8,0x6d,0xc2,0xe3,0xdf,0x56,0x08,
261   0x66,0x24,0xc5,0x2e,0x33,0x2c,0x80,0x37,0x8c,0x79,0x49,0x29,0xb7,0x91,0xe6,0x07,
262   0xf7,0xf6,0x1a,0xd5,0x8f,0x2e,0xa8,0x98,0xc5,0xbb,0x56,0x52,0xdc,0x23,0xe7,0x08,
263   0x18,0xe9,0x1f,0xbe,0xbd,0x91,0xc2,0x79,0x0f,0x9f,0x94,0x3b,0x52,0x97,0x59,0x0a,
264   0xca,0xfd,0xd5,0xe8,0xbb,0x55,0xcc,0xdb,0x69,0x23,0x03,0xe5,0x19,0xeb,0x3c,0x0c,
265   0x0d,0x31,0x3c,0x53,0x8b,0x7a,0xc8,0xbe,0xd5,0x48,0xa2,0x51,0x31,0x21,0x90,0x10,
266   0xe1,0x87,0x41,0x90,0xb1,0xd1,0xd6,0x70,0x26,0x6a,0xa5,0x4b,0xe7,0x2f,0x11,0xc4,
267   0xd8,0x45,0x7f,0x80,0xdc,0xd0,0x52,0x22,0xd7,0xf3,0xef,0x4f,0xaf,0xd3,0xba,0xab,
268   0x45,0x93,0x16,0xd9,0x80,0x58,0x68,0x7d,0x42,0x46,0x13,0x3d,0x6f,0x80,0x7c,0xbb,
269   0xec,0x2a,0x06,0x9b,0x9d,0x69,0x16,0x82,0x65,0x61,0x0f,0x13,0x29,0x35,0x56,0xf3,
270   0xcc,0x0a,0x4f,0xc6,0x33,0x03,0x5d,0x2f,0x41,0x45,0xe5,0xd3,0xdb,0xf4,0x4a,0x55,
271   0xe5,0x33,0xf1,0x5a,0x42,0x27,0x3d,0x85,0xd7,0xf3,0x93,0x7b,0x87,0xbc,0x57,0xe0,
272   0x37,0xa5,0xec,0x57,0xca,0xd3,0xb7,0x85,0x25,0x69,0x1b,0x0d,0x2c,0x8c,0x7c,0x94,
273   0xc2,0x60,0xce,0x6a,0x46,0x88,0xfb,0x97,0x16,0x85,0xd0,0x54,0x71,0x15,0x51,0xe7,
274   0xd9,0xfb,0x82,0x93,0xd4,0xfd,0x67,0x9b,0xe4,0xde,0x04,0x45,0x8f,0x62,0x5d,0xd4,
275   0x58,0x4d,0x77,0x8c,0xc3,0x63,0x54,0xb1,0x54,0x68,0xfa,0x87,0x8f,0x20,0x6b,0x52,
276   0xf8,0x4f,0xad,0x56,0x13,0xb9,0xc2,0xd8,0x64,0x22,0xb0,0x1a,0x6f,0x4f,0x7a,0x61,
277   0xb8,0x02,0x24,0xf2,0xc4,0x01,0xb1,0x0f,0x15,0x0e,0x27,0xfe,0x31,0xef,0x89,0x02,
278   0x9a,0x67,0xdb,0x5e,0xd6,0x39,0x22,0x58,0x67,0x2b,0x60,0x33,0xd3,0x00,0x9a,0x33,
279   0x9d,0x7c,0xd4,0x9c,0x49,0x63,0x13,0xb2,0x5b,0x79,0x59,0xb9,0x57,0x82,0xac,0xf5,
280   0xc1,0x42,0x0e,0xaa,0x1d,0x7d,0x85,0x1c,0xef,0xf8,0x14,0x90,0xbb,0x75,0xbe,0x48,
281   0x05,0xba,0x89,0x8a,0x52,0x89,0x78,0x98,0x24,0xa8,0x8f,0xb8,0x01,0xd9,0xd2,0x2c,
282   0x6b,0xe2,0x45,0x3a,0xe8,0x86,0xec,0x25,0xfa,0x88,0xcb,0x31,0x27,0xae,0xe7,0xa2,
283   0xf2,0xbb,0x42,0xbc,0xdf,0x73,0xe1,0xc3,0x72,0x9a,0xc9,0xfb,0x2f,0xf4,0xfc,0xa8,
284   0x9a,0x45,0x80,0x0e,0x37,0x52,0x57,0x71,0x8a,0xdd,0x87,0x16,0x17,0xab,0x13,0x3f,
285   0x62,0x81,0xff,0x31,0xf0,0x21,0x4e,0x31,0x43,0x51,0x06,0x81,0xe1,0xd3,0x2a,0x67,
286   0x4c,0x6d,0xbe,0x26,0x0a,0xe2,0xc7,0x02,0x9d,0xf6,0x47,0x3e,0x8b,0x6d,0x43,0x20,
287   0x57,0x0a,0xbf,0xeb,0x85,0x93,0xc0,0xe3,0x99,0xcb,0x48,0x4c,0x17,0x77,0x5d,0x6b,
288   0x83,0x59,0x01,0x82,0x61,0x36,0x3a,0xd6,0x35,0xd2,0x0b,0xab,0x83,0xf2,0x77,0x46,
289   0xcf,0x58,0x84,0xe9,0x9e,0xca,0x35,0xda,0x72,0x0a,0x8e,0x5b,0xd1,0xde,0x93,0xb2,
290   0x3d,0x08,0x48,0x22,0x3c,0x4e,0xb1,0xee,0x50,0x73,0xd2,0x5c,0xff,0x3b,0xb0,0xaf,
291   0xcc,0x6a,0x4d,0x2b,0x3b,0xc4,0xae,0x14,0xd0,0x0d,0xd8,0xae,0x0f,0x09,0xcd,0x3d,
292   0x7c,0x7c,0x93,0x05,0x9b,0x2a,0x2c,0x4b,0xf0,0xd8,0x9e,0x51,0xff,0x48,0xec,0x5c,
293   0x4c,0x3f,0x1a,0xb1,0x5c,0x82,0x2c,0x92,0xb1,0xd3,0x25,0x45,0xd1,0xf8,0x0b,0x0d,
294   0x3e,0xb4,0xe2,0x2d,0x7e,0xca,0xac,0xeb,0x13,0x00,0x6e,0x8a,0x83,0x19,0x2c,0x4e,
295   0x51,0xd9,0xea,0x7b,0x01,0x04,0xad,0x55,0x17,0x5e,0x77,0x20,0x17,0xab,0x4e,0x20,
296   0x85,0xaf,0x34,0x99,0xe5,0x2f,0x2f,0xd0,0xbb,0xed,0x42,0x07,0x8b,0xae,0x70,0x83,
297   0xd9,0x37,0xbf,0x89,0x2a,0x4a,0x32,0x5b,0x00,0xad,0xcd,0x3f,0xe1,0x22,0x94,0x77,
298   0x4f,0x6f,0x8b,0x49,0xd0,0x57,0xb6,0xf8,0xe6,0x9d,0x19,0xc8,0x17,0x07,0xb9,0xfd,
299   0xe6,0x58,0x98,0xdb,0xd7,0x54,0xbb,0xa6,0x6e,0xbf,0x27,0xa2,0x2f,0x5d,0xde,0x13,
300   0x9e,0xf3,0xe6,0x3d,0x3f,0x43,0x41,0x64,0x96,0x12,0xf5,0xcd,0x27,0x24,0x05,0xba,
301   0x76,0x3e,0x75,0x70,0x08,0x22,0x49,0x34,0x5f,0x96,0x84,0x49,0x01,0x5c,0x2c,0xf2,
302   0x70,0x3a,0x45,0x75,0x32,0xf3,0xd1,0x15,0xc9,0x4b,0xd5,0x16,0xbb,0x06,0x55,0xbb,
303   0x8b,0xe7,0x55,0x4a,0xbd,0xb4,0xda,0x06,0xd5,0x31,0xe6,0x33,0x57,0x20,0x7f,0x16,
304   0xc7,0x46,0xa7,0xf1,0xa9,0x67,0x64,0x09,0x81,0x47,0xb9,0xa2,0xd3,0xab,0xa9,0x01,
305   0x24,0x55,0x3a,0x68,0xf6,0x0b,0x6f,0x1d,0xce,0x8f,0x4c,0x62,0x31,0xa7,0xd5,0x7d,
306   0xa1,0x15,0x0e,0xb1,0xa4,0x9f,0xfb,0x41,0xbd,0x08,0xa0,0x73,0x6f,0x14,0x02,0x8a,
307   0xde,0x42,0x55,0x2c,0x82,0xcf,0x52,0x21,0xb2,0xb6,0xd5,0x8f,0xf2,0x2f,0x28,0x00,
308   0xa9,0x79,0xb5,0x23,0x9b,0x96,0xbe,0x7c,0x8d,0x8c,0x88,0x8f,0x41,0x5e,0x58,0xe1,
309   0x7c,0x10,0xbd,0xec,0x63,0x81,0x7f,0x7d,0x96,0xed,0xbd,0x6c,0x97,0x27,0x5a,0xda,
310   0xca,0xd3,0x3b,0xee,0x92,0x96,0x43,0xca,0x54,0x14,0x57,0x92,0x73,0xf0,0x5b,0x6b,
311   0x54,0xcf,0x32,0x79,0x5a,0x55,0xc1,0xdf,0xea,0x25,0xeb,0xc2,0x68,0xe3,0x95,0x45,
312   0x37,0x34,0xa2,0x8d,0xbb,0xbc,0xf7,0xbe,0x5a,0x1e,0x78,0xfb,0x75,0xff,0x08,0x68,
313   0x73,0x02,0x8b,0x2a,0xb6,0xcc,0xe6,0x65,0xa2,0x01,0xfd,0x3c,0x9c,0x44,0xb3,0xd4,
314   0x08,0x39,0xed,0x50,0x49,0x86,0x8f,0xd5,0xc4,0xcc,0x7c,0x87,0xdc,0xb2,0x98,0x89,
315   0xf6,0xd9,0xc8,0x00,0x75,0xe8,0xf0,0x0f,0xbe,0x81,0xf3,0xdb,0x35,0x48,0xb6,0x87,
316   0x3d,0xe3,0x1d,0x38,0x3a,0xf3,0x0a,0x11,0x92,0x1e,0x64,0x37,0xa6,0x08,0x0d,0xce,
317   0xdd,0x55,0xea,0xf9,0x99,0xa7,0xde,0xdd,0x3e,0xa5,0xce,0x9d,0x31,0xf1,0x9d,0x5e,
318   0xd6,0x30,0x30,0x43,0x90,0x05,0x6a,0x71,0xc3,0x14,0x30,0x0c,0xd5,0x03,0x66,0x37,
319   0x28,0x74,0xef,0x16,0x20,0x0b,0xb0,0xce,0x22,0x6d,0x8c,0x83,0x91,0x3e,0x68,0x59,
320   0xd3,0x21,0x27,0x72,0x49,0xba,0xae,0xf5,0x59,0xaf,0xe0,0x04,0x67,0xa1,0xa2,0xc3,
321   0xd7,0x37,0xd8,0x58,0x0b,0x13,0x65,0xe4,0x6a,0xd9,0x2e,0x8e,0x56,0x2e,0x16,0x77,
322   0x33,0xb6,0x0c,0xf0,0x45,0x95,0x29,0x9d,0x6e,0x8a,0xdf,0xed,0x54,0x65,0xb4,0xa4,
323   0xf9,0x69,0x2b,0x86,0x62,0xda,0xc8,0x57,0x94,0xfc,0x0f,0xdb,0x91,0x13,0x84,0xd6,
324   0x5f,0x64,0xab,0x0c,0x00,0x31,0x08,0x42,0x7a,0xbf,0x1f,0x3a,0xd0,0x53,0x75,0xb9,
325   0x06,0x2f,0x8c,0x84,0x20,0x99,0xe9,0x5d,0x22,0xd3,0x11,0x0a,0x10,0x23,0x86,0x4e,
326   0xee,0xcc,0xce,0xed,0xc0,0x11,0x6c,0xaa,0x8a,0x38,0xe3,0x4b,0x50,0x84,0xb9,0x93,
327   0x17,0x39,0x71,0x46,0xe1,0x9b,0x8f,0x28,0xb3,0xee,0x97,0xfd,0x92,0x76,0x0d,0x89,
328   0x80,0x77,0x75,0x91,0x83,0x36,0x53,0xd7,0x9e,0xf5,0x2b,0x20,0xd4,0xf9,0x82,0x31,
329   0x2b,0x87,0xda,0xcc,0xa6,0xe1,0xb8,0xb7,0x49,0x4d,0xa1,0xb4,0x18,0x0e,0x17,0x89,
330   0x17,0x67,0xa0,0xf9,0x4a,0x9e,0xbf,0xc8,0xb5,0xf6,0xf7,0xb9,0x5d,0xb3,0xce,0x92,
331   0x44,0x19,0xc7,0x16,0x6f,0x6c,0x66,0x09,0xe3,0xf0,0x2f,0x2f,0xa2,0xe9,0xa6,0x4d,
332   0xb2,0x9b,0x4f,0x25,0x16,0x4a,0xae,0x7c,0xd1,0x3b,0x47,0x17,0xe9,0xb0,0x9f,0xb8,
333   0x61,0xef,0x38,0x24,0x3d,0x3a,0x97,0x20,0x81,0xd7,0x41,0x6f,0x31,0x08,0xb8,0xd4,
334   0x51,0x13,0x82,0x15,0xe5,0x3b,0x22,0xf5,0xf1,0xc4,0x1b,0x38,0x79,0xf2,0xf3,0xa2,
335   0x82,0x08,0x2d,0xf7,0x0e,0x4c,0x4d,0xfb,0x22,0x02,0xd7,0x72,0xc3,0x6c,0x4f,0x20,
336   0xf3,0xcf,0x39,0xc9,0xb8,0x6f,0x19,0x31,0x15,0x91,0x73,0x1d,0x0d,0x77,0xcc,0x4f,
337   0xa6,0x66,0xa6,0x8d,0xe3,0xa3,0x86,0x99,0xc8,0x70,0xf1,0x39,0x59,0x13,0x69,0x30,
338   0x9a,0xcf,0x74,0x41,0x8f,0xe8,0x95,0x32,0x3c,0xa1,0x4f,0xc6,0xa6,0xd9,0x0b,0x91,
339   0xe6,0x1f,0xf7,0xe6,0x2b,0xdc,0xfd,0x85,0x7a,0xf6,0x3e,0xd2,0x77,0x4f,0xe1,0x30,
340   0xc7,0xcb,0x08,0x04,0x0e,0x4f,0xd7,0xb1,0xef,0xbe,0x73,0x9c,0x0f,0xfd,0x00,0x28,
341   0x11,0xf0,0xa1,0xba,0x9a,0x7a,0x7a,0xb5,0x4e,0x80,0xb1,0x7e,0xd0,0xe5,0x68,0x79,
342   0xc4,0x8e,0xc3,0x09,0xd0,0x5f,0xe7,0x93,0x95,0x3a,0xf7,0x7a,0xba,0x06,0x18,0x23,
343   0xe0,0xa5,0x6e,0xf1,0xae,0xfc,0x1c,0x49,0xc6,0xee,0x47,0x8f,0xcc,0x60,0x12,0x26,
344   0x65,0x35,0xa2,0x73,0x35,0x52,0x1b,0xd9,0xdf,0x9b,0xa0,0xbd,0x08,0xf3,0x55,0x82,
345   0x54,0x3e,0x5f,0x8d,0x65,0x62,0xe2,0x41,0xe2,0x81,0xfd,0xda,0x59,0xfb,0x16,0x5d,
346   0x76,0x88,0xca,0x3f,0x2a,0x73,0x83,0xcd,0xdf,0x6c,0x63,0xfb,0xc3,0xb6,0x45,0x6b,
347   0xbc,0x75,0x8c,0xc1,0xab,0xcc,0x9d,0xa2,0x76,0xe0,0xdc,0xb2,0x01,0xd4,0xac,0x94,
348   0x30,0xcd,0x71,0xec,0xe6,0xee,0x91,0x60,0x07,0x5c,0x6d,0x91,0x78,0x3b,0x6c,0x26,
349   0x1d,0xae,0xf0,0xc1,0xd9,0xda,0x5d,0x06,0x91,0xe2,0x18,0x9a,0x28,0xeb,0x85,0x21,
350   0x83,0x18,0x07,0x3e,0x85,0x8e,0x03,0x96,0x13,0x71,0xdc,0xcc,0x11,0xe4,0xf7,0x85,
351   0x62,0x0b,0xb7,0x64,0xeb,0x0c,0x81,0x0e,0x8f,0x08,0xb9,0x27,0x33,0x26,0xc2,0x52,
352   0xba,0x88,0x00,0x33,0x09,0x52,0xd9,0x70,0x03,0xa9,0xae,0x32,0x20,0x4c,0x5c,0xe5,
353   0xfe,0xce,0x1d,0xe6,0xe2,0x1e,0x86,0x78,0x51,0x02,0x9b,0xde,0xcd,0x3d,0x60,0x5e,
354   0xdc,0x92,0xd9,0x3b,0x01,0xc7,0x0b,0xb8,0xbf,0x9f,0xf8,0x1b,0x9c,0xde,0xa5,0xa7,
355   0x1b,0x48,0x16,0xa0,0xc0,0xa1,0x50,0x4a,0x0f,0xad,0x55,0xea,0x8c,0x30,0x2b,0xc2,
356   0xbb,0xee,0xd5,0x17,0x20,0xac,0x56,0x2d,0x3f,0x2c,0xb4,0x49,0x9d,0x34,0xf2,0xad,
357   0xbc,0x86,0x14,0x9f,0x21,0xe8,0x1e,0x61,0x51,0x1c,0x14,0x39,0xce,0xe8,0xfa,0x6a,
358   0x1e,0x0f,0xd4,0x37,0xc4,0x54,0xa6,0xe6,0x43,0x7d,0x74,0xba,0x21,0x4d,0x43,0xf7,
359   0xe1,0x88,0x15,0xe1,0x07,0xf2,0xef,0xbc,0x17,0x4f,0xd6,0xcc,0x95,0x64,0xcd,0x56,
360   0x05,0xf3,0xd7,0x9c,0xeb,0xc1,0xfa,0xac,0xf2,0xe0,0x8d,0x68,0x4c,0x89,0xfc,0x18,
361   0xfa,0x78,0x32,0x9f,0x21,0x11,0xd2,0xe2,0xe4,0xb7,0x82,0xc4,0x68,0xce,0xe3,0x2a,
362   0xd0,0xbc,0x9b,0xf7,0x41,0xe2,0x4e,0x10,0xdf,0xa7,0x9f,0x59,0xcd,0x6c,0x33,0xb5,
363   0x2f,0x98,0xae,0x09,0x2b,0x8d,0xb3,0x38,0xe2,0xaf,0xe6,0x27,0x7b,0x63,0xec,0xb9,
364   0x17,0x0d,0x69,0xd3,0xdd,0x10,0x00,0x59,0xef,0xd1,0x56,0x2e,0x71,0xb3,0x0e,0x36,
365   0x89,0x1b,0xcd,0xcf,0xaa,0x7d,0x65,0x81,0x81,0x35,0x1e,0x00,0x6e,0x5d,0xb1,0xd2,
366   0x37,0xf9,0x61,0x7a,0x9f,0x0d,0x72,0x7b,0x6a,0x9d,0x28,0x5b,0x5c,0xae,0xc7,0x9d,
367   0x39,0x42,0x93,0xc5,0xc5,0x5e,0xd0,0x57,0xc4,0x07,0xc2,0xd7,0xfa,0xea,0x84,0x12,
368   0xdc,0xf0,0x37,0x81,0x98,0x50,0x95,0x7c,0x52,0xaf,0x83,0x27,0x6d,0xb0,0xe5,0xa7,
369   0x4e,0xf8,0x9e,0x20,0x59,0x2b,0x93,0xb5,0xf1,0xec,0xa7,0x8b,0x7a,0xdf,0xbf,0xc5,
370   0x59,0xaa,0xbe,0x88,0xf2,0xee,0x89,0xf8,0xa8,0x52,0x04,0x38,0xe0,0x77,0x12,0x6d,
371   0xfe,0x04,0x98,0xba,0x65,0x9b,0x79,0x44,0x79,0xe0,0x9a,0x2e,0x9f,0x78,0xde,0x9d,
372   0x3b,0x07,0x2a,0xb4,0xb0,0x30,0x61,0x98,0x63,0x98,0x68,0x6d,0xb7,0xe3,0x23,0x56,
373   0x11,0xb3,0x75,0x78,0xd4,0xaf,0x43,0xf6,0x65,0x79,0x70,0xf5,0x28,0xb6,0xe1,0x98,
374   0x80,0x09,0x7a,0x04,0xd2,0x16,0x1e,0x5d,0x81,0x83,0xb1,0xc6,0xf2,0xf2,0x18,0x63,
375   0x88,0x07,0x37,0x59,0xa8,0x67,0xf1,0xcc,0xb6,0xb6,0x2b,0xe0,0x15,0x97,0xc8,0xb7,
376   0x2a,0xae,0xad,0x78,0x58,0xa1,0xbe,0x45,0x04,0x11,0xde,0x42,0x91,0xa5,0xf1,0x95,
377   0x64,0xff,0xdd,0x5f,0xe0,0xc3,0x83,0xc7,0x6a,0x96,0xca,0xee,0x66,0x1c,0x94,0xfb,
378   0x37,0xf8,0xc5,0x10,0x42,0xcf,0x42,0x51,0xea,0x44,0xef,0xe3,0x94,0xfc,0xaf,0xea,
379   0xa3,0x9a,0x66,0x89,0x7c,0xc3,0xfa,0xe5,0x83,0x1b,0x4c,0x21,0x1b,0x45,0x43,0x62,
380   0xa9,0xe5,0xc1,0xcb,0x90,0xa1,0xaa,0x81,0x35,0x1a,0xe3,0xa8,0xfb,0xf7,0x50,0x63,
381   0x47,0xda,0xd4,0xd7,0x7c,0x67,0x54,0x27,0xff,0x43,0xb3,0x78,0x34,0x12,0xd6,0xed,
382   0x7e,0x77,0xa0,0xab,0x42,0x17,0xf6,0xd6,0xe3,0x95,0xbc,0x91,0xc6,0x96,0xd5,0x01,
383   0x4e,0xbd,0x26,0x49,0xe0,0xaf,0x92,0x8d,0xe0,0x10,0xfe,0xf3,0xb1,0x83,0x4d,0x9d,
384   0xb7,0xad,0x64,0xaf,0x58,0x31,0x27,0x4e,0xf5,0xb4,0x79,0x9e,0xf5,0xd9,0x3e,0xc2,
385   0xba,0x45,0x5b,0xdf,0xa8,0x9b,0xb4,0x18,0x24,0x80,0x2d,0x92,0x92,0x98,0xa8,0x70,
386   0x55,0x86,0x0c,0xd7,0xd2,0xef,0x3b,0xea,0x6c,0x76,0x19,0xcf,0x88,0xc0,0x8b,0xa7,
387
388   /* data */
389   0x62,0xef,0x86,0xe9,0x89,0x18,0x1a,0x73,0xf9,0x03,0xf8,0xe1,0xf7,0x35,0xe6,0x37,
390   0xc5,0x30,0xa6,0x79,0xa9,0x7a,0xfe,0xab,0xe6,0x95,0xb1,0xd1,0xc0,0x07,0x83,0xef,
391   0x7a,0x53,0x37,0x0a,0x5a,0xfc,0x93,0x24,0xa3,0x88,0x5a,0x42,0x99,0x7a,0x50,0x69,
392   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
393   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
394   0x80,0x56,0x3a,0x9b,0x9c,0xa0,0xda,0xde,0x32,0xdc,0xf5,0x34,0x84,0x8e,0x4f,0xa3,
395   0xd7,0x3b,0xad,0x2e,0x70,0x65,0xd1,0xd9,0x91,0x91,0x81,0xa7,0x80,0x44,0x7f,0x9e,
396   0x7f,0x00,0x91,0xc1,0xd4,0x4b,0x79,0x14,0xc2,0xa7,0xfd,0x9c,0x8c,0x9a,0xe0,0x5b,
397   0x78,0xa7,0xe6,0x56,0xc9,0x51,0xd3,0x91,0xc3,0x1e,0x6b,0x11,0xaa,0x91,0x72,0xd8,
398   0xc2,0x2e,0xac,0xec,0x4f,0x79,0xdd,0x4f,0x95,0xf6,0xc9,0x07,0xd9,0x29,0x35,0x17,
399   0x5d,0x97,0xe3,0x82,0x66,0xc2,0x98,0x4e,0x39,0x2f,0x19,0x7e,0x18,0x63,0x28,0x16,
400   0x49,0xe0,0x8b,0x1a,0x0f,0x2c,0x05,0x8e,0xad,0xc9,0x59,0x76,0x69,0x3d,0x4d,0xd6,
401   0x86,0x0b,0xa4,0xb3,0x48,0xb6,0x22,0x0f,0xf3,0xc4,0x8b,0xef,0xcb,0xb8,0xa3,0x58,
402   0x14,0x16,0x2e,0x4c,0x12,0x62,0xf0,0xd1,0x09,0x20,0xad,0xe9,0x3d,0xd4,0x2a,0x9a,
403   0xf3,0x03,0x29,0xe7,0x6d,0x2f,0x70,0xd4,0xf1,0xdd,0xc1,0x64,0xc1,0x92,0xe2,0x9d,
404   0x23,0xd0,0x95,0x82,0x59,0x1d,0xa0,0x17,0xa9,0xfb,0xc6,0x61,0x56,0xf0,0xca,0x62,
405   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
406   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
407   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
408   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
409   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
410   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
411   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
412   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
413   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
414   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
415   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
416   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
417   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
418   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
419   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
420   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
421   0xa4,0x7f,0x72,0x1f,0xd7,0x2b,0x81,0x9c,0x33,0x7a,0xbb,0xde,0xfc,0xef,0xe4,0xe7,
422   0x76,0x0e,0xc0,0xbd,0xe5,0x5b,0x14,0x62,0x8d,0x5a,0xa2,0xdc,0xb2,0x8f,0x2f,0x2e,
423   0x99,0x7f,0x7f,0x5b,0x84,0xac,0x57,0x69,0xb8,0x9b,0x79,0x5b,0x7a,0xd1,0xab,0x35,
424   0x0d,0xd0,0xaf,0xfb,0xb4,0x1e,0x4b,0xb1,0xb5,0x3d,0x42,0x5b,0x53,0xb3,0x58,0xfd,
425   0xd1,0x03,0x51,0x9c,0x75,0xb0,0xf0,0x3a,0x82,0x2a,0x32,0x44,0xb7,0xcc,0xbe,0xd0,
426   0x5d,0xeb,0x38,0x4a,0x83,0xaa,0x03,0x57,0x0c,0x2e,0x83,0x9b,0xdd,0x9b,0x1e,0xb9,
427   0xda,0x14,0x35,0x56,0xe6,0xbd,0x2f,0x15,0xe5,0xbb,0x6e,0x9b,0xbc,0x32,0x56,0x8c,
428   0x4f,0x45,0x4c,0x8b,0x81,0x19,0xb4,0x3c,0x37,0xd1,0xf1,0x45,0x55,0x92,0x68,0x47,
429   0xbe,0x80,0x7c,0xe9,0x56,0xbe,0x92,0xcc,0x02,0x71,0x0d,0x97,0xa6,0xbc,0x52,0xec,
430   0x25,0xc4,0xc5,0x6f,0x64,0xac,0xc9,0xc5,0x46,0x99,0xc2,0x92,0xb0,0xae,0x15,0x79,
431   0x86,0x10,0x26,0x1f,0xab,0xe3,0x59,0x27,0x04,0x4a,0x10,0x36,0x74,0x6a,0xb2,0xf0,
432   0xdf,0x66,0xa1,0xf8,0x2b,0x63,0x42,0xf3,0x3a,0x84,0xf8,0x84,0xf0,0xee,0x27,0x4f,
433   0x32,0xc4,0x35,0xfa,0xe4,0x2c,0x84,0x27,0xe9,0x47,0x78,0x7a,0x25,0x3b,0x76,0x98,
434   0x7e,0x2c,0xe1,0x24,0xd5,0x3d,0x1e,0xc4,0x11,0x93,0x91,0x19,0x14,0x52,0x9d,0xc9,
435   0xc2,0x9d,0xa7,0x78,0x00,0x98,0x12,0xca,0xb2,0x69,0x43,0x62,0xbb,0x31,0x9e,0xe4,
436   0x00,0x16,0x86,0xf5,0x64,0x3c,0x5f,0x39,0xcc,0xc7,0x8f,0x53,0x1b,0xda,0x77,0xe8,
437   0x36,0x99,0x7e,0x9b,0x01,0x29,0x05,0x11,0x5f,0xae,0x73,0xed,0x35,0x4b,0x2a,0xd4,
438   0x66,0x25,0x8e,0x6a,0xd7,0x5f,0x04,0x52,0x6b,0x1e,0xf0,0x30,0x07,0x85,0xb5,0xaa,
439   0x8f,0xb9,0xb8,0x61,0xe6,0x94,0x5f,0x77,0x33,0xfa,0xd5,0xfd,0x6d,0x70,0x33,0x54,
440   0x70,0xb9,0x7d,0xbf,0xc2,0x98,0xb7,0x84,0xe5,0xd3,0xe5,0xe6,0x5f,0x2d,0x0b,0x29,
441   0xb3,0x6a,0x2e,0x90,0x65,0x4e,0x50,0x61,0xf8,0x9d,0x76,0xdf,0xf2,0x1b,0xa5,0x4e,
442   0xd6,0x8c,0xdf,0xf3,0x28,0xb4,0x2a,0x10,0x6c,0x57,0x88,0xea,0x27,0x39,0xff,0xc5,
443   0xdb,0x1f,0x92,0xe6,0x0d,0xcb,0x45,0x8f,0x41,0x03,0x1c,0x06,0xfc,0x89,0x1b,0x8d,
444   0xc0,0x23,0x46,0x6a,0x13,0x93,0xa1,0xe0,0x77,0x9f,0x30,0x32,0x72,0x0a,0xf7,0xa6,
445   0x87,0x98,0xfa,0x7f,0x3a,0x0d,0x3d,0x01,0x0e,0x2d,0xc5,0x70,0x89,0xbc,0x94,0x10,
446   0x2e,0x7e,0xb0,0x25,0x81,0x37,0x1b,0xf4,0x06,0xab,0xdb,0xbf,0x42,0x9f,0xf3,0xcb,
447   0xb7,0xd5,0x66,0x5d,0xea,0x12,0x3a,0xb7,0x5f,0x1b,0x72,0x1f,0x9b,0xb2,0x12,0xd7,
448   0x20,0x9d,0x1e,0x25,0x74,0x9f,0x9a,0x4b,0x19,0x7b,0x8a,0x8f,0x95,0xf7,0xf2,0x34,
449   0x6b,0xd6,0xd7,0x7e,0x1f,0xdc,0x3b,0xb1,0x34,0xcd,0x23,0x11,0x30,0x6d,0x94,0xe2,
450   0x96,0x80,0x90,0x68,0xea,0xca,0x1d,0xe7,0xb0,0x10,0x3d,0xa4,0x6d,0x14,0xf6,0xe1,
451   0xa3,0x9b,0x4b,0xe3,0xd7,0x6a,0xf2,0x0c,0x83,0xaf,0xae,0x79,0xf0,0xed,0x55,0x21,
452   0x79,0xb9,0x8a,0xea,0x43,0x77,0xf1,0xb6,0x71,0x8a,0x2f,0x69,0x28,0x57,0xe8,0xe8,
453   0x8c,0x41,0xbf,0x17,0xc0,0xad,0x59,0xd9,0xe8,0xfe,0x5a,0x12,0x2a,0x99,0x65,0xa8,
454   0xa7,0xe2,0x1e,0x7c,0x86,0x3c,0x2a,0x75,0xe9,0x0c,0x2d,0x75,0xf4,0xb5,0xca,0x60,
455   0xcc,0x9c,0xa6,0x1b,0x95,0x24,0x64,0x8a,0x72,0xb2,0xa9,0x90,0x87,0xa9,0x19,0x12,
456   0xfa,0x6e,0x57,0xf3,0xec,0x65,0x07,0x18,0x84,0xf1,0xcf,0x64,0xe4,0x77,0x50,0xbc,
457   0x30,0x5a,0x31,0x04,0x8d,0xff,0x13,0xb0,0x3e,0x10,0x82,0xae,0x00,0xc3,0xb6,0x96,
458   0xb5,0x81,0x1e,0xec,0x21,0x50,0xff,0x34,0x08,0x33,0x9d,0xf3,0x2e,0x2d,0x3c,0xab,
459   0x58,0x44,0x21,0xe1,0x48,0x7b,0x8e,0x19,0xc4,0xd6,0xc9,0xd8,0x8e,0x59,0x14,0xa0,
460   0x6c,0x08,0xb5,0xf7,0x21,0xe7,0xef,0x5f,0x70,0xfa,0x06,0x5e,0x1f,0x45,0x3d,0x77,
461   0xf1,0xcc,0xda,0x2e,0xaa,0x94,0x20,0x06,0x0e,0x9f,0x53,0x85,0xe1,0xf2,0xb7,0x2e,
462   0xe7,0x92,0x90,0x85,0xe4,0x81,0x23,0x0e,0x9c,0xc5,0xb2,0x4e,0xd4,0x61,0x82,0xc7,
463   0x4e,0x58,0xd8,0xfe,0xcf,0xb0,0xf6,0x77,0x1c,0x6c,0x22,0xb7,0xf8,0x90,0x9e,0xab,
464   0x88,0xa1,0xb6,0xf0,0xf1,0xe4,0x8d,0x59,0x6f,0xbd,0x0b,0x0b,0x67,0xd1,0x15,0x2a,
465   0x3c,0xc3,0x8f,0xd9,0x53,0x38,0x5c,0x3c,0x0f,0xd3,0x61,0x79,0xd5,0x39,0x81,0xb1,
466   0x09,0x0e,0xa1,0x0b,0x0e,0xf5,0xa4,0xa8,0x48,0x92,0x6f,0xaf,0x1c,0x8b,0xe5,0x42,
467   0xee,0x81,0xeb,0x86,0x22,0x1b,0x65,0x9e,0x1a,0xfb,0x36,0xae,0x3d,0xc5,0x43,0xdc,
468   0xed,0x1e,0x6f,0x49,0x8f,0xaa,0x9f,0x1c,0x86,0x0c,0xb7,0x77,0x36,0xe9,0x9a,0x7e,
469   0x05,0xe4,0x2c,0x56,0x55,0xa2,0x52,0x23,0x8a,0xc6,0xf0,0x08,0x09,0xf5,0xe9,0x2a,
470   0x35,0xd3,0x22,0xac,0x73,0x03,0x7e,0xb3,0x27,0x2a,0xe2,0x63,0xb4,0xeb,0x32,0xdf,
471   0x7f,0xeb,0x51,0x4b,0xeb,0xcd,0x23,0xcc,0x5d,0x36,0x8e,0x86,0x39,0xc9,0x73,0x9c,
472   0xe2,0x2b,0xb9,0x33,0xbc,0x00,0x42,0x6e,0x2d,0xeb,0xf2,0x72,0x96,0x91,0xae,0x63,
473   0x5e,0x95,0x5a,0x64,0xe6,0x9c,0xd9,0x9a,0x95,0x49,0x0f,0x28,0xcd,0x41,0xe2,0x33,
474   0xf2,0x28,0x33,0xde,0x69,0xa1,0xe9,0x4e,0x96,0x51,0xe6,0xa6,0xdc,0xdb,0x0e,0x0b,
475   0xa0,0xe4,0x46,0xa1,0x45,0x0f,0x72,0x8b,0x30,0x01,0x75,0xee,0xc5,0x5d,0x34,0xed,
476   0x67,0xc8,0x92,0xad,0x7a,0xe6,0x74,0x51,0x63,0x5a,0xbd,0xfe,0x86,0xc9,0x52,0xd8,
477   0x46,0xd6,0x17,0x02,0x08,0x26,0xef,0xa0,0x30,0x5d,0xbf,0xd7,0x21,0x1d,0x6a,0xcb,
478   0x3f,0x0d,0xd5,0xa0,0xef,0xcf,0xe3,0x78,0x95,0x08,0x79,0x7a,0x94,0x5b,0x7b,0xc8,
479   0x51,0x6d,0xcc,0x86,0x2f,0xe1,0x50,0xda,0x93,0x5c,0xec,0xe5,0xe1,0x82,0x84,0xce,
480   0x7c,0xf6,0xfb,0xb6,0xc8,0x5c,0x36,0xc4,0x2a,0x59,0x19,0x1a,0x06,0x91,0x87,0xdc,
481   0xbf,0xa7,0x64,0x2f,0xba,0x6f,0xa5,0x0f,0x57,0x57,0xa8,0x37,0xd0,0xb0,0x16,0xd2,
482   0xd4,0xbe,0x72,0xa4,0x69,0xc5,0x41,0x72,0x92,0x0a,0x05,0xfe,0x52,0xcf,0x43,0x0d,
483   0xaf,0x59,0x7f,0x64,0xac,0xed,0x3e,0xc5,0x4d,0xcd,0x02,0xf6,0x96,0x3f,0x50,0xb9,
484   0x8b,0x86,0xad,0xd4,0x30,0xe5,0x9c,0x0a,0x89,0xa2,0xa0,0x1f,0x9a,0x00,0x3f,0xd7,
485   0x67,0x43,0xfc,0xf5,0xf5,0xaf,0x5b,0x3f,0x46,0x88,0xdf,0x78,0x5f,0x12,0x0e,0x65,
486   0x45,0x91,0x6b,0xc8,0xfa,0x49,0x7b,0x66,0x84,0x7f,0xc0,0x03,0xe6,0x75,0xbf,0x64,
487   0x24,0x70,0xfc,0x4b,0x41,0xb5,0xfc,0x7e,0x43,0x86,0x41,0xbf,0x2d,0x29,0x50,0xd4,
488   0x03,0xe0,0xae,0x7f,0xc9,0xf1,0xde,0x86,0x83,0x9f,0x63,0xac,0x36,0x2e,0xc3,0xb5,
489   0xe4,0xe2,0x81,0x65,0x92,0xff,0x21,0x80,0x45,0xc9,0x26,0xca,0xff,0x84,0x16,0x07,
490   0xc5,0x74,0x74,0xfb,0x9c,0xdd,0xc5,0x6a,0x87,0x03,0x8b,0x19,0x89,0x2b,0x4b,0xca,
491   0xa8,0x97,0x89,0x42,0xe7,0x8c,0xca,0x46,0x4a,0x4f,0x90,0x98,0xd5,0x23,0x60,0xfe,
492   0x8c,0x4b,0xbf,0x3b,0x73,0x0d,0x30,0x12,0x8e,0xac,0x36,0x49,0xe1,0x6b,0x57,0xa3,
493   0x70,0x90,0x16,0xe4,0xef,0xe9,0x5b,0x3b,0x49,0x1c,0x36,0x10,0x2e,0x2c,0xce,0x13,
494   0x42,0xfa,0x46,0xa7,0x28,0x6d,0xc3,0x30,0x84,0x67,0x68,0x14,0xfc,0xcc,0x5a,0x3d,
495   0xce,0x26,0x4a,0x9c,0x74,0xa8,0x1e,0x60,0x28,0xef,0x82,0x8c,0x2c,0x80,0x38,0x24,
496   0xc6,0xe0,0x06,0x2c,0x39,0x92,0xaf,0xa8,0xc8,0x19,0xf6,0x9d,0xb9,0xfb,0xa1,0x0d,
497   0x4f,0xbb,0x73,0xfd,0xce,0xdd,0x30,0x72,0x7a,0xe5,0x9c,0x6e,0x97,0x56,0x7b,0xf6,
498   0x69,0xb7,0x92,0x0f,0x35,0x89,0xa3,0xbc,0x3d,0x51,0x73,0x00,0xc6,0x93,0xc6,0xe1,
499   0x15,0xd3,0x61,0x62,0x6c,0x96,0x06,0x87,0x10,0x5e,0x7b,0x54,0x46,0xb0,0x83,0xcd,
500   0x51,0x11,0xe1,0xf6,0x74,0x04,0x5b,0xd3,0xf5,0x0c,0xb4,0x68,0x17,0xaf,0xb0,0xb9,
501   0x1e,0x70,0x13,0xcb,0x4e,0xd3,0xa0,0xa0,0xeb,0x5c,0x1e,0x3d,0x39,0x8e,0x4e,0xa7,
502   0x7c,0xf0,0xf5,0xe1,0xf8,0x03,0xd7,0xee,0xf2,0x4c,0xb3,0x2c,0xd5,0x04,0x46,0x74,
503   0xbc,0xb8,0x7b,0x9e,0x57,0x81,0xb4,0x4f,0x89,0x83,0x58,0x2a,0x37,0xe1,0xc9,0xd4,
504   0x44,0xc0,0x6c,0xf1,0x95,0x44,0xa4,0x24,0x0d,0x90,0xd5,0x12,0x91,0xc8,0x65,0x5e,
505   0x05,0x11,0xb6,0xad,0x4c,0x8f,0x2c,0xa3,0x4a,0x65,0x2c,0xe2,0xe5,0xb8,0x19,0x11,
506   0xff,0xab,0x59,0xd2,0x7c,0x63,0x4d,0xca,0x41,0x03,0x5b,0x9c,0x31,0xb0,0xe7,0xed,
507   0x31,0x8e,0x54,0x60,0x25,0xc0,0x07,0x9a,0xf0,0x6b,0x64,0x3f,0x77,0xb2,0xce,0xf2,
508   0x9d,0xba,0xa9,0x57,0x47,0xa6,0x5b,0x13,0x59,0x9b,0x45,0xca,0xb6,0xbd,0xce,0x1f,
509   0x42,0x2f,0x57,0xb7,0xe2,0x15,0x47,0x36,0x7a,0x95,0x00,0x3f,0xed,0xd0,0xe6,0x76,
510   0x20,0xed,0x5e,0x80,0xf6,0x0e,0xcc,0x01,0x54,0x57,0x93,0x9c,0x1e,0xed,0x18,0xf6,
511   0x37,0xf4,0xbe,0xb2,0x83,0x8f,0xea,0x75,0xe8,0xe2,0x00,0xe3,0x47,0x13,0x63,0x9f,
512   0x87,0x43,0x77,0x4d,0x89,0x99,0xa1,0x92,0x34,0x37,0x45,0x12,0x6a,0x41,0xc6,0x71,
513   0x0f,0xdc,0x89,0x51,0x09,0x2c,0xf2,0x59,0x39,0x54,0x64,0x2b,0x86,0x79,0x43,0x6b,
514   0xd1,0xbe,0xf4,0xbe,0x01,0x48,0xdb,0xc8,0xf8,0x3b,0x5b,0x2c,0x9a,0xba,0xd9,0x8f,
515   0xcc,0xe9,0xb8,0x94,0x72,0xed,0x5d,0xe0,0x6f,0xea,0x2c,0x17,0xa8,0x03,0x88,0xdc,
516   0x00,0x5d,0xd5,0xd3,0x5c,0x1b,0x78,0xa2,0x9f,0x62,0xd5,0xea,0xae,0x56,0x4f,0x52,
517   0x6d,0x1a,0x4b,0x7c,0xbf,0xd3,0x2d,0x0c,0x89,0xa4,0x58,0xa7,0xae,0xb2,0x30,0xf0,
518   0x13,0x20,0x1a,0x8d,0x9b,0x13,0x7a,0x1f,0x2b,0xae,0xb3,0x4c,0xa6,0x16,0x2a,0xb8,
519   0xf2,0x6f,0x42,0x07,0xf0,0xdc,0x60,0xdb,0x86,0x82,0xe8,0xdb,0x98,0x84,0x3d,0xa9,
520   0x09,0x07,0xc3,0xea,0xbe,0x2e,0xdf,0x41,0x9b,0x1e,0xf5,0x53,0x83,0xfb,0x68,0xc3,
521   0x5a,0xe8,0x9d,0x36,0x05,0x09,0xf8,0x4f,0x68,0x83,0xdb,0xb3,0x66,0x7a,0xad,0x06,
522   0xe4,0x12,0xd0,0xeb,0xc5,0x6d,0xa9,0x06,0xee,0xb2,0x9b,0xfd,0x43,0x03,0x0b,0x71,
523   0xa7,0x84,0x5c,0x09,0xff,0x5b,0xf3,0x67,0x2e,0xa9,0x33,0x2f,0x18,0x95,0x81,0x06,
524   0xa3,0x55,0xff,0x2b,0x00,0xb5,0x22,0x52,0x0e,0x73,0x7d,0x9a,0x37,0x55,0x14,0x47,
525   0xfe,0x1e,0xec,0x9c,0xe7,0x92,0x07,0xdf,0x76,0x75,0x6b,0x54,0x2f,0x8b,0x1a,0x3d,
526   0x96,0x98,0x1a,0xdf,0x2f,0x61,0x6d,0x7e,0x7e,0xa8,0x19,0x5e,0x07,0x32,0x21,0xc4,
527   0x4e,0xc4,0x89,0xf2,0xd8,0x20,0x54,0x2e,0x27,0x0c,0x88,0xba,0xc1,0x4a,0x28,0xdc,
528   0x28,0xa0,0x38,0xd7,0xe2,0xd1,0xbd,0xef,0x71,0xa1,0xb9,0x67,0x5b,0xd3,0x31,0x85,
529   0x23,0x2d,0x29,0x8c,0x4d,0x72,0xa6,0xc0,0x5d,0x66,0xaa,0x65,0xd7,0xce,0x3b,0xbf,
530   0x3f,0x6c,0x5b,0x13,0x19,0x05,0x10,0xa3,0xe9,0x5d,0x5c,0xb4,0x33,0x39,0x45,0x8b,
531   0x7b,0x5b,0xbd,0xcb,0x08,0xc9,0x2d,0x2d,0xa9,0x7b,0x87,0xc9,0x66,0xbb,0x70,0x86,
532   0x64,0xed,0x8c,0x45,0xc6,0x74,0x7e,0xed,0xb1,0xb5,0xeb,0x60,0x49,0x13,0x76,0x82,
533   0xb1,0xf3,0xc4,0x39,0x0d,0xb8,0x78,0x66,0x82,0xc7,0x37,0xef,0x34,0x84,0xa5,0xb8,
534   0x46,0x52,0x65,0xa5,0xdd,0x95,0x1c,0x99,0x1d,0xb3,0x6d,0x78,0x29,0x0d,0xfd,0x27,
535   0x25,0x0a,0x6f,0x8a,0x37,0x0c,0x68,0x84,0x80,0x77,0x8c,0xfa,0x26,0xb0,0x7e,0xcf,
536   0x4d,0x1b,0xe2,0xe8,0x19,0x1b,0x5d,0x28,0xad,0x15,0x93,0x74,0x2d,0x6c,0x27,0xb0,
537   0xbe,0x85,0xbe,0xbf,0x84,0xc3,0xfc,0x86,0xa2,0x8b,0x84,0xe8,0x3d,0x41,0xfa,0xca,
538   0x78,0x48,0x03,0x0f,0x78,0x04,0x43,0x9c,0x60,0xdb,0x5d,0x54,0x55,0x2e,0xf6,0x1c,
539   0x7b,0x64,0xb1,0xd8,0xf5,0xdf,0x33,0x6b,0xe8,0x03,0x20,0xba,0x77,0x35,0x1b,0xa8,
540   0xc7,0xd9,0xc8,0x1a,0xfb,0x52,0xcc,0xf4,0x38,0x04,0xcb,0x19,0xa2,0x55,0x69,0x6d,
541   0x5c,0xa7,0x48,0xd5,0x8a,0x5e,0x0f,0x35,0x52,0xdf,0x60,0x70,0xd5,0x8d,0xdf,0x6b,
542   0x3a,0xce,0x31,0x09,0xa3,0x03,0xfa,0x2f,0x34,0x92,0xdd,0xc1,0x12,0xdf,0x7f,0xa2,
543   0x61,0x4e,0x83,0xb7,0x44,0x41,0x8e,0xe3,0xe0,0x1f,0x44,0x0a,0x58,0x4a,0x48,0x12,
544   0xd1,0x26,0x3e,0xdd,0x6e,0x19,0xcc,0x4f,0x54,0x84,0x93,0x4d,0xa6,0xce,0x3a,0xbb,
545   0x89,0x58,0x62,0x7c,0x21,0x89,0xb2,0x74,0x91,0xc3,0xcc,0x89,0xfe,0x6a,0x54,0x9c,
546   0x8b,0xe3,0xf0,0x94,0x5d,0x92,0x41,0x53,0x98,0xda,0xed,0xbd,0x5f,0x20,0x98,0xb7,
547   0xd6,0xc7,0xe6,0x25,0x22,0x34,0x79,0xea,0x67,0xcb,0xf8,0xeb,0xc8,0xef,0x05,0x0b,
548   0x6a,0x04,0x45,0x2f,0x71,0x70,0x5b,0x3a,0x00,0x94,0xeb,0x11,0x3b,0xd7,0x9b,0x98,
549   0x47,0x9a,0x0d,0xb2,0x48,0x44,0xe5,0x44,0x61,0x37,0xc8,0x31,0xb7,0xd7,0x5a,0x5e,
550   0x6d,0x89,0x3e,0xae,0xa8,0xb1,0x18,0x06,0x8b,0xb2,0x8e,0x4a,0x3b,0xf1,0x41,0x5d,
551   0xdc,0xd1,0xd8,0x23,0x91,0xb7,0xf5,0x81,0x7f,0x07,0x3c,0x5b,0xc9,0x24,0x52,0x95,
552   0x94,0x72,0xdb,0x11,0x03,0x56,0x7a,0xb6,0x3b,0x34,0xd4,0x66,0x60,0x6f,0x8c,0x05,
553   0x95,0x6c,0x47,0x78,0xfe,0x8f,0xa8,0xa3,0xc1,0x3b,0x54,0x69,0xff,0xd4,0xef,0xaf,
554   0xdf,0xbf,0x1c,0x59,0x83,0x60,0x7f,0x4a,0x0f,0x1a,0xbe,0x66,0xa8,0x52,0x7a,0x92,
555   0x72,0x6b,0x5a,0xb2,0x90,0xca,0x00,0xa9,0x26,0xd3,0x10,0x5c,0x5a,0xe9,0x2f,0xae,
556   0x4e,0x70,0x01,0x84,0x26,0xcd,0x29,0xc1,0x07,0x64,0x4c,0x4a,0x14,0x98,0x0d,0x03,
557   0x72,0xce,0x11,0xcf,0x45,0x6a,0xfb,0x93,0xb0,0xce,0x70,0x32,0xd8,0x61,0x14,0x91,
558   0xe0,0x85,0x8a,0x93,0xed,0x9f,0x77,0x1d,0x23,0x12,0x7e,0x12,0xa5,0x43,0x44,0x57,
559   0x97,0x95,0x6c,0xd0,0x1e,0x6d,0x9b,0x60,0x5e,0x2e,0x74,0xec,0x7a,0x3d,0x9c,0x57,
560   0x97,0xfe,0xb7,0x86,0xd9,0xd4,0x68,0x5d,0x62,0x24,0x54,0xbf,0x59,0x51,0x1e,0x90,
561   0xe0,0xc0,0x6b,0xb5,0x1c,0xd4,0xde,0x12,0x30,0xf2,0x1c,0x8a,0x41,0x7e,0xc9,0x02,
562   0x72,0xdb,0x88,0x5d,0xe8,0x6e,0xfe,0x80,0xc6,0x9a,0xce,0x4f,0x31,0xc4,0x9d,0xad,
563   0x4d,0x4f,0x0e,0x7e,0x3d,0xa0,0xc6,0xa8,0x26,0x1a,0x69,0x0c,0x2b,0x22,0x9a,0x91,
564   0x71,0x1c,0xfd,0x19,0x1b,0x6b,0x37,0x88,0x4e,0x74,0xec,0xc3,0x2e,0x9a,0xbf,0xae,
565   0x87,0x23,0xca,0xb3,0x25,0x08,0x77,0x4c,0xa6,0x59,0x73,0x39,0x2b,0x0e,0x03,0x94,
566   0xc1,0x16,0xb8,0x72,0xcd,0x15,0x74,0xfa,0xb2,0xae,0x1b,0x4e,0xd5,0x86,0x92,0x93,
567   0x99,0x70,0xf4,0x03,0xa6,0x16,0x4d,0x98,0x24,0x8c,0x71,0x01,0x8e,0x18,0xe2,0x01,
568   0xe8,0xfc,0x26,0x5b,0x36,0x7e,0xc0,0xd5,0x7c,0xe1,0x33,0x32,0xbe,0x69,0x05,0x36,
569   0x00,0x5a,0xb9,0xa5,0x47,0xf8,0xd3,0x43,0x95,0x87,0xd7,0xd4,0xf0,0x4b,0x49,0x1c,
570   0x5a,0x88,0xad,0xe0,0xd9,0x83,0x87,0xe2,0x70,0x7e,0x5b,0xe7,0x22,0xbe,0xae,0xb4,
571   0xf5,0x88,0x02,0x0b,0xec,0x1e,0xdc,0xb2,0x0b,0xc6,0xc1,0x6b,0x56,0xc2,0x33,0xfc,
572   0xd1,0x58,0xb8,0x28,0x80,0xcb,0xd3,0xb3,0x67,0x5f,0x07,0x60,0x8b,0x58,0xda,0xf5,
573   0xee,0xfa,0xcf,0x35,0x95,0x89,0x6a,0xe4,0x85,0x49,0x2f,0xc6,0xc0,0x7e,0xa2,0xa0,
574   0x4c,0x6c,0x47,0x34,0x2b,0x57,0xa2,0x47,0x63,0x84,0x37,0x9d,0xf7,0x35,0x8b,0xfb,
575   0xeb,0xb0,0x20,0x23,0x43,0x37,0x7b,0xdb,0x03,0x10,0x21,0xe6,0x2f,0x7d,0x94,0x07,
576   0xcb,0xc4,0x5a,0x04,0xdb,0x28,0xf6,0xa0,0x63,0xed,0xeb,0x9f,0x67,0x56,0xbf,0xc5,
577   0xeb,0xa9,0xf5,0xd6,0xf4,0x29,0x11,0x96,0x84,0x1b,0x97,0xc9,0xa1,0xc1,0x0b,0x33,
578   0x4d,0x60,0xf1,0x98,0x8e,0x3c,0xcd,0xbc,0x67,0x99,0x23,0x64,0xdb,0xbc,0x78,0x52,
579   0xf0,0xe7,0x4e,0x4c,0xa9,0x60,0x2a,0x14,0x0a,0x69,0x91,0x70,0x17,0x48,0x05,0x22,
580   0xd4,0x02,0xc6,0x67,0x14,0xd6,0x9d,0x53,0xed,0x75,0x20,0x5e,0xe4,0xc3,0x74,0xe9,
581   0x9e,0xa5,0xbd,0x5b,0xbe,0xff,0x1e,0x16,0xe9,0xb4,0xbc,0x7e,0xc3,0xa9,0xba,0xf8,
582   0xef,0xc1,0x3d,0xe8,0x11,0xe1,0x69,0xb1,0xcf,0xed,0x61,0xb8,0xca,0xc8,0x49,0x60,
583   0xa9,0x56,0x46,0x0e,0x0e,0x7d,0x7c,0x26,0x9d,0x1e,0x0e,0x0b,0xfb,0x20,0x21,0x21,
584   0xcc,0x65,0xd8,0xce,0xb3,0xd1,0x58,0x73,0x55,0x49,0xc5,0x77,0x55,0xb0,0x42,0x3b,
585   0x58,0xec,0xf4,0x26,0x01,0xde,0xfe,0x9a,0xf5,0x6d,0x84,0xfb,0xd8,0x7a,0xac,0xae,
586   0x4d,0xec,0x98,0x17,0xf9,0xa5,0x6c,0x99,0x7f,0x89,0x4d,0x99,0x84,0x7d,0x5f,0x7a,
587   0xab,0x65,0xc5,0xa1,0x99,0x24,0xa4,0x72,0xf1,0x9f,0x1f,0x50,0x58,0xb9,0x5b,0x9f,
588   0x72,0x57,0x7b,0xc4,0xe2,0x5c,0xa4,0x23,0x4d,0xad,0xf9,0x1f,0x56,0x2e,0xa0,0x1d,
589   0xa2,0xc2,0xba,0x81,0xd4,0x4e,0x6d,0xae,0x91,0xb5,0xdd,0x08,0x7d,0xdc,0x2d,0xf4,
590   0x3b,0xa6,0x82,0xd6,0x70,0xf8,0x00,0x11,0xbf,0xb6,0xca,0x0a,0xcd,0xc3,0x04,0x24,
591   0x3d,0x03,0xd3,0xc4,0xb4,0x5b,0x5b,0x4e,0xd6,0xaf,0xbf,0x25,0x46,0xe2,0x24,0xad,
592   0xa8,0xd9,0xae,0x4b,0xa1,0x78,0x80,0x63,0xd5,0xa2,0xbe,0x58,0xe7,0x3b,0x8d,0x8f,
593   0x7c,0x28,0x11,0x6c,0x38,0x4d,0x6d,0x51,0xbe,0x8d,0xc6,0xa5,0xb2,0xcd,0x3f,0xca,
594   0xb9,0xf0,0xfd,0x25,0x77,0xdb,0x23,0x19,0x8f,0x72,0xd6,0x0b,0xa6,0x98,0x3a,0x5e,
595   0x5f,0x32,0x72,0x77,0x5f,0x23,0xa3,0xb9,0x4a,0x50,0xf0,0x89,0xc3,0x9c,0x7e,0x4b,
596   0x6e,0xec,0x70,0x62,0xf0,0x23,0xeb,0x33,0xed,0x26,0x13,0x21,0x08,0x28,0xc1,0xcf,
597   0x08,0xa3,0xe7,0xbc,0x3d,0x44,0xfc,0x72,0x23,0x8f,0xc4,0xf3,0xfe,0x08,0x03,0x45,
598   0x13,0x33,0x7d,0x6b,0xa4,0x94,0xf7,0x68,0xf6,0xaf,0x33,0x42,0x4e,0x09,0xf7,0xfc,
599   0xee,0x24,0x05,0x9a,0x1c,0x85,0x23,0x20,0x1a,0xb1,0x13,0x92,0x2e,0x2a,0x9b,0xf4,
600   0x9b,0x76,0x7e,0x4a,0xa4,0x18,0x7f,0x98,0x8f,0x93,0x64,0xe2,0x9f,0x6d,0xf0,0x2d,
601   0x18,0x29,0xe7,0x7b,0x3e,0x4b,0x0d,0xd1,0x55,0x57,0x26,0x34,0xa1,0xd1,0xf6,0xa6,
602   0x66,0x3d,0x42,0x2d,0xe9,0x1f,0xcc,0xcc,0x6c,0xfb,0x59,0x87,0x34,0x56,0xae,0x61,
603   0x86,0xb2,0x8d,0x60,0xa4,0x94,0xbc,0x87,0xd4,0x01,0x03,0x6d,0xbf,0xe1,0x37,0xab,
604   0xc0,0xa6,0x14,0x71,0xab,0xdd,0x04,0x8d,0xe7,0x12,0x2f,0x0e,0xc2,0x2f,0x9a,0x38,
605   0xbf,0xf7,0x49,0x4f,0x62,0x2e,0x41,0x97,0x2f,0x99,0x84,0x54,0xaa,0xfa,0x18,0xca,
606   0x57,0x16,0x00,0x3d,0xba,0xb1,0x3f,0xf2,0x57,0x90,0xdb,0x2b,0xb3,0x75,0xd7,0x2e,
607   0x50,0x26,0x37,0x3d,0xb3,0x65,0xff,0x9e,0x61,0xf8,0x33,0x93,0xdc,0xa1,0xd7,0x62,
608   0xaa,0x26,0xef,0x4e,0x4e,0x4a,0x7f,0x9b,0x4b,0xd1,0x8b,0x8d,0x27,0x7f,0x18,0x68,
609   0x65,0x18,0x28,0x70,0x89,0x60,0xc0,0xe9,0x17,0x1b,0xe5,0x17,0x93,0x0d,0x99,0x3e,
610   0x81,0xfa,0xe2,0xa2,0x65,0xa7,0xc3,0x88,0xc3,0xd6,0xaa,0x8e,0xb1,0xe6,0x88,0x8b,
611   0x8d,0xe3,0xac,0xe0,0x61,0x09,0xba,0x71,0x53,0xbd,0x57,0x21,0x84,0x63,0x27,0xd5,
612   0x1b,0x5e,0xcd,0x71,0x3a,0x12,0xee,0xd8,0x05,0xe5,0x2d,0xee,0xa1,0x39,0x2f,0x98,
613   0x32,0x72,0x97,0xba,0xdb,0xf5,0x0a,0x37,0xc1,0x25,0x2c,0xf4,0x07,0x68,0xa0,0xd4,
614   0xd2,0x1f,0x0b,0xbc,0x46,0xb0,0x10,0x90,0x86,0x7f,0x54,0x33,0xb6,0xf0,0x7a,0x8a,
615   0xfb,0x65,0x27,0x78,0x79,0x45,0xfe,0xe1,0x53,0xf2,0xa4,0xab,0xae,0xd1,0xbd,0xb8,
616   0xae,0x45,0xec,0xec,0x75,0xb2,0xd6,0x2c,0x2a,0x7e,0x1e,0x5c,0xef,0x0a,0x69,0x5f,
617   0xe9,0xbd,0x5a,0x19,0x3b,0xf9,0x96,0x70,0x0a,0x22,0xc1,0x45,0x79,0x9d,0x7e,0x7f,
618   0xad,0xce,0x72,0x00,0xc9,0x18,0xe3,0xcb,0x92,0x39,0x6f,0x2a,0x2b,0x97,0x85,0x8a,
619   0x4e,0x1a,0x67,0x70,0xc1,0xc5,0x5b,0x61,0x46,0x9c,0xa4,0xdf,0xa3,0xa3,0x85,0x70,
620   0x9b,0xde,0x44,0x97,0xf2,0x52,0x24,0xd7,0x6c,0x01,0x69,0xb6,0xcc,0xf0,0x57,0xb7,
621   0xd8,0x24,0x32,0x5e,0x54,0x9f,0x3e,0x2f,0x02,0x66,0xbf,0xae,0xa7,0x7e,0xf9,0x5f,
622   0x07,0xea,0x31,0xc6,0xe6,0xad,0xa9,0x67,0x09,0xcd,0xa6,0xc7,0x32,0x4d,0x6d,0x68,
623   0x27,0x31,0x56,0x58,0x6d,0x37,0x72,0x05,0x0c,0xef,0x6e,0xb1,0x5c,0x99,0x2c,0x83,
624   0xc2,0xda,0x93,0x9d,0xa2,0x56,0x85,0x23,0x5f,0xb0,0xe6,0x3a,0x5e,0x8d,0x9c,0x06,
625   0x03,0x91,0x88,0xaa,0xb1,0x5f,0x90,0x4b,0xcc,0x9b,0x98,0x0c,0xb9,0xad,0xc9,0x2b,
626   0x0c,0xd5,0xb1,0x1c,0x71,0x7f,0x13,0x8f,0x72,0xed,0x74,0x49,0x12,0x64,0x56,0x0f,
627   0x57,0x29,0x3f,0xa3,0x44,0x7f,0xb1,0xcb,0xdd,0xa9,0x32,0x4a,0x26,0xed,0x44,0xe3,
628   0x23,0x8e,0x6d,0x5c,0xd9,0xd0,0x2f,0x78,0x4a,0xf6,0x10,0xfb,0x7b,0x46,0x93,0xa9,
629   0x71,0x03,0x3c,0x46,0x2e,0x71,0x8f,0x96,0xb7,0xd5,0x10,0x5d,0x11,0x71,0x43,0x60,
630   0x3f,0x8a,0xac,0x61,0x44,0x64,0xcf,0x25,0x26,0x44,0x31,0x71,0xe8,0x6c,0x54,0x07,
631   0x8e,0x22,0xbe,0xad,0x1c,0xa8,0xf1,0x25,0x96,0x44,0x73,0x35,0x00,0x39,0xc6,0xa0,
632   0x5e,0xca,0x70,0x29,0xb4,0x3d,0xf4,0x96,0x06,0xd5,0xd5,0xaa,0x59,0xd6,0x99,0x29,
633   0xaf,0x84,0xc3,0xd7,0x0e,0x23,0xd7,0x78,0x78,0xf7,0x59,0xd1,0xf3,0x45,0xcd,0xa4,
634   0x81,0x4f,0xb7,0xb6,0x28,0x5a,0x9c,0xcb,0xeb,0xab,0xfe,0xa8,0xcd,0x84,0x62,0x0f,
635   0xd4,0x2b,0x4d,0xc6,0x03,0xe2,0x41,0x90,0x5e,0xef,0xc4,0x30,0xe9,0x94,0x58,0x6c,
636   0xa8,0x17,0x83,0x07,0xa0,0xbb,0xc8,0xc5,0xd3,0xc4,0xaa,0x6a,0x46,0x76,0xaf,0xba,
637   0xfe,0x15,0x5a,0x79,0xfd,0xe5,0x2f,0x6b,0x49,0x2a,0xb2,0x54,0xe4,0x28,0x67,0xf8,
638   0xd4,0x24,0xd2,0x1b,0x1b,0x60,0x78,0x82,0xbf,0x21,0xdb,0xef,0xc3,0xac,0x80,0x28,
639   0x2b,0x43,0xec,0xef,0xfb,0x2c,0xa1,0x0a,0x37,0xaa,0x25,0x3b,0xe3,0x00,0xfa,0x48,
640   0x03,0x74,0xa6,0xf4,0x9b,0x49,0xac,0x03,0xaf,0xc3,0x8f,0x39,0x44,0x26,0xd5,0x5a,
641   0x5c,0xb6,0x01,0x2a,0xfd,0xb7,0x97,0x6d,0x29,0x6d,0x1b,0xe7,0xe6,0x1c,0x11,0x5c,
642   0x36,0x08,0xfd,0x91,0x1f,0x76,0x64,0x48,0xa4,0xa8,0xc8,0x46,0xc8,0xe4,0xae,0x50,
643   0x91,0x6c,0x9b,0x28,0x02,0x86,0x11,0x94,0x1f,0x74,0x96,0x57,0xec,0x7c,0xac,0x34,
644   0x6d,0xe1,0xd9,0xf1,0xa7,0xe7,0xa0,0x51,0x9c,0xd1,0x84,0x18,0x51,0xe5,0x0b,0x0a,
645};
646
647
648/* 317-0018 FD1089A */
649static const UINT8 key_0018[0x2000] =
650{
651   /* opcodes */
652   0xbb,0x44,0x3e,0x54,0x0a,0xf1,0xd4,0xe9,0x01,0xb9,0xa7,0x8e,0x8c,0x47,0x24,0x71,
653   0x96,0x48,0xb7,0xbc,0x0c,0x68,0xcb,0x9c,0xda,0x53,0xce,0x3c,0xec,0xb4,0x29,0xc9,
654   0x2d,0x38,0x4b,0x6f,0x8a,0x8b,0x9e,0x59,0xee,0x58,0x8f,0xb5,0x46,0x4c,0x8a,0xad,
655   0x7e,0x13,0xfa,0x6d,0x82,0x58,0x4c,0x22,0x3d,0xc9,0xec,0xf8,0x9c,0x0f,0x45,0x1b,
656   0x8b,0xd9,0xc4,0xb6,0xf5,0xd1,0xd5,0xf6,0xc7,0xa4,0xe3,0x07,0xed,0xfd,0x5b,0x14,
657   0x53,0x8a,0xa9,0x4a,0xe4,0xf5,0x38,0xd5,0x8c,0xea,0x75,0xe1,0x39,0x16,0xcc,0x99,
658   0xd5,0x25,0xa9,0x2a,0x4d,0xc3,0x77,0xbf,0x8d,0x9b,0xa3,0x85,0x80,0x5a,0x99,0xa8,
659   0x13,0xac,0xc4,0x54,0x31,0x3d,0x91,0xb4,0xc8,0xb8,0x6b,0xf5,0xc2,0xca,0xc0,0x43,
660   0x0b,0x1e,0xfa,0xc9,0x91,0x61,0x86,0xb4,0x3e,0x3f,0xcf,0x30,0xff,0x64,0x42,0x68,
661   0xbf,0x7b,0x4b,0x89,0x6b,0x31,0x55,0xbf,0xef,0x31,0xcd,0x35,0x36,0x29,0x1f,0x19,
662   0x2e,0xc3,0xb7,0x94,0xc0,0xab,0x00,0xd5,0xdb,0x8f,0x67,0x06,0x69,0x19,0x57,0x54,
663   0x57,0xf5,0x3e,0xeb,0x91,0xd1,0x86,0xf6,0x02,0x57,0x9b,0xa2,0x97,0x34,0xeb,0x1a,
664   0x3c,0x13,0xe0,0x8c,0xdc,0xa1,0xe6,0x22,0x64,0x8a,0x6b,0x08,0xc0,0x7a,0xd9,0x6c,
665   0xdb,0x1c,0x9d,0x78,0xa2,0x1d,0x22,0x59,0x01,0x28,0xd5,0x3a,0xe4,0xeb,0x22,0x48,
666   0x36,0x10,0x75,0xaf,0xe4,0x43,0x39,0x9b,0xd9,0x32,0xdb,0x37,0x03,0x87,0xc6,0xb0,
667   0x4c,0xef,0x68,0x31,0xa0,0x15,0x2b,0xe7,0xed,0xa6,0x7b,0xfe,0x1d,0x4e,0xc6,0xa2,
668   0x1c,0xb8,0x76,0xfe,0xd8,0x92,0xf7,0x3f,0x3b,0x85,0xb7,0x91,0x31,0xf3,0x82,0x20,
669   0xa7,0xf2,0x8f,0x72,0x9e,0xda,0x62,0x94,0xa0,0x39,0x47,0x92,0x79,0x9a,0x88,0x79,
670   0xf5,0x89,0x73,0x54,0xe1,0x92,0x52,0x2f,0x08,0x42,0x73,0x16,0x36,0x24,0x21,0x15,
671   0x37,0xc4,0xa9,0x39,0xd8,0xae,0x55,0x8c,0xe3,0x6e,0x73,0x1c,0x26,0x90,0x4e,0xf4,
672   0x6c,0xa1,0x32,0x20,0x81,0x2c,0x6b,0xad,0x32,0xbd,0x46,0xa6,0x49,0xe0,0x0d,0x16,
673   0x94,0x22,0x0e,0x0b,0xde,0x0d,0x94,0x91,0xf3,0x2f,0xeb,0xb2,0x9f,0x13,0x60,0x7c,
674   0xaf,0x45,0x3d,0xf9,0xed,0x51,0xd0,0x37,0x27,0xc4,0x64,0x41,0x28,0x29,0x45,0x24,
675   0xbd,0x0c,0xc0,0xea,0xb0,0xf9,0x1f,0xa1,0xcf,0x7c,0xb0,0x54,0xe4,0x21,0xbe,0x0f,
676   0xbd,0x75,0x95,0xde,0x26,0x03,0x81,0xcd,0xe9,0x57,0xcf,0xe9,0xd3,0xfd,0xc9,0x3d,
677   0xb1,0x82,0xbd,0xd5,0x4e,0x70,0xf6,0xbd,0x76,0x55,0xc0,0x01,0xf6,0xbc,0x68,0xae,
678   0x98,0x31,0x38,0xcf,0x2a,0x41,0x7e,0x70,0x77,0x76,0x85,0x9d,0x4b,0x5e,0x99,0x62,
679   0x72,0x84,0x06,0xcc,0xb8,0x74,0x19,0xe5,0xea,0xba,0x1d,0xbb,0xd3,0xe3,0x5e,0x59,
680   0x3f,0x79,0x28,0xcc,0xfa,0x0a,0xc7,0x1e,0xd0,0x21,0x87,0x5d,0x8e,0x4a,0xb5,0x93,
681   0xfe,0x12,0x9c,0xce,0xee,0x03,0x88,0x1a,0x2a,0xab,0xc5,0x81,0x7c,0x95,0x9f,0x11,
682   0xb1,0x4d,0x63,0xd4,0x96,0x60,0x5c,0xd8,0xf6,0x58,0xd6,0x28,0x9d,0xc3,0x1d,0xd1,
683   0x57,0x2c,0x7d,0xdd,0xf1,0x1f,0x43,0x5a,0x35,0x28,0xb9,0x53,0xf1,0xd4,0x2d,0xd4,
684   0xf0,0xad,0xea,0xe9,0xfe,0x41,0x3d,0x9f,0xe7,0x1b,0x70,0x00,0x78,0xc7,0xd1,0x1a,
685   0x7c,0xd2,0xab,0xf8,0xbf,0xc6,0x4a,0xa6,0x0d,0x31,0xfa,0x31,0x32,0x9e,0x07,0xa3,
686   0xfb,0x99,0xbe,0x0a,0x32,0xaf,0x6a,0x71,0xa5,0x6a,0x57,0xe4,0x1f,0x58,0xd1,0x6f,
687   0x6c,0x04,0x24,0x1f,0x59,0xfa,0x9d,0xfe,0xb0,0xc6,0x86,0x1a,0x3f,0xf5,0x2d,0x7e,
688   0xd1,0x11,0xdd,0x37,0x32,0xa8,0xe2,0x4f,0x2f,0x45,0x89,0xd4,0x92,0x74,0x1d,0xd1,
689   0x29,0xc2,0xe9,0x52,0xbf,0xb9,0x3b,0x63,0x20,0xe7,0x5f,0x10,0x18,0xd7,0x9f,0x66,
690   0x74,0x15,0x49,0x6f,0xff,0x2e,0xa7,0x39,0x75,0x02,0xcb,0x0b,0x8c,0xd0,0x46,0x76,
691   0x36,0xd3,0x49,0x6d,0x1e,0x78,0x01,0xdb,0xf1,0x2b,0x9a,0xad,0x5b,0x57,0x59,0xe3,
692   0xa5,0x00,0xb4,0x97,0x3f,0xb8,0x30,0xa6,0x9f,0xd2,0xd7,0xdd,0x51,0x98,0xb7,0x06,
693   0xe2,0x58,0xdb,0xef,0xdc,0x5d,0x4f,0x63,0xcd,0xf3,0x20,0x2f,0x77,0xd6,0xb1,0x6c,
694   0xe6,0xaa,0x1c,0xad,0x07,0x42,0x0e,0xe8,0x46,0xcb,0x75,0xca,0x0f,0x71,0x3b,0xff,
695   0xcd,0x60,0x4c,0x32,0xe0,0xd8,0x37,0x92,0xb0,0x39,0x6c,0xc7,0xbd,0x64,0x24,0x69,
696   0x53,0x62,0x2b,0x06,0xbe,0x58,0xa4,0x0a,0x8e,0x8b,0xeb,0x50,0x49,0x7f,0xe5,0xec,
697   0xad,0x1e,0x3e,0x4a,0xe6,0x55,0xa2,0xd5,0x1f,0x0f,0xbc,0xfa,0x86,0x39,0x39,0x24,
698   0x44,0xbf,0xc5,0xc0,0x88,0x8d,0x0b,0x3a,0x7c,0x8e,0xb8,0xfe,0x4d,0xaf,0x78,0x77,
699   0x27,0xdc,0xf6,0x12,0x35,0x00,0xdf,0x3b,0xa4,0x08,0xdf,0x5d,0x9f,0xe0,0xa2,0xe5,
700   0x54,0x73,0xd3,0x3f,0xed,0xae,0x1f,0xd6,0x96,0x7d,0x31,0x17,0x7d,0xcb,0xb7,0x6e,
701   0xcc,0x85,0x5a,0x46,0xb0,0x97,0xc9,0x0d,0x54,0xed,0xae,0x2c,0xe5,0x72,0xb6,0x12,
702   0x8f,0x13,0x8d,0x29,0x7e,0xbb,0xde,0xde,0xdd,0x57,0x56,0x9d,0xd9,0xd3,0xa1,0xd1,
703   0x9d,0x1b,0x6b,0xe7,0x56,0x1a,0x5f,0x4b,0x30,0xbd,0x29,0x68,0x57,0xf0,0x77,0xab,
704   0xf6,0x9e,0xf3,0x80,0x3a,0xb4,0x4a,0x52,0x4f,0x1e,0x27,0x8e,0x60,0xc8,0x38,0xa0,
705   0x9b,0x9d,0x27,0xf3,0x29,0x8a,0xa0,0xf5,0x39,0x7a,0x50,0x0f,0xf5,0x5a,0xe3,0xb0,
706   0x8a,0x16,0x05,0x42,0x23,0x9a,0x61,0x32,0xed,0xd1,0xa5,0xec,0x14,0xa8,0x7a,0xdb,
707   0xc4,0x0a,0x8f,0x6c,0x28,0xe5,0x8e,0x0b,0x6d,0x23,0x24,0x23,0xbf,0xb0,0xfc,0x21,
708   0x49,0x7a,0xc3,0x71,0x38,0x6b,0x25,0x7e,0xb8,0x70,0xce,0xb5,0xf4,0x74,0x69,0x82,
709   0x19,0x64,0xa3,0x50,0x53,0x2c,0x27,0x8c,0xcd,0xb7,0xa3,0xa2,0xb5,0xf3,0xc1,0xfe,
710   0x34,0xc9,0x2d,0x0b,0x79,0x28,0x95,0x36,0xae,0xfa,0xa3,0xeb,0x00,0x2c,0x03,0x95,
711   0x9b,0xaa,0x63,0xa1,0xaa,0x5f,0x6d,0x7a,0x5a,0x38,0xce,0x8e,0xd6,0x21,0x31,0x47,
712   0x4c,0x05,0x43,0x12,0xe6,0xd1,0xb0,0x5a,0xd0,0x71,0x24,0x8c,0x38,0xd0,0x4a,0x14,
713   0x48,0xdc,0xcf,0x5d,0x2d,0x7e,0x5f,0xd4,0x12,0xa5,0xa5,0xe5,0x24,0x3b,0x4e,0xfc,
714   0x8f,0x2d,0x05,0x84,0x7f,0x66,0x78,0xea,0x1f,0xd4,0x51,0x99,0x9c,0x61,0x3d,0xff,
715   0x21,0xf9,0xe7,0x86,0xdb,0x8a,0xfc,0x9a,0xf6,0xfe,0x28,0xa9,0x9e,0x41,0x16,0x1d,
716   0xfb,0x5a,0xe2,0x91,0x45,0x9c,0xbd,0xf0,0xe4,0x7c,0x0b,0xdb,0xe2,0x81,0x2e,0xef,
717   0x78,0xe0,0xb9,0x7a,0x0f,0x7e,0x6c,0x78,0x42,0xf1,0x38,0x99,0xd9,0x7e,0x39,0xce,
718   0x1c,0xd4,0x65,0x4a,0x6e,0x77,0xdc,0xa8,0xcc,0xda,0x0a,0x70,0x3a,0xde,0x0d,0x5c,
719   0x6e,0x95,0xb3,0x56,0xce,0x7a,0x77,0x6e,0x51,0x8e,0x08,0x15,0x69,0xcd,0x83,0x38,
720   0x5a,0xc5,0x92,0xfc,0x25,0xb3,0x0e,0x37,0xfc,0x84,0x01,0x6f,0x41,0xd7,0xa3,0xd8,
721   0xfe,0x41,0x74,0x62,0x43,0xe8,0xeb,0xe6,0x99,0x22,0x2a,0x13,0x2b,0xdd,0xdb,0x56,
722   0x27,0x03,0xab,0x1a,0xb6,0x81,0x46,0xcc,0x07,0x42,0x57,0xd8,0x44,0x33,0x8b,0xaa,
723   0x9a,0xd5,0xe7,0x98,0xf5,0xe0,0xbb,0x1d,0x80,0xf2,0xc0,0x2f,0x24,0xd7,0x84,0x1a,
724   0xeb,0x5b,0x92,0x2b,0xe3,0x4b,0x77,0xad,0x17,0x72,0xbd,0xeb,0x93,0x9c,0xf2,0x34,
725   0x63,0x95,0xa0,0xd1,0x93,0x29,0x56,0x0f,0x30,0x25,0x9d,0x3b,0x45,0x53,0x02,0xa0,
726   0xde,0x81,0x12,0x8a,0x07,0x7a,0x58,0x45,0xcd,0x0b,0x60,0x1d,0x3a,0xfe,0xb6,0x5f,
727   0x5c,0x21,0xe6,0x56,0x3e,0x3f,0x7d,0x4e,0xec,0x24,0x05,0x93,0x72,0x9c,0x0c,0x71,
728   0xdd,0x74,0x1d,0x35,0x37,0x76,0xc5,0x29,0x98,0xec,0xef,0x3d,0x92,0xf1,0xd9,0x74,
729   0xc7,0xe4,0x14,0x0f,0x25,0x72,0x0e,0x3a,0x95,0x46,0x31,0x23,0x06,0x0e,0xea,0xf4,
730   0x62,0x73,0xa4,0xda,0x96,0x24,0xcc,0x00,0x8d,0xcb,0xce,0x93,0x34,0x15,0x16,0xbf,
731   0x77,0xae,0x0f,0xb0,0x42,0x41,0x26,0x91,0x80,0x7b,0xc6,0x8f,0x1e,0x08,0x5d,0xd5,
732   0x08,0x94,0x54,0x91,0x29,0xca,0x1a,0xec,0x6e,0x56,0x19,0x15,0xc3,0xe6,0xbe,0x36,
733   0x13,0x24,0x75,0x7c,0x4b,0xbd,0xaa,0x13,0x57,0x5c,0xc8,0x27,0x22,0xaf,0x3b,0xe3,
734   0x99,0x60,0x71,0x73,0xa8,0x1b,0xd4,0x05,0x3b,0x8e,0xd1,0xc3,0x3d,0x63,0xd3,0xda,
735   0x9b,0x46,0x48,0x75,0x8d,0x91,0x3f,0x53,0x18,0x1f,0xea,0x9f,0xb7,0xac,0xaf,0x50,
736   0x34,0xc3,0xd8,0x70,0x5d,0xf1,0xb3,0x0d,0xfd,0xc0,0x8b,0x32,0xe0,0xbe,0xac,0xec,
737   0xd2,0x76,0x62,0x45,0x9f,0x74,0xfa,0x4b,0x14,0x44,0xbe,0x09,0xfb,0x72,0xfc,0x8b,
738   0x22,0x8b,0xff,0xdd,0x54,0x1a,0x13,0x0b,0x5e,0xab,0x85,0x22,0x0a,0xca,0x9f,0x2c,
739   0x26,0x03,0xaf,0x37,0x7d,0xe3,0x00,0x4f,0xdb,0xf4,0xde,0x7e,0x0c,0xc4,0x96,0xd1,
740   0xdc,0xde,0x72,0x55,0x18,0xcf,0xc0,0x15,0x8b,0x21,0xcb,0x1d,0x01,0x62,0xdf,0x79,
741   0x46,0x1d,0x48,0x36,0x26,0xde,0x52,0x5e,0x6e,0x31,0x4a,0xff,0xe9,0xa2,0x7b,0x24,
742   0x63,0xbe,0x31,0xd9,0xa8,0x10,0xb8,0x2b,0x84,0x24,0x5d,0x24,0xc3,0x86,0x6a,0xd2,
743   0x32,0xc2,0x2d,0x4d,0x3b,0x91,0x33,0x5c,0xd6,0x23,0xb2,0x0b,0x04,0xea,0xb9,0x46,
744   0x70,0x53,0x76,0xf8,0xc7,0xca,0x12,0x0e,0xb5,0xba,0xbc,0x74,0xe5,0x90,0x9e,0x15,
745   0x05,0xb8,0xe5,0xde,0xbe,0x9d,0xbd,0xbb,0xbf,0xac,0x52,0x97,0xb2,0x51,0xcf,0x60,
746   0x44,0xf8,0x60,0xff,0x21,0x0c,0x33,0x63,0xf4,0xfa,0x72,0x76,0x6a,0x2d,0x4a,0x25,
747   0x2f,0x12,0xe6,0x5b,0xee,0x15,0x73,0x06,0x54,0xa2,0x1d,0x10,0x0d,0x24,0x10,0x65,
748   0xc4,0x08,0x77,0xf3,0x26,0xba,0x7f,0xa4,0xdf,0xa5,0x54,0x64,0x9b,0x36,0x21,0x21,
749   0x05,0xd9,0x13,0xc5,0xca,0xf9,0x56,0x3c,0x95,0x03,0x15,0x74,0x13,0x63,0x7d,0x57,
750   0xf0,0x85,0xba,0xd2,0xd8,0xd4,0xf7,0xd0,0x76,0xbd,0x62,0x3e,0x77,0xab,0x24,0x08,
751   0x87,0x0b,0x6c,0x1a,0x51,0x49,0x64,0x5f,0x82,0xd1,0x39,0xc4,0xc6,0x0e,0x17,0x35,
752   0xc8,0x6d,0x29,0x9d,0x36,0x5a,0x9c,0xe9,0xb9,0xaa,0xfd,0x85,0x6e,0x97,0x42,0xc3,
753   0x32,0x19,0x27,0xdc,0x3c,0x7d,0xb9,0x9d,0x18,0x0e,0x03,0xd1,0x52,0x17,0x11,0x43,
754   0x77,0xe6,0xef,0xc2,0x12,0xc7,0xa9,0x17,0xaf,0x04,0x4c,0x0f,0xda,0xeb,0xe3,0x77,
755   0x1f,0xc6,0x7a,0x1a,0x0b,0xe3,0x1d,0xc4,0x29,0x8d,0xd8,0x41,0x05,0x11,0xb8,0x5e,
756   0x2b,0xb9,0xc7,0xe5,0x27,0xd3,0x13,0xa4,0x85,0xaa,0xa7,0x66,0xd2,0x8a,0x8f,0xf7,
757   0x99,0xbf,0xd8,0x24,0x66,0x96,0x8c,0xb7,0xc5,0x59,0xb9,0x7e,0x43,0x56,0x6a,0x44,
758   0x6a,0xd8,0xac,0xd5,0xc8,0x2b,0x89,0xfd,0xe8,0x9c,0x0e,0x89,0x56,0x75,0x48,0x43,
759   0x9e,0x04,0x42,0xf9,0x4d,0x94,0x08,0x76,0xee,0x71,0xa7,0x86,0x0d,0xe8,0x29,0xf6,
760   0x36,0x43,0x9c,0x91,0xf5,0xd0,0x0b,0x22,0xd6,0xda,0x82,0x77,0x66,0xad,0x0d,0x5b,
761   0x30,0x95,0xb8,0x9b,0xc0,0xde,0xe1,0x38,0x28,0x80,0x29,0x57,0xb9,0xa9,0x5d,0x15,
762   0x4b,0xe7,0x69,0x1d,0x4c,0x65,0x38,0x1d,0x25,0x51,0xb8,0xbf,0x45,0xd4,0xd3,0x4d,
763   0x72,0x3b,0x08,0xbf,0x75,0x24,0x59,0xe3,0x85,0xa5,0xfc,0x45,0xee,0xcb,0xbe,0x71,
764   0xfd,0xa0,0x6c,0xf3,0xfd,0x32,0xd1,0x57,0x39,0x8c,0xb9,0x2a,0x00,0xbb,0xf0,0xf7,
765   0x9b,0xc9,0x42,0x4a,0x57,0xc4,0x7c,0xaf,0x81,0xb6,0x68,0xb3,0x64,0xad,0xd4,0xe0,
766   0x4c,0xb5,0x8b,0xc4,0x85,0xd8,0x5a,0xea,0x5b,0x24,0x8c,0x83,0x6f,0x76,0xc8,0xcf,
767   0x63,0xf4,0xbe,0xf9,0x07,0xa5,0x1b,0x6d,0x88,0x76,0x8b,0x96,0x11,0x52,0xb9,0xe1,
768   0xd0,0x27,0x52,0xb9,0xef,0xdf,0x02,0x8c,0x9a,0x66,0x74,0xc4,0xfe,0xaa,0x56,0xce,
769   0x47,0x95,0x51,0x15,0xa1,0x13,0x14,0x06,0x38,0x12,0x49,0x0d,0x37,0x7c,0x9d,0x95,
770   0xca,0x3e,0xbc,0x0b,0x1f,0x43,0x51,0xdb,0x60,0x79,0x09,0x71,0xba,0xc9,0x90,0x38,
771   0x58,0x22,0x91,0x9d,0x68,0x6e,0xb9,0x0b,0x13,0x9a,0xb4,0xf0,0x88,0x92,0x2d,0xb6,
772   0xf1,0x41,0xd1,0xc9,0x7b,0x94,0x4c,0x97,0x52,0x77,0x4a,0x8a,0xa1,0xd5,0x76,0x0e,
773   0x95,0x9b,0x7d,0x91,0x5a,0xb5,0x0a,0x7d,0x1b,0x0e,0xca,0x3f,0x05,0x93,0x69,0x42,
774   0x44,0x30,0x93,0xf3,0x04,0xd1,0xf3,0xbe,0x70,0x61,0x36,0x0f,0xb4,0xcd,0x08,0x51,
775   0xfe,0x00,0x14,0xf1,0x78,0xe8,0x07,0x5a,0x4f,0x6f,0x8d,0xfa,0xaf,0x81,0x51,0x3b,
776   0xc3,0x0b,0x01,0x89,0xb8,0xf9,0x46,0x52,0xb9,0x37,0xcf,0x00,0xf4,0xb1,0x46,0xff,
777   0x93,0x52,0x58,0xbd,0xc3,0x06,0xb0,0xa4,0xaf,0xbb,0xfc,0x21,0x84,0x5b,0xe6,0x9f,
778   0x6e,0xd3,0x1a,0x8b,0x98,0x0e,0x45,0x51,0x2f,0xf9,0x13,0x5d,0x5f,0x80,0x30,0x1a,
779   0x54,0x8f,0x47,0xf5,0x39,0x11,0x05,0x59,0x3b,0xf3,0x16,0xb4,0x85,0x21,0x26,0x70,
780   0x45,0x86,0xe0,0xf9,0xa5,0x0f,0xf1,0xbd,0xd1,0xa8,0x04,0x26,0xf6,0x3c,0xc6,0xa0,
781   0xeb,0xbf,0x52,0x1a,0x72,0x45,0xc3,0x10,0xf1,0x7e,0xd3,0xbf,0x74,0x36,0x0c,0x73,
782   0x07,0x39,0xfc,0x78,0xb6,0x53,0x2e,0x1b,0x8e,0x50,0x2e,0xa6,0x99,0xfd,0x89,0x67,
783   0xe5,0x25,0xc9,0xa9,0x7e,0x94,0x7c,0xb8,0x6e,0x16,0x2d,0xe0,0xc2,0x78,0x68,0x6e,
784   0x84,0xf8,0x5f,0x59,0x87,0xe6,0xcf,0x87,0x3c,0x4d,0xba,0xa7,0xc5,0x8c,0x1c,0xaf,
785   0x87,0x84,0xb9,0xad,0xc8,0x08,0xad,0xe8,0x91,0xcf,0xce,0x6e,0xee,0xa5,0xaa,0x88,
786   0xec,0x57,0xcc,0x83,0x95,0xaf,0xc0,0xac,0xf7,0x7b,0x13,0x4e,0x1d,0x86,0x4f,0xb5,
787   0x13,0x9c,0x02,0x2d,0xe6,0x89,0xb7,0x02,0xa0,0x1a,0xfa,0x81,0x4f,0x19,0x58,0xf5,
788   0xfe,0x54,0x5b,0xaa,0xb9,0x96,0x91,0xec,0x8c,0xac,0x85,0x07,0x84,0x60,0xc3,0x48,
789   0xac,0x80,0xd7,0xf9,0x0f,0xd6,0x4e,0x68,0xbc,0x30,0xb2,0xe0,0xbc,0x5a,0x91,0xae,
790   0x1c,0x1e,0x76,0x1c,0xe9,0x49,0xee,0x78,0x2e,0xa8,0x83,0x0d,0xf7,0x06,0xc3,0x27,
791   0x50,0x2f,0x38,0x12,0x45,0xf0,0x70,0x1a,0xe3,0x13,0xf6,0x8c,0x35,0x66,0x57,0xb2,
792   0x47,0xb4,0x1d,0xda,0x25,0xc9,0xd6,0x50,0xdb,0x71,0x0d,0x5e,0x75,0x78,0x4e,0x51,
793   0x00,0xab,0x25,0x76,0x87,0xd5,0x1f,0x18,0x16,0xc2,0xc6,0x83,0xb9,0x3e,0xa8,0x03,
794   0x7d,0x15,0x50,0xe5,0x6c,0x14,0x4b,0x73,0x94,0x05,0x23,0xfb,0x00,0xb6,0x66,0xc8,
795   0xbc,0xf3,0x9e,0x27,0xd5,0x86,0x59,0x62,0x55,0x3c,0x22,0xc7,0x4a,0xe2,0x86,0xa0,
796   0xbf,0x43,0x0f,0x3b,0xc0,0x2b,0x4b,0xe3,0x5a,0x66,0xc5,0xe5,0x97,0xc1,0x09,0x8b,
797   0x85,0x06,0xa3,0x23,0x2f,0x03,0x20,0xf8,0xa1,0x83,0x0a,0x56,0xe7,0x52,0xef,0x89,
798   0x0d,0x3d,0x5a,0xde,0x20,0x0e,0xd8,0x9f,0x2b,0x93,0xf3,0x1a,0x3a,0x97,0x39,0x9a,
799   0x59,0xe6,0x34,0x6b,0x94,0x4c,0x72,0xda,0xf8,0x96,0x7f,0x31,0x90,0x8e,0xe5,0xbe,
800   0x68,0x02,0x31,0xcc,0x8c,0xbd,0xf0,0xa7,0x08,0x8b,0xad,0x9c,0xe9,0x39,0xf4,0xf5,
801   0x39,0x91,0x51,0x00,0x06,0x61,0x51,0x08,0x5b,0x74,0x7f,0x59,0x44,0x96,0x66,0x3f,
802   0xce,0x94,0x94,0x06,0x04,0x38,0x95,0xfb,0xf1,0x50,0xf3,0x69,0xa3,0xa7,0x3c,0x9c,
803   0x26,0x09,0xfa,0xe0,0x84,0x42,0xbb,0x82,0xca,0x1f,0x0b,0xcc,0x05,0x6b,0x74,0x0c,
804   0x55,0xea,0x7c,0x2d,0x7a,0x6a,0xc3,0x31,0x7e,0xbd,0x7f,0xfd,0x4d,0x8f,0x1d,0xbf,
805   0xd4,0x8b,0x09,0xa1,0xff,0x5e,0xae,0xcf,0xba,0xb3,0x79,0x77,0xf0,0x37,0xd6,0xc3,
806   0x8f,0x96,0x30,0xdf,0x80,0x7c,0xf4,0xf9,0xb2,0x94,0x8e,0x3b,0x0f,0x8b,0x6a,0xd1,
807   0x84,0x0c,0xf3,0xe9,0xfc,0xc5,0x96,0xad,0x64,0x60,0xbe,0x4a,0xa8,0x89,0xd8,0xeb,
808   0xb4,0xee,0x50,0xbe,0x73,0x39,0x92,0xec,0xd2,0x16,0x09,0xa4,0xbd,0x33,0x22,0x10,
809   0x1f,0x3a,0x49,0x5d,0xe5,0xd8,0xe9,0xb7,0xfb,0xb8,0x6f,0x49,0x4c,0x87,0x47,0xdf,
810   0xd2,0x99,0xe8,0x5b,0x1d,0x9f,0x43,0x0e,0x5b,0x83,0x96,0x06,0x58,0xd2,0x30,0x4f,
811   0xe0,0x17,0x5a,0xf3,0xbf,0xdd,0x61,0x00,0xc2,0xb3,0x92,0x80,0xb3,0x22,0x37,0x81,
812   0x60,0xb8,0x9e,0x0e,0x94,0xff,0x13,0x34,0x1b,0x85,0xe0,0xfd,0xc2,0xd5,0x52,0x77,
813   0x53,0x7c,0xb6,0xad,0x9c,0x04,0x57,0xab,0x68,0xfb,0x81,0x7d,0x83,0xec,0x80,0x30,
814   0xba,0x63,0xa1,0xce,0xd7,0xec,0x2e,0x65,0xa8,0x13,0x75,0x00,0xf8,0x65,0xc1,0xab,
815   0x93,0x6d,0x5f,0x73,0x45,0xb7,0x99,0x62,0xdb,0xcf,0xbc,0x86,0x1f,0x41,0x15,0xea,
816   0xdf,0x9a,0xef,0x9a,0xe6,0x64,0x74,0x8b,0xd9,0x2d,0x01,0xab,0x8b,0x3c,0xc4,0xc4,
817   0xa8,0xd8,0xe7,0xc0,0xdc,0x6f,0x96,0x8b,0xd3,0x6b,0xff,0x13,0x38,0x39,0x4c,0x42,
818   0xb8,0x44,0xa9,0x05,0xfe,0xf9,0x44,0x47,0xb7,0xc4,0x47,0xf5,0x8f,0x10,0xde,0xfb,
819   0x32,0x4a,0x37,0x44,0x4b,0xde,0x7c,0xbe,0x87,0x38,0xda,0x52,0x92,0xc3,0x7c,0xef,
820   0x17,0xec,0x90,0x7f,0xc3,0x1f,0x3f,0xef,0x42,0xc7,0xb8,0x2b,0x3f,0x51,0x25,0x1e,
821   0x67,0x28,0xb3,0xb5,0x66,0xba,0x8e,0xdc,0xe8,0x71,0xe1,0x7e,0x98,0xb9,0xd9,0x88,
822   0x23,0x00,0xa2,0xe6,0x34,0xb0,0x67,0x83,0x78,0x36,0x55,0x4d,0x9b,0xfd,0x98,0x2d,
823   0x49,0x72,0x5c,0x12,0x2d,0x01,0xcc,0xe6,0xf4,0x16,0x15,0x96,0x4a,0x1c,0x62,0x0d,
824   0xda,0x80,0xe0,0x39,0x51,0xad,0xbb,0x04,0x5b,0x11,0x1f,0x5a,0xa3,0x16,0x37,0x29,
825   0xd7,0x28,0x30,0x5b,0xa0,0xb5,0x36,0xdc,0xad,0x27,0x74,0x9a,0xa8,0xea,0x17,0x7f,
826   0x3e,0x6c,0x4b,0x77,0x1a,0x17,0x3b,0x70,0xea,0x58,0x14,0x54,0x58,0x9a,0x02,0x10,
827   0x10,0x4a,0x30,0x8f,0xbf,0xd4,0xcb,0xbe,0x11,0xa4,0xff,0x89,0xb2,0x25,0xf8,0xdc,
828   0x4d,0xc4,0xe1,0xa2,0x90,0xec,0xe7,0xc8,0x24,0x0b,0x35,0x3a,0xb8,0x8b,0xf9,0xe3,
829   0xf6,0xd8,0x5d,0xb0,0x8b,0x60,0x8d,0x8d,0x22,0x8d,0xb7,0x65,0x68,0xcb,0x05,0x25,
830   0x09,0x88,0xa3,0xb9,0xb1,0x2e,0xbf,0x0c,0x0b,0x2a,0x83,0x0b,0xc4,0xe7,0x1b,0xa2,
831   0xa5,0x52,0x51,0x3f,0xfb,0x58,0xcc,0x20,0x1f,0x48,0x7c,0xb1,0x9d,0x6c,0x6c,0xbd,
832   0x02,0x12,0xa8,0x10,0xd8,0x86,0x3c,0x76,0xad,0x12,0x35,0xbb,0x0d,0x03,0x9e,0xac,
833   0x82,0xa6,0x82,0x14,0x99,0x46,0xf0,0xbf,0xdf,0x2f,0xf1,0x79,0xdf,0xad,0x92,0x0e,
834   0x25,0x0d,0xe0,0x4b,0x3d,0x99,0xe6,0xfa,0xb3,0x9f,0xb0,0xe9,0x14,0x6a,0x4a,0xe4,
835   0xeb,0x47,0xc0,0xb5,0xc4,0x80,0x1f,0x29,0x2b,0x62,0x72,0x0d,0xac,0x3a,0xc5,0x2c,
836   0xd4,0x53,0x24,0x52,0x2e,0xf9,0x9b,0x4b,0x45,0x79,0x36,0xe4,0xa8,0x1d,0x02,0xe7,
837   0xe0,0x33,0x0a,0x22,0x7a,0x06,0x5a,0x60,0x03,0xe2,0xfe,0x6d,0x06,0x13,0x03,0x15,
838   0x0f,0xe6,0x73,0x25,0xaa,0xa5,0x5c,0x68,0x63,0x9e,0xc9,0xaa,0xc7,0x1c,0xc6,0xb7,
839   0x61,0x6b,0x60,0x5b,0xbd,0xd8,0xa1,0x63,0x67,0xad,0x97,0x99,0xeb,0x38,0x4d,0xcb,
840   0xd6,0xc4,0xcf,0xc4,0xb3,0x9d,0x2a,0x50,0x0d,0x0f,0x68,0x3c,0x73,0x67,0x97,0x52,
841   0x6e,0xf0,0xc2,0x60,0x8b,0xf6,0xf5,0x31,0x57,0xc5,0x3c,0x91,0x5d,0xa9,0xa3,0x4d,
842   0x29,0xee,0x37,0x2f,0x47,0xe1,0x03,0x05,0x44,0xcd,0x13,0x9a,0xaa,0xfe,0x73,0xba,
843   0x07,0xc0,0x2f,0x31,0xe6,0x5f,0x54,0xcc,0xd3,0x28,0xed,0x56,0x5a,0x66,0x06,0x9a,
844   0x72,0xaf,0x1d,0x45,0xc6,0x74,0x18,0xbd,0x71,0x49,0x95,0x1e,0x56,0x4b,0x4e,0x1d,
845   0x86,0x48,0x2c,0x1f,0x42,0xbd,0x4a,0x3a,0xfb,0xd8,0xf0,0x34,0x54,0x76,0x98,0x81,
846   0x1e,0x24,0xec,0x48,0x5a,0x21,0xc4,0x5e,0x3a,0x59,0x2c,0x48,0x1f,0x6b,0x5b,0x3d,
847   0x9b,0xa3,0xbc,0x20,0x6f,0x00,0xe8,0x89,0x8d,0x2e,0xa8,0xbc,0x16,0x8b,0xf7,0xaf,
848   0x5c,0x25,0xfd,0x07,0xe1,0xb9,0x14,0x1a,0x55,0xb5,0xc5,0xee,0x9a,0x36,0xcb,0x37,
849   0x08,0x65,0xab,0x66,0x68,0x71,0xe8,0x86,0x06,0xd6,0xca,0xc4,0x6e,0xe1,0x5b,0xee,
850   0x2c,0xdc,0xa9,0xcf,0xcc,0x15,0xbf,0x33,0xdb,0xd7,0xa9,0xe6,0xe4,0x6f,0x74,0xb4,
851   0x73,0x27,0x2b,0x6a,0x14,0x4d,0xd9,0xd2,0x54,0x2c,0x8c,0xba,0xbd,0x10,0x50,0xed,
852   0xdd,0x45,0x2f,0x38,0x3f,0x17,0x36,0x65,0x6f,0xd3,0x72,0x42,0xf9,0xc4,0xee,0x9a,
853   0x6a,0x36,0xb6,0x39,0x4d,0x75,0xd7,0xeb,0x2e,0xcd,0x5b,0x7c,0x99,0x8b,0x50,0xb9,
854   0x1a,0xf9,0xc1,0x6d,0x3d,0x65,0xba,0x64,0x8f,0x1a,0x47,0x6a,0x9b,0x65,0x74,0x4b,
855   0xed,0x90,0x4e,0xd4,0x11,0xe9,0xe0,0xd0,0x94,0xba,0x36,0x0b,0x00,0x51,0x5c,0x51,
856   0xe3,0xfa,0x5e,0x6e,0xc8,0xff,0x49,0x2e,0x3b,0xae,0x28,0x5e,0xc8,0x51,0x07,0xc9,
857   0xfc,0x36,0xf2,0x3b,0x62,0xa9,0xf5,0x80,0x86,0xf4,0x1d,0x65,0xf4,0x64,0x74,0xb4,
858   0x38,0x46,0x08,0x3b,0xde,0xe5,0xe4,0xc5,0x73,0x8d,0x15,0x1e,0x82,0x8a,0xa5,0x13,
859   0x97,0x29,0xa2,0x6e,0x3e,0xb4,0x16,0xfd,0x04,0x79,0x0f,0x8b,0x73,0xc3,0x99,0xe4,
860   0x19,0xde,0xbe,0xd4,0x81,0x17,0x8c,0x28,0x37,0xb8,0x0d,0xaa,0xc8,0x0f,0x4f,0x28,
861   0xbe,0x67,0x5d,0x6d,0xa7,0x0c,0x44,0x46,0x0e,0x4b,0x0e,0x7d,0x7f,0x6e,0xc9,0xe0,
862   0x86,0xc3,0x80,0x39,0xb0,0x95,0x3f,0x56,0x87,0x30,0x12,0x03,0x99,0xe0,0x06,0x0a,
863   0x71,0xf2,0x25,0x39,0x9b,0xb0,0x7d,0x5a,0xa4,0x68,0x19,0x3b,0x16,0x65,0x05,0xa7,
864   0x7f,0xf3,0x4e,0x6b,0x6a,0x5f,0xfe,0x51,0x63,0xf3,0x23,0x27,0xf7,0xfd,0xc8,0xb8,
865   0xb0,0xc8,0xf9,0xd0,0x1c,0xa0,0xc2,0x3b,0xc6,0xd1,0x30,0xc5,0x3a,0xa8,0x4d,0x3b,
866   0x04,0x70,0x27,0x68,0xb1,0x75,0xc9,0x18,0xcb,0x03,0x80,0x2a,0x93,0x32,0x18,0x22,
867   0x27,0x29,0x84,0x22,0xa5,0x9c,0xb0,0xd4,0x79,0xb8,0x87,0xe5,0x0e,0xa9,0xf6,0x01,
868   0xd2,0x9a,0xe8,0xd3,0x2e,0xb8,0x4a,0x08,0x91,0x2f,0x08,0x4c,0x65,0x2b,0x0e,0x4a,
869   0x17,0xd7,0x47,0xaf,0x13,0x60,0xa0,0x27,0xc4,0xf1,0x04,0x5d,0x97,0xb8,0x61,0xfe,
870   0xf8,0xdf,0xa1,0xb6,0x52,0x92,0xb0,0x31,0x12,0xff,0x7c,0x1a,0xa4,0x50,0xef,0x1e,
871   0x73,0xb1,0xf6,0xe8,0xec,0x50,0x7c,0x25,0x7b,0x57,0x6e,0x81,0x8b,0xf3,0xb8,0xa8,
872   0x8a,0x4f,0x45,0x45,0xe1,0x98,0x03,0x05,0xff,0xfa,0xdc,0x94,0x4e,0xa0,0xbc,0x9d,
873   0x3b,0xb8,0x90,0xcd,0x32,0x6c,0x44,0xd0,0x9e,0xe8,0xc4,0x51,0xac,0xe7,0x82,0x90,
874   0x59,0x06,0x54,0x43,0xc4,0x6e,0x2a,0xe3,0x38,0x2b,0xcf,0xfe,0x02,0x47,0x10,0x1f,
875   0x6c,0xd0,0xb7,0xd2,0xc4,0xd1,0x92,0xa4,0x54,0x56,0x6c,0x1f,0x6a,0x6b,0x11,0xd1,
876   0x52,0x1c,0x4d,0x45,0x56,0x76,0xed,0x07,0xc4,0x84,0xbc,0xa4,0xe6,0x51,0x85,0xa6,
877   0x0a,0xec,0x17,0x9b,0x7c,0x5e,0x3b,0x0e,0x86,0xb4,0xbe,0x8b,0x75,0xfb,0x6d,0x9e,
878   0x96,0x3e,0x13,0xd4,0x34,0x89,0x7c,0xb7,0x9b,0xe8,0x74,0xd5,0x17,0x68,0xc7,0xb9,
879   0xf5,0x13,0x42,0xef,0x7f,0xf7,0xaf,0x04,0x03,0x1f,0xdc,0x82,0xcc,0x97,0x94,0xf7,
880   0x26,0x6c,0xa4,0xee,0x5e,0xa8,0xd6,0xf3,0xbe,0x59,0xf8,0x93,0x94,0x8a,0xd5,0x58,
881   0x2b,0x47,0x39,0xd0,0xcf,0x9c,0xf0,0x86,0xcd,0x96,0xc7,0x06,0x6f,0x88,0xdc,0x03,
882   0xa6,0x01,0x95,0xd4,0xd4,0xfd,0xf4,0x77,0x8e,0x0a,0xf6,0xc9,0x92,0x2f,0x77,0x6b,
883   0x6a,0x5b,0xe1,0x8b,0x01,0x39,0xa1,0x53,0x44,0x76,0x22,0xf0,0x1f,0xbd,0xd1,0x8d,
884   0x7e,0xbc,0x1a,0x57,0x4c,0x1d,0x69,0x7a,0x76,0x8c,0x29,0x21,0xe7,0xb7,0xc7,0x7a,
885   0x8d,0x48,0xae,0xaf,0x52,0xeb,0x4c,0xec,0x22,0x4e,0x0b,0x5e,0xea,0x1b,0x57,0x31,
886   0x96,0xff,0x9e,0x91,0x12,0xa5,0x4a,0xa9,0x49,0xba,0xc7,0xa6,0x29,0xea,0x83,0xb4,
887   0x9b,0xe1,0xe8,0xfe,0x8e,0x4a,0x63,0xb1,0xec,0xd2,0x5f,0xf9,0xa2,0x25,0x49,0x02,
888   0x9b,0xee,0x8d,0xf7,0xc4,0xda,0x97,0x05,0x09,0x95,0xd2,0x57,0x56,0xca,0xab,0x1a,
889   0x96,0x26,0x8d,0x7a,0xb6,0x55,0xe6,0xa3,0xa2,0x02,0x20,0xc0,0x45,0xda,0xa7,0xfe,
890   0x8c,0x89,0xe8,0x89,0x63,0xba,0x50,0x8c,0xb5,0x1b,0x48,0x34,0x6f,0x55,0x3f,0xad,
891   0x7d,0x17,0x9f,0x22,0xca,0x0b,0xd5,0xc0,0x43,0xde,0x4c,0xb3,0xd4,0x3c,0x71,0x26,
892   0x69,0xd0,0xb0,0x46,0xed,0x47,0x74,0x3f,0x4d,0x4d,0x2b,0x3d,0x74,0x8d,0x3f,0x6b,
893   0x4f,0xb4,0x1c,0xf6,0xca,0x6e,0x2f,0x09,0xd1,0x66,0xe4,0xd2,0x4f,0x49,0xa7,0x7b,
894   0x31,0xc3,0xe3,0x30,0x63,0x80,0x05,0x1f,0xd0,0x2b,0x79,0x72,0x65,0x71,0xab,0x55,
895   0x0e,0xfd,0x06,0xf6,0xb7,0x7c,0xf6,0x7f,0x4b,0x9a,0xe9,0x1d,0xb7,0x03,0x49,0xfb,
896   0xe6,0x62,0x83,0x46,0xc5,0x64,0x02,0x2a,0xc9,0x2f,0x2b,0x4c,0xf2,0x00,0x8e,0x95,
897   0xa2,0x84,0xff,0x77,0xa5,0x46,0xc8,0xfc,0xc8,0xd2,0x36,0x32,0xd5,0xb4,0x96,0x24,
898   0x9a,0x79,0x33,0xde,0xe2,0xac,0x59,0x6c,0x79,0xd8,0x54,0xda,0x2c,0x8b,0x71,0x35,
899   0xc5,0x51,0xfa,0x88,0x12,0xb4,0x3d,0xdf,0xde,0x42,0x85,0x46,0xf5,0x86,0x1e,0xc9,
900   0x23,0x0b,0x55,0x75,0x35,0x60,0xc5,0xe3,0xcd,0xed,0x18,0xc1,0x23,0x76,0x1c,0xd2,
901   0xe0,0x4a,0xfd,0x03,0xb0,0xd3,0xe7,0xc0,0x3d,0x20,0x66,0xe1,0xe3,0xf3,0x7b,0x78,
902   0x2a,0xc3,0x18,0x53,0xa0,0xdc,0x4a,0x3e,0xd0,0x8a,0x1b,0x03,0x46,0x1a,0x99,0x6f,
903   0x8e,0xd6,0xce,0x4f,0x34,0x0c,0xc8,0x6e,0xc5,0x07,0x93,0x98,0xcc,0x13,0x39,0x9a,
904   0xd5,0x7d,0xc8,0x3e,0x6c,0x8f,0x4a,0x52,0x1d,0x97,0xcd,0xa1,0x75,0xe0,0x5c,0xf7,
905   0xfe,0xb6,0x04,0x20,0x46,0x65,0xcf,0xe8,0xd8,0x3a,0xcb,0x1c,0x41,0x80,0x03,0x87,
906   0x0b,0x83,0x83,0xf5,0xc4,0x8f,0x57,0x32,0xf7,0xf0,0x8c,0x0a,0x30,0xf2,0x2c,0x4a,
907   0xc3,0x09,0x0e,0x5c,0x0f,0xad,0xa9,0x72,0xf2,0x4e,0xe4,0x3f,0x0b,0xcb,0x38,0x37,
908
909   /* data */
910   0xa6,0x4d,0x14,0x3d,0x1c,0xc9,0xce,0xda,0x6d,0x8b,0x6a,0x24,0x66,0x1f,0x32,0x26,
911   0xd1,0x11,0x74,0xec,0x7c,0xee,0x7b,0x82,0x32,0x41,0x93,0xf4,0xc0,0x96,0x09,0x4f,
912   0xf0,0x79,0x27,0x9e,0x90,0x76,0x3b,0xec,0x6b,0x1a,0x90,0x48,0x4d,0xef,0x72,0xbb,
913   0x02,0x83,0x2e,0x52,0x56,0x61,0x0e,0x1a,0x16,0x16,0x60,0x1e,0x0d,0x2c,0x6f,0x6a,
914   0x07,0x31,0x87,0x0a,0xd0,0xb0,0xf4,0x0b,0x34,0x35,0x03,0x77,0x00,0x4c,0xfe,0x5c,
915   0xff,0x81,0x33,0xc5,0xfd,0x61,0xed,0xbe,0xc6,0x77,0x78,0x54,0x26,0x4f,0x21,0x91,
916   0xea,0x75,0x32,0x83,0xdc,0x75,0xf9,0x35,0xca,0xdc,0xc1,0xb3,0x7f,0x35,0xd6,0x09,
917   0xc7,0x0b,0x84,0x44,0x6f,0xed,0x18,0x6f,0x41,0x64,0xdd,0x96,0x0b,0xfd,0x1f,0xc5,
918   0x98,0x45,0x2a,0x08,0xb4,0xc7,0x4a,0x6b,0x2c,0x0f,0xcb,0xfb,0xca,0xa9,0xfa,0xc3,
919   0x5c,0x21,0x22,0xcf,0xad,0x04,0x8f,0x2b,0x89,0xdd,0x8d,0xe3,0xbc,0x38,0x68,0x04,
920   0x13,0xa1,0x6d,0x99,0x58,0xa4,0xe7,0xae,0x59,0xce,0x22,0x4f,0xe1,0xaa,0x6a,0x88,
921   0xbd,0xc3,0x0b,0x66,0xb7,0xa8,0x52,0xf3,0x9d,0xe2,0x89,0x3d,0x39,0xfe,0xfe,0x4f,
922   0x59,0x89,0xfc,0x35,0xc9,0x0e,0xd0,0xfc,0x53,0x19,0xc4,0xae,0xc5,0x36,0x26,0x59,
923   0xe9,0xf2,0x41,0x08,0x8d,0xd7,0x61,0xc7,0x7c,0x73,0xd2,0xa3,0x83,0x51,0xe0,0xa6,
924   0x6c,0xfd,0xd8,0xde,0x05,0x03,0x05,0x56,0x19,0xf0,0xb3,0x1a,0x74,0x4f,0x2e,0x37,
925   0xe2,0xac,0xc2,0xb7,0x2f,0x93,0xbc,0xa8,0x28,0x90,0x66,0x15,0x98,0x2f,0x0e,0x0a,
926   0x4b,0xfd,0xff,0x93,0x0d,0x85,0x85,0xbc,0xaa,0x53,0xed,0x92,0xef,0x20,0x1f,0xa8,
927   0x6d,0x9f,0x17,0x8a,0xb9,0x9f,0xa2,0xc4,0xd0,0x8d,0xef,0x41,0x5d,0xd5,0x28,0xee,
928   0x0d,0xe3,0x7a,0xb7,0x8c,0x22,0x10,0x88,0x85,0xff,0x17,0x4c,0xa5,0xe5,0xbb,0xf0,
929   0x98,0x42,0x28,0x60,0x09,0x80,0x89,0x87,0xa5,0x0b,0x0b,0x52,0x18,0x51,0xda,0xad,
930   0x0e,0xbc,0x21,0x83,0x32,0xb8,0x0d,0xc1,0x31,0xb3,0xca,0x53,0xb6,0x17,0x83,0x24,
931   0x6e,0x51,0x65,0x21,0x05,0xcc,0x9c,0x36,0x27,0xf5,0x53,0x4f,0x7f,0x38,0xb8,0x57,
932   0xba,0x01,0xf4,0x3b,0x84,0xbb,0x36,0xe6,0x88,0xd3,0xa8,0x45,0x73,0xb4,0x77,0x44,
933   0xf1,0xcc,0xcf,0xcf,0xad,0x84,0xdb,0xd1,0x54,0x4b,0xc8,0x37,0x92,0x8b,0xc1,0xed,
934   0x13,0xb2,0xf4,0xde,0x82,0x29,0x8b,0xf7,0x8c,0x5f,0xb2,0x24,0xdc,0xbe,0x97,0x51,
935   0x1f,0xb2,0x64,0x69,0x01,0xa9,0x46,0x59,0x2e,0x0d,0x68,0x0c,0x51,0x4b,0xf7,0x6f,
936   0x17,0xce,0x1f,0x6e,0x2c,0x04,0x0c,0xf5,0x3b,0x57,0xe9,0xef,0xf1,0x33,0xe3,0x49,
937   0xfa,0x05,0x25,0xee,0x01,0x39,0xdc,0xcc,0xb4,0x3b,0x34,0xcd,0xbc,0x76,0x59,0xdd,
938   0xc8,0x57,0x76,0xea,0x82,0x4a,0xb8,0xde,0x97,0xbb,0x4b,0xa6,0xb2,0x15,0x5a,0x2d,
939   0x81,0xc4,0x13,0x60,0xae,0x36,0x9f,0x2b,0xe5,0xd5,0x2d,0x79,0xd3,0x0e,0xe7,0x38,
940   0x24,0x4c,0xfa,0x52,0x84,0xfd,0x91,0xb3,0x9e,0x8b,0xd9,0x48,0x20,0x62,0xfe,0xfd,
941   0xb3,0xef,0x2c,0xbe,0x06,0x9e,0x8e,0x76,0xc3,0xdb,0x51,0x12,0x97,0x11,0xa1,0x7e,
942   0x2d,0xad,0xa9,0xa5,0x32,0x1b,0x96,0x74,0x52,0xc6,0x94,0xd7,0x39,0x1c,0xce,0xb9,
943   0x92,0x86,0x71,0x08,0x0a,0x73,0xa9,0xad,0x4c,0x4d,0xa1,0x97,0x06,0x81,0x87,0xb0,
944   0xe2,0x7a,0x84,0xe5,0x8c,0xa6,0xc7,0x22,0xb2,0x6e,0x7a,0x52,0xfe,0x41,0xca,0x62,
945   0x1c,0x89,0xe3,0x3d,0xba,0xb3,0xf0,0xd1,0x82,0x2b,0x1e,0x08,0x21,0x5c,0x98,0xce,
946   0x42,0xb3,0x8c,0x11,0x92,0x9c,0x24,0xbb,0xbd,0x82,0x8c,0xb8,0x6f,0xd2,0xf2,0xf6,
947   0x53,0xf8,0x80,0x5f,0x16,0x60,0x63,0xe0,0x64,0x75,0xc6,0x64,0xe8,0xa4,0xd6,0xd9,
948   0x4f,0x58,0xbf,0x28,0x44,0xfe,0xad,0x84,0xac,0x07,0xd0,0xd1,0x1d,0xb4,0x3e,0xb2,
949   0x0c,0xfb,0x90,0xf1,0x05,0x26,0xd3,0x5c,0x94,0x83,0x12,0xbe,0x46,0x5d,0xcf,0x07,
950   0x69,0x1e,0x2c,0xa3,0xcd,0x61,0xb1,0xd8,0xee,0x35,0x4a,0x55,0x39,0xc5,0xe2,0xc4,
951   0x1a,0x3f,0x66,0xd2,0xfd,0xcc,0xc2,0x2b,0x4d,0x9b,0xe2,0x7a,0x67,0x58,0x1d,0xc1,
952   0x03,0x05,0xfb,0xdd,0x15,0x32,0x94,0x1e,0xe8,0xeb,0xb4,0x12,0xc8,0x3c,0x27,0x44,
953   0x02,0x32,0xb9,0xed,0xc3,0x95,0x10,0xdb,0xc7,0x02,0x45,0x02,0x98,0x7f,0x7d,0xcf,
954   0x61,0xf8,0x63,0xae,0x4f,0x4d,0x29,0x4b,0x0b,0x57,0x5e,0x44,0xce,0x14,0x32,0xf7,
955   0x95,0x50,0x2f,0xaf,0x6c,0xd7,0xe3,0xb8,0x5f,0x75,0xd9,0x5f,0x7b,0xf6,0x9d,0xee,
956   0xcb,0x27,0xbc,0xb3,0x5a,0xd3,0xc0,0xf9,0x37,0xc6,0x37,0x0c,0x6b,0xcc,0xac,0x38,
957   0x03,0xb2,0xab,0xca,0x0c,0x42,0xc0,0x0d,0x91,0x4a,0x78,0x4c,0x9e,0x95,0x5d,0xd6,
958   0x3f,0xef,0xfd,0xf4,0x81,0x25,0xe3,0xf3,0x6e,0x01,0x9c,0x20,0x14,0x51,0xb2,0xc6,
959   0x7e,0xe0,0xb3,0x31,0xb8,0x7a,0x29,0xad,0xcf,0xeb,0xa2,0x86,0xcd,0x00,0xa9,0x09,
960   0xc0,0x83,0xcb,0x81,0xb3,0x42,0x92,0x3a,0xb2,0x08,0x8c,0x80,0xc9,0xa2,0x44,0x9f,
961   0x05,0xda,0x46,0xe4,0x71,0x7e,0x1e,0x99,0x19,0x58,0x59,0x0c,0x09,0x36,0x81,0x88,
962   0x4d,0xe4,0x24,0x5a,0xf1,0x2c,0xcd,0xcc,0x02,0xdc,0x09,0x2c,0x8b,0xbe,0x62,0xc5,
963   0x98,0xa0,0x66,0xe3,0x35,0x4d,0x9f,0xd2,0x6e,0x92,0x9b,0xde,0x50,0x39,0xe5,0x54,
964   0xe6,0x10,0x0a,0x7f,0x3c,0xe2,0x94,0xaa,0x5e,0x7b,0x11,0x24,0x58,0xa7,0x0c,0x36,
965   0x37,0x32,0x11,0x2d,0x05,0xe9,0xac,0x56,0xd0,0x97,0x6a,0xfc,0xa3,0x08,0xd6,0x6b,
966   0x8a,0x08,0x7b,0xef,0x92,0x63,0xe7,0xd5,0xc5,0xe6,0xa6,0x68,0x31,0x5c,0x42,0xf3,
967   0xe1,0x90,0x49,0xc4,0xe1,0x51,0x45,0x27,0x3e,0x68,0xc4,0x66,0x02,0xa2,0x52,0xcf,
968   0x3b,0xcc,0x79,0xac,0xf4,0xb1,0xc6,0x4b,0x39,0x1d,0xc6,0xf7,0x17,0xdc,0x04,0xfd,
969   0x98,0xbb,0x0c,0xa7,0xca,0x84,0x6a,0x43,0xb8,0x05,0xab,0x1c,0x6e,0x09,0x5a,0x7e,
970   0xf8,0x5c,0x02,0xb5,0x62,0xcb,0x31,0x0e,0xb9,0x20,0x73,0xd3,0x08,0x29,0x52,0x52,
971   0x5b,0xb1,0x5c,0xd6,0xbe,0x84,0x1b,0xab,0x3d,0x6e,0x1d,0x1e,0xe5,0x3c,0xee,0x79,
972   0xc1,0xb8,0x18,0x0a,0xdd,0xb0,0x28,0x1c,0x45,0xef,0xab,0xfb,0x05,0x42,0x2c,0xf4,
973   0x2a,0x73,0x37,0x51,0xbe,0x50,0x58,0x60,0xcf,0xa3,0x1c,0x6c,0x68,0x3a,0x0e,0xc1,
974   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
975   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
976   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
977   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
978   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
979   0x96,0xe1,0xb9,0xab,0x63,0x62,0xab,0x76,0xdd,0x8a,0x70,0x6f,0x0e,0x26,0x92,0xe1,
980   0x04,0x01,0x9f,0x18,0xcb,0xe7,0x21,0x60,0x6d,0xa4,0xa6,0x06,0xf8,0x05,0xba,0x54,
981   0x76,0x8e,0xad,0x34,0x55,0x0b,0x4e,0x3f,0x5d,0xaf,0xf8,0xe7,0x45,0x26,0x19,0x58,
982   0xf9,0x1b,0x1b,0xbd,0x64,0x3b,0x6a,0x43,0x73,0x32,0x74,0x16,0x12,0xac,0xa3,0x61,
983   0x2c,0x54,0x63,0x51,0xae,0xd7,0x22,0x12,0x84,0xe0,0x4a,0xcf,0x99,0x1c,0x48,0xb5,
984   0xda,0x37,0x87,0xf0,0x33,0xdd,0x74,0xab,0x90,0xb9,0x7b,0x14,0xdc,0x78,0x08,0x54,
985   0x04,0xc6,0x86,0x9a,0xf3,0x4e,0x62,0x10,0x97,0xbd,0x07,0xe3,0xd9,0xbf,0xe3,0x3f,
986   0xa8,0xff,0x60,0x4f,0xee,0x2a,0xea,0x8e,0x70,0x8e,0x9b,0xed,0x2d,0x06,0xd6,0x61,
987   0x79,0xb8,0x27,0xf4,0x20,0x30,0xd8,0xb4,0xef,0xfa,0x37,0xab,0xb1,0xa2,0x8f,0xe7,
988   0x32,0xb5,0x2c,0x74,0x3e,0xbe,0x5a,0x5c,0xa1,0x49,0x65,0xad,0x28,0xe2,0x9a,0x71,
989   0x9d,0x15,0x44,0xb6,0xce,0x6f,0xae,0x87,0x86,0x7a,0x27,0xf1,0x91,0xc4,0xf8,0xfe,
990   0xbc,0xd8,0x6e,0xbc,0xd1,0x43,0xd6,0x36,0x9e,0x8f,0x7b,0x78,0xee,0x4a,0xa9,0x8e,
991   0x8d,0xff,0xac,0x85,0x48,0x3a,0xd1,0x67,0xe9,0x87,0x63,0x42,0x3e,0x72,0xad,0x21,
992   0x12,0x88,0xfd,0x10,0x31,0x54,0x9f,0x1c,0x67,0x62,0xdd,0x4f,0x81,0x3e,0x05,0xb7,
993   0x4a,0x74,0x61,0x5f,0xe5,0x9a,0xc1,0x19,0xea,0x35,0xea,0x12,0x01,0x86,0x1c,0x17,
994   0xd8,0xf9,0x82,0x13,0x19,0xfa,0x49,0xf3,0x71,0xf4,0x9d,0xa3,0x8b,0x54,0xa9,0x0e,
995   0x14,0x86,0x9a,0x21,0xb8,0xf6,0x9c,0xc8,0x23,0x0f,0xda,0xef,0x00,0x3d,0x81,0x81,
996   0xfc,0xee,0xbd,0x6a,0xc2,0x8c,0xb9,0x98,0x00,0x84,0xa3,0xf5,0x60,0x41,0xa4,0x6e,
997   0x8e,0x31,0xeb,0xef,0x38,0xbd,0xa2,0x63,0x08,0x54,0xf6,0xb7,0xaa,0x60,0x13,0xd6,
998   0xcc,0x4e,0x24,0xae,0x18,0x8a,0x56,0x29,0x3b,0x7f,0xd4,0x33,0xe0,0x9a,0xcc,0xba,
999   0xb4,0x47,0x68,0xa8,0x63,0xf1,0xd4,0xea,0x99,0x06,0x3e,0x6b,0x01,0xef,0xd0,0x18,
1000   0x48,0x1b,0xb7,0xdd,0x1a,0xf4,0x1e,0xa5,0x22,0xe7,0x32,0x5e,0x0d,0x5f,0x1f,0xf1,
1001   0x87,0xca,0x11,0x9c,0x65,0xf1,0x7a,0xcd,0xf9,0x02,0x8c,0x91,0x0c,0xac,0x83,0xb5,
1002   0x29,0x3c,0x6a,0x03,0xdd,0xfd,0x4c,0x49,0xb2,0x3a,0x38,0x52,0x36,0x42,0x37,0xea,
1003   0xf4,0x5e,0x56,0xde,0x78,0xdb,0xa2,0xf8,0x4e,0x06,0x26,0x06,0x02,0x2a,0xee,0xd3,
1004   0x21,0x93,0x06,0x2b,0x36,0x8d,0x7a,0xda,0xcd,0x64,0x57,0xad,0x72,0x65,0xa8,0x6e,
1005   0xb1,0xdb,0x78,0xeb,0x17,0x12,0xd6,0xef,0x2f,0x56,0xcb,0x47,0x84,0xf3,0x64,0xbd,
1006   0xa5,0x36,0xae,0x1f,0x1b,0x69,0xb4,0x37,0x73,0xda,0x82,0xd3,0x3a,0xd4,0x24,0xbf,
1007   0xfb,0xa4,0xa7,0xc5,0x42,0x94,0x15,0xb2,0x9b,0xf2,0x7c,0x53,0x92,0x09,0xe7,0x73,
1008   0xb4,0x25,0x62,0xde,0x8c,0x92,0xfa,0x61,0xa6,0x9c,0xb9,0xc6,0x8e,0x90,0xad,0xdb,
1009   0xd0,0xb9,0xe1,0x6b,0xf9,0x62,0x61,0x42,0x94,0xda,0x39,0x2c,0x2c,0x6a,0x76,0xf5,
1010   0x50,0x5f,0x23,0x6a,0x89,0x06,0x4c,0x56,0x64,0x9b,0x05,0x00,0x8c,0x54,0xdc,0xb5,
1011   0xaa,0xf1,0x5b,0x85,0x05,0x9e,0x6e,0x1b,0x0a,0x89,0x00,0x25,0x25,0xdc,0xfe,0x4c,
1012   0xc2,0xc4,0x54,0x3f,0x4c,0x6c,0xee,0xa8,0x30,0x01,0xb7,0x34,0xd9,0xaf,0x9c,0x8f,
1013   0xb4,0xa2,0x88,0x64,0x2d,0x05,0x69,0x60,0xb0,0x05,0x28,0x2f,0xa8,0xcd,0xb4,0x7d,
1014   0x82,0x8b,0xf7,0xf5,0xaa,0x68,0xde,0x43,0x8b,0x93,0x55,0x15,0x92,0x36,0x47,0x15,
1015   0x2b,0x7e,0xa1,0xf0,0xc1,0x97,0x4f,0x52,0xc1,0xad,0x3d,0xe6,0x97,0xeb,0x56,0x59,
1016   0xae,0x7d,0x87,0x56,0x74,0x91,0xbb,0x8b,0x52,0x51,0xdf,0xa2,0xb7,0xea,0xdf,0x47,
1017   0x0d,0x87,0xa7,0x28,0xc1,0x55,0x22,0xef,0x3f,0x80,0x3d,0x48,0xf2,0x34,0xe3,0xe1,
1018   0x47,0x9c,0x02,0x64,0xaa,0xe5,0x84,0x7e,0x86,0x3b,0x55,0xda,0x48,0xc9,0x63,0x25,
1019   0x5c,0xbc,0x98,0x0b,0x2d,0x90,0x01,0xa2,0xd5,0xa0,0x5b,0x63,0xc5,0xf4,0x74,0x8d,
1020   0xfa,0x98,0x18,0xae,0xc0,0x98,0x13,0x51,0x64,0x01,0x32,0x02,0x30,0xde,0xaf,0x16,
1021   0x1d,0x75,0x9b,0x05,0x56,0x8b,0x2d,0x7e,0xac,0x01,0x12,0xec,0x4b,0xc3,0xf5,0xbc,
1022   0x5e,0xbc,0x83,0x5a,0x12,0xd9,0x68,0x31,0x92,0x06,0x4f,0xae,0x0c,0x2e,0xe5,0x3d,
1023   0xaa,0x3e,0xd6,0x49,0x99,0x22,0xce,0x3f,0x04,0xc5,0x78,0x8b,0x18,0x15,0x81,0x98,
1024   0x01,0xfb,0x95,0xd3,0xea,0x66,0x5f,0xa8,0x00,0x0b,0xde,0x1b,0xa3,0x6c,0x2c,0x10,
1025   0x63,0x48,0x61,0x86,0x6f,0x6b,0x08,0xc9,0xd4,0xa1,0xad,0x25,0x9c,0xb6,0xdc,0xe7,
1026   0xd5,0x77,0x21,0x59,0x8a,0xaf,0x09,0xc9,0xc7,0x2a,0x1e,0x82,0x98,0xb4,0xee,0xd1,
1027   0x0a,0x19,0x04,0x00,0x27,0x26,0xec,0x5d,0xfd,0xa6,0x33,0x33,0x97,0x65,0x63,0xce,
1028   0x01,0x2f,0x0a,0x7a,0x48,0xd0,0xb3,0x83,0x76,0x15,0xea,0x36,0x99,0xc8,0x3c,0xdd,
1029   0xbc,0xb7,0x33,0xc6,0xeb,0xad,0x5d,0x3d,0x32,0x76,0x45,0x8c,0x9e,0xdf,0x77,0x00,
1030   0x39,0xb2,0x7f,0xe6,0x11,0xbd,0xea,0x89,0x31,0xcb,0x42,0x35,0xa6,0xa8,0x15,0x36,
1031   0x7a,0x21,0xee,0xd9,0xbb,0x00,0x59,0x68,0x73,0x13,0xe3,0x31,0xb0,0x25,0x16,0x7f,
1032   0x7e,0x02,0x80,0x9f,0xe7,0x76,0xac,0xdb,0xf9,0x4e,0x26,0x81,0xbe,0x55,0x7b,0xdb,
1033   0x44,0x56,0x35,0x37,0x96,0x1f,0xe2,0xe0,0xc1,0x7c,0x0d,0x23,0xcf,0x37,0x42,0x4a,
1034   0xce,0x1e,0x0d,0xa3,0xc9,0xfb,0xfb,0x79,0xcc,0x9c,0x96,0x18,0xe3,0xcd,0x6c,0xcc,
1035   0x1b,0x58,0x08,0xe2,0x7e,0x0b,0xf6,0xa4,0x1a,0xb0,0xc3,0x60,0xfa,0x15,0xf9,0x61,
1036   0x2a,0x05,0x26,0xf3,0xb7,0x4d,0xd5,0x63,0xab,0xb7,0x92,0xfb,0x14,0x11,0xea,0x09,
1037   0xfd,0x26,0x67,0xd8,0x72,0xc2,0x97,0xb4,0x7f,0xb1,0x05,0xea,0x31,0xbf,0x3d,0xc4,
1038   0x93,0xb9,0xcb,0x90,0xb0,0x6a,0x3c,0x99,0x96,0x9e,0x1a,0x2b,0x51,0x21,0xf3,0x92,
1039   0xb8,0xe3,0x99,0xdb,0x08,0x07,0x7b,0xf3,0x17,0xdd,0xb3,0xb3,0xd2,0x12,0xac,0x47,
1040   0x25,0x51,0xd3,0xdd,0xfc,0x48,0x94,0x9f,0x42,0xa1,0x5b,0xba,0xe4,0x08,0x93,0x59,
1041   0xcd,0x2b,0xa9,0xaa,0xea,0xb4,0x08,0xd6,0x27,0x4f,0x1d,0x0c,0x70,0xaa,0x54,0x76,
1042   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1043   0xb0,0x6f,0x19,0x41,0xd4,0x4b,0xd7,0x99,0xc8,0xe9,0xfb,0xa9,0x77,0xf6,0xf1,0x9e,
1044   0xce,0x1e,0x25,0xa4,0xb9,0x0d,0x02,0xe6,0x24,0x6e,0xf4,0x91,0xfa,0xee,0x69,0xd1,
1045   0x28,0x38,0xcb,0xd2,0x99,0xfa,0x87,0xbf,0x3a,0xde,0x08,0xc4,0xf7,0x90,0xbc,0x0f,
1046   0xbc,0xbe,0x0d,0xca,0x74,0x12,0x67,0x22,0x0c,0x39,0x37,0x43,0x6f,0xde,0xe9,0x58,
1047   0x8b,0xae,0xe9,0x8e,0x4a,0x55,0xa2,0x11,0x98,0x7e,0x81,0x0c,0x63,0xd6,0xf2,0xac,
1048   0x95,0x09,0x61,0x1d,0x1b,0xc3,0x39,0x8a,0xe0,0xaf,0xe6,0x20,0xd1,0x7a,0xd6,0x0b,
1049   0xda,0xd0,0x73,0x76,0xe6,0x5c,0x2a,0x8e,0xe3,0xcb,0x66,0x7f,0xbb,0xc9,0x95,0x75,
1050   0x5a,0x01,0x20,0x9b,0xad,0x20,0x76,0x1e,0xa0,0xd2,0x01,0x29,0x1f,0xc2,0x2e,0xea,
1051   0x15,0x9d,0x69,0x8b,0x6f,0x0f,0x1d,0x38,0x19,0xc3,0xb7,0x1e,0xfe,0x67,0xa3,0x6a,
1052   0x0b,0xa5,0x4c,0x45,0x2c,0x29,0x20,0xde,0x4c,0xa0,0x88,0x5f,0x59,0xb6,0xf3,0xf4,
1053   0x3c,0x17,0xcb,0xcb,0xe4,0x6e,0x7d,0x0e,0x3b,0x68,0x74,0xea,0x2e,0xb1,0x1d,0x8a,
1054   0xa8,0xf4,0xe4,0x1c,0x97,0xde,0x35,0xc9,0xe5,0x1b,0x7b,0xc0,0x7e,0x56,0x23,0x2b,
1055   0x50,0x3c,0x99,0x37,0x45,0x79,0x48,0x10,0x49,0xb9,0x9d,0xe1,0x4a,0xa7,0x04,0xd7,
1056   0x32,0xf0,0xe8,0x1e,0xed,0x3f,0xb6,0xe1,0x69,0x41,0xda,0x4d,0x90,0xa2,0xc0,0x8e,
1057   0x4f,0x0e,0xd3,0xd0,0x91,0x30,0x80,0x3e,0x43,0xb5,0x32,0x05,0x51,0x49,0x56,0x50,
1058   0xa7,0x97,0x58,0x4c,0x30,0x4c,0xa4,0x25,0xd9,0x14,0xa5,0x07,0x8e,0x9a,0xc8,0x1d,
1059   0x3a,0x8c,0x79,0x94,0xca,0x93,0x23,0x98,0x2a,0x5e,0x33,0x54,0x45,0x97,0x15,0xf5,
1060   0x08,0xeb,0x34,0xa7,0x5f,0x05,0xfd,0x95,0x35,0x93,0xdc,0xec,0x77,0x3f,0x3d,0xd8,
1061   0x11,0xb5,0x8b,0x84,0xef,0xa2,0x33,0x1d,0xfc,0xb2,0xa0,0xcf,0x25,0x91,0x3f,0xc6,
1062   0xf1,0x83,0x8d,0x87,0x7f,0xc5,0x9b,0xe7,0xe1,0xc5,0x82,0x6a,0xe1,0x0f,0x8f,0x1e,
1063   0x4d,0x2f,0x0d,0x0e,0xf0,0xb2,0x47,0x46,0x96,0x23,0x8c,0xd2,0x0b,0x0d,0x25,0xbe,
1064   0x1b,0xfe,0x5f,0x17,0x93,0x82,0x87,0xe8,0x3d,0x23,0xe8,0x3d,0xe7,0x6f,0xce,0x22,
1065   0x5c,0xf0,0x85,0xa3,0x69,0x34,0x59,0xcd,0xd8,0xc7,0x97,0xab,0x77,0x33,0x8a,0x49,
1066   0x11,0x05,0x7e,0xb3,0x72,0xca,0xbf,0xf5,0x66,0x0d,0x99,0x1c,0xb9,0x5a,0x59,0x32,
1067   0x38,0x3e,0x49,0x45,0xae,0x43,0xb7,0x60,0xe7,0xf7,0xee,0x90,0xaf,0xe4,0x3b,0xc5,
1068   0xf1,0xdc,0xc8,0x52,0xa2,0x9b,0x0c,0xde,0x45,0xf0,0x39,0x56,0x87,0x46,0x7b,0xa6,
1069   0x14,0x0b,0xfe,0xba,0x97,0xa8,0xed,0x7d,0xbd,0x8c,0x75,0xdc,0x31,0x21,0xc1,0xc2,
1070   0xa1,0xd4,0xfe,0x1c,0xb7,0x11,0x58,0xd6,0x20,0x43,0xfb,0xdc,0x87,0xd7,0x12,0x19,
1071   0x99,0x39,0xca,0x7a,0x02,0xd4,0x4f,0xeb,0x6d,0x15,0xcc,0x57,0x88,0x68,0x6e,0xab,
1072   0xfc,0x38,0x61,0xd3,0x78,0xf2,0xd0,0xbb,0xa6,0x02,0xe8,0x4e,0x33,0xd3,0xd5,0x78,
1073   0xcb,0xd3,0xc2,0x27,0x19,0x6b,0xdc,0x45,0xca,0x0a,0x4f,0xbf,0x8a,0x1a,0x47,0x81,
1074   0x04,0x08,0xef,0x76,0xe5,0x96,0xa2,0x01,0x2d,0x57,0x0f,0xfa,0x80,0x7c,0xeb,0x9f,
1075   0xea,0x53,0x44,0xba,0xf5,0x27,0x25,0x19,0x2f,0x44,0x9b,0x88,0x23,0xf6,0xb0,0xd1,
1076   0x5d,0x8a,0x72,0xc2,0x69,0x4a,0xec,0x25,0xd3,0x84,0x2a,0xc8,0x28,0x83,0x38,0x76,
1077   0xf3,0x93,0x22,0xfc,0xc0,0x01,0xf5,0x24,0x1b,0x17,0xbb,0xbc,0x90,0x23,0x82,0x8f,
1078   0xac,0x70,0x55,0x69,0xf9,0x4a,0x41,0x16,0x05,0xfd,0x50,0x62,0x5b,0xd6,0x90,0x1a,
1079   0x88,0x20,0x0c,0x09,0x16,0x27,0xd0,0xfb,0x93,0x37,0xe8,0xbc,0x8a,0x9c,0x61,0x18,
1080   0x87,0xa2,0x45,0xdc,0x16,0x96,0xa2,0xd3,0xc3,0xc3,0x83,0xc8,0x1b,0x75,0xf4,0x8a,
1081   0xa9,0xf8,0x02,0xe2,0xf9,0x99,0xb7,0x9d,0x97,0xa2,0x21,0x88,0x0f,0x61,0x4b,0x6e,
1082   0xee,0x21,0x41,0x1b,0xbe,0x2e,0x0f,0x5b,0x0d,0xd4,0xc2,0xfb,0x66,0x60,0x65,0xc5,
1083   0x56,0x1d,0x03,0x87,0x67,0x56,0xaa,0x0c,0x27,0x59,0x66,0x20,0x21,0x72,0x41,0x90,
1084   0xe1,0xeb,0x49,0x26,0xf3,0x12,0x89,0xb0,0xe3,0x32,0x0d,0xf9,0x3e,0x97,0xe1,0xcd,
1085   0x8f,0x8d,0x11,0xf8,0x62,0x60,0xaa,0x47,0x43,0x5d,0xb6,0x84,0xbe,0xcf,0x43,0x7d,
1086   0x60,0x02,0x5d,0xfd,0xb3,0x42,0x0e,0xd1,0x45,0xdb,0x63,0xc3,0xa1,0x1a,0x69,0xa1,
1087   0x54,0x49,0x2b,0x35,0xe8,0xb6,0xb5,0x4d,0xeb,0xac,0x13,0xb5,0xe8,0x78,0x52,0x37,
1088   0x6b,0x64,0x7c,0xa0,0x00,0xbe,0x9f,0xbd,0x33,0xd0,0xc6,0x59,0x91,0xe8,0xfd,0x87,
1089   0xd2,0xb5,0xbd,0x02,0x57,0x7b,0x47,0xdf,0xe2,0x9a,0x2d,0xca,0xde,0x3d,0x5a,0x71,
1090   0xb8,0x92,0xbc,0x7e,0xdb,0xc2,0x3c,0x9d,0xb5,0xfc,0xc9,0x7c,0xb0,0x6a,0x4d,0xc5,
1091   0x38,0x39,0xb5,0x25,0xbb,0x95,0xed,0x47,0xa3,0xa9,0xe0,0xd8,0x5c,0xa2,0x7b,0x84,
1092   0x54,0xac,0xaa,0xf7,0xf5,0xf2,0x59,0xdc,0xac,0xa1,0x73,0xe0,0xe4,0xe5,0xe5,0xaf,
1093   0x0a,0xea,0x9a,0xf4,0x8a,0xdb,0x7f,0x5c,0xcf,0xe5,0x80,0x92,0x47,0x33,0x89,0x44,
1094   0x5c,0xf2,0x85,0x1c,0x7a,0x4e,0x61,0xc7,0x0e,0x73,0x09,0xf0,0x84,0x8c,0x68,0x44,
1095   0x48,0xc6,0x6b,0x6f,0xc5,0x4d,0xfd,0x1c,0x68,0x4c,0x0c,0xf9,0x9d,0xf0,0x82,0xaf,
1096   0xd0,0x65,0x4c,0xed,0x6c,0xd6,0x55,0x5d,0xdd,0x70,0x8a,0xac,0x91,0x5f,0xd7,0x86,
1097   0xf2,0xce,0x28,0x96,0x6d,0xea,0x68,0x89,0x6d,0xdf,0x84,0x0b,0x60,0xd9,0x67,0xc7,
1098   0xb0,0x03,0xfe,0x6a,0xc9,0x8a,0x35,0xa0,0x18,0x99,0xf8,0x14,0x09,0x5e,0x32,0x73,
1099   0x08,0x03,0xd0,0x69,0x80,0xb4,0xbe,0xa2,0xde,0x9f,0xe7,0xc9,0x8e,0xee,0x38,0x8b,
1100   0xfb,0xcd,0x9d,0x93,0x93,0x6a,0x02,0x8e,0xbf,0xef,0x52,0x28,0xee,0x88,0x79,0x0d,
1101   0x8a,0x63,0x65,0xe8,0x00,0xaa,0x00,0x66,0xbb,0x8a,0x37,0x33,0x29,0x2e,0xf6,0xfa,
1102   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1103   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1104   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1105   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1106   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1107   0xb3,0xc4,0x28,0x68,0xc8,0x75,0xba,0x29,0xd2,0x70,0x97,0xe8,0x3e,0xdf,0xad,0x52,
1108   0x78,0xef,0xe6,0x13,0xeb,0xcc,0x2e,0xd7,0x04,0xa1,0x73,0x49,0x2f,0x9b,0x9f,0x16,
1109   0xd7,0xe6,0x9f,0xe9,0x6a,0xad,0x5e,0x70,0x51,0x1d,0xc9,0x54,0xfb,0x62,0xcc,0x44,
1110   0xd2,0xa8,0x52,0xea,0x43,0x1a,0x49,0xf3,0xb9,0xe5,0x9a,0x0b,0xa1,0x34,0x34,0xdd,
1111   0x67,0x34,0x01,0x16,0x77,0x11,0xee,0x62,0x3c,0xf7,0xe7,0x6d,0x23,0x11,0xd7,0xe2,
1112   0x98,0x8c,0xab,0x6d,0x06,0x94,0x4f,0xbc,0xda,0x54,0xae,0x79,0x80,0xf9,0xb5,0x51,
1113   0x63,0xaf,0x50,0xef,0xf0,0xa1,0x6a,0x01,0x93,0xfc,0xf0,0x31,0xb8,0xec,0xce,0x2b,
1114   0xca,0x9c,0xf0,0x9d,0x36,0x39,0x41,0x30,0x67,0xef,0xae,0x93,0xca,0xea,0x22,0x71,
1115   0xcb,0x55,0x8b,0x75,0xd6,0x5d,0xd3,0x4b,0x56,0x2d,0xe6,0xa1,0xb8,0xf3,0xb1,0x21,
1116   0x68,0xd9,0x20,0x78,0xd1,0x0b,0x1f,0x51,0x60,0xb7,0x9a,0x59,0x81,0x07,0x7c,0x3c,
1117   0x9f,0x27,0xb1,0xa6,0x27,0x45,0x27,0x42,0x85,0x8b,0xc8,0xbd,0x25,0x26,0x81,0xc2,
1118   0x72,0x41,0x3d,0xff,0xd9,0x09,0xe9,0x1e,0xc5,0xaa,0x71,0xcb,0xa3,0x4f,0xc1,0xb4,
1119   0xdf,0x26,0xc4,0x83,0xe5,0x59,0x67,0xe4,0x20,0x14,0x96,0x85,0xfd,0x84,0x3c,0x10,
1120   0xe8,0xd5,0x46,0x32,0x4c,0x33,0xa0,0x96,0x96,0xc9,0x35,0xe9,0x32,0xc4,0xf2,0xd7,
1121   0x8b,0x50,0xc3,0x0c,0x0e,0x98,0x93,0x33,0x27,0xc9,0x4f,0xf9,0x42,0x0f,0xe3,0x0a,
1122   0xca,0x96,0x3b,0x11,0x2c,0x89,0x42,0xbb,0xd3,0x15,0xe5,0xb4,0x2c,0x65,0x0f,0xa7,
1123   0xa3,0xa6,0xad,0x41,0xa4,0x04,0xab,0x2e,0x9a,0xab,0xf5,0x19,0xf2,0xc6,0x76,0xaf,
1124   0x18,0x82,0x1b,0x9c,0x77,0x0b,0xd0,0x8b,0x7c,0x8c,0x17,0xe0,0x66,0x96,0x31,0x7b,
1125   0xea,0xd9,0x33,0x28,0xdc,0x14,0xe8,0x74,0x87,0x53,0x1b,0xe9,0x37,0xa2,0x9b,0x15,
1126   0x38,0x0d,0x31,0x83,0xd6,0xa1,0xaa,0xbf,0x5e,0x68,0xd3,0x56,0x1b,0x70,0x77,0xd2,
1127   0x59,0xc4,0x62,0xc1,0x64,0x71,0x60,0xae,0x88,0x81,0x3e,0x25,0x12,0x02,0xc6,0xb2,
1128   0x4c,0xff,0xc6,0xe2,0x84,0x84,0x09,0x3f,0x05,0x9d,0x5b,0x57,0x1c,0x57,0x89,0xb5,
1129   0x13,0xbc,0x5d,0xe5,0x38,0xda,0xa5,0x74,0xd6,0xbc,0x2c,0xec,0x39,0x6e,0xbe,0xdb,
1130   0xad,0xfd,0x27,0xcc,0x7e,0x73,0x34,0x4b,0xf9,0xde,0xaf,0xe5,0x69,0x49,0x66,0x24,
1131   0x1a,0xc0,0x24,0x96,0x58,0x4f,0xb5,0xc6,0x6f,0x03,0xe6,0xec,0x59,0xfb,0xfd,0x87,
1132   0xeb,0xd6,0x80,0xdd,0xca,0x41,0x86,0x58,0x21,0x27,0xba,0x65,0x1d,0x75,0xc9,0x6f,
1133   0xea,0x17,0x5e,0xe3,0xb3,0xf8,0x27,0x2d,0xa5,0x06,0xcd,0xb8,0xec,0x2a,0xff,0xf1,
1134   0xb4,0x53,0x67,0x44,0x28,0x6b,0xb2,0x1d,0x75,0x5f,0x8c,0xe7,0xc6,0x1a,0xa0,0x0f,
1135   0x48,0x8a,0x9b,0x01,0x27,0x99,0x29,0x28,0x8f,0x33,0xf6,0xf1,0xab,0x46,0xad,0xc7,
1136   0xa8,0xbc,0xfa,0x18,0xb2,0x81,0x8b,0x4e,0xf4,0x83,0x0a,0xd5,0x9b,0xac,0x24,0x1b,
1137   0xd3,0xe8,0x84,0x8a,0xc7,0x25,0xd8,0x8f,0xa4,0x4d,0xca,0x95,0x96,0x4d,0x06,0x09,
1138   0xc8,0x10,0x3a,0x57,0x67,0x83,0x10,0xeb,0x9f,0x92,0x34,0x30,0x9c,0x29,0x54,0x93,
1139   0x89,0x33,0x1a,0x7f,0x93,0x9d,0x32,0x62,0xe5,0x53,0x4a,0xa6,0xad,0x0c,0xb7,0x15,
1140   0x51,0x25,0x03,0x49,0x72,0xbb,0x2e,0xd6,0x48,0xdc,0x5d,0xb8,0xae,0x83,0xae,0x87,
1141   0xfc,0x3d,0x6b,0x4e,0xfd,0x94,0xe2,0x19,0x7d,0x16,0x5e,0xf4,0x48,0x4d,0x2b,0xeb,
1142   0x2a,0xc7,0x96,0x0b,0xf0,0x0f,0xe9,0x5f,0x64,0xb2,0x72,0xf3,0x54,0x3a,0x7c,0xd3,
1143   0x8b,0x35,0x53,0x0b,0xd5,0x2e,0x43,0xa7,0xff,0xb1,0x99,0xb4,0xd3,0x4a,0xa0,0x3d,
1144   0x1f,0x86,0xa4,0x4e,0xae,0xef,0xf1,0xf3,0x4c,0x13,0xd3,0x39,0xc6,0x7d,0x96,0x2a,
1145   0xe6,0xba,0x87,0xd4,0x7a,0x54,0xf1,0x42,0x4d,0xd9,0x20,0x80,0x2b,0xd3,0x60,0x9b,
1146   0xe0,0xd0,0xfd,0x9d,0x39,0x5c,0x44,0x94,0x01,0x01,0x80,0x8b,0x03,0x4c,0xfd,0x8e,
1147   0x0d,0xca,0x07,0xaa,0xeb,0x06,0xea,0xe9,0x67,0x8c,0xf3,0x59,0x4f,0xe8,0x6c,0x05,
1148   0x6e,0xa7,0xa3,0xf9,0x8f,0x54,0xe3,0x41,0x81,0x7a,0x79,0xe9,0x0d,0xa7,0xaf,0xfe,
1149   0x01,0x67,0xd3,0x8b,0x27,0x44,0x30,0x9c,0x4d,0xcc,0x12,0x3d,0x3e,0x89,0xc5,0x7a,
1150   0xc7,0x09,0x95,0x60,0xb2,0xd8,0xcf,0xfa,0xcd,0x80,0xbe,0x54,0xe3,0x8e,0xae,0x7a,
1151   0xc0,0x8f,0xeb,0x78,0x30,0x0e,0xc1,0x5b,0xff,0x97,0x7d,0x2d,0xfa,0xb6,0x69,0xfc,
1152   0xec,0xf8,0xd3,0xd3,0xa1,0xe8,0x06,0xbe,0xe5,0x11,0x4f,0xca,0x84,0x01,0xf8,0x02,
1153   0x4b,0x44,0x4f,0x71,0x05,0x64,0x9e,0x25,0x7e,0xef,0x33,0x2a,0x82,0x6f,0x5a,0x8a,
1154   0xdd,0x72,0x5d,0x52,0x5b,0x84,0x8a,0x8f,0xb5,0x34,0xd2,0x43,0x00,0x83,0x6c,0xb9,
1155   0xf2,0x5b,0x22,0x8f,0x37,0x29,0x20,0xb0,0x7a,0x59,0x93,0x0a,0x69,0x57,0xa7,0x87,
1156   0xad,0x8e,0x88,0x13,0xf5,0x6b,0x61,0x9c,0xeb,0x5a,0x5f,0x0c,0x3c,0xc6,0xae,0x50,
1157   0x93,0x1d,0x79,0x53,0x9e,0xc8,0xed,0x02,0x07,0x36,0x36,0x49,0x7a,0xd1,0x80,0x13,
1158   0xa4,0x06,0xf6,0x4e,0x31,0x74,0x55,0xf5,0x0e,0xc9,0x75,0x31,0xa3,0x9f,0xe1,0xb4,
1159   0xa9,0x42,0xa5,0x4b,0xae,0xff,0xce,0x3f,0x7e,0x05,0x74,0x38,0xb7,0x84,0x8c,0x47,
1160   0xe9,0x90,0x74,0x1a,0x81,0x54,0x17,0x5b,0xeb,0xfd,0x62,0xb7,0x92,0xb7,0x41,0xda,
1161   0xe3,0xad,0x9f,0x6f,0x4a,0x0c,0x6a,0x23,0x33,0x00,0x8b,0xa1,0x09,0xb4,0xf1,0x97,
1162   0x39,0x55,0x86,0xaf,0x2e,0x0f,0x37,0x95,0x55,0x0e,0xef,0xf7,0x1a,0x7d,0x9c,0x7f,
1163   0xe9,0x89,0x28,0xd9,0x2d,0x5d,0x7f,0xb3,0x53,0x27,0x8f,0xb7,0xc7,0x11,0x42,0x92,
1164   0xf4,0x47,0x84,0xef,0x47,0xf7,0x43,0x7b,0x2c,0x4b,0x69,0xe2,0x0e,0x6f,0xe2,0xd0,
1165   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1166};
1167
1168
1169/* 317-0021 FD1089A */
1170static const UINT8 key_0021[0x2000] =
1171{
1172   /* opcodes */
1173   0x03,0xa4,0xe5,0xdf,0xd0,0xca,0x5f,0x56,0x5a,0xa6,0xbb,0x0b,0xac,0x06,0x86,0x49,
1174    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1175    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1176    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1177    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1178    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1179    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1180    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1181    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1182    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1183    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1184    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1185    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1186    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1187    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1188    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1189    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1190    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1191    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1192    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1193    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1194    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1195    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1196    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1197    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1198    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1199    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1200    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1201    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1202    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1203    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1204    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1205    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1206    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1207    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1208    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1209    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1210    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1211    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1212    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1213    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1214    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1215    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1216    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1217    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1218    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1219    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1220    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1221    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1222    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1223    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1224    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1225    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1226    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1227    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1228    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1229    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1230    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1231    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1232    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1233    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1234    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1235    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1236    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1237    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1238    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1239    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1240    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1241    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1242    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1243    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1244    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1245    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1246    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1247    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1248    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1249    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1250    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1251    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1252    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1253    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1254    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1255    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1256    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1257    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1258    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1259    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1260    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1261    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1262    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1263    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1264    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1265    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1266    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1267    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1268    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1269    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1270    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1271    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1272    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1273    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1274    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1275    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1276    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1277    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1278    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1279    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1280    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1281    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1282    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1283    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1284    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1285    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1286    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1287    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1288    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1289    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1290    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1291    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1292    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1293    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1294    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1295    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1296    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1297    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1298    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1299    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1300    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1301    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1302    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1303    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1304    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1305    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1306    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1307    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1308    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1309    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1310    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1311    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1312    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1313    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1314    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1315    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1316    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1317    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1318    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1319    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1320    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1321    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1322    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1323    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1324    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1325    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1326    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1327    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1328    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1329    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1330    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1331    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1332    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1333    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1334    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1335    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1336    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1337    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1338    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1339    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1340    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1341    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1342    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1343    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1344    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1345    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1346    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1347    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1348    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1349    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1350    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1351    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1352    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1353    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1354    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1355    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1356    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1357    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1358    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1359    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1360    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1361    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1362    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1363    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1364    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1365    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1366    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1367    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1368    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1369    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1370    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1371    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1372    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1373    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1374    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1375    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1376    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1377    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1378    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1379    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1380    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1381    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1382    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1383    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1384    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1385    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1386    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1387    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1388    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1389    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1390    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1391    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1392    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1393    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1394    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1395    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1396    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1397    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1398    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1399    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1400    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1401    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1402    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1403    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1404    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1405    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1406    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1407    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1408    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1409    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1410    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1411    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1412    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1413    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1414    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1415    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1416    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1417    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1418    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1419    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1420    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1421    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1422    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1423    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1424    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1425    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1426    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1427    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1428    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1429
1430   /* data */
1431   0xb6,0xc6,0x4b,0x8b,0x67,0x8c,0xa0,0x77,0x3c,0xa9,0x30,0x2f,0x21,0xc8,0x65,0xe1,
1432   0x01,0x96,0xab,0xb7,0xc9,0xbf,0x70,0xdd,0x65,0xef,0x1e,0x81,0xc0,0xd1,0x22,0xcd,
1433   0xc7,0x12,0xe7,0xee,0x66,0x5d,0xda,0x0f,0x89,0x60,0x67,0x5d,0x1b,0xc5,0xfa,0x04,
1434   0x09,0x38,0x92,0x33,0x46,0x6d,0x80,0x37,0xe1,0x0c,0x3b,0x94,0x8f,0xa9,0x0f,0x54,
1435    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1436    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1437    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1438    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1439    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1440    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1441    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1442    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1443    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1444    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1445    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1446    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1447    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1448    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1449    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1450    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1451    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1452    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1453    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1454    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1455    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1456    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1457    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1458    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1459    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1460    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1461    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1462    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1463    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1464    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1465    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1466    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1467    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1468    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1469    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1470    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1471    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1472    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1473    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1474    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1475    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1476    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1477    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1478    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1479    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1480    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1481    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1482    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1483    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1484    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1485    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1486    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1487    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1488    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1489    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1490    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1491    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1492    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1493    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1494    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1495    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1496    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1497    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1498    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1499    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1500    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1501    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1502    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1503    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1504    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1505    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1506    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1507    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1508    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1509    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1510    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1511    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1512    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1513    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1514    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1515    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1516    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1517    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1518    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1519    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1520    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1521    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1522    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1523    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1524    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1525    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1526    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1527    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1528    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1529    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1530    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1531    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1532    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1533    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1534    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1535    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1536    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1537    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1538    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1539    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1540    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1541    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1542    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1543    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1544    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1545    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1546    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1547    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1548    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1549    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1550    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1551    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1552    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1553    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1554    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1555    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1556    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1557    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1558    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1559    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1560    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1561    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1562    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1563    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1564    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1565    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1566    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1567    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1568    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1569    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1570    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1571    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1572    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1573    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1574    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1575    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1576    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1577    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1578    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1579    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1580    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1581    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1582    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1583    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1584    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1585    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1586    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1587    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1588    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1589    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1590    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1591    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1592    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1593    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1594    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1595    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1596    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1597    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1598    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1599    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1600    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1601    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1602    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1603    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1604    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1605    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1606    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1607    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1608    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1609    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1610    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1611    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1612    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1613    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1614    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1615    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1616    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1617    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1618    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1619    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1620    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1621    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1622    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1623    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1624    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1625    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1626    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1627    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1628    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1629    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1630    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1631    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1632    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1633    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1634    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1635    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1636    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1637    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1638    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1639    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1640    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1641    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1642    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1643    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1644    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1645    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1646    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1647    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1648    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1649    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1650    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1651    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1652    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1653    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1654    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1655    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1656    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1657    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1658    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1659    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1660    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1661    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1662    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1663    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1664    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1665    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1666    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1667    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1668    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1669    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1670    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1671    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1672    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1673    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1674    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1675    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1676    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1677    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1678    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1679    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1680    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1681    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1682    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1683    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1684    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1685    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1686    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
1687};
1688
1689
1690/* 317-0022 FD1089A */
1691static const UINT8 key_0022[0x2000] =
1692{
1693   /* opcodes */
1694   0x55,0xfc,0x8e,0x41,0x02,0x3d,0x55,0xde,0xb0,0x30,0xa1,0x72,0x90,0xb2,0xb1,0xcf,
1695   0x0d,0x78,0x79,0x29,0x9c,0x33,0xed,0xb4,0xb2,0x9a,0x01,0xa4,0xc1,0x60,0xa8,0x2c,
1696   0x3d,0x38,0xd7,0x82,0x9c,0xd7,0x82,0xd8,0x50,0xf1,0x9d,0x63,0xcf,0x3a,0x1c,0x56,
1697   0x8b,0x29,0x66,0x12,0xf2,0x5b,0xe7,0x5f,0xf8,0x01,0x28,0x75,0x14,0x17,0x48,0x36,
1698   0x8c,0xe7,0x35,0xd4,0x76,0x0b,0xae,0xd1,0xba,0x6f,0x41,0x01,0x0c,0x4c,0x4d,0x86,
1699   0xf5,0x2d,0x00,0xd3,0xca,0xed,0x59,0xa9,0xb2,0xb6,0x26,0x1b,0xa3,0x02,0x06,0x8c,
1700   0x65,0x9d,0x66,0xaf,0x8d,0xa0,0x87,0x85,0x81,0x76,0x76,0x62,0x7a,0xda,0x11,0xe7,
1701   0x7c,0xd6,0x08,0x08,0x5f,0xc4,0xd8,0x07,0xc8,0x50,0xd1,0x76,0x2f,0x73,0x10,0x38,
1702   0xdb,0x78,0x84,0x7f,0xe0,0xfa,0xed,0xce,0x26,0xe3,0xd7,0xf7,0x64,0x6d,0xa2,0x1d,
1703   0x20,0x24,0x7c,0xb3,0xb1,0xe1,0x64,0x7a,0x3c,0xcf,0x29,0x86,0xb9,0x69,0x67,0x38,
1704   0xed,0x79,0x8f,0x44,0x70,0x19,0xdf,0xab,0xa8,0xb4,0x65,0xc1,0xcc,0x05,0x00,0x28,
1705   0xe2,0x17,0x5e,0xd2,0xbf,0x42,0xfd,0x02,0x0c,0x33,0x2d,0x4a,0x3f,0xe3,0x0c,0x8e,
1706   0x9d,0x9e,0x88,0xfe,0x3e,0xfd,0x5f,0x1e,0x07,0xeb,0x21,0xc1,0xb1,0xa3,0x2b,0x08,
1707   0xc0,0xae,0xac,0x67,0x8b,0xe9,0xa4,0x9f,0x3a,0x7c,0xdf,0xc4,0xc2,0xe3,0xfd,0x38,
1708   0xea,0xe8,0x6d,0xad,0x48,0xa6,0x6c,0x26,0x43,0x86,0x09,0xf5,0x12,0x45,0x23,0xbd,
1709   0xbb,0xeb,0x68,0x70,0x14,0xd4,0x57,0x52,0xc4,0xaa,0x3e,0xf3,0x42,0x68,0x3c,0x37,
1710   0xd3,0x57,0x3f,0x51,0x8f,0x14,0x05,0xc3,0x5c,0x87,0x1e,0x5e,0xf1,0xec,0xe8,0x47,
1711   0xd3,0xcd,0x91,0xef,0x5a,0x04,0x17,0x19,0xac,0xbd,0x4a,0xd7,0xbf,0x71,0xc7,0x8c,
1712   0x5a,0xec,0xfe,0xea,0x14,0x47,0x2c,0xf4,0x52,0xec,0x60,0xfd,0x4c,0x98,0x7a,0xa6,
1713   0x08,0x54,0x26,0xe3,0x5d,0x7a,0xe4,0xf5,0xf0,0xb5,0x03,0x70,0x39,0x00,0xa0,0x35,
1714   0x7e,0xa5,0xaa,0x78,0xd5,0x3e,0xe0,0xbb,0x25,0xb7,0xd0,0xd0,0x25,0x49,0xd9,0xda,
1715   0x5b,0x7f,0x29,0x4b,0x1d,0x34,0xbe,0xe6,0x92,0x92,0x68,0xbe,0xb0,0x14,0xc5,0x34,
1716   0x3f,0x83,0x43,0xfb,0xd4,0xfb,0x20,0x17,0xd5,0xe7,0x6c,0xd8,0x7b,0xff,0x05,0xe3,
1717   0xca,0x50,0x98,0x29,0x9a,0x34,0xa6,0xec,0x90,0x54,0x7b,0xc0,0x24,0xac,0x37,0x87,
1718   0x9c,0x86,0xc9,0x73,0x0f,0x7d,0xee,0x07,0x62,0x7b,0x35,0x16,0x4d,0xba,0xfd,0xc1,
1719   0x56,0xc6,0x75,0x7b,0xd3,0x78,0x9a,0x08,0xec,0xfb,0x3b,0x78,0x95,0xca,0xf7,0x30,
1720   0x97,0xaf,0x3c,0xe1,0x87,0xc4,0x49,0x8d,0xcc,0x75,0x2c,0x88,0x9d,0x7b,0xc3,0x74,
1721   0xff,0xe1,0xbe,0x43,0xca,0x01,0x9b,0x38,0xa4,0x87,0xa8,0xe5,0x04,0x6d,0x03,0x2d,
1722   0x2f,0xfc,0x9c,0x43,0x3d,0xd0,0x30,0xa8,0x13,0xd3,0x4f,0x2f,0x6a,0x56,0xfc,0xc6,
1723   0xa0,0x75,0x80,0x7e,0xd0,0xa9,0x7d,0xba,0xf8,0xc2,0x07,0x6f,0x94,0x5d,0x80,0x64,
1724   0x6e,0xe9,0x9a,0x2f,0xa1,0xa5,0x58,0x37,0x97,0x9f,0x0c,0xb3,0x0a,0xb6,0x59,0xa9,
1725   0x05,0x98,0x31,0xef,0xe3,0xc4,0xd7,0x2c,0x4e,0x88,0xde,0xd7,0x41,0x03,0x27,0x35,
1726   0x06,0x23,0xe6,0x5e,0x37,0xa7,0x9c,0x38,0xbf,0x1d,0x1d,0x7a,0xd9,0xe3,0x8b,0xa9,
1727   0x0f,0x29,0x58,0x1d,0x3c,0xec,0x47,0xfc,0x89,0xfc,0x6a,0x3c,0x72,0xf7,0x24,0xa4,
1728   0xc2,0x4a,0x27,0xcb,0x92,0x35,0x76,0x16,0x4d,0xc7,0x63,0xbd,0xad,0xdd,0x92,0xc6,
1729   0xbe,0x26,0xf3,0x08,0xd9,0x22,0xcb,0x28,0xa9,0x1d,0xaa,0x9e,0x29,0x37,0x75,0xb0,
1730   0xa3,0x5e,0x5d,0x74,0xb2,0x51,0xe5,0xd1,0x3f,0x9e,0xdf,0x7e,0x86,0xa4,0x6e,0x01,
1731   0x12,0x91,0x04,0xb0,0xbb,0x64,0x64,0xb2,0xae,0xeb,0xa0,0xfd,0x65,0xc4,0x1c,0x59,
1732   0xa9,0x5f,0x88,0x5a,0x96,0xfa,0xe8,0x69,0x97,0xa2,0x8f,0xbc,0x64,0x38,0x1f,0x58,
1733   0x0a,0x69,0x89,0x15,0xe3,0xb3,0x12,0x98,0x98,0x66,0x4b,0x59,0x25,0x9f,0x17,0x9e,
1734   0xd5,0x4d,0xa8,0x7e,0x2f,0x81,0xde,0x53,0xd4,0x74,0x76,0x48,0x99,0xa5,0xcc,0xa8,
1735   0xad,0x84,0x36,0x4f,0x0f,0xd5,0xdc,0x67,0x8d,0xab,0xb2,0x6b,0xc6,0x67,0x81,0x25,
1736   0x28,0xbd,0xde,0xaf,0xf2,0xaf,0x30,0x75,0x32,0x8f,0xae,0x30,0xc7,0x00,0x5d,0xeb,
1737   0x5f,0xf4,0x15,0x01,0x78,0xae,0x7c,0x1b,0x62,0xc0,0x09,0x36,0x3b,0x0d,0x01,0x9a,
1738   0xf0,0xc7,0x7c,0xe3,0x42,0x72,0x5f,0xfb,0xbd,0xde,0x62,0x1d,0xc2,0x2f,0x0c,0xd3,
1739   0x7d,0xd8,0xb1,0xf7,0xee,0x9b,0x7a,0xb4,0xe4,0x8a,0x5c,0x85,0xfc,0x07,0x1e,0x34,
1740   0xa5,0xc6,0x56,0xdc,0x1e,0xc9,0x6b,0xe7,0x76,0x62,0x94,0x0f,0x8a,0x34,0xd7,0x5f,
1741   0x09,0x32,0x0a,0x32,0x72,0x9d,0xd4,0x32,0x13,0x08,0xac,0x5a,0x0a,0x57,0xd7,0xf4,
1742   0x47,0xba,0x6d,0x9a,0x88,0xb6,0x54,0x37,0x5b,0x1c,0x43,0x06,0x1f,0x0e,0xbf,0x91,
1743   0x01,0x00,0x20,0xb3,0x02,0xb4,0x8c,0x95,0xef,0x3c,0xf9,0xb4,0x66,0xfb,0x2e,0xd8,
1744   0xd7,0xa4,0xc2,0x1d,0x7f,0x38,0x1a,0xed,0x6d,0x0a,0x6e,0x02,0x80,0xbd,0xc4,0x68,
1745   0x67,0x44,0xf3,0x78,0x9f,0xe0,0xa0,0xdd,0x77,0x25,0x43,0x92,0x0e,0xf5,0x22,0xe1,
1746   0x53,0x82,0x53,0x65,0x02,0x4e,0xbd,0x07,0xad,0x2d,0x17,0x03,0xaf,0x41,0xe7,0xe4,
1747   0x39,0xfd,0x83,0x83,0x49,0x22,0x12,0x0a,0xad,0xc3,0x8a,0xf6,0x04,0x43,0xb2,0x0f,
1748   0xbc,0x55,0x21,0x72,0x13,0xfa,0x3d,0x87,0x19,0x86,0x3d,0x0a,0xab,0x9a,0x26,0x04,
1749   0x79,0x2a,0xcf,0xd2,0x00,0x78,0xe0,0x1c,0x90,0x16,0xce,0xdf,0x46,0xe7,0xe0,0x63,
1750   0x12,0x1d,0x2d,0x44,0xb1,0x3b,0x9a,0x6b,0xb2,0x13,0xdf,0x15,0x74,0xc8,0x82,0xca,
1751   0x26,0xcd,0xd9,0x66,0xc5,0xe3,0x0c,0x13,0x20,0x1e,0x0f,0x4c,0xd6,0xdf,0xab,0xdb,
1752   0x55,0xda,0x75,0xda,0xdb,0x10,0xd4,0xb5,0x78,0xd5,0xff,0x25,0x0a,0xcb,0xfb,0x35,
1753   0x3f,0xe4,0xa0,0x96,0x63,0x94,0xf0,0x5d,0xda,0x4d,0x3f,0xb2,0x2d,0x13,0x78,0x85,
1754   0x8c,0xfa,0x36,0x93,0x7b,0xeb,0x63,0x6c,0xcd,0x9b,0x3a,0x6d,0xa3,0x91,0x45,0xc6,
1755   0x71,0x24,0x5e,0x74,0xf8,0x7a,0xb1,0x46,0x4c,0x89,0xb6,0xdb,0xcf,0x17,0x3b,0xa2,
1756   0x33,0xbd,0x57,0xd8,0x7b,0xdf,0x77,0x8c,0xf9,0xb5,0x54,0x9d,0x50,0x45,0xfa,0xb9,
1757   0x72,0x65,0xc2,0x5f,0xa3,0xbc,0x57,0xdd,0x73,0xc1,0xb3,0x52,0xc6,0xb9,0x22,0xac,
1758   0xcf,0xbc,0x3d,0xaa,0x10,0xb0,0xef,0xd9,0x5a,0x4c,0x73,0x9a,0xd2,0x15,0x53,0x1a,
1759   0xe9,0x63,0x6a,0x57,0x62,0x5c,0xe2,0x21,0x4f,0xf6,0x35,0x15,0x13,0xf8,0x2e,0xa3,
1760   0x60,0xf9,0xe8,0x08,0x39,0x5e,0xcd,0x54,0xf1,0x5f,0x97,0x64,0x29,0x02,0x52,0xe7,
1761   0xd5,0x1e,0x57,0x5c,0x36,0x58,0x52,0x12,0xe0,0x28,0x3b,0x26,0xb4,0xd4,0x5f,0x87,
1762   0xe6,0x72,0x58,0xf4,0xf8,0xe9,0x0f,0xfb,0xbc,0xf0,0xc1,0xfb,0x55,0x0c,0xf6,0x22,
1763   0x35,0x95,0x8a,0x6f,0x1f,0xb2,0xa7,0xb0,0x26,0x57,0xc7,0x83,0xab,0x4c,0xb6,0x58,
1764   0x61,0x28,0x8d,0x6d,0x4c,0x51,0xb7,0xcf,0xbc,0xfd,0xef,0x5f,0x56,0x34,0x3f,0xc9,
1765   0x0b,0xca,0x01,0x8e,0x1d,0x68,0xe1,0xfa,0x20,0x83,0xd8,0x2e,0xf6,0x62,0x31,0x16,
1766   0xd1,0x1c,0x87,0x72,0x34,0x96,0xc4,0xd1,0xf2,0x88,0x22,0x90,0x2c,0x78,0x2c,0xde,
1767   0x55,0xbc,0xbd,0xba,0x31,0x7b,0x00,0xf2,0xd0,0xac,0x6d,0x25,0x97,0x15,0xd1,0xc1,
1768   0x37,0x4c,0x46,0x05,0xb2,0xb8,0x35,0xff,0x5c,0x90,0x5a,0x8e,0xd7,0xd9,0xbf,0x60,
1769   0x15,0x6b,0xbf,0xf3,0x59,0xec,0x04,0x97,0x35,0xd2,0x88,0x69,0x8c,0x65,0x96,0x59,
1770   0x91,0xb9,0xc9,0x25,0xc5,0xb7,0x0c,0x5a,0xfb,0x14,0x97,0x59,0x57,0x57,0xf7,0x4e,
1771   0x4a,0xd7,0x05,0x39,0x96,0xb9,0xed,0xe9,0x4f,0xf5,0x28,0xfb,0xd7,0x51,0x81,0xde,
1772   0xe0,0x64,0x12,0xd1,0x6d,0x93,0x47,0xe3,0xd0,0x16,0xd9,0xf0,0xac,0xf3,0xd4,0xaa,
1773   0xf3,0x00,0x91,0x8c,0xe8,0xe4,0xbb,0xe8,0x1e,0x16,0x4c,0xd9,0x76,0xdb,0x90,0x50,
1774   0x24,0x4b,0x20,0x0b,0xa9,0x4c,0xe8,0x98,0xd9,0x94,0x20,0x55,0xd6,0xab,0x55,0x72,
1775   0x12,0xe6,0x61,0xed,0x4f,0x6b,0x6e,0x93,0xa2,0x33,0xf6,0x05,0x6b,0x02,0xc4,0xaf,
1776   0x5d,0x6f,0xf3,0xd2,0x7b,0xe2,0xed,0x7a,0x17,0x90,0x6d,0x87,0xd5,0x80,0x7c,0xa8,
1777   0xa5,0x89,0x76,0x5a,0xcc,0x50,0x06,0xec,0xda,0x4d,0x25,0x7d,0xb4,0xc6,0x1e,0xfb,
1778   0x8b,0xd1,0x8b,0x25,0xe2,0x55,0x58,0x89,0x8b,0x09,0xbe,0x86,0xa9,0x72,0x48,0x4a,
1779   0xae,0xe8,0xd1,0xd4,0x5d,0x91,0x83,0xf2,0xc8,0x64,0xd8,0x43,0x52,0x26,0x9c,0x34,
1780   0xae,0x6f,0xe8,0x06,0xdd,0xa5,0x27,0xc6,0x33,0xfe,0x14,0x52,0x52,0x82,0xb9,0x5a,
1781   0x2b,0x05,0x70,0x5b,0x03,0x30,0xe5,0xa5,0x6b,0x78,0x11,0x55,0x46,0x24,0x3f,0x5a,
1782   0xc6,0x4b,0x0a,0x74,0x6e,0xd2,0x5c,0x2f,0x10,0x71,0x6f,0xeb,0xd0,0xae,0xcf,0xd6,
1783   0x1e,0xdf,0x55,0xef,0xbe,0x2b,0x2c,0x05,0xc3,0x89,0xcf,0xb4,0x8e,0xbf,0x07,0x6e,
1784   0xd3,0x63,0xf1,0x6e,0x94,0xdc,0xf5,0xc5,0x23,0x61,0xcf,0x51,0x22,0xf7,0x89,0xc0,
1785   0x86,0x76,0x7e,0x91,0x8f,0x84,0x58,0x11,0xd0,0x97,0x11,0x61,0x2c,0xf7,0xf5,0x6e,
1786   0xd5,0xb8,0x9d,0xf6,0x4e,0xc3,0xf4,0x89,0x6a,0xcd,0x34,0x84,0x4a,0x5d,0xe9,0x16,
1787   0x62,0xca,0xec,0x3f,0x74,0x39,0x69,0xcb,0x92,0xa2,0xd9,0x5a,0x1e,0xcb,0x07,0x5b,
1788   0xcc,0x4b,0x0e,0x0b,0x9e,0x87,0x57,0x79,0xe6,0xb7,0x9f,0x84,0x47,0xe1,0xee,0xda,
1789   0xb4,0xdb,0xa0,0xfa,0x6e,0x4c,0x5f,0x32,0x08,0xaa,0x25,0xa1,0x66,0x3d,0x3e,0x35,
1790   0xb8,0x1a,0x43,0xac,0x83,0x28,0x20,0x96,0x98,0x1d,0x0e,0x51,0x19,0x81,0x98,0x0b,
1791   0x7a,0xa9,0x98,0xc2,0x7d,0xbb,0x3a,0x46,0x34,0xb0,0xf7,0x34,0x02,0x4c,0x9a,0xfc,
1792   0x99,0x26,0x3e,0xdb,0xfd,0xa6,0x4d,0xe1,0x7e,0x01,0x82,0xeb,0xc0,0x3e,0xe6,0xa8,
1793   0xb6,0x33,0xd6,0x97,0xa1,0x88,0xfa,0x07,0x15,0xb2,0x4e,0x15,0xf4,0xf7,0x1c,0xb0,
1794   0x70,0x70,0xfe,0x97,0x0b,0x01,0xe0,0x58,0x99,0x62,0xfb,0x52,0x3c,0x18,0xda,0xb3,
1795   0x66,0x7b,0x58,0x79,0xdb,0xb1,0x9f,0x74,0xab,0xb1,0x29,0x42,0x3a,0xc2,0x51,0x3b,
1796   0xf6,0x83,0xdf,0xaf,0x39,0xd7,0xfc,0xea,0x3f,0x79,0x86,0x8d,0x0f,0x73,0x2a,0x8c,
1797   0x80,0x1f,0x69,0x29,0x38,0x29,0x8f,0xf6,0xad,0x8a,0xbc,0xd6,0x26,0x8d,0xdf,0xfb,
1798   0xb9,0xcd,0xb5,0xe8,0x4e,0x34,0xcd,0x6f,0x9a,0xfc,0x86,0xb3,0x24,0xb1,0x0f,0x27,
1799   0x42,0x2c,0x65,0x8c,0x1b,0x98,0x57,0xf6,0xa6,0x70,0x84,0xc6,0xa9,0x7d,0x5a,0xb0,
1800   0xba,0xdc,0x18,0xb5,0xf5,0xcc,0x29,0x71,0x84,0x54,0xae,0x55,0x93,0x60,0x36,0xc1,
1801   0x7d,0x6e,0x04,0x5c,0xec,0xcc,0xaa,0x9c,0xda,0x98,0x0b,0xc8,0x93,0xc2,0x5a,0xf7,
1802   0xb0,0x07,0x18,0x0f,0x1c,0xf7,0x19,0xc6,0x12,0xef,0x7e,0xa3,0x1b,0x1f,0xbb,0xfd,
1803   0x14,0x84,0x91,0xf9,0x25,0xee,0x14,0x8f,0xca,0xfa,0xa6,0x85,0xcd,0x17,0xf9,0x72,
1804   0x49,0x84,0x10,0xbb,0xa7,0x4f,0x3d,0x98,0xa4,0x57,0x23,0x0e,0x48,0x4a,0xb4,0xf6,
1805   0xef,0xa7,0x34,0xf4,0x43,0xbc,0x33,0x7f,0x3f,0xa8,0x95,0xdf,0x2c,0x59,0x8d,0x29,
1806   0xa7,0x8e,0x9d,0x44,0x98,0xd5,0x96,0xe6,0x3b,0x8c,0x9d,0x97,0x1a,0xe3,0x23,0xab,
1807   0x0f,0xd7,0xeb,0x4b,0x46,0x38,0x07,0x6c,0x38,0xa4,0xda,0xd6,0xb1,0x88,0x16,0x1d,
1808   0xc9,0x24,0xbe,0xaa,0xed,0x87,0x25,0xb2,0xd7,0x8e,0xec,0x3c,0x91,0xe9,0x07,0x1e,
1809   0x75,0x15,0xb7,0x00,0x2e,0x61,0x90,0x57,0xb7,0xec,0x73,0x69,0x5a,0xa4,0x94,0x4f,
1810   0xb1,0x48,0x75,0xed,0xa8,0x66,0xe8,0xfb,0x78,0x5d,0x10,0xfe,0xac,0x5b,0x5f,0x4e,
1811   0x1f,0x5f,0x98,0x11,0xfb,0x37,0xce,0x3e,0xbb,0x81,0x62,0x9a,0x28,0xad,0x07,0xbd,
1812   0x5e,0xf9,0xc1,0x0d,0xc7,0x73,0xe0,0xc0,0x1e,0xf9,0x09,0xdd,0x6d,0x3b,0x2d,0x3b,
1813   0x0f,0xb6,0x8e,0x80,0xad,0xba,0xc0,0x22,0x43,0x64,0xa5,0x68,0x1b,0xa3,0x6f,0x68,
1814   0xd0,0x36,0xa1,0x0a,0x4c,0xac,0x0e,0x03,0xc9,0x62,0xd7,0xda,0xd3,0x87,0x6f,0xe5,
1815   0x43,0x1a,0x9a,0x4b,0x44,0xe9,0x68,0x03,0x51,0x93,0x3e,0xd3,0x34,0x86,0xcc,0x51,
1816   0x07,0x01,0x17,0xe4,0x35,0x12,0x70,0xc2,0x7a,0x98,0x7a,0xf3,0xde,0x41,0x27,0x4c,
1817   0xbc,0x8b,0xba,0x74,0xc0,0xc6,0xc5,0xe1,0xe3,0x10,0x2b,0xda,0x71,0x56,0x1f,0x76,
1818   0x03,0x59,0x22,0x9b,0x84,0xa5,0x07,0xff,0x2f,0x9b,0xf2,0x29,0x8d,0x67,0x53,0x70,
1819   0x7b,0x0a,0xef,0xf9,0x21,0x50,0xd7,0xbc,0xfb,0xd9,0x6e,0x7f,0xd3,0x13,0x66,0xd8,
1820   0xc4,0x3d,0xc2,0x2f,0x38,0x66,0xd4,0xb9,0xe9,0x6b,0x3f,0x7c,0xe2,0xfb,0xf5,0x51,
1821   0x7e,0x95,0x39,0xdc,0x67,0x87,0x9e,0x94,0x98,0xf0,0x05,0xc1,0x5a,0xbd,0xa2,0x78,
1822   0x4a,0xaf,0xf6,0xa0,0x50,0x53,0xd5,0xef,0xa8,0x08,0x61,0xed,0xdc,0xfb,0x0c,0xee,
1823   0xc7,0x2d,0x98,0x1b,0x92,0x6b,0x1a,0x69,0xb9,0x53,0xf2,0xa0,0x07,0x55,0xd3,0x54,
1824   0x95,0xae,0xc0,0xee,0xce,0x6d,0x0b,0xa3,0x6c,0x72,0x58,0x7a,0x7b,0x69,0x97,0x49,
1825   0x54,0xd2,0x0d,0xb8,0xa2,0xfb,0x4a,0x3b,0x60,0x03,0x33,0x1b,0xd8,0xd9,0xf9,0x6e,
1826   0xa5,0x3a,0x1f,0x19,0xb0,0xb5,0x77,0xd3,0x35,0xa8,0x24,0x24,0xbe,0x43,0x98,0x61,
1827   0x26,0x84,0x96,0xb1,0x97,0x39,0x30,0x0b,0x8c,0x01,0xc9,0x34,0xce,0x4a,0x14,0xc4,
1828   0x79,0x52,0x12,0x21,0xf8,0x29,0x17,0x81,0x03,0xac,0xc5,0xeb,0xa7,0x8b,0x0d,0x36,
1829   0x3e,0x43,0x34,0x08,0x71,0x24,0xcb,0xd7,0x3c,0x4b,0xb5,0xea,0xea,0xa8,0x24,0x57,
1830   0x13,0xf8,0x9b,0x06,0xa4,0xca,0xec,0xac,0xd7,0x7d,0x3b,0xd0,0x35,0xf8,0xc8,0x9a,
1831   0x10,0xe7,0xbb,0x30,0xbc,0x1b,0xa0,0x72,0xe3,0xf5,0x3d,0x2a,0xf3,0x29,0x28,0x72,
1832   0x2b,0xb9,0xc8,0xb6,0x99,0xf7,0x53,0xaf,0x1b,0x85,0xd1,0x68,0x61,0x58,0x17,0x3c,
1833   0xe9,0xaf,0xcc,0xd4,0x01,0x20,0x66,0x2d,0xc7,0x8b,0x2c,0x8f,0x2b,0x23,0x35,0x96,
1834   0xea,0x6b,0x67,0x2c,0x94,0x36,0x78,0x8c,0x86,0xa5,0xef,0xf0,0x2c,0x23,0x22,0xcf,
1835   0x8d,0x39,0x5d,0xf2,0xda,0x29,0x6c,0xf8,0x75,0xb9,0x19,0x50,0x12,0x7f,0x7f,0x37,
1836   0xb3,0xe3,0x08,0xbc,0xaa,0x19,0x6e,0xbe,0x9a,0x2a,0xbc,0xeb,0x76,0xeb,0x4d,0xc2,
1837   0x7f,0x04,0xcb,0x91,0x48,0xe9,0x31,0x77,0xb5,0xe3,0xc9,0x62,0xf6,0x07,0x2d,0x11,
1838   0x90,0x3c,0x48,0x11,0x54,0x38,0x55,0xc3,0x64,0x82,0xde,0x54,0x34,0x71,0xbe,0xc2,
1839   0x86,0x2b,0x1e,0xdd,0x6c,0xa6,0x7b,0x42,0x49,0xa9,0x9d,0x61,0xcf,0xcb,0xa0,0x77,
1840   0x02,0x72,0xee,0x94,0x32,0xd4,0x41,0x95,0x03,0xf8,0xa5,0x29,0x68,0xb4,0x73,0xcf,
1841   0xa2,0xb0,0x56,0xd6,0x45,0x60,0x49,0x5b,0x33,0x0d,0x96,0x4d,0x9e,0xcc,0xd8,0x6b,
1842   0x08,0x85,0xf8,0x43,0x45,0xec,0x32,0x34,0x77,0x8a,0x11,0x6c,0x10,0xb4,0x6d,0xea,
1843   0xd4,0x91,0x73,0x7c,0xd3,0x18,0x9d,0xc0,0x71,0x0e,0xb4,0x26,0x61,0x0b,0xd5,0xec,
1844   0xa4,0x75,0x68,0x1f,0x8e,0x82,0x29,0xa0,0xc0,0x39,0x21,0x1b,0x2e,0x71,0xad,0x11,
1845   0x1a,0xd0,0x75,0xce,0x16,0xcc,0x76,0x73,0x05,0xac,0xf8,0xec,0x19,0x86,0x96,0xf9,
1846   0xd5,0x42,0x3c,0x29,0x0b,0x95,0x24,0xd9,0xde,0x05,0xd7,0x38,0xc1,0xeb,0x31,0x45,
1847   0x75,0x6b,0x5c,0xce,0x0e,0x7d,0xd3,0x72,0xed,0xe6,0x60,0x9f,0xc6,0x3f,0x1d,0x94,
1848   0x9a,0xec,0x76,0x5f,0xbd,0x24,0x24,0xdf,0xd1,0xef,0x32,0xc2,0xc8,0x22,0xfb,0x86,
1849   0xe5,0x63,0x28,0x7b,0xba,0x2b,0xb6,0xbe,0x2a,0xbe,0xed,0x3f,0x68,0x34,0x69,0xbc,
1850   0xf5,0x73,0x14,0xc2,0xa5,0x31,0x29,0xb2,0x99,0xf5,0x32,0xb8,0x45,0x15,0x09,0xd4,
1851   0x6a,0xb9,0xd9,0xd5,0x1c,0xd6,0x1d,0x58,0xbd,0x33,0x9f,0xcc,0xff,0x66,0x7a,0x70,
1852   0xe5,0xd7,0x18,0x53,0xc1,0xba,0x33,0x51,0x36,0x18,0xd7,0x1c,0x36,0xc6,0x5c,0x30,
1853   0x05,0x6b,0x6f,0xdc,0x33,0x7e,0x0a,0x3e,0xa4,0x45,0x77,0x46,0x8b,0xd6,0x50,0xb2,
1854   0x6a,0x18,0x80,0x10,0x12,0xc1,0x42,0xbe,0xa8,0x58,0x20,0xec,0x9d,0x34,0xf5,0x98,
1855   0xb4,0x7b,0xea,0x8f,0xff,0x23,0x7c,0x72,0xe1,0xf3,0x73,0xad,0x0c,0x82,0xeb,0x81,
1856   0x83,0x36,0x4e,0xfa,0x99,0x45,0x56,0xf8,0xef,0xb6,0x0f,0x2a,0x79,0x5f,0xd2,0x0d,
1857   0x78,0xe7,0x4b,0xf0,0x80,0xc5,0x72,0xf2,0x72,0x3f,0x94,0x01,0x82,0x6b,0x4b,0xdc,
1858   0x32,0x31,0x80,0x11,0x54,0x45,0x70,0xff,0x0b,0x30,0xa3,0xd4,0xc9,0x47,0xf5,0x8f,
1859   0x51,0xb1,0x90,0xfe,0xb6,0x64,0xee,0xc0,0x59,0x28,0xdb,0x42,0xed,0x92,0x70,0xc5,
1860   0x76,0x09,0x18,0x56,0x44,0xc3,0x8e,0xd3,0xfc,0xc7,0xdc,0xec,0x8f,0xec,0x5c,0x1e,
1861   0x3f,0xd7,0xba,0xb9,0xa0,0x01,0xef,0xda,0x94,0xae,0x46,0x70,0x4d,0xf5,0x5a,0x3b,
1862   0x4e,0xbe,0x14,0xc7,0x6a,0xbd,0xb1,0x74,0xc2,0x7b,0xb9,0x70,0xc9,0x4e,0x08,0xba,
1863   0x43,0x5b,0xc9,0x21,0x9a,0x74,0x41,0x25,0xd0,0xd6,0x8c,0xa2,0x95,0x08,0x3d,0xbc,
1864   0x50,0x76,0x65,0xc4,0x35,0xd9,0xe2,0x5d,0x4d,0x3c,0x62,0x79,0x6d,0xfa,0x64,0x5b,
1865   0x3b,0xbd,0x35,0x95,0x30,0x7f,0xf6,0x0a,0x90,0x8b,0x94,0xed,0x73,0x7c,0xcd,0xbf,
1866   0xbf,0x3c,0x31,0x53,0x2a,0x06,0x1d,0xcd,0x3b,0x64,0xc0,0x9d,0x48,0x30,0x1a,0x88,
1867   0x79,0x96,0xf7,0x9f,0xc3,0x0f,0xf7,0x45,0xed,0x66,0x89,0x2c,0x8d,0xb5,0xea,0x56,
1868   0x0b,0x68,0x29,0x18,0x9b,0x38,0x25,0x12,0x46,0x31,0x8c,0x37,0xe1,0xac,0xdd,0xca,
1869   0x13,0x54,0x66,0x5e,0x53,0x23,0x46,0xd4,0xe7,0x65,0x6b,0x60,0xe5,0xb3,0x93,0x83,
1870   0x34,0xf9,0x4e,0x11,0x8a,0x6f,0xfa,0x2c,0x6e,0xa2,0xc5,0x46,0x37,0x6c,0xad,0x21,
1871   0x0b,0xf7,0x82,0xd2,0xe0,0xbd,0xe1,0xb8,0x7d,0x89,0x3a,0x89,0x79,0x76,0xca,0x45,
1872   0x39,0xee,0xa1,0x3f,0xf6,0xac,0x9c,0x1b,0xb4,0xb9,0x6a,0xc9,0x4a,0x71,0x8a,0x8e,
1873   0x5f,0x7f,0x4b,0xfa,0x6a,0xdc,0xca,0xf2,0xb1,0xd2,0xf6,0xa7,0x4a,0xfe,0x8e,0x9c,
1874   0x1c,0x49,0x20,0xa3,0xde,0xed,0x0b,0xdf,0x16,0x75,0x7d,0xc2,0x1a,0xbc,0x74,0x0f,
1875   0x11,0xec,0xc0,0xd8,0xf1,0x7f,0xff,0x80,0x82,0x41,0x9f,0xba,0x59,0x4b,0xde,0x87,
1876   0xdc,0x08,0xcc,0x3b,0x44,0x33,0x47,0x78,0x95,0xd6,0xfc,0x2f,0xa7,0x4b,0x6c,0xa5,
1877   0x1f,0x3e,0xe3,0x6b,0x75,0xa8,0x81,0x64,0xef,0xd4,0x35,0xc2,0xa4,0x5d,0xbc,0x08,
1878   0x79,0x2d,0xa5,0x08,0x26,0x7e,0x50,0xe5,0x31,0xdc,0xe9,0x12,0xf1,0x20,0x70,0x50,
1879   0x8b,0x75,0xb3,0xb3,0xf7,0x55,0x51,0x9c,0xfa,0x8c,0xb8,0xbf,0x2c,0x34,0x27,0x1e,
1880   0xf3,0xb6,0xac,0x0b,0x86,0xce,0x25,0x28,0xea,0x86,0x42,0x6a,0xf7,0x39,0x81,0x10,
1881   0x53,0x91,0x30,0xb0,0x75,0x88,0x6d,0x2a,0xa2,0x6a,0x28,0xb1,0xf2,0xd0,0x1e,0xc8,
1882   0x4a,0xa5,0xdf,0x42,0x63,0x23,0xc8,0xc1,0xd6,0x09,0x36,0xbb,0x97,0x9f,0xe6,0x79,
1883   0x92,0x5a,0x62,0xf0,0xd7,0x0c,0xe7,0x6c,0x85,0x98,0xf4,0x30,0xa3,0x08,0x7e,0xf8,
1884   0x3f,0xae,0xbc,0x7d,0x38,0x2d,0xb4,0xcb,0x3c,0x78,0x3c,0x3b,0xca,0xd0,0xfb,0x78,
1885   0x30,0xc8,0x68,0x7c,0x8d,0x44,0xc8,0x93,0xcf,0x74,0x33,0x56,0xb5,0xdd,0x8f,0xb1,
1886   0xcd,0x50,0x93,0xdd,0x75,0xef,0xc4,0x65,0xdd,0x2e,0x7a,0x23,0x02,0xcf,0xdb,0x43,
1887   0xb4,0xe4,0xdd,0x3e,0x91,0xd0,0x47,0xdf,0x06,0x45,0xb0,0x41,0x53,0x47,0x7d,0xce,
1888   0x87,0x26,0xe6,0x41,0x7f,0x86,0xf1,0xa3,0xeb,0x5a,0x75,0x51,0x48,0xe3,0x17,0xf3,
1889   0xe5,0xb5,0x4f,0x85,0xe1,0xb2,0x63,0x51,0x2a,0x0c,0x69,0xf1,0x7f,0x45,0x48,0x51,
1890   0x6e,0x31,0xb7,0xaa,0x56,0xf2,0x3c,0x87,0x65,0xfa,0x2d,0xc3,0x9a,0x0c,0xb1,0x88,
1891   0xc3,0x3b,0xbe,0x50,0x7e,0xe8,0x1c,0xe7,0x3b,0xc7,0x60,0x66,0x38,0xd9,0xf0,0x38,
1892   0x83,0x72,0x05,0x18,0xfa,0x33,0xa3,0x10,0x4d,0x10,0xa2,0x7a,0xf9,0x4b,0xa7,0x02,
1893   0x4e,0x76,0x2a,0xa1,0x69,0x74,0x71,0xa2,0x39,0x77,0x93,0xa0,0x7d,0x02,0x75,0x85,
1894   0xc4,0xe7,0xcf,0x8b,0x6b,0x49,0x27,0x3e,0xa1,0x9b,0xd3,0x77,0x65,0x9e,0xfb,0x61,
1895   0x85,0x66,0x93,0x77,0xa0,0x54,0x64,0x82,0x24,0x1c,0x03,0x9f,0x50,0xbf,0xd7,0x36,
1896   0x32,0x91,0x17,0x03,0xa9,0x34,0xc8,0x10,0x63,0x9a,0xc2,0xb8,0xde,0x06,0xab,0xa5,
1897   0x6a,0x0a,0xfa,0xd1,0x25,0x89,0xf4,0x88,0xfc,0xb6,0xb1,0x63,0xb0,0x12,0x16,0x4d,
1898   0xcd,0x71,0xdb,0x80,0xb4,0xf4,0x87,0x88,0x91,0x0f,0x6e,0x3f,0x65,0x83,0xb9,0xce,
1899   0xfc,0x64,0x5d,0xb1,0xf6,0x14,0x21,0xb2,0xc1,0x45,0x9b,0xec,0x9d,0xfa,0x32,0xc8,
1900   0x96,0x85,0x1d,0x03,0x8c,0x89,0x62,0xa5,0x2d,0xf8,0xd7,0x0a,0xf8,0x16,0x23,0xdc,
1901   0x3b,0x73,0xbd,0x16,0x15,0xf3,0xea,0x01,0x74,0xc9,0xc2,0x39,0x16,0x76,0x2b,0xa9,
1902   0x8b,0xce,0xdc,0x8a,0x31,0xf3,0x5a,0x67,0x35,0x57,0xfd,0x1a,0x98,0xbd,0xeb,0xcf,
1903   0x27,0x37,0x1a,0xff,0x80,0x28,0x51,0x76,0x13,0x42,0x27,0x4c,0x1d,0x88,0x01,0xee,
1904   0xad,0x4d,0x17,0x16,0xa3,0x32,0x6f,0xce,0xab,0x2b,0xe0,0x70,0x45,0x79,0x0f,0xa7,
1905   0xbf,0xb0,0x74,0x6e,0x38,0xb1,0x55,0x0f,0x9f,0xb0,0xc8,0x24,0xb1,0x2f,0xb4,0x99,
1906   0xfd,0x00,0xd0,0xa7,0xe1,0x46,0xa2,0xd9,0x8e,0x73,0x80,0x0a,0xff,0x4a,0x91,0x64,
1907   0x05,0xde,0xcb,0x61,0x3e,0x90,0xf6,0xcd,0x18,0x13,0xa6,0xc1,0xd1,0x6b,0x44,0xa8,
1908   0x79,0xe8,0x06,0x3d,0xed,0x2f,0xf1,0x8a,0xdd,0x31,0xdc,0xe9,0xc6,0x30,0x6f,0x06,
1909   0xf8,0xc0,0x1f,0xda,0x90,0xc3,0x33,0xb0,0x7e,0x6b,0xc2,0x23,0x7f,0x3b,0xb1,0x1d,
1910   0x22,0x06,0xb8,0xd8,0xc6,0xed,0x5d,0xe0,0x9a,0x63,0xf6,0x0e,0x9b,0x2c,0xab,0x8d,
1911   0x98,0x58,0x70,0xd8,0x30,0x4c,0x0e,0xb9,0xd1,0xb8,0x1a,0x4a,0xba,0xa1,0xfb,0xf6,
1912   0xf9,0x58,0xe8,0x78,0x6c,0x80,0xe6,0xdb,0xc3,0x0b,0xcd,0x77,0x7c,0x3c,0x43,0xf9,
1913   0xe5,0xa5,0xbe,0x5a,0x1c,0x29,0x86,0xe6,0x11,0xfb,0xb0,0x36,0x81,0x9c,0x22,0x35,
1914   0xfc,0xdf,0x94,0x1e,0xdf,0xe8,0x8d,0x7a,0x5a,0x27,0x61,0x26,0x6a,0x61,0x39,0x4a,
1915   0xde,0xa7,0x0a,0x62,0x56,0x5c,0x9b,0x38,0x3e,0x32,0x82,0xe7,0xd6,0x2b,0x26,0xd8,
1916   0x2c,0x9c,0xbe,0xc8,0x1f,0x25,0x50,0xbf,0x5d,0xb9,0xb2,0x19,0x65,0x9b,0x8b,0x80,
1917   0x85,0x5e,0x52,0xef,0xdc,0xe3,0x4c,0xaf,0x58,0x5e,0x91,0x5d,0xb8,0x50,0x07,0xe1,
1918   0x89,0x8d,0x65,0x77,0x2c,0x37,0x30,0xa9,0xce,0xc0,0xc0,0x51,0x6d,0xea,0x3b,0x9b,
1919   0xd9,0xca,0x97,0x00,0xaf,0xbf,0x9b,0x4c,0x5f,0x7f,0xde,0x98,0x26,0x0a,0xc5,0x4f,
1920   0x14,0xb3,0x88,0x2b,0x06,0x1e,0x2d,0x38,0xab,0x3b,0x8b,0xcf,0x82,0x4f,0x47,0x9b,
1921   0xda,0xea,0xd9,0x97,0xd0,0xf1,0x87,0x0d,0x53,0x95,0x67,0x97,0x22,0x59,0x60,0x21,
1922   0xcb,0x0f,0x29,0xe4,0xad,0xda,0x47,0x6b,0xf6,0x2c,0x13,0x91,0xa5,0xc8,0xb1,0x80,
1923   0x88,0xc0,0x18,0xb3,0x3d,0x77,0x0f,0xf3,0x34,0xa0,0x2d,0x5c,0xab,0x3c,0xd8,0x59,
1924   0xaf,0x9f,0x46,0xa2,0x21,0x6a,0x7f,0x44,0xad,0x91,0x57,0x99,0xd4,0x56,0x77,0x4a,
1925   0xe2,0x4b,0x54,0x53,0xf8,0x53,0x35,0xfe,0x02,0xa0,0x31,0xe6,0xc0,0xb5,0x2d,0xf5,
1926   0xc1,0x64,0xe1,0x65,0x62,0xd0,0xd3,0xc2,0xd2,0x6c,0x59,0xe5,0x10,0xf9,0x9b,0xf9,
1927   0xea,0x8b,0x8d,0x79,0xff,0x83,0xf8,0x2f,0xbd,0x95,0x71,0x35,0x63,0xc3,0x5f,0xf7,
1928   0xff,0x5f,0xf9,0x2e,0x70,0x0b,0x44,0xe5,0x64,0xbb,0x18,0x76,0x59,0xb1,0x1b,0x8d,
1929   0x9f,0x80,0xc3,0x24,0x54,0x09,0x58,0x84,0x65,0x7f,0xee,0x49,0x93,0x65,0x6e,0x5d,
1930   0x6a,0x8e,0x8d,0xfb,0x4b,0x1b,0xd2,0xad,0x62,0x80,0x94,0x4d,0xaf,0x7f,0xf9,0x06,
1931   0x01,0x29,0xf6,0x53,0xf5,0xe3,0x54,0xfe,0xfa,0x5e,0xa9,0x22,0x4f,0x9d,0x5a,0x29,
1932   0x03,0xf2,0x9f,0xcd,0xf3,0x00,0x7e,0x19,0xce,0xba,0xcd,0x68,0x13,0x61,0x33,0x64,
1933   0x10,0x88,0x27,0x08,0xe3,0x13,0xee,0x9e,0x7c,0x32,0xa0,0xc0,0x99,0x6a,0x23,0x59,
1934   0xc8,0x8c,0x2e,0xa4,0x67,0xba,0x46,0x2b,0xa6,0x68,0xc3,0xc9,0x83,0x58,0xca,0xa7,
1935   0xcb,0x9c,0x54,0x42,0x1f,0x97,0x25,0x62,0xeb,0xfb,0xd5,0x23,0x70,0xcc,0xc9,0xef,
1936   0xba,0x5a,0x39,0x80,0xa9,0x49,0x2b,0xe2,0xec,0x8c,0x76,0x6e,0x00,0x64,0xbf,0xcf,
1937   0x34,0x65,0x7e,0x00,0xa7,0x71,0xf9,0x4b,0x47,0xb9,0x46,0x4b,0xd3,0xc2,0x4c,0xe9,
1938   0xd9,0x5d,0xc2,0x61,0xb8,0xad,0x2d,0x3e,0x9e,0x24,0xe5,0x58,0x8a,0x85,0x10,0xdc,
1939   0x4a,0xe3,0xa5,0x44,0x7d,0x9f,0x69,0x59,0x90,0x6d,0xf4,0x37,0xc4,0x4e,0xac,0x49,
1940   0x26,0x96,0xc7,0x47,0x94,0xe6,0x4d,0x3e,0xbe,0x32,0x12,0x88,0x21,0xbc,0xbf,0xce,
1941   0x0d,0x16,0xc9,0x0c,0x9f,0x22,0x77,0x8d,0xc7,0x15,0xe0,0xe9,0x42,0x6f,0xe9,0x0d,
1942   0x9f,0x03,0x4a,0x33,0x3d,0xf4,0x89,0xe4,0x4a,0xb5,0xfc,0xfc,0xc5,0x07,0xca,0xa5,
1943   0x7d,0xfd,0xea,0x5a,0x0e,0xfb,0x22,0xe5,0xea,0xb2,0x08,0x60,0x4c,0x24,0x03,0x37,
1944   0x45,0xa5,0x4a,0x23,0xb3,0xd7,0xe2,0x2f,0x44,0xac,0xa3,0xb6,0x77,0x67,0x33,0x61,
1945   0x99,0x9a,0x08,0x2d,0xcb,0x28,0x6a,0x62,0xfa,0x44,0x6d,0x9c,0xe4,0x6f,0xfa,0xc5,
1946   0x19,0x7d,0xc6,0x18,0xf6,0x8f,0x58,0x1f,0xab,0x19,0x07,0xb4,0x35,0xdc,0xf8,0x02,
1947   0x63,0xec,0x23,0x84,0xd4,0xab,0x4e,0x04,0xf7,0xcb,0x10,0x9d,0x09,0x4f,0xce,0xb9,
1948   0x19,0x89,0xc0,0x12,0x06,0x1c,0xec,0xb3,0x7e,0xfa,0x28,0xf7,0x00,0x66,0x1b,0x88,
1949   0xda,0xf3,0x3c,0x61,0x2b,0x82,0xd0,0xcc,0xe1,0x47,0xef,0x63,0xba,0xc3,0x7f,0x11,
1950
1951   /* data */
1952   0xfa,0x24,0xd8,0xde,0xfa,0xc2,0x72,0x30,0xa2,0x00,0xeb,0x34,0xb6,0x1e,0xc0,0x61,
1953   0x11,0xf0,0x05,0x0c,0x46,0x48,0xcf,0x88,0xe9,0xfc,0x30,0x29,0x8f,0xe0,0x3f,0x43,
1954   0xcb,0xc6,0x0d,0x2b,0x31,0x84,0xb0,0x34,0x55,0xee,0x3b,0xb3,0xcc,0xd6,0xc3,0xfa,
1955   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1956   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1957   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1958   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1959   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1960   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1961   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1962   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1963   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1964   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1965   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1966   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1967   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1968   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1969   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1970   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1971   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1972   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1973   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1974   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1975   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1976   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1977   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1978   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1979   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1980   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1981   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1982   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1983   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1984   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1985   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1986   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1987   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1988   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1989   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1990   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1991   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1992   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1993   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1994   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1995   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1996   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1997   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1998   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1999   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2000   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2001   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2002   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2003   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2004   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2005   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2006   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2007   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2008   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2009   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2010   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2011   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2012   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2013   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2014   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2015   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2016   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2017   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2018   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2019   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2020   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2021   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2022   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2023   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2024   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2025   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2026   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2027   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2028   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2029   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2030   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2031   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2032   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2033   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2034   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2035   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2036   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2037   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2038   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2039   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2040   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2041   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2042   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2043   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2044   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2045   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2046   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2047   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2048   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2049   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2050   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2051   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2052   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2053   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2054   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2055   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2056   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2057   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2058   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2059   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2060   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2061   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2062   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2063   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2064   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2065   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2066   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2067   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2068   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2069   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2070   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2071   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2072   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2073   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2074   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2075   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2076   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2077   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2078   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2079   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2080   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2081   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2082   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2083   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2084   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2085   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2086   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2087   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2088   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2089   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2090   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2091   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2092   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2093   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2094   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2095   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2096   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2097   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2098   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2099   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2100   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2101   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2102   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2103   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2104   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2105   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2106   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2107   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2108   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2109   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2110   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2111   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2112   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2113   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2114   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2115   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2116   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2117   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2118   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2119   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2120   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2121   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2122   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2123   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2124   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2125   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2126   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2127   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2128   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2129   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2130   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2131   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2132   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2133   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2134   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2135   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2136   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2137   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2138   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2139   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2140   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2141   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2142   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2143   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2144   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2145   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2146   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2147   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2148   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2149   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2150   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2151   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2152   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2153   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2154   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2155   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2156   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2157   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2158   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2159   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2160   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2161   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2162   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2163   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2164   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2165   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2166   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2167   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2168   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2169   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2170   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2171   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2172   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2173   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2174   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2175   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2176   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2177   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2178   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2179   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2180   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2181   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2182   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2183   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2184   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2185   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2186   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2187   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2188   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2189   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2190   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2191   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2192   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2193   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2194   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2195   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2196   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2197   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2198   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2199   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2200   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2201   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2202   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2203   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2204   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2205   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2206   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2207   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
2208};
2209
2210
2211/* 317-0024 FD1089B */
2212static const UINT8 key_0024[0x2000] =
2213{
2214   /* opcodes */
2215   0xa7,0x54,0x38,0xa4,0x33,0xb6,0x24,0x8d,0x07,0x9d,0x45,0xca,0xbc,0x66,0xb7,0x36,
2216   0xf1,0x6c,0x95,0xad,0x3f,0x0c,0xfb,0x0c,0x44,0xa1,0x06,0x2e,0x9c,0x87,0xd1,0xf0,
2217    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2218    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2219    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2220    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2221    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2222    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2223    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2224    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2225    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2226    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2227    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2228    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2229    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2230    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2231    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2232    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2233    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2234    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2235    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2236    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2237    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2238    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2239    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2240    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2241    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2242    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2243    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2244    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2245    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2246    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2247    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2248    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2249    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2250    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2251    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2252    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2253    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2254    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2255    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2256    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2257    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2258    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2259    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2260    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2261    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2262    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2263    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2264    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2265    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2266    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2267    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2268    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2269    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2270    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2271    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2272    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2273    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2274    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2275    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2276    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2277    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2278    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2279    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2280    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2281    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2282    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2283    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2284    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2285    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2286    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2287    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2288    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2289    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2290    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2291    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2292    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2293    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2294    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2295    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2296    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2297    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2298    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2299    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2300    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2301    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2302    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2303    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2304    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2305    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2306    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2307    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2308    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2309    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2310    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2311    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2312    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2313    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2314    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2315    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2316    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2317    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2318    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2319    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2320    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2321    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2322    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2323    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2324    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2325    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2326    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2327    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2328    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2329    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2330    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2331    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2332    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2333    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2334    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2335    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2336    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2337    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2338    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2339    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2340    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2341    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2342    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2343    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2344    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2345    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2346    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2347    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2348    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2349    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2350    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2351    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2352    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2353    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2354    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2355    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2356    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2357    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2358    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2359    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2360    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2361    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2362    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2363    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2364    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2365    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2366    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2367    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2368    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2369    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2370    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2371    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2372    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2373    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2374    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2375    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2376    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2377    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2378    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2379    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2380    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2381    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2382    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2383    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2384    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2385    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2386    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2387    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2388    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2389    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2390    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2391    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2392    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2393    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2394    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2395    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2396    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2397    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2398    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2399    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2400    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2401    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2402    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2403    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2404    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2405    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2406    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2407    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2408    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2409    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2410    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2411    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2412    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2413    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2414    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2415    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2416    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2417    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2418    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2419    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2420    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2421    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2422    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2423    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2424    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2425    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2426    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2427    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2428    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2429    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2430    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2431    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2432    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2433    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2434    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2435    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2436    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2437    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2438    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2439    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2440    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2441    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2442    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2443    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2444    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2445    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2446    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2447    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2448    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2449    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2450    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2451    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2452    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2453    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2454    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2455    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2456    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2457    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2458    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2459    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2460    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2461    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2462    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2463    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2464    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2465    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2466    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2467    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2468    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2469    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2470    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2471
2472   /* data */
2473   0x3e,0x82,0x66,0x32,0x8d,0xed,0x09,0x45,0x24,0xb8,0x13,0xb5,0xfe,0x9d,0xfe,0xbe,
2474   0x19,0x59,0x47,0x9c,0x70,0xa8,0x6a,0x8b,0xfe,0x46,0xe3,0xc7,0xc1,0xef,0x2e,0x8c,
2475   0xb3,0x5e,0xc7,0x16,0xd2,0x51,0x2a,0xa0,0x18,0x83,0xd3,0x68,0x82,0xaf,0x3d,0xa9,
2476    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2477    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2478    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2479    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2480    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2481    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2482    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2483    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2484    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2485    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2486    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2487    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2488    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2489    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2490    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2491    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2492    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2493    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2494    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2495    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2496    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2497    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2498    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2499    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2500    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2501    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2502    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2503    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2504    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2505    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2506    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2507    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2508    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2509    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2510    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2511    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2512    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2513    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2514    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2515    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2516    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2517    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2518    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2519    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2520    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2521    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2522    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2523    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2524    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2525    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2526    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2527    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2528    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2529    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2530    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2531    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2532    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2533    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2534    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2535    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2536    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2537    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2538    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2539    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2540    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2541    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2542    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2543    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2544    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2545    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2546    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2547    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2548    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2549    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2550    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2551    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2552    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2553    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2554    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2555    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2556    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2557    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2558    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2559    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2560    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2561    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2562    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2563    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2564    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2565    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2566    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2567    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2568    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2569    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2570    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2571    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2572    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2573    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2574    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2575    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2576    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2577    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2578    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2579    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2580    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2581    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2582    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2583    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2584    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2585    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2586    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2587    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2588    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2589    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2590    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2591    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2592    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2593    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2594    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2595    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2596    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2597    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2598    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2599    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2600    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2601    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2602    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2603    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2604    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2605    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2606    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2607    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2608    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2609    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2610    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2611    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2612    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2613    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2614    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2615    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2616    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2617    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2618    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2619    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2620    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2621    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2622    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2623    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2624    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2625    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2626    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2627    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2628    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2629    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2630    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2631    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2632    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2633    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2634    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2635    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2636    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2637    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2638    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2639    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2640    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2641    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2642    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2643    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2644    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2645    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2646    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2647    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2648    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2649    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2650    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2651    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2652    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2653    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2654    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2655    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2656    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2657    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2658    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2659    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2660    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2661    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2662    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2663    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2664    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2665    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2666    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2667    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2668    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2669    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2670    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2671    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2672    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2673    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2674    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2675    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2676    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2677    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2678    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2679    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2680    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2681    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2682    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2683    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2684    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2685    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2686    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2687    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2688    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2689    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2690    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2691    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2692    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2693    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2694    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2695    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2696    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2697    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2698    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2699    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2700    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2701    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2702    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2703    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2704    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2705    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2706    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2707    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2708    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2709    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2710    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2711    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2712    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2713    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2714    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2715    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2716    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2717    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2718    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2719    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2720    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2721    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2722    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2723    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2724    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2725    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2726    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2727    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2728    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2729};
2730
2731
2732/* 317-0027 FD1089B */
2733/* 317-0028 FD1089A */
2734static const UINT8 key_0027_0028[0x2000] =
2735{
2736   /* opcodes */
2737   0xf9,0xac,0xe2,0x07,0x65,0x2c,0x87,0xa9,0xdd,0x99,0x8b,0xa9,0x44,0x16,0x4f,0xac,
2738   0x80,0xc8,0x3a,0x55,0x72,0xd2,0xae,0x49,0x01,0x58,0x0f,0x2c,0x0e,0x80,0xc2,0xa1,
2739    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2740    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2741    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2742    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2743    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2744    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2745    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2746    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2747    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2748    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2749    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2750    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2751    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2752    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2753    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2754    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2755    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2756    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2757    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2758    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2759    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2760    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2761    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2762    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2763    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2764    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2765    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2766    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2767    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2768    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2769    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2770    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2771    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2772    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2773    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2774    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2775    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2776    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2777    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2778    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2779    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2780    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2781    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2782    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2783    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2784    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2785    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2786    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2787    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2788    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2789    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2790    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2791    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2792    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2793    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2794    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2795    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2796    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2797    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2798    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2799    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2800    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2801    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2802    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2803    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2804    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2805    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2806    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2807    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2808    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2809    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2810    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2811    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2812    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2813    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2814    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2815    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2816    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2817    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2818    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2819    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2820    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2821    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2822    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2823    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2824    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2825    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2826    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2827    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2828    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2829    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2830    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2831    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2832    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2833    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2834    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2835    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2836    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2837    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2838    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2839    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2840    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2841    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2842    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2843    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2844    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2845    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2846    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2847    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2848    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2849    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2850    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2851    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2852    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2853    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2854    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2855    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2856    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2857    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2858    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2859    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2860    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2861    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2862    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2863    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2864    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2865    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2866    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2867    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2868    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2869    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2870    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2871    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2872    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2873    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2874    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2875    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2876    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2877    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2878    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2879    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2880    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2881    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2882    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2883    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2884    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2885    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2886    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2887    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2888    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2889    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2890    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2891    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2892    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2893    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2894    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2895    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2896    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2897    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2898    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2899    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2900    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2901    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2902    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2903    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2904    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2905    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2906    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2907    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2908    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2909    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2910    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2911    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2912    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2913    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2914    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2915    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2916    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2917    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2918    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2919    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2920    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2921    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2922    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2923    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2924    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2925    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2926    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2927    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2928    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2929    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2930    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2931    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2932    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2933    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2934    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2935    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2936    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2937    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2938    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2939    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2940    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2941    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2942    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2943    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2944    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2945    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2946    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2947    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2948    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2949    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2950    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2951    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2952    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2953    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2954    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2955    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2956    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2957    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2958    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2959    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2960    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2961    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2962    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2963    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2964    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2965    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2966    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2967    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2968    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2969    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2970    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2971    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2972    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2973    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2974    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2975    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2976    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2977    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2978    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2979    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2980    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2981    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2982    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2983    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2984    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2985    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2986    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2987    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2988    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2989    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2990    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2991    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2992    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2993
2994   /* data */
2995   0x82,0xe1,0xf4,0x85,0x20,0x9e,0xbe,0xac,0x97,0x3f,0x84,0xf8,0x6d,0x87,0x4b,0xad,
2996   0x25,0x3a,0x15,0x0f,0x43,0x1c,0xe7,0x62,0x4b,0xf1,0xc6,0xea,0xc1,0x7d,0xb4,0xeb,
2997   0x29,0x85,0xb7,0xaa,0x07,0xad,0xd3,0x1d,0x21,0xad,0xd8,0x11,0x33,0x8e,0xff,0xf9,
2998    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
2999    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3000    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3001    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3002    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3003    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3004    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3005    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3006    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3007    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3008    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3009    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3010    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3011    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3012    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3013    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3014    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3015    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3016    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3017    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3018    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3019    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3020    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3021    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3022    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3023    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3024    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3025    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3026    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3027    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3028    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3029    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3030    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3031    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3032    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3033    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3034    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3035    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3036    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3037    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3038    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3039    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3040    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3041    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3042    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3043    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3044    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3045    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3046    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3047    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3048    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3049    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3050    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3051    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3052    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3053    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3054    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3055    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3056    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3057    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3058    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3059    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3060    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3061    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3062    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3063    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3064    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3065    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3066    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3067    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3068    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3069    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3070    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3071    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3072    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3073    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3074    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3075    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3076    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3077    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3078    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3079    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3080    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3081    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3082    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3083    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3084    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3085    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3086    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3087    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3088    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3089    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3090    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3091    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3092    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3093    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3094    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3095    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3096    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3097    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3098    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3099    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3100    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3101    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3102    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3103    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3104    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3105    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3106    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3107    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3108    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3109    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3110    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3111    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3112    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3113    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3114    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3115    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3116    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3117    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3118    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3119    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3120    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3121    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3122    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3123    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3124    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3125    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3126    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3127    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3128    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3129    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3130    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3131    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3132    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3133    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3134    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3135    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3136    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3137    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3138    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3139    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3140    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3141    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3142    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3143    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3144    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3145    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3146    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3147    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3148    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3149    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3150    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3151    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3152    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3153    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3154    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3155    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3156    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3157    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3158    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3159    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3160    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3161    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3162    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3163    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3164    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3165    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3166    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3167    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3168    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3169    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3170    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3171    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3172    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3173    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3174    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3175    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3176    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3177    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3178    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3179    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3180    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3181    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3182    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3183    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3184    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3185    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3186    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3187    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3188    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3189    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3190    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3191    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3192    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3193    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3194    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3195    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3196    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3197    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3198    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3199    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3200    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3201    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3202    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3203    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3204    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3205    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3206    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3207    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3208    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3209    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3210    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3211    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3212    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3213    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3214    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3215    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3216    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3217    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3218    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3219    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3220    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3221    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3222    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3223    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3224    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3225    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3226    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3227    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3228    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3229    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3230    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3231    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3232    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3233    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3234    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3235    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3236    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3237    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3238    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3239    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3240    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3241    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3242    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3243    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3244    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3245    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3246    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3247    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3248    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3249    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3250    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
3251};
3252
3253
3254/* 317-0033 FD1089A */
3255/* 317-0037 FD1089B */
3256static const UINT8 key_0033_0037[0x2000] =
3257{
3258   /* opcodes */
3259   0x4b,0x04,0x8b,0x6a,0x97,0xa3,0xea,0xc4,0xb3,0x94,0xd0,0x88,0xcd,0xc6,0xe8,0x22,
3260   0x0f,0x23,0xdf,0xfe,0xa5,0x98,0x60,0x87,0xbd,0x10,0x19,0x2a,0x81,0x78,0xb4,0x52,
3261   0x1e,0xbc,0xdd,0x6c,0xbf,0xc8,0x42,0xe4,0x92,0x87,0x8d,0x26,0xc0,0xe6,0x6a,0x9d,
3262   0x78,0x10,0xd1,0xed,0x87,0xce,0xb6,0x0d,0xe4,0x26,0x33,0x6c,0x8e,0xb2,0xdd,0xfd,
3263   0x31,0x39,0xf9,0xe2,0x2c,0xb7,0x7d,0x6b,0x8b,0x54,0x0f,0x1b,0x0c,0x6b,0x03,0xa2,
3264   0x1d,0x84,0x60,0xe3,0xdb,0x58,0xdb,0xef,0x14,0xd3,0xd9,0x06,0x45,0x0d,0x70,0x9c,
3265   0x9c,0x4f,0x66,0x51,0xf6,0x13,0x2f,0xf7,0xe0,0x02,0xf2,0x8f,0x99,0xf7,0x84,0x4a,
3266   0x0d,0xfa,0x6a,0x8c,0xdb,0x46,0xda,0xe4,0x4f,0x43,0xba,0x14,0x68,0x8b,0x9f,0x0e,
3267   0xd2,0xe7,0xce,0xf3,0xeb,0x51,0x3c,0x15,0xc1,0xf4,0x91,0xf6,0x11,0x27,0x20,0x46,
3268   0x49,0x74,0xf0,0xe7,0x85,0x96,0xb5,0xeb,0x95,0x75,0xd6,0x94,0xf5,0x2c,0x68,0x52,
3269   0xd2,0x02,0x30,0xc8,0x0b,0x73,0xa5,0xc7,0x2c,0x28,0xea,0x4f,0x74,0xf9,0xd7,0x94,
3270   0xcf,0xf1,0xf0,0xf6,0xdb,0x49,0x6b,0x06,0xe6,0x6b,0x2d,0x87,0xed,0xf0,0xcd,0x6a,
3271   0x9e,0xa1,0x8e,0xd0,0x56,0x78,0x68,0x0b,0x23,0x9f,0xff,0x9c,0xc1,0x6f,0xa9,0x35,
3272   0xa0,0x71,0x6b,0xb7,0xdc,0x60,0xfc,0x34,0x42,0x24,0xbf,0xee,0x50,0xd7,0xcc,0x55,
3273   0x35,0xc2,0xe7,0x0b,0xcc,0x60,0x86,0xe2,0xa4,0x59,0xcf,0xdc,0xfa,0x87,0x96,0x29,
3274   0xbc,0xf4,0x62,0x2c,0x87,0xd9,0x67,0x75,0xa9,0x9f,0x8c,0xc7,0x1f,0xe1,0x67,0x13,
3275   0x96,0x67,0x3b,0x79,0x6d,0x2b,0xff,0x4d,0xb0,0x56,0x59,0x0f,0x1e,0x43,0x9e,0x70,
3276   0x23,0x7a,0xd3,0x53,0xde,0xb5,0xae,0xc9,0x1b,0xde,0x95,0x13,0x58,0x0e,0x9c,0xa3,
3277   0xc3,0x8e,0x8a,0x1a,0x39,0xd8,0xd4,0x4a,0x48,0x96,0x9f,0x35,0x2d,0xa1,0xc1,0x0b,
3278   0xd5,0x03,0xbf,0x2e,0xdf,0xf4,0xd0,0x30,0x98,0xdf,0xd8,0xd3,0xfc,0x5e,0x6c,0x07,
3279   0xbb,0x38,0xd4,0xee,0x30,0x69,0x03,0xdb,0x6a,0x19,0x9f,0x4d,0x27,0xa3,0xff,0xf8,
3280   0xd3,0x8f,0x27,0xbc,0x8c,0x97,0xcd,0xaa,0x20,0xa4,0x56,0x05,0x0c,0xd1,0xd8,0x3e,
3281   0x7d,0x66,0x19,0xf6,0x52,0xdd,0x8d,0xfe,0x18,0xe0,0x5b,0x59,0x0b,0x47,0x58,0x38,
3282   0x1b,0x1e,0x09,0xfc,0xe3,0x9c,0xa4,0x37,0xb2,0x2c,0x0f,0xaa,0x86,0x67,0xde,0x47,
3283   0x0b,0x16,0x58,0x30,0x9f,0x34,0x72,0xb5,0x50,0xe9,0xd2,0x58,0xdb,0x8f,0xcc,0xcb,
3284   0xae,0xaf,0x66,0xf0,0xe6,0x04,0x57,0xd7,0x50,0x76,0x03,0xc3,0x6b,0x20,0x80,0x24,
3285   0x64,0x49,0x93,0x9d,0x17,0x6d,0xb3,0xfe,0x13,0x35,0x03,0x4a,0x96,0x79,0x5b,0xb1,
3286   0x8c,0x44,0x3f,0x96,0x93,0xcf,0xe5,0x8a,0xf9,0x84,0x32,0x4e,0xbb,0xfc,0xbc,0xd4,
3287   0x87,0x00,0xc9,0x3d,0xba,0x8a,0x4e,0xdb,0x62,0xc4,0xf0,0x2f,0x3c,0x07,0x05,0xeb,
3288   0xb5,0xdc,0x92,0xf0,0xec,0xfe,0x4d,0x50,0xad,0x55,0x9c,0x4c,0x77,0xfb,0x94,0x56,
3289   0x76,0x39,0xfa,0x10,0x88,0x8a,0x44,0x4a,0x3b,0x96,0x97,0x07,0xcc,0x37,0xca,0x77,
3290   0x29,0x77,0x61,0xfc,0xef,0x8f,0x91,0x29,0x6c,0xe8,0x41,0xbe,0x9d,0x1d,0x06,0xac,
3291   0x30,0xf6,0x26,0x16,0x81,0x6d,0x95,0x4d,0xa0,0xab,0xfa,0xd1,0x48,0x0b,0xaa,0x56,
3292   0xe9,0x15,0xaa,0xbc,0x9e,0x83,0xb0,0x15,0x36,0x3f,0x21,0xa2,0x2e,0x62,0x14,0xd5,
3293   0xb4,0x35,0x4d,0x4f,0xa5,0x32,0x41,0xe2,0x8f,0x03,0x18,0x8f,0xaf,0x81,0xa5,0x88,
3294   0xf3,0xb6,0x6e,0x2f,0xf7,0xda,0xaa,0x14,0x0b,0x59,0x3d,0xf9,0x2b,0xca,0xbc,0xd1,
3295   0x04,0xf7,0x6f,0xbb,0xf4,0xdb,0x49,0x0a,0x0a,0x9e,0xf0,0x01,0x9b,0xbb,0x0d,0x48,
3296   0x5a,0xae,0x54,0xfc,0x95,0x7e,0x26,0xeb,0x35,0x93,0xc4,0x92,0x55,0x00,0x9f,0x1f,
3297   0x3d,0x8b,0x5a,0x6e,0x67,0xab,0xc6,0x0f,0x7d,0x84,0xe4,0x3e,0x57,0xec,0xe6,0xe8,
3298   0x01,0x68,0x2d,0xac,0xb2,0x2e,0x4b,0xd6,0xd5,0x24,0x01,0x64,0x03,0xde,0x41,0x04,
3299   0x05,0xa3,0x2c,0x13,0xd6,0x68,0x14,0x9f,0x9e,0xd2,0x7b,0x65,0xb7,0x38,0x11,0xd3,
3300   0xaa,0x9d,0xb8,0x06,0x32,0xb9,0x83,0xcc,0x37,0xf0,0xb1,0xa1,0xd4,0x58,0xb6,0xb5,
3301   0x51,0xb6,0x31,0xe4,0x27,0x80,0xf6,0xbb,0x02,0xdc,0x05,0x78,0xb9,0x9f,0x8f,0x09,
3302   0x57,0x4e,0xf7,0x0c,0x15,0x1f,0xce,0xcd,0x5d,0xf7,0xd5,0x4a,0xc8,0x6c,0xfd,0x31,
3303   0x1f,0xc4,0x69,0xdf,0x5c,0xf4,0x6a,0x61,0xa9,0xa1,0x81,0x76,0x5f,0x21,0x60,0x8b,
3304   0x07,0x79,0xe9,0xbc,0x5c,0x5f,0x2c,0xd9,0x46,0x39,0x6b,0x5d,0xdf,0x1c,0x18,0x77,
3305   0x70,0xcd,0xd4,0x05,0x74,0xc2,0x72,0x93,0x93,0x20,0xf1,0x5f,0xa7,0xbe,0x84,0x57,
3306   0xba,0x1f,0x8d,0x18,0x05,0x7b,0x9c,0xef,0xf1,0xb6,0x74,0xdb,0x19,0x66,0x06,0x89,
3307   0x45,0xd1,0x73,0x56,0x6f,0xeb,0x0c,0x4f,0xc0,0x5b,0x54,0x33,0x93,0x76,0xfc,0x6e,
3308   0x70,0x41,0xe5,0x1e,0x11,0x72,0x20,0x11,0x60,0x6e,0xf1,0xc5,0x76,0x4c,0xc6,0x66,
3309   0x9c,0xd0,0x44,0xd2,0x4c,0x6f,0x3a,0x96,0x30,0x50,0xaa,0xf1,0x21,0x49,0xc6,0xd0,
3310   0x29,0xdd,0xef,0xd0,0x81,0x44,0xb7,0x3e,0x92,0x61,0xe0,0x19,0xf6,0xcc,0x5a,0x0d,
3311   0x76,0xc9,0x48,0x79,0x0d,0x4f,0xfa,0x69,0xe4,0x01,0xf3,0x9b,0x53,0x37,0xe3,0x7d,
3312   0xe5,0xf4,0xad,0x2c,0x53,0xf0,0x61,0x76,0x86,0x8f,0x42,0xd8,0x99,0xe8,0xc1,0x80,
3313   0xd4,0xbe,0x7f,0x4b,0xb1,0x89,0x4d,0xc6,0xda,0x6d,0x2e,0x30,0x27,0x53,0x75,0xa4,
3314   0x87,0x1d,0x34,0x88,0x78,0x1e,0xb9,0x3e,0xf9,0x18,0x03,0x5f,0x9e,0xfb,0xbe,0xb4,
3315   0xae,0xe9,0x48,0x38,0x1e,0x34,0xaf,0x13,0x93,0x5d,0xb0,0x9f,0x63,0x16,0xb9,0x66,
3316   0x94,0x41,0xe6,0x20,0xdb,0xee,0x07,0xb9,0x9d,0x60,0x98,0x48,0xf0,0x07,0xc6,0x18,
3317   0x99,0x86,0x70,0xa2,0x0e,0xad,0x22,0x8f,0x75,0x7f,0x1b,0xb9,0xa2,0x2d,0x47,0x2a,
3318   0x1d,0x18,0x44,0x1c,0x18,0xd1,0x60,0xf6,0x7c,0x1b,0x98,0x54,0xdc,0xe7,0x9a,0xfe,
3319   0x7f,0x56,0xc3,0xee,0x59,0xba,0x21,0x4e,0x11,0x94,0x70,0x77,0xfc,0x96,0x20,0xf2,
3320   0x20,0xa1,0x4d,0x7a,0x31,0xc7,0xc4,0xf7,0x96,0x49,0x03,0x83,0x64,0x9a,0x39,0x67,
3321   0x60,0x59,0x41,0x1e,0x00,0x59,0xaa,0x50,0x69,0x9c,0xb1,0xd7,0x71,0x52,0x44,0xbd,
3322   0x9e,0xde,0x00,0x3b,0x25,0xd0,0x33,0xba,0xeb,0xeb,0xda,0xd5,0x86,0x1f,0xa2,0x54,
3323   0x3c,0x8f,0xea,0x31,0x01,0x8c,0xbe,0x95,0x7c,0x97,0xdd,0xdb,0x01,0x61,0xb3,0x8b,
3324   0x98,0xcd,0x5f,0x5f,0xf4,0xec,0xad,0x41,0x7b,0xff,0x1b,0x4a,0x44,0x78,0xd7,0xc3,
3325   0x12,0xf8,0xbe,0x27,0x5d,0x51,0x5e,0x1e,0x49,0x84,0xf4,0x81,0xac,0xc3,0x6d,0x5c,
3326   0x0c,0x70,0x68,0xe7,0x9d,0x1b,0x32,0x8b,0x46,0x86,0xc7,0xe2,0x9c,0xa4,0xd7,0xb6,
3327   0xe4,0x94,0xbd,0xff,0x14,0xaa,0x88,0xe9,0xd2,0x65,0xf6,0xcb,0x72,0x79,0x73,0x30,
3328   0xfb,0xc5,0x1d,0xd1,0x22,0x5d,0xc2,0x97,0x4c,0x81,0xdf,0x9d,0x8f,0xa2,0xa1,0x2b,
3329   0xb1,0x63,0xe7,0xbb,0x27,0x95,0x3e,0xf7,0x16,0x39,0xe2,0xb8,0x53,0x81,0xc3,0x07,
3330   0x66,0xce,0x7c,0x1e,0x82,0xb2,0x5c,0x67,0x8d,0xee,0x61,0x7b,0x1e,0x74,0x37,0x23,
3331   0x79,0x65,0x3c,0x5a,0x94,0x13,0x7e,0x48,0x14,0x00,0xba,0x47,0x4f,0xdc,0x5e,0xe1,
3332   0x4b,0x8a,0x87,0xce,0xbd,0x1a,0x02,0xfa,0x0a,0xce,0x4e,0x7c,0x47,0x19,0x98,0x9f,
3333   0x3c,0x9a,0xbc,0xdc,0x5c,0x25,0x49,0xdc,0xce,0xba,0x7d,0x7a,0x66,0x8a,0x44,0xbe,
3334   0xab,0xf8,0x3c,0xe2,0xd2,0x95,0xb3,0x4f,0xc1,0x22,0xa6,0xa0,0x0c,0x90,0xc3,0x9d,
3335   0xfa,0x03,0x67,0x7f,0xc9,0xa0,0xb3,0x42,0x67,0x2b,0x4f,0x98,0x8b,0x75,0x9d,0x87,
3336   0x1a,0x9d,0x58,0xc3,0x23,0x6f,0x68,0xb3,0xe8,0x6a,0xe7,0x6b,0xdb,0xba,0x1f,0xb3,
3337   0x9e,0x3d,0x88,0xfe,0x01,0x81,0xcd,0x72,0x06,0xc4,0xc8,0xe5,0xe0,0xf1,0x80,0xdd,
3338   0xee,0xa8,0x31,0x8f,0xc4,0x36,0x44,0xe0,0x21,0x98,0x51,0x66,0xf9,0x7c,0x23,0x66,
3339   0x6c,0x3e,0xb3,0xd7,0xcb,0xee,0x2a,0x5d,0x99,0x47,0xe3,0x4d,0x87,0xb9,0x66,0xae,
3340   0x76,0x5f,0x6d,0x35,0x78,0x08,0xe2,0x48,0xce,0x31,0xde,0xfb,0xea,0x08,0xaa,0x15,
3341   0x6d,0x6a,0xc1,0x0b,0x29,0xe5,0xcb,0x02,0x1f,0xb6,0xa2,0xd0,0x81,0xcb,0x4f,0xfb,
3342   0xb0,0xc1,0x0d,0xb7,0x3f,0xe5,0x44,0xeb,0xed,0x36,0x8e,0x2c,0xad,0x60,0xb5,0xbf,
3343   0xa1,0xc1,0xb1,0x9a,0x19,0x68,0xae,0x63,0x98,0x10,0x03,0x6e,0xce,0x28,0x3b,0xc2,
3344   0x9e,0xcd,0x0f,0x14,0x19,0xcd,0x68,0xc9,0x7f,0xa5,0x61,0xf7,0x44,0x83,0x42,0x64,
3345   0x08,0x43,0x85,0x84,0x9d,0x75,0xd4,0x7e,0x04,0x55,0x08,0x27,0x6e,0xd0,0x2a,0x04,
3346   0x3f,0x85,0x74,0x4c,0x05,0xc0,0x50,0xe2,0x85,0x7f,0x57,0x5e,0xae,0x70,0x52,0x04,
3347   0xa2,0xf1,0x3c,0xca,0xb3,0x0d,0x3d,0x55,0x62,0x84,0xaf,0xfb,0x62,0xc3,0x1c,0xc2,
3348   0x92,0xe7,0x3c,0x5e,0x05,0xbe,0xfb,0x36,0xfd,0xc5,0x70,0x5f,0xea,0x29,0xe6,0x9f,
3349   0x6f,0xc9,0xd6,0x6a,0x5d,0x31,0xe9,0xe7,0xb4,0x9f,0xfa,0xea,0xa8,0x01,0x11,0xfa,
3350   0x99,0xf5,0x68,0x4c,0x18,0xc7,0x68,0xc5,0xe8,0x75,0xac,0xfc,0xfa,0xad,0xfc,0x34,
3351   0x6f,0xcc,0x52,0x65,0x99,0xdf,0xd8,0x33,0xf9,0xa5,0xe7,0xf4,0x41,0x8b,0x09,0xae,
3352   0x52,0xad,0xf6,0x15,0x3e,0xdb,0x99,0x90,0x47,0x90,0x0b,0x33,0xdd,0xfb,0x96,0xc5,
3353   0xa2,0xfa,0xb2,0xbb,0x68,0x19,0x0a,0x3b,0x31,0x96,0x78,0x19,0x2d,0x5f,0x03,0xdc,
3354   0xbf,0x11,0xe7,0xb9,0x77,0xfa,0x8d,0x95,0x18,0x16,0x8d,0x06,0x92,0x15,0xb2,0x51,
3355   0x08,0x53,0xf5,0x6d,0xcb,0xdd,0x80,0xfd,0x5c,0x72,0xab,0x59,0x6c,0x7e,0x01,0x85,
3356   0xde,0x1f,0x3c,0x37,0xc3,0x23,0x43,0xd5,0x5c,0x08,0x32,0x73,0x1b,0xfa,0x51,0xd8,
3357   0xa1,0xd7,0x1b,0x79,0xc0,0x2d,0x38,0x7b,0x7a,0x38,0x82,0xb4,0xff,0xe8,0x02,0xaa,
3358   0xb1,0xd9,0xf3,0x91,0x22,0x58,0xbd,0x50,0x14,0x64,0xfa,0x7c,0x77,0xa9,0x74,0x5a,
3359   0x6d,0x86,0x24,0xe0,0x49,0x07,0x33,0xb4,0x8a,0xea,0xfb,0x2a,0xe4,0x9d,0x06,0x49,
3360   0x37,0x3d,0x0d,0xc6,0x94,0x98,0xfa,0x06,0x3e,0x2b,0xe5,0x1f,0xa6,0x24,0x19,0xd7,
3361   0x6d,0x60,0x0f,0xa2,0x64,0x6c,0x71,0xa7,0x8e,0x87,0x18,0xbb,0x1c,0x9d,0x0d,0x63,
3362   0x6f,0x4d,0x8a,0xd6,0x19,0xe3,0xf9,0xf7,0xdb,0x5e,0xf3,0x5e,0xa7,0x6a,0x42,0x4f,
3363   0x9f,0x65,0xde,0xc0,0x13,0x5d,0xf2,0x56,0x85,0x0f,0xd7,0x67,0xa7,0xe9,0x17,0xf9,
3364   0x5b,0x08,0x6b,0xc0,0xb1,0x39,0xbc,0x23,0xec,0xfb,0x24,0x37,0x7c,0x7a,0xed,0xc1,
3365   0x04,0x95,0x90,0x38,0x54,0xd8,0xb6,0xbf,0x6f,0x82,0x3a,0x2e,0x85,0x7f,0x24,0x09,
3366   0xf9,0x6d,0xae,0x86,0x5c,0x9a,0x41,0x8a,0x6f,0x03,0x78,0xac,0x24,0x56,0x1b,0x2f,
3367   0x9c,0xf0,0x25,0x0b,0x29,0xdf,0xbd,0xe4,0x4c,0xdf,0x3f,0x10,0xb7,0x60,0x34,0x94,
3368   0x4b,0x7e,0x54,0x27,0x1a,0x06,0x8a,0x2c,0x65,0x76,0xef,0xbb,0x9e,0xfd,0xcd,0x98,
3369   0x67,0x76,0x9c,0x39,0x90,0x70,0x08,0xc4,0x1c,0x28,0xe8,0x0d,0x3b,0x8c,0x47,0x9b,
3370   0x4f,0x39,0x5d,0xa2,0xeb,0x7d,0x96,0x0a,0xcf,0x55,0x89,0x66,0xec,0x6e,0x01,0xfc,
3371   0x65,0x27,0xf7,0xc2,0x8a,0x8c,0x95,0x5e,0xde,0x5c,0x33,0x25,0x12,0x03,0x5c,0x1c,
3372   0x07,0xa0,0xca,0xf9,0xcf,0xff,0x64,0x22,0xab,0x9e,0x46,0xab,0x0d,0xab,0xb8,0x5b,
3373   0x96,0x03,0x35,0xa7,0x18,0x34,0x65,0xb4,0x94,0x7b,0x22,0x58,0x3c,0xc5,0x75,0x18,
3374   0x72,0xb1,0x99,0x2b,0xc6,0x8c,0xf6,0x75,0xfa,0x52,0x26,0x8c,0x00,0xb3,0xf3,0xb5,
3375   0xfa,0x0a,0x56,0xe6,0x38,0x66,0x78,0xc4,0x3d,0x85,0xb3,0xa6,0xb9,0xd3,0x91,0x90,
3376   0x8f,0x6e,0xcb,0x38,0xd0,0x24,0x4b,0x03,0xbd,0x72,0x29,0x07,0xc7,0x85,0xb0,0x0a,
3377   0x91,0x3c,0x59,0x80,0xec,0x24,0xce,0x90,0xd9,0x79,0xe8,0x0f,0x8a,0x2b,0xb0,0x82,
3378   0x60,0xd5,0x60,0x1f,0xed,0xc7,0x62,0xcc,0xf2,0xfc,0x4f,0x1e,0x61,0x23,0xf1,0x59,
3379   0x5b,0x99,0x75,0x32,0x6c,0x67,0x17,0x68,0x59,0xbf,0x93,0xad,0xce,0xd2,0xf0,0xe3,
3380   0xe8,0x59,0xe2,0x1d,0x74,0x3d,0xd0,0x9a,0xf1,0x98,0xcf,0xce,0x8c,0xb4,0xa4,0x58,
3381   0x21,0x0a,0xc6,0x0c,0x43,0x58,0xe9,0x24,0x3a,0x32,0x23,0xbc,0xf7,0xd8,0x1a,0xa5,
3382   0xb4,0x80,0x60,0x2d,0xdb,0x0f,0xb6,0x51,0x04,0x1b,0x0d,0xbf,0xfa,0xea,0x88,0xd4,
3383   0xb7,0x71,0x78,0x9e,0x62,0x55,0x5e,0xda,0x57,0xec,0xec,0xf5,0x1f,0x3b,0x03,0x0e,
3384   0x72,0xf9,0xb6,0xf1,0x3b,0x89,0x44,0x1d,0x93,0x03,0x20,0xbe,0xc4,0x2b,0xeb,0xb2,
3385   0x46,0x77,0x78,0x87,0xc5,0x0c,0xc6,0x7b,0x18,0xc1,0x08,0x79,0x4a,0x1a,0xa0,0x21,
3386   0x93,0x4c,0x1e,0xc0,0x5f,0x3e,0x45,0x53,0x45,0x85,0x06,0x88,0x10,0x67,0x81,0xbb,
3387   0xb9,0xd8,0x0a,0xfc,0x6a,0x7f,0x21,0x06,0x7b,0xb1,0x78,0x49,0x78,0x73,0xf0,0xe0,
3388   0x18,0x7b,0x9a,0x9a,0x45,0x2e,0xb9,0xf4,0x1a,0xa3,0xbe,0x1c,0xe0,0x9e,0x4b,0xef,
3389   0x0f,0x95,0x30,0xfb,0x52,0xad,0x6f,0x7d,0x82,0xbc,0x3a,0x63,0xa8,0x47,0xf2,0x4a,
3390   0xff,0x85,0x29,0x7f,0xef,0x5a,0xa1,0x01,0x12,0x5b,0x4a,0x7c,0x32,0xd0,0x47,0x4e,
3391   0x48,0xac,0xe8,0x86,0x7d,0x95,0xb0,0xdf,0x2b,0xe2,0x4f,0xc8,0xdc,0x97,0xa8,0x5e,
3392   0x49,0x69,0xcb,0x6f,0x5c,0xc0,0xfb,0x78,0x2d,0xaf,0xa9,0xa7,0x07,0xfc,0x76,0xd8,
3393   0x63,0x1e,0x33,0x9b,0xeb,0x39,0xe3,0x2c,0x78,0x23,0xb7,0x78,0x13,0x61,0x10,0x1e,
3394   0xf6,0x29,0x80,0x6a,0x8b,0x61,0xc8,0x5a,0x6b,0x9d,0xda,0x9c,0x60,0x24,0xd8,0x8e,
3395   0x62,0xeb,0x12,0x3b,0x9c,0x97,0x0a,0x64,0x67,0x7f,0x72,0x73,0x4d,0xa6,0x2c,0x88,
3396   0x07,0xc4,0x48,0x70,0x7e,0x3d,0x09,0xa8,0xcc,0x27,0xdf,0x5d,0x3b,0x47,0x6d,0x6e,
3397   0x44,0x13,0x83,0x67,0x90,0xb1,0x24,0x86,0xfa,0xf6,0x81,0xb9,0x8a,0x67,0xfb,0x9e,
3398   0x7a,0x3a,0x23,0x81,0x34,0x54,0xbc,0x60,0x50,0x4b,0xb7,0xe9,0x9a,0x65,0x35,0x79,
3399   0x09,0x97,0x88,0x1d,0xc8,0x86,0x31,0x94,0x2f,0x88,0xe2,0x4b,0xca,0xa2,0x7c,0x5e,
3400   0x50,0x8a,0x11,0x9d,0xac,0xa6,0xe2,0x83,0xf7,0x0b,0x62,0x3f,0x7b,0x7e,0x30,0xaf,
3401   0xb1,0x75,0x1f,0x5f,0x42,0x15,0x31,0x8d,0x08,0x35,0x96,0x27,0x0d,0x58,0xb1,0xca,
3402   0x8a,0xb6,0x12,0xc4,0xe8,0x33,0x7c,0x11,0xc1,0x65,0xdf,0x61,0xdf,0x92,0x5e,0x10,
3403   0x3b,0xae,0x4a,0x2b,0xff,0x60,0x24,0x71,0x83,0xfd,0x9d,0x4e,0x53,0x8a,0x98,0xe0,
3404   0x26,0xbd,0x26,0xf5,0xe7,0xfb,0x88,0x0b,0xae,0x5b,0x30,0x4e,0xc7,0xa1,0xbf,0x9c,
3405   0xa9,0x42,0x07,0x83,0xff,0x66,0x09,0x3f,0xa2,0xe0,0xf7,0xc0,0x9b,0x36,0x33,0xa2,
3406   0x25,0x9f,0x4d,0x32,0xa8,0xfe,0x07,0x6f,0xbe,0xeb,0x54,0x05,0x31,0xaa,0x53,0x53,
3407   0xfa,0x32,0x58,0x65,0x42,0x26,0xe2,0xf9,0x63,0xde,0xa5,0x7d,0xe7,0x5d,0x80,0x0e,
3408   0x87,0x5b,0x87,0x7a,0x2d,0x3d,0xfa,0x3e,0xf1,0x17,0x4a,0x88,0x1e,0xaf,0x1a,0x35,
3409   0x2e,0x7c,0x3b,0xd2,0xc8,0xa2,0xae,0x9e,0xc8,0xf7,0xa5,0x85,0x36,0x00,0x81,0x26,
3410   0x4d,0xf3,0xd4,0xcd,0x74,0xb6,0x5f,0x79,0x47,0xdd,0x14,0xd6,0x8f,0xaf,0x14,0x42,
3411   0x44,0x21,0xb1,0xcb,0x91,0xd8,0x6d,0x2e,0xd0,0x2b,0xf8,0xd9,0x88,0x1d,0x35,0xe9,
3412   0x75,0x66,0x34,0x2b,0x7f,0x6a,0x37,0x1e,0xc0,0x3f,0xb1,0xee,0x82,0xaa,0x41,0x7a,
3413   0x3e,0x21,0xbb,0x4e,0x9e,0xca,0x1f,0xa9,0x7a,0x7a,0x9e,0x77,0xdd,0xb6,0x9b,0x56,
3414   0x00,0xb4,0xa7,0x94,0x4d,0x59,0x83,0x2e,0x5c,0x3b,0x20,0xd2,0xf9,0xa0,0xa2,0xdd,
3415   0x1b,0x7c,0x57,0x5d,0xed,0x77,0xc3,0x0e,0xc8,0xe4,0x97,0x60,0x35,0xc9,0xb5,0x6f,
3416   0xee,0xdc,0x2d,0x08,0xdd,0x83,0x41,0xa9,0x1b,0xd3,0x63,0x81,0xf2,0x91,0x35,0x6b,
3417   0xdb,0x33,0x87,0xf6,0x7f,0xde,0x5b,0x5f,0xb8,0x69,0xe4,0x94,0x90,0x57,0x81,0x32,
3418   0xe0,0xc6,0x87,0x31,0xe8,0x72,0x90,0xfd,0x05,0x79,0xfa,0x6e,0x7d,0xfb,0x24,0x7d,
3419   0x44,0x49,0x1a,0x54,0x01,0xe6,0x9b,0x4c,0x08,0x83,0x13,0xee,0x61,0x01,0xa1,0xf4,
3420   0xbf,0x72,0x11,0x48,0x88,0x17,0xe1,0x02,0xd3,0x62,0x3f,0x6e,0x63,0xf4,0x08,0x03,
3421   0xb0,0x9f,0xca,0x6c,0xde,0x64,0xc2,0x82,0xc3,0x75,0xdd,0x4f,0xe5,0x33,0xba,0x0b,
3422   0x78,0x31,0xa6,0x21,0x63,0x2e,0x9d,0x2a,0x3b,0x1d,0x4f,0xf0,0x45,0x20,0x17,0x6c,
3423   0x77,0x87,0x04,0xc7,0x77,0xd5,0xd4,0x5c,0x99,0xba,0xf3,0xb2,0xe4,0x19,0x7f,0x85,
3424   0x0d,0x03,0x46,0xbe,0x79,0xb8,0xc5,0x75,0x3f,0xac,0x29,0xf6,0x22,0x7f,0x51,0xb8,
3425   0x9a,0x03,0xca,0x65,0xcb,0x39,0xd0,0xd8,0x8a,0x52,0x53,0x19,0x5f,0xb2,0xee,0x63,
3426   0x7d,0xe7,0xf1,0x1e,0xcb,0xb6,0x57,0xe3,0xdd,0x0e,0xcf,0x7e,0xfa,0x11,0xb6,0xe6,
3427   0x17,0x11,0x1a,0x46,0xd9,0x8f,0xb8,0xf8,0x96,0x3e,0xfe,0x83,0x54,0xfd,0x09,0xa3,
3428   0xc8,0xdf,0xa6,0x57,0x26,0x54,0x74,0x17,0x42,0x89,0xcd,0xd6,0x46,0xf8,0xef,0xb3,
3429   0xf6,0x6b,0xa3,0xd9,0x8b,0xba,0xbd,0x7c,0xf4,0xf0,0xc4,0xfc,0xce,0x46,0xed,0xea,
3430   0x67,0x26,0x1e,0x09,0xbd,0x28,0xeb,0x4a,0x7b,0x18,0x9b,0xce,0x01,0xed,0x22,0xe7,
3431   0x5c,0xd2,0x27,0x16,0x49,0x20,0xff,0x0d,0x35,0x60,0xb0,0xad,0x3f,0x4c,0xee,0x08,
3432   0x33,0xce,0x20,0x60,0x90,0xff,0x5a,0x25,0x82,0x29,0x64,0xf9,0xe7,0xc5,0xb1,0xae,
3433   0x4d,0x7c,0x67,0x46,0xf2,0x28,0x5c,0xf1,0xc1,0xd3,0x16,0x12,0x5b,0xb6,0xca,0x39,
3434   0x0a,0x3a,0x5d,0x29,0xce,0xfa,0x65,0xd2,0x54,0xbd,0x27,0x57,0xf8,0x7f,0x9a,0x09,
3435   0xca,0x69,0x62,0x69,0x85,0xd4,0xd4,0x28,0x99,0x49,0xf7,0x29,0x21,0x82,0x81,0x7d,
3436   0xec,0x69,0xd5,0x65,0x77,0x17,0x0a,0x53,0xf0,0xd5,0xe6,0xe8,0x34,0x1d,0xde,0xf6,
3437   0xd1,0x99,0x17,0x7f,0x04,0x22,0x67,0xb3,0xbb,0xc2,0x54,0xf4,0x93,0xb1,0x12,0xd4,
3438   0xd9,0x5a,0x88,0x15,0x8c,0x57,0x4b,0xa7,0x58,0x6f,0xa0,0xac,0x9b,0x9e,0x7d,0x77,
3439   0x64,0x0c,0x88,0x87,0x6e,0x14,0x15,0x90,0x28,0x3e,0x2b,0x72,0xaf,0x44,0x7f,0x3e,
3440   0xd1,0x0f,0x76,0x37,0x0b,0xba,0x26,0xce,0x8b,0x8d,0x55,0xa3,0x2e,0x02,0x77,0x8a,
3441   0x81,0xc2,0xb3,0x83,0xc3,0xa8,0xde,0xc0,0xe0,0xbc,0x7e,0xa2,0x77,0x39,0xc7,0xbb,
3442   0xd4,0x87,0x9f,0xcc,0xf5,0x9d,0xc7,0x88,0x2d,0x05,0xce,0xeb,0x49,0xcd,0x31,0x29,
3443   0xbc,0x9a,0x72,0x03,0xe0,0xc2,0x43,0xe3,0x3e,0x4b,0x86,0xe9,0x91,0xe9,0x4b,0xe2,
3444   0xc1,0x03,0xd5,0x4b,0xe9,0xae,0x94,0x51,0x50,0xb0,0x2b,0xd3,0x72,0x7d,0x6a,0x5d,
3445   0xf8,0x3c,0x54,0x2d,0xba,0xc1,0x19,0x31,0xc3,0x93,0x1c,0x07,0x4c,0xe7,0xee,0xfb,
3446   0xbf,0xa3,0x50,0x0b,0xb5,0x5b,0x34,0xe5,0xf7,0x56,0xbb,0xe6,0x7f,0x88,0x37,0x1b,
3447   0x77,0x98,0x29,0x43,0x38,0xdb,0x43,0xcb,0x4b,0x57,0x66,0xcf,0x6b,0xc0,0xa4,0x1f,
3448   0x80,0x7d,0x3e,0x36,0xa4,0xa2,0xa6,0x43,0x20,0xf6,0x7e,0x24,0x6f,0xee,0x96,0x65,
3449   0x39,0xb0,0xf1,0x44,0x58,0x10,0xbf,0xaf,0xd6,0x95,0x62,0x43,0xec,0x74,0x6d,0x4e,
3450   0x03,0x92,0xa0,0xcc,0xb6,0x85,0xec,0x6d,0xcd,0x92,0x74,0x8d,0x42,0xb0,0x88,0x39,
3451   0x3e,0x82,0xab,0x30,0x1c,0x60,0x8e,0xde,0x64,0x4e,0x12,0x61,0xd0,0x02,0x49,0x87,
3452   0x4a,0xe2,0x74,0xce,0xeb,0x02,0x05,0x62,0xfc,0x29,0x9d,0x21,0xf7,0xcc,0x0e,0x99,
3453   0x86,0x10,0x59,0x07,0x82,0xcb,0xb0,0x58,0xf5,0x83,0x75,0x2b,0x17,0x6c,0x38,0xcc,
3454   0x53,0x6d,0xbb,0x3a,0x43,0x1b,0xf0,0x21,0xae,0xbb,0xf9,0xe0,0x90,0x43,0x26,0x83,
3455   0x11,0x59,0xfa,0xc8,0x8c,0x51,0x25,0x1d,0x89,0x32,0x8a,0x9f,0xc2,0xb1,0x3a,0x1c,
3456   0x20,0x33,0x76,0x11,0xbe,0xce,0xaf,0xac,0xe4,0x48,0x88,0xca,0x0c,0x15,0xd2,0xf8,
3457   0xe0,0x5c,0x8e,0x75,0x38,0xf2,0xee,0x2d,0x20,0x5c,0x53,0xbf,0xcf,0xd1,0x4f,0x77,
3458   0xb0,0x34,0xa3,0x54,0x5c,0x1d,0x41,0x02,0x9c,0xd0,0x4a,0xdf,0x6b,0x43,0x10,0xf9,
3459   0xf1,0x1b,0x15,0x0d,0x88,0xae,0x09,0x89,0xb9,0x02,0xce,0x8a,0x3f,0xcb,0x77,0xdd,
3460   0x02,0x70,0x43,0x01,0x1d,0x06,0xa6,0x22,0xd8,0x53,0x3f,0x1f,0xac,0xcb,0xe2,0x84,
3461   0x45,0x94,0x8e,0x90,0x7a,0x85,0x77,0x2f,0x56,0x22,0xfd,0xff,0x12,0xa1,0xb2,0x4e,
3462   0x18,0xe7,0x56,0x19,0x01,0x8b,0xdd,0x0e,0x96,0xd0,0x67,0x8a,0xd1,0xae,0x46,0x9b,
3463   0xdc,0xc9,0xfb,0xfd,0x10,0x77,0x38,0x20,0xf6,0xbd,0xde,0x20,0x49,0x52,0xff,0xca,
3464   0xf1,0x9a,0xdd,0x9d,0x08,0xaa,0xe8,0xc5,0xd7,0x49,0xc2,0x20,0xd9,0xec,0x3e,0x3c,
3465   0xb6,0xb9,0x5b,0x56,0x48,0x84,0x4c,0x5c,0x99,0xd4,0x73,0xeb,0xe2,0xdd,0x60,0x51,
3466   0x8c,0x87,0xd6,0x8b,0x32,0x65,0xc6,0x46,0x9c,0xbd,0x50,0xe1,0xc4,0x85,0xc8,0x68,
3467   0xd3,0x63,0xae,0x9a,0x24,0xac,0xb4,0xe3,0x3f,0x65,0xbb,0x62,0xde,0x44,0xd4,0xe3,
3468   0xeb,0xaf,0x42,0xe4,0x7f,0xba,0x76,0x93,0xe3,0x2c,0x12,0xcd,0x91,0x7a,0xe5,0x20,
3469   0x33,0xc9,0xf4,0xc9,0xa2,0xef,0x6e,0xb5,0xe8,0x72,0xb5,0x83,0x3d,0x86,0x5b,0x80,
3470   0x0d,0x12,0x22,0xa8,0xef,0xab,0xfa,0xab,0xad,0x96,0x06,0xe4,0x42,0xc9,0x96,0x62,
3471   0xd7,0xea,0x2d,0xe3,0xc4,0x4d,0x7b,0xd3,0x94,0xf9,0x63,0x50,0x00,0xa3,0xf5,0x28,
3472   0xf1,0xb0,0x74,0xd8,0x82,0x36,0x51,0x8d,0xfb,0xfb,0x2d,0x26,0xd6,0x73,0xd9,0x30,
3473   0xbd,0xc5,0x58,0xe7,0x88,0xc6,0xdb,0x3b,0x43,0xfb,0xc3,0xc7,0x25,0x9a,0xa2,0xdb,
3474   0x99,0x89,0x39,0x72,0x38,0x5d,0x7a,0x3b,0xcb,0x5b,0x87,0x93,0x4d,0x78,0xb0,0x88,
3475   0xe6,0x5c,0x77,0xd7,0xf0,0x5a,0x8e,0xee,0xf5,0x79,0xd7,0xea,0xad,0x6d,0x62,0x98,
3476   0x03,0x9d,0x72,0x77,0x11,0x1e,0x77,0xb4,0x1f,0xb5,0x14,0x2b,0xa6,0xd9,0x19,0x6c,
3477   0x52,0xad,0x89,0xb2,0xfa,0x09,0x95,0xec,0xa9,0x71,0x9d,0xb7,0x98,0x1b,0x35,0x61,
3478   0x31,0xec,0x1d,0xe8,0x0d,0x7b,0x47,0xf7,0xf5,0x0b,0xd4,0xee,0xe3,0x94,0x16,0xda,
3479   0x01,0xba,0x8e,0x78,0xa8,0xd3,0xee,0x35,0x61,0xe4,0x17,0x30,0xe7,0xa4,0x1b,0x35,
3480   0x22,0x76,0x3b,0xc3,0x2c,0x72,0xea,0x06,0x4e,0x5c,0xc7,0xdc,0x03,0xaa,0xa5,0xd3,
3481   0xf3,0x82,0x86,0x29,0xf8,0xb8,0x9a,0xc9,0x1c,0xd3,0x44,0x54,0x98,0x07,0x14,0x14,
3482   0xd5,0x3b,0xcd,0x09,0x6e,0x04,0x5f,0xe0,0x2b,0xa8,0xed,0xf5,0x06,0x1b,0xc8,0x58,
3483   0x28,0x04,0x71,0xc4,0xec,0xb8,0x99,0xa9,0xda,0x3c,0x23,0x22,0xac,0x46,0x20,0xfe,
3484   0x4c,0x3c,0xd1,0xba,0xd3,0x32,0xa8,0x84,0x8a,0xef,0x46,0x39,0xec,0xe8,0x7d,0x67,
3485   0xa0,0x42,0x4e,0x4b,0x82,0xd3,0xeb,0xd3,0x9b,0x20,0xb6,0x9c,0x24,0x60,0x3f,0xf3,
3486   0x86,0x77,0x48,0xd7,0x5b,0xfa,0xc4,0xf4,0x6d,0x31,0xd2,0xa9,0xb4,0x0f,0xc6,0x02,
3487   0x5c,0x3a,0x1f,0xbd,0xbc,0x09,0x91,0x48,0x5f,0x80,0xfb,0xc0,0xfe,0x55,0x71,0xf3,
3488   0x82,0xed,0x33,0x5e,0x06,0x5e,0xb2,0x2f,0xd2,0x6e,0x91,0x43,0x60,0x91,0xa1,0x27,
3489   0x5a,0xee,0xe3,0x1a,0x98,0x5a,0x89,0x08,0x26,0x5a,0xf4,0x90,0x3b,0x24,0xb6,0xfe,
3490   0x42,0x9e,0x90,0x50,0xd4,0x5c,0x74,0x34,0xba,0xa5,0x83,0x08,0xef,0x6e,0x0f,0xd8,
3491   0x9b,0x5d,0x9a,0x62,0x18,0xc6,0xd4,0x13,0xf0,0xaf,0x9f,0x0a,0xdb,0xcf,0x0e,0x14,
3492   0xc5,0x8a,0x60,0xae,0xc5,0xf6,0x09,0x05,0x26,0xd8,0xa8,0xf8,0x61,0xa6,0x11,0x13,
3493   0x1f,0x86,0x44,0x94,0x3a,0x4d,0x72,0x6a,0xbd,0x80,0xfe,0x30,0xdf,0x55,0x79,0x35,
3494   0x0a,0xb1,0xa4,0x76,0xd9,0x2a,0x70,0xa1,0x14,0x06,0x00,0x13,0xb5,0x3a,0xa5,0xd9,
3495   0xe6,0x6b,0xe0,0xb2,0x00,0xef,0x63,0x0b,0x8c,0xcb,0x10,0x00,0x45,0xb5,0xf7,0x61,
3496   0x13,0x13,0x5a,0xa9,0x10,0xfa,0xab,0x07,0x85,0x2f,0x8c,0x59,0xed,0x28,0xcd,0x2b,
3497   0xf0,0x0a,0x70,0xbb,0x69,0xac,0xa8,0xf7,0x5f,0x91,0xd4,0x7c,0x0e,0xf1,0x88,0x98,
3498   0xde,0xb0,0x83,0x47,0x6a,0x64,0xb9,0x39,0x7a,0x53,0x4a,0xca,0x08,0x71,0x87,0x07,
3499   0x3d,0x65,0xf3,0xaf,0x74,0x84,0x3f,0x2e,0x35,0xd3,0x4c,0xa2,0x3a,0x08,0x2c,0xda,
3500   0x6d,0x88,0x20,0x51,0xe7,0x6a,0x9a,0x36,0xf1,0x72,0x3b,0x66,0x06,0x15,0xd5,0x6f,
3501   0xce,0x7b,0x69,0x8e,0x23,0x77,0x29,0xb0,0x0e,0x8f,0x76,0x74,0xca,0xfa,0xe3,0x26,
3502   0xbf,0x9c,0x2f,0xc5,0x87,0x0a,0x4d,0xfd,0xec,0x8c,0x5f,0x2d,0xe6,0x15,0xb5,0x61,
3503   0xa1,0x4b,0xd2,0x57,0x74,0x85,0x66,0x7d,0xea,0xc7,0x54,0xf1,0xbc,0xc6,0xac,0x7e,
3504   0xd3,0xea,0xb1,0xa4,0x4a,0x46,0xd4,0x90,0x69,0xa0,0xb6,0x1f,0xaa,0x6f,0x29,0xde,
3505   0xb7,0xd7,0x2e,0x0c,0x69,0xae,0xf6,0x96,0xc9,0x79,0xe5,0x18,0x11,0x6e,0x89,0xe1,
3506   0xab,0x73,0xa7,0xef,0x30,0x1c,0x2e,0xee,0x69,0xb0,0x3c,0x51,0x24,0x2f,0xe7,0x10,
3507   0x1d,0x7c,0xac,0x00,0xf2,0xda,0xf9,0xab,0xa6,0x28,0xeb,0xc9,0xf1,0x79,0x4f,0x46,
3508   0x37,0x0f,0xa4,0x39,0x8e,0x5a,0x16,0xed,0xbb,0xfd,0x84,0xdb,0x34,0xc8,0x7a,0xac,
3509   0x1f,0xbe,0x37,0x3b,0x51,0x10,0xa7,0x90,0x4f,0x1f,0x68,0xe5,0x4f,0x7c,0xc8,0xa3,
3510   0x36,0xea,0xc4,0x65,0x9a,0x5a,0x0a,0xf3,0xc1,0xed,0xf7,0x47,0xa0,0xf5,0x99,0x8b,
3511   0xdc,0xf3,0xad,0x18,0xcb,0x99,0xa0,0x77,0x72,0xc8,0x91,0x63,0x87,0x92,0x4c,0xc4,
3512   0x70,0x39,0x50,0xb4,0x42,0x2d,0xc9,0x7d,0xc2,0x10,0x95,0x97,0x66,0xb4,0x42,0xad,
3513   0x53,0x1b,0x0d,0x99,0x60,0x75,0xe4,0x62,0x10,0x25,0x64,0x44,0x9b,0xbb,0xdb,0xa8,
3514   0xe5,0xfa,0x46,0x26,0x84,0xd2,0x52,0x89,0xbe,0x66,0x5e,0xca,0x87,0x07,0x77,0x13,
3515
3516   /* data */
3517   0xc6,0x3f,0x81,0xd9,0xb2,0x4f,0x72,0x13,0x0b,0xc7,0xf6,0x3b,0xdc,0x71,0x97,0x9c,
3518   0x31,0x1b,0xe3,0x82,0x16,0x90,0x64,0x39,0x97,0x9d,0xa8,0x0d,0xc1,0x0c,0x3b,0x4b,
3519   0x9f,0xab,0xa7,0x3e,0x3d,0x45,0x79,0x32,0xa7,0xa6,0x3e,0x73,0xe9,0x9a,0x81,0x4d,
3520   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3521   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3522   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3523   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3524   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3525   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3526   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3527   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3528   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3529   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3530   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3531   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3532   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3533   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3534   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3535   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3536   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3537   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3538   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3539   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3540   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3541   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3542   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3543   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3544   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3545   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3546   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3547   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3548   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3549   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3550   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3551   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3552   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3553   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3554   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3555   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3556   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3557   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3558   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3559   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3560   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3561   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3562   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3563   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3564   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3565   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3566   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3567   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3568   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3569   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3570   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3571   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3572   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3573   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3574   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3575   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3576   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3577   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3578   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3579   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3580   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3581   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3582   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3583   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3584   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3585   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3586   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3587   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3588   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3589   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3590   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3591   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3592   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3593   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3594   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3595   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3596   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3597   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3598   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3599   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3600   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3601   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3602   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3603   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3604   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3605   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3606   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3607   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3608   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3609   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3610   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3611   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3612   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3613   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3614   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3615   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3616   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3617   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3618   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3619   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3620   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3621   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3622   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3623   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3624   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3625   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3626   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3627   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3628   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3629   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3630   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3631   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3632   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3633   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3634   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3635   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3636   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3637   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3638   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3639   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3640   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3641   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3642   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3643   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3644   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3645   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3646   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3647   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3648   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3649   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3650   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3651   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3652   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3653   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3654   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3655   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3656   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3657   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3658   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3659   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3660   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3661   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3662   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3663   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3664   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3665   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3666   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3667   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3668   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3669   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3670   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3671   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3672   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3673   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3674   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3675   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3676   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3677   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3678   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3679   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3680   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3681   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3682   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3683   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3684   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3685   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3686   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3687   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3688   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3689   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3690   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3691   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3692   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3693   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3694   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3695   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3696   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3697   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3698   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3699   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3700   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3701   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3702   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3703   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3704   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3705   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3706   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3707   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3708   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3709   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3710   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3711   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3712   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3713   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3714   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3715   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3716   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3717   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3718   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3719   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3720   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3721   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3722   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3723   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3724   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3725   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3726   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3727   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3728   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3729   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3730   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3731   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3732   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3733   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3734   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3735   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3736   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3737   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3738   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3739   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3740   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3741   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3742   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3743   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3744   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3745   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3746   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3747   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3748   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3749   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3750   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3751   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3752   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3753   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3754   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3755   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3756   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3757   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3758   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3759   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3760   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3761   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3762   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3763   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3764   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3765   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3766   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3767   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3768   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3769   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3770   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3771   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3772   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
3773};
3774
3775
3776/* 317-0034 FD1089B */
3777static const UINT8 key_0034[0x2000] =
3778{
3779   /* opcodes */
3780   0x9d,0x5d,0x35,0xcd,0xc8,0x19,0x4d,0xe0,0x8a,0x90,0x15,0x68,0x55,0x76,0x80,0x98,
3781   0x9e,0x7e,0x84,0xa6,0xd9,0x5e,0x13,0xc4,0x79,0xc8,0x22,0x27,0xf4,0x71,0xa5,0x03,
3782   0xbc,0x0d,0x90,0x8c,0x46,0x4f,0xd6,0xf5,0x06,0xed,0x6c,0x74,0x70,0x99,0x46,0x3b,
3783   0x2d,0xc4,0xc1,0x5c,0x66,0x7c,0xcb,0x89,0x0f,0xff,0x8d,0x82,0x48,0xcd,0x1a,0xc3,
3784   0x42,0x72,0x33,0x68,0x67,0xfe,0x2b,0xa9,0x71,0x4e,0xa3,0x8c,0x6c,0x11,0x8f,0xe8,
3785   0xb1,0xc6,0x30,0x62,0xec,0xbc,0x1a,0x72,0x15,0x10,0x2e,0x5e,0x79,0xb1,0xa0,0x3c,
3786   0xb2,0x5e,0xf2,0xf3,0xa9,0xa5,0xf6,0x3a,0x9b,0xe5,0xcf,0x96,0x10,0x4c,0xef,0x5f,
3787   0xf7,0x08,0x58,0x7f,0x11,0xee,0x96,0x74,0x30,0xff,0xf4,0x4e,0xc9,0xee,0x65,0x69,
3788   0xb3,0xd9,0x33,0xcb,0x33,0x51,0x30,0xce,0xf2,0xf4,0x95,0xc7,0x83,0x97,0x76,0x08,
3789   0x7a,0x0d,0xe8,0xe7,0x6b,0x2a,0xfe,0xb8,0xeb,0xc3,0xcd,0xcd,0x8d,0xaa,0x67,0x7c,
3790   0xe6,0xb5,0xe2,0x19,0x88,0xb8,0x52,0xf6,0x09,0x86,0xca,0x69,0xfd,0xf3,0x5e,0xc5,
3791   0xf6,0xd3,0x22,0x5f,0x8a,0xfb,0x2b,0x8a,0x4d,0x3e,0x8b,0x9a,0xd1,0x70,0x59,0xe3,
3792   0xac,0x66,0xa6,0xba,0x71,0xf3,0x88,0x72,0xb5,0xeb,0x12,0x5f,0x0b,0x22,0x59,0xd6,
3793   0x07,0x6d,0x70,0x2a,0x3d,0x9f,0x6b,0xaf,0x42,0x8d,0x5e,0xba,0xa9,0x0a,0x5e,0x9e,
3794   0x07,0xea,0x7e,0xaf,0xee,0x01,0xd2,0x42,0xf4,0x24,0x6f,0xaa,0xad,0x26,0x68,0x3b,
3795   0xac,0xdb,0xd1,0x4a,0x84,0x18,0xbf,0x29,0xcc,0xb0,0x45,0x2f,0x15,0x77,0x77,0xad,
3796   0xe4,0xd9,0x19,0xbc,0x41,0x5a,0x60,0xa1,0xa1,0x6d,0x25,0xd6,0xd0,0x82,0x1b,0xf2,
3797   0xe7,0xd7,0x46,0x5b,0x51,0x79,0xf6,0x47,0xc9,0x49,0xd0,0xbe,0x59,0xf3,0xc5,0x94,
3798   0x5b,0xf8,0x17,0x72,0x7b,0xa4,0x5a,0xcd,0xb2,0x18,0x70,0xec,0x4b,0x8b,0xe6,0xe1,
3799   0xdc,0x2e,0xa0,0x5e,0x7b,0x2c,0xd2,0xfc,0x7a,0xa6,0x02,0x46,0x08,0x0f,0x86,0x17,
3800   0x24,0x2b,0x85,0x9a,0x9c,0x0a,0xf6,0x47,0x0f,0x11,0x9f,0xeb,0xeb,0xf1,0x16,0xa0,
3801   0x6f,0xac,0xc2,0xcf,0xa9,0x96,0xda,0x34,0x78,0x51,0x63,0xd9,0x8a,0xcf,0x35,0x19,
3802   0x5d,0x53,0xf6,0x9e,0x41,0x6f,0x1c,0x62,0x53,0x06,0xef,0xb0,0x83,0x4b,0x83,0x23,
3803   0x8f,0xbf,0xc1,0xa6,0x04,0x35,0x5e,0x71,0x43,0xd1,0xe1,0x11,0x78,0x04,0xa1,0x5f,
3804   0xa3,0x90,0xc3,0x87,0x93,0x89,0x3f,0x02,0xe5,0x51,0xdb,0x9b,0x08,0x9a,0x2e,0x6c,
3805   0x3b,0x67,0x9d,0xe1,0x8d,0x0a,0x60,0xb3,0xda,0x26,0x7d,0xee,0xd4,0xad,0xca,0xeb,
3806   0xf6,0xe2,0xee,0x55,0x92,0x58,0x60,0x26,0xc3,0xf0,0x65,0xaa,0x7a,0xde,0x15,0x7a,
3807   0x75,0xa3,0x56,0x82,0x42,0x13,0xde,0xfa,0x3f,0x50,0x35,0x6f,0x9c,0xcc,0xb0,0xbb,
3808   0x57,0x49,0x75,0x08,0x3d,0xdc,0x7d,0xd0,0xef,0xe5,0x8c,0xde,0xd9,0x17,0x39,0x4d,
3809   0x3c,0x75,0xec,0x87,0x24,0x51,0xda,0x47,0x71,0x4f,0x0a,0x96,0xd2,0x5f,0x53,0xd0,
3810   0xc4,0xc6,0x5a,0xa0,0x96,0x14,0x97,0xff,0x67,0x2e,0x50,0x38,0x25,0x45,0x9b,0xe5,
3811   0x8f,0xdc,0x5f,0xf2,0x33,0xc5,0x53,0x98,0x70,0x23,0xfc,0x62,0x74,0x68,0xb2,0x2b,
3812   0x3e,0x57,0x9b,0x1d,0x9c,0x02,0xae,0xb2,0x2d,0xcc,0xb0,0xb6,0x5e,0x68,0x39,0x42,
3813   0x70,0xd7,0xaf,0xc1,0x70,0x6d,0x48,0xee,0x3c,0xcc,0x0c,0xd3,0x84,0xe5,0xcf,0xca,
3814   0xc5,0xfd,0x3a,0x7f,0x4f,0xa5,0xc2,0xeb,0x3f,0xc0,0xae,0x59,0x84,0x80,0x15,0x64,
3815   0xde,0x68,0xdc,0xf6,0xd9,0x4a,0xbb,0x49,0xd5,0x4a,0x38,0xe9,0x00,0xd8,0xa9,0xaf,
3816   0x59,0xb8,0x35,0xc6,0xaf,0xfd,0xd3,0xa9,0x9e,0x08,0x49,0x21,0x98,0x8d,0x2d,0x4b,
3817   0xd8,0x8e,0xe6,0x8f,0x6f,0x5d,0xab,0xa9,0x3b,0x9c,0x81,0xa3,0xea,0xd8,0xfb,0x89,
3818   0x8e,0xf2,0xbb,0x0a,0xe1,0xeb,0x4b,0xa6,0x81,0x0f,0x98,0x8f,0x82,0xf7,0x60,0x48,
3819   0xcd,0x8e,0x33,0xa4,0x17,0x0e,0x6e,0xc4,0xe7,0x03,0x1c,0x94,0x46,0xa9,0x6e,0x43,
3820   0x03,0x75,0xcc,0xec,0xb3,0x44,0x98,0x55,0x21,0x85,0x86,0x15,0x68,0x75,0x98,0x91,
3821   0xf1,0x23,0x20,0x01,0x79,0x6e,0xc1,0x6b,0x08,0x04,0x6e,0xa5,0xfa,0x64,0x68,0x56,
3822   0xf9,0xdc,0x42,0xf4,0xff,0x8b,0xe0,0xc7,0x58,0x5f,0x72,0xe4,0x9d,0x16,0x7d,0x32,
3823   0xba,0xd2,0x67,0xe8,0x3b,0x93,0x0b,0xb2,0x35,0x34,0x73,0xf2,0x2c,0x77,0xc5,0xd4,
3824   0xf0,0x6e,0xfa,0xd1,0x1e,0x7c,0xd6,0xb4,0x26,0x53,0xf0,0x98,0x45,0xf7,0xb0,0xe7,
3825   0x8b,0xb8,0x4b,0x5c,0xd5,0x3a,0xc8,0x00,0xd2,0x70,0xfd,0x30,0x01,0x9b,0x92,0x94,
3826   0xb1,0x4f,0xfc,0x28,0xff,0x6e,0x81,0x36,0xda,0x2a,0x3a,0x58,0x01,0x05,0x0b,0x7a,
3827   0x02,0xd3,0xac,0xd5,0x3c,0xb6,0xa2,0xf4,0xdd,0x20,0x45,0xb2,0xe3,0xd5,0xbb,0x39,
3828   0xf5,0x42,0x6a,0xf9,0xff,0xe4,0x31,0x66,0x4a,0x6f,0xbe,0xc3,0xd7,0x72,0x75,0x83,
3829   0x47,0xcc,0xca,0xf4,0x4d,0x72,0xef,0x8c,0x9e,0x58,0xf7,0x15,0xb9,0xa5,0x10,0x78,
3830   0x6e,0x6a,0x96,0xa5,0x9b,0xa3,0xde,0x30,0x12,0x65,0x3b,0xad,0xa9,0xc3,0x01,0xb1,
3831   0x34,0xd1,0x84,0xcf,0x85,0xa4,0x19,0x9b,0x72,0x4f,0x13,0xa9,0xcf,0xe6,0xc7,0x8e,
3832   0x6e,0x7d,0x88,0xde,0x25,0x29,0xaa,0x2b,0xc7,0xfd,0x81,0x0b,0x29,0x0e,0x62,0x11,
3833   0x1e,0x6f,0xa0,0xd2,0x7a,0x34,0x8f,0xe0,0x12,0x71,0x84,0xd1,0xb8,0x3b,0xd2,0x39,
3834   0x42,0xa5,0xcd,0xab,0x84,0xc4,0xca,0xbb,0x51,0xaa,0x1b,0xfd,0x7d,0x6d,0x17,0x06,
3835   0xdc,0x21,0x0f,0x69,0x43,0xd8,0x59,0xba,0x85,0xa8,0x48,0x8e,0x76,0xa4,0x31,0x77,
3836   0xeb,0xe1,0x66,0x0c,0xb7,0x72,0x3d,0xde,0xae,0x6b,0x0a,0x83,0xa4,0xe1,0x20,0x8e,
3837   0x6e,0xe6,0xd3,0x94,0xdf,0x91,0x77,0x27,0xcc,0xf3,0x61,0xde,0x08,0x22,0xe4,0x4a,
3838   0x67,0x31,0x54,0x01,0xbd,0x34,0x05,0x96,0xdf,0x1b,0x69,0xa9,0x71,0xc4,0x62,0x19,
3839   0x14,0x29,0x2c,0x50,0x5d,0xe9,0x29,0xe7,0x52,0xcd,0xc2,0x6d,0xb3,0xea,0xb1,0xb7,
3840   0x95,0x95,0x8a,0x98,0x0a,0x21,0xe1,0xe4,0x29,0xe3,0x4b,0x70,0x03,0x2d,0x5b,0x0f,
3841   0xae,0x55,0xa6,0x95,0x3d,0xaf,0xbf,0xd6,0xc5,0x8d,0x3a,0xa7,0x58,0x45,0xab,0xdb,
3842   0x0c,0x2b,0xa7,0x47,0xf5,0x91,0xc1,0xbd,0x25,0xcd,0x8d,0x13,0xb2,0x32,0xa0,0x1d,
3843   0xb0,0x15,0x8d,0xad,0x31,0xc9,0xe8,0x99,0x4b,0xa2,0x46,0xb5,0x12,0xf4,0x3a,0xd3,
3844   0x98,0x14,0x58,0xc9,0xf3,0x55,0x34,0x6a,0x36,0x0c,0x63,0x8b,0x76,0x8b,0x78,0xff,
3845   0xc6,0x28,0x08,0x9a,0x3a,0x37,0xa6,0x31,0xe6,0x0a,0xe6,0x96,0xdf,0xf7,0x5c,0x9f,
3846   0x38,0x51,0x9d,0x20,0x05,0x6d,0x3c,0xec,0x5b,0x9e,0xcd,0xd7,0x4d,0x38,0xe5,0xb5,
3847   0xef,0x90,0x17,0x5b,0x56,0xf9,0xf7,0x9c,0x95,0xc7,0x1a,0x4c,0xc0,0x4e,0x13,0xec,
3848   0xe3,0x76,0x4b,0x9d,0xb1,0xc1,0xf0,0x8d,0x64,0x0f,0x44,0x26,0x95,0x80,0x2f,0x9b,
3849   0xb8,0xc7,0xa7,0x22,0x41,0x99,0x9e,0xed,0xa3,0xaa,0x08,0x31,0x54,0xae,0xdb,0x22,
3850   0xc6,0x59,0x0a,0xf3,0x6e,0x5e,0x88,0xda,0xbf,0x73,0x4a,0x09,0x2f,0x4a,0x44,0xb5,
3851   0x30,0x98,0x6a,0x12,0x37,0x11,0xaf,0x53,0xb8,0x68,0x09,0xae,0x27,0x52,0x6a,0x55,
3852   0xf8,0x84,0xc7,0x7d,0x9e,0xb0,0x14,0x5a,0x8e,0x8a,0x44,0x20,0x3c,0xc8,0x4d,0x02,
3853   0x1c,0x1c,0x21,0x35,0xa2,0x3c,0xb5,0xee,0x41,0xda,0xfd,0x5e,0x6f,0xab,0xed,0xbc,
3854   0x9e,0x62,0x78,0x3b,0x43,0xb5,0x93,0x0e,0xd1,0x56,0x33,0x6a,0xbe,0xfa,0x49,0x83,
3855   0x7c,0x55,0xcc,0x8d,0x80,0x1b,0xaf,0xbc,0x3e,0xff,0xe5,0x43,0x2a,0xb7,0x63,0x58,
3856   0xb8,0xf5,0x1d,0x2d,0x5b,0x6e,0x07,0xf7,0x88,0xd6,0x15,0xe9,0xb3,0xe0,0x3a,0x39,
3857   0x50,0x42,0x6b,0x19,0xd3,0xae,0x9d,0xbe,0xaf,0xd9,0xc1,0x5c,0x5a,0x77,0xce,0x27,
3858   0x46,0x3b,0xb7,0x53,0xe8,0xdb,0x6f,0x13,0xb3,0x09,0xeb,0x9c,0x1d,0x7a,0x1f,0x22,
3859   0x98,0xe2,0xff,0xd9,0x99,0xf5,0x7e,0xf5,0x94,0x66,0x92,0xa9,0xfd,0xeb,0x2d,0x2a,
3860   0x48,0x36,0x44,0xac,0xe8,0xfc,0xcb,0x63,0x52,0xf1,0xb5,0x83,0xfa,0xc8,0xf8,0x3f,
3861   0x54,0x37,0x86,0xcd,0xd4,0xf0,0x54,0x5f,0xed,0xa8,0x56,0x2a,0x14,0xd1,0x06,0x0d,
3862   0x95,0xa5,0x68,0xfc,0x48,0xc5,0x51,0x01,0xee,0x04,0xd7,0x6f,0x19,0x36,0x0e,0x9b,
3863   0x5f,0x30,0x08,0xd8,0x53,0xc5,0xdb,0x7a,0x8a,0xc9,0x9a,0xd5,0x97,0x11,0x5a,0x3e,
3864   0x0e,0x70,0x2e,0x08,0x84,0xba,0x2a,0x88,0x8c,0xc4,0x63,0x10,0xba,0x60,0xeb,0xf6,
3865   0xa2,0x65,0xd9,0x8e,0xd9,0xa4,0x3e,0x2a,0xf2,0xf3,0x30,0x20,0x82,0x25,0xc2,0xc4,
3866   0x1b,0x0e,0x08,0x68,0x53,0x83,0x17,0x62,0xbe,0x57,0x02,0x05,0xee,0x5f,0xdd,0xa6,
3867   0x6d,0xd4,0xe0,0x3b,0x19,0x8d,0xd6,0xb0,0xa5,0x5b,0xe4,0x13,0xc3,0x30,0x9d,0xbc,
3868   0x81,0xf7,0x1c,0xb7,0x20,0x18,0x91,0x84,0xbf,0xb5,0x4e,0xb7,0x31,0xe3,0xa9,0xe4,
3869   0x4a,0xb5,0xf6,0xa0,0xde,0x10,0xd9,0xb6,0xef,0x35,0xfa,0xbb,0x52,0x47,0x1d,0xa7,
3870   0x52,0x7a,0xb6,0x2d,0xe1,0x01,0x39,0x03,0xf4,0x11,0x1a,0xdb,0x7f,0xde,0xcc,0x6a,
3871   0x76,0x9c,0xc4,0x64,0xcd,0x7f,0x76,0x7c,0x77,0xba,0x56,0x67,0x69,0x82,0xd7,0xda,
3872   0x97,0x0b,0x6f,0x87,0xf5,0x89,0x90,0x22,0x77,0x30,0xaf,0x61,0x10,0x34,0x76,0x7f,
3873   0xe2,0xad,0xb7,0x69,0x91,0x34,0x5a,0xe2,0x4d,0x94,0xf4,0xbe,0x29,0x21,0x17,0xd1,
3874   0x39,0x30,0x59,0xf0,0x92,0x14,0x4e,0xee,0x47,0x21,0x88,0x9f,0x6c,0xab,0x9d,0xd8,
3875   0x16,0x07,0x21,0x6c,0x58,0x88,0xa6,0x2f,0x46,0x83,0xc2,0xf6,0xf5,0x4b,0x08,0x94,
3876   0x78,0x34,0x0d,0xdd,0xe3,0x92,0x64,0xa6,0x4a,0xba,0xa1,0xc1,0xc2,0xff,0x58,0x05,
3877   0x5e,0xb5,0x1e,0x43,0x33,0x31,0x86,0x51,0x54,0xc6,0x25,0x02,0xd5,0xc8,0x8d,0x2a,
3878   0xca,0x8c,0x55,0x9e,0x48,0x65,0x0e,0x31,0x62,0xa7,0x4e,0xb8,0x2c,0xa6,0xa7,0x05,
3879   0xbb,0xb7,0xb0,0xee,0x22,0x72,0x9a,0x20,0xd6,0x4c,0x20,0x4c,0x78,0x47,0xac,0x34,
3880   0x5b,0xd9,0xf3,0xcc,0xb3,0x74,0xa9,0x08,0xb3,0x8d,0x81,0xdb,0x91,0x98,0x31,0x3a,
3881   0x7f,0x08,0x6b,0x19,0xb2,0x53,0xe4,0x6c,0x5e,0xeb,0x50,0x27,0xb7,0x45,0x63,0x3d,
3882   0xf1,0xd5,0xd0,0xa4,0x3f,0x0f,0x4c,0x4e,0xd6,0x66,0x8b,0x30,0xea,0x50,0x41,0x3d,
3883   0xaf,0x3f,0x22,0x6b,0x59,0xa8,0xe2,0xac,0x1b,0xff,0x34,0xf6,0x2b,0xb7,0xcd,0x3b,
3884   0xbb,0x46,0x61,0x6f,0xff,0x1e,0xa4,0x88,0x2d,0xb4,0x4a,0x78,0x78,0x7c,0x06,0x35,
3885   0x13,0xe9,0x8d,0xb1,0x33,0x71,0x93,0xe1,0x0c,0x86,0xcc,0xb8,0xd2,0x9d,0xec,0x2c,
3886   0xb8,0x2a,0xa6,0x2f,0xf4,0xa1,0xb0,0xb6,0xb8,0x75,0xbc,0xb5,0x39,0x1c,0x7f,0x20,
3887   0xab,0x08,0xac,0xea,0x42,0xae,0xf9,0x09,0x31,0x82,0x18,0x6f,0xad,0xf7,0xbe,0x11,
3888   0xea,0x83,0x9f,0xe3,0x1c,0x98,0x6f,0xd8,0x77,0xab,0xe2,0xe6,0x2e,0x30,0xab,0xff,
3889   0x77,0x9a,0x7f,0x18,0x84,0x5f,0x12,0x25,0x8a,0xf1,0x18,0x1a,0xbd,0xc5,0x45,0xea,
3890   0x50,0x4f,0x4c,0x8b,0x79,0x03,0xe3,0xef,0x6a,0x54,0xbc,0x0b,0x58,0xb8,0x8c,0xd2,
3891   0x77,0xa1,0x07,0x3a,0xfa,0x84,0xe0,0x35,0x17,0xd5,0xcc,0xb8,0x00,0x07,0x80,0xb7,
3892   0xea,0x90,0xae,0x26,0x09,0xe2,0x0a,0xf9,0x91,0x72,0x4a,0x23,0x6a,0x01,0x3a,0x71,
3893   0xf5,0xdb,0xcc,0xd9,0x44,0x57,0x2e,0x8e,0xad,0x09,0x33,0xa3,0x83,0x86,0xb0,0x2c,
3894   0x1b,0x61,0x78,0x3e,0xc8,0x2e,0x5f,0xec,0xde,0x82,0x39,0x4a,0xb2,0xf0,0xdb,0x6d,
3895   0x96,0x0c,0x18,0x68,0xe1,0x6b,0xc4,0x4f,0xe4,0xa0,0xb4,0x37,0xf5,0x3f,0xba,0x33,
3896   0x67,0xdc,0xad,0x57,0x8e,0x0c,0x5e,0xb7,0xbf,0x62,0xa3,0x68,0x4d,0x73,0x4f,0x7d,
3897   0x8c,0xd2,0x37,0x0b,0xd1,0x13,0x2e,0x24,0x6f,0xca,0x08,0xde,0xba,0x8c,0x99,0x4d,
3898   0x07,0xec,0xb6,0x84,0xa9,0x7e,0x32,0x97,0xf4,0xd7,0xe1,0x9a,0x3c,0x8a,0x98,0xa1,
3899   0xd6,0x2b,0x2a,0xc1,0x15,0x4f,0x6b,0x0e,0x4e,0x89,0x30,0x9a,0xd4,0x6d,0x4c,0x7b,
3900   0xfb,0x8f,0x93,0xc4,0x17,0x84,0xda,0x8a,0x7d,0xdf,0xf3,0xe0,0x80,0x35,0xb5,0xda,
3901   0x74,0x19,0xf1,0x8c,0xae,0x1f,0x7d,0x0b,0x81,0xdb,0x2c,0x6a,0x41,0xe2,0xd2,0xbd,
3902   0x43,0xc7,0x44,0x19,0xda,0x1e,0x55,0x91,0x5a,0x7c,0xda,0x39,0x17,0x74,0xa5,0x26,
3903   0x66,0x9a,0x8c,0x6b,0x9a,0x83,0x63,0x1c,0x08,0xc2,0xfc,0x4e,0x02,0xeb,0x2d,0x14,
3904   0xdf,0x93,0xc9,0x82,0xf0,0x4c,0xa5,0xac,0x8b,0xad,0x94,0xa7,0x03,0x47,0x6a,0x86,
3905   0xac,0xb0,0xfb,0x5e,0xdb,0x7b,0x1c,0x42,0xe3,0x3c,0xa0,0x46,0x18,0x88,0x5c,0x7e,
3906   0xce,0xf2,0x23,0xff,0x5a,0x0e,0xc9,0xdc,0x10,0x71,0x22,0x29,0x42,0xae,0x03,0xfb,
3907   0x46,0x59,0x3f,0x65,0x6f,0x07,0xaa,0x7b,0x12,0xbd,0xfe,0x6b,0x67,0xa4,0x71,0x09,
3908   0xe3,0x06,0x54,0xdc,0x2a,0x97,0x9b,0x17,0xae,0x0b,0x39,0xf0,0xe4,0x15,0x23,0x99,
3909   0x3f,0x6a,0x4d,0x47,0x35,0xbf,0xab,0x2e,0x38,0xc5,0x31,0x82,0xbd,0x33,0xd2,0x77,
3910   0x38,0xbc,0x84,0x2b,0x4e,0x8c,0x76,0x15,0xb6,0xba,0x69,0xbd,0x38,0xb0,0x1f,0x76,
3911   0x68,0x41,0xae,0x94,0xdb,0x41,0x29,0x6b,0x24,0x85,0xa5,0x50,0xd7,0xe0,0x35,0x96,
3912   0x89,0x26,0xed,0x92,0xcd,0x2c,0xe2,0x96,0x37,0xc4,0x26,0xf8,0x5b,0xc5,0xd0,0x0c,
3913   0xce,0x00,0xf1,0x24,0x23,0x4b,0x9f,0x96,0xee,0x79,0xed,0xb6,0xc4,0x5e,0xef,0xd6,
3914   0x38,0xcf,0xba,0x4c,0xdf,0x9f,0x61,0x6b,0x4b,0xa3,0xf8,0x88,0x12,0xad,0x94,0xf6,
3915   0xc7,0x93,0x48,0x09,0xff,0x29,0x28,0x15,0x4d,0x41,0x49,0x6f,0x45,0xb1,0xbd,0x6a,
3916   0x7c,0x4c,0x9b,0x5a,0x85,0xe7,0xf4,0x94,0xf4,0x55,0xde,0x6b,0x5d,0x6a,0x6c,0x34,
3917   0x55,0xfa,0xb3,0x41,0x6f,0xda,0xc5,0xe8,0xee,0x84,0xe7,0x9d,0x75,0xdf,0x36,0x12,
3918   0x98,0xcb,0xd9,0x71,0x09,0x3a,0x06,0x2d,0x7d,0x21,0xef,0xbb,0xa8,0x73,0xc8,0x90,
3919   0x3e,0x26,0xc7,0x1e,0xf3,0x2c,0x1f,0xd9,0x7a,0x7b,0x03,0x37,0x88,0x05,0xa8,0xaa,
3920   0xd1,0xbe,0x42,0xa8,0x09,0x9c,0x05,0xa3,0xe3,0x91,0x24,0x0f,0x15,0x93,0xd4,0x62,
3921   0x51,0x94,0x49,0x0e,0x4c,0x89,0xb7,0x89,0xba,0x65,0x52,0x45,0xa1,0xa0,0x1e,0xbe,
3922   0xbc,0xb5,0x7e,0xef,0xb6,0x26,0x07,0x65,0x63,0x07,0x0d,0xb6,0x98,0x6d,0xe5,0x76,
3923   0x28,0x6b,0xe2,0x37,0xe7,0x15,0x59,0x8f,0xaa,0x80,0x9d,0x11,0x44,0xbf,0x02,0x52,
3924   0x89,0xe6,0xdc,0xe5,0x4e,0x09,0x80,0x5e,0x65,0x3d,0x41,0x51,0xa5,0x95,0x73,0x53,
3925   0xdf,0x26,0x6b,0xf7,0xe9,0x02,0x7c,0xd2,0x96,0x8d,0xbd,0xf8,0x2c,0x35,0x2c,0xb4,
3926   0x52,0xb3,0x04,0xb9,0x01,0x4d,0xea,0x3c,0x87,0xc8,0x80,0x85,0xd2,0x55,0xc5,0x6a,
3927   0xf4,0x47,0x4b,0xbf,0x04,0xf3,0xa8,0x56,0x13,0xab,0x6f,0x05,0x37,0xc6,0x35,0x9f,
3928   0x83,0x95,0x8d,0xf9,0x0c,0x6e,0x0b,0xe6,0xe5,0xa4,0x43,0x3a,0x22,0x8b,0xca,0xc9,
3929   0xd7,0x78,0x33,0x68,0x19,0xbe,0x13,0xea,0xfb,0xb1,0xfc,0x24,0x91,0xa5,0x85,0xe8,
3930   0xf0,0xef,0x3f,0x0d,0x2b,0xe3,0xc0,0x64,0x56,0xd3,0x9b,0xc3,0x86,0x15,0x64,0xfd,
3931   0xce,0xfc,0xaf,0xe6,0x42,0xdd,0x11,0x52,0xf7,0x0a,0x1e,0x16,0x00,0xd9,0x68,0x06,
3932   0x71,0x9e,0x85,0xf4,0x5e,0xab,0x08,0xb6,0xdc,0x56,0x86,0x1f,0xfe,0xf3,0x91,0x04,
3933   0xd9,0xd4,0xbf,0x38,0x80,0x4f,0xa4,0x8f,0x07,0xb8,0xd3,0xdd,0x82,0x61,0xe0,0xf7,
3934   0x06,0xa0,0x5f,0xb0,0xa6,0xc8,0xe5,0xdc,0x76,0x2e,0x05,0x50,0x8b,0x25,0x53,0xdf,
3935   0xf8,0x01,0x63,0x5d,0xd1,0x16,0xca,0x9f,0x2a,0xb9,0x1c,0x78,0x18,0x3d,0xeb,0xbc,
3936   0xaf,0xf7,0xcd,0xfe,0x4b,0x9e,0x64,0x67,0x1f,0xff,0xca,0xdd,0x83,0x46,0x3a,0x52,
3937   0xac,0xe6,0x69,0xba,0xce,0x55,0x0b,0x0b,0x1d,0x05,0xd3,0x38,0xcd,0x6b,0x77,0x34,
3938   0x11,0xfa,0xa9,0xf4,0x1e,0x28,0x1e,0x6c,0x28,0x67,0x8a,0x90,0x63,0x2c,0xa1,0x53,
3939   0x03,0xeb,0x17,0xab,0x3b,0x18,0x9f,0x8a,0xb8,0x6a,0x29,0x81,0xf1,0xbe,0xc2,0x3c,
3940   0x9f,0x65,0xdb,0xf4,0x17,0xf2,0x47,0xbb,0xac,0xfa,0xda,0xa8,0xb2,0x0f,0x68,0xcc,
3941   0x7e,0xc8,0xc6,0x3d,0x63,0xb6,0xc7,0x0e,0xb5,0x6f,0x86,0xf4,0x20,0xad,0x1f,0x26,
3942   0xec,0x6c,0xbd,0x60,0x97,0xaf,0x51,0xd7,0x93,0x27,0xd2,0xbf,0x55,0x8b,0x33,0x4b,
3943   0x51,0x8e,0x67,0xb1,0xfb,0xe3,0x63,0x23,0xc7,0x3f,0x1b,0xd6,0x28,0x56,0x83,0xfe,
3944   0x93,0xdc,0x8f,0xcf,0x7c,0x85,0x32,0x7c,0x57,0x04,0x61,0x3b,0x98,0x0e,0x11,0x3e,
3945   0xb2,0x57,0x33,0xba,0x1a,0x93,0xbe,0xe2,0x45,0x76,0xa5,0xec,0xa4,0xb3,0xdb,0x0a,
3946   0xae,0x00,0x55,0x72,0xd6,0x0f,0x07,0x56,0x8f,0x95,0xe5,0xea,0x4e,0x45,0xe2,0x64,
3947   0x87,0xd5,0xf4,0xf7,0xae,0xf7,0x0d,0xd6,0x37,0x60,0x22,0x36,0x95,0xc4,0x27,0x4b,
3948   0x3d,0xd7,0x0f,0x48,0xa3,0x4d,0xd0,0x63,0x3b,0xd9,0x5c,0xce,0x79,0x30,0xa8,0xbe,
3949   0xd0,0x07,0xa8,0x67,0xb5,0x0f,0x55,0xf3,0x4b,0xe2,0x64,0x71,0x6c,0x50,0x7c,0x83,
3950   0x63,0xbd,0x53,0xe5,0x3f,0x8c,0xa4,0x5b,0xd2,0xc7,0xe6,0x17,0xd0,0x62,0x4d,0x8d,
3951   0xec,0x50,0x0c,0x31,0xdb,0x86,0x58,0x77,0x52,0xf8,0x66,0xd2,0x03,0x9a,0x67,0xb7,
3952   0xa2,0x60,0x92,0x9a,0xe5,0x3d,0x1a,0xef,0x7e,0x26,0x32,0x2a,0x23,0x0f,0x0f,0xbe,
3953   0x86,0xec,0xe5,0x20,0x5c,0xb1,0xe8,0xc4,0x58,0x51,0x4b,0x1e,0x30,0xc2,0x44,0xa2,
3954   0x96,0xf6,0x05,0xc4,0x3f,0xe2,0xc3,0xf7,0xdf,0x7a,0xb2,0xb0,0x2a,0xb1,0x05,0x63,
3955   0xd3,0x7d,0xf2,0x84,0x90,0xd0,0xab,0x86,0x13,0x9f,0x65,0xdf,0x11,0xdd,0x54,0x01,
3956   0x3e,0x80,0xac,0x61,0x4d,0x7b,0xa0,0x73,0xf4,0xc1,0x66,0xab,0xe5,0x47,0x30,0x7c,
3957   0xd5,0x01,0x33,0x5b,0x78,0xe2,0xa3,0xbc,0x81,0xe0,0xb3,0x13,0xa6,0xed,0x98,0xd4,
3958   0x99,0xfe,0x87,0x73,0x0f,0x07,0xb2,0x63,0xbc,0xfc,0x4e,0x19,0x54,0xd1,0x8e,0x09,
3959   0x8b,0x79,0xa8,0xa7,0x14,0xe9,0xce,0x66,0xa4,0x15,0x35,0xbc,0xef,0xf1,0x11,0x1b,
3960   0xa9,0x71,0x96,0xf8,0x85,0x88,0xf7,0xc7,0x39,0x2b,0x69,0xfc,0x77,0x4e,0x21,0x0a,
3961   0xf4,0xe5,0x50,0x66,0x64,0xe4,0x2d,0x84,0x7b,0x3e,0xeb,0xd8,0xec,0xe9,0xbd,0xd6,
3962   0x6c,0xd7,0xd8,0xf2,0xb0,0xfd,0x70,0x9f,0x69,0x4e,0xb9,0x52,0x4e,0xc0,0xe7,0x7f,
3963   0x12,0x45,0x2d,0x9a,0x68,0xd3,0xc1,0x16,0x05,0x5c,0xd5,0x69,0x9d,0xd4,0x9e,0x05,
3964   0xe4,0x31,0x4f,0x5f,0x8e,0x65,0x1e,0xeb,0x4e,0x66,0x3d,0x1d,0xd9,0x26,0xe1,0x68,
3965   0xe3,0x9a,0x3e,0x41,0x20,0xb5,0x88,0x1c,0x44,0x6d,0xf3,0x6d,0x02,0xb4,0xb2,0xa8,
3966   0x10,0x7f,0xfa,0x4d,0xdf,0xb3,0x45,0x95,0xfb,0xef,0xe3,0x0b,0x32,0x84,0x68,0x44,
3967   0x58,0x86,0x25,0xd3,0x41,0x07,0x70,0x4c,0xc2,0x1d,0x9c,0x44,0xaf,0xdb,0xfd,0x4e,
3968   0xda,0x56,0xe8,0xfe,0x19,0xa0,0xb0,0xe8,0x3f,0xd0,0xa9,0xa1,0x21,0xf7,0x28,0xbc,
3969   0x91,0x2b,0x80,0xce,0x66,0x7f,0x05,0x69,0x71,0x07,0x0c,0x23,0x88,0xd8,0xe8,0x90,
3970   0x7e,0x05,0xed,0x42,0x27,0xa2,0x6f,0xcf,0x58,0xc4,0xc3,0xcb,0xe4,0x7e,0x3c,0xc8,
3971   0x9f,0xe4,0x2f,0x5c,0x5e,0x0b,0xef,0x1a,0xf4,0x06,0xd0,0x97,0x35,0xe9,0x26,0x66,
3972   0xf5,0xc8,0x46,0x1b,0x09,0xb8,0x83,0x4a,0x45,0xcc,0x31,0x88,0x7b,0x19,0xa5,0x68,
3973   0x81,0xb1,0x32,0x7f,0x2a,0xaa,0x2c,0x5f,0x4a,0x18,0xe8,0x9e,0xb6,0x0e,0xb8,0xd0,
3974   0x41,0xae,0x4e,0x70,0xbd,0x8d,0x33,0x51,0x26,0xdc,0xdd,0x1d,0x6e,0xd1,0xc1,0x87,
3975   0x8b,0x9e,0x53,0x45,0x6f,0x79,0x06,0x09,0x0f,0x94,0x50,0x88,0x5f,0x24,0xa3,0x76,
3976   0x52,0x5c,0x74,0x86,0xde,0x72,0x37,0x6e,0xf5,0x98,0x5f,0xe0,0x8c,0x03,0x62,0x91,
3977   0x97,0xe7,0xb2,0x35,0x0a,0x78,0xc4,0x7f,0xd8,0xea,0x0c,0x25,0xf6,0x70,0xfe,0xd9,
3978   0x59,0x3f,0x0d,0x50,0xf3,0x8b,0xaf,0x3e,0xb8,0x88,0x56,0x57,0x9e,0x6a,0x77,0x4f,
3979   0x97,0x64,0x86,0xd9,0x98,0xab,0xf6,0xaa,0x95,0x73,0x3d,0x76,0x82,0xf0,0xcd,0xf1,
3980   0x53,0x56,0x1b,0xce,0xfb,0xd9,0x9b,0xc3,0x70,0xac,0xc0,0x82,0xa4,0x04,0x00,0xc0,
3981   0x8b,0x15,0xcd,0x31,0x1b,0x13,0x9c,0x89,0x47,0x31,0xe1,0x7b,0x02,0xa5,0x10,0xb8,
3982   0xc5,0xee,0x02,0xe0,0x51,0xd0,0x5e,0x50,0x22,0x43,0xe8,0xdb,0x4b,0x9b,0x34,0x55,
3983   0xe0,0x2c,0xd7,0x93,0xf5,0x4b,0x65,0x68,0x9f,0x4b,0x70,0xa8,0xf1,0x81,0x8e,0x27,
3984   0x00,0x3f,0x52,0xba,0xdf,0xdb,0x51,0x35,0xa2,0xa9,0x1d,0x6a,0x5d,0xfb,0x4c,0x2f,
3985   0x25,0x27,0x72,0x57,0x0d,0x80,0x22,0xb6,0x2a,0x5b,0xf0,0x21,0x8e,0x0b,0x70,0x6b,
3986   0x4f,0xe4,0x37,0x68,0x81,0x3b,0xd8,0xed,0x36,0x63,0xe7,0xcd,0x84,0xb0,0xf8,0xdc,
3987   0x7e,0x76,0xa0,0xef,0x39,0x0a,0x73,0xd9,0xc8,0xbf,0x03,0x6e,0x3f,0xe9,0xe6,0x83,
3988   0xb3,0xdd,0xaf,0xeb,0x36,0xee,0xf3,0x7a,0xde,0x70,0x44,0x04,0xbf,0xb8,0x39,0x5e,
3989   0xec,0x19,0x63,0x5b,0x79,0xe7,0x58,0xd0,0x7a,0x77,0xab,0x8f,0x04,0x1c,0xf0,0x6e,
3990   0x2a,0x2a,0xbc,0x41,0x00,0xf6,0xa2,0xdb,0x9b,0xd2,0x36,0x0f,0x0e,0x14,0x0d,0xb4,
3991   0x6d,0x10,0xb9,0x9b,0xcd,0x19,0xd1,0x9a,0xf3,0xe3,0x21,0xcd,0x36,0x2b,0x42,0x34,
3992   0x23,0xf0,0x87,0x34,0xed,0xa7,0xa2,0xbf,0xc7,0xc3,0x49,0xca,0xe6,0xba,0x2e,0x49,
3993   0x7e,0xfe,0x06,0x2f,0xc3,0x04,0x84,0x72,0xe8,0xb6,0x4e,0xc9,0x7d,0xc0,0xc2,0x54,
3994   0xc0,0x91,0x69,0xd0,0x00,0xbc,0x18,0x4f,0x92,0xd5,0xa2,0xe7,0xc9,0x71,0xdb,0xac,
3995   0xfa,0x23,0x98,0xb0,0x78,0x7f,0xac,0x09,0x97,0x19,0xeb,0xca,0xab,0x86,0x29,0x08,
3996   0x09,0x59,0x3b,0xd6,0x04,0x27,0xf4,0x48,0xf0,0x83,0x29,0x72,0x22,0x01,0xad,0x69,
3997   0xed,0x35,0x54,0x9e,0x1c,0xcd,0x20,0x70,0x55,0xf4,0x50,0x98,0x78,0x69,0x03,0x48,
3998   0xf8,0xe1,0x2e,0xb5,0x4a,0x10,0xc5,0x13,0xe3,0xaa,0xbb,0x95,0x35,0x63,0x05,0x71,
3999   0xb4,0xee,0x98,0xd9,0xd6,0x00,0x66,0x02,0x0d,0x4d,0x63,0x20,0xcf,0x89,0x85,0x67,
4000   0x8e,0x67,0xbf,0x0a,0xbe,0x9d,0x04,0x3e,0xd5,0xdd,0x49,0x38,0x46,0xdc,0x82,0x2a,
4001   0x84,0x4e,0xa2,0x48,0x04,0xe7,0x9f,0xc8,0x3a,0x5a,0x6b,0xdc,0x9a,0x5c,0xfb,0xb9,
4002   0x97,0xa2,0x43,0x93,0xa6,0xdd,0x37,0x9e,0x3c,0xc4,0xcb,0x0e,0xcb,0x0a,0xf2,0x16,
4003   0xc7,0x62,0xa1,0xec,0xa6,0x81,0xcc,0xc2,0xda,0x1b,0x67,0xcd,0xd9,0xe4,0x66,0x74,
4004   0x43,0xcc,0xb5,0x59,0x9b,0xaf,0xf1,0xb0,0x01,0x8e,0x18,0xc4,0xeb,0x56,0x37,0x7f,
4005   0x2a,0x94,0xc3,0xbc,0xd0,0xed,0xf0,0xef,0x90,0x57,0xf1,0x8b,0x20,0xc4,0xfb,0x06,
4006   0x32,0x29,0x42,0xd2,0x7b,0x79,0xfa,0x65,0xae,0xaa,0x57,0x30,0x81,0xae,0x8c,0xaa,
4007   0xa6,0x7b,0xce,0x46,0xd3,0x03,0x51,0x77,0xb9,0x3a,0x49,0xb2,0x0f,0x16,0xea,0x6c,
4008   0x88,0x89,0x67,0x16,0xd7,0x89,0xf6,0x27,0xb2,0x08,0xc9,0x11,0xcb,0xfb,0x15,0x4a,
4009   0xd6,0x55,0x0e,0x44,0x89,0x0c,0xe7,0x74,0x97,0x12,0xd6,0x4d,0xb3,0x5c,0x0d,0x45,
4010   0x92,0xde,0xc1,0xce,0xe8,0x8c,0x26,0x5d,0x69,0x59,0x6f,0x66,0xc8,0x3b,0xd2,0x5d,
4011   0xbb,0x24,0x81,0xb6,0xf4,0x09,0xb1,0xe4,0x28,0xde,0x96,0x5c,0x0a,0x96,0x64,0x92,
4012   0x50,0x27,0x4e,0xfa,0xad,0x83,0x8a,0x08,0xd4,0x9f,0x4a,0x2f,0x7a,0x6f,0xc3,0xe5,
4013   0x53,0xe7,0x28,0x9c,0x12,0xfa,0xaf,0xc9,0x6d,0x9e,0x8a,0xdf,0x16,0xc5,0xef,0x54,
4014   0xc2,0x64,0x10,0x9a,0x25,0x6e,0x21,0x26,0xf3,0xd9,0x58,0x6c,0xdf,0x97,0xe7,0xe0,
4015   0x9f,0x9d,0x04,0xf6,0xe5,0xdf,0xe1,0x21,0x66,0x51,0xb3,0xd6,0xd6,0xe7,0xad,0x89,
4016   0xe8,0x94,0x05,0xae,0x52,0x4e,0xed,0xb9,0xc6,0x07,0x9a,0x1d,0xf9,0xb4,0x76,0xba,
4017   0x3a,0x2a,0x77,0x92,0x41,0x6e,0xfa,0x88,0x54,0xfb,0x52,0x31,0x46,0xe4,0xd3,0x1f,
4018   0xeb,0x3d,0xd1,0xe8,0x18,0x1b,0xa1,0x20,0xa0,0x91,0x96,0x59,0x57,0xb3,0x05,0x29,
4019   0x12,0x96,0x41,0x23,0xa4,0x4c,0x9e,0xdc,0xe1,0xec,0x70,0xe7,0x9d,0x87,0x0c,0xd8,
4020   0xad,0x33,0xc5,0x43,0xe4,0x03,0xef,0xbd,0x17,0x0c,0xdf,0xd9,0x19,0x60,0xe8,0x2c,
4021   0xbe,0x15,0x5e,0x48,0xda,0x3f,0x96,0xc3,0x42,0xf0,0xe2,0x31,0xc9,0x3e,0x99,0x24,
4022   0x43,0x3d,0x0c,0x32,0x85,0xff,0x91,0xef,0x62,0x9a,0x7b,0xed,0xae,0x22,0x1f,0xc2,
4023   0x3e,0xa9,0xcf,0x01,0xe5,0x45,0xe1,0x3f,0x77,0x09,0xa9,0x0f,0xc9,0x0a,0x7a,0x05,
4024   0xae,0x5b,0xa8,0xb5,0xfa,0x10,0x87,0xb4,0x81,0x3d,0x6c,0x95,0x18,0xf7,0xa9,0xed,
4025   0x92,0x51,0x95,0x4e,0xc4,0x5f,0x81,0x4e,0x80,0x36,0xc3,0x81,0x9c,0xe9,0xae,0x79,
4026   0xec,0x8c,0x97,0xcc,0x42,0x34,0xd1,0x0e,0x74,0xf4,0xb0,0xd1,0x56,0xe0,0x88,0xab,
4027   0xba,0x0d,0xae,0x2f,0x76,0x8e,0x75,0xf2,0x5e,0x77,0x32,0x87,0x44,0xdc,0x37,0x82,
4028   0xfe,0xd2,0xda,0x77,0x5f,0x6c,0x6f,0xfb,0x3c,0xbf,0x48,0xa1,0x67,0xdd,0xbb,0xfe,
4029   0xb7,0xdd,0x1c,0xa4,0xfd,0xd0,0xbd,0x29,0x0f,0xcc,0xf4,0x21,0xc0,0xe4,0x14,0x1e,
4030   0xe4,0x2c,0x72,0xb6,0x50,0xb9,0x61,0x7d,0xd7,0x9e,0x35,0x05,0x4d,0xef,0x42,0xe4,
4031   0x87,0xc0,0xdd,0xad,0x58,0x26,0x59,0xf5,0x94,0x34,0x0a,0x4f,0x0f,0xff,0x45,0x4f,
4032   0x9e,0x9a,0x5d,0x8a,0x14,0x19,0xa7,0x92,0x46,0x90,0x75,0xfd,0x07,0x14,0x1d,0x5f,
4033   0x2b,0xb8,0xf2,0x4b,0x86,0x90,0x49,0x55,0xed,0xb1,0x75,0x11,0x33,0x2e,0xca,0x14,
4034   0x2c,0x1c,0x9d,0xf1,0xad,0x8d,0x43,0xd6,0x86,0x14,0xba,0x83,0x96,0x84,0x9f,0x44,
4035   0x1e,0xe5,0xfb,0x03,0x2c,0xb4,0xca,0xdc,0x7b,0xf5,0xc0,0xdd,0x49,0xa9,0x43,0x71,
4036
4037   /* data */
4038   0x0a,0x9d,0x0f,0x2c,0x45,0x00,0x27,0x7a,0x7f,0x4e,0x67,0x7e,0x4b,0x5c,0xe4,0x8a,
4039   0x3d,0xfd,0xb1,0xf4,0xe9,0x05,0xe2,0x10,0xe4,0x48,0x8b,0x30,0xc1,0x9b,0xc1,0xaa,
4040   0x15,0xd1,0x97,0xd2,0x72,0xbf,0x21,0xfa,0x6e,0x37,0x74,0x78,0x9d,0x0f,0xa3,0x9f,
4041   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4042   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4043   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4044   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4045   0x91,0x1b,0xc2,0xc4,0xe0,0x2d,0xe6,0x3a,0x1e,0x1b,0x22,0x55,0xdd,0xb9,0x8a,0x4f,
4046   0x71,0xde,0x7f,0x38,0x3a,0x53,0x3f,0xf6,0xfe,0xb8,0xb4,0xff,0x71,0x01,0x12,0xc5,
4047   0x46,0x21,0x8c,0xbd,0x33,0x0d,0x58,0x5a,0xea,0xb9,0xa8,0x12,0x20,0x19,0xb1,0x57,
4048   0x89,0x21,0xa7,0x9e,0xd9,0xc5,0xbd,0x5b,0xc3,0xf8,0x29,0x02,0xfc,0xaf,0x1d,0x06,
4049   0x38,0xde,0xce,0xdd,0x2b,0x79,0x70,0xf9,0x89,0x73,0x36,0xcf,0x06,0xc2,0x56,0xd2,
4050   0x55,0x58,0x02,0x78,0x2b,0x2a,0x6f,0x33,0x3c,0x2c,0xd1,0x79,0x3c,0x51,0x5c,0xbc,
4051   0xdf,0x8f,0x43,0x70,0xd8,0xd8,0xbb,0x0b,0xdc,0x21,0xf9,0x00,0x9f,0x5e,0x2f,0xc2,
4052   0xd5,0x82,0x91,0xc6,0x32,0x83,0x55,0x80,0x69,0x53,0xad,0x64,0x30,0xe7,0xce,0xe5,
4053   0x39,0x33,0xed,0x78,0x39,0x2b,0x3b,0x92,0xe3,0xc3,0xef,0xa5,0xed,0xee,0x3b,0x25,
4054   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4055   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4056   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4057   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4058   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4059   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4060   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4061   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4062   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4063   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4064   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4065   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4066   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4067   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4068   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4069   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4070   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4071   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4072   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4073   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4074   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4075   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4076   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4077   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4078   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4079   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4080   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4081   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4082   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4083   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4084   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4085   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4086   0x09,0xa1,0x55,0x88,0xec,0xd0,0x6f,0xc8,0x31,0xe0,0x48,0xe3,0xfe,0x8b,0xf4,0xe4,
4087   0x1e,0x47,0xbd,0x60,0x65,0x27,0xf7,0xe9,0xa7,0x19,0xbe,0xee,0x72,0x7c,0xfd,0xf1,
4088   0xb4,0x4c,0xbe,0x5b,0x11,0xbd,0x75,0xdf,0x7f,0x02,0x96,0x33,0xf0,0x50,0x94,0x09,
4089   0x59,0xdb,0xe4,0x16,0xae,0xd7,0xfb,0x0d,0xe2,0x78,0x4b,0xa4,0xea,0xf1,0x48,0x8d,
4090   0xbb,0x77,0x68,0x7e,0x47,0x3e,0x1d,0x29,0x82,0x7a,0xdd,0x42,0x62,0x5f,0x1a,0x7f,
4091   0xda,0x21,0x48,0x92,0xdd,0xf3,0xdd,0x31,0x60,0x0a,0x4c,0x0e,0x57,0x9a,0x08,0xdd,
4092   0xb5,0xd7,0x86,0x54,0x70,0xf4,0x3a,0x26,0x7a,0x27,0x98,0x06,0xc8,0xa2,0x13,0xa9,
4093   0x4e,0x9a,0x20,0xc3,0x00,0x43,0x34,0x08,0xd2,0xd0,0xc1,0x2b,0xb7,0x77,0x3b,0xe2,
4094   0xa4,0x6a,0x18,0xdf,0x8d,0xde,0xca,0xd7,0x66,0x07,0xc6,0x7e,0x23,0x19,0x81,0x87,
4095   0xb7,0x47,0x6c,0xa8,0x17,0xc7,0xfe,0x93,0x37,0xcb,0xa9,0xfd,0x0b,0x88,0xe3,0x9a,
4096   0x87,0x31,0x1e,0x1d,0x9e,0xfc,0xcf,0x3c,0x46,0x4c,0x9d,0xa0,0x68,0x7d,0xab,0xd4,
4097   0xc0,0xea,0x53,0x22,0x7e,0x3c,0xd2,0x91,0xf9,0x06,0x82,0x53,0xcd,0xfe,0x06,0x5e,
4098   0x2d,0x98,0x10,0xa4,0x4e,0x47,0x55,0x19,0x64,0x80,0x89,0xb3,0xa2,0xb7,0x5f,0x64,
4099   0x3e,0x60,0x8d,0x22,0x6a,0xef,0xc5,0xdf,0x5b,0xd7,0xbc,0x90,0x45,0x8e,0x26,0x28,
4100   0x5c,0x86,0xb7,0x9d,0xd4,0x34,0x22,0xe1,0xe0,0x0b,0x1c,0xe9,0xb5,0x81,0x59,0xa9,
4101   0x87,0x08,0x8d,0x15,0x8a,0x15,0x6c,0x20,0xf2,0x1c,0xaa,0xc0,0xf2,0x91,0xfa,0xe7,
4102   0xbf,0xe8,0x11,0x8a,0x8e,0x94,0xa3,0x9d,0x90,0x0a,0x64,0x13,0xfc,0xbe,0x08,0xe2,
4103   0x05,0x24,0x42,0xfc,0xde,0xb0,0xc7,0x56,0xbc,0xd5,0x4b,0xe4,0xd3,0x09,0x82,0x9a,
4104   0x57,0xbe,0x20,0x6b,0x7b,0x69,0xd8,0x4d,0x75,0x7d,0x60,0x32,0x77,0x70,0x6a,0x0f,
4105   0xb6,0xb4,0xab,0xd7,0x66,0xbe,0xd6,0x80,0xba,0x02,0xa1,0xfc,0xe8,0xf4,0xbe,0x22,
4106   0x08,0xe2,0x2c,0xd9,0xd7,0x41,0x94,0x84,0xcb,0xf6,0x38,0x39,0xe5,0x3f,0x2d,0x4b,
4107   0xba,0xef,0x86,0x0e,0xdd,0xdb,0x58,0xd7,0xe2,0xd6,0xb5,0xf9,0x5d,0xb4,0xb4,0xc8,
4108   0xe3,0x49,0x66,0x99,0x07,0x6a,0xe1,0xbf,0x5d,0xea,0x38,0x8e,0x7a,0x9d,0x7f,0x5b,
4109   0xf1,0x58,0xcb,0x78,0x56,0xee,0x2e,0x3b,0x3e,0x33,0xbf,0xf8,0x3c,0xfc,0x8f,0x02,
4110   0xe4,0x1c,0xb4,0xad,0xcb,0x67,0x41,0x4d,0x83,0xb2,0x4b,0x37,0xa3,0xd0,0xe5,0xbe,
4111   0xbc,0x95,0x23,0x36,0x64,0xd5,0x19,0xf4,0x2e,0x65,0xdc,0x4b,0xae,0x18,0x7f,0x8f,
4112   0x79,0xc3,0x16,0x15,0x22,0x38,0xb6,0x30,0x3d,0x4d,0x72,0x34,0x5f,0xd6,0x5e,0x75,
4113   0x1b,0xa5,0x8f,0x48,0x05,0x90,0x18,0x00,0xb2,0x6b,0x0d,0xf2,0xb5,0x08,0x83,0x71,
4114   0xa2,0x3d,0x8d,0xd1,0x0e,0xdd,0x3f,0x66,0x8b,0xbd,0xad,0x85,0xb0,0xb0,0xec,0x81,
4115   0x0e,0x8a,0x0f,0xae,0x3b,0x20,0x2b,0x61,0xca,0x44,0x53,0xed,0x4f,0xcc,0x9b,0xa6,
4116   0x5f,0x8c,0x17,0xe1,0x8d,0x57,0xdc,0xf0,0x6d,0x01,0xfd,0x2a,0x94,0x5e,0x8e,0xe0,
4117   0x95,0x43,0xa4,0x68,0x04,0x83,0x52,0x15,0x76,0xf2,0xac,0x3c,0x7e,0x65,0xc6,0x2f,
4118   0xb0,0xaf,0xb5,0x44,0xa1,0xa4,0x8d,0xcf,0xe4,0x18,0x60,0x23,0x0d,0xe0,0x44,0x94,
4119   0xb0,0xcf,0x4c,0x76,0x62,0xba,0x8c,0x1e,0xb6,0x74,0x19,0xdf,0x13,0x80,0x62,0xbe,
4120   0xe5,0xc5,0x3a,0x5c,0xd1,0x1a,0xe8,0x65,0x8c,0x73,0x9e,0x4c,0xca,0xc4,0x91,0x84,
4121   0x3f,0x01,0xf5,0x82,0x9f,0x1e,0xfd,0xba,0x9e,0x0e,0xdf,0xa0,0xef,0xc6,0xcd,0xa8,
4122   0x47,0x3a,0xfc,0x45,0x5a,0x5e,0xa0,0xec,0xdc,0x26,0xed,0x11,0x81,0x85,0x16,0x28,
4123   0xfc,0x70,0x51,0xa5,0x02,0xdb,0xd0,0xfb,0x47,0xba,0xc8,0x9f,0x7f,0x01,0x6c,0x06,
4124   0x5e,0xa3,0xf2,0xa1,0x97,0x96,0x8c,0xe7,0xe0,0xcc,0x70,0x4b,0xeb,0x3a,0xd0,0x79,
4125   0x6d,0xbd,0x98,0xf3,0x57,0xb5,0x2f,0xee,0xf1,0xd9,0xbf,0x00,0x0d,0x3e,0xd7,0x28,
4126   0x01,0x1c,0x72,0x88,0xc2,0xad,0x56,0x97,0x66,0x26,0xf8,0x09,0xe3,0xbd,0xcc,0x91,
4127   0x2b,0xa4,0x46,0xe4,0x33,0x87,0x7e,0xc2,0x96,0xb2,0x13,0xc9,0xcd,0xca,0xf1,0xc8,
4128   0xf9,0x24,0xae,0x92,0x2c,0x13,0xde,0xfb,0x7c,0xeb,0x13,0xd7,0xfd,0x01,0xe3,0xfb,
4129   0xc1,0xa7,0xe2,0x3a,0xde,0x34,0xa2,0x68,0x68,0xf9,0xb9,0x5a,0x71,0x4c,0xba,0xe2,
4130   0x0f,0x80,0x3a,0xd7,0x55,0xe9,0xcc,0x0a,0x58,0xdc,0x04,0x51,0x2b,0xac,0xf6,0xb5,
4131   0xc8,0xb7,0x97,0x5a,0x21,0x87,0xf6,0xf3,0x73,0x25,0xc8,0x74,0xf2,0x05,0xc0,0xd0,
4132   0xd1,0x9b,0x94,0xfd,0x46,0x5b,0xf6,0xed,0x83,0xb9,0x9b,0x95,0xbd,0x28,0x37,0xe9,
4133   0x28,0x1d,0x7e,0xdc,0xf7,0x0c,0x23,0x63,0x60,0x69,0xdc,0x73,0x95,0xa7,0x5b,0xfe,
4134   0xcb,0x3c,0x55,0xf8,0x36,0x9a,0x7e,0x57,0x0a,0x36,0x89,0x0d,0x7a,0x84,0x2c,0x10,
4135   0xbc,0xf8,0x19,0x52,0x02,0x05,0x05,0xc8,0x81,0x20,0xa4,0x65,0x6c,0xbd,0xa9,0x1f,
4136   0xf9,0x50,0xca,0xe8,0x5a,0x4d,0xb9,0xb5,0xc5,0x28,0x2b,0x7a,0x6c,0x54,0xd4,0x2b,
4137   0x83,0x46,0x68,0xbc,0x2d,0xfa,0x47,0x75,0x5d,0x1b,0xe2,0xc8,0x9a,0xa7,0x95,0x30,
4138   0x38,0x30,0x33,0xc0,0x8b,0x4c,0x91,0x8d,0xe8,0x8e,0x82,0xaa,0xa2,0x8b,0xda,0x2b,
4139   0x0d,0xd5,0x6d,0x24,0x7e,0x02,0x10,0xaa,0x48,0xa6,0x96,0xd0,0xbf,0x54,0xd4,0xab,
4140   0x38,0xa0,0x9d,0x4d,0x05,0x1e,0xc5,0xcc,0x7d,0x63,0x20,0x3c,0xf1,0x02,0x83,0xaf,
4141   0xb7,0x8f,0xc1,0x3b,0x22,0x9e,0xae,0xf3,0x87,0xc4,0x1f,0xec,0x38,0x95,0xe6,0x39,
4142   0x8b,0xa3,0xda,0xee,0xd4,0x84,0xcc,0x20,0x66,0xcb,0x92,0xe1,0x95,0x0d,0xff,0x47,
4143   0xb5,0xdc,0xe8,0x66,0x1b,0xce,0x20,0x51,0x19,0x77,0x7b,0x1c,0x06,0x6a,0xcd,0xdb,
4144   0x33,0x3b,0xeb,0xa3,0xf6,0x7e,0xa8,0x87,0xa2,0xc8,0xd8,0x9b,0x8c,0xac,0x50,0xf4,
4145   0x07,0xbe,0xe3,0xa5,0x67,0x93,0x65,0xc2,0x00,0xbd,0xab,0x60,0x27,0xd3,0x88,0x91,
4146   0x2f,0x66,0xd0,0x6c,0x6d,0x0c,0x58,0x02,0x33,0x58,0xf2,0x69,0xd7,0xdf,0x75,0xb4,
4147   0xad,0x33,0xb2,0xf7,0x07,0xeb,0x7f,0x47,0x3b,0x98,0xaf,0xb7,0x9d,0xd0,0x16,0x5c,
4148   0x7f,0x26,0x89,0x48,0x37,0x2e,0xdb,0x91,0x18,0x7d,0xe1,0x4b,0x77,0xa6,0x6d,0x88,
4149   0xa7,0x3d,0x55,0x5e,0xfc,0xd7,0x6d,0xe1,0xca,0x07,0x87,0x23,0x66,0x61,0x79,0x3a,
4150   0x23,0x79,0x16,0x39,0x55,0xe4,0x33,0x35,0x51,0x35,0xa3,0xb5,0xb4,0x20,0x9a,0xaa,
4151   0x1b,0x42,0x50,0xa5,0x1d,0x62,0x39,0xd8,0x2c,0x35,0x4b,0x77,0xbd,0x6e,0x79,0xb8,
4152   0x44,0xc3,0xb6,0xcd,0x35,0xe6,0xf7,0xeb,0x03,0x8c,0x30,0x46,0x24,0x69,0x55,0x12,
4153   0x0a,0x31,0x59,0x83,0x2a,0x97,0x32,0xcc,0xf8,0x51,0xd2,0x23,0xe7,0x11,0x2e,0xba,
4154   0x6d,0x8c,0x3a,0xc6,0xfc,0x76,0xe9,0x7a,0x09,0x82,0x31,0x0c,0x08,0x66,0x04,0xae,
4155   0x6c,0xd4,0x57,0x95,0xab,0x81,0x1e,0xf5,0x37,0x21,0x4d,0x02,0x85,0x67,0xd7,0xf0,
4156   0x09,0x09,0xb1,0xf2,0x37,0xb9,0xd0,0x3d,0x82,0x2c,0x25,0x05,0x60,0x16,0xa7,0x7e,
4157   0x43,0x2b,0x49,0xdc,0xa0,0x1e,0xfe,0x52,0xeb,0xa5,0xbb,0x15,0x97,0x72,0x74,0x59,
4158   0x1a,0x3a,0x1d,0x52,0xe6,0xb1,0xaa,0x34,0x70,0x8a,0x0e,0x33,0x2c,0x7b,0x3e,0x82,
4159   0x8d,0x36,0x2f,0x56,0x09,0x70,0xd2,0xe3,0x12,0xdd,0x1e,0x5d,0x1d,0x31,0x06,0xf7,
4160   0x9e,0x1f,0x7d,0xe7,0x09,0x5c,0x78,0x5f,0xd1,0x9d,0xeb,0x94,0x6c,0x93,0xca,0xba,
4161   0x4c,0xf5,0x08,0x04,0xe6,0x76,0x9b,0xa8,0xad,0xc9,0x75,0xd8,0x17,0xa3,0x8b,0xc9,
4162   0x96,0xb8,0xd1,0xaf,0xa0,0xbc,0x3a,0xbe,0xa7,0x63,0xbc,0x29,0x20,0x60,0x49,0x26,
4163   0x7e,0x68,0xd6,0xe7,0x37,0x2f,0x57,0xa1,0xbd,0x69,0xc0,0x87,0x85,0xca,0x04,0xcf,
4164   0x03,0x05,0x18,0xab,0xab,0xd0,0xf0,0x51,0xf0,0xdd,0x80,0xf3,0x48,0xe1,0xbc,0xc5,
4165   0x25,0x8f,0x98,0xfd,0xfc,0x9d,0x07,0xcd,0x4b,0x19,0x51,0x81,0xb9,0x5e,0xfc,0x12,
4166   0xe6,0x50,0x8f,0x19,0x64,0xc0,0x1f,0xe9,0xca,0x84,0xbf,0xd6,0xa9,0x6f,0x83,0x34,
4167   0x97,0x56,0x7f,0x58,0x27,0x0c,0xc8,0x94,0xed,0x65,0x71,0x3f,0x7e,0x35,0x8f,0xaa,
4168   0x6d,0x51,0x34,0x1d,0x13,0x39,0x12,0xdf,0xed,0xe6,0x21,0xf3,0xfe,0x7f,0xa1,0xce,
4169   0xfa,0xf7,0xc6,0xe2,0x94,0x44,0xc3,0xa3,0x81,0x58,0xcd,0x87,0x76,0x28,0x19,0x00,
4170   0x25,0xa8,0xd8,0x84,0x42,0xcb,0x41,0x85,0x83,0x87,0x87,0x77,0x9a,0xce,0xdd,0xd0,
4171   0x3d,0x95,0x78,0x03,0x1e,0xd0,0x8c,0x83,0xf2,0x72,0x4d,0xc5,0x6c,0x71,0xee,0x3d,
4172   0x42,0xbf,0xa5,0x5f,0x26,0x51,0xa4,0x9e,0xcd,0x1b,0x20,0x6f,0xeb,0x11,0x4d,0x47,
4173   0x34,0x27,0x5e,0x98,0x5b,0x50,0x89,0xd6,0x16,0x81,0x00,0x77,0x17,0xae,0xf8,0xed,
4174   0x13,0xcb,0xa5,0xae,0xbe,0xcc,0x3b,0x2c,0xcb,0xa4,0xed,0xdb,0xf0,0x48,0xf1,0x31,
4175   0xdf,0xac,0x79,0xa1,0x4d,0xc4,0xba,0x9e,0xdd,0xb8,0x7c,0x5a,0xd8,0xa0,0x52,0x53,
4176   0x9e,0x8f,0xbd,0xbf,0x03,0x9b,0x11,0x30,0xdb,0xd8,0xa3,0x3c,0xfb,0x58,0xc5,0x77,
4177   0x36,0x31,0xce,0x73,0x60,0x77,0x0f,0xc6,0x4e,0x3c,0xde,0x03,0xd2,0x96,0x8e,0xbf,
4178   0xc3,0x98,0x73,0x8d,0xf2,0x57,0xe2,0x01,0x35,0xe6,0x2e,0xaf,0x5f,0x59,0xab,0x2c,
4179   0x45,0xc4,0xae,0x0b,0xba,0x3c,0x8a,0xe1,0x92,0xd4,0x93,0x4f,0x1e,0x4e,0xb7,0xbe,
4180   0xa6,0xde,0x52,0xbc,0xf2,0x37,0x8c,0xfe,0xf6,0x8d,0xd7,0x35,0xa6,0x14,0xa9,0x18,
4181   0xf6,0x00,0x73,0x5a,0xd9,0x84,0xac,0xae,0x44,0xd6,0xc7,0xc9,0x2b,0x28,0x37,0x5f,
4182   0x82,0xaf,0x71,0x24,0x3c,0x9e,0xe9,0xcc,0x4f,0x2b,0x13,0x0a,0xad,0x88,0x63,0x93,
4183   0x4b,0xea,0x4c,0x1b,0x1d,0x85,0x44,0x56,0x17,0xfa,0x76,0xba,0xf1,0x3a,0x79,0x2a,
4184   0x2b,0x8f,0x6f,0x7b,0x39,0xbb,0x4e,0x9c,0xfc,0xc3,0x93,0xa8,0x30,0x91,0xc2,0x95,
4185   0x09,0x99,0x91,0x55,0xba,0x4f,0xb2,0xde,0x78,0x27,0xda,0x22,0x77,0x94,0xbd,0x15,
4186   0xeb,0x0b,0x0f,0xad,0x08,0x00,0x84,0xdc,0x01,0xe7,0xcf,0x98,0x0c,0x34,0xa5,0xd3,
4187   0x5b,0x5a,0xbb,0x82,0x23,0xcf,0xc2,0x98,0x98,0x05,0x71,0x0b,0xed,0x71,0x7b,0xcd,
4188   0x58,0x86,0x93,0xd3,0x0b,0xba,0x6e,0x11,0x3b,0x7f,0xc0,0x7b,0x1c,0x4a,0x3d,0x04,
4189   0xe1,0x8f,0x98,0xa2,0xc0,0xc2,0x86,0x47,0xeb,0x57,0xbc,0xe8,0x97,0xc1,0xec,0x79,
4190   0xf8,0x75,0xca,0xed,0x42,0xe7,0x0c,0x3a,0xa8,0x8b,0x64,0x52,0x5f,0xd5,0x88,0x2a,
4191   0x9c,0x38,0x2a,0xb6,0x91,0x2a,0xff,0xea,0x72,0x1d,0xba,0xb9,0x75,0x86,0x11,0x19,
4192   0xcc,0xd8,0xb6,0xfc,0xac,0x89,0x5e,0x57,0x49,0x0b,0xbd,0x1d,0xd7,0xd3,0x87,0x44,
4193   0x8a,0x55,0x6f,0xbe,0x95,0x05,0x2b,0x80,0x2e,0x57,0x6d,0x7e,0x87,0xbe,0xea,0xac,
4194   0xd5,0xaf,0x56,0x01,0x39,0x55,0xd6,0x24,0x59,0x18,0x55,0x2b,0xab,0xa8,0x8e,0x2a,
4195   0x81,0x9c,0x57,0x36,0x31,0x85,0x83,0x62,0x0f,0xf9,0xe6,0xc3,0x6d,0x8b,0x55,0x6b,
4196   0xa1,0xcf,0xa3,0x70,0xfe,0x5a,0xa5,0xe6,0xd9,0xbf,0x2d,0xdf,0x85,0x92,0x11,0x71,
4197   0x56,0x68,0x25,0xaf,0xa0,0xd3,0x3b,0xae,0x27,0xee,0xe5,0x46,0x8b,0xb8,0xb0,0x81,
4198   0xb9,0xb1,0xde,0x25,0x25,0x8c,0x65,0x66,0x43,0xff,0x37,0x77,0x87,0xbc,0x49,0x8d,
4199   0x64,0x78,0x8f,0xdc,0x50,0xe7,0xfd,0x98,0xbd,0xbd,0x53,0xc9,0x86,0x03,0x21,0xf2,
4200   0x8f,0xe7,0x8b,0x84,0x1f,0xbd,0xa5,0xd4,0xc9,0x5b,0x84,0x34,0x21,0x94,0x3b,0xfb,
4201   0xbc,0x3c,0xde,0x7a,0x2d,0x27,0x82,0x07,0x08,0x2a,0x39,0xf5,0xe1,0x19,0x1a,0x98,
4202   0x4d,0xc6,0x36,0x45,0xdf,0x07,0xa3,0x4f,0x2c,0xaf,0x74,0x0a,0xc7,0x93,0xbe,0xcb,
4203   0x44,0x86,0x93,0xe5,0x37,0x5c,0x09,0xac,0x35,0xe9,0x34,0x75,0xd1,0x02,0x26,0x93,
4204   0x9f,0x7a,0xf5,0x5a,0x34,0x25,0xb5,0x1e,0x23,0xd8,0x78,0x34,0x00,0x66,0x54,0xef,
4205   0x60,0xa3,0x5d,0xa4,0xd6,0x64,0xa5,0xa6,0xf6,0x7c,0x42,0x49,0x54,0xbf,0x47,0xe1,
4206   0x85,0x02,0xc9,0xc3,0x1c,0x17,0xdb,0x42,0xae,0xd5,0x91,0xb2,0xce,0x0d,0xff,0x68,
4207   0x10,0x95,0x3a,0xb7,0x08,0x50,0xfd,0x9d,0xff,0x93,0xb4,0xf9,0x8a,0x66,0xbf,0xff,
4208   0x5d,0xb0,0x80,0x99,0xde,0x14,0xb9,0xcd,0xa5,0xbd,0x84,0x2f,0x88,0xbe,0x34,0x54,
4209   0x5b,0x2b,0x1e,0xcf,0xf0,0x19,0x94,0x34,0x1d,0x9b,0xed,0x17,0xb5,0xc5,0x7a,0x0d,
4210   0x8d,0xab,0x91,0xa9,0x78,0x62,0x85,0x80,0x4a,0xfd,0xaa,0x25,0xd7,0x91,0x55,0x2c,
4211   0xf4,0x30,0xd9,0x29,0x74,0xf1,0x8a,0xb1,0x2c,0xe5,0xbc,0x57,0xee,0x22,0xc4,0xaf,
4212   0x91,0xbb,0xf6,0x4e,0xe6,0xc4,0xa4,0xc7,0xc3,0x52,0x24,0xae,0xfb,0x78,0xc9,0x98,
4213   0x62,0x4a,0xe7,0x18,0xcc,0xdc,0xd3,0xc2,0x0e,0x43,0xe0,0x2b,0xfc,0x92,0x63,0xe5,
4214   0x68,0xde,0xae,0x87,0x28,0x3a,0x17,0xa2,0x0f,0xba,0xf2,0xcc,0xf2,0x72,0x91,0x98,
4215   0xa4,0x77,0x4a,0x9a,0xf9,0xdc,0x71,0x67,0xc5,0xb6,0x58,0x92,0xdd,0x17,0x55,0xaf,
4216   0x14,0x15,0xbb,0x53,0x3e,0xc4,0xdf,0x11,0x30,0x36,0x14,0x7d,0xbd,0x81,0xae,0x2c,
4217   0xb9,0xb8,0x01,0xb1,0xf9,0xf0,0x62,0xa0,0x50,0x3c,0x24,0x8e,0x92,0xb0,0x9c,0x0d,
4218   0x94,0x61,0x1c,0xb4,0x28,0x61,0xfa,0x14,0x25,0xc6,0x8a,0xc3,0x5c,0xa4,0x1e,0x54,
4219   0xa3,0x0e,0x0c,0x5b,0xcd,0x18,0xa7,0x6d,0xae,0xd6,0x44,0x1d,0x1b,0x5d,0x36,0xff,
4220   0xe7,0xc0,0xd1,0xa8,0xe7,0x13,0x6a,0xab,0xed,0x6b,0x54,0x9c,0xcf,0xdb,0xe3,0x10,
4221   0x60,0x77,0x6b,0x9a,0x75,0x54,0x41,0xce,0xe1,0x84,0xb8,0x41,0x78,0x1e,0x24,0x86,
4222   0x0f,0x33,0xda,0x31,0x79,0xd9,0x2d,0xd6,0x8a,0x23,0x71,0x0a,0x16,0x25,0xfb,0x60,
4223   0xf2,0xf4,0x1e,0x6c,0xf1,0xa3,0x2e,0xc3,0xe8,0x47,0x80,0xf8,0xa9,0xf2,0x67,0xa0,
4224   0x0a,0xba,0x37,0x20,0xc2,0xff,0xab,0xe7,0x71,0xf5,0x5b,0x18,0x7f,0x10,0xc5,0x69,
4225   0xe2,0x83,0x5d,0x8c,0x8c,0x83,0x96,0x36,0x72,0x44,0xe6,0x1b,0x88,0xfa,0xbf,0xef,
4226   0xc1,0xd9,0x96,0x66,0x13,0x14,0xdf,0x33,0x70,0xe1,0x0d,0x0c,0xcd,0x72,0x96,0xa3,
4227   0x1e,0xfc,0xec,0xac,0x57,0xb3,0x84,0xdd,0x6b,0xca,0xd2,0xe9,0x50,0x77,0x4a,0x83,
4228   0xf8,0xec,0x5f,0x60,0x58,0x5e,0x87,0x34,0x63,0x01,0x34,0xb3,0x0f,0x08,0xdb,0x90,
4229   0x4e,0xa9,0xf0,0x81,0x16,0x16,0xe6,0x38,0x59,0x84,0x33,0x6a,0x0b,0x27,0x49,0xca,
4230   0x22,0x33,0x9d,0x0e,0x90,0xdb,0xa3,0xe8,0x4b,0x54,0xce,0x0e,0x45,0xd3,0x94,0x32,
4231   0x73,0x8a,0x67,0x09,0xc8,0xad,0xbc,0x46,0x3a,0x72,0x07,0x9f,0xbb,0x0b,0xbc,0xc6,
4232   0xa0,0xf3,0x87,0xc0,0xe2,0xea,0x59,0x05,0xe8,0xf3,0xda,0xe6,0xc7,0x61,0x9c,0x36,
4233   0x93,0x89,0x35,0xca,0x5e,0xbd,0x38,0x75,0x3e,0x53,0x3a,0x0b,0x46,0x9f,0xce,0x61,
4234   0x8b,0xf4,0x88,0x4a,0x20,0xa6,0xfc,0x9a,0x19,0x09,0xbf,0x25,0x8a,0x72,0x64,0xc0,
4235   0x88,0x34,0x80,0x3e,0x26,0xa3,0xa5,0x74,0x78,0x13,0x69,0x34,0x93,0xd9,0x60,0x54,
4236   0x8a,0x48,0x1c,0xa8,0x71,0xb5,0x33,0x03,0x5d,0x73,0x39,0x39,0x61,0xd6,0xc0,0x1e,
4237   0x91,0x32,0x5e,0x86,0x02,0xdc,0xa6,0x46,0xc7,0x27,0x2d,0x32,0xf4,0x68,0x86,0x1c,
4238   0x9d,0xf1,0x45,0xda,0xd7,0x18,0xfe,0x3f,0xb5,0x31,0x46,0x20,0x4c,0x8e,0xb0,0x4f,
4239   0xaf,0x85,0xd1,0xa3,0xf2,0x6a,0x3c,0xed,0x29,0x8f,0x85,0x03,0x69,0x4a,0xbc,0x41,
4240   0xa1,0x9c,0x01,0xf8,0x5a,0xfb,0xfb,0x1b,0x04,0x9f,0x61,0x9d,0xd2,0xfd,0xe6,0x74,
4241   0xfa,0x89,0x3d,0x92,0xae,0xb6,0x1b,0xec,0x23,0xfa,0x34,0x76,0x8d,0xc7,0x3c,0x23,
4242   0x20,0x92,0xe7,0xe9,0x0f,0xcf,0xe8,0xba,0x90,0xf1,0xf4,0x8b,0xd5,0x6e,0xbf,0x50,
4243   0x13,0xb8,0xfd,0xfd,0x7d,0x44,0x62,0x85,0x49,0x86,0xa1,0xdd,0xa9,0xf2,0x70,0xfa,
4244   0xd3,0xfb,0x81,0xcd,0xf9,0x17,0x89,0x4d,0x4f,0xb8,0x3b,0x6d,0x0b,0x53,0x4d,0x20,
4245   0x60,0x5b,0x71,0x5b,0x81,0x46,0x5c,0x12,0xa3,0x86,0xc2,0x39,0xfa,0x91,0x57,0xc4,
4246   0xb9,0xd9,0xcf,0xa6,0x16,0xd3,0xdd,0xd4,0x43,0xf2,0x37,0x42,0x75,0xac,0x8f,0xe4,
4247   0xe0,0x73,0x99,0xae,0xb8,0xbc,0x0b,0x94,0x31,0xfb,0x98,0x89,0x7e,0xa4,0xf3,0x82,
4248   0xd4,0x2a,0xd1,0x73,0x67,0x03,0xe6,0x50,0x6b,0xa1,0xe6,0x0c,0x14,0x79,0x84,0x9d,
4249   0x95,0xfe,0x76,0xf5,0x24,0xa6,0x6e,0x09,0x83,0xe6,0x85,0xdd,0xa2,0x8e,0x2e,0xb5,
4250   0xcb,0x5c,0x6b,0xde,0x51,0xe5,0x0f,0x6b,0x88,0xbc,0xef,0x71,0xc5,0x75,0xdd,0x02,
4251   0x5b,0xa4,0xb0,0x34,0x9e,0xde,0x39,0x1b,0xe3,0x5e,0x04,0x23,0x26,0x46,0xda,0xa6,
4252   0x29,0xf1,0xe8,0xa6,0xbf,0x13,0x22,0x57,0x5a,0x60,0x7c,0xec,0x6f,0x8b,0xe9,0x9b,
4253   0x71,0x4a,0x5e,0x96,0xd6,0x4f,0xcf,0x12,0x10,0x4f,0x30,0x43,0x95,0xfe,0x75,0x5d,
4254   0xd7,0x0f,0x91,0x93,0x4a,0x38,0x79,0x1b,0x64,0x2b,0x21,0x27,0x98,0x9d,0x7d,0xec,
4255   0x59,0x42,0x81,0xa5,0xb4,0xf2,0x0b,0x9f,0x11,0x5c,0xdf,0x2d,0xe0,0x65,0xcf,0xa6,
4256   0xb6,0xe1,0xef,0x5b,0x26,0xa5,0x54,0xa2,0xc4,0x84,0x11,0xce,0x25,0x52,0x3a,0x34,
4257   0xdc,0xe4,0xe4,0x26,0x7d,0x0d,0x22,0xfa,0x9c,0xa1,0x08,0x04,0xce,0x75,0xaa,0x97,
4258   0xa6,0x5c,0x1d,0x07,0xb9,0x2a,0x74,0xa8,0x9a,0xb3,0xc4,0xcf,0xdd,0xcc,0x1f,0xcf,
4259   0x16,0x48,0x9b,0xfc,0xda,0xfc,0x4c,0xaa,0xbc,0xba,0x45,0x2e,0x50,0x58,0x9a,0xdb,
4260   0x2b,0xaa,0x5f,0x06,0xe0,0x82,0xa9,0x02,0x03,0xb6,0x8a,0x23,0x29,0x1a,0x19,0xbd,
4261   0xe5,0x80,0x67,0x25,0xcb,0xbe,0x8a,0xae,0x6f,0xa8,0x95,0xad,0x66,0x10,0x9d,0x15,
4262   0x90,0xbc,0x51,0x02,0xd2,0x5e,0x32,0x16,0x5f,0x65,0xcb,0x09,0x3b,0x26,0x00,0x47,
4263   0x8d,0x47,0xa3,0x50,0x55,0xdc,0x06,0xb7,0x69,0xfa,0x7f,0x10,0x9c,0xb4,0x61,0xf0,
4264   0xc2,0x1e,0x01,0xea,0xb0,0x4d,0xb2,0x92,0x39,0x54,0xc8,0x7d,0x31,0x47,0x97,0x3e,
4265   0x6d,0x3b,0x74,0x69,0xc0,0x43,0xb2,0x93,0xfe,0x73,0xa5,0x4e,0xfb,0xdf,0xa2,0x31,
4266   0x8c,0x9c,0xfc,0xcd,0x84,0xbd,0x08,0xb8,0xb8,0x57,0x18,0x85,0xfb,0x7d,0x82,0xc8,
4267   0x21,0x43,0x99,0x16,0xfe,0xbd,0xb2,0x02,0x67,0x00,0x20,0x20,0x2f,0x1f,0x37,0x05,
4268   0x2a,0x2e,0x4c,0x44,0x2d,0x42,0xb1,0x71,0x0b,0x6e,0xbd,0x21,0x98,0xc6,0xc1,0xe7,
4269   0xa9,0x5e,0x13,0x57,0x11,0x4b,0x06,0x06,0xa4,0xa1,0xee,0x86,0x37,0x72,0x20,0x6e,
4270   0x9d,0xd4,0xef,0x4f,0xaa,0xda,0xaf,0xbf,0x32,0x98,0xb5,0x51,0x0a,0x23,0x54,0x99,
4271   0x05,0x8e,0xe0,0x2c,0xf8,0xee,0xae,0x9d,0xb5,0x55,0x11,0x81,0x12,0xd9,0x5d,0x6a,
4272   0xe3,0x8e,0xe6,0xee,0xfa,0x86,0x01,0xa0,0x2d,0xd7,0x01,0x15,0x50,0x94,0x3b,0xe0,
4273   0x35,0xd2,0x02,0x95,0xb2,0xa4,0xaa,0xc9,0x9b,0x1e,0x87,0x0f,0xc2,0x55,0xee,0xfb,
4274   0xfd,0x5b,0x32,0x21,0x1f,0x47,0xa7,0x16,0xfd,0x2a,0xa2,0x6d,0x69,0x1a,0x50,0x9f,
4275   0x48,0x13,0xc4,0x6c,0xb9,0x47,0xee,0x13,0xf9,0x0f,0x41,0x49,0xfd,0xa0,0x33,0xc2,
4276   0xb9,0x2e,0x36,0x32,0x21,0xed,0xbf,0x4d,0x28,0x11,0x42,0xc7,0xc4,0xcd,0x33,0x53,
4277   0xe7,0x56,0x06,0xa6,0x86,0xe1,0x2e,0x74,0x95,0x9f,0x20,0x71,0x07,0xc7,0x50,0x50,
4278   0xd2,0x8c,0x32,0xc7,0xe8,0x21,0x3a,0x88,0x3e,0xbb,0xdb,0x48,0xc8,0x8e,0x8b,0xbb,
4279   0x7a,0xce,0xbc,0x95,0x47,0xae,0xe3,0x89,0x24,0x64,0x73,0x4c,0x06,0x22,0xe2,0x93,
4280   0xdf,0x1d,0xa2,0x10,0xa3,0x89,0x28,0x77,0x48,0x99,0xe8,0x7e,0xc0,0x83,0x56,0xd7,
4281   0x00,0x79,0xe6,0x37,0xfc,0xb0,0x0b,0x52,0xa8,0x5c,0x3a,0xdc,0xf8,0xb1,0xe7,0x89,
4282   0xdf,0xe2,0x86,0x0c,0x53,0x25,0x8b,0x1a,0x46,0xac,0x69,0x67,0xac,0xac,0x96,0xa7,
4283   0x7b,0x58,0x84,0x8e,0xa6,0xe6,0xa8,0xcf,0x20,0x88,0x75,0x20,0xde,0x74,0x61,0x33,
4284   0xd4,0xdc,0xde,0xbd,0xf6,0xf4,0x61,0x71,0x37,0xf2,0x5e,0x05,0x8d,0x09,0x49,0x2b,
4285   0xea,0x6c,0x96,0x99,0x43,0x50,0xb8,0x01,0x8c,0xe9,0x24,0x17,0xb8,0x6a,0x4e,0x91,
4286   0xbd,0x09,0xaa,0x21,0x8d,0xf8,0xac,0x7d,0x1d,0x6c,0xc7,0x57,0x61,0x99,0x71,0x63,
4287   0x4d,0xb3,0x1c,0x57,0xd4,0xee,0x3c,0xe6,0xeb,0x7d,0x47,0xc3,0x87,0x95,0xb0,0xa3,
4288   0x99,0x6a,0xea,0x3a,0x18,0x30,0x6a,0x3c,0xf7,0x1b,0xa4,0x5c,0x29,0x5e,0x0c,0x50,
4289   0xa3,0x2f,0x16,0xca,0x59,0xc0,0x35,0x7f,0x3f,0x45,0xde,0x22,0x49,0xf4,0x85,0x69,
4290   0x6a,0x00,0x9e,0x07,0x97,0x9c,0x9d,0xaf,0xc4,0xfd,0xf5,0x16,0xe5,0x57,0x1b,0xf0,
4291   0xee,0xde,0x84,0xf0,0xd3,0xc5,0xa1,0xcc,0x87,0x42,0xe9,0x36,0xff,0x87,0xcf,0xe3,
4292   0x2f,0xc9,0xc6,0x87,0x0b,0x3c,0x3c,0x89,0x97,0x0a,0x89,0x94,0x4d,0x4c,0x6d,0xa3,
4293   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4294};
4295
4296
4297/* 317-0167 FD1089A */
4298/* 317-0168 FD1089B */
4299static const UINT8 key_0167_0168[0x2000] =
4300{
4301   /* opcodes */
4302   0xf0,0x82,0x27,0x82,0xe5,0x55,0x83,0xd2,0x56,0xd2,0xb9,0x2d,0x02,0xbb,0x8a,0x53,
4303   0xa9,0x5e,0xcf,0x5d,0xb7,0x8b,0x05,0x02,0x0b,0x0d,0xcd,0x27,0xfe,0xfb,0x01,0x65,
4304   0xe8,0x6f,0x77,0x53,0x21,0x7f,0x08,0x8b,0x00,0x43,0x8c,0xa3,0xde,0xd5,0xda,0x34,
4305   0x13,0x4b,0xcb,0xd6,0xf6,0xbe,0x37,0x20,0xe1,0x46,0xf6,0xab,0x2a,0xfa,0xdf,0x0f,
4306   0x2a,0xf4,0xcc,0xe4,0x38,0x4a,0x93,0xc1,0xae,0x14,0x0c,0x3f,0xe2,0x6c,0x11,0xf6,
4307   0x2d,0x68,0x78,0x7e,0xe6,0x21,0x1a,0x6e,0x67,0xaf,0xcf,0x5f,0x06,0x2a,0x6e,0xe9,
4308   0x1b,0xa9,0xd0,0xa4,0x00,0x45,0xcd,0x27,0x0b,0x16,0x3d,0x0b,0x95,0x33,0xf8,0xe8,
4309   0xf6,0xb5,0xd5,0x56,0x86,0xb5,0xad,0xec,0x9c,0x48,0x57,0x43,0x91,0x89,0xad,0xf3,
4310   0xbd,0x8e,0x85,0x94,0x78,0x70,0xb8,0xbd,0x19,0x47,0x1e,0x08,0xf9,0x2a,0x8e,0x0a,
4311   0x70,0x33,0xe1,0x5e,0xd6,0x78,0xef,0x9a,0x82,0x11,0x90,0x58,0xcd,0x18,0x9c,0x2e,
4312   0x0f,0xa3,0xea,0xb4,0x9f,0xcb,0x53,0x84,0xd7,0xa8,0xae,0x34,0x0d,0x52,0xd5,0x5d,
4313   0x9a,0xe0,0x9e,0x96,0xd5,0x6b,0xe2,0x79,0x18,0x0b,0x79,0x9c,0xb9,0xd7,0x3a,0x98,
4314   0x10,0xe8,0xfe,0x04,0x77,0x56,0x9d,0x7a,0x44,0x39,0xef,0x90,0xd1,0xa9,0xcc,0xdf,
4315   0x73,0xbd,0x0b,0xfe,0x85,0x8e,0x85,0x87,0x5d,0x34,0x11,0x10,0x54,0xc6,0x89,0x32,
4316   0xc2,0x5e,0xc3,0x85,0xff,0x12,0x98,0xa0,0x62,0xfa,0xe0,0x1c,0x44,0x30,0x72,0x91,
4317   0xfd,0xca,0x27,0x97,0xe5,0xe1,0xd7,0xc5,0x53,0x8d,0x5a,0xb4,0xa0,0xe6,0x88,0xfc,
4318   0x24,0x03,0x38,0x35,0x36,0xfd,0x43,0xf6,0x30,0xec,0x80,0xd8,0x68,0xe7,0xc9,0x73,
4319   0x37,0x07,0xf4,0x5f,0xf4,0x64,0xda,0x33,0xf9,0x16,0x53,0x88,0x9c,0x35,0x36,0xf6,
4320   0x36,0xd8,0x5d,0x15,0x1e,0x18,0x9d,0x7c,0xad,0x0d,0xd1,0xc4,0x3c,0xce,0xd0,0x85,
4321   0x20,0x75,0x71,0x57,0xb4,0x18,0x8d,0xd1,0x4e,0xcf,0xfc,0x8d,0x47,0xb4,0x95,0x20,
4322   0xf7,0xdd,0x31,0x25,0xb6,0x63,0xa8,0x33,0xdb,0x5e,0xd2,0xe1,0xbf,0xe6,0x86,0xc8,
4323   0xba,0x12,0x9e,0x7f,0x24,0xfb,0xf0,0xa0,0x54,0xb9,0x54,0xc1,0xa3,0x63,0xa4,0x7b,
4324   0x69,0x12,0xb6,0x65,0xfe,0xde,0x63,0x19,0xb9,0xdf,0x83,0x2d,0xf3,0x2d,0xed,0x3a,
4325   0x04,0xdf,0x7a,0xd7,0x43,0x0e,0x02,0x9e,0x0a,0xd2,0x5d,0x25,0xaf,0x42,0x62,0x05,
4326   0x8b,0x78,0xeb,0xd5,0xf5,0x8a,0xce,0x2f,0x47,0x90,0xe3,0xa9,0xd7,0xa4,0x04,0xdc,
4327   0xfd,0xdc,0x07,0x60,0x13,0x51,0xc5,0xcc,0x6f,0x1b,0x16,0xb9,0x6a,0x51,0xd1,0xbf,
4328   0x5c,0x0d,0xcf,0x76,0x9d,0x65,0xe8,0x75,0x84,0x72,0xf4,0x55,0x6a,0x4b,0xca,0xae,
4329   0xa7,0x09,0x44,0x18,0x93,0xc4,0x38,0x2a,0x85,0x94,0x7e,0x7d,0xd6,0x91,0xf0,0xa9,
4330   0xde,0xd2,0x64,0x46,0xf5,0x70,0xb3,0xeb,0x72,0x83,0xb5,0x31,0xae,0x22,0x41,0xb0,
4331   0x01,0x67,0x30,0x00,0xc2,0x68,0x5a,0xb8,0x4b,0x3d,0x97,0x72,0xf2,0x00,0xbe,0xc3,
4332   0x10,0xc7,0xa9,0x46,0xfc,0xab,0x2e,0x91,0x10,0xc4,0x25,0x3e,0xa2,0x29,0x68,0xe3,
4333   0x0b,0xf4,0xcd,0x18,0xa2,0x3b,0x2d,0x77,0xc0,0x17,0x60,0x96,0xbe,0x9f,0x3d,0x0e,
4334   0xf1,0xec,0x9d,0x76,0xb4,0x16,0x58,0x68,0x5d,0x35,0x46,0x7a,0x45,0x61,0x3e,0x45,
4335   0xc4,0xb1,0x1a,0x60,0x32,0x3e,0xb0,0x65,0xe6,0x20,0xd8,0xea,0x39,0x6e,0x6c,0x88,
4336   0x83,0x42,0x42,0xd6,0x1c,0xb2,0x33,0x6e,0x5b,0xd6,0x17,0xe6,0x99,0xc8,0xc5,0xd7,
4337   0x2e,0x9e,0x16,0xd9,0x71,0x71,0xe2,0x83,0xbc,0x59,0x01,0x6e,0x65,0x6d,0x4a,0x32,
4338   0xc5,0xc7,0x97,0x67,0x33,0x7d,0xbe,0xa4,0x09,0xa7,0x97,0x82,0x9d,0x5f,0xfc,0x99,
4339   0x48,0xbb,0xc3,0x81,0x61,0xd4,0xc5,0xd1,0x42,0xc2,0xda,0x22,0x41,0x9d,0xd9,0x0c,
4340   0xb6,0x7c,0x9b,0x27,0xfb,0x78,0xf8,0x0a,0x66,0xa9,0xc8,0x4e,0x50,0x26,0xe3,0x8b,
4341   0x11,0x08,0x20,0x59,0x01,0x68,0x58,0x4f,0x77,0x5b,0x62,0x06,0xcc,0xfc,0x18,0x16,
4342   0x58,0x61,0x50,0x17,0x73,0xa3,0xe3,0xa0,0x74,0xda,0xa9,0x4b,0xb4,0x1d,0x79,0xad,
4343   0x8b,0x86,0x2c,0x61,0x51,0x2b,0x9a,0xfd,0x5d,0x24,0x9b,0x1b,0x08,0x8b,0x07,0x51,
4344   0xaa,0x76,0xb5,0x37,0x9a,0xfe,0x7e,0x67,0x32,0x3b,0x39,0x77,0xc8,0x45,0xc0,0x00,
4345   0xb5,0x33,0xe9,0x99,0x50,0x1e,0x8d,0xdc,0xf3,0x1e,0x84,0x5f,0xf4,0x4a,0xa5,0xbb,
4346   0xab,0xbb,0xc9,0x87,0x72,0x89,0xc8,0x5d,0x9f,0xcc,0x7a,0xd3,0x8c,0x9c,0xb7,0x82,
4347   0x8e,0x10,0x56,0x01,0x00,0x41,0x30,0xea,0x38,0x47,0x1c,0xd3,0x8f,0x39,0xf4,0x55,
4348   0x5d,0x31,0x8e,0x08,0xfa,0x45,0xc3,0x83,0xbd,0x8d,0x6b,0x5f,0xff,0x23,0x5d,0x34,
4349   0x18,0x1d,0x72,0x9a,0x60,0x94,0x82,0x28,0x2e,0xa0,0x65,0x77,0xdb,0x59,0xf3,0x1f,
4350   0xbf,0xd6,0x03,0xb8,0x31,0x30,0x6e,0xd9,0x8b,0x7f,0x0b,0x1b,0x23,0xda,0xb4,0x16,
4351   0x52,0x5a,0x3f,0x62,0x6f,0x17,0x85,0x96,0xd4,0x29,0x5e,0x4b,0xd7,0xa8,0xa1,0x19,
4352   0xd1,0xab,0x28,0x98,0x19,0x4b,0xc8,0x5f,0x08,0xa0,0x5c,0x07,0xf7,0xc1,0xbb,0x28,
4353   0x3b,0xc8,0xbc,0x5a,0x2f,0xcb,0x38,0x34,0x29,0xe2,0x07,0x50,0x82,0x27,0x00,0x43,
4354   0x92,0xb0,0xfc,0xa8,0xb1,0x96,0xd3,0x16,0x36,0xf1,0x5d,0x24,0x7a,0xd9,0x71,0x6b,
4355   0xd5,0x65,0xe9,0x82,0x9f,0xae,0x9b,0x03,0x2f,0xcc,0x5f,0x84,0xde,0xd6,0x0f,0x9e,
4356   0x04,0xe5,0x81,0xe8,0xf9,0x11,0x8e,0xfc,0x14,0x72,0x0e,0x70,0xae,0x20,0xd8,0xdd,
4357   0x1f,0x32,0xc5,0xda,0xbe,0xc1,0xad,0x01,0xe5,0xe5,0x68,0xe8,0xea,0xb5,0xcd,0x28,
4358   0x26,0x4b,0xb6,0x58,0xf0,0xbd,0xf9,0x12,0xa2,0x23,0x6e,0xec,0x92,0x97,0xef,0x7f,
4359   0x18,0x2f,0x52,0x63,0x8e,0x04,0x70,0x2f,0x4a,0x2e,0x21,0x7c,0xa5,0xc4,0x3c,0xe2,
4360   0xf7,0xe0,0x9a,0xf9,0x98,0x98,0x13,0x58,0xdf,0x05,0x7f,0x98,0x25,0x3e,0xb5,0x51,
4361   0xc2,0x5c,0x8f,0x1b,0x0e,0x77,0xe3,0x8d,0x60,0xa7,0x89,0x11,0x04,0x5b,0xcc,0x79,
4362   0xa5,0x2f,0xc9,0xf0,0xa3,0xde,0xce,0xcd,0x16,0x74,0x69,0x15,0x2c,0x53,0x1c,0xba,
4363   0x7b,0x03,0x3d,0x1b,0x05,0x1b,0x26,0x50,0xa2,0x35,0x2d,0x73,0x29,0xe6,0xab,0x9a,
4364   0x74,0xc9,0xf7,0xde,0x59,0x74,0x6b,0x57,0xb0,0x81,0x5d,0x1c,0x53,0x86,0x26,0x47,
4365   0x18,0x1b,0x1d,0xee,0xd8,0xda,0x9b,0x2a,0x6b,0x59,0xf9,0x12,0xa8,0x31,0x8c,0xbf,
4366   0x68,0xf9,0xaf,0x49,0x83,0x4b,0xb8,0xc8,0xd1,0xbd,0x00,0x54,0x29,0xe8,0xdf,0x04,
4367   0x65,0x63,0xad,0xf1,0x5b,0xc8,0xc1,0x33,0xe3,0xad,0x74,0xe1,0xd7,0xab,0x1e,0x15,
4368   0x0d,0x59,0x17,0xe5,0x5e,0x51,0xb6,0x69,0xa2,0x29,0x54,0xbb,0xb0,0x7a,0x49,0xf1,
4369   0x61,0xdc,0xec,0x24,0x8d,0xe6,0x97,0x6c,0x0c,0x31,0xa0,0xe0,0xb5,0x55,0x60,0x9a,
4370   0x62,0xea,0x2e,0xb0,0xe9,0x87,0x64,0x3a,0x22,0xc5,0x58,0x52,0xe7,0x3c,0x63,0x0e,
4371   0x0e,0x84,0xdc,0x87,0x70,0x34,0x1d,0xd5,0xe5,0xe5,0x7c,0x10,0x44,0x2f,0x51,0x4f,
4372   0x66,0xaa,0xf6,0xab,0x23,0xed,0xc1,0x3c,0x53,0x91,0x0b,0x19,0xce,0x2e,0x2c,0x5b,
4373   0x6b,0x5c,0x7c,0x1b,0x03,0xb2,0x52,0x6e,0x6d,0xc9,0x07,0x6f,0x83,0x39,0xf3,0x34,
4374   0x1b,0x9a,0x6e,0xd6,0x0e,0x83,0xcf,0x6d,0x34,0x8e,0x6f,0x10,0x64,0x50,0xa6,0xd9,
4375   0x77,0x64,0xcc,0xde,0x45,0x60,0x38,0x37,0xa6,0xde,0x43,0xfe,0x72,0x74,0x45,0x49,
4376   0x80,0xba,0x95,0x31,0xa9,0x4a,0x8d,0xce,0xc4,0xba,0x83,0x38,0xab,0xa3,0xd0,0x86,
4377   0x34,0x9c,0xcb,0xd1,0x38,0x3f,0xce,0x31,0x8f,0x22,0x2f,0xbd,0x10,0xde,0x46,0x8e,
4378   0x94,0x0a,0x6d,0xbc,0xf3,0xfa,0x5f,0x05,0x16,0x47,0x8f,0xa2,0x25,0xa9,0x63,0xa1,
4379   0x04,0x7b,0xf4,0xdb,0x4d,0x13,0x5a,0x27,0x96,0xca,0xac,0x5f,0x78,0xf8,0x04,0x59,
4380   0x8b,0xf5,0x78,0xee,0x66,0x18,0x20,0xf6,0xa2,0xba,0x16,0x48,0xd7,0x33,0x70,0xbd,
4381   0x9d,0xdb,0x47,0x2d,0x8b,0x09,0xb3,0x70,0x3a,0x16,0xcc,0x5e,0x42,0x5a,0xa9,0xce,
4382   0x3b,0x2c,0x63,0x99,0xbc,0xe6,0x12,0x96,0x5e,0xde,0xcd,0x9f,0xb9,0x6d,0xad,0x8a,
4383   0x65,0xea,0xca,0x30,0xf9,0xaf,0x3c,0x69,0x0e,0x12,0x1b,0x0c,0x3c,0x6c,0x7e,0xf3,
4384   0x1b,0x14,0x7e,0xf3,0x42,0x63,0x33,0xe7,0x4a,0xb2,0xb4,0xa6,0xcb,0x56,0x1b,0x07,
4385   0x5d,0xaa,0x7e,0xe3,0x97,0x04,0xf5,0x12,0x13,0xbd,0x9a,0x6b,0x66,0x2d,0x83,0xc7,
4386   0x2b,0xac,0xc9,0xfe,0xf9,0x91,0x84,0xe8,0x67,0x35,0xcc,0x5c,0x0e,0xf0,0xb8,0x34,
4387   0x85,0x1a,0x61,0x46,0x66,0x0a,0xdf,0x6a,0x47,0x19,0x49,0x7a,0xc1,0x9f,0xb8,0x4c,
4388   0x6b,0xf4,0x44,0xb9,0xdf,0x6f,0x05,0x99,0xb3,0x69,0x13,0xc3,0x80,0x3a,0x85,0x10,
4389   0xdd,0x39,0x74,0x58,0x64,0xc0,0xf8,0x73,0xab,0x25,0x28,0x38,0x4b,0xc1,0x1e,0x81,
4390   0xdb,0xeb,0xf0,0x24,0xf5,0xfd,0xb6,0xf9,0x2f,0x4d,0x8a,0xda,0x22,0x33,0x82,0x9d,
4391   0x66,0x09,0xb7,0x1b,0x92,0x25,0x41,0x2c,0x3f,0xe0,0x37,0xa7,0x05,0x92,0xb3,0x65,
4392   0x7c,0x93,0xcb,0x3e,0x3b,0x3a,0x98,0x0a,0xdb,0xe0,0x31,0xa0,0xf4,0xdd,0xaf,0xda,
4393   0x1e,0x89,0x2a,0x8e,0xf0,0x3b,0xba,0x94,0x03,0x4c,0x77,0xc6,0xef,0x14,0x78,0xfa,
4394   0x4c,0xeb,0xd6,0x09,0xb1,0x28,0xa9,0xcb,0xb7,0x24,0x08,0x17,0xf6,0x37,0x0d,0xc6,
4395   0x06,0xb8,0xce,0xb0,0x7e,0x01,0x63,0xad,0xf8,0x68,0xe6,0x94,0x09,0x46,0x6d,0x3f,
4396   0x4c,0xf2,0x11,0x84,0x57,0xc6,0xea,0x3b,0xc4,0x18,0x0f,0x3e,0x29,0x41,0x9a,0x63,
4397   0x1e,0x98,0xa1,0x83,0x3d,0x76,0x3d,0x76,0x1c,0x34,0x85,0x13,0x54,0x27,0x92,0x33,
4398   0x7c,0xaa,0x7c,0xae,0x2e,0x13,0x5b,0x5c,0x00,0xbb,0x47,0x14,0x8b,0xfa,0x57,0xb0,
4399   0x66,0x28,0xa4,0x06,0x2b,0x9c,0x46,0xee,0x70,0xaf,0x54,0x42,0xce,0xb9,0xe8,0xd8,
4400   0xdc,0x12,0x18,0x89,0x34,0x11,0xfc,0x2d,0x6c,0x0f,0xae,0x9b,0x1d,0x64,0x44,0xac,
4401   0xdf,0x67,0xd7,0x38,0x49,0x72,0x7f,0x17,0xf4,0xdb,0x53,0x20,0x78,0xfb,0x6d,0x2d,
4402   0x6d,0x29,0xe3,0x14,0x6a,0xbf,0xcd,0xad,0x08,0x13,0x45,0xd2,0xdf,0x7e,0x61,0x59,
4403   0x87,0x57,0x3a,0x1b,0x97,0xf8,0xe8,0xf0,0xa8,0xb7,0x83,0xaf,0x52,0xec,0x22,0x31,
4404   0x2d,0xf1,0xde,0x4e,0xd0,0x1c,0xcf,0xde,0xd4,0xc6,0x0c,0xb9,0xd1,0x47,0xae,0xb6,
4405   0x5f,0xf7,0xce,0xae,0x15,0x2d,0x81,0x78,0x8c,0x42,0xe2,0xee,0x5c,0x8e,0x07,0xe6,
4406   0x1d,0x69,0x09,0x39,0x66,0x2a,0x00,0xbf,0xd1,0x2a,0x03,0x4f,0xf3,0xc1,0x2c,0xc2,
4407   0x67,0x47,0x91,0xf0,0xc3,0x13,0x4a,0xb1,0xa1,0x7e,0x71,0xdd,0x97,0xe0,0x1c,0x4b,
4408   0x3d,0x90,0x64,0xd4,0x2d,0xe8,0x61,0x4f,0xfd,0x3e,0x2b,0x96,0x46,0xeb,0xd9,0x7f,
4409   0x9f,0x46,0x84,0xe3,0xa2,0xa9,0x44,0x9a,0xe5,0x6a,0x30,0x7b,0x01,0xe1,0x61,0x5f,
4410   0x8d,0x68,0xef,0x1e,0x23,0x55,0xf2,0x90,0x59,0x02,0x82,0x8d,0xc8,0xc4,0xb6,0xec,
4411   0x07,0xf6,0xa7,0x86,0xb0,0xee,0x6d,0x32,0x59,0x05,0x1f,0xca,0x9b,0x93,0xd7,0x24,
4412   0x0e,0xf0,0xab,0x19,0x49,0x73,0xb3,0x81,0xe5,0x75,0x09,0x33,0x7a,0x4e,0xc3,0x08,
4413   0xa0,0x56,0xfa,0xd8,0xee,0xe4,0xc6,0x7b,0xfd,0x51,0x3f,0xc9,0x65,0xf5,0x7c,0x99,
4414   0xbe,0x27,0x96,0xc4,0x9f,0x41,0xa5,0x21,0xa1,0x99,0xc0,0x8a,0x5c,0x88,0x00,0xd5,
4415   0x68,0x65,0x7d,0xdb,0x5c,0x8a,0x4f,0x74,0xd1,0x4d,0x8e,0x77,0x5f,0x07,0x51,0xbe,
4416   0x9e,0x0f,0xb1,0x1e,0x25,0xbe,0xc6,0x72,0x8d,0x6d,0xa7,0x91,0x6e,0x71,0x6e,0x52,
4417   0x60,0x25,0x31,0x8e,0xfa,0xdf,0x08,0x1d,0xd6,0xf8,0x0d,0xd6,0x89,0xc8,0x56,0x92,
4418   0xae,0xa7,0xfc,0x29,0xdc,0xec,0x17,0x73,0xaa,0xf0,0xbf,0x47,0xb1,0x0b,0x0b,0x7f,
4419   0x88,0x95,0x14,0xf1,0xc9,0xe5,0xf2,0x75,0x0a,0x54,0xbc,0xe5,0xe4,0x3a,0x8b,0x17,
4420   0xee,0xef,0x77,0xe4,0xc2,0xca,0x98,0x24,0xf6,0x24,0x06,0xae,0x23,0x55,0xd8,0x5b,
4421   0xe0,0xb4,0x27,0x03,0xc7,0x9b,0x0b,0x7e,0x6e,0x60,0x9b,0xa3,0x6e,0x5c,0xf1,0x4c,
4422   0x5e,0xe6,0x23,0x4f,0xd8,0x58,0x49,0x84,0x72,0x08,0x7d,0xc5,0xc5,0x4e,0xd5,0xe8,
4423   0x69,0x84,0x6a,0xc6,0xf5,0x00,0x54,0x37,0x02,0x1b,0xaa,0x12,0x28,0x2d,0x86,0x30,
4424   0xff,0x8e,0xfe,0x69,0x1e,0x95,0x2b,0x95,0x1e,0x9b,0x24,0x8b,0x97,0xf8,0x02,0x25,
4425   0x21,0x04,0xdd,0x39,0x53,0x16,0xcd,0x9f,0xc6,0x87,0xea,0x31,0x12,0xaf,0x4b,0xc5,
4426   0xcf,0xe6,0x09,0x34,0x94,0x83,0x3c,0x56,0xfa,0xdf,0xfb,0x02,0x99,0x52,0x60,0x11,
4427   0x09,0x33,0x81,0x5b,0xe1,0xdc,0x76,0xb8,0xbb,0xa3,0x59,0xff,0x2c,0xe1,0x0a,0xcf,
4428   0xed,0x44,0xaf,0x3a,0x21,0x7d,0xc6,0x07,0xd3,0x02,0x29,0xcc,0x5c,0xed,0xae,0x21,
4429   0x13,0x54,0x2e,0xa0,0x51,0x50,0x81,0xdf,0x6f,0xf8,0x7e,0x77,0xc2,0x65,0xfe,0xff,
4430   0xa5,0xaf,0xd9,0x11,0x6e,0xee,0xe7,0x43,0x76,0x3a,0xff,0x2e,0x15,0xaa,0xfb,0x69,
4431   0xa3,0x57,0xb1,0x8e,0x77,0x59,0xf9,0x33,0xea,0xc7,0xad,0xf1,0x54,0xbb,0xa3,0x5f,
4432   0x0d,0x4b,0xb4,0x17,0x6c,0x8f,0xb8,0xaf,0xca,0xa1,0x86,0xc0,0x7f,0x97,0xf7,0xe2,
4433   0xe2,0x8a,0xe3,0xac,0x4d,0x92,0x22,0xb7,0x16,0xc6,0x8b,0x9b,0x96,0xf8,0xf0,0x24,
4434   0x16,0x3f,0x4d,0x1a,0x60,0x38,0x4b,0xce,0x38,0xbd,0x82,0x99,0xb4,0xa4,0x8a,0xd2,
4435   0xed,0xc6,0xfa,0xd3,0xfb,0xfb,0x6b,0xf2,0xf6,0x1a,0x75,0x87,0xf5,0xfc,0xb0,0xec,
4436   0x11,0x79,0xb3,0x77,0x62,0x69,0x17,0x81,0xff,0xa4,0x74,0x62,0x01,0x01,0x62,0x72,
4437   0x81,0x59,0x78,0x08,0x94,0x83,0x4f,0x7d,0x55,0x59,0x7f,0x29,0xda,0xb1,0xa0,0x64,
4438   0x3c,0x64,0x49,0x85,0x93,0x4a,0x14,0xe5,0xf6,0x3a,0x96,0xdc,0x7f,0x0d,0x6a,0xc2,
4439   0x44,0x9b,0x26,0xee,0x5d,0xbc,0x64,0xb9,0xe4,0x48,0xba,0x7b,0xef,0x16,0xc0,0x8b,
4440   0x97,0xff,0x10,0x43,0xf4,0xda,0xf9,0x1e,0x81,0xe9,0x06,0x2c,0xca,0xa2,0xc1,0x37,
4441   0x8e,0x05,0x84,0x57,0xa5,0xa8,0xa5,0xa3,0xe6,0x24,0x7c,0x34,0x2a,0x10,0x63,0x22,
4442   0x49,0x06,0xb0,0x85,0x1b,0x9c,0xbd,0x75,0x78,0x6b,0xdf,0x09,0x37,0x0a,0x71,0x5a,
4443   0x31,0x13,0xc9,0x80,0x3d,0x1c,0x92,0x35,0xbe,0x2e,0xaa,0xef,0x91,0xeb,0xde,0x44,
4444   0x2c,0xce,0x46,0x0c,0x28,0x30,0xfc,0x1e,0x1d,0x69,0x16,0x53,0xa3,0xd1,0xad,0x83,
4445   0x51,0xbf,0xd9,0x86,0xc0,0x8c,0xb2,0x34,0x88,0x90,0x4f,0x64,0x41,0x22,0xc9,0xef,
4446   0x82,0x9c,0x38,0xac,0xe4,0x54,0xb3,0x75,0xff,0xa3,0x53,0x20,0x6b,0xe0,0x30,0x86,
4447   0xbf,0x65,0x62,0x7f,0x94,0x88,0x01,0xe2,0x82,0xa2,0x24,0x89,0x21,0x0a,0xe4,0x49,
4448   0x08,0x19,0x59,0xfd,0xd0,0x28,0x9a,0x7c,0x11,0x8c,0xc1,0x9d,0x63,0xa0,0xe4,0x39,
4449   0x5d,0xba,0x1b,0x28,0x99,0x33,0x80,0x41,0xac,0x63,0x29,0x5d,0x31,0xa2,0x2f,0x54,
4450   0xbf,0x47,0xaa,0xfe,0xed,0xab,0xb2,0x32,0x54,0x26,0x5e,0xca,0x8b,0x10,0xc7,0x9c,
4451   0x2c,0xc0,0x05,0x80,0xcd,0x8f,0x2f,0x50,0x07,0xd5,0x5e,0xe2,0x71,0xea,0xaa,0x0f,
4452   0xa5,0x25,0x2b,0xaf,0x39,0xdf,0xf9,0x99,0xc6,0x70,0x2b,0xa6,0xe3,0x2f,0xda,0xae,
4453   0x2a,0x76,0x1e,0x89,0x31,0x9b,0x0e,0x0e,0x91,0xf7,0xc4,0x17,0xe1,0xe1,0x56,0x7a,
4454   0xbb,0xb3,0xdc,0x0f,0xb5,0xc3,0x70,0xb0,0x68,0x69,0x28,0x33,0x6c,0xff,0x1d,0x71,
4455   0x58,0xdb,0x67,0x42,0xc5,0x56,0x1d,0x7d,0x4b,0xc8,0x59,0xfb,0x82,0x89,0x31,0x94,
4456   0x01,0xf0,0xbe,0x20,0x61,0x56,0x17,0x76,0x3a,0x13,0x55,0x70,0x24,0x7f,0x90,0xe4,
4457   0xb6,0xf1,0xe0,0xaa,0x89,0xc2,0x5d,0x9c,0x35,0x4a,0x1e,0x90,0x52,0xe1,0x3c,0x5f,
4458   0x77,0xde,0xcf,0xe1,0x3d,0x9a,0xee,0xed,0x3c,0x6d,0xb3,0x5c,0x0c,0xae,0x34,0x06,
4459   0x44,0xb7,0x89,0xc3,0x7e,0xde,0xcc,0x6a,0x4f,0x7c,0x13,0xd5,0x52,0xe8,0x77,0xda,
4460   0x1d,0x7c,0x10,0x51,0x4a,0x8e,0xf5,0x14,0x6f,0x77,0xf9,0x24,0x8e,0x07,0xd9,0x03,
4461   0x2c,0x63,0x8c,0xa2,0xaa,0x6b,0xe9,0x9a,0x5d,0x38,0xc9,0x82,0xa0,0xe2,0x04,0xf4,
4462   0xc9,0x81,0x72,0x86,0x31,0x2d,0xea,0xd1,0x30,0xfd,0x46,0x6c,0x1e,0x0a,0x5c,0xf1,
4463   0x52,0x6c,0x04,0xf6,0x25,0x3a,0x18,0x14,0xef,0x8e,0x6e,0xe2,0x08,0x7e,0xdf,0xfa,
4464   0xc7,0x22,0x43,0xf2,0x85,0x94,0x71,0x63,0x9a,0xea,0x42,0xe5,0x5d,0x3d,0x8e,0x0f,
4465   0x28,0xa5,0x2d,0x7a,0x51,0x39,0xf6,0xbe,0x31,0x13,0xc3,0x73,0x1f,0x49,0x6a,0x30,
4466   0x75,0xf3,0xc3,0x8e,0x89,0x2b,0xa8,0x25,0xb4,0x07,0xef,0x8d,0x4d,0xa0,0x71,0x5d,
4467   0xae,0x0e,0x06,0x2e,0x2d,0x69,0x85,0x98,0x22,0xc8,0xc7,0x33,0xe7,0x44,0xa4,0x96,
4468   0xd2,0xf5,0xf4,0x5a,0x3c,0xf2,0x8f,0x17,0x7d,0x54,0x4c,0x65,0xed,0x34,0x04,0xdb,
4469   0xe3,0xa7,0x8e,0x12,0xb8,0xc8,0xc4,0xa2,0xc4,0xad,0x7c,0x23,0x5f,0x6f,0x8f,0x2c,
4470   0xe0,0x26,0xd5,0x57,0xa0,0xe9,0x25,0x39,0xf7,0xd2,0x58,0x6d,0x3d,0xf7,0x46,0x89,
4471   0xc9,0x70,0xc7,0x27,0xf4,0x57,0xb3,0xdd,0x16,0xc2,0xe1,0x43,0x86,0xca,0x2a,0xf3,
4472   0x9e,0x87,0x65,0x83,0xb4,0x11,0x6c,0x8c,0x21,0x7f,0x15,0xa5,0x3c,0xea,0x39,0x68,
4473   0x5f,0x6a,0xb0,0x6b,0xe0,0x16,0x51,0x47,0x17,0x07,0xf5,0x93,0x5e,0x55,0x74,0xe9,
4474   0x0b,0x18,0xa6,0xdf,0x78,0x68,0x63,0x0e,0xfa,0x5c,0x82,0x0d,0xec,0x0d,0xdc,0x76,
4475   0xa4,0x93,0x48,0xdf,0x7b,0x05,0xa0,0xe1,0xc9,0x7d,0xba,0x14,0xe6,0x11,0x6f,0x0f,
4476   0x29,0xd9,0x97,0x6b,0xeb,0xef,0x09,0xc0,0x84,0x69,0x9e,0xa6,0x4c,0x60,0x2e,0xb4,
4477   0x9a,0xec,0x91,0x83,0xc7,0x25,0x9f,0xab,0x2b,0x22,0x2f,0xc4,0x1d,0xfc,0x1a,0x65,
4478   0xf7,0xcb,0x37,0x27,0x0f,0xa6,0x60,0xa2,0xbe,0xa6,0x6b,0x6e,0x5b,0xe3,0x31,0x22,
4479   0x75,0x8a,0x57,0xc3,0x74,0x4d,0xa5,0x3d,0xf7,0x54,0xa4,0x05,0x17,0x74,0xeb,0x74,
4480   0xec,0x88,0x13,0xe3,0x8d,0x67,0xb4,0xa7,0x14,0xe8,0x66,0x1b,0x97,0xe4,0xc0,0x95,
4481   0x2e,0x33,0x5c,0x6e,0xf3,0xac,0xcf,0xfe,0xfc,0x28,0xb4,0x9d,0x62,0x7f,0xa2,0xa2,
4482   0x3d,0x89,0x30,0x66,0xa5,0x1d,0xf7,0x41,0xb1,0x15,0x8e,0x8b,0x7a,0x47,0x8f,0x9b,
4483   0x18,0x8b,0x90,0xca,0xa2,0xbb,0x2a,0x70,0x31,0xad,0xf4,0xe5,0xdd,0x3a,0x88,0x80,
4484   0xbe,0x3a,0x7c,0x9a,0xec,0x84,0x69,0x8b,0x7e,0xf1,0xe6,0xaa,0x8d,0x59,0x8d,0x51,
4485   0x31,0x94,0xf4,0xd6,0x81,0x79,0xb4,0x92,0x97,0xe2,0x64,0xdc,0x89,0xa5,0x9e,0x0e,
4486   0x6f,0x9a,0xf8,0x7e,0x63,0x9b,0x0b,0x84,0x7b,0x7e,0x6f,0x7a,0xd0,0x1c,0xbb,0xb6,
4487   0x7a,0x4d,0x88,0x91,0x90,0xe8,0x6e,0x63,0x2c,0xc6,0x05,0x84,0x64,0xbf,0xe4,0x4b,
4488   0x51,0xab,0xa4,0x11,0x0a,0x61,0xdd,0x2e,0xa8,0xbb,0x27,0xfa,0x43,0x8f,0x19,0xcc,
4489   0xf3,0xb5,0x4c,0xfd,0xd0,0x07,0x58,0xe5,0xf1,0x5b,0xd5,0xdc,0x6f,0x8a,0x5a,0x39,
4490   0x62,0x6c,0x80,0x55,0xe1,0xd8,0xdf,0x88,0x06,0xa7,0x0f,0x29,0xe7,0xb1,0xa7,0x92,
4491   0x9c,0xce,0x41,0x19,0x3f,0xd5,0x72,0x17,0xe6,0xa0,0xd5,0xe3,0xaa,0x05,0x00,0xd7,
4492   0xa3,0xdc,0x8d,0x49,0xe8,0xff,0x12,0x92,0x93,0x44,0x27,0x09,0xba,0x84,0x66,0x07,
4493   0x76,0x97,0x65,0xe5,0xde,0x54,0xbd,0xf8,0x0b,0x94,0x05,0x9b,0x15,0x2f,0xd7,0x24,
4494   0x14,0xfd,0xc9,0xec,0x20,0xd5,0x74,0x4b,0x50,0x91,0x6f,0x99,0xbd,0x07,0x54,0x2d,
4495   0x7f,0x0f,0xb9,0x60,0xad,0x83,0x37,0x8a,0x61,0x39,0x65,0x03,0xb1,0x0a,0xdd,0x22,
4496   0xb5,0xce,0x35,0x87,0x5c,0x06,0xb5,0x3d,0x8d,0xe8,0xd8,0xf0,0x39,0x72,0x03,0xb8,
4497   0x38,0x3d,0x8c,0xac,0x61,0xe1,0xcc,0xe6,0x8e,0xf6,0x1a,0x7c,0x95,0x13,0xd0,0x86,
4498   0x4e,0xd1,0x44,0x1e,0x93,0xc8,0xcf,0x5a,0x3a,0x90,0xc8,0x53,0x1c,0xc0,0x89,0x21,
4499   0x11,0xf1,0x68,0xdc,0xf0,0xbb,0xbd,0x9b,0x92,0xb6,0xe2,0x77,0xcf,0x79,0x2d,0x88,
4500   0x7f,0x9d,0xf7,0xe5,0x7a,0xba,0x98,0xa7,0x97,0x68,0x68,0xe7,0xaf,0x3e,0xbe,0xba,
4501   0x99,0xd5,0xf3,0x3b,0x2f,0xc5,0x5f,0x80,0x47,0xa6,0x5a,0xa2,0xba,0x0f,0x3b,0xb9,
4502   0x60,0x9a,0x5b,0xdc,0x10,0xdc,0x12,0x25,0xa3,0x70,0xb8,0xaa,0xf1,0xec,0xa4,0x83,
4503   0xd2,0xea,0x2f,0xca,0x1e,0x00,0xb1,0x95,0xac,0xc6,0x81,0xfd,0x55,0xd6,0xf9,0x1a,
4504   0xf0,0xc6,0x6f,0x04,0x57,0x2f,0x3c,0xd2,0x60,0xa8,0xb7,0x9d,0xe4,0xcb,0x3a,0x7d,
4505   0xbb,0x2e,0x1b,0x89,0xbc,0x6a,0xb2,0xda,0xc0,0x16,0x59,0x88,0x9f,0xcc,0x66,0xab,
4506   0x31,0x22,0x33,0x5b,0x4e,0xb1,0x15,0xaf,0xcd,0x10,0x67,0xc0,0x87,0xd9,0x7f,0xa6,
4507   0x53,0xa2,0xb6,0x78,0x0b,0x04,0x64,0x50,0x85,0x97,0xe1,0x44,0x9a,0xf2,0x84,0x6c,
4508   0x22,0xae,0xa6,0xe2,0xf4,0x63,0x9f,0xbc,0xe9,0xa9,0xc7,0x13,0xd9,0x17,0x75,0xff,
4509   0x9c,0x46,0x02,0x98,0x0a,0xce,0xc6,0xf5,0xfa,0x47,0x18,0x2f,0x45,0x48,0x52,0x5e,
4510   0xc2,0x6a,0xca,0x99,0x4b,0x45,0xd9,0xf9,0xb6,0x71,0xd6,0x96,0xdc,0x85,0x1b,0x88,
4511   0x95,0x1a,0xfe,0xe7,0xb8,0xc8,0xd8,0xca,0x1f,0x27,0x00,0x4a,0x9f,0xce,0xcf,0x7f,
4512   0x13,0x56,0x9e,0x80,0x52,0x57,0xc2,0x67,0x33,0x69,0x96,0x4a,0x8f,0x23,0x70,0x41,
4513   0x3e,0x1f,0xa9,0x66,0x17,0xf2,0x99,0xcf,0xf3,0x37,0x98,0x95,0xaa,0x85,0xfd,0xd0,
4514   0x14,0x73,0x21,0x98,0x08,0x9a,0x5c,0x04,0x60,0x91,0x06,0x2d,0xf2,0xf2,0x76,0x2b,
4515   0x96,0x53,0x05,0x15,0x26,0x4d,0x0b,0x04,0x78,0x77,0xe0,0x10,0x65,0x6b,0xdb,0x51,
4516   0xc5,0xbf,0x55,0xdf,0x6f,0x0c,0xa6,0xd1,0x3c,0xe9,0x25,0x04,0xf0,0x2c,0x44,0x9f,
4517   0xb7,0x11,0xf4,0xe4,0xd7,0x2d,0x6a,0xad,0xe7,0xd7,0xbc,0xd0,0x81,0x69,0x02,0x25,
4518   0x3b,0x39,0x56,0x86,0xae,0x9f,0xce,0xc9,0x72,0xf5,0x83,0xc7,0x1e,0x91,0x8d,0x58,
4519   0x4b,0xcc,0x03,0x53,0x91,0xfe,0xff,0x91,0x88,0x7f,0x97,0xea,0xc7,0xa6,0xe4,0x36,
4520   0xe7,0xcc,0xfd,0x4c,0x80,0x49,0xfb,0x06,0x2a,0x75,0xf6,0x3a,0x7c,0xa7,0x06,0xc0,
4521   0x0f,0x38,0x43,0x72,0x7b,0x80,0xc4,0x26,0x58,0xd7,0xa2,0xb5,0x3d,0x94,0xf5,0xf7,
4522   0xc3,0x10,0xd4,0xc3,0x82,0xa3,0x59,0xf2,0x12,0xa4,0x9a,0x5c,0x0a,0x6d,0xaf,0xd9,
4523   0x04,0x54,0xb2,0x95,0xb2,0xb9,0x6b,0x58,0xde,0xdd,0x30,0xe3,0x32,0x36,0x67,0xd0,
4524   0x04,0xdb,0xea,0xb5,0xad,0xe6,0x8f,0x2a,0x84,0x6d,0x2f,0xc9,0xe2,0x89,0xa2,0x28,
4525   0x20,0x51,0xbf,0xe0,0x93,0xde,0x5f,0x88,0x96,0x48,0x5a,0xba,0x7f,0xa7,0x88,0x0c,
4526   0xa7,0x13,0xc0,0x17,0x66,0xa3,0xdc,0x72,0x14,0x70,0xb2,0xb7,0x08,0x92,0x1a,0x7c,
4527   0x9b,0x20,0xee,0x5a,0x25,0x34,0x04,0xe8,0xfe,0xe4,0x35,0xc0,0x7d,0x48,0x59,0x78,
4528   0xfb,0x7a,0x47,0xa9,0xd0,0x90,0xd8,0xeb,0x53,0xa3,0xe4,0xd5,0xde,0xcb,0x43,0x00,
4529   0xc7,0x1f,0xcc,0x04,0x67,0xb9,0x59,0x79,0x15,0xaf,0xc0,0xf6,0x2b,0x19,0xd9,0x14,
4530   0xff,0x11,0x7e,0x6b,0xea,0xad,0x85,0x93,0x43,0x06,0xc7,0x23,0x64,0x34,0x1c,0xb4,
4531   0xa3,0x4f,0x5b,0xde,0x58,0x6e,0x5d,0x39,0xdd,0xaa,0xfa,0x5c,0x88,0x1b,0x0a,0xe0,
4532   0xb2,0xd8,0x65,0x5d,0xb3,0xfa,0xe2,0x6b,0xe3,0x9a,0x5a,0xa1,0x99,0xcd,0xa4,0x98,
4533   0x2e,0xae,0x9a,0xe8,0xfa,0x53,0x12,0x29,0x55,0xd5,0xe5,0xf2,0x96,0x4c,0xeb,0xdd,
4534   0x16,0xcf,0xfb,0x7f,0x2d,0x78,0xee,0x73,0x33,0x5d,0x9c,0x4f,0x7f,0x96,0xdd,0xad,
4535   0x6a,0x3d,0x89,0x23,0x4c,0x68,0x77,0x49,0x7c,0x30,0x80,0xb9,0x54,0xad,0x7b,0x09,
4536   0x2a,0xf7,0x42,0xd2,0x57,0x25,0xab,0xab,0x32,0x50,0x8f,0x2e,0x15,0x90,0xc6,0xf1,
4537   0x56,0xfc,0x27,0x8d,0x4d,0xad,0x8b,0x99,0x54,0xbb,0xca,0xaf,0xc1,0x3e,0xbc,0x65,
4538   0xee,0x4e,0x39,0x54,0x30,0x02,0x18,0x13,0xe2,0x73,0x32,0x3c,0x5a,0xb9,0x5e,0x65,
4539   0xf1,0xeb,0x76,0x27,0xff,0x23,0x50,0x1a,0xdc,0x77,0xc5,0xd5,0xdf,0xff,0xad,0xf1,
4540   0x61,0xd5,0xdf,0x06,0xba,0x0f,0x34,0xac,0x42,0xc6,0x84,0x7a,0x50,0x12,0xa7,0x09,
4541   0x3d,0x0b,0x75,0xf1,0x61,0xc8,0xc5,0xca,0x13,0x62,0x70,0x2b,0xad,0xf1,0x4d,0xad,
4542   0x85,0x8c,0x36,0xe8,0xf4,0x4c,0x01,0x74,0x51,0x49,0x87,0xe8,0xf6,0x9b,0xa0,0xdd,
4543   0x39,0x5a,0x23,0xeb,0x73,0x9d,0xea,0xaa,0xfb,0x7d,0xca,0xb1,0x2a,0x12,0x9e,0x99,
4544   0x59,0x73,0x3d,0xfa,0xdd,0xba,0x7e,0x6c,0x11,0xfd,0x3a,0x86,0x4b,0x54,0x49,0xe2,
4545   0xe4,0xd9,0x82,0x15,0x34,0xa2,0xbe,0xba,0x93,0xc8,0xd5,0x68,0x58,0x63,0x9f,0xb6,
4546   0xdc,0x8b,0xf3,0x3d,0x77,0x57,0xab,0x94,0x81,0xe0,0x9d,0x55,0x51,0x3e,0xa1,0x16,
4547   0x88,0x91,0x70,0xa6,0xd7,0x43,0xfa,0xdb,0x43,0x90,0x4e,0x36,0xe4,0x50,0x02,0x10,
4548   0xd2,0x5a,0xaf,0xc1,0x24,0x87,0xec,0xa0,0xf3,0xaf,0x53,0x07,0x57,0xaa,0x7a,0x4c,
4549   0x67,0x4f,0xfa,0xc8,0x3d,0x78,0x6a,0xd2,0xef,0xfb,0x64,0xc4,0x95,0xb0,0x7e,0xf4,
4550   0x49,0x71,0x51,0xba,0x21,0x14,0x75,0x70,0x36,0x72,0x81,0x6c,0xa0,0x63,0x0e,0x07,
4551   0x76,0xbe,0xb4,0x99,0xd2,0x5c,0x0b,0x7a,0xca,0x15,0xaa,0x01,0x77,0xc1,0x2a,0x87,
4552   0xf0,0x37,0x23,0x64,0x4e,0x51,0x2d,0xf0,0xa9,0xe5,0xdf,0x82,0x19,0xcb,0xd2,0x73,
4553   0xb6,0xdd,0x9e,0x1b,0x97,0xf1,0xdb,0xd2,0xd5,0xe0,0x20,0xef,0x88,0x82,0x06,0xcb,
4554   0xc7,0xae,0x25,0xbe,0xac,0x3d,0x15,0x1f,0x4d,0x07,0x6d,0x48,0xc2,0xe4,0xc7,0x8f,
4555   0x25,0xab,0xb8,0x4d,0x8c,0x36,0xdb,0xd9,0x10,0x5b,0xc6,0x8d,0xc9,0xf2,0x13,0xbf,
4556   0xce,0xd5,0x58,0xc8,0x39,0xda,0x2d,0xff,0x20,0xda,0x2c,0xbd,0x9c,0xad,0xeb,0x5b,
4557   0xc4,0x2a,0x03,0x2e,0xb1,0x2a,0x0b,0x91,0x7b,0x85,0x9d,0xda,0x3a,0x13,0x4f,0x62,
4558
4559   /* data */
4560   0xa1,0x15,0x88,0x14,0x04,0xd3,0x2c,0xeb,0x19,0xf3,0xe3,0x85,0xa2,0x37,0x6e,0xa2,
4561   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4562   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4563   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4564   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4565   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4566   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4567   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4568   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4569   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4570   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4571   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4572   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4573   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4574   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4575   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4576   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4577   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4578   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4579   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4580   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4581   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4582   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4583   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4584   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4585   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4586   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4587   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4588   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4589   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4590   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4591   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4592   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4593   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4594   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4595   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4596   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4597   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4598   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4599   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4600   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4601   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4602   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4603   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4604   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4605   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4606   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4607   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4608   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4609   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4610   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4611   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4612   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4613   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4614   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4615   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4616   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4617   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4618   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4619   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4620   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4621   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4622   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4623   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4624   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4625   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4626   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4627   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4628   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4629   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4630   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4631   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4632   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4633   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4634   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4635   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4636   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4637   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4638   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4639   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4640   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4641   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4642   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4643   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4644   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4645   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4646   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4647   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4648   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4649   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4650   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4651   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4652   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4653   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4654   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4655   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4656   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4657   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4658   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4659   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4660   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4661   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4662   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4663   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4664   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4665   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4666   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4667   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4668   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4669   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4670   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4671   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4672   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4673   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4674   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4675   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4676   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4677   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4678   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4679   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4680   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4681   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4682   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4683   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4684   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4685   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4686   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4687   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4688   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4689   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4690   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4691   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4692   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4693   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4694   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4695   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4696   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4697   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4698   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4699   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4700   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4701   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4702   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4703   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4704   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4705   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4706   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4707   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4708   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4709   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4710   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4711   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4712   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4713   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4714   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4715   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4716   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4717   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4718   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4719   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4720   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4721   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4722   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4723   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4724   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4725   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4726   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4727   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4728   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4729   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4730   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4731   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4732   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4733   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4734   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4735   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4736   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4737   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4738   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4739   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4740   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4741   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4742   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4743   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4744   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4745   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4746   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4747   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4748   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4749   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4750   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4751   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4752   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4753   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4754   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4755   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4756   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4757   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4758   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4759   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4760   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4761   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4762   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4763   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4764   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4765   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4766   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4767   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4768   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4769   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4770   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4771   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4772   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4773   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4774   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4775   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4776   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4777   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4778   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4779   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4780   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4781   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4782   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4783   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4784   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4785   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4786   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4787   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4788   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4789   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4790   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4791   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4792   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4793   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4794   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4795   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4796   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4797   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4798   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4799   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4800   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4801   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4802   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4803   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4804   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4805   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4806   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4807   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4808   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4809   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4810   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4811   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4812   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4813   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4814   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4815   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
4816};
4817
4818
4819/* 317-xxxx FD1089A - Partial table. */
4820static const UINT8 key_wb35[0x2000] =
4821{
4822   /* opcodes */
4823   0xfb,0x47,0x73,0xac,0x3c,0xb8,0x2d,0x57,0xca,0x27,0x49,0x76,0x8f,0x41,0x33,0x36,
4824    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4825    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4826    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4827    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4828    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4829    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4830    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4831    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4832    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4833    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4834    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4835    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4836    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4837    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4838    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4839    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4840    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4841    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4842    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4843    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4844    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4845    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4846    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4847    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4848    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4849    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4850    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4851    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4852    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4853    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4854    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4855    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4856    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4857    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4858    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4859    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4860    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4861    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4862    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4863    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4864    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4865    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4866    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4867    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4868    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4869    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4870    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4871    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4872    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4873    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4874    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4875    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4876    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4877    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4878    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4879    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4880    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4881    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4882    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4883    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4884    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4885    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4886    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4887    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4888    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4889    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4890    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4891    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4892    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4893    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4894    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4895    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4896    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4897    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4898    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4899    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4900    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4901    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4902    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4903    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4904    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4905    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4906    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4907    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4908    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4909    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4910    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4911    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4912    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4913    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4914    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4915    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4916    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4917    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4918    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4919    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4920    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4921    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4922    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4923    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4924    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4925    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4926    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4927    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4928    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4929    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4930    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4931    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4932    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4933    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4934    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4935    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4936    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4937    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4938    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4939    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4940    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4941    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4942    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4943    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4944    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4945    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4946    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4947    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4948    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4949    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4950    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4951    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4952    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4953    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4954    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4955    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4956    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4957    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4958    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4959    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4960    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4961    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4962    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4963    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4964    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4965    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4966    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4967    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4968    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4969    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4970    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4971    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4972    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4973    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4974    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4975    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4976    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4977    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4978    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4979    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4980    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4981    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4982    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4983    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4984    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4985    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4986    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4987    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4988    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4989    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4990    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4991    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4992    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4993    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4994    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4995    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4996    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4997    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4998    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4999    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5000    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5001    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5002    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5003    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5004    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5005    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5006    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5007    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5008    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5009    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5010    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5011    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5012    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5013    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5014    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5015    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5016    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5017    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5018    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5019    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5020    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5021    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5022    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5023    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5024    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5025    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5026    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5027    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5028    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5029    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5030    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5031    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5032    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5033    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5034    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5035    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5036    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5037    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5038    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5039    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5040    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5041    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5042    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5043    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5044    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5045    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5046    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5047    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5048    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5049    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5050    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5051    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5052    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5053    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5054    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5055    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5056    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5057    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5058    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5059    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5060    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5061    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5062    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5063    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5064    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5065    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5066    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5067    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5068    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5069    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5070    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5071    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5072    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5073    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5074    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5075    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5076    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5077    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5078    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5079
5080   /* data */
5081   0x27,0x14,0xca,0xad,0x76,0xe2,0x5f,0xbe,0xe5,0x7a,0x9a,0x80,0x3e,0x69,0xc5,0xfe,
5082   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
5083    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5084    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5085    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5086    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5087    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5088    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5089    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5090    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5091    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5092    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5093    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5094    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5095    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5096    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5097    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5098    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5099    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5100    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5101    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5102    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5103    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5104    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5105    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5106    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5107    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5108    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5109    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5110    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5111    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5112    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5113    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5114    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5115    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5116    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5117    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5118    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5119    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5120    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5121    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5122    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5123    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5124    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5125    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5126    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5127    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5128    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5129    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5130    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5131    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5132    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5133    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5134    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5135    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5136    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5137    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5138    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5139    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5140    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5141    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5142    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5143    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5144    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5145    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5146    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5147    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5148    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5149    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5150    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5151    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5152    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5153    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5154    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5155    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5156    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5157    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5158    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5159    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5160    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5161    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5162    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5163    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5164    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5165    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5166    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5167    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5168    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5169    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5170    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5171    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5172    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5173    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5174    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5175    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5176    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5177    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5178    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5179    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5180    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5181    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5182    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5183    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5184    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5185    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5186    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5187    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5188    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5189    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5190    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5191    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5192    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5193    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5194    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5195    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5196    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5197    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5198    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5199    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5200    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5201    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5202    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5203    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5204    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5205    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5206    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5207    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5208    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5209    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5210    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5211    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5212    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5213    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5214    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5215    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5216    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5217    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5218    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5219    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5220    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5221    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5222    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5223    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5224    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5225    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5226    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5227    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5228    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5229    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5230    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5231    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5232    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5233    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5234    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5235    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5236    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5237    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5238    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5239    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5240    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5241    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5242    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5243    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5244    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5245    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5246    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5247    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5248    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5249    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5250    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5251    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5252    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5253    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5254    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5255    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5256    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5257    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5258    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5259    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5260    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5261    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5262    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5263    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5264    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5265    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5266    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5267    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5268    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5269    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5270    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5271    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5272    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5273    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5274    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5275    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5276    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5277    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5278    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5279    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5280    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5281    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5282    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5283    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5284    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5285    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5286    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5287    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5288    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5289    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5290    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5291    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5292    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5293    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5294    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5295    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5296    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5297    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5298    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5299    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5300    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5301    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5302    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5303    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5304    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5305    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5306    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5307    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5308    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5309    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5310    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5311    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5312    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5313    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5314    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5315    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5316    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5317    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5318    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5319    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5320    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5321    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5322    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5323    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5324    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5325    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5326    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5327    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5328    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5329    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5330    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5331    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5332    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5333    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5334    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5335    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5336    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5337};
5338
5339
5340/* 317-5021 FD1089B */
5341static const UINT8 key_5021[0x2000] =
5342{
5343   /* opcodes */
5344   0x43,0xa7,0x19,0x37,0x03,0x91,0xb8,0xc5,0x23,0x15,0x5d,0xf3,0xb0,0x00,0x95,0x0f,
5345    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5346    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5347    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5348    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5349    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5350    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5351    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5352    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5353    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5354    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5355    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5356    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5357    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5358    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5359    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5360    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5361    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5362    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5363    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5364    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5365    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5366    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5367    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5368    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5369    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5370    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5371    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5372    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5373    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5374    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5375    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5376    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5377    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5378    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5379    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5380    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5381    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5382    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5383    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5384    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5385    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5386    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5387    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5388    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5389    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5390    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5391    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5392    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5393    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5394    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5395    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5396    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5397    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5398    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5399    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5400    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5401    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5402    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5403    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5404    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5405    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5406    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5407    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5408    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5409    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5410    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5411    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5412    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5413    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5414    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5415    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5416    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5417    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5418    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5419    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5420    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5421    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5422    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5423    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5424    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5425    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5426    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5427    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5428    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5429    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5430    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5431    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5432    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5433    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5434    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5435    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5436    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5437    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5438    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5439    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5440    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5441    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5442    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5443    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5444    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5445    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5446    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5447    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5448    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5449    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5450    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5451    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5452    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5453    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5454    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5455    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5456    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5457    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5458    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5459    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5460    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5461    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5462    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5463    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5464    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5465    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5466    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5467    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5468    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5469    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5470    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5471    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5472    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5473    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5474    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5475    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5476    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5477    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5478    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5479    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5480    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5481    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5482    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5483    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5484    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5485    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5486    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5487    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5488    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5489    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5490    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5491    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5492    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5493    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5494    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5495    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5496    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5497    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5498    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5499    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5500    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5501    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5502    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5503    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5504    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5505    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5506    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5507    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5508    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5509    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5510    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5511    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5512    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5513    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5514    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5515    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5516    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5517    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5518    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5519    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5520    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5521    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5522    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5523    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5524    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5525    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5526    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5527    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5528    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5529    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5530    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5531    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5532    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5533    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5534    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5535    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5536    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5537    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5538    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5539    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5540    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5541    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5542    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5543    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5544    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5545    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5546    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5547    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5548    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5549    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5550    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5551    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5552    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5553    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5554    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5555    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5556    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5557    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5558    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5559    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5560    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5561    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5562    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5563    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5564    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5565    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5566    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5567    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5568    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5569    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5570    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5571    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5572    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5573    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5574    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5575    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5576    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5577    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5578    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5579    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5580    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5581    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5582    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5583    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5584    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5585    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5586    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5587    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5588    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5589    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5590    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5591    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5592    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5593    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5594    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5595    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5596    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5597    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5598    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5599    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5600
5601   /* data */
5602   0x37,0x8d,0x00,0xfb,0xc2,0xa5,0x31,0x5b,0xb4,0x98,0x60,0x8c,0xfa,0x12,0xf8,0xb9,
5603   0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
5604    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5605    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5606    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5607    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5608    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5609    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5610    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5611    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5612    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5613    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5614    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5615    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5616    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5617    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5618    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5619    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5620    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5621    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5622    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5623    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5624    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5625    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5626    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5627    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5628    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5629    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5630    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5631    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5632    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5633    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5634    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5635    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5636    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5637    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5638    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5639    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5640    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5641    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5642    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5643    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5644    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5645    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5646    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5647    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5648    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5649    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5650    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5651    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5652    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5653    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5654    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5655    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5656    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5657    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5658    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5659    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5660    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5661    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5662    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5663    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5664    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5665    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5666    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5667    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5668    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5669    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5670    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5671    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5672    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5673    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5674    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5675    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5676    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5677    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5678    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5679    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5680    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5681    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5682    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5683    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5684    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5685    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5686    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5687    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5688    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5689    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5690    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5691    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5692    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5693    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5694    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5695    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5696    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5697    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5698    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5699    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5700    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5701    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5702    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5703    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5704    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5705    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5706    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5707    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5708    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5709    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5710    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5711    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5712    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5713    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5714    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5715    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5716    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5717    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5718    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5719    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5720    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5721    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5722    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5723    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5724    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5725    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5726    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5727    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5728    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5729    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5730    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5731    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5732    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5733    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5734    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5735    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5736    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5737    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5738    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5739    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5740    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5741    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5742    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5743    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5744    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5745    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5746    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5747    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5748    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5749    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5750    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5751    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5752    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5753    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5754    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5755    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5756    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5757    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5758    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5759    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5760    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5761    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5762    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5763    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5764    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5765    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5766    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5767    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5768    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5769    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5770    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5771    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5772    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5773    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5774    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5775    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5776    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5777    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5778    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5779    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5780    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5781    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5782    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5783    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5784    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5785    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5786    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5787    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5788    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5789    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5790    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5791    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5792    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5793    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5794    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5795    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5796    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5797    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5798    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5799    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5800    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5801    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5802    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5803    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5804    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5805    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5806    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5807    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5808    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5809    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5810    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5811    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5812    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5813    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5814    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5815    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5816    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5817    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5818    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5819    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5820    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5821    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5822    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5823    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5824    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5825    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5826    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5827    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5828    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5829    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5830    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5831    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5832    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5833    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5834    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5835    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5836    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5837    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5838    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5839    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5840    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5841    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5842    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5843    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5844    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5845    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5846    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5847    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5848    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5849    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5850    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5851    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5852    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5853    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5854    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5855    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5856    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5857    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
5858};
5859
5860
5861
5862127struct parameters
5863128{
5864129   int xor;
r3115r3116
6159424   return decrypted;
6160425}
6161426
6162
6163
6164void fd1089_decrypt_0013A(running_machine *machine)
427void fd1089a_decrypt(running_machine *machine)
6165428{
6166   sys16_decrypt(machine, key_0013A,FD1089B);
429   sys16_decrypt(machine, memory_region(machine, "fd1089a_key"), FD1089A);
6167430}
6168431
6169void fd1089_decrypt_0018(running_machine *machine)
432void fd1089b_decrypt(running_machine *machine)
6170433{
6171   sys16_decrypt(machine, key_0018,FD1089A);
434   sys16_decrypt(machine, memory_region(machine, "fd1089b_key"), FD1089B);
6172435}
6173436
6174void fd1089_decrypt_0021(running_machine *machine)
6175{
6176   sys16_decrypt(machine, key_0021,FD1089A);
6177}
6178
6179void fd1089_decrypt_0022(running_machine *machine)
6180{
6181   sys16_decrypt(machine, key_0022,FD1089A);
6182}
6183
6184void fd1089_decrypt_0024(running_machine *machine)
6185{
6186   sys16_decrypt(machine, key_0024,FD1089B);
6187}
6188
6189void fd1089_decrypt_0027(running_machine *machine)
6190{
6191   sys16_decrypt(machine, key_0027_0028,FD1089B);
6192}
6193
6194void fd1089_decrypt_0028(running_machine *machine)
6195{
6196   sys16_decrypt(machine, key_0027_0028,FD1089A);
6197}
6198
6199void fd1089_decrypt_0033(running_machine *machine)
6200{
6201   sys16_decrypt(machine, key_0033_0037,FD1089A);
6202}
6203
6204void fd1089_decrypt_0034(running_machine *machine)
6205{
6206   sys16_decrypt(machine, key_0034,FD1089B);
6207}
6208
6209void fd1089_decrypt_0037(running_machine *machine)
6210{
6211   sys16_decrypt(machine, key_0033_0037,FD1089B);
6212}
6213
6214void fd1089_decrypt_0167(running_machine *machine)
6215{
6216   sys16_decrypt(machine, key_0167_0168,FD1089A);
6217}
6218
6219void fd1089_decrypt_0168(running_machine *machine)
6220{
6221   sys16_decrypt(machine, key_0167_0168,FD1089B);
6222}
6223
6224void fd1089_decrypt_5021(running_machine *machine)
6225{
6226   sys16_decrypt(machine, key_5021,FD1089B);
6227}
6228
6229void fd1089_decrypt_wb35(running_machine *machine)
6230{
6231   sys16_decrypt(machine, key_wb35,FD1089A);
6232}
6233
src/mame/machine/fd1089.h
r3115r3116
11void *fd1089_get_decrypted_base(void);
22
3void fd1089_decrypt_0013A(running_machine *machine);
4void fd1089_decrypt_0018(running_machine *machine);
5void fd1089_decrypt_0021(running_machine *machine);
6void fd1089_decrypt_0022(running_machine *machine);
7void fd1089_decrypt_0024(running_machine *machine);
8void fd1089_decrypt_0027(running_machine *machine);
9void fd1089_decrypt_0028(running_machine *machine);
10void fd1089_decrypt_0033(running_machine *machine);
11void fd1089_decrypt_0034(running_machine *machine);
12void fd1089_decrypt_0037(running_machine *machine);
13void fd1089_decrypt_0167(running_machine *machine);
14void fd1089_decrypt_0168(running_machine *machine);
15void fd1089_decrypt_5021(running_machine *machine);
16void fd1089_decrypt_wb35(running_machine *machine);
3void fd1089a_decrypt(running_machine *machine);
4void fd1089b_decrypt(running_machine *machine);
src/mame/machine/playch10.c
r3115r3116
6060 *  BIOS ports handling
6161 *
6262 *************************************/
63READ8_HANDLER( pc10_port_0_r )
63
64CUSTOM_INPUT( pc10_int_detect_r )
6465{
65   return input_port_read(machine, "BIOS") | ( ( ~pc10_int_detect & 1 ) << 3 );
66   return ~pc10_int_detect & 1;
6667}
6768
6869WRITE8_HANDLER( pc10_SDCS_w )
src/mame/machine/asteroid.c
r3115r3116
3535      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
3636}
3737
38
3938READ8_HANDLER( asteroid_IN0_r )
4039{
40   int res = input_port_read(machine, "IN0");
41   int bitmask = (1 << offset);
4142
42   int res;
43   int bitmask;
44
45   res=input_port_read(machine, "IN0");
46
47   bitmask = (1 << offset);
48
49   if (activecpu_gettotalcycles() & 0x100)
50      res |= 0x02;
51   if (!avgdvg_done())
52      res |= 0x04;
53
5443   if (res & bitmask)
5544      res = 0x80;
5645   else
r3115r3116
6049}
6150
6251
63READ8_HANDLER( asteroib_IN0_r )
64{
65   int res;
66
67   res=input_port_read(machine, "IN0");
68
69//  if (activecpu_gettotalcycles() & 0x100)
70//      res |= 0x02;
71   if (!avgdvg_done())
72      res |= 0x80;
73
74   return res;
75}
76
7752READ8_HANDLER( asterock_IN0_r )
7853{
79   int res;
80   int bitmask;
54   int res = input_port_read(machine, "IN0");
55   int bitmask = (1 << offset);
8156
82   res=input_port_read(machine, "IN0");
83
84   bitmask = (1 << offset);
85
86   if (activecpu_gettotalcycles() & 0x100)
87      res |= 0x04;
88   if (!avgdvg_done())
89      res |= 0x01;
90
9157   if (res & bitmask)
9258      res = ~0x80;
9359   else
r3115r3116
10369
10470READ8_HANDLER( asteroid_IN1_r )
10571{
106   int res;
107   int bitmask;
72   int res = input_port_read(machine, "IN1");
73   int bitmask = (1 << (offset & 0x7));
10874
109   res=input_port_read(machine, "IN1");
110   bitmask = (1 << (offset & 0x7));
111
11275   if (res & bitmask)
11376      res = 0x80;
11477   else
11578       res = ~0x80;
116   return (res);
79
80   return res;
11781}
11882
11983
r3115r3116
173137   asteroid_bank_switch_w(machine,0,0);
174138   avgdvg_reset_w(machine,0,0);
175139}
176
177
178/*
179 * This is Lunar Lander's Inputport 0.
180 */
181READ8_HANDLER( llander_IN0_r )
182{
183   int res;
184
185   res = input_port_read(machine, "IN0");
186
187   if (avgdvg_done())
188      res |= 0x01;
189   else
190      res &= ~0x01;
191
192   if (activecpu_gettotalcycles() & 0x100)
193      res |= 0x40;
194   else
195      res &= ~0x40;
196
197   return res;
198}
src/mame/machine/mhavoc.c
r3115r3116
217217 *
218218 *************************************/
219219
220READ8_HANDLER( mhavoc_port_0_r )
220CUSTOM_INPUT( tms5220_r )
221221{
222   UINT8 res;
223
224   /* Bits 7-6 = selected based on Player 1 */
225   /* Bits 5-4 = common */
226   if (player_1)
227      res = (input_port_read(machine, "IN0") & 0x30) | (input_port_read(machine, "IN2") & 0xc0);
228   else
229      res = input_port_read(machine, "IN0") & 0xf0;
230
231   /* Bit 3 = Gamma rcvd flag */
232   if (gamma_rcvd)
233      res |= 0x08;
234
235   /* Bit 2 = Gamma xmtd flag */
236   if (gamma_xmtd)
237      res |= 0x04;
238
239   /* Bit 1 = 2.4kHz (divide 2.5MHz by 1024) */
240   if (!(activecpu_gettotalcycles() & 0x400))
241      res |= 0x02;
242
243   /* Bit 0 = Vector generator halt flag */
244   if (avgdvg_done())
245      res |= 0x01;
246
247   return res;
222   return tms5220_ready_r() ? 0 : 1;
248223}
249224
250
251READ8_HANDLER( alphaone_port_0_r )
225CUSTOM_INPUT( mhavoc_bit67_r )
252226{
253   /* Bits 7-2 = common */
254   UINT8 res = input_port_read(machine, "IN0") & 0xfc;
255
256   /* Bit 1 = 2.4kHz (divide 2.5MHz by 1024) */
257   if (!(activecpu_gettotalcycles() & 0x400))
258      res |= 0x02;
259
260   /* Bit 0 = Vector generator halt flag */
261   if (avgdvg_done())
262      res |= 0x01;
263
264   return res;
227   const char *tag1 = param;
228   const char *tag2 = tag1 + strlen(tag1) + 1;
229   return input_port_read(field->port->machine, player_1 ? tag2 : tag1) & 0x03;
265230}
266231
267
268READ8_HANDLER( mhavoc_port_1_r )
232CUSTOM_INPUT( gamma_rcvd_r )
269233{
270   /* Bits 7-2 = input switches */
271   UINT8 res = input_port_read(machine, "IN1") & 0xfc;
234   /* Gamma rcvd flag */
235   return gamma_rcvd;
236}
272237
273   /* Bit 1 = Alpha rcvd flag */
274   if (has_gamma_cpu && alpha_rcvd)
275      res |= 0x02;
276
277   /* Bit 0 = Alpha xmtd flag */
278   if (has_gamma_cpu && alpha_xmtd)
279      res |= 0x01;
280
281   return res;
238CUSTOM_INPUT( gamma_xmtd_r )
239{
240   /* Gamma xmtd flag */
241   return gamma_xmtd;
282242}
283243
284READ8_HANDLER( mhavoc_port_1_sp_r )
244CUSTOM_INPUT( alpha_rcvd_r )
285245{
286   /* Bits 7-3 = input switches */
287   UINT8 res = input_port_read(machine, "IN1") & 0xf8;
246   /* Alpha rcvd flag */
247   return (has_gamma_cpu && alpha_rcvd);
248}
288249
289   /* Bit 2 = TMS5220 ready flag */
290   if (!tms5220_ready_r())
291         res |= 0x04;
292
293   /* Bit 1 = Alpha rcvd flag */
294   if (has_gamma_cpu && alpha_rcvd)
295      res |= 0x02;
296
297   /* Bit 0 = Alpha xmtd flag */
298   if (has_gamma_cpu && alpha_xmtd)
299      res |= 0x01;
300
301   return res;
250CUSTOM_INPUT( alpha_xmtd_r )
251{
252   /* Alpha xmtd flag */
253   return (has_gamma_cpu && alpha_xmtd);
302254}
303255
304
305
306
307256/*************************************
308257 *
309258 *  Output ports
src/mame/machine/dc.c
r3115r3116
457457                              maple0x86data2[pos+8] = 1;
458458                              maple0x86data2[pos+1] = 0x8e;
459459                              maple0x86data2[pos+9] = 1;
460                              maple0x86data2[pos+5] = 0xe0;
460461                              // 4 + 1 + 0x10 + ?,8e,addr,0,?,?,addr?,len,status,report1,jvsbytes...
461462                              ddtdata.length=11;
462463                              tocopy += 10;
src/mame/machine/scramble.c
r3115r3116
6363}
6464
6565
66static READ8_HANDLER( ckongs_input_port_1_r )
67{
68   return (input_port_read(machine, "IN1") & 0xfc) | ((input_port_read(machine, "IN2") & 0x06) >> 1);
69}
70
71static READ8_HANDLER( ckongs_input_port_2_r )
72{
73   return (input_port_read(machine, "IN2") & 0xf9) | ((input_port_read(machine, "IN1") & 0x03) << 1);
74}
75
76
77/* the coinage DIPs are spread accross two input ports */
78static READ8_HANDLER( stratgyx_input_port_2_r )
79{
80   return (input_port_read(machine, "IN2") & ~0x06) | ((input_port_read(machine, "IN4") << 1) & 0x06);
81}
82
83static READ8_HANDLER( stratgyx_input_port_3_r )
84{
85   return (input_port_read(machine, "IN3") & ~0x03) | ((input_port_read(machine, "IN4") >> 2) & 0x03);
86}
87
88
8966static READ8_HANDLER( darkplnt_input_port_1_r )
9067{
9168   static const UINT8 remap[] = {0x03, 0x02, 0x00, 0x01, 0x21, 0x20, 0x22, 0x23,
r3115r3116
228205   {
229206      input_port_0_r,            /* Port A read */
230207      input_port_1_r,            /* Port B read */
231      stratgyx_input_port_2_r,   /* Port C read */
208      input_port_2_r,            /* Port C read */
232209      NULL,                  /* Port A write */
233210      NULL,                  /* Port B write */
234211      NULL                   /* Port C write */
r3115r3116
236213   {
237214      NULL,                  /* Port A read */
238215      NULL,                  /* Port B read */
239      stratgyx_input_port_3_r,   /* Port C read */
216      input_port_3_r,            /* Port C read */
240217      soundlatch_w,            /* Port A write */
241218      scramble_sh_irqtrigger_w,   /* Port B write */
242219      NULL                  /* Port C write */
r3115r3116
290267{
291268   {
292269      input_port_0_r,            /* Port A read */
293      ckongs_input_port_1_r,      /* Port B read */
294      ckongs_input_port_2_r,      /* Port C read */
270      input_port_1_r,            /* Port B read */
271      input_port_2_r,            /* Port C read */
295272      NULL,                  /* Port A write */
296273      NULL,                  /* Port B write */
297274      NULL                   /* Port C write */
src/mame/machine/gaplus.c
r3115r3116
3030
3131READ8_HANDLER( gaplus_customio_3_r )
3232{
33    int mode;
33   int mode = gaplus_customio_3[8];
3434
35    mode = gaplus_customio_3[8];
36    if (mode == 2)
37    {
38        switch (offset)
39        {
40            case 0:
41                return input_port_read(machine, "IN2");      /* cabinet & test mode */
42                break;
43            case 2:
44                return 0x0f;
45                break;
46            default:
47                return gaplus_customio_3[offset];
48        }
49    }
50    else
51    {
52        switch (offset)
53        {
54            case 0:
55                return input_port_read(machine, "IN2");      /* cabinet & test mode */
56                break;
57            case 1:
58                return 0x0f;
59                break;
60            case 2:
61                return 0x0e;
62                break;
63            case 3:
64                return 0x01;
65                break;
66            default:
67                return gaplus_customio_3[offset];
68        }
69    }
35   switch (offset)
36   {
37      case 0:
38         return input_port_read(machine, "IN2");      /* cabinet & test mode */
39         break;
40      case 1:
41         return (mode == 2) ? gaplus_customio_3[offset] : 0x0f;
42         break;
43      case 2:
44         return (mode == 2) ? 0x0f : 0x0e;
45         break;
46      case 3:
47         return (mode == 2) ? gaplus_customio_3[offset] : 0x01;
48         break;
49      default:
50         return gaplus_customio_3[offset];
51   }
7052}
src/mame/machine/stfight.c
r3115r3116
3636*/
3737
3838static UINT8 *decrypt;
39static int adpcm_data_offs;
40static int adpcm_data_end;
41static int toggle;
42static UINT8 fm_data;
3943
44static int coin_mech_latch[2];
45static int stfight_coin_mech_query_active = 0;
46static int stfight_coin_mech_query;
47
48
49
4050DRIVER_INIT( empcity )
4151{
4252   UINT8 *rom = memory_region(machine, "main");
r3115r3116
8292
8393MACHINE_RESET( stfight )
8494{
95   adpcm_data_offs = adpcm_data_end = 0;
96   toggle = 0;
97   fm_data = 0;
98   coin_mech_latch[0] = 0x02;
99   coin_mech_latch[1] = 0x01;
100
101   stfight_coin_mech_query_active = 0;
102   stfight_coin_mech_query = 0;
103
85104    // initialise rom bank
86105    stfight_bank_w( machine, 0, 0 );
87106}
r3115r3116
109128{
110129    // Do a RST10
111130    cpunum_set_input_line_and_vector(machine, 0,0,HOLD_LINE,0xd7);
112      timer_set(ATTOTIME_IN_HZ(120), NULL, 0, stfight_interrupt_1);
131    timer_set(ATTOTIME_IN_HZ(120), NULL, 0, stfight_interrupt_1);
113132}
114133
115134/*
r3115r3116
122141    return( ~input_port_read(machine, offset ? "DSW1" : "DSW0") );
123142}
124143
125static int stfight_coin_mech_query_active = 0;
126static int stfight_coin_mech_query;
127
128144READ8_HANDLER( stfight_coin_r )
129145{
130    static int coin_mech_latch[2] = { 0x02, 0x01 };
131
132146    int coin_mech_data;
133147    int i;
134148
r3115r3116
180194    0x5400,     // girl getting shot
181195    0x7200      // (end of samples)
182196};
183static int adpcm_data_offs;
184static int adpcm_data_end;
185197
186198void stfight_adpcm_int( running_machine *machine, int data )
187199{
188   static int toggle;
189200   UINT8 *SAMPLES = memory_region(machine, "adpcm");
190201   int adpcm_data = SAMPLES[adpcm_data_offs & 0x7fff];
191202
r3115r3116
226237 *      Machine hardware for YM2303 fm sound control
227238 */
228239
229static UINT8 fm_data;
230
231240WRITE8_HANDLER( stfight_fm_w )
232241{
233242    // the sound cpu ignores any fm data without bit 7 set
src/mame/machine/balsente.c
r3115r3116
11201120 *
11211121 *************************************/
11221122
1123READ8_HANDLER( nstocker_port2_r )
1123CUSTOM_INPUT( nstocker_bits_r )
11241124{
1125   return (input_port_read(machine, "IN0") & 0xf0) | nstocker_bits;
1125   return nstocker_bits;
11261126}
11271127
11281128
src/mame/machine/steppers.c
r3115r3116
1616
1717#include "driver.h"
1818#include "steppers.h"
19#include "deprecat.h"
20/* local prototypes */
1921
20// local prototypes ///////////////////////////////////////////////////////
22static void update_optic(int which);
2123
22static void update_optic(int id);
24/* local vars */
2325
24// local vars /////////////////////////////////////////////////////////////
25
26static struct
26typedef struct _stepper
2727{
28   UINT8   pattern,   // coil pattern
29      old_pattern,   // old coil pattern
30            type;   // reel type
31   INT16 step_pos,      // step position 0 - max_steps
32      max_steps;      // maximum step position
28   const stepper_interface *intf;
29   UINT8    pattern,   /* coil pattern */
30       old_pattern,   /* old coil pattern */
31            type;   /* reel type */
32   INT16    step_pos,   /* step position 0 - max_steps */
33         max_steps;   /* maximum step position */
3334
34   INT16 index_pos,   // position of index (in steps)
35         index_len,   // length of index   (in steps)
36         index_patt;   // pattern needed on coils (0=don't care)
35   INT16 index_start,   /* start position of index (in half steps) */
36         index_end,   /* end position of index (in half steps) */
37         index_patt;   /* pattern needed on coils (0=don't care) */
3738
3839   UINT8 optic;
40} stepper;
3941
40} steppers[MAX_STEPPERS];
41
42
43// step table, use previouspattern::newpattern as index
42static stepper step[MAX_STEPPERS];
43/* step table, use previouspattern::newpattern as index */
4444static const int StarpointStepTab[] =
4545{
4646   0, //0000->0000 0->0
r3115r3116
316316   0  //1111->1111 F->F
317317};
318318
319///////////////////////////////////////////////////////////////////////////
320
321319static const int BarcrestStepTab[] =
322320{
323321   0, //0000->0000 0->0
r3115r3116
341339   0, //0001->0001 1->1
342340   0, //0001->0010 1->2
343341   1, //0001->0011 1->3
344   0,//0001->0100 1->4
345   0,//0001->0101 1->5
342   0, //0001->0100 1->4
343   0, //0001->0101 1->5
346344   0, //0001->0110 1->6
347345   0, //0001->0111 1->7
348346   0, //0001->1000 1->8
r3115r3116
593591   0  //1111->1111 F->F
594592};
595593
594/* useful interfaces */
595
596const stepper_interface starpoint_interface_48step =
597{
598   STARPOINT_48STEP_REEL,
599   16,
600   24,
601   0x09
602};
603
596604///////////////////////////////////////////////////////////////////////////
605void stepper_config(int which, const stepper_interface *intf)
606{
597607
598void Stepper_init(int id, int type)
599{
600   if ( id < MAX_STEPPERS )
608   assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "Can only call stepper_config at init time!");
609   assert_always((which >= 0) && (which < MAX_STEPPERS), "stepper_config called on an invalid stepper motor!");
610   assert_always(intf, "stepper_config called with an invalid interface!");
611
612   step[which].intf = intf;
613
614   step[which].type = intf->type;
615   step[which].index_start = intf->index_start;/* location of first index value in half steps */
616   step[which].index_end    = intf->index_end;    /* location of last index value in half steps */
617   step[which].index_patt    = intf->index_patt; /* hex value of coil pattern (0 if not needed)*/
618   step[which].pattern     = 0;
619   step[which].old_pattern = 0;
620   step[which].step_pos    = 0;
621
622   switch ( step[which].type )
601623   {
602      steppers[id].index_pos   = 16;
603      steppers[id].index_len   = 8;
604      steppers[id].index_patt  = 0x09;
605      steppers[id].pattern     = 0;
606      steppers[id].old_pattern = 0;
607      steppers[id].step_pos    = 0;
608      steppers[id].max_steps   = (48*2);
609      steppers[id].type       = type;
624      case STARPOINT_48STEP_REEL:  /* STARPOINT RMxxx */
625      case BARCREST_48STEP_REEL :  /* Barcrest Reel unit */
626      step[which].max_steps = (48*2);
627      break;
628      case STARPOINT_144STEPS_DICE :/* STARPOINT 1DCU DICE mechanism */
629      step[which].max_steps = (144*2);
630      break;
631   }
610632
611      switch ( steppers[id].type )
612      {
613         case STARPOINT_48STEP_REEL :  // STARPOINT RMxxx
614         break;
615         case BARCREST_48STEP_REEL :     // Barcrest reel units have different coil windings and optic tabs
616         Stepper_set_index(id,0,16,0x09);
617         break;
618         case STARPOINT_144STEPS_DICE :// STARPOINT 1DCU DICE mechanism
619         steppers[id].max_steps = (144*2);
620         break;
621      }
622      state_save_register_item("Stepper", id, steppers[id].index_pos);
623      state_save_register_item("Stepper", id, steppers[id].index_len);
624      state_save_register_item("Stepper", id, steppers[id].index_patt);
625      state_save_register_item("Stepper", id, steppers[id].pattern);
626      state_save_register_item("Stepper", id, steppers[id].old_pattern);
627      state_save_register_item("Stepper", id, steppers[id].step_pos);
628      state_save_register_item("Stepper", id, steppers[id].max_steps);
629      state_save_register_item("Stepper", id, steppers[id].type);
630   }
633   state_save_register_item("stepper", which, step[which].index_start);
634   state_save_register_item("stepper", which, step[which].index_end);
635   state_save_register_item("stepper", which, step[which].index_patt);
636   state_save_register_item("stepper", which, step[which].pattern);
637   state_save_register_item("stepper", which, step[which].old_pattern);
638   state_save_register_item("stepper", which, step[which].step_pos);
639   state_save_register_item("stepper", which, step[which].max_steps);
640   state_save_register_item("stepper", which, step[which].type);
631641}
632642
633643///////////////////////////////////////////////////////////////////////////
634void Stepper_set_index(int id,int position,int length,int pattern)
644int stepper_get_position(int which)
635645{
636   steppers[id].index_pos   = position;//location of first index value in half steps
637   steppers[id].index_len   = length;  //number of half steps the index lasts
638   steppers[id].index_patt  = pattern; //hex value of coil pattern
646   return step[which].step_pos;
639647}
640648
641int Stepper_get_position(int id)
642{
643   return steppers[id].step_pos;
644}
645
646649///////////////////////////////////////////////////////////////////////////
647650
648int Stepper_get_max(int id)
651int stepper_get_max(int which)
649652{
650   return steppers[id].max_steps;
653   return step[which].max_steps;
651654}
652655
653656///////////////////////////////////////////////////////////////////////////
654657
655static void update_optic(int id)
658static void update_optic(int which)
656659{
657   int pos   = steppers[id].step_pos,
658      index = steppers[id].index_pos;
660   int pos   = step[which].step_pos,
661      start = step[which].index_start,
662      end = step[which].index_end;
659663
660   if ( ( pos >= index ) && ( pos <  index + steppers[id].index_len ) &&
661      ( ( steppers[id].pattern == steppers[id].index_patt || steppers[id].index_patt==0) ||
662      ( steppers[id].pattern == 0 &&
663      (steppers[id].old_pattern == steppers[id].index_patt || steppers[id].index_patt==0)
664   if ( (( pos >= start ) && ( pos <= end )) &&
665      ( ( step[which].pattern == step[which].index_patt || step[which].index_patt==0) ||
666      ( step[which].pattern == 0 &&
667      (step[which].old_pattern == step[which].index_patt || step[which].index_patt==0)
664668      ) ) )
665669   {
666      steppers[id].optic = 1;
670      step[which].optic = 1;
667671   }
668   else steppers[id].optic = 0;
672   else step[which].optic = 0;
669673}
670674
671675///////////////////////////////////////////////////////////////////////////
672676
673void Stepper_reset_position(int id)
677void stepper_reset_position(int which)
674678{
675   steppers[id].step_pos    = 0;
676   steppers[id].pattern     = 0x00;
677   steppers[id].old_pattern = 0x00;
679   step[which].step_pos    = 0;
680   step[which].pattern     = 0x00;
681   step[which].old_pattern = 0x00;
678682
679   update_optic(id);
683   update_optic(which);
680684}
681685
682686///////////////////////////////////////////////////////////////////////////
683687
684int Stepper_optic_state(int id)
688int stepper_optic_state(int which)
685689{
686690   int result = 0;
687691
688   if ( id < MAX_STEPPERS )
692   if ( which < MAX_STEPPERS )
689693   {
690      result = steppers[id].optic;
694      result = step[which].optic;
691695   }
692696
693697   return result;
r3115r3116
695699
696700///////////////////////////////////////////////////////////////////////////
697701
698int Stepper_update(int id, UINT8 pattern)
702int stepper_update(int which, UINT8 pattern)
699703{
700704   int changed = 0;
701705
702706   pattern &= 0x0F;
703707
704   if ( steppers[id].pattern != pattern )
705   { // pattern changed
708   if ( step[which].pattern != pattern )
709   { /* pattern changed */
706710      int index,
707711         steps,
708712         pos;
709713
710      if ( steppers[id].pattern )
714      if ( step[which].pattern )
711715      {
712         steppers[id].old_pattern = steppers[id].pattern;
716         step[which].old_pattern = step[which].pattern;
713717      }
714      steppers[id].pattern = pattern;
718      step[which].pattern = pattern;
715719
716      index = (steppers[id].old_pattern << 4) | pattern;
717      switch ( steppers[id].type )
720      index = (step[which].old_pattern << 4) | pattern;
721      switch ( step[which].type )
718722      {
719723         default:
720         case STARPOINT_48STEP_REEL :   // STARPOINT RMxxx
721         case STARPOINT_144STEPS_DICE :  // STARPOINT 1DCU DICE mechanism
724         case STARPOINT_48STEP_REEL :   /* STARPOINT RMxxx */
725         case STARPOINT_144STEPS_DICE :  /* STARPOINT 1DCU DICE mechanism */
722726         steps = StarpointStepTab[ index ];
723727         break;
724         case BARCREST_48STEP_REEL :       // Barcrest reel units have different windings
728         case BARCREST_48STEP_REEL :       /* Barcrest reel units have different windings */
725729         steps = BarcrestStepTab[ index ];
726730         break;
727731      }
728//      if ( id ==0 )logerror("Id %d Index %d Steps %d Pattern Old %02X New %02X\n",id,index,steps,steppers[id].old_pattern,steppers[id].pattern);
732      #if 0 /* Assists with new index generation */
733      if ( which ==0 )logerror("which %d Index %d Steps %d Pattern Old %02X New %02X\n",which,index,steps,step[which].old_pattern,step[which].pattern);
734      #endif
729735
730736      if ( steps )
731737      {
732         pos = steppers[id].step_pos + steps;
738         pos = step[which].step_pos + steps;
733739
734         if ( pos > steppers[id].max_steps ) pos -= steppers[id].max_steps;
735         else if ( pos < 0 )                 pos += steppers[id].max_steps;
740         if ( pos > step[which].max_steps ) pos -= step[which].max_steps;
741         else if ( pos < 0 )                 pos += step[which].max_steps;
736742
737         steppers[id].step_pos = pos;
738         update_optic(id);
743         step[which].step_pos = pos;
744         update_optic(which);
739745
740746         changed++;
741747      }
src/mame/machine/steppers.h
r3115r3116
55// Emulates : 48 step motors driven with full step or half step          //
66//            also emulates the index optic                              //
77//                                                                       //
8// 13-08-2008: J. Wallace - Added a rigid interface structure,           //
9//                          and removed unnecessary inline functions     //
10//                          Rewritten to make it more flexible           //
811// 26-01-2007: J. Wallace - Rewritten to make it more flexible           //
12// 26-01-2007: J. Wallace - Rewritten to make it more flexible           //
13// 26-01-2007: J. Wallace - Rewritten to make it more flexible           //
914//                          and to allow indices to be set in drivers    //
1015// 29-12-2006: J. Wallace - Added state save support                     //
1116// 05-03-2004: Re-Animator                                               //
r3115r3116
1823#ifndef INC_STEPPERS
1924#define INC_STEPPERS
2025
21#define MAX_STEPPERS          8         // maximum number of steppers
26#define MAX_STEPPERS          8         /* maximum number of steppers */
2227
23#define STARPOINT_48STEP_REEL   0         // STARPOINT RMXXX reel unit
24#define BARCREST_48STEP_REEL    1         // Barcrest bespoke reel unit
25#define STARPOINT_144STEPS_DICE 2         // STARPOINT 1DCU DICE mechanism - tech sheet available  on request
28#define STARPOINT_48STEP_REEL   0         /* STARPOINT RMXXX reel unit */
29#define BARCREST_48STEP_REEL    1         /* Barcrest bespoke reel unit */
30#define STARPOINT_144STEPS_DICE 2         /* STARPOINT 1DCU DICE mechanism */
2631
27void Stepper_init( int id, int type);      // init a stepper motor
32/*------------- Stepper motor interface structure -----------------*/
2833
29void Stepper_reset_position(int id);      // reset a motor to position 0
34typedef struct _stepper_interface stepper_interface;
35struct _stepper_interface
36{
37   UINT8 type; /* Reel unit type */
38   INT16 index_start;/* start position of index (in half steps) */
39   INT16 index_end;  /* end position of index (in half steps) */
40   INT16 index_patt; /* pattern needed on coils (0=don't care) */
41};
3042
31int Stepper_optic_state(   int id);      // read a motor's optics
43extern const stepper_interface starpoint_interface_48step;
3244
33void Stepper_set_index(int id,int position,int length,int pattern);
45void stepper_config(int which, const stepper_interface *intf);
3446
35int Stepper_update(int id, UINT8 pattern);   // update a motor
47void stepper_reset_position(int id);      /* reset a motor to position 0 */
3648
37int  Stepper_get_position(int id);         // get current position in half steps
49int  stepper_optic_state(   int id);      /* read a motor's optics */
3850
39int  Stepper_get_max(int id);            // get maximum position in half steps
51int  stepper_update(int id, UINT8 pattern);   /* update a motor */
52
53int  stepper_get_position(int id);         /* get current position in half steps */
54
55int  stepper_get_max(int id);            /* get maximum position in half steps */
4056#endif
src/mame/machine/taitosj.c
r3115r3116
2424static UINT8 protection_value;
2525static UINT32 address;
2626
27void taitosj_register_main_savestate(void);
28
2927MACHINE_START( taitosj )
3028{
3129   memory_configure_bank(1, 0, 1, memory_region(machine, "main") + 0x6000, 0);
3230   memory_configure_bank(1, 1, 1, memory_region(machine, "main") + 0x10000, 0);
3331
34   taitosj_register_main_savestate();
35
3632   state_save_register_global(fromz80);
3733   state_save_register_global(toz80);
3834   state_save_register_global(zaccept);
r3115r3116
5046{
5147   /* set the default ROM bank (many games only have one bank and */
5248   /* never write to the bank selector register) */
53    taitosj_bankswitch_w(machine, 0, 0);
49   taitosj_bankswitch_w(machine, 0, 0);
5450
5551
5652   zaccept = 1;
src/mame/machine/amiga.c
r3115r3116
405405 *
406406 *************************************/
407407
408static void update_irqs(void)
408static void update_irqs(running_machine *machine)
409409{
410410   int ints = CUSTOM_REG(REG_INTENA) & CUSTOM_REG(REG_INTREQ);
411   int irq = -1;
412411
413412   /* Master interrupt switch */
414413   if (CUSTOM_REG(REG_INTENA) & 0x4000)
415414   {
416415      /* Serial transmit buffer empty, disk block finished, software interrupts */
417      if (ints & 0x0007)
418         irq = 1;
416      cpunum_set_input_line(machine, 0, 1, ints & 0x0007 ? ASSERT_LINE : CLEAR_LINE);
419417
420418      /* I/O ports and timer interrupts */
421      if (ints & 0x0008)
422         irq = 2;
419      cpunum_set_input_line(machine, 0, 2, ints & 0x0008 ? ASSERT_LINE : CLEAR_LINE);
423420
424421      /* Copper, VBLANK, blitter interrupts */
425      if (ints & 0x0070)
426         irq = 3;
422      cpunum_set_input_line(machine, 0, 3, ints & 0x0070 ? ASSERT_LINE : CLEAR_LINE);
427423
428424      /* Audio interrupts */
429      if (ints & 0x0780)
430         irq = 4;
425      cpunum_set_input_line(machine, 0, 4, ints & 0x0780 ? ASSERT_LINE : CLEAR_LINE);
431426
432427      /* Serial receive buffer full, disk sync match */
433      if (ints & 0x1800)
434         irq = 5;
428      cpunum_set_input_line(machine, 0, 5, ints & 0x1800 ? ASSERT_LINE : CLEAR_LINE);
435429
436430      /* External interrupts */
437      if (ints & 0x2000)
438         irq = 6;
431      cpunum_set_input_line(machine, 0, 6, ints & 0x2000 ? ASSERT_LINE : CLEAR_LINE);
439432   }
440
441   /* set the highest IRQ line */
442   if (irq >= 0)
443      cpunum_set_input_line(Machine, 0, irq, ASSERT_LINE);
444433   else
445      cpunum_set_input_line(Machine, 0, 7, CLEAR_LINE);
434   {
435      cpunum_set_input_line(machine, 0, 1, CLEAR_LINE);
436      cpunum_set_input_line(machine, 0, 2, CLEAR_LINE);
437      cpunum_set_input_line(machine, 0, 3, CLEAR_LINE);
438      cpunum_set_input_line(machine, 0, 4, CLEAR_LINE);
439      cpunum_set_input_line(machine, 0, 5, CLEAR_LINE);
440      cpunum_set_input_line(machine, 0, 6, CLEAR_LINE);
441   }
446442}
447443
448444
449445static TIMER_CALLBACK( amiga_irq_proc )
450446{
451   update_irqs();
447   update_irqs(machine);
452448   timer_reset( amiga_irq_timer, attotime_never);
453449}
454450
r3115r3116
14281424         if ( temp & 0x8000  ) /* if we're enabling irq's, delay a bit */
14291425            timer_adjust_oneshot( amiga_irq_timer, ATTOTIME_IN_CYCLES( AMIGA_IRQ_DELAY_CYCLES, 0 ), 0);
14301426         else /* if we're disabling irq's, process right away */
1431            update_irqs();
1427            update_irqs(machine);
14321428         break;
14331429
14341430      case REG_INTREQ:
r3115r3116
14451441         if ( temp & 0x8000  ) /* if we're generating irq's, delay a bit */
14461442            timer_adjust_oneshot( amiga_irq_timer, ATTOTIME_IN_CYCLES( AMIGA_IRQ_DELAY_CYCLES, 0 ), 0);
14471443         else /* if we're clearing irq's, process right away */
1448            update_irqs();
1444            update_irqs(machine);
14491445         break;
14501446
14511447      case REG_ADKCON:
src/mame/machine/decoprot.c
r3115r3116
740740         return ((deco16_prot_ram[0x78e>>1]>>4)&0xff00) | (deco16_prot_ram[0x78e>>1]&0x000f) | ((deco16_prot_ram[0x78e>>1]<<8)&0xf000);
741741
742742      case 0x00c >> 1: /* Player 1 & Player 2 joysticks & fire buttons */
743         return (input_port_read(machine, "P1") + (input_port_read(machine, "P2") << 8));
743         return input_port_read(machine, "INPUTS");
744744      case 0x778 >> 1: /* Credits */
745         return input_port_read(machine, "IN0");
745         return input_port_read(machine, "SYSTEM");
746746      case 0x382 >> 1: /* DIPS */
747         return (input_port_read(machine, "DSWA") + (input_port_read(machine, "DSWB") << 8));
747         return input_port_read(machine, "DSW");
748748   }
749749
750750   if (activecpu_get_pc()!=0xc0ea)
r3115r3116
17541754   const UINT16* prot_ram=deco16_prot_ram;
17551755   switch (offset * 2)
17561756   {
1757   case 0x5b2: return input_port_read(machine, "IN0");
1757   case 0x5b2: return input_port_read(machine, "SYSTEM");
17581758   case 0x44c: return input_port_read(machine, "DSW");
1759   case 0x042: return input_port_read(machine, "IN1");
1759   case 0x042: return input_port_read(machine, "INPUTS");
17601760
17611761   case 0x510: return DECO_PORT(0);
17621762   case 0x51a: return DECO_PORT(2);
src/mame/machine/mcr.c
r3115r3116
473473
474474static void update_mcr68_interrupts(running_machine *machine)
475475{
476   int newstate = 0;
477
478   /* all interrupts go through an LS148, which gives priority to the highest */
479   if (v493_irq_state)
480      newstate = v493_irq_vector;
481   if (m6840_irq_state)
482      newstate = m6840_irq_vector;
483
484   /* set the new state of the IRQ lines */
485   if (newstate)
486      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
487   else
488      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
476   cpunum_set_input_line(machine, 0, v493_irq_vector, v493_irq_state ? ASSERT_LINE : CLEAR_LINE);
477   cpunum_set_input_line(machine, 0, m6840_irq_vector, m6840_irq_state ? ASSERT_LINE : CLEAR_LINE);
489478}
490479
491480
src/mame/machine/galaxold.c
r3115r3116
246246   memory_set_bank(1, _4in1_bank);
247247}
248248
249READ8_HANDLER( _4in1_input_port_1_r )
249CUSTOM_INPUT( _4in1_fake_port_r )
250250{
251251   static const char *portnames[] = { "FAKE1", "FAKE2", "FAKE3", "FAKE4" };
252   int bit_mask = (FPTR)param;
252253
253   return (input_port_read(machine, "IN1") & ~0xc0) | (input_port_read(machine, portnames[_4in1_bank]) & 0xc0);
254   return (input_port_read(field->port->machine, portnames[_4in1_bank]) & bit_mask) ? 0x01 : 0x00;
254255}
255256
256READ8_HANDLER( _4in1_input_port_2_r )
257{
258   static const char *portnames[] = { "FAKE1", "FAKE2", "FAKE3", "FAKE4" };
259
260   return (input_port_read(machine, "DSW0") & 0x04) | (input_port_read(machine, portnames[_4in1_bank]) & ~0xc4);
261}
262
263
264257DRIVER_INIT( pisces )
265258{
266259   /* the coin lockout was replaced */
src/mame/machine/harddriv.c
r3115r3116
219219
220220static void hd68k_update_interrupts(running_machine *machine)
221221{
222   int newstate = 0;
223
224   if (msp_irq_state)
225      newstate = 1;
226   if (adsp_irq_state)
227      newstate = 2;
228   if (gsp_irq_state)
229      newstate = 3;
230   if (atarigen_sound_int_state)   /* /LINKIRQ on STUN Runner */
231      newstate = 4;
232   if (irq_state)
233      newstate = 5;
234   if (duart_irq_state)
235      newstate = 6;
236
237   if (newstate)
238      cpunum_set_input_line(machine, hdcpu_main, newstate, ASSERT_LINE);
239   else
240      cpunum_set_input_line(machine, hdcpu_main, 7, CLEAR_LINE);
222   cpunum_set_input_line(machine, hdcpu_main, 1, msp_irq_state ? ASSERT_LINE : CLEAR_LINE);
223   cpunum_set_input_line(machine, hdcpu_main, 2, adsp_irq_state ? ASSERT_LINE : CLEAR_LINE);
224   cpunum_set_input_line(machine, hdcpu_main, 3, gsp_irq_state ? ASSERT_LINE : CLEAR_LINE);
225   cpunum_set_input_line(machine, hdcpu_main, 4, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);   /* /LINKIRQ on STUN Runner */
226   cpunum_set_input_line(machine, hdcpu_main, 5, irq_state ? ASSERT_LINE : CLEAR_LINE);
227   cpunum_set_input_line(machine, hdcpu_main, 6, duart_irq_state ? ASSERT_LINE : CLEAR_LINE);
241228}
242229
243230
src/mame/machine/dec0.c
r3115r3116
1919   switch (offset<<1)
2020   {
2121      case 0: /* Player 1 & 2 joystick & buttons */
22         return (input_port_read(machine, "IN0") + (input_port_read(machine, "IN1") << 8));
22         return input_port_read(machine, "INPUTS");
2323
2424      case 2: /* Credits, start buttons */
25         return input_port_read(machine, "IN2");
25         return input_port_read(machine, "SYSTEM");
2626
2727      case 4: /* Byte 4: Dipswitch bank 2, Byte 5: Dipswitch Bank 1 */
28         return (input_port_read(machine, "DSW0") + (input_port_read(machine, "DSW1") << 8));
28         return input_port_read(machine, "DSW");
2929
3030      case 8: /* Intel 8751 mc, Bad Dudes & Heavy Barrel only */
3131         //logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n", activecpu_get_pc(), 0x30c000+offset);
r3115r3116
6262   switch (offset<<1)
6363   {
6464      case 0: /* Player 1 Joystick + start, Player 2 Joystick + start */
65         return (input_port_read(machine, "IN0") + (input_port_read(machine, "IN1") << 8));
65         return input_port_read(machine, "INPUTS");
6666
6767      case 2: /* Dipswitches */
68         return (input_port_read(machine, "DSW0") + (input_port_read(machine, "DSW1") << 8));
68         return input_port_read(machine, "DSW");
6969
7070      case 4: /* Player 1 rotary */
7171         return ~(1 << (input_port_read(machine, "AN0") * 12 / 256));
r3115r3116
7474         return ~(1 << (input_port_read(machine, "AN1") * 12 / 256));
7575
7676      case 8: /* Credits, start buttons */
77         return input_port_read(machine, "IN2");
77         return input_port_read(machine, "SYSTEM");
7878
7979      case 12:
8080         return 0;   /* ?? watchdog ?? */
r3115r3116
9191   switch (offset<<1)
9292   {
9393      case 0: /* Dip Switches */
94         return (input_port_read(machine, "DSW0") + (input_port_read(machine, "DSW1") << 8));
94         return input_port_read(machine, "DSW");
9595
9696      case 2: /* Player 1 & Player 2 joysticks & fire buttons */
97         return (input_port_read(machine, "IN0") + (input_port_read(machine, "IN1") << 8));
97         return input_port_read(machine, "INPUTS");
9898
9999      case 4: /* Credits */
100         return input_port_read(machine, "IN2");
100         return input_port_read(machine, "SYSTEM");
101101   }
102102
103103   logerror("Unknown control read at 30c000 %d\n", offset);
src/mame/machine/nb1413m3.c
r3115r3116
377377   nb1413m3_inputport = data;
378378}
379379
380CUSTOM_INPUT( nb1413m3_busyflag_r )
381{
382   return nb1413m3_busyflag & 0x01;
383}
384
385
386/* 2008-08 FP:
387 * In ALL games (but pastelg, hyhoo & hyhoo2) nb1413m3_outcoin_flag is read at inputport0.
388 * However, a few games (lovehous, maiko, mmaiko, hanaoji and the ones using inputport3_r below)
389 * read nb1413m3_outcoin_flag also at inputport3! Is this the correct behaviour for these games
390 * or should they only check the flag at inputport3? */
391CUSTOM_INPUT( nb1413m3_outcoin_flag_r )
392{
393   return nb1413m3_outcoin_flag & 0x01;
394}
395
380396READ8_HANDLER( nb1413m3_inputport0_r )
381397{
382   switch (nb1413m3_type)
383   {
384      case NB1413M3_HYHOO:
385      case NB1413M3_HYHOO2:
386      case NB1413M3_PASTELG:
387         return ((input_port_read(machine, "SYSTEM") & 0xfe) | (nb1413m3_busyflag & 0x01));
388      default:
389         return ((input_port_read(machine, "SYSTEM") & 0xfc) | ((nb1413m3_outcoin_flag & 0x01) << 1) | (nb1413m3_busyflag & 0x01));
390   }
398   return ((input_port_read(machine, "SYSTEM") & 0xfc) | ((nb1413m3_outcoin_flag & 0x01) << 1));
391399}
392400
393401READ8_HANDLER( nb1413m3_inputport1_r )
r3115r3116
509517      case NB1413M3_MMSIKAKU:
510518         return ((nb1413m3_outcoin_flag & 0x01) << 1);
511519         break;
512      case NB1413M3_LOVEHOUS:
513      case NB1413M3_MAIKO:
514      case NB1413M3_MMAIKO:
515      case NB1413M3_HANAOJI:
516         return ((input_port_read(machine, "PORT0-2") & 0xfd) | ((nb1413m3_outcoin_flag & 0x01) << 1));
517         break;
518520      default:
519521         return 0xff;
520522         break;
r3115r3116
685687
686688/* Nichibutsu Mahjong games share a common control panel */
687689INPUT_PORTS_START( nbmjcontrols )
688   PORT_START("KEY0")      /* (3) PORT 1-1 */
690   PORT_START("KEY0")
689691   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
690692   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
691693   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_M )
r3115r3116
695697   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
696698   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
697699
698   PORT_START("KEY1")         /* (4) PORT 1-2 */
700   PORT_START("KEY1")
699701   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
700702   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
701703   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_N )
r3115r3116
705707   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
706708   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
707709
708   PORT_START("KEY2")         /* (5) PORT 1-3 */
710   PORT_START("KEY2")
709711   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
710712   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
711713   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
r3115r3116
715717   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
716718   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
717719
718   PORT_START("KEY3")         /* (6) PORT 1-4 */
720   PORT_START("KEY3")
719721   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
720722   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
721723   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
r3115r3116
725727   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
726728   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
727729
728   PORT_START("KEY4")         /* (7) PORT 1-5 */
730   PORT_START("KEY4")
729731   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )
730732   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )
731733   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
r3115r3116
735737   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
736738   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
737739
738   PORT_START("KEY5")         /* (6) PORT 2-1 */
740   PORT_START("KEY5")
739741   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
740742   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2)
741743   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2)
r3115r3116
745747   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
746748   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
747749
748   PORT_START("KEY6")         /* (7) PORT 2-2 */
750   PORT_START("KEY6")
749751   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2)
750752   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2)
751753   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2)
r3115r3116
755757   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
756758   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
757759
758   PORT_START("KEY7")         /* (8) PORT 2-3 */
760   PORT_START("KEY7")
759761   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
760762   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2)
761763   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2)
r3115r3116
765767   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
766768   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
767769
768   PORT_START("KEY8")         /* (9) PORT 2-4 */
770   PORT_START("KEY8")
769771   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
770772   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
771773   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2)
r3115r3116
775777   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
776778   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
777779
778   PORT_START("KEY9")         /* (10) PORT 2-5 */
780   PORT_START("KEY9")
779781   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2)
780782   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_PLAYER(2)
781783   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2)
src/mame/machine/bfm_bd1.c
r3115r3116
5151//
5252static const char BD1ASCII[] =
5353//0123456789ABCDEF0123456789ABC DEF01 23456789ABCDEF0123456789ABCDEF
54 "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ ?\"#$%%'()*+.-./0123456789&%<=>?"\
55 "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ ?\"#$%%'()*+.-./0123456789&%<=>?"\
54 "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ ?\"#$%%'()*+.-./0123456789&%<=>?"
55 "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ ?\"#$%%'()*+.-./0123456789&%<=>?"
5656 "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ ?\"#$%%'()*+.-./0123456789&%<=>?";
5757
5858/*
src/mame/machine/nitedrvr.c
r3115r3116
88#include "nitedrvr.h"
99#include "sound/discrete.h"
1010
11static UINT8 nitedrvr_gear = 1;
11static UINT8 nitedrvr_gear;
1212static UINT8 nitedrvr_track;
1313static INT32 nitedrvr_steering_buf;
1414static INT32 nitedrvr_steering_val;
1515static UINT8 nitedrvr_crash_en;
16static UINT8 nitedrvr_crash_data = 0x0f;
16static UINT8 nitedrvr_crash_data;
1717static UINT8 nitedrvr_crash_data_en;   // IC D8
1818static UINT8 ac_line;
1919static INT32 last_steering_val;
r3115r3116
247247}
248248
249249
250void nitedrvr_crash_toggle(running_machine *machine)
250static TIMER_CALLBACK( nitedrvr_crash_toggle_callback )
251251{
252252   if (nitedrvr_crash_en && nitedrvr_crash_data_en)
253253   {
r3115r3116
269269   }
270270}
271271
272void nitedrvr_register_machine_vars(void)
273{/* save all the statics in this file. */
272MACHINE_START( nitedrvr )
273{
274274   state_save_register_global(nitedrvr_gear);
275275   state_save_register_global(nitedrvr_track);
276276   state_save_register_global(nitedrvr_steering_buf);
r3115r3116
281281   state_save_register_global(ac_line);
282282   state_save_register_global(last_steering_val);
283283}
284
285MACHINE_RESET( nitedrvr )
286{
287   nitedrvr_gear = 1;
288   nitedrvr_track = 0;
289   nitedrvr_steering_buf = 0;
290   nitedrvr_steering_val = 0;
291   nitedrvr_crash_en = 0;
292   nitedrvr_crash_data = 0x0f;
293   nitedrvr_crash_data_en = 0;
294   ac_line = 0;
295   last_steering_val = 0;
296
297   timer_pulse(PERIOD_OF_555_ASTABLE(RES_K(180), 330, CAP_U(1)), NULL, 0, nitedrvr_crash_toggle_callback);
298}
src/mame/mamedriv.c
r3115r3116
28262826   DRIVER( jdreddb )   /* Judge Dredd (Rev B) */
28272827
28282828   /* Video System ZN1 */
2829   DRIVER( vspsx )
2830   DRIVER( aerofgts )   /* Aero Fighters Special (TAIWAN) */
28292831   DRIVER( sncwgltd )   /* Sonic Wings Limited (JAPAN) */
28302832
28312833   /* Taito FX1a */
r3115r3116
38253827   DRIVER( doa )      /* 1996 */
38263828   DRIVER( sgt24h )   /* 1996 */
38273829   DRIVER( von )      /* 1996 */
3828   DRIVER( vonusa )   /* 1996 */
3830   DRIVER( vonj )      /* 1996 */
38293831   DRIVER( dynabb )   /* 1996 */
38303832   DRIVER( zerogun )   /* 1997 */
38313833   DRIVER( zerogunj )   /* 1997 */
38323834   DRIVER( dynmcopb )   /* 1998 */
38333835   DRIVER( dyndek2b )   /* 1998 */
38343836   DRIVER( pltkids )   /* 1998 */
3835   DRIVER( waverunr )   /* 199? */
38363837   DRIVER( rchase2 )   /* 199? */
38373838
38383839   /* Model 2C-CRX (TGPx4, SCSP sound board) */
38393840   DRIVER( skisuprg )   /* 1996 */
38403841   DRIVER( stcc )      /* 1996 */
3842   DRIVER( waverunr )   /* 1996 */
38413843   DRIVER( hotd )      /* 1997 */
38423844   DRIVER( overrev )   /* 1997 */
38433845   DRIVER( topskatr )   /* 1997 */
3846   DRIVER( topskatu )   /* 1997 */
38443847   DRIVER( bel )      /* 1998 */
38453848   DRIVER( dynmcopc )   /* 1998 */
38463849
r3115r3116
54555458   DRIVER( mnchmobl )   /* A2001      (c) 1983 + Centuri license */
54565459   DRIVER( marvins )   /* A2003      (c) 1983 */
54575460   DRIVER( madcrash )   /* A2005      (c) 1984 */
5458   DRIVER( vangrd2 )   /*            (c) 1984 */
5459   DRIVER( jcross )   /* .. */
5461   DRIVER( vangrd2 )   /* A2005      (c) 1984 */
54605462   DRIVER( mainsnk )   /* fill in */
54615463   DRIVER( canvas )   /*            (c) 1985 */
5464   DRIVER( jcross )   /* .. */
54625465   DRIVER( sgladiat )   /* A3006      (c) 1984 */
5463   DRIVER( hal21 )      /*            (c) 1985 */
5466   DRIVER( hal21 )      /* A4031      (c) 1985 */
54645467   DRIVER( hal21j )   /*            (c) 1985 (Japan) */
54655468   DRIVER( aso )      /*            (c) 1985 */
54665469   DRIVER( alphamis )   /*            (c) 1985 */
r3115r3116
54705473   DRIVER( athena )   /*       'UP' (c) 1986 */
54715474   DRIVER( fitegolf )   /*       'GU' (c) 1988 */
54725475   DRIVER( fitegol2 )   /*       'GU' (c) 1988 */
5473   DRIVER( countryc )   /*       'CC' (c) 1988 */
5476   DRIVER( countryc )   /* A7004 'CC' (c) 1988 */
54745477   DRIVER( ikari )      /* A5004 'IW' (c) 1986 */
5478   DRIVER( ikaria )   /* A5004 'IW' (c) 1986 */
54755479   DRIVER( ikarijp )   /* A5004 'IW' (c) 1986 (Japan) */
54765480   DRIVER( ikarijpb )   /* bootleg */
5477   DRIVER( victroad )   /*            (c) 1986 */
5478   DRIVER( dogosoke )   /*            (c) 1986 */
5479   DRIVER( dogosokj )   /* bootleg */
5481   DRIVER( victroad )   /* A6002      (c) 1986 */
5482   DRIVER( dogosoke )   /* A6002      (c) 1986 */
5483   DRIVER( dogosokb )   /* bootleg */
54805484   DRIVER( gwar )      /* A7003 'GV' (c) 1987 */
54815485   DRIVER( gwarj )      /* A7003 'GV' (c) 1987 (Japan) */
54825486   DRIVER( gwara )      /* A7003 'GV' (c) 1987 */
54835487   DRIVER( gwarb )      /* bootleg */
5484   DRIVER( bermudat )   /* A6003 'WW' (c) 1987 */
5485   DRIVER( bermudao )   /* A6003 'WW' (c) 1987 */
5486   DRIVER( bermudaa )   /* A6003 'WW' (c) 1987 */
5487   DRIVER( worldwar )   /* A6003 'WW' (c) 1987 */
5488   DRIVER( bermudat )   /*            (c) 1987 */
5489   DRIVER( bermudaj )   /*            (c) 1987 */
5490   DRIVER( bermudaa )   /* A6004 'WW' (c) 1987 */
5491   DRIVER( worldwar )   /* A6004 'WW' (c) 1987 */
54885492   DRIVER( psychos )   /*       'PS' (c) 1987 */
54895493   DRIVER( psychosj )   /*       'PS' (c) 1987 (Japan) */
54905494   DRIVER( chopper )   /* A7003 'KK' (c) 1988 */
r3115r3116
80288032   DRIVER( egghunt )   /* (c) 1995 Invi Image */
80298033   DRIVER( magic10 )   /* (c) 1995 A.W.P. Games */
80308034   DRIVER( magic10a )   /* (c) 1995 A.W.P. Games */
8035   DRIVER( magic10b )   /* (c) 1995 A.W.P. Games */
80318036   DRIVER( magic102 )   /* (c) 1997 ABM Games */
80328037   DRIVER( suprpool )   /* (c) 1997 ABM Games */
80338038   DRIVER( hotslot )   /* (c) 1996 ABM Electronics */
src/mame/includes/nitedrvr.h
r3115r3116
2424WRITE8_HANDLER( nitedrvr_out0_w );
2525WRITE8_HANDLER( nitedrvr_out1_w );
2626
27void nitedrvr_crash_toggle(running_machine *machine);
28void nitedrvr_register_machine_vars(void);
27MACHINE_RESET( nitedrvr );
28MACHINE_START( nitedrvr );
2929
3030
3131/*----------- defined in audio/nitedrvr.c -----------*/
src/mame/includes/asteroid.h
r3115r3116
1313INTERRUPT_GEN( llander_interrupt );
1414
1515READ8_HANDLER( asteroid_IN0_r );
16READ8_HANDLER( asteroib_IN0_r );
1716READ8_HANDLER( asterock_IN0_r );
1817READ8_HANDLER( asteroid_IN1_r );
1918READ8_HANDLER( asteroid_DSW1_r );
r3115r3116
2423
2524MACHINE_RESET( asteroid );
2625
27READ8_HANDLER( llander_IN0_r );
28
2926extern UINT8 *asteroid_ram1, *asteroid_ram2;
3027
3128/*----------- defined in audio/asteroid.c -----------*/
src/mame/includes/mhavoc.h
r3115r3116
3131WRITE8_HANDLER( mhavoc_ram_banksel_w );
3232WRITE8_HANDLER( mhavoc_rom_banksel_w );
3333
34READ8_HANDLER( mhavoc_port_0_r );
35READ8_HANDLER( alphaone_port_0_r );
36READ8_HANDLER( mhavoc_port_1_r );
37READ8_HANDLER( mhavoc_port_1_sp_r );
34CUSTOM_INPUT( tms5220_r );
35CUSTOM_INPUT( gamma_rcvd_r );
36CUSTOM_INPUT( gamma_xmtd_r );
37CUSTOM_INPUT( alpha_rcvd_r );
38CUSTOM_INPUT( alpha_xmtd_r );
39CUSTOM_INPUT( mhavoc_bit67_r );
3840
3941WRITE8_HANDLER( mhavoc_out_0_w );
4042WRITE8_HANDLER( alphaone_out_0_w );
src/mame/includes/balsente.h
r3115r3116
5959WRITE8_HANDLER( balsente_dac_data_w );
6060WRITE8_HANDLER( balsente_register_addr_w );
6161
62READ8_HANDLER( nstocker_port2_r );
62CUSTOM_INPUT( nstocker_bits_r );
6363WRITE8_HANDLER( spiker_expand_w );
6464READ8_HANDLER( spiker_expand_r );
6565READ8_HANDLER( grudge_steering_r );
src/mame/includes/dkong.h
r3115r3116
4747#define HARDWARE_TRS02         2
4848#define HARDWARE_TKG02         3
4949
50#define DK2B_PALETTE_LENGTH      (256+256+8+1) // (256)
51#define DK4B_PALETTE_LENGTH      (256+256+8+1) // (256)
52#define DK3_PALETTE_LENGTH      (256+256+8+1) // (256)
50#define DK2B_PALETTE_LENGTH      (256+256+8+1) /*  (256) */
51#define DK4B_PALETTE_LENGTH      (256+256+8+1) /*  (256) */
52#define DK3_PALETTE_LENGTH      (256+256+8+1) /*  (256) */
5353#define RS_PALETTE_LENGTH      (256+256+8+1)
5454
5555typedef struct _dkong_state dkong_state;
r3115r3116
6161   UINT8   hardware_type;
6262
6363   /* sound state */
64   UINT8 page,mcustatus;
65   UINT8 portT;
6664
6765   /* video state */
6866   tilemap *bg_tilemap;
r3115r3116
9189   /* Save state relevant */
9290   UINT8   gfx_bank, palette_bank;
9391   UINT8   grid_on;
94   UINT8   snd02_enable;
95   UINT8   sig_ansn;
9692   UINT16   grid_col;
9793   UINT8   sprite_bank;
9894   UINT8   dma_latch;
r3115r3116
105101
106102/*----------- defined in video/dkong.c -----------*/
107103
108WRITE8_HANDLER( radarscp_snd02_w ); /* to daisy chain sound 02 signal */
109WRITE8_HANDLER( radarsc1_ansn_w ); /* to daisy chain sound 02 signal */
110
111104WRITE8_HANDLER( radarscp_grid_enable_w );
112105WRITE8_HANDLER( radarscp_grid_color_w );
113106WRITE8_HANDLER( dkong_flipscreen_w );
r3115r3116
131124
132125/*----------- defined in audio/dkong.c -----------*/
133126
134READ8_HANDLER( dkong_audio_status_r );
135127WRITE8_HANDLER( dkong_audio_irq_w );
136128
137WRITE8_HANDLER( dkong_snd_disc_w );
138WRITE8_HANDLER( dkong_sh_tuneselect_w );
139
140WRITE8_HANDLER( dkongjr_sh_test6_w );
141WRITE8_HANDLER( dkongjr_sh_tuneselect_w );
142
143WRITE8_HANDLER( dkongjr_snd_w1 );
144WRITE8_HANDLER( dkongjr_snd_w2 );
145
146129MACHINE_DRIVER_EXTERN( radarscp_audio );
147130MACHINE_DRIVER_EXTERN( dkong2b_audio );
148131MACHINE_DRIVER_EXTERN( dkongjr_audio );
src/mame/includes/playch10.h
r3115r3116
1717DRIVER_INIT( pchboard );   /* h-board games */
1818DRIVER_INIT( pciboard );   /* i-board games */
1919DRIVER_INIT( pckboard );   /* k-board games */
20READ8_HANDLER( pc10_port_0_r );
20CUSTOM_INPUT( pc10_int_detect_r );
2121READ8_HANDLER( pc10_prot_r );
2222READ8_HANDLER( pc10_detectclr_r );
2323READ8_HANDLER( pc10_in0_r );
src/mame/includes/snk.h
r3115r3116
88
99extern UINT8 *snk_rambase;
1010
11extern INTERRUPT_GEN( snk_irq_AB );
12extern INTERRUPT_GEN( snk_irq_BA );
13
1411extern READ8_HANDLER ( snk_cpuA_nmi_trigger_r );
1512extern WRITE8_HANDLER( snk_cpuA_nmi_ack_w );
1613
1714extern READ8_HANDLER ( snk_cpuB_nmi_trigger_r );
1815extern WRITE8_HANDLER( snk_cpuB_nmi_ack_w );
1916
20extern int snk_gamegroup;
21extern int snk_sound_busy_bit;
22extern int snk_irq_delay;
2317
24
2518/*----------- defined in video/snk.c -----------*/
2619
27extern VIDEO_START( snk );
28extern VIDEO_START( snk_3bpp_shadow );
29extern VIDEO_START( snk_4bpp_shadow );
20extern PALETTE_INIT( tnk3 );
21
22extern VIDEO_START( jcross );
3023extern VIDEO_START( sgladiat );
24extern VIDEO_START( tnk3 );
25extern VIDEO_START( aso );
26extern VIDEO_START( ikari );
27extern VIDEO_START( gwar );
28extern VIDEO_START( tdfever );
3129
3230extern VIDEO_UPDATE( tnk3 );
33extern VIDEO_UPDATE( athena );
3431extern VIDEO_UPDATE( ikari );
32extern VIDEO_UPDATE( gwar );
3533extern VIDEO_UPDATE( tdfever );
36extern VIDEO_UPDATE( gwar );
37extern VIDEO_UPDATE( sgladiat );
3834
39void tnk3_draw_text( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, UINT8 *source );
40void tnk3_draw_status( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, UINT8 *source );
35extern WRITE8_HANDLER( snk_bg_scrollx_w );
36extern WRITE8_HANDLER( snk_bg_scrolly_w );
37extern WRITE8_HANDLER( snk_sp16_scrollx_w );
38extern WRITE8_HANDLER( snk_sp16_scrolly_w );
39extern WRITE8_HANDLER( snk_sp32_scrollx_w );
40extern WRITE8_HANDLER( snk_sp32_scrolly_w );
4141
42extern WRITE8_HANDLER( jcross_scroll_msb_w );
43extern WRITE8_HANDLER( sgladiat_scroll_msb_w );
44extern WRITE8_HANDLER( sgladiat_flipscreen_w );
45extern WRITE8_HANDLER( tnk3_videoattrs_w );
46extern WRITE8_HANDLER( aso_videoattrs_w );
47extern WRITE8_HANDLER( aso_bg_bank_w );
48extern WRITE8_HANDLER( ikari_bg_scroll_msb_w );
49extern WRITE8_HANDLER( ikari_sp_scroll_msb_w );
50extern WRITE8_HANDLER( ikari_unknown_video_w );
51extern WRITE8_HANDLER( gwar_fg_bank_w );
52extern WRITE8_HANDLER( gwar_videoattrs_w );
53extern WRITE8_HANDLER( gwar_sprite_split_point_w );
54extern WRITE8_HANDLER( gwara_videoattrs_w );
55extern WRITE8_HANDLER( gwara_sp_scroll_msb_w );
56extern WRITE8_HANDLER( tdfever_sp_scroll_msb_w );
57extern WRITE8_HANDLER( tdfever_spriteram_w );
4258
59extern UINT8 *snk_fg_videoram;
60extern UINT8 *snk_bg_videoram;
61extern WRITE8_HANDLER( snk_fg_videoram_w );
62extern WRITE8_HANDLER( snk_bg_videoram_w );
63extern WRITE8_HANDLER( aso_bg_videoram_w );
64
4365/*----------- defined in drivers/hal21.c -----------*/
4466
4567extern PALETTE_INIT( aso );
src/mame/includes/starshp1.h
r3115r3116
1616 *  12MHz signal, effecitvely doubling the horizontal resolution
1717 */
1818
19#include "sound/discrete.h"
20
21
1922#define STARSHP1_MASTER_CLOCK      (12096000)
2023#define STARSHP1_CPU_CLOCK         (STARSHP1_MASTER_CLOCK / 16)
2124#define STARSHP1_PIXEL_CLOCK      (STARSHP1_MASTER_CLOCK / 2)
r3115r3116
6770VIDEO_UPDATE( starshp1 );
6871VIDEO_EOF( starshp1 );
6972VIDEO_START( starshp1 );
73
74
75/*----------- defined in sound/starshp1.c -----------*/
76
77DISCRETE_SOUND_EXTERN( starshp1 );
78
79/* Discrete Sound Input Nodes */
80#define STARSHP1_NOISE_AMPLITUDE   NODE_01
81#define STARSHP1_TONE_PITCH         NODE_02
82#define   STARSHP1_MOTOR_SPEED      NODE_03
83#define   STARSHP1_NOISE_FREQ         NODE_04
84#define   STARSHP1_MOLVL            NODE_05
85#define   STARSHP1_SL2            NODE_06
86#define   STARSHP1_SL1            NODE_07
87#define   STARSHP1_KICKER            NODE_08
88#define   STARSHP1_PHASOR_ON         NODE_09
89#define   STARSHP1_ATTRACT         NODE_10
src/mame/includes/iremipt.h
r3115r3116
259259   IREM_COIN_MODE_2_DSW1_LOC(DIPBANK)
260260
261261
262/* New Coin Mode 1, introduced in later m72 games (m72 early games have different Coinage) */ \
262/* New Coin Mode 1, introduced in later m72 games (m72 early games have different Coinage) */
263263
264264#define IREM_COIN_MODE_1_NEW \
265265   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:5,6,7,8") \
src/mame/includes/megasys1.h
r3115r3116
8080
8181
8282#define COINAGE_6BITS \
83   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )\
84   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )\
85   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )\
86   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )\
87   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) )\
88   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )\
89   PORT_DIPSETTING(    0x01, DEF_STR( 1C_4C ) )\
90   PORT_DIPSETTING(    0x06, DEF_STR( 1C_5C ) )\
91   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )\
92   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )\
93   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )\
94   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )\
95   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )\
96   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )\
97   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )\
98   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )\
99   PORT_DIPSETTING(    0x08, DEF_STR( 1C_4C ) )\
100   PORT_DIPSETTING(    0x30, DEF_STR( 1C_5C ) )\
83   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )\
84   PORT_DIPSETTING(      0x0400, DEF_STR( 3C_1C ) )\
85   PORT_DIPSETTING(      0x0200, DEF_STR( 2C_1C ) )\
86   PORT_DIPSETTING(      0x0700, DEF_STR( 1C_1C ) )\
87   PORT_DIPSETTING(      0x0300, DEF_STR( 1C_2C ) )\
88   PORT_DIPSETTING(      0x0500, DEF_STR( 1C_3C ) )\
89   PORT_DIPSETTING(      0x0100, DEF_STR( 1C_4C ) )\
90   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_5C ) )\
91   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )\
92   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )\
93   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )\
94   PORT_DIPSETTING(      0x2000, DEF_STR( 3C_1C ) )\
95   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )\
96   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )\
97   PORT_DIPSETTING(      0x1800, DEF_STR( 1C_2C ) )\
98   PORT_DIPSETTING(      0x2800, DEF_STR( 1C_3C ) )\
99   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_4C ) )\
100   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_5C ) )\
101101
102102#define COINAGE_6BITS_2 \
103   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )\
104   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )\
105   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )\
106   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )\
107   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )\
108   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )\
109   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )\
110   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )\
111   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )\
112   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )\
113   PORT_DIPSETTING(    0x08, DEF_STR( 4C_1C ) )\
114   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )\
115   PORT_DIPSETTING(    0x18, DEF_STR( 2C_1C ) )\
116   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )\
117   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )\
118   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )\
119   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )\
120   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )\
103   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )\
104   PORT_DIPSETTING(      0x0100, DEF_STR( 4C_1C ) )\
105   PORT_DIPSETTING(      0x0200, DEF_STR( 3C_1C ) )\
106   PORT_DIPSETTING(      0x0300, DEF_STR( 2C_1C ) )\
107   PORT_DIPSETTING(      0x0700, DEF_STR( 1C_1C ) )\
108   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_2C ) )\
109   PORT_DIPSETTING(      0x0500, DEF_STR( 1C_3C ) )\
110   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )\
111   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )\
112   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )\
113   PORT_DIPSETTING(      0x0800, DEF_STR( 4C_1C ) )\
114   PORT_DIPSETTING(      0x1000, DEF_STR( 3C_1C ) )\
115   PORT_DIPSETTING(      0x1800, DEF_STR( 2C_1C ) )\
116   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )\
117   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_2C ) )\
118   PORT_DIPSETTING(      0x2800, DEF_STR( 1C_3C ) )\
119   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )\
120   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )\
121121
122122#define COINAGE_8BITS \
123   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )\
124   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )\
125   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )\
126   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )\
127   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )\
128/*  PORT_DIPSETTING(    0x05, DEF_STR( 1C_1C ) )*/   \
129/*  PORT_DIPSETTING(    0x04, DEF_STR( 1C_1C ) )*/   \
130/*  PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )*/   \
131/*  PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )*/   \
132/*  PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )*/   \
133   PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )\
134   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )\
135   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )\
136   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )\
137   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )\
138   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )\
139   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )\
140   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )\
141   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )\
142   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )\
143   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )\
144   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )\
145/*  PORT_DIPSETTING(    0x50, DEF_STR( 1C_1C ) )*/   \
146/*  PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )*/   \
147/*  PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )*/   \
148/*  PORT_DIPSETTING(    0x20, DEF_STR( 1C_1C ) )*/   \
149/*  PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )*/   \
150   PORT_DIPSETTING(    0x60, DEF_STR( 2C_3C ) )\
151   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )\
152   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )\
153   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )\
154   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )\
155   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )\
156   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
123   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) )\
124   PORT_DIPSETTING(      0x0007, DEF_STR( 4C_1C ) )\
125   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )\
126   PORT_DIPSETTING(      0x0009, DEF_STR( 2C_1C ) )\
127   PORT_DIPSETTING(      0x000f, DEF_STR( 1C_1C ) )\
128/*  PORT_DIPSETTING(      0x0005, DEF_STR( 1C_1C ) )*/\
129/*  PORT_DIPSETTING(      0x0004, DEF_STR( 1C_1C ) )*/\
130/*  PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) )*/\
131/*  PORT_DIPSETTING(      0x0002, DEF_STR( 1C_1C ) )*/\
132/*  PORT_DIPSETTING(      0x0001, DEF_STR( 1C_1C ) )*/\
133   PORT_DIPSETTING(      0x0006, DEF_STR( 2C_3C ) )\
134   PORT_DIPSETTING(      0x000e, DEF_STR( 1C_2C ) )\
135   PORT_DIPSETTING(      0x000d, DEF_STR( 1C_3C ) )\
136   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_4C ) )\
137   PORT_DIPSETTING(      0x000b, DEF_STR( 1C_5C ) )\
138   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )\
139   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )\
140   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B ) )\
141   PORT_DIPSETTING(      0x0070, DEF_STR( 4C_1C ) )\
142   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C ) )\
143   PORT_DIPSETTING(      0x0090, DEF_STR( 2C_1C ) )\
144   PORT_DIPSETTING(      0x00f0, DEF_STR( 1C_1C ) )\
145/*  PORT_DIPSETTING(      0x0050, DEF_STR( 1C_1C ) )*/\
146/*  PORT_DIPSETTING(      0x0040, DEF_STR( 1C_1C ) )*/\
147/*  PORT_DIPSETTING(      0x0030, DEF_STR( 1C_1C ) )*/\
148/*  PORT_DIPSETTING(      0x0020, DEF_STR( 1C_1C ) )*/\
149/*  PORT_DIPSETTING(      0x0010, DEF_STR( 1C_1C ) )*/\
150   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_3C ) )\
151   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_2C ) )\
152   PORT_DIPSETTING(      0x00d0, DEF_STR( 1C_3C ) )\
153   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_4C ) )\
154   PORT_DIPSETTING(      0x00b0, DEF_STR( 1C_5C ) )\
155   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_6C ) )\
156   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
157157
158158
159159/***************************************************************************
src/mame/includes/galaxold.h
r3115r3116
136136WRITE8_HANDLER( kingball_sound2_w );
137137
138138WRITE8_HANDLER( _4in1_bank_w );
139READ8_HANDLER( _4in1_input_port_1_r );
140READ8_HANDLER( _4in1_input_port_2_r );
139CUSTOM_INPUT( _4in1_fake_port_r );
141140
142141WRITE8_HANDLER( zigzag_sillyprotection_w );
143142
144143INTERRUPT_GEN( hunchbks_vh_interrupt );
145144INTERRUPT_GEN( gmgalax_vh_interrupt );
146145
147READ8_HANDLER( gmgalax_input_port_0_r );
148READ8_HANDLER( gmgalax_input_port_1_r );
149READ8_HANDLER( gmgalax_input_port_2_r );
150146
151
152147/*----------- defined in machine/scramble.c -----------*/
153148
154149extern const ppi8255_interface scramble_ppi_ppi8255_intf[2];
src/mame/includes/nb1413m3.h
r3115r3116
142142READ8_HANDLER( nb1413m3_dipsw3_h_r );
143143WRITE8_HANDLER( nb1413m3_outcoin_w );
144144WRITE8_HANDLER( nb1413m3_vcrctrl_w );
145CUSTOM_INPUT( nb1413m3_busyflag_r );
146CUSTOM_INPUT( nb1413m3_outcoin_flag_r );
145147
146148/* used in: hyhoo.c, niyanpai.c, pastelg.c, nbmj8688.c, nbmj8891.c, nbmj8991.c, nbmj9195.c*/
147149INPUT_PORTS_EXTERN( nbmjcontrols );
src/mame/mame.mak
r3115r3116
6868CPUS += V60
6969CPUS += V70
7070CPUS += I8035
71CPUS += I8041
72CPUS += I8048
73CPUS += I8648
74CPUS += I8748
75CPUS += MB8884
7176CPUS += I8039
72CPUS += I8048
77CPUS += I8049
7378CPUS += I8749
7479CPUS += N7751
75CPUS += MB8884
7680CPUS += M58715
7781CPUS += I8X41
7882CPUS += I8051
r3115r3116
526530   $(DRIVERS)/sprint2.o $(AUDIO)/sprint2.o $(VIDEO)/sprint2.o \
527531   $(DRIVERS)/sprint4.o $(VIDEO)/sprint4.o $(AUDIO)/sprint4.o \
528532   $(DRIVERS)/sprint8.o $(VIDEO)/sprint8.o \
529   $(DRIVERS)/starshp1.o $(VIDEO)/starshp1.o \
533   $(DRIVERS)/starshp1.o $(AUDIO)/starshp1.o $(VIDEO)/starshp1.o \
530534   $(DRIVERS)/starwars.o $(MACHINE)/starwars.o $(AUDIO)/starwars.o \
531535   $(DRIVERS)/subs.o $(MACHINE)/subs.o $(AUDIO)/subs.o $(VIDEO)/subs.o \
532536   $(DRIVERS)/tank8.o $(AUDIO)/tank8.o $(VIDEO)/tank8.o \
r3115r3116
742746$(MAMEOBJ)/gametron.a: \
743747   $(DRIVERS)/gotya.o $(AUDIO)/gotya.o $(VIDEO)/gotya.o \
744748   $(DRIVERS)/sbugger.o $(VIDEO)/sbugger.o \
745   $(DRIVERS)/gatron.o \
749   $(DRIVERS)/gatron.o $(VIDEO)/gatron.o \
746750
747751$(MAMEOBJ)/gottlieb.a: \
748752   $(DRIVERS)/exterm.o $(VIDEO)/exterm.o \
r3115r3116
12611265   $(DRIVERS)/dmndrby.o \
12621266   $(DRIVERS)/hal21.o \
12631267   $(DRIVERS)/hng64.o $(VIDEO)/hng64.o \
1264   $(DRIVERS)/jcross.o $(VIDEO)/jcross.o \
12651268   $(DRIVERS)/lasso.o $(VIDEO)/lasso.o \
12661269   $(DRIVERS)/mainsnk.o $(VIDEO)/mainsnk.o \
12671270   $(DRIVERS)/marvins.o $(VIDEO)/marvins.o \
12681271   $(DRIVERS)/munchmo.o $(VIDEO)/munchmo.o \
12691272   $(DRIVERS)/prehisle.o $(VIDEO)/prehisle.o \
12701273   $(DRIVERS)/rockola.o $(AUDIO)/rockola.o $(VIDEO)/rockola.o \
1271   $(DRIVERS)/sgladiat.o \
12721274   $(DRIVERS)/snk.o $(VIDEO)/snk.o \
12731275   $(DRIVERS)/snk68.o $(VIDEO)/snk68.o \
12741276
r3115r3116
17111713
17121714$(DRIVERS)/funworld.o:   $(LAYOUT)/funworld.lh
17131715
1716$(DRIVERS)/gatron.o:   $(LAYOUT)/poker41.lh \
1717                  $(LAYOUT)/pulltabs.lh
1718
17141719$(DRIVERS)/lazercmd.o:   $(LAYOUT)/lazercmd.lh
17151720
17161721$(DRIVERS)/lucky74.o:   $(LAYOUT)/lucky74.lh
src/mame/video/hd63484.c
r3115r3116
318318         logerror ("Graphic bit mode not supported\n");
319319   }
320320
321   // bpp = 4;          // for skattva
322   // bitmask = 0x000f; // for skattva
323
321324   if (x >= 0)
322325   {
323326      x_int = x / (16 / bpp);
r3115r3116
332335         x_mod = (16 / bpp) - x_mod;
333336      }
334337   }
338
335339   color &= bitmask;
336340
337341   bitmask_shifted = bitmask << (x_mod * bpp);
r3115r3116
455459   dst = (x_int + y * 1);
456460
457461   if ((pattern[dst] & bitmask_shifted) >> (x_mod * bpp))
458      return 1; //cl1
462      return 1;
459463   else
460      return 0; //cl0
464      return 0;
461465}
462466
463467static void agcpy(int opcode,int src_x,int src_y,int dst_x,int dst_y,INT16 _ax,INT16 _ay)
r3115r3116
622626
623627static void ptn(int opcode,int src_x,int src_y,INT16 _ax,INT16 _ay)
624628{
625   int dst_step1_x,dst_step1_y,dst_step2_x,dst_step2_y;
629   int dst_step1_x = 0,dst_step1_y = 0,dst_step2_x = 0,dst_step2_y = 0;
626630   int src_step1_x,src_step1_y,src_step2_x,src_step2_y;
627631   int ax = _ax;
628632   int ay = _ay;
r3115r3116
631635   int yys = src_y;
632636   int xxd = cpx;
633637   int yyd = cpy;
638   int getpixel;
634639
635640   if (ax < 0)
636641      ax_neg = -1;
r3115r3116
645650      switch (opcode & 0x0700)
646651      {
647652         default:
648         case 0x0000: dst_step1_x =  1; dst_step1_y =  0; dst_step2_x = -ay_neg*ay; dst_step2_y =   1; break;
649         case 0x0100: dst_step1_x =  1; dst_step1_y =  0; dst_step2_x = -ay_neg*ay; dst_step2_y =  -1; break;
650         case 0x0200: dst_step1_x = -1; dst_step1_y =  0; dst_step2_x =  ay_neg*ay; dst_step2_y =   1; break;
651         case 0x0300: dst_step1_x = -1; dst_step1_y =  0; dst_step2_x =  ay_neg*ay; dst_step2_y =  -1; break;
652         case 0x0400: dst_step1_x =  0; dst_step1_y =  1; dst_step2_x =  1; dst_step2_y = -ay_neg*ay; break;
653         case 0x0500: dst_step1_x =  0; dst_step1_y = -1; dst_step2_x =  1; dst_step2_y =  ay_neg*ay; break;
654         case 0x0600: dst_step1_x =  0; dst_step1_y =  1; dst_step2_x = -1; dst_step2_y = -ay_neg*ay; break;
655         case 0x0700: dst_step1_x =  0; dst_step1_y = -1; dst_step2_x = -1; dst_step2_y =  ay_neg*ay; break;
653         case 0x0000: logerror("PTN: not supported"); break;
654         case 0x0100: logerror("PTN: not supported"); break;
655         case 0x0200: logerror("PTN: not supported"); break;
656         case 0x0300: logerror("PTN: not supported"); break;
657         case 0x0400: logerror("PTN: not supported"); break;
658          case 0x0500: logerror("PTN: not supported"); break;
659         case 0x0600: logerror("PTN: not supported"); break;
660         case 0x0700: logerror("PTN: not supported"); break;
656661      }
657662   else
658663      switch (opcode & 0x0700)
659664      {
660665         default:
661         case 0x0000: dst_step1_x =  1; dst_step1_y =  0; dst_step2_x = -ax_neg*ax; dst_step2_y =   1; break;
662         case 0x0100: dst_step1_x =  1; dst_step1_y =  0; dst_step2_x = -ax_neg*ax; dst_step2_y =  -1; break;
663         case 0x0200: dst_step1_x = -1; dst_step1_y =  0; dst_step2_x =  ax_neg*ax; dst_step2_y =   1; break;
664         case 0x0300: dst_step1_x = -1; dst_step1_y =  0; dst_step2_x =  ax_neg*ax; dst_step2_y =  -1; break;
665         case 0x0400: dst_step1_x =  0; dst_step1_y =  1; dst_step2_x =  1; dst_step2_y =  ax_neg*ax; break;
666         case 0x0500: dst_step1_x =  0; dst_step1_y = -1; dst_step2_x =  1; dst_step2_y = -ax_neg*ax; break;
667         case 0x0600: dst_step1_x =  0; dst_step1_y =  1; dst_step2_x = -1; dst_step2_y =  ax_neg*ax; break;
668         case 0x0700: dst_step1_x =  0; dst_step1_y = -1; dst_step2_x = -1; dst_step2_y = -ax_neg*ax; break;
666         case 0x0000: dst_step1_x =  1; dst_step1_y =  0; dst_step2_x = -ax_neg*ax; dst_step2_y =  1; break;
667         case 0x0100: logerror("PTN: not supported"); break;
668         case 0x0200: dst_step1_x =  0; dst_step1_y =  1; dst_step2_x = -1; dst_step2_y = -ax_neg*ax; break;
669         case 0x0300: logerror("PTN: not supported"); break;
670         case 0x0400: dst_step1_x = -1; dst_step1_y =  0; dst_step2_x =  ax_neg*ax; dst_step2_y = -1; break;
671         case 0x0500: logerror("PTN: not supported"); break;
672         case 0x0600: dst_step1_x =  0; dst_step1_y = -1; dst_step2_x =  1; dst_step2_y =  ax_neg*ax; break;
673         case 0x0700: logerror("PTN: not supported"); break;
669674      }
670675
671   if ((_ax >= 0) && (_ay >= 0) && ((opcode & 0x0800) == 0x0000))
672      { src_step1_x =  1; src_step1_y =  0; src_step2_x = -ax; src_step2_y =   1; }
673   else if ((_ax >= 0) && (_ay < 0) && ((opcode & 0x0800) == 0x0000))
674      { src_step1_x =  1; src_step1_y =  0; src_step2_x = -ax; src_step2_y =  -1; }
675   else if ((_ax < 0) && (_ay >= 0) && ((opcode & 0x0800) == 0x0000))
676      { src_step1_x = -1; src_step1_y =  0; src_step2_x = -ax; src_step2_y =   1; }
677   else if ((_ax < 0) && (_ay < 0) && ((opcode & 0x0800) == 0x0000))
678      { src_step1_x = -1; src_step1_y =  0; src_step2_x = -ax; src_step2_y =  -1; }
679   else if ((_ax >= 0) && (_ay >= 0) && ((opcode & 0x0800) == 0x0800))
680      { src_step1_x =  0; src_step1_y =  1; src_step2_x =   1; src_step2_y = -ay; }
681   else if ((_ax >= 0) && (_ay < 0) && ((opcode & 0x0800) == 0x0800))
682      { src_step1_x =  0; src_step1_y = -1; src_step2_x =   1; src_step2_y = -ay; }
683   else if ((_ax < 0) && (_ay >= 0) && ((opcode & 0x0800) == 0x0800))
684      { src_step1_x =  0; src_step1_y =  1; src_step2_x =  -1; src_step2_y = -ay; }
685   else // ((_ax < 0) && (_ay < 0) && ((opcode & 0x0800) == 0x0800))
686      { src_step1_x =  0; src_step1_y = -1; src_step2_x =  -1; src_step2_y = -ay; }
676   src_step1_x =  1; src_step1_y =  0; src_step2_x = -ax; src_step2_y =  1;
687677
688678   for (;;)
689679   {
690680      for (;;)
691681      {
692         dot(xxd,yyd,opcode & 0x0007,get_pixel_ptn(xxs,yys));
682         getpixel = get_pixel_ptn(xxs,yys);
683         switch ((opcode & 0x0018) >> 3)
684         {
685            case 0x0000:
686               if (getpixel)
687                  dot(xxd,yyd,opcode & 0x0007,cl1);
688               else
689                  dot(xxd,yyd,opcode & 0x0007,cl0);
690               break;
691            case 0x0001:
692               if (getpixel)
693                  dot(xxd,yyd,opcode & 0x0007,cl1);
694               break;
695            case 0x0002:
696               if (getpixel == 0)
697                  dot(xxd,yyd,opcode & 0x0007,cl0);
698               break;
699            case 0x0003:
700               logerror("PTN: not supported"); break;
701               break;
702         }
693703
694704         if (opcode & 0x0800)
695705         {
r3115r3116
782792
783793void line(INT16 sx, INT16 sy, INT16 ex, INT16 ey, INT16 col)
784794{
785
786795         INT16 ax,ay;
787796
788797         int cpx_t=sx;
r3115r3116
795804         {
796805            while (ax)
797806            {
798               dot(cpx_t,cpy_t,col,cl0);
807               dot(cpx_t,cpy_t,col & 7,cl0);
799808
800809               if (ax > 0)
801810               {
r3115r3116
814823         {
815824            while (ay)
816825            {
817               dot(cpx_t,cpy_t,col,cl0);
826               dot(cpx_t,cpy_t,col & 7,cl0);
818827
819828               if (ay > 0)
820829               {
r3115r3116
832841
833842}
834843
844void paint(int sx, int sy, int col)
845{
846   int getpixel;
847   dot(sx,sy,0,col);
848
849   getpixel = get_pixel(sx+1,sy);
850   switch ((HD63484_reg[0x02/2] & 0x700) >> 8)
851   {
852      case 0:
853         break;
854      case 1:
855         break;
856      case 2:
857         getpixel = (getpixel << 12) | (getpixel << 8) | (getpixel << 4) | (getpixel << 0);
858         break;
859      case 3:
860         getpixel = (getpixel << 8) | (getpixel << 0);
861         break;
862      case 4:
863         break;
864
865      default:
866         logerror ("Graphic bit mode not supported\n");
867   }
868   if ((getpixel != col) && (getpixel != edg))
869      {
870         sx++;
871         paint(sx,sy,col);
872         sx--;
873      }
874
875   getpixel = get_pixel(sx-1,sy);
876   switch ((HD63484_reg[0x02/2] & 0x700) >> 8)
877   {
878      case 0:
879         break;
880      case 1:
881         break;
882      case 2:
883         getpixel = (getpixel << 12) | (getpixel << 8) | (getpixel << 4) | (getpixel << 0);
884         break;
885      case 3:
886         getpixel = (getpixel << 8) | (getpixel << 0);
887         break;
888      case 4:
889         break;
890
891      default:
892         logerror ("Graphic bit mode not supported\n");
893   }
894   if ((getpixel != col) && (getpixel != edg))
895      {
896         sx--;
897         paint(sx,sy,col);
898         sx++;
899      }
900
901   getpixel = get_pixel(sx,sy+1);
902   switch ((HD63484_reg[0x02/2] & 0x700) >> 8)
903   {
904      case 0:
905         break;
906      case 1:
907         break;
908      case 2:
909         getpixel = (getpixel << 12) | (getpixel << 8) | (getpixel << 4) | (getpixel << 0);
910         break;
911      case 3:
912         getpixel = (getpixel << 8) | (getpixel << 0);
913         break;
914      case 4:
915         break;
916
917      default:
918         logerror ("Graphic bit mode not supported\n");
919   }
920   if ((getpixel != col) && (getpixel != edg))
921      {
922         sy++;
923         paint(sx,sy,col);
924         sy--;
925      }
926
927   getpixel = get_pixel(sx,sy-1);
928   switch ((HD63484_reg[0x02/2] & 0x700) >> 8)
929   {
930      case 0:
931         break;
932      case 1:
933         break;
934      case 2:
935         getpixel = (getpixel << 12) | (getpixel << 8) | (getpixel << 4) | (getpixel << 0);
936         break;
937      case 3:
938         getpixel = (getpixel << 8) | (getpixel << 0);
939         break;
940      case 4:
941         break;
942
943      default:
944         logerror ("Graphic bit mode not supported\n");
945   }
946   if ((getpixel != col) && (getpixel != edg))
947      {
948         sy--;
949         paint(sx,sy,col);
950         sy++;
951      }
952}
953
835954static void HD63484_command_w(UINT16 cmd)
836955{
837956   int len;
r3115r3116
852971
853972   if (fifo_counter >= len)
854973   {
855/*
856974      int i;
857975
858      printf("PC %05x: HD63484 command %s (%04x) ",activecpu_get_pc(),instruction_name[fifo[0]>>10],fifo[0]);
976      logerror("PC %05x: HD63484 command %s (%04x) ",activecpu_get_pc(),instruction_name[fifo[0]>>10],fifo[0]);
859977      for (i = 1;i < fifo_counter;i++)
860         printf("%04x ",fifo[i]);
861      printf("\n");
862*/
978         logerror("%04x ",fifo[i]);
979      logerror("\n");
980
863981      if (fifo[0] == 0x0400) { /* ORG */
864982         org = ((fifo[1] & 0x00ff) << 12) | ((fifo[2] & 0xfff0) >> 4);
865983         org_dpd = fifo[2] & 0x000f;
r3115r3116
9091027               rwp_dn = (fifo[1] & 0xc000) >> 14;
9101028            }
9111029         else if (fifo[0] == 0x080d)
912            rwp = (rwp & 0xff000) | ((fifo[1] & 0xfff0) >> 4);
1030            {
1031               rwp = (rwp & 0xff000) | ((fifo[1] & 0xfff0) >> 4);
1032            }
9131033         else
914logerror("unsupported register\n");
1034            logerror("unsupported register\n");
9151035      }
9161036      else if ((fifo[0] & 0xfff0) == 0x1800)   /* WPTN */
9171037      {
r3115r3116
9281048      }
9291049      else if (fifo[0] == 0x4800)   /* WT */
9301050      {
931         if (!input_code_pressed(KEYCODE_9)) HD63484_ram[rwp] = fifo[1];
1051         HD63484_ram[rwp] = fifo[1];
9321052         rwp = (rwp + 1) & (HD63484_RAM_SIZE-1);
9331053      }
9341054      else if (fifo[0] == 0x5800)   /* CLR */
9351055      {
9361056         doclr16(fifo[0],fifo[1],&rwp,fifo[2],fifo[3]);
9371057
938      /*
9391058            {
9401059                int fifo2 = (int)fifo[2],fifo3 = (int)fifo[3];
9411060                if (fifo2<0) fifo2 *= -1;
9421061                if (fifo3<0) fifo3 *= -1;
9431062                rwp += ((fifo2+1)*(fifo3+1));
9441063            }
945            */
1064
9461065      }
9471066      else if ((fifo[0] & 0xfffc) == 0x5c00)   /* SCLR */
9481067      {
9491068         doclr16(fifo[0],fifo[1],&rwp,fifo[2],fifo[3]);
9501069
951      /*
9521070            {
9531071                int fifo2 = (int)fifo[2],fifo3 = (int)fifo[3];
9541072                if (fifo2<0) fifo2 *= -1;
9551073                if (fifo3<0) fifo3 *= -1;
9561074                rwp += ((fifo2+1)*(fifo3+1));
9571075            }
958            */
1076
9591077      }
9601078      else if ((fifo[0] & 0xf0ff) == 0x6000)   /* CPY */
9611079      {
9621080         docpy16(fifo[0],((fifo[1] & 0x00ff) << 12) | ((fifo[2] & 0xfff0) >> 4),&rwp,fifo[3],fifo[4]);
9631081
964      /*
9651082            {
9661083                int fifo2 = (int)fifo[2],fifo3 = (int)fifo[3];
9671084                if (fifo2<0) fifo2 *= -1;
9681085                if (fifo3<0) fifo3 *= -1;
9691086                rwp += ((fifo2+1)*(fifo3+1));
9701087            }
971            */
1088
9721089      }
9731090      else if ((fifo[0] & 0xf0fc) == 0x7000)   /* SCPY */
9741091      {
9751092         docpy16(fifo[0],((fifo[1] & 0x00ff) << 12) | ((fifo[2] & 0xfff0) >> 4),&rwp,fifo[3],fifo[4]);
9761093
977      /*
9781094            {
9791095                int fifo2 = (int)fifo[2],fifo3 = (int)fifo[3];
9801096                if (fifo2<0) fifo2 *= -1;
9811097                if (fifo3<0) fifo3 *= -1;
9821098                rwp += ((fifo2+1)*(fifo3+1));
9831099            }
984            */
1100
9851101      }
9861102      else if (fifo[0] == 0x8000)   /* AMOVE */
9871103      {
r3115r3116
9951111      }
9961112      else if ((fifo[0] & 0xff00) == 0x8800)   /* ALINE */
9971113      {
998         line(cpx,cpy,fifo[1],fifo[2],fifo[0]&7);
1114         line(cpx,cpy,fifo[1],fifo[2],fifo[0] & 0xff);
9991115         cpx = (INT16)fifo[1];
10001116         cpy = (INT16)fifo[2];
10011117      }
10021118      else if ((fifo[0] & 0xff00) == 0x8c00)   /* RLINE */
10031119      {
1004         line(cpx,cpy,cpx+(INT16)fifo[1],cpy+(INT16)fifo[2],fifo[0]&7);
1120         line(cpx,cpy,cpx+(INT16)fifo[1],cpy+(INT16)fifo[2],fifo[0] & 0xff);
10051121         cpx += (INT16)fifo[1];
10061122         cpy += (INT16)fifo[2];
10071123      }
10081124      else if ((fifo[0] & 0xfff8) == 0x9000)   /* ARCT */
10091125      {
1010         line(cpx,cpy,(INT16)fifo[1],cpy,fifo[0]&7);
1011         line((INT16)fifo[1],cpy,(INT16)fifo[1],(INT16)fifo[2],fifo[0]&7);
1012         line((INT16)fifo[1],(INT16)fifo[2],cpx,(INT16)fifo[2],fifo[0]&7);
1013         line(cpx,(INT16)fifo[2],cpx,cpy,fifo[0]&7);
1126         line(cpx,cpy,(INT16)fifo[1],cpy,fifo[0] & 0xff);
1127         line((INT16)fifo[1],cpy,(INT16)fifo[1],(INT16)fifo[2],fifo[0] & 0xff);
1128         line((INT16)fifo[1],(INT16)fifo[2],cpx,(INT16)fifo[2],fifo[0] & 0xff);
1129         line(cpx,(INT16)fifo[2],cpx,cpy,fifo[0] & 0xff);
10141130         cpx = (INT16)fifo[1];
10151131         cpy = (INT16)fifo[2];
10161132      }
10171133      else if ((fifo[0] & 0xfff8) == 0x9400)   /* RRCT  added*/
10181134      {
1019         line(cpx,cpy,cpx+(INT16)fifo[1],cpy,fifo[0]&7);
1020         line(cpx+(INT16)fifo[1],cpy,cpx+(INT16)fifo[1],cpy+(INT16)fifo[2],fifo[0]&7);
1021         line(cpx+(INT16)fifo[1],cpy+(INT16)fifo[2],cpx,cpy+(INT16)fifo[2],fifo[0]&7);
1022         line(cpx,cpy+(INT16)fifo[2],cpx,cpy,fifo[0]&7);
1135         line(cpx,cpy,cpx+(INT16)fifo[1],cpy,fifo[0] & 0xff);
1136         line(cpx+(INT16)fifo[1],cpy,cpx+(INT16)fifo[1],cpy+(INT16)fifo[2],fifo[0] & 0xff);
1137         line(cpx+(INT16)fifo[1],cpy+(INT16)fifo[2],cpx,cpy+(INT16)fifo[2],fifo[0] & 0xff);
1138         line(cpx,cpy+(INT16)fifo[2],cpx,cpy,fifo[0] & 0xff);
10231139
10241140         cpx += (INT16)fifo[1];
10251141         cpy += (INT16)fifo[2];
r3115r3116
10561172         {
10571173            for (;;)
10581174            {
1059               dot(xx,yy,fifo[0] & 0x0007,cl0);
1175               dot(xx,yy,fifo[0] & 0x07,cl0);
10601176
10611177               if (ax == 0) break;
10621178               else if (ax > 0)
r3115r3116
10901206      }
10911207      else if ((fifo[0] & 0xfff8) == 0xc400)   /* RFRCT  added TODO*/
10921208      {
1093         line(cpx,cpy,cpx+(INT16)fifo[1],cpy,fifo[0]&7);
1094         line(cpx+fifo[1],cpy,cpx+fifo[1],cpy+fifo[2],fifo[0]&7);
1095         line(cpx+fifo[1],cpy+fifo[2],cpx,cpy+fifo[2],fifo[0]&7);
1096         line(cpx,cpy+fifo[2],cpx,cpy,fifo[0]&7);
1209         line(cpx,cpy,cpx+(INT16)fifo[1],cpy,fifo[0] & 0xff);
1210         line(cpx+fifo[1],cpy,cpx+fifo[1],cpy+fifo[2],fifo[0] & 0xff);
1211         line(cpx+fifo[1],cpy+fifo[2],cpx,cpy+fifo[2],fifo[0] & 0xff);
1212         line(cpx,cpy+fifo[2],cpx,cpy,fifo[0] & 0xff);
10971213
10981214         cpx=cpx+(INT16)fifo[1];
10991215         cpy=cpy+(INT16)fifo[2];
11001216      }
1217      else if (fifo[0] == 0xc800)   /* PAINT */
1218      {
1219         paint(cpx,cpy,cl0);
1220      }
11011221      else if ((fifo[0] & 0xfff8) == 0xcc00)   /* DOT */
11021222      {
1103         dot(cpx,cpy,fifo[0] & 0x0007,cl0);
1223         dot(cpx,cpy,fifo[0] & 0xff,cl0);
11041224      }
11051225      else if ((fifo[0] & 0xf000) == 0xd000)   /* PTN (to do) */
11061226      {
1107         // if ((fifo[0] & 0x0700) == 0x0400) printf("4");
1108         ptn(fifo[0] & 0x0007,psx,psy,pex - psx,pey - psy);
1227         ptn(fifo[0],psx,psy,pex - psx,pey - psy);
11091228
1110         cpx += pex - psx;
1111         cpy += pey - psy;
1229         if ((fifo[0] & 0x0800) == 0x0000)
1230            switch (fifo[0] & 0x0700)
1231            {
1232               case 0x0000:
1233                  if ((pey - psy) > 0)
1234                     cpy += (pey - psy);
1235                  else
1236                     cpy -= (pey - psy);
1237                  break;
1238               case 0x0100:
1239                  // missing
1240                  break;
1241               case 0x0200:
1242                  if ((pey - psy) > 0)
1243                     cpx += (pey - psy);
1244                  else
1245                     cpx -= (pey - psy);
1246                  break;
1247               case 0x0300:
1248                  // missing
1249                  break;
1250               case 0x0400:
1251                  if ((pey - psy) > 0)
1252                     cpy -= (pey - psy);
1253                  else
1254                     cpy += (pey - psy);
1255                  break;
1256               case 0x0500:
1257                  // missing
1258                  break;
1259               case 0x0600:
1260                  if ((pey - psy) > 0)
1261                     cpx -= (pey - psy);
1262                  else
1263                     cpx += (pey - psy);
1264                  break;
1265               case 0x0700:
1266                  // missing
1267                  break;
1268            }
1269         else
1270            {
1271               // missing
1272            }
11121273      }
1113      else if ((fifo[0] & 0xf0f8) == 0xe000)   /* AGCPY */
1274      else if ((fifo[0] & 0xf018) == 0xe000)   /* AGCPY */
11141275      {
1115         agcpy(fifo[0],fifo[1],fifo[2],cpx,cpy,fifo[3],fifo[4]);
1276         agcpy(fifo[0],(INT16)fifo[1],(INT16)fifo[2],cpx,cpy,fifo[3],fifo[4]);
11161277
1117         cpx += fifo[4];
1118         cpy += fifo[3];
1278         switch (fifo[0] & 0x0700)
1279         {
1280            case 0x0000:
1281               if (fifo[4] > 0)
1282                  cpy += fifo[4];
1283               else
1284                  cpy -= fifo[4];
1285               break;
1286            case 0x0100:
1287               if (fifo[4] > 0)
1288                  cpy -= fifo[4];
1289               else
1290                  cpy += fifo[4];
1291               break;
1292            case 0x0200:
1293               if (fifo[4] > 0)
1294                  cpy += fifo[4];
1295               else
1296                  cpy -= fifo[4];
1297               break;
1298            case 0x0300:
1299               if (fifo[4] > 0)
1300                  cpy -= fifo[4];
1301               else
1302                  cpy += fifo[4];
1303               break;
1304            case 0x0400:
1305               if (fifo[3] > 0)
1306                  cpx += fifo[3];
1307               else
1308                  cpx -= fifo[3];
1309               break;
1310            case 0x0500:
1311               if (fifo[3] > 0)
1312                  cpx += fifo[3];
1313               else
1314                  cpx -= fifo[3];
1315               break;
1316            case 0x0600:
1317               if (fifo[3] > 0)
1318                  cpx -= fifo[3];
1319               else
1320                  cpx += fifo[3];
1321               break;
1322            case 0x0700:
1323               if (fifo[3] > 0)
1324                  cpx -= fifo[3];
1325               else
1326                  cpx += fifo[3];
1327               break;
1328         }
11191329      }
11201330      else
1121{
1122logerror("unsupported command\n");
1123popmessage("unsupported command %s (%04x)",instruction_name[fifo[0]>>10],fifo[0]);
1124}
1331         {
1332            logerror("unsupported command\n");
1333            popmessage("unsupported command %s (%04x)",instruction_name[fifo[0]>>10],fifo[0]);
1334         }
11251335
11261336      fifo_counter = 0;
11271337   }
src/mame/video/ygv608.c
r3115r3116
538538   add_exit_callback(machine, ygv608_exit);
539539}
540540
541static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
541static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
542542{
543543#ifdef _ENABLE_SPRITES
544544
545545  // sprites are always clipped to 512x512
546546  // - regardless of the visible display dimensions
547  static rectangle spriteClip = { 0, 512, 0, 512 };
547  rectangle spriteClip = { 0, 512, 0, 512 };
548548
549549  PSPRITE_ATTR sa;
550550  int flipx = 0, flipy = 0;
src/mame/video/dkong.c
r3115r3116
1010#include "driver.h"
1111#include "video/resnet.h"
1212#include "includes/dkong.h"
13#include "machine/latch8.h"
1314
1415#define RADARSCP_BCK_COL_OFFSET         256
1516#define RADARSCP_GRID_COL_OFFSET      (RADARSCP_BCK_COL_OFFSET + 256)
r3115r3116
6061
6162static const res_net_decode_info dkong_decode_info =
6263{
63   2,      // there may be two proms needed to construct color
64   0,      // start at 0
65   255,   // end at 255
66   //  R,   G,   B,   R,   G,   B
67   { 256, 256,   0,   0,   0,   0},      // offsets
68   {   1,  -2,   0,   0,   2,   0},      // shifts
69   {0x07,0x04,0x03,0x00,0x03,0x00}          // masks
64   2,      /*  there may be two proms needed to construct color */
65   0,      /*  start at 0 */
66   255,   /*  end at 255 */
67   /*  R,   G,   B,   R,   G,   B */
68   { 256, 256,   0,   0,   0,   0},      /*  offsets */
69   {   1,  -2,   0,   0,   2,   0},      /*  shifts */
70   {0x07,0x04,0x03,0x00,0x03,0x00}          /*  masks */
7071};
7172
7273static const res_net_info dkong_net_info =
r3115r3116
7576   {
7677      { RES_NET_AMP_DARLINGTON, 470, 0, 3, { 1000, 470, 220 } },
7778      { RES_NET_AMP_DARLINGTON, 470, 0, 3, { 1000, 470, 220 } },
78      { RES_NET_AMP_EMITTER,    680, 0, 2, {  470, 220,   0 } }  // dkong
79      { RES_NET_AMP_EMITTER,    680, 0, 2, {  470, 220,   0 } }  /* dkong */
7980   }
8081};
8182
r3115r3116
9192
9293static const res_net_decode_info dkong3_decode_info =
9394{
94   1,      // one prom needed to contruct color
95   0,      // start at 0
96   255,   // end at 255
97   //  R,   G,   B
98   {   0,   0, 512 },      // offsets
99   {   4,   0,   0 },      // shifts
100   {0x0F,0x0F,0x0F }          // masks
95   1,      /*  one prom needed to contruct color */
96   0,      /*  start at 0 */
97   255,   /*  end at 255 */
98   /*   R,   G,   B */
99   {   0,   0, 512 },      /*  offsets */
100   {   4,   0,   0 },      /*  shifts */
101   {0x0F,0x0F,0x0F }          /*  masks */
101102};
102103
103104static const res_net_info dkong3_net_info =
r3115r3116
124125   {
125126      { RES_NET_AMP_DARLINGTON, 470,      0, 3, { 1000, 470, 220 } },
126127      { RES_NET_AMP_DARLINGTON, 470,      0, 3, { 1000, 470, 220 } },
127      { RES_NET_AMP_DARLINGTON, 680, 150000, 2, {  470, 220,   0 } }    // radarscp
128      { RES_NET_AMP_DARLINGTON, 680, 150000, 2, {  470, 220,   0 } }    /* radarscp */
128129   }
129130};
130131
r3115r3116
134135   {
135136      { RES_NET_AMP_DARLINGTON, 470,      0, 0, { 0 } },
136137      { RES_NET_AMP_DARLINGTON, 470,      0, 0, { 0 } },
137      { RES_NET_AMP_DARLINGTON, 680, 150000, 0, { 0 } }    // radarscp
138      { RES_NET_AMP_DARLINGTON, 680, 150000, 0, { 0 } }    /* radarscp */
138139   }
139140};
140141
r3115r3116
163164   RES_NET_VCC_5V | RES_NET_VBIAS_5V | RES_NET_VIN_TTL_OUT | RES_NET_MONITOR_SANYO_EZV20,
164165   {
165166      { RES_NET_AMP_DARLINGTON, 4700, 470, 0, { 0 } },
166      { RES_NET_AMP_DARLINGTON,    1,   0, 0, { 0 } },   // dummy
167      { RES_NET_AMP_DARLINGTON,    1,   0, 0, { 0 } },   // dummy
167      { RES_NET_AMP_DARLINGTON,    1,   0, 0, { 0 } },   /*  dummy */
168      { RES_NET_AMP_DARLINGTON,    1,   0, 0, { 0 } },   /*  dummy */
168169   }
169170};
170171
r3115r3116
174175{
175176   RES_NET_VCC_5V | RES_NET_VBIAS_5V | RES_NET_VIN_VCC | RES_NET_MONITOR_SANYO_EZV20,
176177   {
177      { RES_NET_AMP_DARLINGTON,  470, 4700, 0, { 0 } },   // bias/gnd exist in schematics, readable in TKG3 schematics
178      { RES_NET_AMP_DARLINGTON,  470, 4700, 0, { 0 } },   // bias/gnd exist in schematics, readable in TKG3 schematics
179      { RES_NET_AMP_DARLINGTON,    0,    0, 8, { 128,64,32,16,8,4,2,1 } },   // dummy
178      { RES_NET_AMP_DARLINGTON,  470, 4700, 0, { 0 } },   /*  bias/gnd exist in schematics, readable in TKG3 schematics */
179      { RES_NET_AMP_DARLINGTON,  470, 4700, 0, { 0 } },   /*  bias/gnd exist in schematics, readable in TKG3 schematics */
180      { RES_NET_AMP_DARLINGTON,    0,    0, 8, { 128,64,32,16,8,4,2,1 } },   /*  dummy */
180181   }
181182};
182183
r3115r3116
186187{
187188   RES_NET_VCC_5V | RES_NET_VBIAS_5V | RES_NET_VIN_TTL_OUT | RES_NET_MONITOR_SANYO_EZV20,
188189   {
189      { RES_NET_AMP_DARLINGTON,    0,   0, 1, { 1 } },   // dummy
190      { RES_NET_AMP_DARLINGTON,    0,   0, 1, { 1 } },   // dummy
191      { RES_NET_AMP_DARLINGTON,    0,   0, 1, { 1 } },   // dummy
190      { RES_NET_AMP_DARLINGTON,    0,   0, 1, { 1 } },   /*  dummy */
191      { RES_NET_AMP_DARLINGTON,    0,   0, 1, { 1 } },   /*  dummy */
192      { RES_NET_AMP_DARLINGTON,    0,   0, 1, { 1 } },   /*  dummy */
192193   }
193194};
194195
r3115r3116
210211   /* Now treat tri-state black background generation */
211212
212213   for (i=0;i<256;i++)
213      if ( (i & 0x03) == 0x00 )  // NOR => CS=1 => Tristate => real black
214      if ( (i & 0x03) == 0x00 )  /* NOR => CS=1 => Tristate => real black */
214215      {
215216         int r,g,b;
216217         r = compute_res_net( 1, 0, &dkong_net_bck_info );
r3115r3116
250251   /* Now treat tri-state black background generation */
251252
252253   for (i=0;i<256;i++)
253      if ( (i & 0x03) == 0x00 )  // NOR => CS=1 => Tristate => real black
254      if ( (i & 0x03) == 0x00 )  /* NOR => CS=1 => Tristate => real black */
254255      {
255256         r = compute_res_net( 1, 0, &radarscp_net_bck_info );
256257         g = compute_res_net( 1, 1, &radarscp_net_bck_info );
r3115r3116
288289   /* Now treat tri-state black background generation */
289290
290291   for (i=0;i<256;i++)
291      if ( (i & 0x03) == 0x00 )  // NOR => CS=1 => Tristate => real black
292      if ( (i & 0x03) == 0x00 )  /* NOR => CS=1 => Tristate => real black */
292293      {
293294         r = compute_res_net( 1, 0, &radarscp_net_bck_info );
294295         g = compute_res_net( 1, 1, &radarscp_net_bck_info );
r3115r3116
352353   /* Now treat tri-state black background generation */
353354
354355   for (i=0;i<256;i++)
355      if ( (i & 0x03) == 0x00 )  // NOR => CS=1 => Tristate => real black
356      if ( (i & 0x03) == 0x00 )  /* NOR => CS=1 => Tristate => real black */
356357      {
357358         r = compute_res_net( 0, 0, &radarsc1_net_info );
358359         g = compute_res_net( 0, 1, &radarsc1_net_info );
r3115r3116
480481   }
481482}
482483
483WRITE8_HANDLER( radarscp_snd02_w )
484{
485   dkong_state *state = machine->driver_data;
486
487   state->snd02_enable = data & 0x01;
488}
489
490WRITE8_HANDLER( radarsc1_ansn_w )
491{
492   dkong_state *state = machine->driver_data;
493
494   state->sig_ansn = data & 0x01;
495}
496
497484WRITE8_HANDLER( dkongjr_gfxbank_w )
498485{
499486   dkong_state *state = machine->driver_data;
r3115r3116
547534   dkong_state *state = machine->driver_data;
548535
549536   state->grid_col = (data & 0x07) ^ 0x07;
550   //popmessage("Gridcol: %d", state->grid_col);
537   /* popmessage("Gridcol: %d", state->grid_col); */
551538}
552539
553540WRITE8_HANDLER( dkong_flipscreen_w )
r3115r3116
716703 * a period of roughly 4.4 ms
717704 */
718705
719#define RC1      (2.2e3 * 22e-6) // 22e-6;
706#define RC1      (2.2e3 * 22e-6) /* 22e-6; */
720707#define RC2      (10e3 * 33e-6)
721708#define RC31   (18e3 * 33e-6)
722709#define RC32   ((18e3 + 68e3) * 33e-6)
723710#define RC4      (90e3 * 0.47e-6)
724711#define dt      (1./60./(double) VTOTAL)
725#define period2 (((INT64)(PIXEL_CLOCK) * ( 33L * 68L )) / (INT32)10000000L / 3)  // period/2 in pixel ...
712#define period2 (((INT64)(PIXEL_CLOCK) * ( 33L * 68L )) / (INT32)10000000L / 3)  /* period/2 in pixel ... */
726713
727714static void radarscp_step(running_machine *machine, int line_cnt)
728715{
729716   dkong_state *state = machine->driver_data;
717   const device_config *dev6h = devtag_get_device(machine, LATCH8, "ls259.6h");
718   const device_config *devvp2 = devtag_get_device(machine, LATCH8, "virtual_p2");
719
730720   /* Condensator is illegible in schematics for TRS2 board.
731721     * TRS1 board states 3.3u.
732722     */
r3115r3116
753743   if ( ( !(line_cnt & 0x40) && ((line_cnt+1) & 0x40) ) && (mame_rand(machine) > RAND_MAX/2))
754744      state->sig30Hz = (1-state->sig30Hz);
755745
756   state->rflip_sig = state->snd02_enable & state->sig30Hz;
746   /* Now mix with SND02 (sound 2) line - on 74ls259, bit2 */
747   state->rflip_sig = latch8_bit2_r(dev6h, 0) & state->sig30Hz;
748
757749   sig = state->rflip_sig ^ ((line_cnt & 0x80)>>7);
758750
759751   if (state->hardware_type == HARDWARE_TRS01)
760752      state->rflip_sig = !state->rflip_sig;
761753
762   if  (sig) // 128VF
754   if  (sig) /* 128VF */
763755      diff = (0.0 - cv1);
764756   else
765757      diff = (3.4 - cv1);
r3115r3116
781773
782774   state->blue_level = (int)(vg3/5.0*255);
783775
784   // Grid signal
785   if (state->grid_on && state->sig_ansn)
776   /*
777     * Grid signal
778     *
779     * Mixed with ANS line (bit 5) from Port B of 8039
780     */
781   if (state->grid_on && latch8_bit5_r(devvp2, 0))
786782   {
787783      diff = (0.0 - cv3);
788784      diff = diff - diff*exp(0.0 - (1.0/RC32 * dt) );
r3115r3116
798794   diff = diff - diff*exp(0.0 - (1.0/RC4 * dt) );
799795   cv4 += diff;
800796
801   if (CD4049(machine, CD4049(machine, vg2 - cv4))>2.4/5.0) //TTL - Level
797   if (CD4049(machine, CD4049(machine, vg2 - cv4))>2.4/5.0) /* TTL - Level */
802798      state->grid_sig = 0;
803799   else
804800      state->grid_sig = 1;
r3115r3116
831827      {
832828         pixel = BITMAP_ADDR16(bitmap, y, x);
833829         draw_ok = !(*pixel & 0x01) && !(*pixel & 0x02);
834         if (state->hardware_type == HARDWARE_TRS01) // Check again from schematics
830         if (state->hardware_type == HARDWARE_TRS01) /* Check again from schematics */
835831            draw_ok = draw_ok  && !((htable[ (!state->rflip_sig<<7) | (x>>2)] >>2) & 0x01);
836832         if (draw_ok)
837833            *pixel = *(BITMAP_ADDR16(state->bg_bits, y, x));
r3115r3116
930926   state->gfx_bank = 0;
931927   state->palette_bank = 0;
932928   state->sprite_bank = 0;
933   state->sig_ansn = 1;
934929   state->vidhw = -1;
935930
936931   state_save_register_global(state->gfx_bank);
r3115r3116
938933   state_save_register_global(state->sprite_bank);
939934   state_save_register_global(state->grid_on);
940935
941   state_save_register_global(state->snd02_enable);
942   state_save_register_global(state->sig_ansn);
943936   state_save_register_global(state->grid_col);
944937   state_save_register_global(state->flip);
945938}
src/mame/video/psx.c
r3115r3116
529529            }
530530            else if( m_n_debuginterleave == 1 )
531531            {
532               n_xi = ( n_x & ~0x78 ) + ( ( n_x << 3 ) & 0x40 ) + ( ( n_y << 3 ) & 0x38 ); \
533               n_yi = ( n_y & ~0x7 ) + ( ( n_x >> 4 ) & 0x7 ); \
532               n_xi = ( n_x & ~0x78 ) + ( ( n_x << 3 ) & 0x40 ) + ( ( n_y << 3 ) & 0x38 );
533               n_yi = ( n_y & ~0x7 ) + ( ( n_x >> 4 ) & 0x7 );
534534            }
535535            else
536536            {
src/mame/video/marvins.c
r3115r3116
22#include "cpu/z80/z80.h"
33#include "snk.h"
44
5int marvins_gamegroup;
6
57static int flipscreen, sprite_flip_adjust;
68static tilemap *fg_tilemap, *bg_tilemap, *tx_tilemap;
79static UINT8 bg_color, fg_color, old_bg_color, old_fg_color;
r3115r3116
170172
171173   {
172174      tilemap_clip = *video_screen_get_visible_area(machine->primary_screen);
173      if (snk_gamegroup != 1) // not Mad Crasher
175      if (marvins_gamegroup != 1) // not Mad Crasher
174176      {
175177         tilemap_clip.max_x-=16;
176178         tilemap_clip.min_x+=16;
r3115r3116
180182      tilemap_set_transparent_pen(bg_tilemap,0xf);
181183      tilemap_set_transparent_pen(tx_tilemap,0xf);
182184
183      switch (snk_gamegroup)
185      switch (marvins_gamegroup)
184186      {
185187         case 0:   // Marvin's Maze
186188            tilemap_set_scrolldx( bg_tilemap, 271, 287  );
r3115r3116
418420
419421   cpuintrf_push_context(0);
420422   {
421      int madcrash_vreg = (snk_gamegroup == 1) ? 0x00 : 0xf1; // Mad Crasher=0x00, VanguardII=0xf1
423      int madcrash_vreg = (marvins_gamegroup == 1) ? 0x00 : 0xf1; // Mad Crasher=0x00, VanguardII=0xf1
422424
423425      UINT8 sprite_partition = program_read_byte(0xfa00);
424426
src/mame/video/cps1.c
r3115r3116
12801280   {"sf2v004",  CPS_B_21_DEF, mapper_S9263B, 0x36 },
12811281   {"sf2accp2", CPS_B_21_DEF, mapper_S9263B, 0x36 },
12821282   {"sf2m1",    CPS_B_21_DEF, mapper_S9263B, 0x36 },
1283   {"sf2m2",    CPS_B_21_DEF, mapper_S9263B, 0x36 },
1283   {"sf2m2",    CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
12841284   {"sf2m3",    CPS_B_21_DEF, mapper_S9263B, 0x36 },
12851285   {"sf2m4",    HACK_B_1,     mapper_S9263B, 0x36, 0, 0, 1 },
12861286   {"sf2m5",    CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
r3115r3116
15561556            cps1_cps_b_regs[cps1_game_config->mult_factor2/2]) >> 16;
15571557
15581558   if (offset == cps1_game_config->in2_addr/2)   /* Extra input ports (on C-board) */
1559   {
1560      if (cps1_game_config->bootleg_kludge == 1)
1561         return input_port_read(machine, "IN2") << 8;
1562      else
1563         return input_port_read(machine, "IN2");
1564   }
1559      return input_port_read(machine, "IN2");
15651560
15661561   if (offset == cps1_game_config->in3_addr/2)   /* Player 4 controls (on C-board) ("Captain Commando") */
15671562      return input_port_read(machine, "IN3");
src/mame/video/snk.c
r3115r3116
1515
1616 those using tnk3_vh_screenrefresh (tnk3, athena, fitegolf) sgladiat is similar
1717    (0-7  , 6  is shadow, 7  is transparent) * these are using aso colour prom convert *
18 those using tdfever_vh_screenrefresh (tdfever)
19    (0-15 , 14(13 for tdfeverj) is shadow, 15 is transparent)
20 those using ftsoccer_vh_screenrefresh (ftsoccer)
21    (0-15 , 14 is shadow/highlight, 15 is transparent)
2218 those using ikari_vh_screenrefresh (ikari, victroad)
2319    (0-7  , 6  is shadow, 7  is transparent)
20 those using tdfever_vh_screenrefresh (tdfever, fsoccer)
21    (0-15 , 14 is shadow, 15 is transparent)
2422
2523*******************************************************************************/
2624
25UINT8 *snk_fg_videoram;
26UINT8 *snk_bg_videoram;
2727
28#define MAX_VRAM_SIZE (64*64*2) /* 0x2000 */
28static tilemap *fg_tilemap;
29static tilemap *bg_tilemap;
30static int bg_scrollx, bg_scrolly, sp16_scrollx, sp16_scrolly, sp32_scrollx, sp32_scrolly;
31static UINT8 sprite_split_point;
32static int num_sprites, yscroll_mask;
2933
34static UINT8 empty_tile[16*16];
3035
36/**************************************************************************************/
3137
38PALETTE_INIT( tnk3 )
39{
40   int i;
41   int num_colors = 0x400;
3242
33VIDEO_START( snk )
43   /*
44        palette format is RRRG GGBB B??? the three unknown bits are used but
45        I'm not sure how, I'm currently using them as least significant bit.
46    */
47   for( i=0; i<num_colors; i++ )
48   {
49      int bit0=0,bit1,bit2,bit3,r,g,b;
50
51      bit0 = (color_prom[i + 2*num_colors] >> 2) & 0x01;
52      bit1 = (color_prom[i] >> 1) & 0x01;
53      bit2 = (color_prom[i] >> 2) & 0x01;
54      bit3 = (color_prom[i] >> 3) & 0x01;
55      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
56
57      bit0 = (color_prom[i + 2*num_colors] >> 1) & 0x01;
58      bit1 = (color_prom[i + num_colors] >> 2) & 0x01;
59      bit2 = (color_prom[i + num_colors] >> 3) & 0x01;
60      bit3 = (color_prom[i] >> 0) & 0x01;
61      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
62
63      bit0 = (color_prom[i + 2*num_colors] >> 0) & 0x01;
64      bit1 = (color_prom[i + 2*num_colors] >> 3) & 0x01;
65      bit2 = (color_prom[i + num_colors] >> 0) & 0x01;
66      bit3 = (color_prom[i + num_colors] >> 1) & 0x01;
67      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
68
69      palette_set_color(machine,i,MAKE_RGB(r,g,b));
70   }
71}
72
73/**************************************************************************************/
74
75static TILEMAP_MAPPER( tnk3_fg_scan_cols )
3476{
35   tmpbitmap = auto_bitmap_alloc(512, 512, video_screen_get_format(machine->primary_screen));
77   // tilemap is 36x28, the central part is from the first RAM page and the
78   // extra 4 columns are from the second page
79   col -= 2;
80   if (col & 0x20)
81      return 0x400 + row + ((col & 0x1f) << 5);
82   else
83      return row + (col << 5);
3684}
3785
86static TILE_GET_INFO( tnk3_get_fg_tile_info )
87{
88   int code = snk_fg_videoram[tile_index];
89   int color = code >> 5;
90   SET_TILE_INFO(0,
91         code,
92         color,
93         tile_index & 0x400 ? TILE_FORCE_LAYER0 : 0);
94}
3895
39VIDEO_START( snk_3bpp_shadow )
96static TILE_GET_INFO( ikari_get_fg_tile_info )
4097{
98   int code = snk_fg_videoram[tile_index];
99   SET_TILE_INFO(0,
100         code,
101         0,
102         tile_index & 0x400 ? TILE_FORCE_LAYER0 : 0);
103}
104
105static TILE_GET_INFO( gwar_get_fg_tile_info )
106{
107   int code = snk_fg_videoram[tile_index];
108   SET_TILE_INFO(0,
109         code,
110         0,
111         0);
112}
113
114
115static TILE_GET_INFO( aso_get_bg_tile_info )
116{
117   int code = snk_bg_videoram[tile_index];
118   SET_TILE_INFO(1,
119         code,
120         0,
121         0);
122}
123
124static TILE_GET_INFO( tnk3_get_bg_tile_info )
125{
126   int attr = snk_bg_videoram[2*tile_index+1];
127   int code = snk_bg_videoram[2*tile_index] | ((attr & 0x30) << 4);
128   int color = (attr & 0xf) ^ 8;
129   SET_TILE_INFO(1,
130         code,
131         color,
132         0);
133}
134
135static TILE_GET_INFO( ikari_get_bg_tile_info )
136{
137   int attr = snk_bg_videoram[2*tile_index+1];
138   int code = snk_bg_videoram[2*tile_index] | ((attr & 0x03) << 8);
139   int color = (attr & 0x70) >> 4;
140   SET_TILE_INFO(1,
141         code,
142         color,
143         0);
144}
145
146static TILE_GET_INFO( gwar_get_bg_tile_info )
147{
148   int attr = snk_bg_videoram[2*tile_index+1];
149   int code = snk_bg_videoram[2*tile_index] | ((attr & 0x0f) << 8);
150   int color = (attr & 0xf0) >> 4;
151   SET_TILE_INFO(1,
152         code,
153         color,
154         0);
155
156   // bermudat, tdfever use FFFF to blank the background.
157   // (still call SET_TILE_INFO, otherwise problems might occur on boot when
158   // the tile data hasn't been initialised)
159   if (code >= machine->gfx[1]->total_elements)
160      tileinfo->pen_data = empty_tile;
161}
162
163
164/**************************************************************************************/
165
166static VIDEO_START( snk_3bpp_shadow )
167{
41168   int i;
42169
43   VIDEO_START_CALL(snk);
44
45170   if(!(machine->config->video_attributes & VIDEO_HAS_SHADOWS))
46      popmessage("driver should use VIDEO_HAS_SHADOWS");
171      fatalerror("driver should use VIDEO_HAS_SHADOWS");
47172
48173   /* prepare shadow draw table */
49174   for(i = 0; i <= 5; i++) gfx_drawmode_table[i] = DRAWMODE_SOURCE;
r3115r3116
54179      machine->shadow_table[i] = i | 0x200;
55180}
56181
57VIDEO_START( snk_4bpp_shadow )
182static VIDEO_START( snk_4bpp_shadow )
58183{
59184   int i;
60185
61   VIDEO_START_CALL(snk);
62
63186   if(!(machine->config->video_attributes & VIDEO_HAS_SHADOWS))
64      popmessage("driver should use VIDEO_HAS_SHADOWS");
187      fatalerror("driver should use VIDEO_HAS_SHADOWS");
65188
66189   /* prepare shadow draw table */
67190   for(i = 0; i <= 13; i++) gfx_drawmode_table[i] = DRAWMODE_SOURCE;
r3115r3116
69192   gfx_drawmode_table[15] = DRAWMODE_NONE;
70193
71194   /* all palette entries are not affected by shadow sprites... */
72   for (i = 0x00;i < 0x400;i++)
195   for (i = 0x000;i < 0x400;i++)
73196      machine->shadow_table[i] = i;
74197   /* ... except for tilemap colors */
75198   for (i = 0x200;i < 0x300;i++)
76199      machine->shadow_table[i] = i + 0x100;
77200}
78201
79/**************************************************************************************/
80202
81static void tnk3_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int scrollx, int scrolly,
82               int x_size, int y_size, int bg_type )
203VIDEO_START( jcross )
83204{
84   const gfx_element *gfx = machine->gfx[1];
205   VIDEO_START_CALL(snk_3bpp_shadow);
85206
86   int tile_number, attributes, color, sx, sy;
87   int offs, x, y;
207   fg_tilemap = tilemap_create(tnk3_get_fg_tile_info, tnk3_fg_scan_cols, 8, 8, 36, 28);
208   bg_tilemap = tilemap_create(aso_get_bg_tile_info,  tilemap_scan_cols, 8, 8, 64, 64);
88209
89   /* to be moved to memmap */
90   for(x=0; x<x_size; x++) for(y=0; y<y_size; y++)
91   {
92      offs = (x*y_size + y) << 1;
93      tile_number = videoram[offs];
94      attributes  = videoram[offs+1];
210   tilemap_set_transparent_pen(fg_tilemap, 15);
211   tilemap_set_scrolldy(fg_tilemap, 8, 8);
95212
96      if(bg_type == 0)
97      {
98            /* type tnk3 */
99            tile_number |= (attributes & 0x30) << 4;
100            color = (attributes & 0xf) ^ 8;
101      }
102      else
103      {
104            /* type ikari */
105            tile_number |= (attributes & 0x03) << 8;
106            color = attributes >> 4;
107      }
213   tilemap_set_scrolldx(bg_tilemap, 15, 24);
214   tilemap_set_scrolldy(bg_tilemap,  8, -32);
108215
109      sx = x * 512 / x_size;
110      sy = y * 512 / y_size;
216   num_sprites = 25;
217   yscroll_mask = 0x1ff;
218}
111219
112      drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
113   }
114   copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,cliprect);
220VIDEO_START( sgladiat )
221{
222   VIDEO_START_CALL(snk_3bpp_shadow);
223
224   fg_tilemap = tilemap_create(tnk3_get_fg_tile_info, tnk3_fg_scan_cols, 8, 8, 36, 28);
225   bg_tilemap = tilemap_create(aso_get_bg_tile_info,  tilemap_scan_cols, 8, 8, 64, 32);
226
227   tilemap_set_transparent_pen(fg_tilemap, 15);
228   tilemap_set_scrolldy(fg_tilemap, 8, 8);
229
230   tilemap_set_scrolldx(bg_tilemap, 15, 24);
231   tilemap_set_scrolldy(bg_tilemap,  8, -32);
232
233   num_sprites = 25;
234   yscroll_mask = 0x0ff;
115235}
116236
117void tnk3_draw_text(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, UINT8 *source )
237VIDEO_START( aso )
118238{
119   const gfx_element *gfx = machine->gfx[0];
239   VIDEO_START_CALL(snk_3bpp_shadow);
120240
121   int tile_number, color, sx, sy;
122   int x, y;
241   fg_tilemap = tilemap_create(tnk3_get_fg_tile_info, tnk3_fg_scan_cols, 8, 8, 36, 28);
242   bg_tilemap = tilemap_create(aso_get_bg_tile_info,  tilemap_scan_cols, 8, 8, 64, 64);
123243
124   for(x=0; x<32; x++) for(y=0; y<32; y++)
125   {
126      tile_number = source[(x<<5)+y];
244   tilemap_set_transparent_pen(fg_tilemap, 15);
245   tilemap_set_scrolldy(fg_tilemap, 8, 8);
127246
128      if(tile_number == 0x20 || tile_number == 0xff) continue;
247   tilemap_set_scrolldx(bg_tilemap, 15+256, 24+256);
248   tilemap_set_scrolldy(bg_tilemap,  8, -32);
129249
130      if(bank == -1) color = 8;
131      else
132      {
133         color = tile_number >> 5;
134         tile_number |= bank << 8;
135      }
136      sx = (x+2) << 3;
137      sy = (y+1) << 3;
138
139      drawgfx(bitmap,gfx,tile_number,color,0,0,sx,sy,cliprect,TRANSPARENCY_PEN,15);
140   }
250   num_sprites = 50;
251   yscroll_mask = 0x1ff;
141252}
142253
143static void tnk3_draw_status_main(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, UINT8 *source, int start )
254VIDEO_START( tnk3 )
144255{
145   const gfx_element *gfx = machine->gfx[0];
256   VIDEO_START_CALL(snk_3bpp_shadow);
146257
147   int tile_number, color, sx, sy;
148   int x, y;
258   fg_tilemap = tilemap_create(tnk3_get_fg_tile_info, tnk3_fg_scan_cols, 8, 8, 36, 28);
259   bg_tilemap = tilemap_create(tnk3_get_bg_tile_info, tilemap_scan_cols, 8, 8, 64, 64);
149260
150   for(x = start; x < start+2; x++) for(y = 0; y < 32; y++)
151   {
152      tile_number = source[(x<<5)+y];
261   tilemap_set_transparent_pen(fg_tilemap, 15);
262   tilemap_set_scrolldy(fg_tilemap, 8, 8);
153263
154      if(bank == -1) color = 8;
155      else
156      {
157          color = tile_number >> 5;
158         tile_number |= (bank << 8);
159      }
160      sx = ((x+34)&0x3f) << 3;
161      sy = (y+1) << 3;
264   tilemap_set_scrolldx(bg_tilemap, 15, 24);
265   tilemap_set_scrolldy(bg_tilemap,  8, -32);
162266
163      drawgfx(bitmap,gfx,tile_number,color,0,0,sx,sy,cliprect,TRANSPARENCY_NONE,0);
164   }
267   num_sprites = 50;
268   yscroll_mask = 0x1ff;
165269}
166270
167void tnk3_draw_status(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, UINT8 *source )
271VIDEO_START( ikari )
168272{
169   tnk3_draw_status_main(machine,bitmap,cliprect,bank,source, 0);
170   tnk3_draw_status_main(machine,bitmap,cliprect,bank,source,30);
273   VIDEO_START_CALL(snk_3bpp_shadow);
274
275   fg_tilemap = tilemap_create(ikari_get_fg_tile_info, tnk3_fg_scan_cols,  8,  8, 36, 28);
276   bg_tilemap = tilemap_create(ikari_get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
277
278   tilemap_set_transparent_pen(fg_tilemap, 15);
279   tilemap_set_scrolldy(fg_tilemap, 8, 8);
280
281   tilemap_set_scrolldx(bg_tilemap, 15, 24);
282   tilemap_set_scrolldy(bg_tilemap,  8, -32);
171283}
172284
173static void tnk3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int xscroll, int yscroll )
285VIDEO_START( gwar )
174286{
175   const gfx_element *gfx = machine->gfx[2];
287   memset(empty_tile,0xf,sizeof(empty_tile));
176288
177   int tile_number, attributes, color, sx, sy;
178   int yflip;
179   int offs;
289   fg_tilemap = tilemap_create(gwar_get_fg_tile_info, tilemap_scan_cols,  8,  8, 50, 32);
290   bg_tilemap = tilemap_create(gwar_get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
180291
181   for(offs = 0; offs < 50*4; offs+=4)
182   {
183      if(*(UINT32*)(spriteram+offs) == 0 || *(UINT32*)(spriteram+offs) == -1) continue;
292   tilemap_set_transparent_pen(fg_tilemap, 15);
184293
185      tile_number = spriteram[offs+1];
186      attributes  = spriteram[offs+3]; /* YBFX.CCCC */
187      if(attributes & 0x40) tile_number |= 256;
294   tilemap_set_scrolldx(bg_tilemap, 16, 143);
295   tilemap_set_scrolldy(bg_tilemap,  0, -32);
296}
188297
189      color = attributes & 0xf;
190      sx =  xscroll - spriteram[offs+2];
191      if(!(attributes & 0x80)) sx += 256;
192      sy = -yscroll + spriteram[offs];
193      if(attributes & 0x10) sy += 256;
194      sx &= 0x1ff;
195      sy &= 0x1ff;
196      if (sx > 512-16) sx -= 512;
197      if (sy > 512-16) sy -= 512;
198      yflip = attributes & 0x20;
298VIDEO_START( tdfever )
299{
300   VIDEO_START_CALL(snk_4bpp_shadow);
199301
200      drawgfx(bitmap,gfx,tile_number,color,0,yflip,sx,sy,cliprect,TRANSPARENCY_PEN_TABLE,7);
201   }
302   VIDEO_START_CALL(gwar);
202303}
203304
204VIDEO_UPDATE( tnk3 )
305/**************************************************************************************/
306
307WRITE8_HANDLER( snk_fg_videoram_w )
205308{
206   UINT8 *ram = snk_rambase - 0xd000;
207   int attributes = ram[0xc800];
208   /*
209        X-------
210        -X------    character bank (for text layer)
211        --X-----
212        ---X----    scrolly MSB (background)
213        ----X---    scrolly MSB (sprites)
214        -----X--
215        ------X-    scrollx MSB (background)
216        -------X    scrollx MSB (sprites)
217    */
309   snk_fg_videoram[offset] = data;
310   tilemap_mark_tile_dirty(fg_tilemap, offset);
311}
218312
219   // TODO attributes & 0x80 is screen flip
313WRITE8_HANDLER( snk_bg_videoram_w )
314{
315   snk_bg_videoram[offset] = data;
316   tilemap_mark_tile_dirty(bg_tilemap, offset >> 1);
317}
220318
221   /* to be moved to memmap */
222   spriteram = &ram[0xd000];
319WRITE8_HANDLER( aso_bg_videoram_w )
320{
321   snk_bg_videoram[offset] = data;
322   tilemap_mark_tile_dirty(bg_tilemap, offset);
323}
223324
224   {
225      int bg_scrollx = -ram[0xcc00] + 15;
226      int bg_scrolly = -ram[0xcb00] + 8;
227      if(attributes & 0x02) bg_scrollx += 256;
228      if(attributes & 0x10) bg_scrolly += 256;
229      tnk3_draw_background(screen->machine, bitmap, cliprect, bg_scrollx, bg_scrolly, 64, 64, 0 );
230   }
325WRITE8_HANDLER( snk_bg_scrollx_w )
326{
327   bg_scrollx = (bg_scrollx & ~0xff) | data;
328}
231329
232   {
233      int sp_scrollx = ram[0xca00] + 29;
234      int sp_scrolly = ram[0xc900] + 9;
235      if(attributes & 0x01) sp_scrollx += 256;
236      if(attributes & 0x08) sp_scrolly += 256;
237      tnk3_draw_sprites(screen->machine, bitmap, cliprect, sp_scrollx, sp_scrolly );
238   }
330WRITE8_HANDLER( snk_bg_scrolly_w )
331{
332   bg_scrolly = (bg_scrolly & ~0xff) | data;
333}
239334
240   {
241      int bank = (attributes & 0x40) ? 1:0;
335WRITE8_HANDLER( snk_sp16_scrollx_w )
336{
337   sp16_scrollx = (sp16_scrollx & ~0xff) | data;
338}
242339
243      tnk3_draw_text(screen->machine, bitmap, cliprect, bank, &ram[0xf800] );
244      tnk3_draw_status(screen->machine, bitmap, cliprect, bank, &ram[0xfc00] );
245   }
246   return 0;
340WRITE8_HANDLER( snk_sp16_scrolly_w )
341{
342   sp16_scrolly = (sp16_scrolly & ~0xff) | data;
247343}
248344
249static void athena_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int xscroll, int yscroll )
345WRITE8_HANDLER( snk_sp32_scrollx_w )
250346{
251   const gfx_element *gfx = machine->gfx[2];
347   sp32_scrollx = (sp32_scrollx & ~0xff) | data;
348}
252349
253   int tile_number, attributes, color, sx, sy;
254   int offs;
350WRITE8_HANDLER( snk_sp32_scrolly_w )
351{
352   sp32_scrolly = (sp32_scrolly & ~0xff) | data;
353}
255354
256   for(offs = 0; offs < 50*4; offs+=4)
257   {
258      if(*(UINT32*)(spriteram+offs) == 0 || *(UINT32*)(spriteram+offs) == -1) continue;
259355
260      tile_number = spriteram[offs+1];
261      attributes  = spriteram[offs+3]; /* YBBX.CCCC */
262      if(attributes & 0x40) tile_number |= 256;
263      if(attributes & 0x20) tile_number |= 512;
356WRITE8_HANDLER( sgladiat_flipscreen_w )
357{
358   flip_screen_set(data & 0x80);
264359
265      color = attributes & 0xf;
266      sx =  xscroll - spriteram[offs+2];
267      if(!(attributes & 0x80)) sx += 256;
268      sy = -yscroll + spriteram[offs];
269      if(attributes & 0x10) sy += 256;
270      sx &= 0x1ff;
271      sy &= 0x1ff;
272      if (sx > 512-16) sx -= 512;
273      if (sy > 512-16) sy -= 512;
360   tilemap_set_palette_offset(bg_tilemap, ((data & 0xf) ^ 8) << 4);
274361
275      drawgfx(bitmap,gfx,tile_number,color,0,0,sx,sy,cliprect,TRANSPARENCY_PEN_TABLE,7);
276   }
362   // other bits unknown
277363}
278364
279/* Same as tnk3 but sprite attribute bit 5 is extra bank bit instead of y-flip. */
280VIDEO_UPDATE( athena )
365WRITE8_HANDLER( jcross_scroll_msb_w )
281366{
282   UINT8 *ram = snk_rambase - 0xd000;
283   int attributes = ram[0xc800];
367   bg_scrolly =   (bg_scrolly   & 0xff) | ((data & 0x10) << 4);
368   sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x08) << 5);
369   bg_scrollx =   (bg_scrollx   & 0xff) | ((data & 0x02) << 7);
370   sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8);
371}
372
373WRITE8_HANDLER( sgladiat_scroll_msb_w )
374{
375   bg_scrollx =   (bg_scrollx   & 0xff) | ((data & 0x02) << 7);
376   sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8);
377}
378
379WRITE8_HANDLER( aso_videoattrs_w )
380{
284381   /*
382        video attributes:
285383        X-------
384        -X------
385        --X-----    flip screen
386        ---X----    scrolly MSB (background)
387        ----X---    scrolly MSB (sprites)
388        -----X--
389        ------X-    scrollx MSB (background)
390        -------X    scrollx MSB (sprites)
391    */
392
393   flip_screen_set(data & 0x20);
394
395   bg_scrolly =   (bg_scrolly   & 0xff) | ((data & 0x10) << 4);
396   sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x08) << 5);
397   bg_scrollx =   (bg_scrollx   & 0xff) | ((data & 0x02) << 7);
398   sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8);
399}
400
401WRITE8_HANDLER( tnk3_videoattrs_w )
402{
403   /*
404        video attributes:
405        X-------    flip screen
286406        -X------    character bank (for text layer)
287407        --X-----
288408        ---X----    scrolly MSB (background)
r3115r3116
292412        -------X    scrollx MSB (sprites)
293413    */
294414
295   // TODO attributes & 0x80 is screen flip
415   flip_screen_set(data & 0x80);
296416
297   /* to be moved to memmap */
298   spriteram = &ram[0xd000];
417   tilemap_set_pen_data_offset(fg_tilemap, ((data & 0x40) << 2) * machine->gfx[0]->char_modulo);
299418
300   {
301      int bg_scrollx = -ram[0xcc00] + 15;
302      int bg_scrolly = -ram[0xcb00] + 8;
303      if(attributes & 0x02) bg_scrollx += 256;
304      if(attributes & 0x10) bg_scrolly += 256;
305      tnk3_draw_background(screen->machine, bitmap, cliprect, bg_scrollx, bg_scrolly, 64, 64, 0 );
306   }
419   bg_scrolly =   (bg_scrolly   & 0xff) | ((data & 0x10) << 4);
420   sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x08) << 5);
421   bg_scrollx =   (bg_scrollx   & 0xff) | ((data & 0x02) << 7);
422   sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8);
423}
307424
308   {
309      int sp_scrollx = ram[0xca00] + 29;
310      int sp_scrolly = ram[0xc900] + 9;
311      if(attributes & 0x01) sp_scrollx += 256;
312      if(attributes & 0x08) sp_scrolly += 256;
313      athena_draw_sprites(screen->machine, bitmap, cliprect, sp_scrollx, sp_scrolly );
314   }
425WRITE8_HANDLER( aso_bg_bank_w )
426{
427   tilemap_set_palette_offset(bg_tilemap, ((data & 0xf) ^ 8) << 4);
428   tilemap_set_pen_data_offset(bg_tilemap, ((data & 0x30) << 4) * machine->gfx[1]->char_modulo);
429}
315430
316   {
317      int bank = (attributes & 0x40) ? 1:0;
431WRITE8_HANDLER( ikari_bg_scroll_msb_w )
432{
433   bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7);
434   bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x01) << 8);
435}
318436
319      tnk3_draw_text(screen->machine, bitmap, cliprect, bank, &ram[0xf800] );
320      tnk3_draw_status(screen->machine, bitmap, cliprect, bank, &ram[0xfc00] );
321   }
322   return 0;
437WRITE8_HANDLER( ikari_sp_scroll_msb_w )
438{
439   sp32_scrollx = (sp32_scrollx & 0xff) | ((data & 0x20) << 3);
440   sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x10) << 4);
441   sp32_scrolly = (sp32_scrolly & 0xff) | ((data & 0x08) << 5);
442   sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x04) << 6);
323443}
324444
325/************************************************************************************/
445WRITE8_HANDLER( ikari_unknown_video_w )
446{
447   /* meaning of 0xc980 uncertain.
448       Normally 0x20, ikaria/ikarijp sets it to 0x31 during test mode.
449       Changing char bank is necessary to fix the display during the
450       hard flags test and the test grid.
451       Changing palette bank is necessary to fix colors in test mode. */
326452
327VIDEO_START( sgladiat )
453if (data != 0x20 &&   // normal
454   data != 0x31 &&   // ikari test
455   data != 0xaa)   // victroad spurious during boot
456   popmessage("attrs %02x contact MAMEDEV", data);
457
458   tilemap_set_palette_offset(fg_tilemap, (data & 0x01) << 4);
459   tilemap_set_pen_data_offset(fg_tilemap, ((data & 0x10) << 4) * machine->gfx[0]->char_modulo);
460}
461
462WRITE8_HANDLER( gwar_fg_bank_w )
328463{
329   tmpbitmap = auto_bitmap_alloc(512, 256, video_screen_get_format(machine->primary_screen));
464   tilemap_set_palette_offset(fg_tilemap, (data & 0xf) << 4);
465   tilemap_set_pen_data_offset(fg_tilemap, ((data & 0x30) << 4) * machine->gfx[0]->char_modulo);
330466}
331467
332static void sgladiat_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int scrollx, int scrolly )
468WRITE8_HANDLER( gwar_videoattrs_w )
333469{
334   const gfx_element *gfx = machine->gfx[1];
470   flip_screen_set(data & 0x04);
335471
336   int tile_number, color, sx, sy;
337   int offs, x, y;
472   sp32_scrollx = (sp32_scrollx & 0xff) | ((data & 0x80) << 1);
473   sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x40) << 2);
474   sp32_scrolly = (sp32_scrolly & 0xff) | ((data & 0x20) << 3);
475   sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x10) << 4);
476   bg_scrollx =   (bg_scrollx   & 0xff) | ((data & 0x02) << 7);
477   bg_scrolly =   (bg_scrolly   & 0xff) | ((data & 0x01) << 8);
478}
338479
339   for(x = 0; x < 64; x++) for(y = 0; y < 32; y++)
340   {
341      offs = (x<<5)+y;
342      tile_number = videoram[offs];
480WRITE8_HANDLER( gwara_videoattrs_w )
481{
482   flip_screen_set(data & 0x10);
343483
344      color = 0;
345      sx = x << 3;
346      sy = y << 3;
484   bg_scrollx =   (bg_scrollx   & 0xff) | ((data & 0x02) << 7);
485   bg_scrolly =   (bg_scrolly   & 0xff) | ((data & 0x01) << 8);
486}
347487
348      drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
349   }
350   copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,cliprect);
488WRITE8_HANDLER( gwara_sp_scroll_msb_w )
489{
490   sp32_scrollx = (sp32_scrollx & 0xff) | ((data & 0x20) << 3);
491   sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x10) << 4);
492   sp32_scrolly = (sp32_scrolly & 0xff) | ((data & 0x08) << 5);
493   sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x04) << 6);
351494}
352495
353VIDEO_UPDATE( sgladiat )
496WRITE8_HANDLER( gwar_sprite_split_point_w )
354497{
355   UINT8 *pMem = snk_rambase - 0xd000;
356   int attributes, scrollx, scrolly;
498   sprite_split_point = data;
499}
357500
358   attributes = pMem[0xd300];
501WRITE8_HANDLER( tdfever_sp_scroll_msb_w )
502{
503   sp32_scrolly = (sp32_scrolly & 0xff) | ((data & 0x80) << 1);
504   sp32_scrollx = (sp32_scrollx & 0xff) | ((data & 0x40) << 2);
505}
359506
360   scrollx = -pMem[0xd700] + ((attributes & 2) ? 256:0);
361   scrolly = -pMem[0xd600];
362   scrollx += 15;
363   scrolly += 8;
364   sgladiat_draw_background(screen->machine, bitmap, cliprect, scrollx, scrolly );
507WRITE8_HANDLER( tdfever_spriteram_w )
508{
509   /*  partial updates avoid flickers in the fsoccer radar. */
510   if (offset < 0x80 && spriteram[offset] != data)
511   {
512      int vpos = video_screen_get_vpos(machine->primary_screen);
365513
366   scrollx = pMem[0xd500] + ((attributes & 1) ? 256:0);
367   scrolly = pMem[0xd400];
368   scrollx += 29;
369   scrolly += 9;
370   tnk3_draw_sprites(screen->machine, bitmap, cliprect, scrollx, scrolly );
514      if (vpos > 0)
515         video_screen_update_partial(machine->primary_screen, vpos - 1);
516   }
371517
372   tnk3_draw_text(screen->machine, bitmap, cliprect, 0, &pMem[0xf000] );
373   return 0;
518   spriteram[offset] = data;
374519}
375520
376521/**************************************************************************************/
377522
378static void ikari_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int start, int xscroll, int yscroll,
379            UINT8 *source, int mode )
523static void tnk3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const int xscroll, const int yscroll)
380524{
381   gfx_element *gfx = machine->gfx[mode];
525   const gfx_element *gfx = machine->gfx[2];
526   const int size = gfx->width;
382527   int tile_number, attributes, color, sx, sy;
383   int which, finish;
528   int xflip,yflip;
529   int offs;
384530
385   finish = (start+25)*4;
531   /* jcross and sgladiat have only 25 sprites, the others 50 */
386532
387   for(which = start*4; which < finish; which+=4)
533   /* jcross has 256 tiles, attribute bit 6 MIGHT be x-flip (uncertain) */
534   /* sgladiat and tnk3 have 512 tiles, bit 6 is bank and bit 5 is y-flip */
535   /* athena has 1024 tiles, bit 6 and bit 5 are bank */
536
537   for (offs = 0; offs < num_sprites*4; offs += 4)
388538   {
389      if(*(UINT32*)(source+which) == 0 || *(UINT32*)(source+which) == -1) continue;
539      tile_number = spriteram[offs+1];
540      attributes  = spriteram[offs+3];
541      color = attributes & 0xf;
542      sx =  xscroll + 301 - size - spriteram[offs+2];
543      sy = -yscroll + 7 - size + spriteram[offs];
544      sx += (attributes & 0x80) << 1;
545      sy += (attributes & 0x10) << 4;
546      xflip = 0;
547      yflip = 0;
390548
391      tile_number = source[which+1];
392      attributes  = source[which+3];
393      switch(mode)
549      if (gfx->total_elements > 256)   // all except jcross
394550      {
395         case 2:
396            tile_number |= (attributes & 0x60) << 3;
397            break;
398         case 3:
399            if(attributes & 0x40) tile_number |= 256;
400            break;
551         tile_number |= (attributes & 0x40) << 2;
401552      }
402      color = attributes & 0xf;
403      sx =  xscroll - source[which+2];
404      if(!(attributes & 0x80)) sx += 256;
405      sy = -yscroll + source[which];
406      if(attributes & 0x10) sy += 256;
407      sx = (sx - 16) & 0x1ff;
408      sy = (sy - 16) & 0x1ff;
409      if (sx > 512-16) sx -= 512;
410      if (sy > 512-16) sy -= 512;
553      else   // jcross
554      {
555         xflip = attributes & 0x40;   // uncertain (not used?)
556      }
411557
412      drawgfx(bitmap,gfx,tile_number,color,0,0,sx,sy,cliprect,TRANSPARENCY_PEN_TABLE,7);
413   }
414}
558      if (gfx->total_elements > 512)   // athena
559      {
560         tile_number |= (attributes & 0x20) << 4;
561      }
562      else   // all others
563      {
564         yflip = attributes & 0x20;
565      }
415566
416VIDEO_UPDATE( ikari )
417{
418   UINT8 *ram = snk_rambase - 0xd000;
567      if (flip_screen_get())
568      {
569         sx = 89 - size - sx;   // this causes slight misalignment in tnk3 but is correct for athena and fitegolf
570         sy = 262 - size - sy;
571         xflip = !xflip;
572         yflip = !yflip;
573      }
419574
420   {
421      int attributes = ram[0xc900];
422      int scrolly =  8-ram[0xc800] - ((attributes & 0x01) ? 256:0);
423      int scrollx = 13-ram[0xc880] - ((attributes & 0x02) ? 256:0);
424      tnk3_draw_background(screen->machine, bitmap, cliprect, scrollx, scrolly, 32, 32, 1 );
425   }
575      sx &= 0x1ff;
576      sy &= yscroll_mask;   // sgladiat apparently has only 256 pixels of vertical scrolling range
577      if (sx > 512-size) sx -= 512;
578      if (sy > (yscroll_mask+1)-size) sy -= (yscroll_mask+1);
426579
427   {
428      int attributes = ram[0xcd00];
429
430      int sp16_scrolly = -7 + ram[0xca00] + ((attributes & 0x04) ? 256:0);
431      int sp16_scrollx = 44 + ram[0xca80] + ((attributes & 0x10) ? 256:0);
432
433      int sp32_scrolly =  9 + ram[0xcb00] + ((attributes & 0x08) ? 256:0);
434      int sp32_scrollx = 28 + ram[0xcb80] + ((attributes & 0x20) ? 256:0);
435
436      ikari_draw_sprites(screen->machine, bitmap, cliprect,  0, sp16_scrollx, sp16_scrolly, &ram[0xe800], 2 );
437      ikari_draw_sprites(screen->machine, bitmap, cliprect,  0, sp32_scrollx, sp32_scrolly, &ram[0xe000], 3 );
438      ikari_draw_sprites(screen->machine, bitmap, cliprect, 25, sp16_scrollx, sp16_scrolly, &ram[0xe800], 2 );
580      drawgfx(bitmap,gfx,
581            tile_number,
582            color,
583            xflip,yflip,
584            sx,sy,
585            cliprect,TRANSPARENCY_PEN_TABLE,7);
439586   }
440
441   tnk3_draw_text(screen->machine, bitmap, cliprect, -1, &ram[0xf800] );
442   tnk3_draw_status(screen->machine, bitmap, cliprect, -1, &ram[0xfc00] );
443   return 0;
444587}
445588
446/**************************************************************/
447589
448static void tdfever_draw_bg(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int xscroll, int yscroll )
590static void ikari_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
591      const int start, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum )
449592{
450   const UINT8 *source = snk_rambase + 0x000;
451   const gfx_element *gfx = machine->gfx[1];
452
593   const gfx_element *gfx = machine->gfx[gfxnum];
594   const int size = gfx->width;
453595   int tile_number, attributes, color, sx, sy;
454   int offs, x, y;
596   int which, finish;
455597
456   for(x = 0; x < 32; x++) for(y = 0; y < 32; y++)
598   finish = (start+25)*4;
599
600   for (which = start*4; which < finish; which += 4)
457601   {
458      offs = (x<<6)+(y<<1);
459      tile_number = source[offs];
460      attributes  = source[offs+1];
602      tile_number = source[which+1];
603      attributes  = source[which+3];
604      color = attributes & 0xf;
605      sx =  xscroll + 300 - size - source[which+2];
606      sy = -yscroll + 7 - size + source[which];
607      sx += (attributes & 0x80) << 1;
608      sy += (attributes & 0x10) << 4;
461609
462      tile_number |= (attributes & 0xf) << 8;
610      switch (size)
611      {
612         case 16:
613            tile_number |= (attributes & 0x60) << 3;
614            break;
463615
464      color = attributes >> 4;
465      sx = x << 4;
466      sy = y << 4;
616         case 32:
617            tile_number |= (attributes & 0x40) << 2;
618            break;
619      }
467620
468      // intercept overflown tile indices
469      if(tile_number >= gfx->total_elements)
470         plot_box(tmpbitmap, sx, sy, gfx->width, gfx->height, get_black_pen(machine));
471      else
472         drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
621      sx &= 0x1ff;
622      sy &= 0x1ff;
623      if (sx > 512-size) sx -= 512;
624      if (sy > 512-size) sy -= 512;
625
626      drawgfx(bitmap,gfx,
627            tile_number,
628            color,
629            0,0,
630            sx,sy,
631            cliprect,TRANSPARENCY_PEN_TABLE,7);
473632   }
474   copyscrollbitmap(bitmap,tmpbitmap,1,&xscroll,1,&yscroll,cliprect);
475633}
476634
635/**************************************************************/
636
477637/*
478638Sprite Format
479639-------------
r3115r3116
482642byte2: x offset
483643byte3: attributes
484644
485    mode 0/1 attributes:
645    32x32 attributes:
486646
487647    76543210
488648    ----xxxx (color)
r3115r3116
490650    -xx----- (bank number)
491651    x------- (x offset bit8)
492652
493    mode 2 attributes:
653    16x16 attributes:
494654
495655    76543210
496656    -----xxx (color)
r3115r3116
498658    -xx-x--- (bank number)
499659    x------- (x offset bit8)
500660*/
501static void tdfever_draw_sp(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int xscroll, int yscroll, int mode, int flipx )
661static void tdfever_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
662      const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, const int hw_xflip, const int from, const int to )
502663{
503   const UINT8 *source = snk_rambase + ((mode==2)?0x1800:0x1000);
504   const gfx_element *gfx = machine->gfx[(mode==1)?3:2];
664   const gfx_element *gfx = machine->gfx[gfxnum];
665   const int size = gfx->width;
505666   int tile_number, attributes, sx, sy, color, pen_mode;
506   int which, finish, sp_size;
667   int which;
668   int flipx, flipy;
507669
508   if(mode < 0 || mode > 2) return;
670   pen_mode = (machine->config->video_attributes & VIDEO_HAS_SHADOWS) ? TRANSPARENCY_PEN_TABLE : TRANSPARENCY_PEN;
509671
510   pen_mode = (snk_gamegroup & 1) ? TRANSPARENCY_PEN_TABLE : TRANSPARENCY_PEN;
511
512   if(mode == 2)
672   for(which = from*4; which < to*4; which+=4)
513673   {
514      finish  = 64 * 4;
515      sp_size = 16;
516   }
517   else
518   {
519      finish  = 32 * 4;
520      sp_size = 32;
521   }
522
523   for(which = 0; which < finish; which+=4)
524   {
525      if(*(UINT32*)(source+which) == 0 || *(UINT32*)(source+which) == -1) continue;
526
527674      tile_number = source[which+1];
528675      attributes  = source[which+3];
676      color = attributes & 0x0f;
677      sx = -xscroll - 9 + source[which+2];
678      sy = -yscroll + 1 - size + source[which];
679      sx += (attributes & 0x80) << 1;
680      sy += (attributes & 0x10) << 4;
529681
530      sx = xscroll + source[which+2]; if(mode==0) sx = 256-sx;
531      sy = yscroll + source[which];
532      sx += attributes<<1 & 0x100;
533      sy += attributes<<4 & 0x100;
534      sx &= 0x1ff; if(sx > 512-sp_size) sx -= 512;
535      sy &= 0x1ff; if(sy > 512-sp_size) sy -= 512;
536
537      switch(mode)
682      switch (size)
538683      {
539         case 2:
540            tile_number |= (attributes<<4 & 0x600) | (attributes<<5 & 0x100);
541            color = attributes & 0x07;
542         break;
684         case 16:
685            tile_number |= ((attributes & 0x08) << 5) | ((attributes & 0x60) << 4);
686            color &= 7;   // attribute bit 3 is used for bank select
687            break;
543688
544         default:
545            tile_number |= attributes<<3 & 0x300;
546            color = attributes & 0x0f;
689         case 32:
690            tile_number |= (attributes & 0x60) << 3;
691            break;
547692      }
548693
549      drawgfx(bitmap,gfx,tile_number,color,flipx,0,sx,sy,cliprect,pen_mode,15);
550   }
551}
694      flipx = hw_xflip;
695      flipy = 0;
552696
553static void tdfever_draw_tx(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int attributes, int dx, int dy, int base )
554{
555   const UINT8 *source = snk_rambase - 0xd000 + base;
556   const gfx_element *gfx = machine->gfx[0];
697      if (hw_xflip)
698         sx = 495 - size - sx;
557699
558   int tile_high = (attributes & 0xf0) << 4;
559   int color = attributes & 0xf;
560   int tile_number, sx, sy;
561   int x, y;
700      if (flip_screen_get())
701      {
702         sx = 495 - size - sx;
703         sy = 258 - size - sy;
704         flipx = !flipx;
705         flipy = !flipy;
706      }
562707
563   for(x = 0; x < 64; x++) for(y = 0; y < 32; y++)
564   {
565      tile_number = source[(x<<5)+y];
708      sx &= 0x1ff;
709      sy &= 0x1ff;
710      if (sx > 512-size) sx -= 512;
711      if (sy > 512-size) sy -= 512;
566712
567      if(tile_number == 0x20) continue;
568
569      sx = dx + x*8;
570      sy = dy + y*8;
571
572      drawgfx(bitmap,gfx,tile_high|tile_number,color,0,0,sx,sy,cliprect,TRANSPARENCY_PEN,15);
713      drawgfx(bitmap,gfx,
714            tile_number,
715            color,
716            flipx,flipy,
717            sx,sy,
718            cliprect,pen_mode,15);
573719   }
574720}
575721
576722/**************************************************************/
577723
578VIDEO_UPDATE( tdfever )
724VIDEO_UPDATE( tnk3 )
579725{
580   const UINT8 *ram = snk_rambase - 0xd000;
726   tilemap_set_scrollx(bg_tilemap, 0, bg_scrollx);
727   tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly);
581728
582   UINT8 bg_attributes = ram[0xc880];
583   UINT8 sp_attributes = ram[0xc900];
584   UINT8 tx_attributes = ram[0xc8c0];
585   int bg_scroll_x = -ram[0xc840] + ((bg_attributes & 0x02) ? 256:0);
586   int bg_scroll_y = -ram[0xc800] + ((bg_attributes & 0x01) ? 256:0);
587   int sp_scroll_x = -ram[0xc9c0] + ((sp_attributes & 0x40) ? 0:256);
588   int sp_scroll_y = -ram[0xc980] + ((sp_attributes & 0x80) ? 256:0);
729   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
730   tnk3_draw_sprites(screen->machine, bitmap, cliprect, sp16_scrollx, sp16_scrolly);
731   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
589732
590   // TODO bg_attribute & 0x10 is screen flip
733   return 0;
734}
591735
592   if(snk_gamegroup == 3 || snk_gamegroup == 5) // tdfever, tdfeverj
593   {
594         bg_scroll_x += 143;
595         bg_scroll_y += -32;
596         sp_scroll_x += 135;
597         sp_scroll_y += -65;
598   }
599   else if(snk_gamegroup == 7) // ftsoccer
600   {
601         bg_scroll_x += 16;
602         bg_scroll_y += 0;
603         sp_scroll_x += 40;
604         sp_scroll_y += -31;
605   }
606   tdfever_draw_bg(screen->machine, bitmap, cliprect, bg_scroll_x, bg_scroll_y );
607736
608   tdfever_draw_sp(screen->machine, bitmap, cliprect, sp_scroll_x, sp_scroll_y, 0, 1 );
737VIDEO_UPDATE( ikari )
738{
739   tilemap_set_scrollx(bg_tilemap, 0, bg_scrollx);
740   tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly);
609741
610   tdfever_draw_tx(screen->machine, bitmap, cliprect, tx_attributes, 0, 0, 0xf800 );
742   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
743
744   ikari_draw_sprites(screen->machine, bitmap, cliprect,  0, sp16_scrollx, sp16_scrolly, spriteram + 0x800, 2 );
745   ikari_draw_sprites(screen->machine, bitmap, cliprect,  0, sp32_scrollx, sp32_scrolly, spriteram,         3 );
746   ikari_draw_sprites(screen->machine, bitmap, cliprect, 25, sp16_scrollx, sp16_scrolly, spriteram + 0x800, 2 );
747
748   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
611749   return 0;
612750}
613751
752
614753VIDEO_UPDATE( gwar )
615754{
616   const UINT8 *ram = snk_rambase - 0xd000;
617   int gwar_sp_baseaddr, gwar_tx_baseaddr;
618   UINT8 bg_attribute;
755   tilemap_set_scrollx(bg_tilemap, 0, bg_scrollx);
756   tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly);
619757
620   if(snk_gamegroup == 4) // gwara
621   {
622      gwar_sp_baseaddr = 0xf000;
623      gwar_tx_baseaddr = 0xc800;
624   }
625   else
626   {
627      gwar_sp_baseaddr = 0xc000;
628      gwar_tx_baseaddr = 0xf800;
629   }
758   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
630759
631   bg_attribute = ram[gwar_sp_baseaddr+0x880];
760   tdfever_draw_sprites(screen->machine, bitmap, cliprect, sp16_scrollx, sp16_scrolly, spriteram + 0x800, 2, 0, 0, sprite_split_point );
761   tdfever_draw_sprites(screen->machine, bitmap, cliprect, sp32_scrollx, sp32_scrolly, spriteram,         3, 0, 0, 32 );
762   tdfever_draw_sprites(screen->machine, bitmap, cliprect, sp16_scrollx, sp16_scrolly, spriteram + 0x800, 2, 0, sprite_split_point, 64 );
632763
633   // TODO bg_attribute & 0x04 is screen flip
764   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
634765
635   {
636      int bg_scroll_y, bg_scroll_x;
766   return 0;
767}
637768
638      bg_scroll_x = -ram[gwar_sp_baseaddr+0x840] + 16;
639      bg_scroll_y = -ram[gwar_sp_baseaddr+0x800];
640769
641      bg_scroll_x += (bg_attribute & 2) ? 256:0;
642       bg_scroll_y += (bg_attribute & 1) ? 256:0;
770VIDEO_UPDATE( tdfever )
771{
772   tilemap_set_scrollx(bg_tilemap, 0, bg_scrollx);
773   tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly);
643774
644      tdfever_draw_bg(screen->machine, bitmap, cliprect, bg_scroll_x, bg_scroll_y );
645   }
775   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
646776
647   {
648      UINT8 sp_attribute = ram[gwar_sp_baseaddr+0xac0];
649      int sp16_x = -ram[gwar_sp_baseaddr+0x940] - 9;
650      int sp16_y = -ram[gwar_sp_baseaddr+0x900] - 15;
651      int sp32_x = -ram[gwar_sp_baseaddr+0x9c0] - 9;
652      int sp32_y = -ram[gwar_sp_baseaddr+0x980] - 31;
777   tdfever_draw_sprites(screen->machine, bitmap, cliprect, sp32_scrollx, sp32_scrolly, spriteram, 2, 1, 0, 32 );
653778
654      if(snk_gamegroup == 2) // gwar, gwarj, gwarb, choppera
655      {
656         sp16_y += (bg_attribute & 0x10) ? 256:0;
657         sp16_x += (bg_attribute & 0x40) ? 256:0;
658         sp32_y += (bg_attribute & 0x20) ? 256:0;
659         sp32_x += (bg_attribute & 0x80) ? 256:0;
660      }
661      else
662      {
663         UINT8 spp_attribute = ram[gwar_sp_baseaddr+0xa80];
664         sp16_x += (spp_attribute & 0x10) ? 256:0;
665         sp16_y += (spp_attribute & 0x04) ? 256:0;
666         sp32_x += (spp_attribute & 0x20) ? 256:0;
667         sp32_y += (spp_attribute & 0x08) ? 256:0;
668      }
779   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
669780
670      if(sp_attribute & 0xf8) // improves priority
671      {
672         tdfever_draw_sp(screen->machine, bitmap, cliprect, sp16_x, sp16_y, 2, 0 );
673         tdfever_draw_sp(screen->machine, bitmap, cliprect, sp32_x, sp32_y, 1, 0 );
674      }
675      else
676      {
677         tdfever_draw_sp(screen->machine, bitmap, cliprect, sp32_x, sp32_y, 1, 0 );
678         tdfever_draw_sp(screen->machine, bitmap, cliprect, sp16_x, sp16_y, 2, 0 );
679      }
680   }
681
682   {
683      UINT8 text_attribute = ram[gwar_sp_baseaddr+0x8c0];
684      tdfever_draw_tx(screen->machine, bitmap, cliprect, text_attribute, 0, 0, gwar_tx_baseaddr );
685   }
686781   return 0;
687782}
src/mame/video/namconb1.c
r3115r3116
44#include "namconb1.h"
55#include "namcoic.h"
66#include "namcos2.h"
7#include "audio/namcoc7x.h"
78
89static UINT32 tilemap_tile_bank[4];
910
r3115r3116
111112   static int toggle;
112113   static UINT16 credits;
113114   static int old_coin_state;
114   static int old_p1;
115   static int old_p2;
116   static int old_p3;
117   static int old_p4;
115   static UINT16 old_p1;
116   static UINT16 old_p2;
117   static UINT16 old_p3;
118   static UINT16 old_p4;
118119   int new_coin_state = input_port_read(machine, "COIN") & 0x3;   /* coin1,2 */
119   unsigned dsw = input_port_read(machine, "DSW")<<16;
120   unsigned p1 = input_port_read(machine, "P1");
121   unsigned p2 = input_port_read(machine, "P2");
122   unsigned p3;
123   unsigned p4;
120   UINT16 dsw = input_port_read(machine, "DSW");
121   UINT16 p1 = input_port_read(machine, "P1");
122   UINT16 p2 = input_port_read(machine, "P2");
123   UINT16 p3;
124   UINT16 p4;
125
124126   toggle = !toggle;
125   if( toggle ) dsw &= ~(0x80<<16);
127   if(toggle)
128      dsw &= ~0x80;
129
130   if(cpunum_is_suspended(1, SUSPEND_REASON_HALT))
131      return;
132
126133   if( namcos2_gametype == NAMCONB2_MACH_BREAKERS )
127134   {
128135      p3 = input_port_read_safe(machine, "P3", 0);
r3115r3116
144151   old_p3 = p3;
145152   old_p4 = p4;
146153
147   namconb1_workram32[0x6000/4] = dsw|p1;
148   namconb1_workram32[0x6004/4] = (p2<<16)|p3;
149   namconb1_workram32[0x6008/4] = p4<<16;
154   namcoc7x_soundram16_w(machine, 0x6000/2, dsw, 0xffff);
155   namcoc7x_soundram16_w(machine, 0x6002/2, p1, 0xffff);
156   namcoc7x_soundram16_w(machine, 0x6004/2, p2, 0xffff);
157   namcoc7x_soundram16_w(machine, 0x6006/2, p3, 0xffff);
158   namcoc7x_soundram16_w(machine, 0x6008/2, p4, 0xffff);
150159
151160   if( new_coin_state && !old_coin_state )
152161   {
153162      credits++;
154163   }
155164   old_coin_state = new_coin_state;
156   namconb1_workram32[0x601e/4] &= 0xffff0000;
157   namconb1_workram32[0x601e/4] |= credits;
165    namcoc7x_soundram16_w(machine, 0x601e/2, credits, 0xffff);
158166} /* handle_mcu */
159167
160168static void
src/mame/video/psikyo.c
r3115r3116
434434
435435   tilemap *tmptilemap0, *tmptilemap1;
436436
437   flip_screen_set(~input_port_read(screen->machine, "DSW1") & 1);      // hardwired to a DSW bit
437   flip_screen_set(~input_port_read(screen->machine, "DSW") & 0x00010000);      // hardwired to a DSW bit
438438
439439   /* Layers enable (not quite right) */
440440
src/mame/video/tetrisp2.c
r3115r3116
5757
5858UINT16 *rocknms_sub_priority;
5959
60static int flipscreen_old;
6061
6162/***************************************************************************
6263
r3115r3116
270271
271272VIDEO_START( tetrisp2 )
272273{
274   flipscreen_old = -1;
275
273276   tilemap_bg = tilemap_create(   get_tile_info_bg,tilemap_scan_rows,
274277
275278                        16,16,NX_0,NY_0);
r3115r3116
295298
296299VIDEO_START( rockntread )
297300{
301   flipscreen_old = -1;
302
298303   tilemap_bg = tilemap_create(   get_tile_info_bg,tilemap_scan_rows,
299304
300305                        16, 16, 256, 16);   // rockn ms(main),1,2,3,4
r3115r3116
315320
316321VIDEO_START( rocknms )
317322{
318   tilemap_bg = tilemap_create(get_tile_info_bg,tilemap_scan_rows,
323   VIDEO_START_CALL( rockntread );
319324
320               16, 16, 256, 16);   // rockn ms(main),1,2,3,4
321
322   tilemap_fg = tilemap_create(get_tile_info_fg,tilemap_scan_rows,
323
324               8, 8, 64, 64);
325
326   tilemap_rot = tilemap_create(get_tile_info_rot,tilemap_scan_rows,
327
328               16, 16, 128, 128);
329
330325   tilemap_sub_bg = tilemap_create(get_tile_info_rocknms_sub_bg,tilemap_scan_rows,
331326
332327               16, 16, 32, 256);   // rockn ms(sub)
r3115r3116
339334
340335               16, 16, 128, 128);
341336
342   tilemap_set_transparent_pen(tilemap_bg, 0);
343   tilemap_set_transparent_pen(tilemap_fg, 0);
344   tilemap_set_transparent_pen(tilemap_rot, 0);
345
346337   tilemap_set_transparent_pen(tilemap_sub_bg, 0);
347338   tilemap_set_transparent_pen(tilemap_sub_fg, 0);
348339   tilemap_set_transparent_pen(tilemap_sub_rot, 0);
r3115r3116
518509
519510VIDEO_UPDATE( tetrisp2 )
520511{
521   static int flipscreen_old = -1;
522512   int flipscreen;
523513   int asc_pri;
524514   int scr_pri;
r3115r3116
603593
604594VIDEO_UPDATE( rockntread )
605595{
606   static int flipscreen_old = -1;
607596   int flipscreen;
608597   int asc_pri;
609598   int scr_pri;
src/mame/video/cischeat.c
r3115r3116
182182
183183    and allows the shift to be handled using two buttons */
184184
185static int read_shift(running_machine *machine)
185CUSTOM_INPUT( cischeat_shift_r )
186186{
187187   static int ret = 1; /* start with low shift */
188   switch ( (input_port_read(machine, "FAKE") >> 2) & 3 )
188   switch ( (input_port_read(field->port->machine, "FAKE") >> 2) & 3 )
189189   {
190190      case 1 : ret = 1;   break;   // low  shift: button 3
191191      case 2 : ret = 0;   break;   // high shift: button 4
r3115r3116
193193   return ret;
194194}
195195
196
197196/*
198197    F1 GP Star has a real pedal, while Cisco Heat's is connected to
199198    a switch. The Former game stores, during boot, the value that
r3115r3116
219218   switch (offset)
220219   {
221220      case 0x0000/2 : return input_port_read(machine, "IN1");   // Coins
222      case 0x0002/2 : return input_port_read(machine, "IN2") + (read_shift(machine)<<1);   // Buttons
221      case 0x0002/2 : return input_port_read(machine, "IN2");   // Buttons
223222      case 0x0004/2 : return input_port_read(machine, "IN3");   // Motor Limit Switches
224223      case 0x0006/2 : return input_port_read(machine, "IN4");   // DSW 1 & 2
225224
r3115r3116
315314   switch (offset)
316315   {
317316      case 0x0000/2 : return input_port_read(machine, "IN1");   // Coins
318      case 0x0002/2 : return input_port_read(machine, "IN2") + (read_shift(machine)<<1);         // Buttons
317      case 0x0002/2 : return input_port_read(machine, "IN2");   // Buttons
319318      case 0x0004/2 : return input_port_read(machine, "IN3");   // Motor Limit Switches
320319      case 0x0006/2 : return input_port_read(machine, "IN4");   // DSW 1 & 2
321320
r3115r3116
411410
412411//      case 0x0002/2 : return 0xFFFF;
413412
414      case 0x0004/2 :   return input_port_read(machine, "IN2") + (read_shift(machine)<<5);   // Buttons
413      case 0x0004/2 :   return input_port_read(machine, "IN2");   // Buttons
415414
416415      case 0x0006/2 :   return input_port_read(machine, "IN3");   // ? Read at boot only
417416
418      case 0x0008/2 :   return soundlatch2_r(machine,0);   // From sound cpu
417      case 0x0008/2 :   return soundlatch2_r(machine,0);      // From sound cpu
419418
420419      case 0x000c/2 :   return input_port_read(machine, "IN4");   // DSW 3
421420
src/mame/video/gatron.c
r0r3116
1/******************************************************************************
2
3    GAME-A-TRON gambling hardware
4    -----------------------------
5
6    *** Video Hardware ***
7
8    Written by Roberto Fresca.
9
10
11    Games running on this hardware:
12
13    * Poker 4-1,  1983, Game-A-Tron.
14    * Pull Tabs,  1983, Game-A-Tron.
15
16
17*******************************************************************************/
18
19
20#include "driver.h"
21
22static tilemap *bg_tilemap;
23
24
25WRITE8_HANDLER( gat_videoram_w )
26{
27   videoram[offset] = data;
28   tilemap_mark_tile_dirty(bg_tilemap, offset);
29}
30
31static TILE_GET_INFO( get_bg_tile_info )
32{
33/*  - bits -
34    7654 3210
35    xxxx xxxx   tiles code.
36
37    only one color code
38*/
39
40   int code = videoram[tile_index];
41
42   SET_TILE_INFO(0, code, 0, 0);
43}
44
45VIDEO_START( gat )
46{
47   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, 8, 16, 48, 16);
48}
49
50VIDEO_UPDATE( gat )
51{
52   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
53   return 0;
54}
55
56PALETTE_INIT( gat )
57{
58}
59
src/mame/video/rollrace.c
r3115r3116
8989
9090         drawgfx(bitmap,
9191            screen->machine->gfx[RA_BGCHAR_BASE],
92            mem[offs + ( ra_bkgpage * 1024 )] \
92            mem[offs + ( ra_bkgpage * 1024 )]
9393            + ((( mem[offs + 0x4000 + ( ra_bkgpage * 1024 )] & 0xc0 ) >> 6 ) * 256 ) ,
9494            ra_bkgcol,
9595            ra_flipx,(ra_bkgflip^ra_flipy),
src/mame/video/avgdvg.h
r3115r3116
66extern UINT16 *quantum_colorram;
77extern UINT16 *quantum_vectorram;
88
9int avgdvg_done(void);
109CUSTOM_INPUT( avgdvg_done_r );
1110WRITE8_HANDLER( avgdvg_go_w );
1211WRITE8_HANDLER( avgdvg_reset_w );
src/mame/video/konamiic.c
r3115r3116
1019101900-01 R operand 1 / operand 2
1020102002-03 R operand 1 % operand 2?
1021102104-05 R sqrt(operand 3<<16)
102206    R unknown - return value written to 13?
10221023
1023102406-07 W distance for collision check
1024102508-09 W Y pos of obj1
r3115r3116
53115312      case 0x05:
53125313         return int_sqrt(op3<<16) & 0xff;
53135314
5315      case 0x06:
5316         return K051733_ram[0x13];
5317
53145318      case 0x07:{
53155319         if (xobj1c + rad < xobj2c)
53165320            return 0x80;
src/mame/video/snk68.c
r3115r3116
1616
1717UINT16* pow_fg_videoram;
1818
19static int pow_charbank;
2019static int sprite_flip_axis;
2120static tilemap *fg_tilemap;
2221static int flipscreen;
r3115r3116
2928
3029static TILE_GET_INFO( get_pow_tile_info )
3130{
32   int tile = (pow_fg_videoram[2*tile_index] & 0xff) | (pow_charbank << 8);
31   int tile = (pow_fg_videoram[2*tile_index] & 0xff);
3332   int color = pow_fg_videoram[2*tile_index+1] & 0x07;
3433
3534   SET_TILE_INFO(0, tile, color, 0);
r3115r3116
140139
141140      sprite_flip_axis = data & 0x04;   // for streetsm? though might not be present on this board
142141
143      if (pow_charbank != ((data & 0x70) >> 4))
144      {
145         pow_charbank = (data & 0x70) >> 4;
146         tilemap_mark_all_tiles_dirty(fg_tilemap);
147      }
142      tilemap_set_pen_data_offset(fg_tilemap, ((data & 0x70) << 4) * machine->gfx[0]->char_modulo);
148143   }
149144}
150145
src/mame/video/quizdna.c
r3115r3116
1919
2020static UINT8 quizdna_bg_xscroll[2];
2121
22static int quizdna_flipscreen = -1;
22static int quizdna_flipscreen;
2323static int quizdna_video_enable;
2424
2525
r3115r3116
5656
5757VIDEO_START( quizdna )
5858{
59   quizdna_flipscreen = -1;
60   quizdna_video_enable = 0;
61   quizdna_bg_xscroll[0] = 0;
62   quizdna_bg_xscroll[1] = 0;
63
5964   quizdna_bg_ram = auto_malloc(0x2000);
6065   quizdna_fg_ram = auto_malloc(0x1000);
6166
src/mame/video/fromance.c
r3115r3116
2727static UINT8 crtc_data[0x10];
2828static emu_timer *crtc_timer;
2929
30static UINT8 flipscreen_old = -1;
30static UINT8 flipscreen_old;
3131
3232static tilemap *bg_tilemap, *fg_tilemap;
3333
r3115r3116
7373 *
7474 *************************************/
7575
76VIDEO_START( fromance )
76static void init_common(void)
7777{
78   /* allocate tilemaps */
79   bg_tilemap = tilemap_create(get_fromance_bg_tile_info, tilemap_scan_rows,       8,4, 64,64);
80   fg_tilemap = tilemap_create(get_fromance_fg_tile_info, tilemap_scan_rows,  8,4, 64,64);
78   flipscreen_old = -1;
8179
8280   /* allocate local videoram */
8381   local_videoram[0] = auto_malloc(0x1000 * 3);
r3115r3116
112110   state_save_register_global_pointer(local_paletteram, 0x800 * 2);
113111}
114112
113VIDEO_START( fromance )
114{
115   /* allocate tilemaps */
116   bg_tilemap = tilemap_create(get_fromance_bg_tile_info, tilemap_scan_rows,       8,4, 64,64);
117   fg_tilemap = tilemap_create(get_fromance_fg_tile_info, tilemap_scan_rows,  8,4, 64,64);
118
119   init_common();
120}
121
115122VIDEO_START( nekkyoku )
116123{
117124   /* allocate tilemaps */
118125   bg_tilemap = tilemap_create(get_nekkyoku_bg_tile_info, tilemap_scan_rows,       8,4, 64,64);
119126   fg_tilemap = tilemap_create(get_nekkyoku_fg_tile_info, tilemap_scan_rows,  8,4, 64,64);
120127
121   /* allocate local videoram */
122   local_videoram[0] = auto_malloc(0x1000 * 3);
123   local_videoram[1] = auto_malloc(0x1000 * 3);
124
125   /* allocate local palette RAM */
126   local_paletteram = auto_malloc(0x800 * 2);
127
128   /* configure tilemaps */
129   tilemap_set_transparent_pen(fg_tilemap,15);
130
131   /* reset the timer */
132   crtc_timer = timer_alloc(crtc_interrupt_gen, NULL);
133
134   scrollx_ofs = 0x159;
135   scrolly_ofs = 0x10;
136
137   /* state save */
138   state_save_register_global(selected_videoram);
139   state_save_register_global_pointer(local_videoram[0], 0x1000 * 3);
140   state_save_register_global_pointer(local_videoram[1], 0x1000 * 3);
141   state_save_register_global(selected_paletteram);
142   state_save_register_global_array(scrollx);
143   state_save_register_global_array(scrolly);
144   state_save_register_global(gfxreg);
145   state_save_register_global(flipscreen);
146   state_save_register_global(flipscreen_old);
147   state_save_register_global(scrollx_ofs);
148   state_save_register_global(scrolly_ofs);
149   state_save_register_global(crtc_register);
150   state_save_register_global_array(crtc_data);
151   state_save_register_global_pointer(local_paletteram, 0x800 * 2);
128   init_common();
152129}
153130
154131VIDEO_START( pipedrm )
src/mame/etc/jrcrypt.c
r3115r3116
352352      }
353353   }
354354   printf("  Non mapped, Probably not encrypted: %d\n",unmapped);
355   printf("  Non mapped, but Probably encrypted:
356%d\n",unmapped_encrypted);
355   printf("  Non mapped, but Probably encrypted: %d\n",unmapped_encrypted);
357356
358357   while (1)
359358   {
360359      void write_rom_section(char *prefix,char *suffix,int
361360start,int end);
362361      char c;
363      printf(" Enter D to Merge mapped and unmapped and dump to
364rom file,\n");
362      printf(" Enter D to Merge mapped and unmapped and dump to rom file,\n");
365363      printf(" Enter Q to quit.\n");
366364      c=tolower(getchar());
367365      while (getchar()!='\n') {}
r3115r3116
371369      {
372370         char line[100],*l;
373371         int i;
374         printf("Enter file prefix (files will be named
375'prefix'.8d 'prefix'.8e, etc.\n");
372         printf("Enter file prefix (files will be named 'prefix'.8d 'prefix'.8e, etc.\n");
376373         gets(line);
377374         // kill newline:
378375         for (l=line;*l!='\n' && *l!='\0';l++)
src/mame/layout/poker41.lay
r0r3116
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="hold1" defstate="1">
4      <rect>
5         <color red="1.0" green="0.0" blue="0.0" />
6      </rect>
7      <text string="DISCARD 1" state="1">
8         <color red="0.0" green="0.0" blue="0.0" />
9         <bounds x="0" y="0.1" width="1" height="0.8" />
10      </text>
11   </element>
12
13   <element name="hold2" defstate="1">
14      <rect>
15         <color red="1.0" green="0.0" blue="0.0" />
16      </rect>
17      <text string="DISCARD 2" state="1">
18         <color red="0.0" green="0.0" blue="0.0" />
19         <bounds x="0" y="0.1" width="1" height="0.8" />
20      </text>
21   </element>
22
23   <element name="hold3" defstate="1">
24      <rect>
25         <color red="1.0" green="0.0" blue="0.0" />
26      </rect>
27      <text string="DISCARD 3" state="1">
28         <color red="0.0" green="0.0" blue="0.0" />
29         <bounds x="0" y="0.1" width="1" height="0.8" />
30      </text>
31   </element>
32
33   <element name="hold4" defstate="1">
34      <rect>
35         <color red="1.0" green="0.0" blue="0.0" />
36      </rect>
37      <text string="DISCARD 4" state="1">
38         <color red="0.0" green="0.0" blue="0.0" />
39         <bounds x="0" y="0.1" width="1" height="0.8" />
40      </text>
41   </element>
42
43   <element name="hold5" defstate="1">
44      <rect>
45         <color red="1.0" green="0.0" blue="0.0" />
46      </rect>
47      <text string="DISCARD 5" state="1">
48         <color red="0.0" green="0.0" blue="0.0" />
49         <bounds x="0" y="0.1" width="1" height="0.8" />
50      </text>
51   </element>
52
53   <element name="stand" defstate="1">
54      <rect>
55         <color red="1.0" green="0.5" blue="0.0" />
56      </rect>
57      <text string="FB-DRAW / STAND" state="1">
58         <color red="0.0" green="0.0" blue="0.0" />
59         <bounds x="0" y="0.1" width="1" height="0.8" />
60      </text>
61   </element>
62
63   <element name="hit" defstate="1">
64      <rect>
65         <color red="1.0" green="0.5" blue="0.0" />
66      </rect>
67      <text string="DEAL / HIT" state="1">
68         <color red="0.0" green="0.0" blue="0.0" />
69         <bounds x="0" y="0.1" width="1" height="0.8" />
70      </text>
71   </element>
72
73   <element name="bet" defstate="1">
74      <rect>
75         <color red="1.0" green="0.5" blue="0.0" />
76      </rect>
77      <text string="ANTE / BET" state="1">
78         <color red="0.0" green="0.0" blue="0.0" />
79         <bounds x="0" y="0.1" width="1" height="0.8" />
80      </text>
81   </element>
82
83   <element name="start" defstate="1">
84      <rect>
85         <color red="1.0" green="0.5" blue="0.0" />
86      </rect>
87      <text string="START" state="1">
88         <color red="0.0" green="0.0" blue="0.0" />
89         <bounds x="0" y="0.1" width="1" height="0.8" />
90      </text>
91   </element>
92
93
94   <view name="Button Lamps">
95      <screen index="0">
96         <bounds left="0" top="0" right="4" bottom="3" />
97      </screen>
98
99      <bezel name="lamp8" element="hold1">
100         <bounds x="0" y="3.02" width="0.72" height="0.24" />
101      </bezel>
102
103      <bezel name="lamp7" element="hold2">
104         <bounds x="0.82" y="3.02" width="0.72" height="0.24" />
105      </bezel>
106
107      <bezel name="lamp6" element="stand">
108         <bounds x="0.82" y="3.28" width="0.72" height="0.24" />
109      </bezel>
110
111      <bezel name="lamp0" element="hold3">
112         <bounds x="1.64" y="3.02" width="0.72" height="0.24" />
113      </bezel>
114
115      <bezel name="lamp5" element="hit">
116         <bounds x="1.64" y="3.28" width="0.72" height="0.24" />
117      </bezel>
118
119      <bezel name="lamp1" element="hold4">
120         <bounds x="2.46" y="3.02" width="0.72" height="0.24" />
121      </bezel>
122
123      <bezel name="lamp3" element="bet">
124         <bounds x="2.46" y="3.28" width="0.72" height="0.24" />
125      </bezel>
126
127      <bezel name="lamp2" element="hold5">
128         <bounds x="3.28" y="3.02" width="0.72" height="0.24" />
129      </bezel>
130
131      <bezel name="lamp4" element="start">
132         <bounds x="3.28" y="3.28" width="0.72" height="0.24" />
133      </bezel>
134   </view>
135</mamelayout>
src/mame/layout/pulltabs.lay
r0r3116
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="tab1" defstate="1">
4      <rect>
5         <color red="1.0" green="0.0" blue="0.0" />
6      </rect>
7      <text string="SUPER STAR" state="1">
8         <color red="0.0" green="0.0" blue="0.0" />
9         <bounds x="0" y="0.1" width="1" height="0.8" />
10      </text>
11   </element>
12
13   <element name="tab2" defstate="1">
14      <rect>
15         <color red="1.0" green="0.0" blue="0.0" />
16      </rect>
17      <text string="LADY LUCK" state="1">
18         <color red="0.0" green="0.0" blue="0.0" />
19         <bounds x="0" y="0.1" width="1" height="0.8" />
20      </text>
21   </element>
22
23   <element name="tab3" defstate="1">
24      <rect>
25         <color red="1.0" green="0.0" blue="0.0" />
26      </rect>
27      <text string="BIG BAR" state="1">
28         <color red="0.0" green="0.0" blue="0.0" />
29         <bounds x="0" y="0.1" width="1" height="0.8" />
30      </text>
31   </element>
32
33   <element name="bet" defstate="1">
34      <rect>
35         <color red="1.0" green="0.5" blue="0.0" />
36      </rect>
37      <text string="ANTE/BET" state="1">
38         <color red="0.0" green="0.0" blue="0.0" />
39         <bounds x="0" y="0.1" width="1" height="0.8" />
40      </text>
41   </element>
42
43
44   <view name="Button Lamps">
45      <screen index="0">
46         <bounds left="0" top="0" right="4" bottom="3" />
47      </screen>
48
49      <bezel name="lamp8" element="tab1">
50         <bounds x="0.30" y="3.02" width="1.00" height="0.24" />
51      </bezel>
52
53      <bezel name="lamp0" element="tab2">
54         <bounds x="1.50" y="3.02" width="1.00" height="0.24" />
55      </bezel>
56
57      <bezel name="lamp3" element="bet">
58         <bounds x="1.50" y="3.28" width="1.00" height="0.24" />
59      </bezel>
60
61      <bezel name="lamp2" element="tab3">
62         <bounds x="2.70" y="3.02" width="1.00" height="0.24" />
63      </bezel>
64
65   </view>
66</mamelayout>
src/mame/drivers/sbugger.c
r3115r3116
130130ADDRESS_MAP_END
131131
132132static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
133   AM_RANGE(0xe0, 0xe0) AM_WRITENOP // 8156 command/status reg (write c0 = command START = (start of timer)
134   AM_RANGE(0xe1, 0xe1) AM_READ(input_port_0_r) //8156 PA
135   AM_RANGE(0xe2, 0xe2) AM_READ(input_port_1_r) //8156 PB
136   AM_RANGE(0xe3, 0xe3) AM_READ(input_port_2_r) //8156 PC = 6 bit ! //2 bits tested af f4c6
137   AM_RANGE(0xe4, 0xe4) AM_WRITENOP // 8156 timer reg1 (write 7f = CNT length)
138   AM_RANGE(0xe5, 0xe5) AM_WRITENOP // 8156 timer reg2 (write c0 = timer mode - automatic reload, i.e. single pulse every time TC is reached)
133   AM_RANGE(0xe0, 0xe0) AM_WRITENOP            // 8156 command/status reg (write c0 = command START = (start of timer)
134   AM_RANGE(0xe1, 0xe1) AM_READ_PORT("INPUTS")      // 8156 PA
135   AM_RANGE(0xe2, 0xe2) AM_READ_PORT("DSW1")      // 8156 PB
136   AM_RANGE(0xe3, 0xe3) AM_READ_PORT("DSW2")      // 8156 PC = 6 bit ! //2 bits tested af f4c6
137   AM_RANGE(0xe4, 0xe4) AM_WRITENOP            // 8156 timer reg1 (write 7f = CNT length)
138   AM_RANGE(0xe5, 0xe5) AM_WRITENOP            // 8156 timer reg2 (write c0 = timer mode - automatic reload, i.e. single pulse every time TC is reached)
139139
140140   AM_RANGE(0xe8, 0xe8) AM_WRITE(sn76496_0_w)
141141   AM_RANGE(0xe9, 0xe9) AM_WRITE(sn76496_1_w)
r3115r3116
163163/* input ports */
164164
165165static INPUT_PORTS_START( sbugger )
166   PORT_START("INPUTS")   /* 8-bit */
166   PORT_START("INPUTS")
167167   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_2WAY
168168   PORT_DIPNAME( 0x02, 0x02, "PA 1" )
169169   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
r3115r3116
177177   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
178178   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
179179
180   PORT_START("DSW1")   /* 8-bit */
180   PORT_START("DSW1")
181181   PORT_DIPNAME( 0x01, 0x01, "PB 0" )
182182   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
183183   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
201201   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
202202   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
203203
204   PORT_START("DSW2")   /* 6-bit */
204   PORT_START("DSW2")
205205   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) ) //enemy speed
206206   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
207207   PORT_DIPSETTING(    0x01, DEF_STR( Normal ) )
208208   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
209209   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
210
211210   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Allow_Continue ) )
212211   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
213212   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
214
215213   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) //bonus stage related (code at $f94 & $df8)
216214   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
217215   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/targeth.c
r3115r3116
7272   AM_RANGE(0x000000, 0x0fffff) AM_ROM
7373   AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(targeth_vram_w) AM_BASE(&targeth_videoram)   /* Video RAM */
7474   AM_RANGE(0x108000, 0x108007) AM_WRITE(SMH_RAM) AM_BASE(&targeth_vregs)   /* Video Registers */
75   AM_RANGE(0x108000, 0x108001) AM_READ(input_port_0_word_r)      /* Gun 1P X */
76   AM_RANGE(0x108002, 0x108003) AM_READ(input_port_1_word_r)      /* Gun 1P Y */
77   AM_RANGE(0x108004, 0x108005) AM_READ(input_port_2_word_r)      /* Gun 2P X */
78   AM_RANGE(0x108006, 0x108007) AM_READ(input_port_3_word_r)      /* Gun 2P Y */
75   AM_RANGE(0x108000, 0x108001) AM_READ_PORT("GUNX1")
76   AM_RANGE(0x108002, 0x108003) AM_READ_PORT("GUNY1")
77   AM_RANGE(0x108004, 0x108005) AM_READ_PORT("GUNX2")
78   AM_RANGE(0x108006, 0x108007) AM_READ_PORT("GUNY2")
7979   AM_RANGE(0x108000, 0x108007) AM_WRITE(SMH_RAM) AM_BASE(&targeth_vregs)   /* Video Registers */
8080   AM_RANGE(0x10800c, 0x10800d) AM_WRITE(SMH_NOP)               /* CLR Video INT */
8181   AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)   /* Palette */
8282   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&targeth_spriteram)   /* Sprite RAM */
83   AM_RANGE(0x700000, 0x700001) AM_READ(input_port_4_word_r)      /* DIPSW #2 */
84   AM_RANGE(0x700002, 0x700003) AM_READ(input_port_5_word_r)      /* DIPSW #1 */
85   AM_RANGE(0x700006, 0x700007) AM_READ(input_port_6_word_r)      /* Coins, Start & Fire buttons */
86   AM_RANGE(0x700008, 0x700009) AM_READ(input_port_7_word_r)      /* Service & Guns Reload? */
83   AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW2")
84   AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSW1")
85   AM_RANGE(0x700006, 0x700007) AM_READ_PORT("SYSTEM")            /* Coins, Start & Fire buttons */
86   AM_RANGE(0x700008, 0x700009) AM_READ_PORT("SERVICE")         /* Service & Guns Reload? */
8787   AM_RANGE(0x70000a, 0x70001b) AM_WRITE(SMH_NOP)               /* ??? Guns reload related? */
8888   AM_RANGE(0x70000c, 0x70000d) AM_WRITE(OKIM6295_bankswitch_w)   /* OKI6295 bankswitch */
8989   AM_RANGE(0x70000e, 0x70000f) AM_READWRITE(okim6295_status_0_lsb_r, okim6295_data_0_lsb_w)   /* OKI6295 status register */
r3115r3116
9292ADDRESS_MAP_END
9393
9494static INPUT_PORTS_START( targeth )
95   PORT_START("GUNX1")   /* Gun 1 X */
95   PORT_START("GUNX1")
9696   PORT_BIT( 0x01ff, 200, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.05, -0.028, 0) PORT_MINMAX( 0, 400 + 4) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(1)
9797   PORT_BIT( 0xfe00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
9898
99   PORT_START("GUNY1")   /* Gun 1 Y */
99   PORT_START("GUNY1")
100100   PORT_BIT( 0x01ff, 128, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.041, -0.011, 0) PORT_MINMAX(4,255) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(1)
101101   PORT_BIT( 0xfe00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
102102
103   PORT_START("GUNX2")   /* Gun 2 X */
103   PORT_START("GUNX2")
104104   PORT_BIT( 0x01ff, 400 + 4, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.05, -0.028, 0) PORT_MINMAX( 0, 400 + 4) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(2)
105105   PORT_BIT( 0xfe00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
106106
107   PORT_START("GUNY2")   /* Gun 2 Y */
107   PORT_START("GUNY2")
108108   PORT_BIT( 0x01ff, 255, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.041, -0.011, 0) PORT_MINMAX(4,255) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(2)
109109   PORT_BIT( 0xfe00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
110110
111   PORT_START("DSW2")   /* DSW #2 */
112   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
113   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
114   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
115   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
116   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
117   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
118   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
119   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
120   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
121   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
122   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
123   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
124   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
125   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
126   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
127   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
128   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
129   PORT_DIPNAME( 0x40, 0x40, "Gun alarm" )   /* This doesn't work. What's supposed to do? */
130   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
131   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
132   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
133
134   PORT_START("DSW1")   /* DSW #1 */
111   PORT_START("DSW1")
135112   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
136113   PORT_DIPSETTING(    0x02, DEF_STR( 6C_1C ) )
137114   PORT_DIPSETTING(    0x03, DEF_STR( 5C_1C ) )
r3115r3116
155132   PORT_DIPSETTING(    0x00, "Start 2C/Continue 1C" )
156133   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) )
157134   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
135
136   PORT_START("DSW2")
137   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
138   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
139   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
140   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
141   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
142   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
143   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
158144   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
145   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
146   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
147   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
148   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
149   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
150   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
151   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
152   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
153   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
154   PORT_DIPNAME( 0x40, 0x40, "Gun alarm" )   /* This doesn't work. What's supposed to do? */
155   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
156   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
157   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
158   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
159159
160   PORT_START("SYSTEM")   /* Button 1, COINSW & STARTSW */
160   PORT_START("SYSTEM")
161161   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
162162   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
163163   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
167167   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
168168   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
169169
170   PORT_START("SERVICE")   /* Service & Button 2 */
170   PORT_START("SERVICE")
171171   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
172172   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* this MUST be low or the game doesn't boot */
173173   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)   /* Reload 1P? */
src/mame/drivers/nycaptor.c
r3115r3116
514514   AM_RANGE(0xd002, 0xd002) AM_READ(nycaptor_generic_control_r)
515515   AM_RANGE(0xd400, 0xd400) AM_READ(from_snd_r)
516516   AM_RANGE(0xd401, 0xd401) AM_READ(unk_r)
517   AM_RANGE(0xd800, 0xd800) AM_READ(input_port_0_r)
518   AM_RANGE(0xd801, 0xd801) AM_READ(input_port_1_r)
519   AM_RANGE(0xd802, 0xd802) AM_READ(input_port_2_r)
520   AM_RANGE(0xd803, 0xd803) AM_READ(input_port_3_r)
521   AM_RANGE(0xd804, 0xd804) AM_READ(input_port_4_r)
517   AM_RANGE(0xd800, 0xd800) AM_READ_PORT("DSW0")
518   AM_RANGE(0xd801, 0xd801) AM_READ_PORT("DSW1")
519   AM_RANGE(0xd802, 0xd802) AM_READ_PORT("DSW2")
520   AM_RANGE(0xd803, 0xd803) AM_READ_PORT("IN0")
521   AM_RANGE(0xd804, 0xd804) AM_READ_PORT("IN1")
522522   AM_RANGE(0xd805, 0xd805) AM_READ(cyclshtg_mcu_status_r)
523523   AM_RANGE(0xd806, 0xd806) AM_READ(SMH_NOP)
524524   AM_RANGE(0xd807, 0xd807) AM_READ(cyclshtg_mcu_status_r)
src/mame/drivers/rainbow.c
r3115r3116
275275   AM_RANGE(0x10c000, 0x10ffff) AM_READ(SMH_RAM)   /* main RAM */
276276   AM_RANGE(0x200000, 0x200fff) AM_READ(SMH_RAM)   /* palette */
277277   AM_RANGE(0x201000, 0x203fff) AM_READ(SMH_RAM)   /* read in initial checks */
278   AM_RANGE(0x390000, 0x390003) AM_READ(input_port_0_word_r)
279   AM_RANGE(0x3b0000, 0x3b0003) AM_READ(input_port_1_word_r)
278   AM_RANGE(0x390000, 0x390003) AM_READ_PORT("DSWA")
279   AM_RANGE(0x3b0000, 0x3b0003) AM_READ_PORT("DSWB")
280280   AM_RANGE(0x3e0000, 0x3e0001) AM_READ(SMH_NOP)
281281   AM_RANGE(0x3e0002, 0x3e0003) AM_READ(taitosound_comm16_lsb_r)
282282   AM_RANGE(0x800000, 0x8007ff) AM_READ(rainbow_cchip_ram_r)
r3115r3116
310310   AM_RANGE(0x10c000, 0x10ffff) AM_READ(SMH_RAM)   /* main RAM */
311311   AM_RANGE(0x200000, 0x200fff) AM_READ(SMH_RAM)   /* palette */
312312   AM_RANGE(0x201000, 0x203fff) AM_READ(SMH_RAM)   /* read in initial checks */
313   AM_RANGE(0x400000, 0x400001) AM_READ(input_port_0_word_r)
314   AM_RANGE(0x400002, 0x400003) AM_READ(input_port_1_word_r)
315   AM_RANGE(0x401000, 0x401001) AM_READ(input_port_2_word_r)
316   AM_RANGE(0x401002, 0x401003) AM_READ(input_port_3_word_r)
313   AM_RANGE(0x400000, 0x400001) AM_READ_PORT("DSWA")
314   AM_RANGE(0x400002, 0x400003) AM_READ_PORT("DSWB")
315   AM_RANGE(0x401000, 0x401001) AM_READ_PORT("401001")
316   AM_RANGE(0x401002, 0x401003) AM_READ_PORT("401003")
317317   AM_RANGE(0x420000, 0x420001) AM_READ(SMH_NOP)   /* read, but result not used */
318318   AM_RANGE(0x440000, 0x4407ff) AM_READ(SMH_RAM)
319319   AM_RANGE(0xc00000, 0xc0ffff) AM_READ(PC080SN_word_0_r)
src/mame/drivers/pasha2.c
r3115r3116
234234   AM_RANGE(0x08, 0x0b) AM_READNOP //sound status?
235235   AM_RANGE(0x18, 0x1b) AM_READNOP //sound status?
236236   AM_RANGE(0x20, 0x23) AM_WRITE(pasha2_lamps_w)
237   AM_RANGE(0x40, 0x43) AM_READ(input_port_0_word_r)
238   AM_RANGE(0x60, 0x63) AM_READ(input_port_1_word_r)
239   AM_RANGE(0x80, 0x83) AM_READ(input_port_2_word_r)
237   AM_RANGE(0x40, 0x43) AM_READ_PORT("COINS")
238   AM_RANGE(0x60, 0x63) AM_READ_PORT("DSW")
239   AM_RANGE(0x80, 0x83) AM_READ_PORT("INPUTS")
240240   AM_RANGE(0xa0, 0xa3) AM_WRITENOP //soundlatch?
241241   AM_RANGE(0xc0, 0xc3) AM_WRITE(pasha2_misc_w)
242242   AM_RANGE(0xe0, 0xe3) AM_READWRITE(oki_0_r, oki_0_w)
src/mame/drivers/rungun.c
r3115r3116
124124      case 0x06/2:
125125         if (ACCESSING_BITS_0_7)
126126         {
127            data = input_port_read(machine, "DSW") | eeprom_read_bit();
127            data = input_port_read(machine, "DSW");
128128
129129            if (init_eeprom_count)
130130            {
r3115r3116
390390   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
391391
392392   PORT_START("DSW")
393   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
393   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
394394   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
395395   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
396396   PORT_DIPNAME( 0x10, 0x00, "Monitors" )
src/mame/drivers/eprom.c
r3115r3116
4444
4545static void update_interrupts(running_machine *machine)
4646{
47   int newstate = 0;
48   int newstate2 = 0;
49
50   if (atarigen_video_int_state)
51      newstate |= 4, newstate2 |= 4;
52   if (atarigen_sound_int_state)
53      newstate |= 6;
54
55   if (newstate)
56      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
57   else
58      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
59
60   if (newstate2)
61      cpunum_set_input_line(machine, 1, newstate2, ASSERT_LINE);
62   else
63      cpunum_set_input_line(machine, 1, 7, CLEAR_LINE);
47   cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
48   cpunum_set_input_line(machine, 1, 4, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
49   cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
6450}
6551
6652
src/mame/drivers/rocnrope.c
r3115r3116
3030
3131
3232static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
33   AM_RANGE(0x3080, 0x3080) AM_READ(input_port_0_r) /* IO Coin */
34   AM_RANGE(0x3081, 0x3081) AM_READ(input_port_1_r) /* P1 IO */
35   AM_RANGE(0x3082, 0x3082) AM_READ(input_port_2_r) /* P2 IO */
36   AM_RANGE(0x3083, 0x3083) AM_READ(input_port_3_r) /* DSW 0 */
37   AM_RANGE(0x3000, 0x3000) AM_READ(input_port_4_r) /* DSW 1 */
38   AM_RANGE(0x3100, 0x3100) AM_READ(input_port_5_r) /* DSW 2 */
33   AM_RANGE(0x3080, 0x3080) AM_READ_PORT("SYSTEM")
34   AM_RANGE(0x3081, 0x3081) AM_READ_PORT("P1")
35   AM_RANGE(0x3082, 0x3082) AM_READ_PORT("P2")
36   AM_RANGE(0x3083, 0x3083) AM_READ_PORT("DSW1")
37   AM_RANGE(0x3000, 0x3000) AM_READ_PORT("DSW2")
38   AM_RANGE(0x3100, 0x3100) AM_READ_PORT("DSW3")
3939   AM_RANGE(0x4000, 0x5fff) AM_READ(SMH_RAM)
4040   AM_RANGE(0x6000, 0xffff) AM_READ(SMH_ROM)
4141ADDRESS_MAP_END
r3115r3116
6161
6262
6363static INPUT_PORTS_START( rocnrope )
64   PORT_START("IN0")
64   PORT_START("SYSTEM")
6565   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
6666   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
6767   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
7171   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
7272   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
7373
74   PORT_START("IN1")
74   PORT_START("P1")
7575   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
7676   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
7777   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
r3115r3116
8181   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
8282   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
8383
84   PORT_START("IN2")
84   PORT_START("P2")
8585   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
8686   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
8787   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
r3115r3116
9191   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
9292   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
9393
94   PORT_START("DSW0")
94   PORT_START("DSW1")
9595   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
9696   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
9797   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
126126   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
127127   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
128128   PORT_DIPSETTING(    0x00, "Disabled" )
129/* 0x00 disables Coin 2. It still accepts coins and makes the sound, but
130   it doesn't give you any credit */
129   /* 0x00 disables Coin 2. It still accepts coins and makes the sound, but it doesn't give you any credit */
131130
132   PORT_START("DSW1")
131   PORT_START("DSW2")
133132   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
134133   PORT_DIPSETTING(    0x03, "3" )
135134   PORT_DIPSETTING(    0x02, "4" )
r3115r3116
159158   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
160159   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
161160
162   PORT_START("DSW2")
161   PORT_START("DSW3")
163162   PORT_DIPNAME( 0x07, 0x07, "First Bonus" )
164163   PORT_DIPSETTING(    0x07, "20000" )
165164   PORT_DIPSETTING(    0x05, "30000" )
src/mame/drivers/docastle.c
r3115r3116
159159#include "includes/docastle.h"
160160
161161
162static int adpcm_pos, adpcm_idle;
163static int adpcm_data;
164static int adpcm_status;
165
166
162167/* Read/Write Handlers */
163168
164static int adpcm_pos, adpcm_idle;
165169
166170static void idsoccer_adpcm_int(running_machine *machine, int chip)
167171{
168   static int adpcm_data = -1;
169
170172   if (adpcm_pos >= memory_region_length(machine, "adpcm"))
171173   {
172174      adpcm_idle = 1;
r3115r3116
187189static READ8_HANDLER( idsoccer_adpcm_status_r )
188190{
189191   // this is wrong, but the samples work anyway!!
190   static int i;
191   i ^= 0x80;
192   return i;
192   adpcm_status ^= 0x80;
193   return adpcm_status;
193194}
194195
195196static WRITE8_HANDLER( idsoccer_adpcm_w )
r3115r3116
571572
572573/* Machine Drivers */
573574
575static MACHINE_RESET( docastle )
576{
577   adpcm_pos = adpcm_idle = 0;
578   adpcm_data = -1;
579   adpcm_status = 0;
580}
581
582
574583static MACHINE_DRIVER_START( docastle )
575584   // basic machine hardware
576585//  MDRV_CPU_ADD("main", Z80, 4000000)  // 4 MHz
r3115r3116
603612   MDRV_VIDEO_START(docastle)
604613   MDRV_VIDEO_UPDATE(docastle)
605614
615   MDRV_MACHINE_RESET( docastle )
616
606617   // sound hardware
607618   MDRV_SPEAKER_STANDARD_MONO("mono")
608619
src/mame/drivers/ultrsprt.c
r3115r3116
5252   UINT32 r = 0;
5353
5454   if (ACCESSING_BITS_24_31)
55      r |= (((eeprom_read_bit()) << 1) | (input_port_read(machine, "SERVICE") << 3)) << 24;
55      r |= input_port_read(machine, "SERVICE");
5656
5757   return r;
5858}
r3115r3116
6767   }
6868}
6969
70static READ32_HANDLER( control1_r )
70static CUSTOM_INPUT( analog_ctrl_r )
7171{
72   return (input_port_read(machine, "P1") << 28) | ((input_port_read(machine, "STICKX1") & 0xfff) << 16) | (input_port_read(machine, "STICKY1") & 0xfff);
72   const char *tag = param;
73   return input_port_read(field->port->machine, tag) & 0xfff;
7374}
7475
75static READ32_HANDLER( control2_r )
76{
77   return (input_port_read(machine, "P2") << 28) | ((input_port_read(machine, "STICKX2") & 0xfff) << 16) | (input_port_read(machine, "STICKY2") & 0xfff);
78}
79
8076static WRITE32_HANDLER( int_ack_w )
8177{
8278   cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ1, CLEAR_LINE);
r3115r3116
104100static ADDRESS_MAP_START( ultrsprt_map, ADDRESS_SPACE_PROGRAM, 32 )
105101   AM_RANGE(0x00000000, 0x0007ffff) AM_RAM AM_BASE(&vram)
106102   AM_RANGE(0x70000000, 0x70000003) AM_READWRITE(eeprom_r, eeprom_w)
107   AM_RANGE(0x70000020, 0x70000023) AM_READ(control1_r)
108   AM_RANGE(0x70000040, 0x70000043) AM_READ(control2_r)
103   AM_RANGE(0x70000020, 0x70000023) AM_READ_PORT("P1")
104   AM_RANGE(0x70000040, 0x70000043) AM_READ_PORT("P2")
109105   AM_RANGE(0x70000080, 0x70000087) AM_WRITE(K056800_host_w)
110106   AM_RANGE(0x70000088, 0x7000008f) AM_READ(K056800_host_r)
111107   AM_RANGE(0x700000e0, 0x700000e3) AM_WRITE(int_ack_w)
r3115r3116
179175
180176static INPUT_PORTS_START( ultrsprt )
181177   PORT_START("P1")
182   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_COIN1 )
183   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
184   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_START1 )
178   PORT_BIT( 0x00000fff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(analog_ctrl_r, "STICKY1")
179   PORT_BIT( 0x0fff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(analog_ctrl_r, "STICKX1")
180   PORT_BIT( 0x40000000, IP_ACTIVE_HIGH, IPT_COIN1 )
181   PORT_BIT( 0x20000000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
182   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_START1 )
185183
184   PORT_START("P2")
185   PORT_BIT( 0x00000fff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(analog_ctrl_r, "STICKY2")
186   PORT_BIT( 0x0fff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(analog_ctrl_r, "STICKX2")
187   PORT_BIT( 0x40000000, IP_ACTIVE_HIGH, IPT_SERVICE1 )
188   PORT_BIT( 0x20000000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
189   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_START2 )
190
191   PORT_START("SERVICE")
192   PORT_BIT( 0x02000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
193   PORT_SERVICE_NO_TOGGLE( 0x08000000, IP_ACTIVE_LOW )
194
186195   PORT_START("STICKX1")
187196   PORT_BIT( 0xfff, 0x800, IPT_AD_STICK_X ) PORT_MINMAX(0x000,0xfff) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) PORT_PLAYER(1)
188197
189198   PORT_START("STICKY1")
190199   PORT_BIT( 0xfff, 0x800, IPT_AD_STICK_Y ) PORT_MINMAX(0x000,0xfff) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1)
191200
192   PORT_START("P2")
193   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_SERVICE1 )
194   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
195   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_START2 )
196
197201   PORT_START("STICKX2")
198202   PORT_BIT( 0xfff, 0x800, IPT_AD_STICK_X ) PORT_MINMAX(0x000,0xfff) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) PORT_PLAYER(2)
199203
200204   PORT_START("STICKY2")
201205   PORT_BIT( 0xfff, 0x800, IPT_AD_STICK_Y ) PORT_MINMAX(0x000,0xfff) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2)
202
203   PORT_START("SERVICE")
204   PORT_SERVICE_NO_TOGGLE( 0x1, IP_ACTIVE_LOW )
205
206206INPUT_PORTS_END
207207
208208static void eeprom_handler(mame_file *file, int read_or_write)
src/mame/drivers/rampart.c
r3115r3116
4040
4141static void update_interrupts(running_machine *machine)
4242{
43   int newstate = 0;
44
45   if (atarigen_scanline_int_state)
46      newstate = 4;
47
48   if (newstate)
49      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
50   else
51      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
43   cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
5244}
5345
5446
r3115r3116
186178   AM_RANGE(0x500000, 0x500fff) AM_MIRROR(0x019000) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size)
187179   AM_RANGE(0x5a6000, 0x5a6001) AM_MIRROR(0x019ffe) AM_WRITE(atarigen_eeprom_enable_w)
188180   AM_RANGE(0x640000, 0x640001) AM_MIRROR(0x019ffe) AM_WRITE(latch_w)
189   AM_RANGE(0x640000, 0x640001) AM_MIRROR(0x019ffc) AM_READ(input_port_0_word_r)
190   AM_RANGE(0x640002, 0x640003) AM_MIRROR(0x019ffc) AM_READ(input_port_1_word_r)
191   AM_RANGE(0x6c0000, 0x6c0001) AM_MIRROR(0x019ff8) AM_READ(input_port_2_word_r)
192   AM_RANGE(0x6c0002, 0x6c0003) AM_MIRROR(0x019ff8) AM_READ(input_port_3_word_r)
193   AM_RANGE(0x6c0004, 0x6c0005) AM_MIRROR(0x019ff8) AM_READ(input_port_4_word_r)
194   AM_RANGE(0x6c0006, 0x6c0007) AM_MIRROR(0x019ff8) AM_READ(input_port_5_word_r)
181   AM_RANGE(0x640000, 0x640001) AM_MIRROR(0x019ffc) AM_READ_PORT("IN0")
182   AM_RANGE(0x640002, 0x640003) AM_MIRROR(0x019ffc) AM_READ_PORT("IN1")
183   AM_RANGE(0x6c0000, 0x6c0001) AM_MIRROR(0x019ff8) AM_READ_PORT("TRACK0")
184   AM_RANGE(0x6c0002, 0x6c0003) AM_MIRROR(0x019ff8) AM_READ_PORT("TRACK1")
185   AM_RANGE(0x6c0004, 0x6c0005) AM_MIRROR(0x019ff8) AM_READ_PORT("TRACK2")
186   AM_RANGE(0x6c0006, 0x6c0007) AM_MIRROR(0x019ff8) AM_READ_PORT("TRACK3")
195187   AM_RANGE(0x726000, 0x726001) AM_MIRROR(0x019ffe) AM_WRITE(watchdog_reset16_w)
196188   AM_RANGE(0x7e6000, 0x7e6001) AM_MIRROR(0x019ffe) AM_WRITE(atarigen_scanline_int_ack_w)
197189ADDRESS_MAP_END
src/mame/drivers/senjyo.c
r3115r3116
166166   AM_RANGE(0xa800, 0xafff) AM_READ(SMH_RAM)
167167   AM_RANGE(0xb000, 0xb7ff) AM_READ(SMH_RAM)
168168   AM_RANGE(0xb800, 0xbbff) AM_READ(SMH_RAM)
169   AM_RANGE(0xd000, 0xd000) AM_READ(input_port_0_r)   /* player 1 input */
170   AM_RANGE(0xd001, 0xd001) AM_READ(input_port_1_r)   /* player 2 input */
171   AM_RANGE(0xd002, 0xd002) AM_READ(input_port_2_r)   /* coin */
172   AM_RANGE(0xd004, 0xd004) AM_READ(input_port_3_r)   /* DSW1 */
173   AM_RANGE(0xd005, 0xd005) AM_READ(input_port_4_r)   /* DSW2 */
169   AM_RANGE(0xd000, 0xd000) AM_READ_PORT("P1")
170   AM_RANGE(0xd001, 0xd001) AM_READ_PORT("P2")
171   AM_RANGE(0xd002, 0xd002) AM_READ_PORT("SYSTEM")
172   AM_RANGE(0xd004, 0xd004) AM_READ_PORT("DSW1")
173   AM_RANGE(0xd005, 0xd005) AM_READ_PORT("DSW2")
174174ADDRESS_MAP_END
175175
176176static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
r3115r3116
317317
318318
319319static INPUT_PORTS_START( senjyo )
320   PORT_START("P1")   /* IN0 */
320   PORT_START("P1")
321321   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
322322   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
323323   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
r3115r3116
327327   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
328328   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
329329
330   PORT_START("P2")   /* IN1 */
330   PORT_START("P2")
331331   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
332332   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
333333   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
r3115r3116
337337   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
338338   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
339339
340   PORT_START("SYSTEM")   /* IN2 */
340   PORT_START("SYSTEM")
341341   /* coin input for both must be active between 2 and 9 frames to be consistently recognized */
342342   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2)
343343   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(2)
r3115r3116
348348   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
349349   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
350350
351   PORT_START("DSW1")   /* DSW0 */
351   PORT_START("DSW1")
352352   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
353353   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
354354   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
r3115r3116
371371   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
372372   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
373373
374   PORT_START("DSW2")   /* DSW1 */
374   PORT_START("DSW2")
375375   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
376376   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
377377   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r3115r3116
398398INPUT_PORTS_END
399399
400400static INPUT_PORTS_START( starforc )
401   PORT_START("P1")   /* IN0 */
401   PORT_START("P1")
402402   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
403403   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
404404   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
r3115r3116
408408   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
409409   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
410410
411   PORT_START("P2")   /* IN1 */
411   PORT_START("P2")
412412   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
413413   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
414414   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
r3115r3116
418418   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
419419   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
420420
421   PORT_START("SYSTEM")   /* IN2 */
421   PORT_START("SYSTEM")
422422   /* coin input for both must be active between 2 and 9 frames to be consistently recognized */
423423   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2)
424424   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(2)
r3115r3116
429429   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
430430   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
431431
432   PORT_START("DSW1")   /* DSW0 */
432   PORT_START("DSW1")
433433   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
434434   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
435435   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
r3115r3116
452452   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
453453   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
454454
455   PORT_START("DSW2")   /* DSW1 */
455   PORT_START("DSW2")
456456   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Bonus_Life ) )
457457   PORT_DIPSETTING(    0x00, "50k, 200k and 500k" )
458458   PORT_DIPSETTING(    0x01, "100k, 300k and 800k" )
r3115r3116
479479INPUT_PORTS_END
480480
481481static INPUT_PORTS_START( baluba )
482   PORT_START("P1")   /* IN0 */
482   PORT_START("P1")
483483   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
484484   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
485485   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
r3115r3116
489489   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
490490   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
491491
492   PORT_START("P2")   /* IN1 */
492   PORT_START("P2")
493493   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
494494   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
495495   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
r3115r3116
499499   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
500500   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
501501
502   PORT_START("SYSTEM")   /* IN2 */
502   PORT_START("SYSTEM")
503503   /* coin input for both must be active between 2 and 9 frames to be consistently recognized */
504504   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2)
505505   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(2)
r3115r3116
510510   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
511511   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
512512
513   PORT_START("DSW1")   /* DSW0 */
513   PORT_START("DSW1")
514514   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
515515   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
516516   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
r3115r3116
533533   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
534534   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
535535
536   PORT_START("DSW2")   /* DSW1 */
536   PORT_START("DSW2")
537537   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Bonus_Life ) )
538538   PORT_DIPSETTING(    0x00, "30k, 100k and 200k" )
539539   PORT_DIPSETTING(    0x01, "50k, 200k and 500k" )
src/mame/drivers/snowbros.c
r3115r3116
164164   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
165165   AM_RANGE(0x100000, 0x103fff) AM_READ(SMH_RAM)
166166   AM_RANGE(0x300000, 0x300001) AM_READ(snowbros_68000_sound_r)
167   AM_RANGE(0x500000, 0x500001) AM_READ(input_port_0_word_r)
168   AM_RANGE(0x500002, 0x500003) AM_READ(input_port_1_word_r)
169   AM_RANGE(0x500004, 0x500005) AM_READ(input_port_2_word_r)
167   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
168   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2")
169   AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM")
170170   AM_RANGE(0x600000, 0x6001ff) AM_READ(SMH_RAM)
171171   AM_RANGE(0x700000, 0x701fff) AM_READ(pandora_spriteram_LSB_r)
172172ADDRESS_MAP_END
r3115r3116
213213   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
214214   AM_RANGE(0x100000, 0x103fff) AM_READ(SMH_RAM)
215215   AM_RANGE(0x300000, 0x300001) AM_READ(snowbros_68000_sound_r)
216   AM_RANGE(0x500000, 0x500001) AM_READ(input_port_0_word_r)
217   AM_RANGE(0x500002, 0x500003) AM_READ(input_port_1_word_r)
218   AM_RANGE(0x500004, 0x500005) AM_READ(input_port_2_word_r)
216   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
217   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2")
218   AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM")
219219   AM_RANGE(0x600000, 0x6001ff) AM_READ(SMH_RAM)
220220   AM_RANGE(0x700000, 0x701fff) AM_READ(SMH_RAM)
221221ADDRESS_MAP_END
r3115r3116
238238static ADDRESS_MAP_START( honeydol_readmem, ADDRESS_SPACE_PROGRAM, 16 )
239239   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
240240   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
241   AM_RANGE(0x900000, 0x900001) AM_READ(input_port_0_word_r)
242   AM_RANGE(0x900002, 0x900003) AM_READ(input_port_1_word_r)
243   AM_RANGE(0x900004, 0x900005) AM_READ(input_port_2_word_r)
241   AM_RANGE(0x900000, 0x900001) AM_READ_PORT("DSW1")
242   AM_RANGE(0x900002, 0x900003) AM_READ_PORT("DSW2")
243   AM_RANGE(0x900004, 0x900005) AM_READ_PORT("SYSTEM")
244244   AM_RANGE(0xa00000, 0xa007ff) AM_READ(SMH_RAM)
245245   AM_RANGE(0xb00000, 0xb01fff) AM_READ(SMH_RAM)
246246ADDRESS_MAP_END
r3115r3116
298298   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
299299   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
300300   AM_RANGE(0x300000, 0x300001) AM_READ(snowbros_68000_sound_r)
301   AM_RANGE(0x500000, 0x500001) AM_READ(input_port_0_word_r)
302   AM_RANGE(0x500002, 0x500003) AM_READ(input_port_1_word_r)
303   AM_RANGE(0x500004, 0x500005) AM_READ(input_port_2_word_r)
301   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
302   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2")
303   AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM")
304304   AM_RANGE(0x600000, 0x6001ff) AM_READ(SMH_RAM)
305305   AM_RANGE(0x700000, 0x701fff) AM_READ(SMH_RAM)
306306ADDRESS_MAP_END
r3115r3116
365365   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
366366   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
367367
368   AM_RANGE(0x500000, 0x500001) AM_READ(input_port_0_word_r)
369   AM_RANGE(0x500002, 0x500003) AM_READ(input_port_1_word_r)
370   AM_RANGE(0x500004, 0x500005) AM_READ(input_port_2_word_r)
368   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
369   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2")
370   AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM")
371371
372372   AM_RANGE(0x600000, 0x6001ff) AM_READ(SMH_RAM)
373373   AM_RANGE(0x700000, 0x701fff) AM_READ(pandora_spriteram_LSB_r)
r3115r3116
513513   AM_RANGE( 0x000000, 0x03ffff) AM_READ(SMH_ROM)
514514   AM_RANGE( 0x100000, 0x103fff) AM_READ(SMH_RAM)
515515   AM_RANGE( 0x300000, 0x300001) AM_READ(sb3_sound_r) // ?
516   AM_RANGE( 0x500000, 0x500001) AM_READ(input_port_0_word_r)
517   AM_RANGE( 0x500002, 0x500003) AM_READ(input_port_1_word_r)
518   AM_RANGE( 0x500004, 0x500005) AM_READ(input_port_2_word_r)
516   AM_RANGE( 0x500000, 0x500001) AM_READ_PORT("DSW1")
517   AM_RANGE( 0x500002, 0x500003) AM_READ_PORT("DSW2")
518   AM_RANGE( 0x500004, 0x500005) AM_READ_PORT("SYSTEM")
519519   AM_RANGE( 0x600000, 0x6003ff) AM_READ(SMH_RAM)
520520   AM_RANGE( 0x700000, 0x7021ff) AM_READ(SMH_RAM)
521521ADDRESS_MAP_END
r3115r3116
538538static ADDRESS_MAP_START( finalttr_readmem, ADDRESS_SPACE_PROGRAM, 16 )
539539   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
540540   AM_RANGE(0x100000, 0x103fff) AM_READ(SMH_RAM)
541   AM_RANGE(0x500000, 0x500001) AM_READ(input_port_0_word_r)
542   AM_RANGE(0x500002, 0x500003) AM_READ(input_port_1_word_r)
543   AM_RANGE(0x500004, 0x500005) AM_READ(input_port_2_word_r)
541   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
542   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2")
543   AM_RANGE(0x500004, 0x500005) AM_READ_PORT("SYSTEM")
544544
545545   AM_RANGE(0x600000, 0x6001ff) AM_READ(SMH_RAM)
546546   AM_RANGE(0x700000, 0x701fff) AM_READ(pandora_spriteram_LSB_r)
r3115r3116
572572   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
573573   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
574574   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
575   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x00)
576   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x00)
577   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x00)
578   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
575   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
576   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
577   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
578   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
579579   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
580   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
581   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
580   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
581   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
582582   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
583   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
584   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
585   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
586   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x01)
587   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x00)
588   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x00)
589   PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x00)
590   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1",0x01,PORTCOND_EQUALS,0x00)
583   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
584   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
585   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
586   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x01)
587   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
588   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
589   PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
590   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )   PORT_CONDITION("DSW1", 0x01, PORTCOND_EQUALS, 0x00)
591591   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
592592   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
593593   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
src/mame/drivers/mhavoc.c
r3115r3116
253253   AM_RANGE(0x0200, 0x07ff) AM_RAMBANK(1) AM_BASE(&mhavoc_zram0)
254254   AM_RANGE(0x0800, 0x09ff) AM_RAM
255255   AM_RANGE(0x0a00, 0x0fff) AM_RAMBANK(1) AM_BASE(&mhavoc_zram1)
256   AM_RANGE(0x1000, 0x1000) AM_READ(mhavoc_gamma_r)          /* Gamma Read Port */
257   AM_RANGE(0x1200, 0x1200) AM_READWRITE(mhavoc_port_0_r, SMH_NOP) /* Alpha Input Port 0 */
258   AM_RANGE(0x1400, 0x141f) AM_RAM AM_BASE(&mhavoc_colorram)        /* ColorRAM */
259   AM_RANGE(0x1600, 0x1600) AM_WRITE(mhavoc_out_0_w)         /* Control Signals */
260   AM_RANGE(0x1640, 0x1640) AM_WRITE(avgdvg_go_w)            /* Vector Generator GO */
261   AM_RANGE(0x1680, 0x1680) AM_WRITE(watchdog_reset_w)         /* Watchdog Clear */
262   AM_RANGE(0x16c0, 0x16c0) AM_WRITE(avgdvg_reset_w)        /* Vector Generator Reset */
263   AM_RANGE(0x1700, 0x1700) AM_WRITE(mhavoc_alpha_irq_ack_w) /* IRQ ack */
264   AM_RANGE(0x1740, 0x1740) AM_WRITE(mhavoc_rom_banksel_w)   /* Program ROM Page Select */
265   AM_RANGE(0x1780, 0x1780) AM_WRITE(mhavoc_ram_banksel_w)   /* Program RAM Page Select */
266   AM_RANGE(0x17c0, 0x17c0) AM_WRITE(mhavoc_gamma_w)        /* Gamma Communication Write Port */
267   AM_RANGE(0x1800, 0x1fff) AM_RAM                           /* Shared Beta Ram */
268   AM_RANGE(0x2000, 0x3fff) AM_ROMBANK(2)                   /* Paged Program ROM (32K) */
269   AM_RANGE(0x4000, 0x4fff) AM_RAM AM_BASE(&vectorram) AM_SIZE(&vectorram_size) AM_REGION("alpha", 0x4000)/* Vector Generator RAM */
270   AM_RANGE(0x5000, 0x7fff) AM_ROM                           /* Vector ROM */
271   AM_RANGE(0x8000, 0xffff) AM_READ(SMH_ROM)               /* Program ROM (32K) */
256   AM_RANGE(0x1000, 0x1000) AM_READ(mhavoc_gamma_r)         /* Gamma Read Port */
257   AM_RANGE(0x1200, 0x1200) AM_READ_PORT("IN0") AM_WRITENOP   /* Alpha Input Port 0 */
258   AM_RANGE(0x1400, 0x141f) AM_RAM AM_BASE(&mhavoc_colorram)   /* ColorRAM */
259   AM_RANGE(0x1600, 0x1600) AM_WRITE(mhavoc_out_0_w)         /* Control Signals */
260   AM_RANGE(0x1640, 0x1640) AM_WRITE(avgdvg_go_w)            /* Vector Generator GO */
261   AM_RANGE(0x1680, 0x1680) AM_WRITE(watchdog_reset_w)         /* Watchdog Clear */
262   AM_RANGE(0x16c0, 0x16c0) AM_WRITE(avgdvg_reset_w)         /* Vector Generator Reset */
263   AM_RANGE(0x1700, 0x1700) AM_WRITE(mhavoc_alpha_irq_ack_w)   /* IRQ ack */
264   AM_RANGE(0x1740, 0x1740) AM_WRITE(mhavoc_rom_banksel_w)      /* Program ROM Page Select */
265   AM_RANGE(0x1780, 0x1780) AM_WRITE(mhavoc_ram_banksel_w)      /* Program RAM Page Select */
266   AM_RANGE(0x17c0, 0x17c0) AM_WRITE(mhavoc_gamma_w)         /* Gamma Communication Write Port */
267   AM_RANGE(0x1800, 0x1fff) AM_RAM                        /* Shared Beta Ram */
268   AM_RANGE(0x2000, 0x3fff) AM_ROMBANK(2)                  /* Paged Program ROM (32K) */
269   AM_RANGE(0x4000, 0x4fff) AM_RAM AM_BASE(&vectorram) AM_SIZE(&vectorram_size) AM_REGION("alpha", 0x4000)   /* Vector Generator RAM */
270   AM_RANGE(0x5000, 0x7fff) AM_ROM                        /* Vector ROM */
271   AM_RANGE(0x8000, 0xffff) AM_READ(SMH_ROM)               /* Program ROM (32K) */
272272ADDRESS_MAP_END
273273
274274
r3115r3116
283283   AM_RANGE(0x0000, 0x07ff) AM_RAM                        /* Program RAM (2K) */
284284    AM_RANGE(0x0800, 0x0fff) AM_RAM AM_MIRROR (0x1800)
285285   AM_RANGE(0x2000, 0x203f) AM_READWRITE(quad_pokey_r, quad_pokey_w)   /* Quad Pokey read  */
286   AM_RANGE(0x2800, 0x2800) AM_READ(mhavoc_port_1_r)         /* Gamma Input Port */
286   AM_RANGE(0x2800, 0x2800) AM_READ_PORT("IN1")            /* Gamma Input Port */
287287   AM_RANGE(0x3000, 0x3000) AM_READ(mhavoc_alpha_r)         /* Alpha Comm. Read Port*/
288288   AM_RANGE(0x3800, 0x3803) AM_READ_PORT("DIAL")            /* Roller Controller Input*/
289289   AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW2") AM_WRITE(mhavoc_gamma_irq_ack_w)   /* DSW at 8S, IRQ Acknowledge*/
r3115r3116
308308   AM_RANGE(0x0800, 0x09ff) AM_RAM
309309   AM_RANGE(0x0a00, 0x0fff) AM_RAMBANK(1) AM_BASE(&mhavoc_zram1)
310310   AM_RANGE(0x1020, 0x103f) AM_READWRITE(dual_pokey_r, dual_pokey_w)
311   AM_RANGE(0x1040, 0x1040) AM_READWRITE(alphaone_port_0_r, SMH_NOP) /* Alpha Input Port 0 */
311   AM_RANGE(0x1040, 0x1040) AM_READ_PORT("IN0") AM_WRITENOP   /* Alpha Input Port 0 */
312312   AM_RANGE(0x1060, 0x1060) AM_READ_PORT("IN1")            /* Gamma Input Port */
313313   AM_RANGE(0x1080, 0x1080) AM_READ_PORT("DIAL")            /* Roller Controller Input*/
314314   AM_RANGE(0x10a0, 0x10a0) AM_WRITE(alphaone_out_0_w)         /* Control Signals */
r3115r3116
334334 *
335335 *************************************/
336336
337static CUSTOM_INPUT( clock_r )
338{
339   /* 2.4kHz (divide 2.5MHz by 1024) */
340   return (cpunum_gettotalcycles(0) & 0x400) ? 0 : 1;
341}
342
343
344/* 2008-08 FP:
345   IN0 Bit 4 is tested in the second input test, but it's not clear its effect.
346   According to the memory map at top it should be Diagnostic Step, but it's
347   actually IN0 Bit 5 to have this function. I marked it as UNKNOWN for the moment */
337348static INPUT_PORTS_START( mhavoc )
338   PORT_START("IN0")   /* IN0 - alpha (player_1 = 0) */
339   PORT_BIT ( 0x03, IP_ACTIVE_HIGH, IPT_SPECIAL )
340   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
341   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
342   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
343   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Diag Step/Coin C") PORT_CODE(KEYCODE_F1)
344   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )   /* Left Coin Switch  */
345   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )   /* Right Coin */
349   PORT_START("IN0")   /* alpha */
350   /* Bits 7-6 = selected based on player_1 */
351   /* Bits 5-4 = common */
352   /* Bit 3 = Gamma rcvd flag */
353   /* Bit 2 = Gamma xmtd flag */
354   /* Bit 1 = 2.4kHz (divide 2.5MHz by 1024) */
355   /* Bit 0 = Vector generator halt flag */
356   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
357   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(clock_r, NULL)
358   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gamma_xmtd_r, NULL)
359   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gamma_rcvd_r, NULL)
360   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
361   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Diag Step/Coin C") PORT_CODE(KEYCODE_F1)
362   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mhavoc_bit67_r, "COIN\0SERVICE")
346363
347   PORT_START("IN1")   /* IN1 - gamma */
348   PORT_BIT ( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
349   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
350   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
351   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
352   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
364   PORT_START("IN1")   /* gamma */
365   /* Bits 7-2 = input switches */
366   /* Bit 1 = Alpha rcvd flag */
367   /* Bit 0 = Alpha xmtd flag */
368   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(alpha_xmtd_r, NULL)
369   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(alpha_rcvd_r, NULL)
370   PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNKNOWN )
371   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
372   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
373   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
374   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
353375
354   PORT_START("DIAL")   /* IN2 - gamma */
376   PORT_START("DIAL")   /* gamma */
355377   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40) PORT_REVERSE
356378
357379   PORT_START("DSW1")   /* DIP Switch at position 13/14S */
r3115r3116
398420   PORT_DIPSETTING(    0x60, "1 each 5" )
399421   PORT_DIPSETTING(    0xe0, DEF_STR( None ) )
400422
401   PORT_START("IN2")   /* IN5 - dummy for player_1 = 1 on alpha */
402   PORT_BIT ( 0x3f, IP_ACTIVE_HIGH, IPT_SPECIAL )
403   PORT_DIPNAME( 0x40, 0x40, "Credit to start" )
404   PORT_DIPSETTING(    0x40, "1" )
423   PORT_START("COIN")      /* dummy for player_1 = 0 on alpha */
424   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )      /* Left Coin Switch  */
425   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )      /* Right Coin */
426
427   PORT_START("SERVICE")   /* dummy for player_1 = 1 on alpha */
428   PORT_DIPNAME( 0x01, 0x01, "Credit to start" )
429   PORT_DIPSETTING(    0x01, "1" )
405430   PORT_DIPSETTING(    0x00, "2" )
406   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
431   PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
407432INPUT_PORTS_END
408433
434static INPUT_PORTS_START( mhavocrv )
435   PORT_INCLUDE( mhavoc )
409436
437   PORT_MODIFY("IN1")
438   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(tms5220_r, NULL)
439   PORT_BIT( 0x0b, IP_ACTIVE_LOW, IPT_UNKNOWN )
440INPUT_PORTS_END
441
410442static INPUT_PORTS_START( mhavocp )
411   PORT_START("IN0")   /* IN0 - alpha (player_1 = 0) */
412   PORT_BIT ( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL )
413   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
414   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Diag Step/Coin C") PORT_CODE(KEYCODE_F1)
415   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )   /* Left Coin Switch  */
416   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )   /* Right Coin */
443   PORT_INCLUDE( mhavoc )
417444
418   PORT_START("IN1")   /* IN1 - gamma */
419   PORT_BIT ( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
420   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
421   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
422   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
423   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
424
425   PORT_START("DIAL")   /* IN2 - gamma */
426   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40) PORT_REVERSE
427
428   PORT_START("DSW1") /* DIP Switch at position 13/14S */
445   PORT_MODIFY("DSW1")
429446   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:7,8")
430447   PORT_DIPSETTING(    0x00, "1" )
431448   PORT_DIPSETTING(    0x01, "2" )
432449   PORT_DIPSETTING(    0x02, "3" )
433450   PORT_DIPSETTING(    0x03, "4" )
434   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:5,6")
435   PORT_DIPSETTING(    0x0c, "50000")
436   PORT_DIPSETTING(    0x00, "100000")
437   PORT_DIPSETTING(    0x04, "200000")
438   PORT_DIPSETTING(    0x08, DEF_STR( None ))
439   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:3,4")
440   PORT_DIPSETTING(    0x10, DEF_STR( Easy ))
441   PORT_DIPSETTING(    0x00, DEF_STR( Medium ))
442   PORT_DIPSETTING(    0x30, DEF_STR( Hard ))
443   PORT_DIPSETTING(    0x20, "Demo")
444   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1,2")
445   PORT_DIPSETTING(    0x00, "3 (2 in Free Play)")
446   PORT_DIPSETTING(    0xc0, "4 (3 in Free Play)")
447   PORT_DIPSETTING(    0x80, "5 (4 in Free Play)")
448   PORT_DIPSETTING(    0x40, "6 (5 in Free Play)")
449
450   PORT_START("DSW2") /* DIP Switch at position 8S */
451   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW2:7,8")
452   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
453   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
454   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
455   PORT_DIPSETTING(    0x01, DEF_STR( Free_Play ) )
456   PORT_DIPNAME( 0x0c, 0x0c, "Right Coin Mechanism" )   PORT_DIPLOCATION("SW2:5,6")
457   PORT_DIPSETTING(    0x0c, "x1" )
458   PORT_DIPSETTING(    0x08, "x4" )
459   PORT_DIPSETTING(    0x04, "x5" )
460   PORT_DIPSETTING(    0x00, "x6" )
461   PORT_DIPNAME( 0x10, 0x10, "Left Coin Mechanism" )   PORT_DIPLOCATION("SW2:4")
462   PORT_DIPSETTING(    0x10, "x1" )
463   PORT_DIPSETTING(    0x00, "x2" )
464   PORT_DIPNAME( 0xe0, 0xe0, "Bonus Credits" )         PORT_DIPLOCATION("SW2:1,2,3")
465   PORT_DIPSETTING(    0x80, "2 each 4" )
466   PORT_DIPSETTING(    0x40, "1 each 3" )
467   PORT_DIPSETTING(    0xa0, "1 each 4" )
468   PORT_DIPSETTING(    0x60, "1 each 5" )
469   PORT_DIPSETTING(    0xe0, DEF_STR( None ) )
470
471   PORT_START("IN2")   /* IN5 - dummy for player_1 = 1 on alpha */
472   PORT_BIT ( 0x3f, IP_ACTIVE_HIGH, IPT_SPECIAL )
473   PORT_DIPNAME( 0x40, 0x40, "Credit to start" )
474   PORT_DIPSETTING(    0x40, "1" )
475   PORT_DIPSETTING(    0x00, "2" )
476   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
477451INPUT_PORTS_END
478452
479
480453static INPUT_PORTS_START( alphaone )
481   PORT_START("IN0")   /* IN0 - alpha (player_1 = 0) */
482   PORT_BIT ( 0x03, IP_ACTIVE_HIGH, IPT_SPECIAL )
483   PORT_BIT ( 0x7c, IP_ACTIVE_LOW, IPT_UNKNOWN )
484   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
454   PORT_START("IN0")   /* alpha (player_1 = 0) */
455   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
456   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(clock_r, NULL)
457   PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNKNOWN )
458   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
485459
486   PORT_START("IN1")   /* IN1 - gamma */
487   PORT_BIT ( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
460   PORT_START("IN1")   /* gamma */
461   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
488462   PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
489   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_COIN3 )
490   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
491   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
463   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 )
464   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
465   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
492466
493   PORT_START("DIAL")   /* IN2 - gamma */
467   PORT_START("DIAL")   /* gamma */
494468   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40) PORT_REVERSE
495469INPUT_PORTS_END
496470
r3115r3116
787761{
788762   /* install the speech support that was only optionally stuffed for use */
789763   /* in the Return to Vax hack */
790   memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2800, 0, 0, mhavoc_port_1_sp_r);
791764   memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x5800, 0x5800, 0, 0, speech_data_w);
792765   memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x5900, 0x5900, 0, 0, speech_strobe_w);
793766}
r3115r3116
802775
803776GAME( 1983, mhavoc,   0,      mhavoc,   mhavoc,   0,        ROT0, "Atari", "Major Havoc (rev 3)", GAME_SUPPORTS_SAVE )
804777GAME( 1983, mhavoc2,  mhavoc, mhavoc,   mhavoc,   0,        ROT0, "Atari", "Major Havoc (rev 2)", GAME_SUPPORTS_SAVE )
805GAME( 1983, mhavocrv, mhavoc, mhavocrv, mhavoc,  mhavocrv, ROT0, "JMA",   "Major Havoc (Return to Vax)", GAME_SUPPORTS_SAVE )
778GAME( 1983, mhavocrv, mhavoc, mhavocrv, mhavocrv, mhavocrv, ROT0, "JMA",   "Major Havoc (Return to Vax)", GAME_SUPPORTS_SAVE )
806779GAME( 1983, mhavocp,  mhavoc, mhavoc,   mhavocp,  0,        ROT0, "Atari", "Major Havoc (prototype)", GAME_SUPPORTS_SAVE )
807780GAME( 1983, alphaone, mhavoc, alphaone, alphaone, 0,        ROT0, "Atari", "Alpha One (prototype, 3 lives)", GAME_SUPPORTS_SAVE )
808781GAME( 1983, alphaona, mhavoc, alphaone, alphaone, 0,        ROT0, "Atari", "Alpha One (prototype, 5 lives)", GAME_SUPPORTS_SAVE )
src/mame/drivers/segaxbd.c
r3115r3116
8686
8787static void update_main_irqs(running_machine *machine)
8888{
89   int irq = 0;
89   cpunum_set_input_line(machine, 0, 2, timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
90   cpunum_set_input_line(machine, 0, 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
9091
91   /* the IRQs are effectively ORed together */
92   if (vblank_irq_state)
93      irq |= 4;
94   if (timer_irq_state)
95      irq |= 2;
92   if(!gprider_hack)
93      cpunum_set_input_line(machine, 0, 6, timer_irq_state && vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
9694
97   if (gprider_hack && irq > 4)
98      irq = 4;
99
100   /* assert the lines that are live, or clear everything if nothing is live */
101   if (irq != 0)
102   {
103      cpunum_set_input_line(machine, 0, irq, ASSERT_LINE);
95   if(timer_irq_state || vblank_irq_state)
10496      cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
105   }
106   else
107      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
10897}
10998
11099
src/mame/drivers/sonson.c
r3115r3116
8585   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(sonson_colorram_w) AM_BASE(&colorram)
8686   AM_RANGE(0x2020, 0x207f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
8787   AM_RANGE(0x3000, 0x3000) AM_WRITE(sonson_scrollx_w)
88   AM_RANGE(0x3002, 0x3002) AM_READ(input_port_0_r)   /* IN0 */
89   AM_RANGE(0x3003, 0x3003) AM_READ(input_port_1_r)   /* IN1 */
90   AM_RANGE(0x3004, 0x3004) AM_READ(input_port_2_r)   /* IN2 */
91   AM_RANGE(0x3005, 0x3005) AM_READ(input_port_3_r)   /* DSW0 */
92   AM_RANGE(0x3006, 0x3006) AM_READ(input_port_4_r)   /* DSW1 */
88   AM_RANGE(0x3002, 0x3002) AM_READ_PORT("P1")
89   AM_RANGE(0x3003, 0x3003) AM_READ_PORT("P2")
90   AM_RANGE(0x3004, 0x3004) AM_READ_PORT("SYSTEM")
91   AM_RANGE(0x3005, 0x3005) AM_READ_PORT("DSW1")
92   AM_RANGE(0x3006, 0x3006) AM_READ_PORT("DSW2")
9393   AM_RANGE(0x3008, 0x3008) AM_WRITENOP   // might be Y scroll, but the game always sets it to 0
9494   AM_RANGE(0x3010, 0x3010) AM_WRITE(soundlatch_w)
9595   AM_RANGE(0x3018, 0x3018) AM_WRITE(sonson_flipscreen_w)
r3115r3116
110110
111111
112112static INPUT_PORTS_START( sonson )
113   PORT_START("P1")   /* IN0 */
113   PORT_START("P1")
114114   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
115115   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
116116   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
r3115r3116
120120   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
121121   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
122122
123   PORT_START("P2")   /* IN1 */
123   PORT_START("P2")
124124   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
125125   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
126126   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
130130   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
131131   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
132132
133   PORT_START("SYSTEM")   /* IN2 */
133   PORT_START("SYSTEM")
134134   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
135135   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
136136   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
r3115r3116
140140   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
141141   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
142142
143   PORT_START("DSW1")   /* DSW0 */
143   PORT_START("DSW1")
144144   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) )
145145   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
146146   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
167167   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
168168   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
169169
170   PORT_START("DSW2")   /* DSW1 */
170   PORT_START("DSW2")
171171   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
172172   PORT_DIPSETTING(    0x03, "3" )
173173   PORT_DIPSETTING(    0x02, "4" )
src/mame/drivers/artmagic.c
r3115r3116
5757
5858static void update_irq_state(running_machine *machine)
5959{
60   int irq_lines = 0;
61
62   if (tms_irq)
63      irq_lines |= 4;
64   if (hack_irq)
65      irq_lines |= 5;
66
67   if (irq_lines)
68      cpunum_set_input_line(machine, 0, irq_lines, ASSERT_LINE);
69   else
70      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
60   cpunum_set_input_line(machine, 0, 4, tms_irq  ? ASSERT_LINE : CLEAR_LINE);
61   cpunum_set_input_line(machine, 0, 5, hack_irq ? ASSERT_LINE : CLEAR_LINE);
7162}
7263
7364
src/mame/drivers/twincobr.c
r3115r3116
213213   AM_RANGE(0x074000, 0x074003) AM_WRITE(twincobr_fgscroll_w)   /* fg layer scroll */
214214   AM_RANGE(0x074004, 0x074005) AM_WRITE(twincobr_fgoffs_w)   /* offset in fg video RAM */
215215   AM_RANGE(0x076000, 0x076003) AM_WRITE(twincobr_exscroll_w)   /* Spare layer scroll */
216   AM_RANGE(0x078000, 0x078001) AM_READ(input_port_3_word_r)   /* Flying Shark - DSW A */
217   AM_RANGE(0x078002, 0x078003) AM_READ(input_port_4_word_r)   /* Flying Shark - DSW B */
218   AM_RANGE(0x078004, 0x078005) AM_READ(input_port_1_word_r)   /* Player 1 inputs */
219   AM_RANGE(0x078006, 0x078007) AM_READ(input_port_2_word_r)   /* Player 2 inputs */
220   AM_RANGE(0x078008, 0x078009) AM_READ(input_port_0_word_r)   /* V-Blank & FShark Coin/Start */
216   AM_RANGE(0x078000, 0x078001) AM_READ_PORT("DSWA")
217   AM_RANGE(0x078002, 0x078003) AM_READ_PORT("DSWB")
218   AM_RANGE(0x078004, 0x078005) AM_READ_PORT("P1")
219   AM_RANGE(0x078006, 0x078007) AM_READ_PORT("P2")
220   AM_RANGE(0x078008, 0x078009) AM_READ_PORT("VBLANK")         /* V-Blank & FShark Coin/Start */
221221   AM_RANGE(0x07800a, 0x07800b) AM_WRITE(fshark_coin_dsp_w)   /* Flying Shark DSP Comms & coin stuff */
222222   AM_RANGE(0x07800c, 0x07800d) AM_WRITE(twincobr_control_w)   /* Twin Cobra DSP Comms & system control */
223223   AM_RANGE(0x07a000, 0x07afff) AM_READWRITE(twincobr_sharedram_r, twincobr_sharedram_w)   /* 16-bit on 68000 side, 8-bit on Z80 side */
r3115r3116
238238   ADDRESS_MAP_GLOBAL_MASK(0xff)
239239   AM_RANGE(0x00, 0x00) AM_READWRITE(ym3812_status_port_0_r, ym3812_control_port_0_w)
240240   AM_RANGE(0x01, 0x01) AM_WRITE(ym3812_write_port_0_w)
241   AM_RANGE(0x10, 0x10) AM_READ(input_port_5_r)      /* Twin Cobra - Coin/Start */
241   AM_RANGE(0x10, 0x10) AM_READ_PORT("SYSTEM")         /* Twin Cobra - Coin/Start */
242242   AM_RANGE(0x20, 0x20) AM_WRITE(twincobr_coin_w)      /* Twin Cobra coin count-lockout */
243   AM_RANGE(0x40, 0x40) AM_READ(input_port_3_r)      /* Twin Cobra - DSW A */
244   AM_RANGE(0x50, 0x50) AM_READ(input_port_4_r)      /* Twin Cobra - DSW B */
243   AM_RANGE(0x40, 0x40) AM_READ_PORT("DSWA")
244   AM_RANGE(0x50, 0x50) AM_READ_PORT("DSWB")
245245ADDRESS_MAP_END
246246
247247
r3115r3116
279279   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
280280
281281#define  TOAPLAN_JAPAN_DSW_A                     \
282   PORT_START("DSWA")      /* DSW A */                     \
283282   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )      \
284283   PORT_DIPSETTING(   0x01, DEF_STR( Upright ) )      \
285284   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )      \
r3115r3116
304303   PORT_DIPSETTING(   0x40, DEF_STR( 1C_2C ) )
305304
306305#define  TWINCOBR_VBLANK_INPUT( active_level )      \
307   PORT_START("VBLANK")                              \
308306   PORT_BIT( 0x7f, active_level, IPT_UNKNOWN )      \
309307   PORT_BIT( 0x80, active_level, IPT_VBLANK )
310308
311309#define  TWINCOBR_SYSTEM_INPUTS                     \
312   PORT_START("SYSTEM")                                 \
313310   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN3 )         \
314311   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT )         \
315312   PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" )   \
r3115r3116
322319   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
323320
324321#define TWINCOBR_DSW_B      /* not KTIGER */         \
325   PORT_START("DSWB")      /* DSW B */                     \
326322   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )   \
327323   PORT_DIPSETTING(   0x01, DEF_STR( Easy ) )               \
328324   PORT_DIPSETTING(   0x00, DEF_STR( Normal ) )            \
r3115r3116
346342   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
347343
348344#define  FSHARK_SYSTEM_INPUTS      /* V-Blank is also here */             \
349   PORT_START("SYSTEM")                                                 \
350345   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN3 )                         \
351346   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT )      /* tilt causes freeze */ \
352347   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )   /* reset button */       \
r3115r3116
357352   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
358353
359354#define FSHARK_DSW_B                           \
360   PORT_START("DSWB")      /* DSW B */                     \
361355   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )   \
362356   PORT_DIPSETTING(   0x01, DEF_STR( Easy ) )               \
363357   PORT_DIPSETTING(   0x00, DEF_STR( Normal ) )            \
r3115r3116
384378
385379
386380static INPUT_PORTS_START( twincobr )
381   PORT_START("VBLANK")
387382   TWINCOBR_VBLANK_INPUT( IP_ACTIVE_HIGH )
388383
389384   PORT_START("P1")
r3115r3116
392387   PORT_START("P2")
393388   TOAPLAN_PLAYER_INPUT( 2 )
394389
395   PORT_START("DSWA")      /* DSW A */
390   PORT_START("DSWA")
396391   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
397392   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
398393   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
r3115r3116
416411   PORT_DIPSETTING(   0x80, DEF_STR( 1C_4C ) )
417412   PORT_DIPSETTING(   0xc0, DEF_STR( 1C_6C ) )
418413
414   PORT_START("DSWB")
419415   TWINCOBR_DSW_B
420416
417   PORT_START("SYSTEM")
421418   TWINCOBR_SYSTEM_INPUTS
422419INPUT_PORTS_END
423420
424421static INPUT_PORTS_START( twincobu )
422   PORT_START("VBLANK")
425423   TWINCOBR_VBLANK_INPUT( IP_ACTIVE_HIGH )
426424
427425   PORT_START("P1")
r3115r3116
430428   PORT_START("P2")
431429   TOAPLAN_PLAYER_INPUT( 2 )
432430
433   PORT_START("DSWA")      /* DSW A */
431   PORT_START("DSWA")
434432   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
435433   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
436434   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
r3115r3116
454452   PORT_DIPSETTING(   0xc0, DEF_STR( 2C_3C ) )
455453   PORT_DIPSETTING(   0x40, DEF_STR( 1C_2C ) )
456454
455   PORT_START("DSWB")
457456   TWINCOBR_DSW_B
458457
458   PORT_START("SYSTEM")
459459   TWINCOBR_SYSTEM_INPUTS
460460INPUT_PORTS_END
461461
462462static INPUT_PORTS_START( ktiger )
463   PORT_START("VBLANK")
463464   TWINCOBR_VBLANK_INPUT( IP_ACTIVE_HIGH )
464465
465466   PORT_START("P1")
r3115r3116
468469   PORT_START("P2")
469470   TOAPLAN_PLAYER_INPUT( 2 )
470471
472   PORT_START("DSWA")
471473   TOAPLAN_JAPAN_DSW_A
472474
473   PORT_START("DSWB")      /* DSW B */
475   PORT_START("DSWB")
474476   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
475477   PORT_DIPSETTING(   0x01, DEF_STR( Easy ) )
476478   PORT_DIPSETTING(   0x00, DEF_STR( Normal ) )
r3115r3116
493495   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
494496   PORT_DIPSETTING(   0x80, DEF_STR( Yes ) )
495497
498   PORT_START("SYSTEM")
496499   TWINCOBR_SYSTEM_INPUTS
497500INPUT_PORTS_END
498501
499502static INPUT_PORTS_START( fshark )
503   PORT_START("VBLANK")
500504   FSHARK_SYSTEM_INPUTS
501505
502506   PORT_START("P1")
r3115r3116
505509   PORT_START("P2")
506510   TOAPLAN_PLAYER_INPUT( 2 )
507511
508   PORT_START("DSWA")      /* DSW A */
512   PORT_START("DSWA")
509513   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
510514   PORT_DIPSETTING(   0x01, DEF_STR( Upright ) )
511515   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
r3115r3116
529533   PORT_DIPSETTING(   0x80, DEF_STR( 1C_4C ) )
530534   PORT_DIPSETTING(   0xc0, DEF_STR( 1C_6C ) )
531535
536   PORT_START("DSWB")
532537   FSHARK_DSW_B
538
539   PORT_START("SYSTEM")
540   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
533541INPUT_PORTS_END
534542
535543static INPUT_PORTS_START( skyshark )
544   PORT_START("VBLANK")
536545   FSHARK_SYSTEM_INPUTS
537546
538547   PORT_START("P1")
r3115r3116
541550   PORT_START("P2")
542551   TOAPLAN_PLAYER_INPUT( 2 )
543552
544   PORT_START("DSWA")      /* DSW A */
553   PORT_START("DSWA")
545554   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
546555   PORT_DIPSETTING(   0x01, DEF_STR( Upright ) )
547556   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
r3115r3116
565574   PORT_DIPSETTING(   0x80, DEF_STR( 1C_2C ) )
566575/*  PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )    Same as previous */
567576
577   PORT_START("DSWB")
568578   FSHARK_DSW_B
579
580   PORT_START("SYSTEM")
581   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
569582INPUT_PORTS_END
570583
571584static INPUT_PORTS_START( hishouza )
585   PORT_START("VBLANK")
572586   FSHARK_SYSTEM_INPUTS
573587
574588   PORT_START("P1")
r3115r3116
577591   PORT_START("P2")
578592   TOAPLAN_PLAYER_INPUT( 2 )
579593
594   PORT_START("DSWA")
580595   TOAPLAN_JAPAN_DSW_A
581596
597   PORT_START("DSWB")
582598   FSHARK_DSW_B
599
600   PORT_START("SYSTEM")
601   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
583602INPUT_PORTS_END
584603
585604static INPUT_PORTS_START( gulfwar2 )
605   PORT_START("VBLANK")
586606   TWINCOBR_VBLANK_INPUT( IP_ACTIVE_LOW )
587607
588608   PORT_START("P1")
r3115r3116
591611   PORT_START("P2")
592612   TOAPLAN_PLAYER_INPUT( 2 )
593613
594   PORT_START("DSWA")      /* DSW A */
614   PORT_START("DSWA")
595615   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
596616   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
597617   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
r3115r3116
615635   PORT_DIPSETTING(   0x80, DEF_STR( 1C_4C ) )
616636   PORT_DIPSETTING(   0xc0, DEF_STR( 1C_6C ) )
617637
638   PORT_START("DSWB")
618639   TWINCOBR_DSW_B
619640
641   PORT_START("SYSTEM")
620642   TWINCOBR_SYSTEM_INPUTS
621643INPUT_PORTS_END
622644
src/mame/drivers/bking.c
r3115r3116
1919#include "cpu/m6805/m6805.h"
2020#include "sound/ay8910.h"
2121#include "sound/dac.h"
22#include "includes/buggychl.h"
2223
23
24/* bking3 mcu communication */
25extern MACHINE_RESET( buggychl );
26extern READ8_HANDLER( buggychl_68705_portA_r );
27extern WRITE8_HANDLER( buggychl_68705_portA_w );
28extern WRITE8_HANDLER( buggychl_68705_ddrA_w );
29extern READ8_HANDLER( buggychl_68705_portB_r );
30extern WRITE8_HANDLER( buggychl_68705_portB_w );
31extern WRITE8_HANDLER( buggychl_68705_ddrB_w );
32extern READ8_HANDLER( buggychl_68705_portC_r );
33extern WRITE8_HANDLER( buggychl_68705_portC_w );
34extern WRITE8_HANDLER( buggychl_68705_ddrC_w );
35extern WRITE8_HANDLER( buggychl_mcu_w );
36extern READ8_HANDLER( buggychl_mcu_r );
37extern READ8_HANDLER( buggychl_mcu_status_r );
38
3924extern PALETTE_INIT( bking );
4025
4126extern VIDEO_START( bking );
r3115r3116
6247UINT8 *bking_playfield_ram;
6348
6449static int bking3_addr_h, bking3_addr_l;
65static int sndnmi_enable = 1;
50static int sndnmi_enable;
6651
6752static READ8_HANDLER( bking_sndnmi_disable_r )
6853{
r3115r3116
789774   ROM_LOAD( "a24-21.25",    0x0000, 0x1000, CRC(3106fcac) SHA1(08454adfb58e5df84140d86ed52fa4ef684df9f1) ) /* extra rom on the same SUB PCB where is the mcu */
790775ROM_END
791776
792GAME( 1982, bking,  0, bking,  bking,  0, ROT270, "Taito Corporation", "Birdie King", 0 )
793GAME( 1983, bking2, 0, bking,  bking2, 0, ROT90,  "Taito Corporation", "Birdie King 2", 0 )
794GAME( 1984, bking3, 0, bking3, bking2, 0, ROT90,  "Taito Corporation", "Birdie King 3", 0 )
777static DRIVER_INIT( bking )
778{
779   sndnmi_enable = 1;
780}
781
782GAME( 1982, bking,  0, bking,  bking,  bking, ROT270, "Taito Corporation", "Birdie King", 0 )
783GAME( 1983, bking2, 0, bking,  bking2, bking, ROT90,  "Taito Corporation", "Birdie King 2", 0 )
784GAME( 1984, bking3, 0, bking3, bking2, bking, ROT90,  "Taito Corporation", "Birdie King 3", 0 )
src/mame/drivers/shougi.c
r3115r3116
262262   AM_RANGE(0x4000, 0x43ff) AM_RAM      /* 2114 x 2 (0x400 x 4bit each) */
263263
264264   /* 4800-480f connected to the 74LS259, A3 is data line so 4800-4807 write 0, and 4808-480f write 1 */
265   AM_RANGE(0x4800, 0x4800) AM_WRITE(cpu_shared_ctrl_sub_w)  AM_READ(input_port_2_r)
265   AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(cpu_shared_ctrl_sub_w)
266266   AM_RANGE(0x4801, 0x4801) AM_WRITE(nmi_disable_and_clear_line_w)
267267   AM_RANGE(0x4802, 0x4802) AM_NOP
268268   AM_RANGE(0x4803, 0x4803) AM_NOP
r3115r3116
275275   AM_RANGE(0x480c, 0x480c) AM_WRITE(shougi_mcu_halt_on_w)
276276   AM_RANGE(0x480f, 0x480f) AM_NOP
277277
278   AM_RANGE(0x5000, 0x5000) AM_READ(input_port_0_r)
279   AM_RANGE(0x5800, 0x5800) AM_READ(input_port_1_r) AM_WRITE(shougi_watchdog_reset_w)   /* game won't boot if watchdog doesn't work */
278   AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1")
279   AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2") AM_WRITE(shougi_watchdog_reset_w)   /* game won't boot if watchdog doesn't work */
280280   AM_RANGE(0x6000, 0x6000) AM_WRITE(ay8910_control_port_0_w)
281281   AM_RANGE(0x6800, 0x6800) AM_WRITE(ay8910_write_port_0_w)
282282   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE(1) /* 2114 x 2 (0x400 x 4bit each) */
r3115r3116
313313
314314
315315static INPUT_PORTS_START( shougi )
316   PORT_START("PLAYER1")
316   PORT_START("P1")
317317   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START2 )
318318   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
319319   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
r3115r3116
323323   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
324324   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
325325
326   PORT_START("PLAYER2")
326   PORT_START("P2")
327327   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
328328   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
329329   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
src/mame/drivers/pipedrm.c
r3115r3116
236236   ADDRESS_MAP_GLOBAL_MASK(0xff)
237237   AM_RANGE(0x10, 0x10) AM_WRITE(fromance_crtc_data_w)
238238   AM_RANGE(0x11, 0x11) AM_WRITE(fromance_crtc_register_w)
239   AM_RANGE(0x20, 0x20) AM_READWRITE(input_port_0_r, sound_command_w)
240   AM_RANGE(0x21, 0x21) AM_READWRITE(input_port_1_r, pipedrm_bankswitch_w)
239   AM_RANGE(0x20, 0x20) AM_READ_PORT("P1") AM_WRITE(sound_command_w)
240   AM_RANGE(0x21, 0x21) AM_READ_PORT("P2") AM_WRITE(pipedrm_bankswitch_w)
241241   AM_RANGE(0x22, 0x25) AM_WRITE(fromance_scroll_w)
242   AM_RANGE(0x22, 0x22) AM_READ(input_port_2_r)
243   AM_RANGE(0x23, 0x23) AM_READ(input_port_3_r)
244   AM_RANGE(0x24, 0x24) AM_READ(input_port_4_r)
242   AM_RANGE(0x22, 0x22) AM_READ_PORT("DSW1")
243   AM_RANGE(0x23, 0x23) AM_READ_PORT("DSW2")
244   AM_RANGE(0x24, 0x24) AM_READ_PORT("SYSTEM")
245245   AM_RANGE(0x25, 0x25) AM_READ(pending_command_r)
246246ADDRESS_MAP_END
247247
r3115r3116
313313   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
314314   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
315315
316   PORT_START("SYSTEM")   /* $24 */
317   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
318   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
319   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
320   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
321   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
322   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
323   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
324   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
325
316326   PORT_START("DSW1")   /* $22 */
317   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ))
318   PORT_DIPSETTING(    0x06, DEF_STR( 5C_1C ))
319   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ))
320   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ))
321   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ))
327   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
328   PORT_DIPSETTING(    0x06, DEF_STR( 5C_1C ) )
329   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
330   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
331   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
322332   PORT_DIPSETTING(    0x04, "6 Coins/4 Credits" )
323   PORT_DIPSETTING(    0x03, DEF_STR( 4C_3C ))
324   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ))
333   PORT_DIPSETTING(    0x03, DEF_STR( 4C_3C ) )
334   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
325335   PORT_DIPSETTING(    0x02, "5 Coins/6 Credits" )
326   PORT_DIPSETTING(    0x01, DEF_STR( 4C_5C ))
327   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ))
328//  PORT_DIPSETTING(    0x05, DEF_STR( 2C_3C ))
329   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ))
330   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ))
331   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ))
332   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ))
333   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ))
334   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ))
335   PORT_DIPSETTING(    0x60, DEF_STR( 5C_1C ))
336   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ))
337   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ))
338   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ))
336   PORT_DIPSETTING(    0x01, DEF_STR( 4C_5C ) )
337   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
338//  PORT_DIPSETTING(    0x05, DEF_STR( 2C_3C ) )
339   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
340   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
341   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
342   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
343   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
344   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
345   PORT_DIPSETTING(    0x60, DEF_STR( 5C_1C ) )
346   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
347   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
348   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
339349   PORT_DIPSETTING(    0x40, "6 Coins/4 Credits" )
340   PORT_DIPSETTING(    0x30, DEF_STR( 4C_3C ))
341   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ))
350   PORT_DIPSETTING(    0x30, DEF_STR( 4C_3C ) )
351   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
342352   PORT_DIPSETTING(    0x20, "5 Coins/6 Credits" )
343   PORT_DIPSETTING(    0x10, DEF_STR( 4C_5C ))
344   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ))
345//  PORT_DIPSETTING(    0x50, DEF_STR( 2C_3C ))
346   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ))
347   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ))
348   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ))
349   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ))
350   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ))
353   PORT_DIPSETTING(    0x10, DEF_STR( 4C_5C ) )
354   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
355//  PORT_DIPSETTING(    0x50, DEF_STR( 2C_3C ) )
356   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
357   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
358   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
359   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
360   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
351361
352362   PORT_START("DSW2")   /* $23 */
353   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ))
363   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
354364   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
355365   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
356366   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
357367   PORT_DIPSETTING(    0x00, "Super" )
358   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ))
368   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) )
359369   PORT_DIPSETTING(    0x0c, "1" )
360370   PORT_DIPSETTING(    0x08, "2" )
361371   PORT_DIPSETTING(    0x04, "3" )
362372   PORT_DIPSETTING(    0x00, "4" )
363   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ))
364   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
365   PORT_DIPSETTING(    0x10, DEF_STR( On ))
366   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ))
367   PORT_DIPSETTING(    0x20, DEF_STR( Off ))
368   PORT_DIPSETTING(    0x00, DEF_STR( On ))
373   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
374   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
375   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
376   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
377   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
378   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
369379   PORT_DIPNAME( 0x40, 0x40, "Training Mode" )
370   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
371   PORT_DIPSETTING(    0x40, DEF_STR( On ))
380   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
381   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
372382   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
373
374   PORT_START("SYSTEM")   /* $24 */
375   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
376   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
377   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
378   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
379   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
380   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
381   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
382   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
383383INPUT_PORTS_END
384384
385385
r3115r3116
404404   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
405405   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
406406
407   PORT_START("SYSTEM")   /* $24 */
408   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
409   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
410   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
411   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
412   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
413   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
414   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
415   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
416
407417   PORT_START("DSW1")   /* $22 */
408   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ))
409   PORT_DIPSETTING(    0x09, DEF_STR( 5C_1C ))
410   PORT_DIPSETTING(    0x08, DEF_STR( 4C_1C ))
411   PORT_DIPSETTING(    0x07, DEF_STR( 3C_1C ))
412   PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ))
418   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) )
419   PORT_DIPSETTING(    0x09, DEF_STR( 5C_1C ) )
420   PORT_DIPSETTING(    0x08, DEF_STR( 4C_1C ) )
421   PORT_DIPSETTING(    0x07, DEF_STR( 3C_1C ) )
422   PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
413423   PORT_DIPSETTING(    0x0b, "6 Coins/4 Credits" )
414   PORT_DIPSETTING(    0x0c, DEF_STR( 4C_3C ))
415   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ))
424   PORT_DIPSETTING(    0x0c, DEF_STR( 4C_3C ) )
425   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
416426   PORT_DIPSETTING(    0x0d, "5 Coins/6 Credits" )
417   PORT_DIPSETTING(    0x0e, DEF_STR( 4C_5C ))
418   PORT_DIPSETTING(    0x0f, DEF_STR( 2C_3C ))
419//  PORT_DIPSETTING(    0x0a, DEF_STR( 2C_3C ))
420   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
421   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ))
422   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ))
423   PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ))
424   PORT_DIPSETTING(    0x05, DEF_STR( 1C_6C ))
425   PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_B ))
426   PORT_DIPSETTING(    0x90, DEF_STR( 5C_1C ))
427   PORT_DIPSETTING(    0x80, DEF_STR( 4C_1C ))
428   PORT_DIPSETTING(    0x70, DEF_STR( 3C_1C ))
429   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ))
427   PORT_DIPSETTING(    0x0e, DEF_STR( 4C_5C ) )
428   PORT_DIPSETTING(    0x0f, DEF_STR( 2C_3C ) )
429//  PORT_DIPSETTING(    0x0a, DEF_STR( 2C_3C ) )
430   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
431   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
432   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
433   PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
434   PORT_DIPSETTING(    0x05, DEF_STR( 1C_6C ) )
435   PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_B ) )
436   PORT_DIPSETTING(    0x90, DEF_STR( 5C_1C ) )
437   PORT_DIPSETTING(    0x80, DEF_STR( 4C_1C ) )
438   PORT_DIPSETTING(    0x70, DEF_STR( 3C_1C ) )
439   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
430440   PORT_DIPSETTING(    0xb0, "6 Coins/4 Credits" )
431   PORT_DIPSETTING(    0xc0, DEF_STR( 4C_3C ))
432   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ))
441   PORT_DIPSETTING(    0xc0, DEF_STR( 4C_3C ) )
442   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
433443   PORT_DIPSETTING(    0xd0, "5 Coins/6 Credits" )
434   PORT_DIPSETTING(    0xe0, DEF_STR( 4C_5C ))
435   PORT_DIPSETTING(    0xf0, DEF_STR( 2C_3C ))
436//  PORT_DIPSETTING(    0xa0, DEF_STR( 2C_3C ))
437   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ))
438   PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ))
439   PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ))
440   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ))
441   PORT_DIPSETTING(    0x50, DEF_STR( 1C_6C ))
444   PORT_DIPSETTING(    0xe0, DEF_STR( 4C_5C ) )
445   PORT_DIPSETTING(    0xf0, DEF_STR( 2C_3C ) )
446//  PORT_DIPSETTING(    0xa0, DEF_STR( 2C_3C ) )
447   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
448   PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
449   PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
450   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
451   PORT_DIPSETTING(    0x50, DEF_STR( 1C_6C ) )
442452
443453   PORT_START("DSW2")   /* $23 */
444454   PORT_DIPNAME( 0x03, 0x00, "Difficulty 1" )
r3115r3116
452462   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
453463   PORT_DIPSETTING(    0x0c, "Super" )
454464   PORT_SERVICE( 0x10, IP_ACTIVE_HIGH )
455   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Flip_Screen ))
456   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
457   PORT_DIPSETTING(    0x20, DEF_STR( On ))
458   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ))
459   PORT_DIPSETTING(    0x40, DEF_STR( Off ))
460   PORT_DIPSETTING(    0x00, DEF_STR( On ))
465   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Flip_Screen ) )
466   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
467   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
468   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
469   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
470   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
461471   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
462
463   PORT_START("SYSTEM")   /* $24 */
464   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
465   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
466   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
467   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
468   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
469   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
470   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
471   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
472472INPUT_PORTS_END
473473
474474
src/mame/drivers/discoboy.c
r3115r3116
4949static UINT8 discoboy_ram_bank;
5050static UINT8 port_00;
5151static UINT8 discoboy_gfxbank;
52static int adpcm_data;
5253
5354static VIDEO_START( discoboy )
5455{
r3115r3116
330331
331332/* Sound */
332333
333static int adpcm_data = 0x80;
334
335334//static WRITE8_HANDLER( splash_adpcm_data_w ){
336335//  adpcm_data = data;
337336//}
r3115r3116
460459static GFXDECODE_START( discoboy )
461460   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0x000, 128 )
462461   GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout2, 0x000, 128 )
463
464462GFXDECODE_END
465463
466464
r3115r3116
471469   MSM5205_S48_4B      /* ??? unknown hz */
472470};
473471
472static MACHINE_RESET( discoboy )
473{
474   discoboy_ram_bank = 0;
475   port_00 = 0;
476   discoboy_gfxbank = 0;
477   adpcm_data = 0x80;
478}
474479
475480static MACHINE_DRIVER_START( discoboy )
476481   /* basic machine hardware */
r3115r3116
499504   MDRV_VIDEO_START(discoboy)
500505   MDRV_VIDEO_UPDATE(discoboy)
501506
507   MDRV_MACHINE_RESET( discoboy )
508
502509   /* sound hardware */
503510   MDRV_SPEAKER_STANDARD_MONO("mono")
504511
src/mame/drivers/policetr.c
r3115r3116
135135
136136/*************************************
137137 *
138 *  Input ports
139 *
140 *************************************/
141
142static READ32_HANDLER( port0_r )
143{
144   return input_port_read(machine, "IN0") << 16;
145}
146
147
148static READ32_HANDLER( port1_r )
149{
150   return (input_port_read(machine, "IN1") << 16) | (eeprom_read_bit() << 29);
151}
152
153
154static READ32_HANDLER( port2_r )
155{
156   return input_port_read(machine, "DSW1") << 16;
157}
158
159
160
161/*************************************
162 *
163138 *  Output ports
164139 *
165140 *************************************/
r3115r3116
311286   AM_RANGE(0x00900000, 0x00900003) AM_WRITE(policetr_palette_offset_w)
312287   AM_RANGE(0x00920000, 0x00920003) AM_WRITE(policetr_palette_data_w)
313288   AM_RANGE(0x00a00000, 0x00a00003) AM_WRITE(control_w)
314   AM_RANGE(0x00a00000, 0x00a00003) AM_READ(port0_r)
315   AM_RANGE(0x00a20000, 0x00a20003) AM_READ(port1_r)
316   AM_RANGE(0x00a40000, 0x00a40003) AM_READ(port2_r)
289   AM_RANGE(0x00a00000, 0x00a00003) AM_READ_PORT("IN0")
290   AM_RANGE(0x00a20000, 0x00a20003) AM_READ_PORT("IN1")
291   AM_RANGE(0x00a40000, 0x00a40003) AM_READ_PORT("DSW")
317292   AM_RANGE(0x00e00000, 0x00e00003) AM_WRITENOP      // watchdog???
318293   AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_REGION("user1", 0)
319294ADDRESS_MAP_END
r3115r3116
330305   AM_RANGE(0x00700000, 0x00700003) AM_WRITE(bsmt2000_reg_w)
331306   AM_RANGE(0x00800000, 0x0080000f) AM_WRITE(policetr_video_w)
332307   AM_RANGE(0x00a00000, 0x00a00003) AM_WRITE(control_w)
333   AM_RANGE(0x00a00000, 0x00a00003) AM_READ(port0_r)
334   AM_RANGE(0x00a20000, 0x00a20003) AM_READ(port1_r)
335   AM_RANGE(0x00a40000, 0x00a40003) AM_READ(port2_r)
308   AM_RANGE(0x00a00000, 0x00a00003) AM_READ_PORT("IN0")
309   AM_RANGE(0x00a20000, 0x00a20003) AM_READ_PORT("IN1")
310   AM_RANGE(0x00a40000, 0x00a40003) AM_READ_PORT("DSW")
336311   AM_RANGE(0x00e00000, 0x00e00003) AM_WRITENOP      // watchdog???
337312   AM_RANGE(0x1fc00000, 0x1fcfffff) AM_ROM AM_REGION("user1", 0)
338313ADDRESS_MAP_END
r3115r3116
347322
348323static INPUT_PORTS_START( policetr )
349324   PORT_START("IN0")
350   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
351   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
352   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
353   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
354   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
355   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
356   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
357   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
358   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
359   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
360   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
361   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
362   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
363   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
364   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
365   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
325   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_UNKNOWN )
326   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_UNKNOWN )
327   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_UNKNOWN )
328   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_UNKNOWN )
329   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNKNOWN )
330   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNKNOWN )
331   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNKNOWN )
332   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNKNOWN )
333   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
334   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
335   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
336   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
337   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
338   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
339   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
340   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
366341
367342   PORT_START("IN1")
368   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START2 )
369   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START1 )
370   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN2 )
371   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN1 )
372   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
373   PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )      /* Not actually a dipswitch */
374   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
375   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
376   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
377   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
378   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
379   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
380   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
381   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL )      /* EEPROM read */
382   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
383   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
343   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_START2 )
344   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_START1 )
345   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_COIN2 )
346   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_COIN1 )
347   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNKNOWN )
348   PORT_SERVICE( 0x00200000, IP_ACTIVE_LOW )      /* Not actually a dipswitch */
349   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNKNOWN )
350   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNKNOWN )
351   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
352   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
353   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
354   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
355   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
356   PORT_BIT( 0x20000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM read */
357   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
358   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
384359
385   PORT_START("DSW1")
386   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW1:1" )
387   PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW1:2" )
388   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:3" )
389   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW1:4" )
390   PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW1:5" )
391   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW1:6" )
392   PORT_DIPNAME( 0x40, 0x40, "Monitor Sync") PORT_DIPLOCATION("SW1:7")
393   PORT_DIPSETTING(    0x00, "+")
394   PORT_DIPSETTING(    0x40, "-")
395   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen )) PORT_DIPLOCATION("SW1:8") /* For use with mirrored CRTs - Not supported */
396   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
397   PORT_DIPSETTING(    0x80, DEF_STR( On ))   /* Will invert the Y axis of guns */
398   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
360   PORT_START("DSW")
361   PORT_DIPUNUSED_DIPLOC( 0x00010000, 0x00010000, "SW1:1" )
362   PORT_DIPUNUSED_DIPLOC( 0x00020000, 0x00020000, "SW1:2" )
363   PORT_DIPUNUSED_DIPLOC( 0x00040000, 0x00040000, "SW1:3" )
364   PORT_DIPUNUSED_DIPLOC( 0x00080000, 0x00080000, "SW1:4" )
365   PORT_DIPUNUSED_DIPLOC( 0x00100000, 0x00100000, "SW1:5" )
366   PORT_DIPUNUSED_DIPLOC( 0x00200000, 0x00200000, "SW1:6" )
367   PORT_DIPNAME( 0x00400000, 0x00400000, "Monitor Sync") PORT_DIPLOCATION("SW1:7")
368   PORT_DIPSETTING(          0x00000000, "+")
369   PORT_DIPSETTING(          0x00400000, "-")
370   PORT_DIPNAME( 0x00800000, 0x00800000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") /* For use with mirrored CRTs - Not supported */
371   PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
372   PORT_DIPSETTING(          0x00800000, DEF_STR( On ) )   /* Will invert the Y axis of guns */
373   PORT_BIT( 0xff000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
399374
400375   PORT_START("GUNX1")            /* fake analog X */
401376   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.012, 0.008, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)
src/mame/drivers/seibuspi.c
r3115r3116
892892{
893893   if( ACCESSING_BITS_0_7 )
894894   {
895      return (input_port_read(machine, "P2") << 8) | input_port_read(machine, "P1") | 0xffff0000;
895      return input_port_read(machine, "INPUTS");
896896   }
897897   return 0xffffffff;
898898}
r3115r3116
901901{
902902   if( ACCESSING_BITS_0_7 )
903903   {
904      return ((input_port_read(machine, "SYSTEM") | 0xffffff00) & ~0x40) | (eeprom_read_bit() << 6);
904      return input_port_read(machine, "SYSTEM");
905905   }
906906   return 0xffffffff;
907907}
r3115r3116
11181118/********************************************************************/
11191119
11201120static INPUT_PORTS_START( spi_2button )
1121   PORT_START("P1")
1122   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1123   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1124   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1125   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1126   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1127   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1128   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1129   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1121   PORT_START("INPUTS")
1122   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1123   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1124   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1125   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1126   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1127   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1128   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNUSED )
1129   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED )
1130   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1131   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1132   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1133   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1134   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1135   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1136   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNUSED )
1137   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED )
1138   PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNUSED )
11301139
1131   PORT_START("P2")
1132   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1133   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1134   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1135   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1136   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1137   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1138   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1139   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1140
11411140   PORT_START("SYSTEM")
1142   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
1143   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
1144   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW) /* Test Button */
1145   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7)
1146   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
1141   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_START1 )
1142   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_START2 )
1143   PORT_SERVICE_NO_TOGGLE( 0x00000004, IP_ACTIVE_LOW) /* Test Button */
1144   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7)
1145   PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
1146   PORT_BIT( 0x000000b0, IP_ACTIVE_LOW, IPT_UNUSED )
1147   PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED )
11471148
1148   PORT_START("JP1")      /* JP1 */
1149   PORT_START("JP1")
11491150   PORT_DIPNAME( 0x03, 0x03, "JP1" )
11501151   PORT_DIPSETTING(   0x03, "Update"  )
11511152   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
r3115r3116
11591160INPUT_PORTS_END
11601161
11611162static INPUT_PORTS_START( spi_3button )
1162   PORT_START("P1")
1163   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1164   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1165   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1166   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1167   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1168   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1169   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1170   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1163   PORT_INCLUDE( spi_2button )
11711164
1172   PORT_START("P2")
1173   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1174   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1175   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1176   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1177   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1178   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1179   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1180   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1181
1182   PORT_START("SYSTEM")
1183   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
1184   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
1185   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
1186   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7)
1187   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
1188
1189   PORT_START("JP1")
1190   PORT_DIPNAME( 0x03, 0x03, "JP1" )
1191   PORT_DIPSETTING(   0x03, "Update"  )
1192   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
1193   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1194   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
1195
1196   PORT_START("COIN")
1197   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1198   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1199   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
1165   PORT_MODIFY("INPUTS")
1166   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1167   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
12001168INPUT_PORTS_END
12011169
12021170static INPUT_PORTS_START( seibu386_2button )
1203   PORT_START("P1")
1204   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1205   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1206   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1207   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1208   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1209   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1210   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1211   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1171   PORT_START("INPUTS")
1172   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1173   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1174   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1175   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1176   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1177   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1178   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNUSED )
1179   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED )
1180   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1181   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1182   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1183   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1184   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1185   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1186   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNUSED )
1187   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED )
1188   PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNUSED )
12121189
1213   PORT_START("P2")
1214   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1215   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1216   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1217   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1218   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1219   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1220   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1221   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1222
12231190   PORT_START("SYSTEM")
1224   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
1225   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
1226   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW) /* Test Button */
1227   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7)
1228   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
1229   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
1230   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
1191   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_START1 )
1192   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_START2 )
1193   PORT_SERVICE_NO_TOGGLE( 0x00000004, IP_ACTIVE_LOW) /* Test Button */
1194   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7)
1195   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN1 )
1196   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_COIN2 )
1197   PORT_BIT( 0x000000c0, IP_ACTIVE_LOW, IPT_UNUSED )
1198   PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED )
12311199
1232   PORT_START("JP1")      /* JP1 */
1200   PORT_START("JP1")
12331201   PORT_DIPNAME( 0x03, 0x03, "JP1" )
12341202   PORT_DIPSETTING(   0x03, "Update"  )
12351203   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
r3115r3116
12741242}
12751243
12761244static INPUT_PORTS_START( spi_ejanhs )
1277   PORT_START("P1")
1278   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(ejanhs_encode, "IN0BITS")
1245   PORT_START("INPUTS")
1246   PORT_BIT( 0x0000003f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(ejanhs_encode, "IN0BITS")
1247   PORT_BIT( 0x00003f00, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(ejanhs_encode, "IN1BITS")
1248   PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNUSED )
12791249
1280   PORT_START("P2")
1281   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(ejanhs_encode, "IN1BITS")
1282
12831250   PORT_START("SYSTEM")
1284   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
1285   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7)
1286   PORT_BIT( 0xf3, IP_ACTIVE_LOW, IPT_UNKNOWN )
1251   PORT_SERVICE_NO_TOGGLE( 0x00000004, IP_ACTIVE_LOW )
1252   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7)
1253   PORT_BIT( 0x000000f3, IP_ACTIVE_LOW, IPT_UNKNOWN )
1254   PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED )
12871255
12881256   PORT_START("JP1")
12891257   PORT_DIPNAME( 0x03, 0x03, "JP1" )
r3115r3116
12981266   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
12991267
13001268   PORT_START("IN0BITS")
1301   PORT_BIT( 0x001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 A") PORT_CODE(KEYCODE_A)
1302   PORT_BIT( 0x002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 B") PORT_CODE(KEYCODE_B)
1303   PORT_BIT( 0x004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 E") PORT_CODE(KEYCODE_E)
1304   PORT_BIT( 0x008, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 F") PORT_CODE(KEYCODE_F)
1305   PORT_BIT( 0x010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 I") PORT_CODE(KEYCODE_I)
1306   PORT_BIT( 0x020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 J") PORT_CODE(KEYCODE_J)
1307   PORT_BIT( 0x040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 M") PORT_CODE(KEYCODE_M)
1308   PORT_BIT( 0x080, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 N") PORT_CODE(KEYCODE_N)
1309   PORT_BIT( 0x100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 Kan") PORT_CODE(KEYCODE_LCONTROL)
1310   PORT_BIT( 0x200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 Reach") PORT_CODE(KEYCODE_LSHIFT)
1311   PORT_BIT( 0x400, IP_ACTIVE_HIGH, IPT_START1 ) PORT_PLAYER(1)
1269   PORT_BIT( 0x001, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) PORT_PLAYER(1)
1270   PORT_BIT( 0x002, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) PORT_PLAYER(1)
1271   PORT_BIT( 0x004, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) PORT_PLAYER(1)
1272   PORT_BIT( 0x008, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) PORT_PLAYER(1)
1273   PORT_BIT( 0x010, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) PORT_PLAYER(1)
1274   PORT_BIT( 0x020, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) PORT_PLAYER(1)
1275   PORT_BIT( 0x040, IP_ACTIVE_HIGH, IPT_MAHJONG_M ) PORT_PLAYER(1)
1276   PORT_BIT( 0x080, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) PORT_PLAYER(1)
1277   PORT_BIT( 0x100, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN ) PORT_PLAYER(1)
1278   PORT_BIT( 0x200, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) PORT_PLAYER(1)
1279   PORT_BIT( 0x400, IP_ACTIVE_HIGH, IPT_START1 )
13121280
13131281   PORT_START("IN1BITS")
1314   PORT_BIT( 0x001, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 C") PORT_CODE(KEYCODE_C)
1315   PORT_BIT( 0x002, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 D") PORT_CODE(KEYCODE_D)
1316   PORT_BIT( 0x004, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 G") PORT_CODE(KEYCODE_G)
1317   PORT_BIT( 0x008, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 H") PORT_CODE(KEYCODE_H)
1318   PORT_BIT( 0x010, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 K") PORT_CODE(KEYCODE_K)
1319   PORT_BIT( 0x020, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 L") PORT_CODE(KEYCODE_L)
1320   PORT_BIT( 0x040, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 Chi") PORT_CODE(KEYCODE_SPACE)
1321   PORT_BIT( 0x080, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 Pon") PORT_CODE(KEYCODE_LALT)
1322   PORT_BIT( 0x100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 Ron") PORT_CODE(KEYCODE_Z)
1282   PORT_BIT( 0x001, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) PORT_PLAYER(1)
1283   PORT_BIT( 0x002, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) PORT_PLAYER(1)
1284   PORT_BIT( 0x004, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) PORT_PLAYER(1)
1285   PORT_BIT( 0x008, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) PORT_PLAYER(1)
1286   PORT_BIT( 0x010, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) PORT_PLAYER(1)
1287   PORT_BIT( 0x020, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) PORT_PLAYER(1)
1288   PORT_BIT( 0x040, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) PORT_PLAYER(1)
1289   PORT_BIT( 0x080, IP_ACTIVE_HIGH, IPT_MAHJONG_PON ) PORT_PLAYER(1)
1290   PORT_BIT( 0x100, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) PORT_PLAYER(1)
13231291INPUT_PORTS_END
13241292
13251293/********************************************************************/
src/mame/drivers/sauro.c
r3115r3116
159159
160160static ADDRESS_MAP_START( sauro_readport, ADDRESS_SPACE_IO, 8 )
161161   ADDRESS_MAP_GLOBAL_MASK(0xff)
162   AM_RANGE(0x00, 0x00) AM_READ(input_port_2_r)
163   AM_RANGE(0x20, 0x20) AM_READ(input_port_3_r)
164   AM_RANGE(0x40, 0x40) AM_READ(input_port_0_r)
165   AM_RANGE(0x60, 0x60) AM_READ(input_port_1_r)
162   AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW1")
163   AM_RANGE(0x20, 0x20) AM_READ_PORT("DSW2")
164   AM_RANGE(0x40, 0x40) AM_READ_PORT("P1")
165   AM_RANGE(0x60, 0x60) AM_READ_PORT("P2")
166166ADDRESS_MAP_END
167167
168168static ADDRESS_MAP_START( sauro_writeport, ADDRESS_SPACE_IO, 8 )
r3115r3116
204204static ADDRESS_MAP_START( trckydoc_readmem, ADDRESS_SPACE_PROGRAM, 8 )
205205   AM_RANGE(0x0000, 0xdfff) AM_READ(SMH_ROM)
206206   AM_RANGE(0xe000, 0xe7ff) AM_READ(SMH_RAM)
207   AM_RANGE(0xf800, 0xf800) AM_READ(input_port_2_r)
208   AM_RANGE(0xf808, 0xf808) AM_READ(input_port_3_r)
209   AM_RANGE(0xf810, 0xf810) AM_READ(input_port_0_r)
210   AM_RANGE(0xf818, 0xf818) AM_READ(input_port_1_r)
207   AM_RANGE(0xf800, 0xf800) AM_READ_PORT("DSW1")
208   AM_RANGE(0xf808, 0xf808) AM_READ_PORT("DSW2")
209   AM_RANGE(0xf810, 0xf810) AM_READ_PORT("P1")
210   AM_RANGE(0xf818, 0xf818) AM_READ_PORT("P2")
211211   AM_RANGE(0xf828, 0xf828) AM_READ(watchdog_reset_r)
212212ADDRESS_MAP_END
213213
r3115r3116
230230ADDRESS_MAP_END
231231
232232static INPUT_PORTS_START( tecfri )
233   PORT_START("P1")      /* IN0 */
233   PORT_START("P1")
234234   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
235235   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
236236   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
r3115r3116
240240   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
241241   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
242242
243   PORT_START("P2")      /* IN1 */
243   PORT_START("P2")
244244   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
245245   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
246246   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
src/mame/drivers/system1.c
r3115r3116
240240
241241static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
242242   ADDRESS_MAP_GLOBAL_MASK(0xff)
243   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r) /* joy1 */
244   AM_RANGE(0x04, 0x04) AM_READ(input_port_1_r) /* joy2 */
245   AM_RANGE(0x08, 0x08) AM_READ(input_port_2_r) /* coin,start */
246   AM_RANGE(0x0c, 0x0c) AM_READ(input_port_3_r) /* DIP2 */
247   AM_RANGE(0x0e, 0x0e) AM_READ(input_port_3_r) /* DIP2 blckgalb reads it from here */
248   AM_RANGE(0x0d, 0x0d) AM_READ(input_port_4_r) /* DIP1 some games read it from here... */
249   AM_RANGE(0x10, 0x10) AM_READ(input_port_4_r) /* DIP1 ... and some others from here */
250                           /* but there are games which check BOTH! */
243   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
244   AM_RANGE(0x04, 0x04) AM_READ_PORT("P2")
245   AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM")
246   AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2")   /* DIP2 */
247   AM_RANGE(0x0e, 0x0e) AM_READ_PORT("DSW2")   /* DIP2 blckgalb reads it from here */
248   AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1")   /* DIP1 some games read it from here... */
249   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1")   /* DIP1 ... and some others from here */
250                                    /* but there are games which check BOTH! */
251251
252   AM_RANGE(0x11, 0x11) AM_READ(input_port_3_r) /* DIP2 ... blockgal */
252   AM_RANGE(0x11, 0x11) AM_READ_PORT("DSW2")   /* DIP2 ... blockgal */
253253
254254
255255   AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r)
r3115r3116
266266
267267static ADDRESS_MAP_START( wbml_readport, ADDRESS_SPACE_IO, 8 )
268268   ADDRESS_MAP_GLOBAL_MASK(0xff)
269   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r) /* joy1 */
270   AM_RANGE(0x04, 0x04) AM_READ(input_port_1_r) /* joy2 */
271   AM_RANGE(0x08, 0x08) AM_READ(input_port_2_r) /* coin,start */
272   AM_RANGE(0x0c, 0x0c) AM_READ(input_port_3_r) /* DIP2 */
273   AM_RANGE(0x0d, 0x0d) AM_READ(input_port_4_r) /* DIP1 some games read it from here... */
274   AM_RANGE(0x10, 0x10) AM_READ(input_port_4_r) /* DIP1 ... and some others from here */
275                           /* but there are games which check BOTH! */
269   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
270   AM_RANGE(0x04, 0x04) AM_READ_PORT("P2")
271   AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM")
272   AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2")   /* DIP2 */
273   AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1")   /* DIP1 some games read it from here... */
274   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1")   /* DIP1 ... and some others from here */
275                                    /* but there are games which check BOTH! */
276276   AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r)
277277   AM_RANGE(0x16, 0x16) AM_READ(wbml_videoram_bank_latch_r)
278278   AM_RANGE(0x19, 0x19) AM_READ(system1_videomode_r)  /* mirror address */
r3115r3116
280280
281281static ADDRESS_MAP_START( sht_readport, ADDRESS_SPACE_IO, 8 )
282282   ADDRESS_MAP_GLOBAL_MASK(0xff)
283//  AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r) /* joy1 */
284//  AM_RANGE(0x04, 0x04) AM_READ(input_port_1_r) /* joy2 */
285   AM_RANGE(0x08, 0x08) AM_READ(input_port_2_r) /* coin,start */
286   AM_RANGE(0x0c, 0x0c) AM_READ(input_port_3_r) /* DIP2 */
287   AM_RANGE(0x0d, 0x0d) AM_READ(input_port_4_r) /* DIP1 some games read it from here... */
288   AM_RANGE(0x10, 0x10) AM_READ(input_port_4_r) /* DIP1 ... and some others from here */
289                           /* but there are games which check BOTH! */
283/*  AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") */
284/*  AM_RANGE(0x04, 0x04) AM_READ_PORT("P2") */
285   AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM")
286   AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2")   /* DIP2 */
287   AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1")   /* DIP1 some games read it from here... */
288   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1")   /* DIP1 ... and some others from here */
289                                    /* but there are games which check BOTH! */
290290
291   AM_RANGE(0x12, 0x12) AM_READ(input_port_5_r) // trigger is here..
291   AM_RANGE(0x12, 0x12) AM_READ_PORT("TRIGGER")
292292
293   AM_RANGE(0x1c, 0x1c) AM_READ(input_port_6_r) // gunx
294   AM_RANGE(0x1d, 0x1d) AM_READ(input_port_7_r) // guny
293   AM_RANGE(0x1c, 0x1c) AM_READ_PORT("GUNX")
294   AM_RANGE(0x1d, 0x1d) AM_READ_PORT("GUNY")
295295
296   AM_RANGE(0x18, 0x18) AM_READ(input_port_8_r) // ??
296   AM_RANGE(0x18, 0x18) AM_READ_PORT("18")      /* ?? */
297297
298298
299299   AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r)
r3115r3116
305305
306306static ADDRESS_MAP_START( nobo_readport, ADDRESS_SPACE_IO, 8 )
307307   ADDRESS_MAP_GLOBAL_MASK(0xff)
308   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)   /* Player 1 inputs */
309   AM_RANGE(0x04, 0x04) AM_READ(input_port_1_r)   /* Player 2 inputs */
310   AM_RANGE(0x08, 0x08) AM_READ(input_port_2_r)   /* System inputs */
311   AM_RANGE(0x0c, 0x0c) AM_READ(input_port_3_r)   /* DSW1 */
312   AM_RANGE(0x0d, 0x0d) AM_READ(input_port_4_r)   /* DSW0 */
308   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
309   AM_RANGE(0x04, 0x04) AM_READ_PORT("P2")
310   AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM")
311   AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2")         /* DIP2 */
312   AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1")         /* DIP1 some games read it from here... */
313313   AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r)
314314   AM_RANGE(0x16, 0x16) AM_READ(inport16_r)         /* Used - check code at 0x05cb */
315315   AM_RANGE(0x1c, 0x1c) AM_READ(inport1c_r)         /* Shouldn't be called ! */
r3115r3116
410410ADDRESS_MAP_END
411411
412412
413#define IN0_PORT \
414   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) \
415   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) \
416   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) \
417   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) \
418   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) \
419   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) \
420   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
421   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
422
423#define DSW1_PORT \
413#define COINAGE_PORT \
424414   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW A:1,2,3,4") \
425415   PORT_DIPSETTING(   0x07, DEF_STR( 4C_1C ) ) \
426416   PORT_DIPSETTING(   0x08, DEF_STR( 3C_1C ) ) \
r3115r3116
462452   PORT_DIPSETTING(   0x80, "Port $0D" ) \
463453   PORT_DIPSETTING(   0x00, "Port $10" )
464454
465static INPUT_PORTS_START( starjack )
466   PORT_START("P1")  /* IN1 */
455static INPUT_PORTS_START( common )
456   PORT_START("P1")
467457   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
468458   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
469459   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
r3115r3116
473463   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
474464   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
475465
476   PORT_START("P2")  /* IN2 */
466   PORT_START("P2")
477467   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
478468   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
479469   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
r3115r3116
483473   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
484474   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
485475
486   PORT_START("SYSTEM")  /* IN0 */
487   IN0_PORT
476   PORT_START("SYSTEM")
477   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
478   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
479   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
480   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
481   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
482   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
483   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
484   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
488485
489   PORT_START("DSW1")     /* DSW1 */
490   DSW1_PORT
486   PORT_START("DSW2")
487   COINAGE_PORT
488INPUT_PORTS_END
491489
492   PORT_START("DSW0")  /* DSW0 */
490
491static INPUT_PORTS_START( starjack )
492   PORT_INCLUDE( common )
493
494   PORT_START("DSW1")
493495   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
494496   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
495497   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
515517INPUT_PORTS_END
516518
517519static INPUT_PORTS_START( starjacs )
518   PORT_START("P1")  /* IN1 */
519   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
520   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
521   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
522   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
523   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
524   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
525   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
526   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
520   PORT_INCLUDE( common )
527521
528   PORT_START("P2")  /* IN2 */
529   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
530   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
531   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
532   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
533   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
534   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
535   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
536   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
537
538   PORT_START("SYSTEM")  /* IN0 */
539   IN0_PORT
540
541   PORT_START("DSW1")     /* DSW1 */
542   DSW1_PORT
543
544   PORT_START("DSW0")  /* DSW0 */
522   PORT_START("DSW1")
545523   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
546524   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
547525   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
566544INPUT_PORTS_END
567545
568546static INPUT_PORTS_START( regulus )
569   PORT_START("P1")  /* IN1 */
570   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
571   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
572   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
573   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
574   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
575   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
576   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
577   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
547   PORT_INCLUDE( common )
578548
579   PORT_START("P2")  /* IN2 */
580   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
581   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
582   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
583   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
584   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
585   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
586   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
587   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
588
589   PORT_START("SYSTEM")  /* IN0 */
590   IN0_PORT
591
592   PORT_START("DSW1")     /* DSW1 */
593   DSW1_PORT
594
595   PORT_START("DSW0")  /* DSW0 */
549   PORT_START("DSW1")
596550   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
597551   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
598552   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
620574
621575/* Same as 'regulus', but no DEF_STR( Allow_Continue ) Dip Switch */
622576static INPUT_PORTS_START( reguluso )
623   PORT_START("P1")  /* IN1 */
624   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
625   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
626   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
627   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
628   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
629   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
630   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
631   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
577   PORT_INCLUDE( regulus )
632578
633   PORT_START("P2")  /* IN2 */
634   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
635   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
636   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
637   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
638   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
639   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
640   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
641   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
642
643   PORT_START("SYSTEM")  /* IN0 */
644   IN0_PORT
645
646   PORT_START("DSW1")     /* DSW1 */
647   DSW1_PORT
648
649   PORT_START("DSW0")  /* DSW0 */
650   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
651   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
652   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
653   PORT_DIPNAME( 0x02, 0x02, "Unused SW 0-1" )
654   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
655   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
656   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
657   PORT_DIPSETTING(   0x0c, "3" )
658   PORT_DIPSETTING(   0x08, "4" )
659   PORT_DIPSETTING(   0x04, "5" )
660   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
661   PORT_DIPNAME( 0x10, 0x10, "Unused SW 0-4" )
662   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
663   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
664   PORT_DIPNAME( 0x20, 0x20, "Unused SW 0-5" )
665   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
666   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
667   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
668   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
669   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
579   PORT_MODIFY("DSW1")
670580   PORT_DIPNAME( 0x80, 0x80, "Unused SW 0-7" )
671581   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
672582   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
673583INPUT_PORTS_END
674584
675585static INPUT_PORTS_START( upndown )
676   PORT_START("P1")  /* IN1 */
677   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
678   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
679   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
680   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
681   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
682   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
683   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
684   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
586   PORT_INCLUDE( common )
685587
686   PORT_START("P2")  /* IN2 */
687   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
688   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
689   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
690   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
691   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
692   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
693   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
694   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
588   PORT_MODIFY("P1")
589   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* no button 2 */
695590
696   PORT_START("SYSTEM")  /* IN0 */
697   IN0_PORT
591   PORT_MODIFY("P2")
592   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* no button 2 */
698593
699   PORT_START("DSW1")     /* DSW1 */
700   DSW1_PORT
701
702   PORT_START("DSW0")  /* DSW0 */
594   PORT_START("DSW1")
703595   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
704596   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
705597   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
725617INPUT_PORTS_END
726618
727619static INPUT_PORTS_START( mrviking )
728   PORT_START("P1")  /* IN1 */
729   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
620   PORT_INCLUDE( common )
621
622   PORT_MODIFY("P1")
730623   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
731624   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
732   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
733   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
734   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
735   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
736   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
737625
738   PORT_START("P2")  /* IN2 */
739   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
626   PORT_MODIFY("P2")
740627   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
741628   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
742   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
743   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
744   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
745   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
746   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
747629
748   PORT_START("SYSTEM")  /* IN0 */
749   IN0_PORT
750
751   PORT_START("DSW1")     /* DSW1 */
752   DSW1_PORT
753
754   PORT_START("DSW0")  /* DSW0 */
630   PORT_START("DSW1")
755631   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
756632   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
757633   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
777653/* Same as 'mrviking', but no "Maximum Credits" Dip Switch and "Difficulty" Dip Switch is
778654   handled by bit 7 instead of bit 6 (so bit 6 is unused) */
779655static INPUT_PORTS_START( mrvikngj )
780   PORT_START("P1")  /* IN1 */
781   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
782   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
783   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
784   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
785   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
786   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
787   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
788   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
656   PORT_INCLUDE( mrviking )
789657
790   PORT_START("P2")  /* IN2 */
791   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
792   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
793   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
794   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
795   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
796   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
797   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
798   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
799
800   PORT_START("SYSTEM")  /* IN0 */
801   IN0_PORT
802
803   PORT_START("DSW1")     /* DSW1 */
804   DSW1_PORT
805
806   PORT_START("DSW0")  /* DSW0 */
807   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
808   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
809   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
658   PORT_MODIFY("DSW1")
810659   PORT_DIPNAME( 0x02, 0x02, "Unused SW 0-1" )
811660   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
812661   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
813   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
814   PORT_DIPSETTING(   0x0c, "3" )
815   PORT_DIPSETTING(   0x08, "4" )
816   PORT_DIPSETTING(   0x04, "5" )
817   PORT_DIPSETTING(   0x00, DEF_STR( Infinite ) )
818   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
819   PORT_DIPSETTING(   0x30, "10k, 30k then every 30k" )
820   PORT_DIPSETTING(   0x20, "20k, 40k then every 30k" )
821   PORT_DIPSETTING(   0x10, "30k, then every 30k" )
822   PORT_DIPSETTING(   0x00, "40k, then every 30k" )
823662   PORT_DIPNAME( 0x40, 0x40, "Unused SW 0-6" )
824663   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
825664   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
r3115r3116
829668INPUT_PORTS_END
830669
831670static INPUT_PORTS_START( swat )
832   PORT_START("P1")  /* IN1 */
833   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
834   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
835   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
836   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
671   PORT_INCLUDE( common )
672
673   PORT_MODIFY("P1")
837674   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
838675   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
839676   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
840677   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
841678
842   PORT_START("P2")  /* IN2 */
843   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
844   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
845   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
846   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
679   PORT_MODIFY("P2")
847680   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
848681   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
849682   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
850683   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
851684
852   PORT_START("SYSTEM")  /* IN0 */
853   IN0_PORT
854
855   PORT_START("DSW1")     /* DSW1 */
856   DSW1_PORT
857
858   PORT_START("DSW0")  /* DSW0 */
685   PORT_START("DSW1")
859686   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
860687   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
861688   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
882709INPUT_PORTS_END
883710
884711static INPUT_PORTS_START( flicky )
885   PORT_START("P1")  /* IN1 */
886   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
887   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
888   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
889   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
890   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
891   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
712   PORT_INCLUDE( common )
713
714   PORT_MODIFY("P1")
715   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* no button 2 */
716   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* only 2way inputs */
717   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* only 2way inputs */
892718   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
893719   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
894720
895   PORT_START("P2")  /* IN2 */
896   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
897   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
898   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
899   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
900   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
901   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
721   PORT_MODIFY("P2")
722   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* no button 2 */
723   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* only 2way inputs */
724   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* only 2way inputs */
902725   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
903726   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
904727
905   PORT_START("SYSTEM")  /* IN0 */
906   IN0_PORT
907
908   PORT_START("DSW1")     /* DSW1 */
909   DSW1_PORT
910
911   PORT_START("DSW0")  /* DSW0 */
728   PORT_START("DSW1")
912729   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
913730   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
914731   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
932749INPUT_PORTS_END
933750
934751static INPUT_PORTS_START( wmatch )
935   PORT_START("P1")  /* IN1 */
752   PORT_START("P1")
936753   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_8WAY
937754   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY
938755   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY
r3115r3116
942759   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_8WAY
943760   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_8WAY
944761
945   PORT_START("P2")  /* IN2 */
762   PORT_START("P2")
946763   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_8WAY PORT_COCKTAIL
947764   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY PORT_COCKTAIL
948765   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY PORT_COCKTAIL
r3115r3116
952769   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_8WAY PORT_COCKTAIL
953770   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_8WAY PORT_COCKTAIL
954771
955   PORT_START("SYSTEM")  /* IN0 */
772   PORT_START("SYSTEM")
956773   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
957774   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
958775   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
959776   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
960777   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
961778   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
962   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* TURN P1 */
963   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL /* TURN P2 */
779   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )            /* TURN P1 */
780   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL   /* TURN P2 */
964781
965   PORT_START("DSW1")     /* DSW1 */
966   DSW1_PORT
782   PORT_START("DSW2")
783   COINAGE_PORT
967784
968   PORT_START("DSW0")  /* DSW0 */
785   PORT_START("DSW1")
969786   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
970787   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
971788   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
990807INPUT_PORTS_END
991808
992809static INPUT_PORTS_START( bullfgt )
993   PORT_START("P1")  /* IN1 */
994   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
995   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
996   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
997   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
998   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
999   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1000   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1001   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
810   PORT_INCLUDE( common )
1002811
1003   PORT_START("P2")  /* IN2 */
1004   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1005   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1006   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1007   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1008   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1009   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1010   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1011   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1012
1013   PORT_START("SYSTEM")  /* IN0 */
1014   IN0_PORT
1015
1016   PORT_START("DSW1")     /* DSW1 */
1017   DSW1_PORT
1018
1019   PORT_START("DSW0")  /* DSW0 */
812   PORT_START("DSW1")
1020813   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1021814   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1022815   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
1040833INPUT_PORTS_END
1041834
1042835static INPUT_PORTS_START( spatter )
1043   PORT_START("P1")  /* IN1 */
1044   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1045   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1046   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
1047   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1048   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1049   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1050   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1051   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
836   PORT_INCLUDE( common )
1052837
1053   PORT_START("P2")  /* IN2 */
1054   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1055   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1056   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1057   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1058   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1059   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1060   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1061   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1062
1063   PORT_START("SYSTEM")  /* IN0 */
1064   IN0_PORT
1065
1066   PORT_START("DSW1")     /* DSW1 */
1067   DSW1_PORT
1068
1069   PORT_START("DSW0")  /* DSW0 */
838   PORT_START("DSW1")
1070839   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1071840   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1072841   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
1090859INPUT_PORTS_END
1091860
1092861static INPUT_PORTS_START( pitfall2 )
1093   PORT_START("P1")  /* IN1 */
1094   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1095   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1096   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
1097   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1098   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1099   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1100   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1101   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
862   PORT_INCLUDE( common )
1102863
1103   PORT_START("P2")  /* IN2 */
1104   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1105   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1106   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1107   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1108   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1109   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1110   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1111   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1112
1113   PORT_START("SYSTEM")  /* IN0 */
1114   IN0_PORT
1115
1116   PORT_START("DSW1")     /* DSW1 */
1117   DSW1_PORT
1118
1119   PORT_START("DSW0")  /* DSW0 */
864   PORT_START("DSW1")
1120865   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1121866   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1122867   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
1143888INPUT_PORTS_END
1144889
1145890static INPUT_PORTS_START( pitfallu )
1146   PORT_START("P1")  /* IN1 */
1147   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1148   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1149   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
1150   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1151   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1152   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1153   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1154   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
891   PORT_INCLUDE( common )
1155892
1156   PORT_START("P2")  /* IN2 */
1157   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1158   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1159   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1160   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1161   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1162   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1163   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1164   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1165
1166   PORT_START("SYSTEM")  /* IN0 */
1167   IN0_PORT
1168
1169   PORT_START("DSW1")     /* DSW1 */
1170   DSW1_PORT
1171
1172   PORT_START("DSW0")  /* DSW0 */
893   PORT_START("DSW1")  /* DSW0 */
1173894   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1174895   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1175896   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
1195916INPUT_PORTS_END
1196917
1197918static INPUT_PORTS_START( seganinj )
1198   PORT_START("P1")  /* IN1 */
919   PORT_INCLUDE( common )
920
921   PORT_MODIFY("P1")
1199922   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 )
1200   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1201   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
1202   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1203   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1204   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1205   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1206   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1207923
1208   PORT_START("P2")  /* IN2 */
924   PORT_MODIFY("P1")
1209925   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
1210   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1211   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1212   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1213   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1214   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1215   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1216   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1217926
1218   PORT_START("SYSTEM")  /* IN0 */
1219   IN0_PORT
1220
1221   PORT_START("DSW1")     /* DSW1 */
1222   DSW1_PORT
1223
1224   PORT_START("DSW0")  /* DSW0 */
927   PORT_START("DSW1")
1225928   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1226929   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1227930   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
1246949INPUT_PORTS_END
1247950
1248951static INPUT_PORTS_START( imsorry )
1249   PORT_START("P1")  /* IN1 */
1250   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1251   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1252   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
1253   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1254   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1255   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1256   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1257   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
952   PORT_INCLUDE( common )
1258953
1259   PORT_START("P2")  /* IN2 */
1260   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1261   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1262   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1263   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1264   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1265   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1266   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1267   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1268
1269   PORT_START("SYSTEM")  /* IN0 */
1270   IN0_PORT
1271
1272   PORT_START("DSW1")     /* DSW1 */
1273   DSW1_PORT
1274
1275   PORT_START("DSW0")  /* DSW0 */
954   PORT_START("DSW1")
1276955   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1277956   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1278957   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
1296975INPUT_PORTS_END
1297976
1298977static INPUT_PORTS_START( teddybb )
1299   PORT_START("P1")  /* IN1 */
1300   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
978   PORT_INCLUDE( common )
979
980   PORT_MODIFY("P1")
1301981   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
1302982   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
1303   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1304   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1305   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1306   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1307   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1308983
1309   PORT_START("P2")  /* IN2 */
1310   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
984   PORT_MODIFY("P2")
1311985   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1312986   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1313   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1314   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1315   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1316   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1317   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1318987
1319   PORT_START("SYSTEM")  /* IN0 */
1320   IN0_PORT
1321
1322   PORT_START("DSW1")     /* DSW1 */
1323   DSW1_PORT
1324
1325   PORT_START("DSW0")  /* DSW0 */
988   PORT_START("DSW1")
1326989   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1327990   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1328991   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
13461009INPUT_PORTS_END
13471010
13481011static INPUT_PORTS_START( hvymetal )
1349   PORT_START("P1")  /* IN1 */
1350   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1012   PORT_INCLUDE( common )
1013
1014   PORT_MODIFY("P1")
13511015   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
13521016   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
1353   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1354   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1355   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1356   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1357   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
13581017
1359   PORT_START("P2")  /* IN2 */
1360   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1018   PORT_MODIFY("P2")
13611019   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
13621020   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1363   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1364   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1365   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1366   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1367   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
13681021
1369   PORT_START("SYSTEM")  /* IN0 */
1370   IN0_PORT
1371
1372   PORT_START("DSW1")     /* DSW1 */
1373   DSW1_PORT
1374
1375   PORT_START("DSW0")  /* DSW1 */
1022   PORT_START("DSW1")
13761023   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
13771024   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
13781025   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
13981045INPUT_PORTS_END
13991046
14001047static INPUT_PORTS_START( myhero )
1401   PORT_START("P1")  /* IN1 */
1402   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1048   PORT_INCLUDE( common )
1049
1050   PORT_MODIFY("P1")
14031051   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
14041052   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
1405   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1406   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1407   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1408   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1409   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
14101053
1411   PORT_START("P2")  /* IN2 */
1412   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1054   PORT_MODIFY("P2")
14131055   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
14141056   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1415   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1416   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1417   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1418   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1419   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
14201057
1421   PORT_START("SYSTEM")  /* IN0 */
1422   IN0_PORT
1423
1424   PORT_START("DSW1")     /* DSW1 */
1425   DSW1_PORT
1426
1427   PORT_START("DSW0")  /* DSW0 */
1058   PORT_START("DSW1")
14281059   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
14291060   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
14301061   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
14481079INPUT_PORTS_END
14491080
14501081static INPUT_PORTS_START( shtngmst )
1451   PORT_START("P1")  /* IN1 */
1082   PORT_START("P1")
14521083   /*
14531084    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
14541085    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
r3115r3116
14601091    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
14611092    */
14621093
1463   PORT_START("P2")  /* IN2 */
1094   PORT_START("P2")
14641095   /*
14651096    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
14661097    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
r3115r3116
14721103    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
14731104    */
14741105
1475   PORT_START("SYSTEM")  /* IN0 */
1476   IN0_PORT
1106   PORT_START("SYSTEM")
1107   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1108   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1109   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
1110   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
1111   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1112   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1113   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1114   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
14771115
1478   PORT_START("DSW1")  /* DSW1 */
1479   PORT_DIPNAME( 0x01, 0x01, "DSW1" )
1116   PORT_START("DSW2")
1117   PORT_DIPNAME( 0x01, 0x01, "DSW2" )
14801118   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
14811119   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14821120   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
r3115r3116
15011139   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
15021140   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
15031141
1504   PORT_START("DSW0")     /* DSW0 */
1505   DSW1_PORT
1142   PORT_START("DSW1")
1143   COINAGE_PORT
15061144
15071145   PORT_START("TRIGGER")  /* trigger is in here */
15081146   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
15481186
15491187
15501188static INPUT_PORTS_START( chplft )
1551   PORT_START("P1")  /* IN1 */
1552   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1553   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1554   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
1555   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1556   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1557   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1558   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1559   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1189   PORT_INCLUDE( common )
15601190
1561   PORT_START("P2")  /* IN2 */
1562   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1563   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1564   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1565   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1566   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1567   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1568   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1569   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1570
1571   PORT_START("SYSTEM")  /* IN0 */
1572   IN0_PORT
1573
1574   PORT_START("DSW1")  /* DSW1 */
1191   PORT_MODIFY("DSW2")
15751192   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW B:1")
15761193   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
15771194   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
15961213   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
15971214   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
15981215
1599   PORT_START("DSW0")     /* DSW0 */
1600   DSW1_PORT
1216   PORT_START("DSW1")
1217   COINAGE_PORT
16011218INPUT_PORTS_END
16021219
16031220static INPUT_PORTS_START( 4dwarrio )
1604   PORT_START("P1")  /* IN1 */
1605   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1606   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1607   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
1608   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1609   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1610   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1611   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1612   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1221   PORT_INCLUDE( common )
16131222
1614   PORT_START("P2")  /* IN2 */
1615   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1616   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1617   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1618   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1619   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1620   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1621   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1622   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1623
1624   PORT_START("SYSTEM")  /* IN0 */
1625   IN0_PORT
1626
1627   PORT_START("DSW1")     /* DSW1 */
1628   DSW1_PORT
1629
1630   PORT_START("DSW0")  /* DSW0 */
1223   PORT_START("DSW1")
16311224   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
16321225   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
16331226   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
16521245INPUT_PORTS_END
16531246
16541247static INPUT_PORTS_START( brain )
1655   PORT_START("P1")  /* IN1 */
1656   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1657   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1658   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
1659   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1660   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1661   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1662   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1663   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1248   PORT_INCLUDE( common )
16641249
1665   PORT_START("P2")  /* IN2 */
1666   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1667   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1668   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1669   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1670   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1671   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1672   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1673   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1674
1675   PORT_START("SYSTEM")  /* IN0 */
1676   IN0_PORT
1677
1678   PORT_START("DSW1")     /* DSW1 */
1679   DSW1_PORT
1680
1681   PORT_START("DSW0")  /* DSW0 */
1250   PORT_START("DSW1")
16821251   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
16831252   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
16841253   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
17051274INPUT_PORTS_END
17061275
17071276static INPUT_PORTS_START( gardia )
1708   PORT_START("P1")  /* IN1 */
1709   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1710   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1711   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
1712   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1713   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1714   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1715   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1716   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1277   PORT_INCLUDE( common )
17171278
1718   PORT_START("P2")  /* IN2 */
1719   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1720   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1721   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1722   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1723   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1724   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1725   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1726   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1727
1728   PORT_START("SYSTEM")  /* IN0 */
1729   IN0_PORT
1730
1731   PORT_START("DSW1")     /* DSW1 */
1732   DSW1_PORT
1733
1734   PORT_START("DSW0")  /* DSW0 */
1279   PORT_START("DSW1")
17351280   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
17361281   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
17371282   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
r3115r3116
17571302INPUT_PORTS_END
17581303
17591304static INPUT_PORTS_START( raflesia )
1760   PORT_START("P1")  /* IN1 */
1761   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1762   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1763   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
1764   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1765   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1766   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1767   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1768   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1305   PORT_INCLUDE( common )
17691306
1770   PORT_START("P2")  /* IN2 */
1771   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1772   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1773   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1774   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1775   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1776   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1777   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1778   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1779
1780   PORT_START("SYSTEM")  /* IN0 */
1781   IN0_PORT
1782
1783   PORT_START("DSW1")     /* DSW1 */
1784   DSW1_PORT
1785
1786   PORT_START("DSW0")  /* DSW0 */
1307   PORT_START("DSW1")
17871308   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
17881309   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
17891310   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
18071328INPUT_PORTS_END
18081329
18091330static INPUT_PORTS_START( wboy )
1810   PORT_START("P1")  /* IN1 */
1811   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1331   PORT_INCLUDE( common )
1332
1333   PORT_MODIFY("P1")
18121334   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
18131335   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
1814   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
18151336   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
18161337   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
18171338   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
18181339   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
18191340
1820   PORT_START("P2")  /* IN2 */
1821   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1341   PORT_MODIFY("P2")
18221342   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
18231343   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1824   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
18251344   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
18261345   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
18271346   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
18281347   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
18291348
1830   PORT_START("SYSTEM")  /* IN0 */
1831   IN0_PORT
1832
1833   PORT_START("DSW1")     /* DSW1 */
1834   DSW1_PORT
1835
1836   PORT_START("DSW0")  /* DSW0 */
1349   PORT_START("DSW1")
18371350   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW B:1")
18381351   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
18391352   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
18601373INPUT_PORTS_END
18611374
18621375static INPUT_PORTS_START( wboy3 )
1863   PORT_START("P1")  /* IN1 */
1864   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1865   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
1866   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
1867   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1868   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
1869   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
1870   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1871   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
1376   PORT_INCLUDE( wboy )
18721377
1873   PORT_START("P2")  /* IN2 */
1874   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1875   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1876   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1877   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1878   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
1879   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
1880   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1881   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1882
1883   PORT_START("SYSTEM")  /* IN0 */
1884   IN0_PORT
1885
1886   PORT_START("DSW1")     /* DSW1 */
1887   DSW1_PORT
1888
1889   PORT_START("DSW0")  /* DSW0 */
1890   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW B:1")
1891   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1892   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
1893   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW B:2")
1894   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
1895   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1378   PORT_MODIFY("DSW1")  /* DSW0 */
18961379   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW B:3,4")
18971380   PORT_DIPSETTING(   0x0c, "1" )
18981381   PORT_DIPSETTING(   0x08, "2" )
18991382   PORT_DIPSETTING(   0x04, "3" )
19001383   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
1901   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW B:5")
1902   PORT_DIPSETTING(   0x10, "30k 100k 170k 240k" )
1903   PORT_DIPSETTING(   0x00, "30k 120k 210k 300k" )
1904   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW B:6")
1905   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
1906   PORT_DIPSETTING(   0x20, DEF_STR( Yes ) )
1907   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW B:7")
1908   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
1909   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1910   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW B:8")
1911   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
1912   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
19131384INPUT_PORTS_END
19141385
19151386static INPUT_PORTS_START( wboysys2 )
1916   PORT_START("P1")  /* IN1 */
1917   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1387   PORT_INCLUDE( common )
1388
1389   PORT_MODIFY("P1")
19181390   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
19191391   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
1920   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
19211392   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
19221393   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
19231394   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
19241395   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
19251396
1926   PORT_START("P2")  /* IN2 */
1927   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1397   PORT_MODIFY("P2")
19281398   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
19291399   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1930   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
19311400   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
19321401   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
19331402   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
19341403   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
19351404
1936   PORT_START("SYSTEM")  /* IN0 */
1937   IN0_PORT
1938
1939   PORT_START("DSW1")  /* DSW0 */
1405   PORT_MODIFY("DSW2")
19401406   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW B:1")
19411407   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
19421408   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
19611427   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
19621428   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
19631429
1964   PORT_START("DSW0")     /* DSW1 */
1965   DSW1_PORT
1430   PORT_START("DSW1")
1431   COINAGE_PORT
19661432INPUT_PORTS_END
19671433
19681434/* same as wboy, additional Energy Consumption switch */
19691435static INPUT_PORTS_START( wbdeluxe )
1970   PORT_START("P1")  /* IN1 */
1971   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Has to be 0 otherwise the game resets */
1972                                    /* if you die after level 1. */
1973   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
1974   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
1975   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1976   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
1977   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
1978   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1979   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
1436   PORT_INCLUDE( wboy )
19801437
1981   PORT_START("P2")  /* IN2 */
1982   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1983   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1984   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1985   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1986   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
1987   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
1988   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1989   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1990
1991   PORT_START("SYSTEM")  /* IN0 */
1992   IN0_PORT
1993
1994   PORT_START("DSW1")     /* DSW1 */
1995   DSW1_PORT
1996
1997   PORT_START("DSW0")  /* DSW0 */
1998   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW B:1")
1999   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
2000   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
2001   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW B:2")
2002   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
2003   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
2004   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW B:3,4")
2005   PORT_DIPSETTING(   0x0c, "3" )
2006   PORT_DIPSETTING(   0x08, "4" )
2007   PORT_DIPSETTING(   0x04, "5" )
2008   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
2009   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW B:5")
2010   PORT_DIPSETTING(   0x10, "30k 100k 170k 240k" )
2011   PORT_DIPSETTING(   0x00, "30k 120k 210k 300k" )
2012   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW B:6")
2013   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
2014   PORT_DIPSETTING(   0x20, DEF_STR( Yes ) )
2015   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW B:7")
2016   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
2017   PORT_DIPSETTING(   0x00, DEF_STR( Hard ) )
1438   PORT_MODIFY("P1")
1439   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* Has to be 0 otherwise the game resets */
1440                                       /* if you die after level 1. */
1441   PORT_MODIFY("DSW1")
20181442   PORT_DIPNAME( 0x80, 0x00, "Energy Consumption" ) PORT_DIPLOCATION("SW B:8")
20191443   PORT_DIPSETTING(   0x00, "Slow" )
20201444   PORT_DIPSETTING(   0x80, "Fast" )
20211445INPUT_PORTS_END
20221446
20231447static INPUT_PORTS_START( wboyu )
2024   PORT_START("P1")  /* IN1 */
2025   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2026   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
2027   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
2028   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2029   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
2030   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
2031   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
2032   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
1448   PORT_INCLUDE( wboy )
20331449
2034   PORT_START("P2")  /* IN2 */
2035   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2036   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
2037   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
2038   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2039   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* down - unused */
2040   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* up - unused */
2041   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
2042   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
2043
2044   PORT_START("SYSTEM")  /* IN0 */
2045   IN0_PORT
2046
2047   PORT_START("DSW1")  /* DSW0 */
1450   PORT_MODIFY("DSW2")
20481451   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
20491452   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
20501453   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
20691472   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
20701473   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
20711474
2072   PORT_START("DSW0")     /* DSW1 */
1475   PORT_MODIFY("DSW1")
20731476   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
20741477   PORT_DIPSETTING(   0x04, DEF_STR( 4C_1C ) )
20751478   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
r3115r3116
21411544*/
21421545
21431546static INPUT_PORTS_START( blockgal )
2144   PORT_START("P1")  /* IN1 */
1547   PORT_START("P1")
21451548   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(60) PORT_KEYDELTA(15) PORT_REVERSE
21461549
2147   PORT_START("P2")  /* IN2 */
1550   PORT_START("P2")
21481551   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(60) PORT_KEYDELTA(15) PORT_REVERSE PORT_COCKTAIL
21491552
2150   PORT_START("SYSTEM")  /* IN0 */
1553   PORT_START("SYSTEM")
21511554   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
21521555   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
21531556   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
21571560   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
21581561   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
21591562
2160   PORT_START("DSW1")  /* DSW0 */
1563   PORT_START("DSW2")
21611564   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
21621565   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
21631566   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
21811584   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
21821585   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
21831586
2184   PORT_START("DSW0")     /* DSW1 */
2185   DSW1_PORT
1587   PORT_START("DSW1")
1588   COINAGE_PORT
21861589INPUT_PORTS_END
21871590
21881591static INPUT_PORTS_START( tokisens )
2189   PORT_START("P1")  /* IN1 */
2190   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2191   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
2192   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
2193   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2194   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
2195   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
2196   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
2197   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1592   PORT_INCLUDE( common )
21981593
2199   PORT_START("P2")  /* IN2 */
2200   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2201   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
2202   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
2203   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2204   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
2205   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
2206   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
2207   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
2208
2209   PORT_START("SYSTEM")  /* IN0 */
2210   IN0_PORT
2211
2212   PORT_START("DSW1")  /* DSW0 */
1594   PORT_MODIFY("DSW2")
22131595   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
22141596   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
22151597   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
22341616   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
22351617   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
22361618
2237   PORT_START("DSW0")     /* DSW1 */
2238   DSW1_PORT
1619   PORT_START("DSW1")
1620   COINAGE_PORT
22391621INPUT_PORTS_END
22401622
22411623static INPUT_PORTS_START( wbml )
2242   PORT_START("P1")  /* IN1 */
2243   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2244   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
2245   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
2246   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2247   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
2248   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
2249   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
2250   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1624   PORT_INCLUDE( common )
22511625
2252   PORT_START("P2")  /* IN2 */
2253   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2254   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
2255   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
2256   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2257   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
2258   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
2259   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
2260   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
2261
2262   PORT_START("SYSTEM")  /* IN0 */
2263   IN0_PORT
2264
2265   PORT_START("DSW1")  /* DSW1 */
1626   PORT_MODIFY("DSW2")
22661627   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
22671628   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
22681629   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
r3115r3116
22871648   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
22881649   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
22891650
2290   PORT_START("DSW0")     /* DSW0 */
2291   DSW1_PORT
1651   PORT_START("DSW1")
1652   COINAGE_PORT
22921653INPUT_PORTS_END
22931654
22941655static INPUT_PORTS_START( noboranb )
2295   PORT_START("P1")  /* IN1 */
2296   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1656   PORT_INCLUDE( common )
1657
1658   PORT_MODIFY("P1")
22971659   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )            // shot
22981660   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )            // fly
2299   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2300   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
2301   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
2302   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
2303   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
23041661
2305   PORT_START("P2")  /* IN2 */
2306   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1662   PORT_MODIFY("P2")
23071663   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL      // shot
23081664   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL      // fly
2309   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2310   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
2311   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
2312   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
2313   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
23141665
2315   PORT_START("SYSTEM")  /* IN0 */
2316   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2317   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2318   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
2319   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
2320   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
2321   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2322   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2323   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2324
2325   PORT_START("DSW1")  /* DSW1 */
1666   PORT_MODIFY("DSW2")
23261667   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
23271668   PORT_DIPSETTING(   0x00, DEF_STR( 2C_1C ) )
23281669   PORT_DIPSETTING(   0x03, DEF_STR( 1C_1C ) )
r3115r3116
23451686   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
23461687   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
23471688
2348   PORT_START("DSW0")  /* DSW0 */
1689   PORT_START("DSW1")
23491690   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
23501691   PORT_DIPSETTING(   0x02, "2" )
23511692   PORT_DIPSETTING(   0x03, "3" )
r3115r3116
23771718
23781719*/
23791720static INPUT_PORTS_START( ufosensi )
2380   PORT_START("P1")  /* IN1 */
1721   PORT_INCLUDE( common )
1722
1723   PORT_MODIFY("P1")
23811724   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 )
2382   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
2383   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
2384   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2385   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
2386   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
2387   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
2388   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
23891725
2390   PORT_START("P2")  /* IN2 */
1726   PORT_MODIFY("P2")
23911727   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
2392   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
2393   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
2394   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2395   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
2396   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
2397   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
2398   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
23991728
2400   PORT_START("SYSTEM")  /* IN0 */
2401   IN0_PORT
2402
2403   PORT_START("DSW1")  /* DSW1 */
1729   PORT_MODIFY("DSW2")
24041730   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) )
24051731   PORT_DIPSETTING(   0x00, DEF_STR( Easy ) )
24061732   PORT_DIPSETTING(   0x01, DEF_STR( Normal ) )
r3115r3116
24241750   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
24251751   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
24261752
2427   PORT_START("DSW0")     /* DSW0 */
1753   PORT_START("DSW1")
24281754   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
24291755   PORT_DIPSETTING(   0x07, DEF_STR( 4C_1C ) )
24301756   PORT_DIPSETTING(   0x08, DEF_STR( 3C_1C ) )
src/mame/drivers/powerins.c
r3115r3116
8787
8888static ADDRESS_MAP_START( powerins_readmem, ADDRESS_SPACE_PROGRAM, 16 )
8989   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM            )   // ROM
90   AM_RANGE(0x100000, 0x100001) AM_READ(input_port_0_word_r      )   // Coins + Start Buttons
91   AM_RANGE(0x100002, 0x100003) AM_READ(input_port_1_word_r      )   // P1 + P2
92   AM_RANGE(0x100008, 0x100009) AM_READ(input_port_2_word_r      )   // DSW 1
93   AM_RANGE(0x10000a, 0x10000b) AM_READ(input_port_3_word_r      )   // DSW 2
94   AM_RANGE(0x10003e, 0x10003f) AM_READ(okim6295_status_0_lsb_r   )   // OKI Status (used by powerina)
90   AM_RANGE(0x100000, 0x100001) AM_READ_PORT("SYSTEM")
91   AM_RANGE(0x100002, 0x100003) AM_READ_PORT("P1_P2")
92   AM_RANGE(0x100008, 0x100009) AM_READ_PORT("DSW1")
93   AM_RANGE(0x10000a, 0x10000b) AM_READ_PORT("DSW2")
94   AM_RANGE(0x10003e, 0x10003f) AM_READ(okim6295_status_0_lsb_r)   // OKI Status (used by powerina)
9595   AM_RANGE(0x120000, 0x120fff) AM_READ(SMH_RAM            )   // Palette
9696   AM_RANGE(0x130000, 0x130007) AM_READ(SMH_RAM            )   // VRAM 0 Control
9797   AM_RANGE(0x140000, 0x143fff) AM_READ(SMH_RAM            )   // VRAM 0
r3115r3116
103103   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM                        )   // ROM
104104   AM_RANGE(0x100014, 0x100015) AM_WRITE(powerins_flipscreen_w               )   // Flip Screen
105105   AM_RANGE(0x100016, 0x100017) AM_WRITE(SMH_NOP                        )   // ? always 1
106   AM_RANGE(0x100018, 0x100019) AM_WRITE(powerins_tilebank_w                  )   // Tiles Banking (VRAM 0)
106   AM_RANGE(0x100018, 0x100019) AM_WRITE(powerins_tilebank_w               )   // Tiles Banking (VRAM 0)
107107   AM_RANGE(0x10001e, 0x10001f) AM_WRITE(powerins_soundlatch_w               )   // Sound Latch
108   AM_RANGE(0x100030, 0x100031) AM_WRITE(powerins_okibank_w                  )   // Sound
108   AM_RANGE(0x100030, 0x100031) AM_WRITE(powerins_okibank_w               )   // Sound
109109   AM_RANGE(0x10003e, 0x10003f) AM_WRITE(okim6295_data_0_lsb_w               )   // used by powerina
110110   AM_RANGE(0x120000, 0x120fff) AM_WRITE(powerins_paletteram16_w) AM_BASE(&paletteram16   )   // Palette
111   AM_RANGE(0x130000, 0x130007) AM_WRITE(SMH_RAM) AM_BASE(&powerins_vctrl_0         )   // VRAM 0 Control
111   AM_RANGE(0x130000, 0x130007) AM_WRITE(SMH_RAM) AM_BASE(&powerins_vctrl_0   )   // VRAM 0 Control
112112   AM_RANGE(0x140000, 0x143fff) AM_WRITE(powerins_vram_0_w) AM_BASE(&powerins_vram_0      )   // VRAM 0
113113   AM_RANGE(0x170000, 0x170fff) AM_WRITE(powerins_vram_1_w) AM_BASE(&powerins_vram_1      )   // VRAM 1
114114   AM_RANGE(0x171000, 0x171fff) AM_WRITE(powerins_vram_1_w                  )   // Mirror of VRAM 1?
115   AM_RANGE(0x180000, 0x18ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16               )   // RAM + Sprites
115   AM_RANGE(0x180000, 0x18ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16         )   // RAM + Sprites
116116ADDRESS_MAP_END
117117
118118/* In powerina there is a hidden test mode screen because it's a bootleg
r3115r3116
157157***************************************************************************/
158158
159159static INPUT_PORTS_START( powerins )
160   PORT_START("SYSTEM")   // IN0 - $100000 - Coins
161   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1    )
162   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2    )
160   PORT_START("SYSTEM")   /* $100000 */
161   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
162   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
163163   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
164   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1   )
165   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START2   )
164   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1 )
165   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START2 )
166166   PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW )
167   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN  )
168   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
167   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
168   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
169169
170   PORT_START("P1_P2")   // IN1 - $100002 - Player 1 & 2
170   PORT_START("P1_P2")      /* $100002 */
171171   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
172   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT    ) PORT_PLAYER(1)
172   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
173173   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
174174   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
175175   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
r3115r3116
178178   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
179179
180180   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
181   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT    ) PORT_PLAYER(2)
181   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
182182   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
183183   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
184184   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
r3115r3116
186186   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
187187   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
188188
189   PORT_START("DSW1")   // IN2 - $100008 - DSW 1
189   PORT_START("DSW1")      /* $100008 */
190190   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Free_Play ) )      PORT_DIPLOCATION("SW1:8")
191191   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
192192   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r3115r3116
194194   PORT_DIPSETTING(      0x0008, DEF_STR( 4C_1C ) )
195195   PORT_DIPSETTING(      0x0004, DEF_STR( 3C_1C ) )
196196   PORT_DIPSETTING(      0x000c, DEF_STR( 2C_1C ) )
197  PORT_DIPSETTING(      0x0000, "2 Coins/1 Credit (1 to continue)" )
197   PORT_DIPSETTING(      0x0000, "2 Coins/1 Credit (1 to continue)" )
198198   PORT_DIPSETTING(      0x000e, DEF_STR( 1C_1C ) )
199199   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
200200   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_3C ) )
r3115r3116
203203   PORT_DIPSETTING(      0x0040, DEF_STR( 4C_1C ) )
204204   PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ) )
205205   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_1C ) )
206  PORT_DIPSETTING(      0x0000, "2 Coins/1 Credit (1 to continue)" )
206   PORT_DIPSETTING(      0x0000, "2 Coins/1 Credit (1 to continue)" )
207207   PORT_DIPSETTING(      0x0070, DEF_STR( 1C_1C ) )
208208   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
209209   PORT_DIPSETTING(      0x0050, DEF_STR( 1C_3C ) )
r3115r3116
212212   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
213213   PORT_DIPSETTING(      0x0000, DEF_STR( On )  )
214214
215   PORT_START("DSW2")   // IN3 - $10000a - DSW 2
215   PORT_START("DSW2")      /* $10000a */
216216   PORT_DIPNAME( 0x0001, 0x0001, "Coin Chutes" )             PORT_DIPLOCATION("SW2:8")
217217   PORT_DIPSETTING(      0x0001, "1 Chute" )
218218   PORT_DIPSETTING(      0x0000, "2 Chutes" )
src/mame/drivers/quizo.c
r3115r3116
125125
126126static ADDRESS_MAP_START( portmap, ADDRESS_SPACE_IO, 8 )
127127   ADDRESS_MAP_GLOBAL_MASK(0xff)
128   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
129   AM_RANGE(0x10, 0x10) AM_READ(input_port_1_r)
130   AM_RANGE(0x40, 0x40) AM_READ(input_port_2_r)
128   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
129   AM_RANGE(0x10, 0x10) AM_READ_PORT("IN1")
130   AM_RANGE(0x40, 0x40) AM_READ_PORT("IN2")
131131   AM_RANGE(0x50, 0x50) AM_WRITE(ay8910_control_port_0_w)
132132   AM_RANGE(0x51, 0x51) AM_WRITE(ay8910_write_port_0_w)
133133   AM_RANGE(0x60, 0x60) AM_WRITE(port60_w)
src/mame/drivers/niyanpai.c
r3115r3116
260260   return ((dipsw_a << 8) | dipsw_b);
261261}
262262
263static READ16_HANDLER( niyanpai_inputport_0_r )
264{
265   return ((input_port_read(machine, "P1") << 8) | (input_port_read(machine, "P2") << 0));
266}
267
268static READ16_HANDLER( niyanpai_inputport_1_r )
269{
270   return ((input_port_read(machine, "SYSTEM") << 8) | 0xff);
271}
272
273263static READ16_HANDLER( musobana_inputport_0_r )
274264{
275265   int portdata;
276266
277267   switch ((musobana_inputport ^ 0xff00) >> 8)
278268   {
279      case 0x01:   portdata = ((input_port_read(machine, "KEY0") << 8) | (input_port_read(machine, "KEY5"))); break;
280      case 0x02:   portdata = ((input_port_read(machine, "KEY1") << 8) | (input_port_read(machine, "KEY6"))); break;
281      case 0x04:   portdata = ((input_port_read(machine, "KEY2") << 8) | (input_port_read(machine, "KEY7"))); break;
282      case 0x08:   portdata = ((input_port_read(machine, "KEY3") << 8) | (input_port_read(machine, "KEY8"))); break;
283      case 0x10:   portdata = ((input_port_read(machine, "KEY4") << 8) | (input_port_read(machine, "KEY9"))); break;
284      default:   portdata = (((input_port_read(machine, "KEY0") << 8) | (input_port_read(machine, "KEY5")))) & (((input_port_read(machine, "KEY1") << 8) | (input_port_read(machine, "KEY6"))))
285                        & (((input_port_read(machine, "KEY2") << 8) | (input_port_read(machine, "KEY7")))) & (((input_port_read(machine, "KEY3") << 8) | (input_port_read(machine, "KEY8"))))
286                        & (((input_port_read(machine, "KEY4") << 8) | (input_port_read(machine, "KEY9")))); break;
269      case 0x01:   portdata = input_port_read(machine, "KEY0"); break;
270      case 0x02:   portdata = input_port_read(machine, "KEY1"); break;
271      case 0x04:   portdata = input_port_read(machine, "KEY2"); break;
272      case 0x08:   portdata = input_port_read(machine, "KEY3"); break;
273      case 0x10:   portdata = input_port_read(machine, "KEY4"); break;
274      default:   portdata = input_port_read(machine, "KEY0") & input_port_read(machine, "KEY1") & input_port_read(machine, "KEY2")
275                        & input_port_read(machine, "KEY3") & input_port_read(machine, "KEY4"); break;
287276   }
288277
289278   return (portdata);
290279}
291280
292static READ16_HANDLER( musobana_inputport_1_r )
281static CUSTOM_INPUT( musobana_outcoin_flag_r )
293282{
294283   // tmp68301_parallel_interface[0x05]
295284   //  bit 0   coin counter
296285   //  bit 2   motor on
297286   //  bit 3   coin lock
298287
299   if (tmp68301_parallel_interface_r(machine, 0x0005, 0x00ff) & 0x0004) musobana_outcoin_flag ^= 1;
288   if (tmp68301_parallel_interface_r(field->port->machine, 0x0005, 0x00ff) & 0x0004) musobana_outcoin_flag ^= 1;
300289   else musobana_outcoin_flag = 1;
301290
302   return (((input_port_read(machine, "SYSTEM") & 0xdf) | ((musobana_outcoin_flag & 0x01) << 5)) << 8);
291   return musobana_outcoin_flag & 0x01;
303292}
304293
305294static WRITE16_HANDLER ( musobana_inputport_w )
r3115r3116
322311   AM_RANGE(0x240800, 0x240803) AM_READ(niyanpai_blitter_2_r)
323312
324313   AM_RANGE(0x280000, 0x280001) AM_READ(niyanpai_dipsw_r)
325   AM_RANGE(0x280200, 0x280201) AM_READ(niyanpai_inputport_0_r)
326   AM_RANGE(0x280400, 0x280401) AM_READ(niyanpai_inputport_1_r)
314   AM_RANGE(0x280200, 0x280201) AM_READ_PORT("P1_P2")
315   AM_RANGE(0x280400, 0x280401) AM_READ_PORT("SYSTEM")
327316
328317   AM_RANGE(0xfffc00, 0xfffc0f) AM_READ(tmp68301_address_decoder_r)
329318   AM_RANGE(0xfffc80, 0xfffc9f) AM_READ(tmp68301_interrupt_controller_r)
r3115r3116
383372
384373   AM_RANGE(0x280000, 0x280001) AM_READ(niyanpai_dipsw_r)
385374   AM_RANGE(0x280200, 0x280201) AM_READ(musobana_inputport_0_r)
386   AM_RANGE(0x280400, 0x280401) AM_READ(musobana_inputport_1_r)
375   AM_RANGE(0x280400, 0x280401) AM_READ_PORT("SYSTEM")
387376
388377   AM_RANGE(0xfffc00, 0xfffc0f) AM_READ(tmp68301_address_decoder_r)
389378   AM_RANGE(0xfffc80, 0xfffc9f) AM_READ(tmp68301_interrupt_controller_r)
r3115r3116
445434
446435   AM_RANGE(0x280000, 0x280001) AM_READ(niyanpai_dipsw_r)
447436   AM_RANGE(0x280200, 0x280201) AM_READ(musobana_inputport_0_r)
448   AM_RANGE(0x280400, 0x280401) AM_READ(musobana_inputport_1_r)
437   AM_RANGE(0x280400, 0x280401) AM_READ_PORT("SYSTEM")
449438
450439   AM_RANGE(0xfffc00, 0xfffc0f) AM_READ(tmp68301_address_decoder_r)
451440   AM_RANGE(0xfffc80, 0xfffc9f) AM_READ(tmp68301_interrupt_controller_r)
r3115r3116
538527
539528
540529static INPUT_PORTS_START( niyanpai )
541   PORT_START("DSWA")   /* (0) DIPSW-A */
530   PORT_START("SYSTEM")
531   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )         // ?
532   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
533   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )         // COIN2
534   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START3 )         // CREDIT CLEAR
535   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START2 )         // START2
536   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE2 )         // ANALYZER
537   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_START1 )         // START1
538   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )         // ?
539    PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )               // TEST
540
541   PORT_START("P1_P2")
542   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
543   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
544   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
545   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
546   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
547   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
548   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
549   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
550   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
551   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
552   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
553   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
554   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
555   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
556   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
557   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
558
559   PORT_START("DSWA")
542560   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
543561   PORT_DIPSETTING(    0x03, "1" )
544562   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
562580   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
563581   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
564582
565   PORT_START("DSWB")   /* (1) DIPSW-B */
583   PORT_START("DSWB")
566584   PORT_DIPNAME( 0x01, 0x00, "Nudity" )
567585   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
568586   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
570588   PORT_DIPNAME( 0x80, 0x80, "Graphic ROM Test" )
571589   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
572590   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
591INPUT_PORTS_END
573592
574   PORT_START("SYSTEM")   /* (2) PORT 0 */
575   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
576   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )         // COIN2
577   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 )         // CREDIT CLEAR
578   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )         // START2
579   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
580   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )         // START1
581   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )      // ?
582    PORT_SERVICE( 0x80, IP_ACTIVE_LOW )               // TEST
593INPUT_PORTS_START( nbmjctrl_16 )
594   PORT_START("KEY0")
595   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START2 )
596   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2)
597   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2)
598   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2)
599   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2)
600   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2)
601   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
602   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
603   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
604   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
605   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_M )
606   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_I )
607   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_E )
608   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_A )
609   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
610   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
583611
584   PORT_START("P1")   /* (3) PLAYER-1 */
585   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
586   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
587   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
588   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
589   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
590   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
591   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
592   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
612   PORT_START("KEY1")
613   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2)
614   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2)
615   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2)
616   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2)
617   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2)
618   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2)
619   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
620   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
621   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
622   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
623   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_N )
624   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_J )
625   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_F )
626   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_B )
627   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
628   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
593629
594   PORT_START("P2")   /* (4) PLAYER-2 */
595   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
596   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
597   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
598   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
599   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
600   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
601   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
602   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
603INPUT_PORTS_END
630   PORT_START("KEY2")
631   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
632   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2)
633   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2)
634   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2)
635   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2)
636   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2)
637   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
638   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
639   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
640   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
641   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
642   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_K )
643   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_G )
644   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_C )
645   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
646   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
604647
605static INPUT_PORTS_START( musobana )
648   PORT_START("KEY3")
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_MAHJONG_PON ) PORT_PLAYER(2)
652   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2)
653   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2)
654   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2)
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_UNKNOWN )
658   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
659   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
660   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_L )
661   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_H )
662   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_D )
663   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
664   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
606665
607   // I don't have manual for this game.
666   PORT_START("KEY4")
667   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2)
668   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_PLAYER(2)
669   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2)
670   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2)
671   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2)
672   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2)
673   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
674   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
675   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )
676   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )
677   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
678   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )
679   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )
680   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )
681   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
682   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
683INPUT_PORTS_END
608684
609   PORT_START("DSWA")   /* (0) DIPSW-A */
685static INPUT_PORTS_START( musobana )   // I don't have manual for this game.
686   PORT_START("DSWA")
610687   PORT_DIPNAME( 0x03, 0x03, "Game Out" )
611688   PORT_DIPSETTING(    0x03, "90% (Easy)" )
612689   PORT_DIPSETTING(    0x02, "80%" )
r3115r3116
630707   PORT_DIPSETTING(    0x80, "Medal Type" )
631708   PORT_DIPSETTING(    0x00, "Credit Type" )
632709
633   PORT_START("DSWB")   /* (1) DIPSW-B */
710   PORT_START("DSWB")
634711   PORT_DIPNAME( 0x03, 0x03, "Bet Min" )
635712   PORT_DIPSETTING(    0x03, "1" )
636713   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
654731   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
655732   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
656733
657   PORT_START("SYSTEM")   /* (2) PORT 0 */
658   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
659   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )         // COIN2
660   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 )         // CREDIT CLEAR
661   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
662   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
663   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )         // OUT COIN
664   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
665    PORT_SERVICE( 0x80, IP_ACTIVE_LOW )               // TEST
734   PORT_START("SYSTEM")
735   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
736   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )         // COIN2
737   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START3 )         // CREDIT CLEAR
738   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE3 )         // MEMORY RESET
739   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE2 )         // ANALYZER
740   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(musobana_outcoin_flag_r, NULL)   // OUT COIN
741   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
742    PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )               // TEST
666743
667   PORT_INCLUDE( nbmjcontrols )
744   PORT_INCLUDE( nbmjctrl_16 )
668745INPUT_PORTS_END
669746
670static INPUT_PORTS_START( 4psimasy )
671
672   // I don't have manual for this game.
673
674   PORT_START("DSWA")   /* (0) DIPSW-A */
747static INPUT_PORTS_START( 4psimasy )   // I don't have manual for this game.
748   PORT_START("DSWA")
675749   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
676750   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
677751   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
697771   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
698772   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
699773
700   PORT_START("DSWB")   /* (1) DIPSW-B */
774   PORT_START("DSWB")
701775   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
702776   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
703777   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
723797   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
724798   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
725799
726   PORT_START("SYSTEM")   /* (2) PORT 0 */
727   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
728   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )         // COIN2
729   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 )         // CREDIT CLEAR
730   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
731   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
732   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )         // OUT COIN
733   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
734    PORT_SERVICE( 0x80, IP_ACTIVE_LOW )               // TEST
800   PORT_START("SYSTEM")
801   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
802   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )         // COIN2
803   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START3 )         // CREDIT CLEAR
804   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE3 )         // MEMORY RESET
805   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE2 )         // ANALYZER
806   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(musobana_outcoin_flag_r, NULL)   // OUT COIN
807   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
808    PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )               // TEST
735809
736   PORT_INCLUDE( nbmjcontrols )
810   PORT_INCLUDE( nbmjctrl_16 )
737811INPUT_PORTS_END
738812
739static INPUT_PORTS_START( mhhonban )
740
741   // I don't have manual for this game.
742
743   PORT_START("DSWA")   /* (0) DIPSW-A */
813static INPUT_PORTS_START( mhhonban )   // I don't have manual for this game.
814   PORT_START("DSWA")
744815   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
745816   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
746817   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
766837   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
767838   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
768839
769   PORT_START("DSWB")   /* (1) DIPSW-B */
840   PORT_START("DSWB")
770841   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
771842   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
772843   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
792863   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
793864   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
794865
795   PORT_START("SYSTEM")   /* (2) PORT 0 */
796   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
797   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )         // COIN2
798   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 )         // CREDIT CLEAR
799   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
800   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
801   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )         // OUT COIN
802   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
803    PORT_SERVICE( 0x80, IP_ACTIVE_LOW )               // TEST
866   PORT_START("SYSTEM")
867   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
868   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )         // COIN2
869   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START3 )         // CREDIT CLEAR
870   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE3 )         // MEMORY RESET
871   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE2 )         // ANALYZER
872   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(musobana_outcoin_flag_r, NULL)   // OUT COIN
873   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
874    PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )               // TEST
804875
805   PORT_INCLUDE( nbmjcontrols )
876   PORT_INCLUDE( nbmjctrl_16 )
806877INPUT_PORTS_END
807878
808879
src/mame/drivers/bfm_sc2.c
r3115r3116
356356
357357      for ( i = 0; i < 6; i++)
358358      {
359         Stepper_reset_position(i);
360         if ( Stepper_optic_state(i) ) pattern |= 1<<i;
359         stepper_reset_position(i);
360         if ( stepper_optic_state(i) ) pattern |= 1<<i;
361361      }
362362
363363      optic_pattern = pattern;
r3115r3116
567567{
568568   reel34_latch = data;
569569
570   if ( Stepper_update(2, data   ) ) reel_changed |= 0x04;
571   if ( Stepper_update(3, data>>4) ) reel_changed |= 0x08;
570   if ( stepper_update(2, data   ) ) reel_changed |= 0x04;
571   if ( stepper_update(3, data>>4) ) reel_changed |= 0x08;
572572
573   if ( Stepper_optic_state(2) ) optic_pattern |=  0x04;
573   if ( stepper_optic_state(2) ) optic_pattern |=  0x04;
574574   else                          optic_pattern &= ~0x04;
575   if ( Stepper_optic_state(3) ) optic_pattern |=  0x08;
575   if ( stepper_optic_state(3) ) optic_pattern |=  0x08;
576576   else                          optic_pattern &= ~0x08;
577577
578578   draw_reel((2));
r3115r3116
585585{
586586   reel56_latch = data;
587587
588   if ( Stepper_update(4, data   ) ) reel_changed |= 0x10;
589   if ( Stepper_update(5, data>>4) ) reel_changed |= 0x20;
588   if ( stepper_update(4, data   ) ) reel_changed |= 0x10;
589   if ( stepper_update(5, data>>4) ) reel_changed |= 0x20;
590590
591   if ( Stepper_optic_state(4) ) optic_pattern |=  0x10;
591   if ( stepper_optic_state(4) ) optic_pattern |=  0x10;
592592   else                          optic_pattern &= ~0x10;
593   if ( Stepper_optic_state(5) ) optic_pattern |=  0x20;
593   if ( stepper_optic_state(5) ) optic_pattern |=  0x20;
594594   else                          optic_pattern &= ~0x20;
595595
596596   draw_reel((4));
src/mame/drivers/suprnova.c
r3115r3116
496496
497497    Input port definitions
498498
499    NOTE: The driver reads data from eight input ports, even if they are unused.
500          So I left them mapped. See for reference the READ32_HANDLERs :
501          "nova_input_port_0_r", "nova_input_port_3_r", "nova_input_port_dip_r"
499    NOTE: The driver reads data from eight 8bit input ports, even if they
500           are unused. So I left them mapped.
501
502502**********************************************************************************/
503503
504static CUSTOM_INPUT( paddle_r )
505{
506   const char *tag = param;
507   return input_port_read(field->port->machine, tag);
508}
509
504510static INPUT_PORTS_START( skns )      /* 3 buttons, 2 players */
511   PORT_START("400000")
512   PORT_BIT( 0x000000ff, IP_ACTIVE_LOW, IPT_UNUSED )
513   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_START1 )
514   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_START2 )
515   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_COIN1 )
516   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_COIN2 )
517   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_SERVICE )
518   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_TILT )
519   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_SERVICE1 )
520   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
505521
506   PORT_START("IN0")  /* IN0 */
507   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
508   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
509   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
510   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
511   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
512   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
513   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
514   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
522   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
523   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
524   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
525   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
526   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
527   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
528   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
529   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED )
530   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
531   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
532   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
533   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
534   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
535   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
536   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
537   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED )
515538
516   PORT_START("IN1")  /* IN1 */
517   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
518   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
519   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
520   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
521   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
522   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
523   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
524   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
539   PORT_START("400004")
540   PORT_SERVICE( 0x00000001, IP_ACTIVE_LOW )
541   PORT_DIPNAME( 0x00000002, 0x00000002, DEF_STR( Flip_Screen ) ) // This port affects 0x000000040191c8 function
542   PORT_DIPSETTING(          0x00000002, DEF_STR( Off ) )
543   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
544   PORT_DIPNAME( 0x00000004, 0x00000004, DEF_STR( Unknown ) )
545   PORT_DIPSETTING(          0x00000004, DEF_STR( Off ) )
546   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
547   PORT_DIPNAME( 0x00000008, 0x00000008, DEF_STR( Unknown ) )
548   PORT_DIPSETTING(          0x00000008, DEF_STR( Off ) )
549   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
550   PORT_DIPNAME( 0x00000010, 0x00000010, DEF_STR( Unknown ) )
551   PORT_DIPSETTING(          0x00000010, DEF_STR( Off ) )
552   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
553   PORT_DIPNAME( 0x00000020, 0x00000020, DEF_STR( Unknown ) )
554   PORT_DIPSETTING(          0x00000020, DEF_STR( Off ) )
555   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
556   PORT_DIPNAME( 0x00000040, 0x00000040, "Use Backup Ram" )
557   PORT_DIPSETTING(          0x00000000, DEF_STR( No ) )
558   PORT_DIPSETTING(          0x00000040, DEF_STR( Yes ) )
559   PORT_DIPNAME( 0x00000080, 0x00000080, "Freeze" )
560   PORT_DIPSETTING(          0x00000000, "Freezes the game")
561   PORT_DIPSETTING(          0x00000080, "Right value")
562   PORT_BIT( 0x0000ff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(paddle_r, "Paddle C")
563   PORT_BIT( 0x00ff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(paddle_r, "Paddle B")
564   PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(paddle_r, "Paddle A")
525565
526   PORT_START("IN2")  /* IN2 */
527   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
528   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
529   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
530   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
531   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )
532   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
533   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
534   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
566   PORT_START("40000c")
567   PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(paddle_r, "Paddle D")
568   PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED )
535569
536   PORT_START("IN3")  /* IN3 */
570   PORT_START("Paddle A")
537571   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
538572
539   PORT_START("Paddle A")  /* Paddle A */
573   PORT_START("Paddle B")
540574   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
541575
542   PORT_START("Paddle B")  /* Paddle B */
576   PORT_START("Paddle C")
543577   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
544578
545   PORT_START("Paddle C")  /* Paddle C */
579   PORT_START("Paddle D")
546580   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
547
548   PORT_START("DSW")  /* DSW */
549   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
550   PORT_DIPNAME( 0x02, 0x02, DEF_STR(Flip_Screen) ) // This port affects 0x040191c8 function
551   PORT_DIPSETTING(    0x02, DEF_STR(Off) )
552   PORT_DIPSETTING(    0x00, DEF_STR(On) )
553   PORT_DIPNAME( 0x04, 0x04, DEF_STR(Unknown) )
554   PORT_DIPSETTING(    0x04, DEF_STR(Off) )
555   PORT_DIPSETTING(    0x00, DEF_STR(On) )
556   PORT_DIPNAME( 0x08, 0x08, DEF_STR(Unknown) )
557   PORT_DIPSETTING(    0x08, DEF_STR(Off) )
558   PORT_DIPSETTING(    0x00, DEF_STR(On) )
559   PORT_DIPNAME( 0x10, 0x10, DEF_STR(Unknown) )
560   PORT_DIPSETTING(    0x10, DEF_STR(Off) )
561   PORT_DIPSETTING(    0x00, DEF_STR(On) )
562   PORT_DIPNAME( 0x20, 0x20, DEF_STR(Unknown) )
563   PORT_DIPSETTING(    0x20, DEF_STR(Off) )
564   PORT_DIPSETTING(    0x00, DEF_STR(On) )
565   PORT_DIPNAME( 0x40, 0x40, "Use Backup Ram" )
566   PORT_DIPSETTING(    0x00, DEF_STR(No) )
567   PORT_DIPSETTING(    0x40, DEF_STR(Yes) )
568   PORT_DIPNAME( 0x80, 0x80, "Freeze" )
569   PORT_DIPSETTING(    0x00, "Freezes the game")
570   PORT_DIPSETTING(    0x80, "Right value")
571
572   PORT_START("Paddle D")  /* Paddle D */
573   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
574
575581INPUT_PORTS_END
576582
577583static INPUT_PORTS_START( skns_1p )      /* 2 buttons, 1 player */
584   PORT_INCLUDE( skns )
578585
579   PORT_START("IN0")  /* IN0 */
580   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
581   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
582   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
583   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
584   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
585   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
586   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
587   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
588
586   PORT_MODIFY("400000")
589587   /* jjparads and jjparad2 are 1 player only games
590588       ryouran and teljan have an unemulated feature
591589       that allows to play them in two player mode
592590       via a cable-network connection (untestable)
593591       Service mode test shows only P1 inputs */
594   PORT_START("IN1")  /* IN1 */
595   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
596
592   PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNUSED )
597593   /* same as above, coin 2 and start 2 are untestable
598594       in ryouran and teljan. So I left disabled for now */
599   PORT_START("IN2")  /* IN2 */
600   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
601//PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
602   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
603   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
604//PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
605   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
606   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )
607   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
608   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
609   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
595   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNUSED )   /* Start 2 */
596   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNUSED )   /* Coin 2 */
597   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNUSED )   /* No Button 3 */
610598
611   PORT_START("IN3")  /* IN3 */
612   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
613
614   PORT_START("Paddle A")  /* Paddle A */
615   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
616
617   PORT_START("Paddle B")  /* Paddle B */
618   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
619
620   PORT_START("Paddle C")  /* Paddle C */
621   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
622
623   PORT_START("DSW")  /* DSW */
624   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
625   PORT_DIPNAME( 0x02, 0x02, DEF_STR(Flip_Screen) ) // This port affects 0x040191c8 function
626   PORT_DIPSETTING(    0x02, DEF_STR(Off) )
627   PORT_DIPSETTING(    0x00, DEF_STR(On) )
628   PORT_DIPNAME( 0x04, 0x04, DEF_STR(Unknown) )
629   PORT_DIPSETTING(    0x04, DEF_STR(Off) )
630   PORT_DIPSETTING(    0x00, DEF_STR(On) )
631   PORT_DIPNAME( 0x08, 0x08, DEF_STR(Unknown) )
632   PORT_DIPSETTING(    0x08, DEF_STR(Off) )
633   PORT_DIPSETTING(    0x00, DEF_STR(On) )
634   PORT_DIPNAME( 0x10, 0x10, "Test Mode" )
635   PORT_DIPSETTING(    0x10, DEF_STR(Off) )
636   PORT_DIPSETTING(    0x00, DEF_STR(On) )
637   PORT_DIPNAME( 0x20, 0x20, DEF_STR(Unknown) )
638   PORT_DIPSETTING(    0x20, DEF_STR(Off) )
639   PORT_DIPSETTING(    0x00, DEF_STR(On) )
640   PORT_DIPNAME( 0x40, 0x40, "Use Backup Ram" )
641   PORT_DIPSETTING(    0x00, DEF_STR(No) )
642   PORT_DIPSETTING(    0x40, DEF_STR(Yes) )
643   PORT_DIPNAME( 0x80, 0x80, "Freeze" )
644   PORT_DIPSETTING(    0x00, "Freezes the game")
645   PORT_DIPSETTING(    0x80, "Right value")
646
647   PORT_START("Paddle D")  /* Paddle D */
648   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
649
599   PORT_MODIFY("400004")
600   PORT_DIPNAME( 0x00000010, 0x00000010, "Test Mode" )
601   PORT_DIPSETTING(          0x00000010, DEF_STR(Off) )
602   PORT_DIPSETTING(          0x00000000, DEF_STR(On) )
650603INPUT_PORTS_END
651604
652605static INPUT_PORTS_START( cyvern )      /* 2 buttons, 2 players */
653606   PORT_INCLUDE( skns )
654607
655   PORT_MODIFY("IN0")
656   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
657
658   PORT_MODIFY("IN1")
659   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
660
608   PORT_MODIFY("400000")
609   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED )   /* No Button 3 */
610   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNUSED )   /* No Button 3 */
661611INPUT_PORTS_END
662612
663613static INPUT_PORTS_START( galpanis )   /* 1 button, 2 players */
664614   PORT_INCLUDE( skns )
665615
666   PORT_MODIFY("IN0")
667   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
668   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
669
670   PORT_MODIFY("IN1")
671   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
672   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
673
616   PORT_MODIFY("400000")
617   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED )   /* No Button 2 */
618   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED )   /* No Button 3 */
619   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_UNUSED )   /* No Button 2 */
620   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNUSED )   /* No Button 3 */
674621INPUT_PORTS_END
675622
676623static INPUT_PORTS_START( puzzloop )   /* 2 buttons, 2 players, paddle */
677624   PORT_INCLUDE( skns )
678625
679   PORT_MODIFY("IN0")
680   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
626   PORT_MODIFY("400000")
627   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED )   /* No Button 3 */
628   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNUSED )   /* No Button 3 */
681629
682   PORT_MODIFY("IN1")
683   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
684
685630   PORT_MODIFY("Paddle A")  /* Paddle A */
686   PORT_BIT( 0xFF, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_REVERSE PORT_PLAYER(1)
631   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_REVERSE PORT_PLAYER(1)
687632
688633   PORT_MODIFY("Paddle B")  /* Paddle B */
689   PORT_BIT( 0xFF, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_REVERSE PORT_PLAYER(2)
690
634   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_REVERSE PORT_PLAYER(2)
691635INPUT_PORTS_END
692636
693637static INPUT_PORTS_START( vblokbrk )   /* 3 buttons, 2 players, paddle */
694638   PORT_INCLUDE( skns )
695639
696640   PORT_MODIFY("Paddle A")  /* Paddle A */
697   PORT_BIT( 0xFF, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_REVERSE PORT_PLAYER(1)
641   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_REVERSE PORT_PLAYER(1)
698642
699643   PORT_MODIFY("Paddle B")  /* Paddle B */
700   PORT_BIT( 0xFF, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_REVERSE PORT_PLAYER(2)
701
644   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_REVERSE PORT_PLAYER(2)
702645INPUT_PORTS_END
703646
704647
705static READ32_HANDLER( nova_input_port_0_r )
706{
707   return input_port_read(machine, "IN0")<<24 | input_port_read(machine, "IN1")<<16 | input_port_read(machine, "IN2")<<8 | input_port_read(machine, "IN3");
708}
709
710static READ32_HANDLER( nova_input_port_3_r )
711{
712   return input_port_read(machine, "Paddle D") | 0xffffff00;
713}
714
715static READ32_HANDLER( nova_input_port_dip_r )
716{
717   return input_port_read(machine, "Paddle A")<<24 | input_port_read(machine, "Paddle B")<<16 | input_port_read(machine, "Paddle C")<<8 | input_port_read(machine, "DSW");
718}
719
720648static UINT32 timer_0_temp[4];
721649
722650static WRITE32_HANDLER( skns_msm6242_w )
r3115r3116
862790
863791static ADDRESS_MAP_START( skns_readmem, ADDRESS_SPACE_PROGRAM, 32 )
864792   AM_RANGE(0x00000000, 0x0007ffff) AM_READ(SMH_ROM) /* BIOS ROM */
865   AM_RANGE(0x00400000, 0x00400003) AM_READ(nova_input_port_0_r)
866   AM_RANGE(0x00400004, 0x00400007) AM_READ(nova_input_port_dip_r)
793   AM_RANGE(0x00400000, 0x00400003) AM_READ_PORT("400000")
794   AM_RANGE(0x00400004, 0x00400007) AM_READ_PORT("400004")
867795   AM_RANGE(0x00400008, 0x0040000b) AM_READ(SMH_RAM)
868796   /* In between is write only */
869   AM_RANGE(0x0040000c, 0x0040000f) AM_READ(nova_input_port_3_r)
797   AM_RANGE(0x0040000c, 0x0040000f) AM_READ_PORT("40000c")
870798   AM_RANGE(0x00800000, 0x00801fff) AM_READ(SMH_RAM) /* 'backup' RAM */
871799//  AM_RANGE(0x00c00000, 0x00c00003) AM_READ(skns_ymz280_r) /* ymz280 (sound) */
872800   AM_RANGE(0x01000000, 0x0100000f) AM_READ(skns_msm6242_r)
src/mame/drivers/namcofl.c
r3115r3116
442442   ROM_REGION( 0x100000, NAMCONB1_TILEMASKREGION, 0 ) // "SSHAPE" (mask for other tiles?)
443443   ROM_LOAD("se1_ssh.18u",    0x000000, 0x100000, CRC(7a8e0bda) SHA1(f6a508d90274d0205fec0c46f5f783a2715c0c6e) )
444444
445   ROM_REGION( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
445   ROM_REGION( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
446446   ROM_LOAD("se1_spr.21l",   0x000000,  0x80000, CRC(850a27ac) SHA1(7d5db840ec67659a1f2e69a62cdb03ce6ee0b47b) )
447447   NAMCO_C7X_BIOS
448448
r3115r3116
479479   ROM_REGION( 0x80000, NAMCONB1_TILEMASKREGION, 0 ) // "SSHAPE" (mask for other tiles?)
480480   ROM_LOAD("flr1ssh.18u",    0x000000, 0x080000, CRC(f70cb2bf) SHA1(dbddda822287783a43415172b81d0382a8ac43d8) )
481481
482   ROM_REGION( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
482   ROM_REGION( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
483483   ROM_LOAD("flr1spr.21l",   0x000000,  0x20000, CRC(69bb0f5e) SHA1(6831d618de42a165e508ad37db594d3aa290c530) )
484484   NAMCO_C7X_BIOS
485485
r3115r3116
516516   ROM_REGION( 0x80000, NAMCONB1_TILEMASKREGION, 0 ) // "SSHAPE" (mask for other tiles?)
517517   ROM_LOAD("flr1ssh.18u",    0x000000, 0x080000, CRC(f70cb2bf) SHA1(dbddda822287783a43415172b81d0382a8ac43d8) )
518518
519   ROM_REGION( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
519   ROM_REGION( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
520520   ROM_LOAD("flr1spr.21l",   0x000000,  0x20000, CRC(69bb0f5e) SHA1(6831d618de42a165e508ad37db594d3aa290c530) )
521521   NAMCO_C7X_BIOS
522522
r3115r3116
553553   ROM_REGION( 0x80000, NAMCONB1_TILEMASKREGION, 0 ) // "SSHAPE" (mask for other tiles?)
554554   ROM_LOAD("flr1ssh.18u",    0x000000, 0x080000, CRC(f70cb2bf) SHA1(dbddda822287783a43415172b81d0382a8ac43d8) )
555555
556   ROM_REGION( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
556   ROM_REGION( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
557557   ROM_LOAD("flr1spr.21l",   0x000000,  0x20000, CRC(69bb0f5e) SHA1(6831d618de42a165e508ad37db594d3aa290c530) )
558558   NAMCO_C7X_BIOS
559559
src/mame/drivers/shootout.c
r3115r3116
103103
104104static ADDRESS_MAP_START( readmem_alt, ADDRESS_SPACE_PROGRAM, 8 )
105105   AM_RANGE(0x0000, 0x0fff) AM_READ(SMH_RAM)
106   AM_RANGE(0x1000, 0x1000) AM_READ(input_port_0_r)
107   AM_RANGE(0x1001, 0x1001) AM_READ(input_port_1_r)
108   AM_RANGE(0x1002, 0x1002) AM_READ(input_port_2_r)
109   AM_RANGE(0x1003, 0x1003) AM_READ(input_port_3_r)
106   AM_RANGE(0x1000, 0x1000) AM_READ_PORT("DSW1")
107   AM_RANGE(0x1001, 0x1001) AM_READ_PORT("P1")
108   AM_RANGE(0x1002, 0x1002) AM_READ_PORT("P2")
109   AM_RANGE(0x1003, 0x1003) AM_READ_PORT("DSW2")
110110   AM_RANGE(0x2000, 0x21ff) AM_READ(SMH_RAM)
111111   AM_RANGE(0x2800, 0x2800) AM_READ(ym2203_status_port_0_r)
112112   AM_RANGE(0x3000, 0x37ff) AM_READ(SMH_RAM)   /* foreground */
r3115r3116
146146/*******************************************************************************/
147147
148148static INPUT_PORTS_START( shootout )
149   PORT_START("P1")
150   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
151   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
152   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
153   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
154   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
155   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
156   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
157   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
158
159   PORT_START("P2")
160   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
161   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
162   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
163   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
164   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
165   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
166   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
167   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
168
149169   PORT_START("DSW1")
150170   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
151171   PORT_DIPSETTING(   0x00, DEF_STR( 2C_1C ) )
r3115r3116
168188   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
169189   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
170190
171   PORT_START("P1")
172   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
173   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
174   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
175   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
176   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
177   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
178   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
179   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
180
181   PORT_START("P2")
182   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
183   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
184   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
185   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
186   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
187   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
188   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
189   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
190
191191   PORT_START("DSW2")
192192   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
193193   PORT_DIPSETTING(   0x01, "1" )
src/mame/drivers/zn.c
r3115r3116
112112} zn_config_table[] =
113113{
114114   { "nbajamex", ac01, ac02 }, /* black screen */
115   { "jdredd",   ac01, ac02 }, /* OK ( missing guns ) */
116   { "jdreddb",  ac01, ac02 }, /* OK ( missing guns ) */
115   { "jdredd",   ac01, ac02 }, /* OK */
116   { "jdreddb",  ac01, ac02 }, /* OK */
117117   { "primrag2", tw01, tw02 }, /* locks up when starting a game */
118118   { "hvnsgate", at01, at02 }, /* OK */
119119   { "ts2",      cp01, cp02 }, /* OK */
r3115r3116
156156   { "cbaj",     mg01, mg03 }, /* OK */
157157   { "shngmtkb", mg01, mg04 }, /* OK */
158158   { "doapp",    mg01, mg05 }, /* OK */
159   { "flamegun", mg01, mg06 }, /* OK, geometry issues */
160   { "flameguj", mg01, mg06 }, /* OK, geometry issues */
159   { "flamegun", mg01, mg06 }, /* OK */
160   { "flameguj", mg01, mg06 }, /* OK */
161161   { "glpracr3", mg01, mg08 },
162162   { "tondemo",  mg01, mg09 }, /* OK */
163163   { "1on1gov",  mg01, mg10 }, /* OK */
r3115r3116
165165   { "tblkkuzu", mg01, mg12 }, /* OK */
166166   { "tecmowcm", mg01, mg13 }, /* OK */
167167   { "mfjump",   mg01, mg14 }, /* OK */
168   { "sfchamp",  tt01, tt02 }, /* stuck in test mode */
169   { "sfchampj", tt01, tt02 }, /* stuck in test mode */
168   { "sfchamp",  tt01, tt02 }, /* OK */
169   { "sfchampj", tt01, tt02 }, /* OK */
170170   { "psyforce", tt01, tt03 }, /* OK */
171171   { "psyforcj", tt01, tt03 }, /* OK */
172172   { "psyfrcex", tt01, tt03 }, /* OK */
173173   { "raystorm", tt01, tt04 }, /* OK */
174174   { "raystorj", tt01, tt04 }, /* OK */
175   { "ftimpact", tt01, tt05 }, /* stuck in test mode */
176   { "ftimpcta", tt01, tt05 }, /* OK, geometry issues */
177   { "mgcldate", tt01, tt06 }, /* stuck in test mode */
175   { "ftimpact", tt01, tt05 }, /* OK */
176   { "ftimpcta", tt01, tt05 }, /* OK */
177   { "mgcldate", tt01, tt06 }, /* OK */
178178   { "mgcldtex", tt01, tt06 }, /* OK */
179179   { "gdarius",  tt01, tt07 }, /* OK */
180180   { "gdariusb", tt01, tt07 }, /* OK */
181181   { "gdarius2", tt01, tt07 }, /* OK */
182182   { "taitogn",  tt10, tt16 }, /* shows gnet logo */
183   { "aerofgts", kn01, kn02 }, /* OK */
183184   { "sncwgltd", kn01, kn02 }, /* OK */
184185   { NULL, NULL, NULL }
185186};
r3115r3116
188189static UINT32 m_b_znsecport;
189190static int m_n_dip_bit;
190191static int m_b_lastclock;
192static emu_timer *dip_timer;
191193
192194static READ32_HANDLER( znsecsel_r )
193195{
r3115r3116
201203   {
202204      if( m_b_lastclock )
203205      {
204         psx_sio_input( Machine, 0, PSX_SIO_IN_DATA, ( znsec_step( 0, ( n_data & PSX_SIO_OUT_DATA ) / PSX_SIO_OUT_DATA ) & 1 ) * PSX_SIO_IN_DATA );
206         psx_sio_input( Machine, 0, PSX_SIO_IN_DATA, ( znsec_step( 0, ( n_data & PSX_SIO_OUT_DATA ) != 0 ) != 0 ) * PSX_SIO_IN_DATA );
205207      }
206208      m_b_lastclock = 0;
207209   }
r3115r3116
217219   {
218220      if( m_b_lastclock )
219221      {
220         psx_sio_input( Machine, 0, PSX_SIO_IN_DATA, ( znsec_step( 1, ( n_data & PSX_SIO_OUT_DATA ) / PSX_SIO_OUT_DATA ) & 1 ) * PSX_SIO_IN_DATA );
222         psx_sio_input( Machine, 0, PSX_SIO_IN_DATA, ( znsec_step( 1, ( n_data & PSX_SIO_OUT_DATA ) != 0 ) != 0 ) * PSX_SIO_IN_DATA );
221223      }
222224      m_b_lastclock = 0;
223225   }
r3115r3116
248250   {
249251      if( m_b_lastclock )
250252      {
251         verboselog( 2, "read dip %02x -> %02x\n", n_data, ( ( input_port_read(Machine, "DSW") >> m_n_dip_bit ) & 1 ) * PSX_SIO_IN_DATA );
252         psx_sio_input( Machine, 0, PSX_SIO_IN_DATA, ( ( input_port_read(Machine, "DSW") >> m_n_dip_bit ) & 1 ) * PSX_SIO_IN_DATA );
253         int bit = ( ( input_port_read(Machine, "DSW") >> m_n_dip_bit ) & 1 );
254         verboselog( 2, "read dip %02x -> %02x\n", n_data, bit * PSX_SIO_IN_DATA );
255         psx_sio_input( Machine, 0, PSX_SIO_IN_DATA, bit * PSX_SIO_IN_DATA );
253256         m_n_dip_bit++;
254257         m_n_dip_bit &= 7;
255258      }
r3115r3116
268271   if( ( m_n_znsecsel & 0x80 ) == 0 )
269272   {
270273      psx_sio_install_handler( 0, sio_pad_handler );
274      psx_sio_input( Machine, 0, PSX_SIO_IN_DSR, 0 );
271275   }
272276   else if( ( m_n_znsecsel & 0x08 ) == 0 )
273277   {
274278      znsec_start( 1 );
275279      psx_sio_install_handler( 0, sio_znsec1_handler );
280      psx_sio_input( Machine, 0, PSX_SIO_IN_DSR, 0 );
276281   }
277282   else if( ( m_n_znsecsel & 0x04 ) == 0 )
278283   {
279284      znsec_start( 0 );
280285      psx_sio_install_handler( 0, sio_znsec0_handler );
286      psx_sio_input( Machine, 0, PSX_SIO_IN_DSR, 0 );
281287   }
282288   else
283289   {
290      m_n_dip_bit = 0;
291      m_b_lastclock = 1;
292
284293      psx_sio_install_handler( 0, sio_dip_handler );
294      psx_sio_input( Machine, 0, PSX_SIO_IN_DSR, 0 );
295
296      timer_adjust_oneshot( dip_timer, ATTOTIME_IN_CYCLES( 100, 0 ), 1 );
285297   }
286298
287299   verboselog( 2, "znsecsel_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
288300}
289301
302static TIMER_CALLBACK( dip_timer_fired )
303{
304   psx_sio_input( Machine, 0, PSX_SIO_IN_DSR, param * PSX_SIO_IN_DSR );
305
306   if( param )
307   {
308      timer_adjust_oneshot( dip_timer, ATTOTIME_IN_CYCLES( 50, 0 ), 0 );
309   }
310}
311
290312static READ32_HANDLER( boardconfig_r )
291313{
292314   /*
r3115r3116
362384   AM_RANGE(0x1fa00100, 0x1fa00103) AM_READ_PORT("P2")
363385   AM_RANGE(0x1fa00200, 0x1fa00203) AM_READ_PORT("SERVICE")
364386   AM_RANGE(0x1fa00300, 0x1fa00303) AM_READ_PORT("SYSTEM")
365   AM_RANGE(0x1fa10000, 0x1fa10003) AM_READ_PORT("EXTRA1")
366   AM_RANGE(0x1fa10100, 0x1fa10103) AM_READ_PORT("EXTRA2")
387   AM_RANGE(0x1fa10000, 0x1fa10003) AM_READ_PORT("P3")
388   AM_RANGE(0x1fa10100, 0x1fa10103) AM_READ_PORT("P4")
367389   AM_RANGE(0x1fa10200, 0x1fa10203) AM_READ(boardconfig_r)
368390   AM_RANGE(0x1fa10300, 0x1fa10303) AM_READWRITE(znsecsel_r, znsecsel_w)
369391   AM_RANGE(0x1fa20000, 0x1fa20003) AM_WRITE(coin_w)
370392   AM_RANGE(0x1fa30000, 0x1fa30003) AM_NOP /* ?? */
371393   AM_RANGE(0x1fa40000, 0x1fa40003) AM_READNOP /* ?? */
372394   AM_RANGE(0x1fa60000, 0x1fa60003) AM_READNOP /* ?? */
373   AM_RANGE(0x1faf0000, 0x1faf07ff) AM_READWRITE8(at28c16_0_r, at28c16_0_w, 0xffffffff) /* eeprom */
395   AM_RANGE(0x1faf0000, 0x1faf07ff) AM_DEVREADWRITE8(AT28C16, "at28c16", at28c16_r, at28c16_w, 0xffffffff) /* eeprom */
374396   AM_RANGE(0x1fb20000, 0x1fb20007) AM_READ(unknown_r)
375397   AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_SHARE(2) AM_REGION("user1", 0) /* bios */
376398   AM_RANGE(0x80000000, 0x803fffff) AM_RAM AM_SHARE(1) /* ram mirror */
r3115r3116
403425      n_game++;
404426   }
405427
406   at28c16_init( 0, memory_region( machine, "user4" ), NULL );
428   dip_timer = timer_alloc( dip_timer_fired, NULL );
407429}
408430
409431static const psx_spu_interface psxspu_interface =
r3115r3116
421443   psx_machine_init(machine);
422444}
423445
446static const at28c16_config at28c16_intf =
447{
448   "at28c16", NULL
449};
450
424451static MACHINE_DRIVER_START( zn1_1mb_vram )
425452   /* basic machine hardware */
426453   MDRV_CPU_ADD( "MAIN", PSXCPU, XTAL_67_7376MHz )
r3115r3116
448475   MDRV_SOUND_CONFIG( psxspu_interface )
449476   MDRV_SOUND_ROUTE(0, "left", 0.35)
450477   MDRV_SOUND_ROUTE(1, "right", 0.35)
478
479   MDRV_DEVICE_ADD( "at28c16", AT28C16 )
480   MDRV_DEVICE_CONFIG( at28c16_intf )
451481MACHINE_DRIVER_END
452482
453483static MACHINE_DRIVER_START( zn1_2mb_vram )
r3115r3116
484514   MDRV_SOUND_CONFIG( psxspu_interface )
485515   MDRV_SOUND_ROUTE(0, "left", 0.35)
486516   MDRV_SOUND_ROUTE(1, "right", 0.35)
517
518   MDRV_DEVICE_ADD( "at28c16", AT28C16 )
519   MDRV_DEVICE_CONFIG( at28c16_intf )
487520MACHINE_DRIVER_END
488521
489522/*
r3115r3116
682715   MDRV_CPU_VBLANK_INT_HACK( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */
683716
684717   MDRV_MACHINE_RESET( coh1000c )
685   MDRV_NVRAM_HANDLER( at28c16_0 )
686718
687719   MDRV_SOUND_ADD( "qsound", QSOUND, QSOUND_CLOCK )
688720   MDRV_SOUND_ROUTE(0, "left", 1.0)
r3115r3116
698730   MDRV_CPU_VBLANK_INT_HACK( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */
699731
700732   MDRV_MACHINE_RESET( coh1000c )
701   MDRV_NVRAM_HANDLER( at28c16_0 )
702733
703734   MDRV_SOUND_ADD( "qsound", QSOUND, QSOUND_CLOCK )
704735   MDRV_SOUND_ROUTE(0, "left", 1.0)
r3115r3116
880911   MDRV_CPU_VBLANK_INT_HACK( qsound_interrupt, 4 ) /* 4 interrupts per frame ?? */
881912
882913   MDRV_MACHINE_RESET( coh3002c )
883   MDRV_NVRAM_HANDLER( at28c16_0 )
884914
885915   MDRV_SOUND_ADD( "qsound", QSOUND, QSOUND_CLOCK )
886916   MDRV_SOUND_ROUTE(0, "left", 1.0)
r3115r3116
11171147   memory_set_bankptr( 1, memory_region( machine, "user2" ) + ( ( data & 3 ) * 0x800000 ) );
11181148}
11191149
1120static INTERRUPT_GEN( coh1000t_vblank )
1121{
1122   /* kludge: stop dropping into test mode on bootup */
1123   if( strcmp( machine->gamedrv->name, "raystorm" ) == 0 )
1124   {
1125      if( g_p_n_psxram[ 0x1b358 / 4 ] == 0x34020001 )
1126      {
1127         g_p_n_psxram[ 0x1b358 / 4 ] = 0x34020000;
1128      }
1129   }
1130   /* kludge: stop dropping into test mode on bootup */
1131   if( strcmp( machine->gamedrv->name, "raystorj" ) == 0 )
1132   {
1133      if( g_p_n_psxram[ 0x1b358 / 4 ] == 0x34020001 )
1134      {
1135         g_p_n_psxram[ 0x1b358 / 4 ] = 0x34020000;
1136      }
1137   }
1138   if(strcmp( machine->gamedrv->name, "gdarius" ) == 0 )
1139   {
1140      if (psxreadbyte(0x165d53) == 0)
1141      {
1142         psxwritebyte(0x165d53, 1);
1143      }
1144   }
1145   if(strcmp( machine->gamedrv->name, "gdariusb" ) == 0 )
1146   {
1147      if (psxreadbyte(0x165dfb) == 0)
1148      {
1149         psxwritebyte(0x165dfb, 1);
1150      }
1151   }
1152   if(strcmp( machine->gamedrv->name, "gdarius2" ) == 0 )
1153   {
1154      if (psxreadbyte(0x16be3b) == 0)
1155      {
1156         psxwritebyte(0x16be3b, 1);
1157      }
1158   }
1159   if(strcmp( machine->gamedrv->name, "ftimpcta" ) == 0 )
1160   {
1161      if (psxreadbyte(0x0f8997) == 0)
1162      {
1163         psxwritebyte(0x0f8997, 1);
1164      }
1165   }
1166   if(strcmp( machine->gamedrv->name, "ftimpact" ) == 0 ) /* WRONG!!!- Copied from ftimpcta */
1167   {
1168      if (psxreadbyte(0x0f8997) == 0) /* WRONG!!!- Copied from ftimpcta */
1169      {
1170         psxwritebyte(0x0f8997, 1); /* WRONG!!!- Copied from ftimpcta */
1171      }
1172   }
1173   psx_vblank(machine, cpunum);
1174}
1175
11761150static WRITE8_HANDLER( fx1a_sound_bankswitch_w )
11771151{
11781152   memory_set_bankptr( 10, memory_region( machine, "audio" ) + 0x10000 + ( ( ( data - 1 ) & 0x07 ) * 0x4000 ) );
r3115r3116
12131187   memory_set_bankptr( 1, memory_region( machine, "user2" ) ); /* banked game rom */
12141188   memory_set_bankptr( 2, taitofx1_eeprom1 );
12151189   zn_machine_init(machine);
1216
1217   // patch to make psyforce boot
1218   if ((!strcmp(machine->gamedrv->name, "psyforce")) ||
1219       (!strcmp(machine->gamedrv->name, "psyforcj")) ||
1220       (!strcmp(machine->gamedrv->name, "psyfrcex")))
1221   {
1222      // note: these values can be anything non-zero
1223      // perhaps Taito expects RAM to be initialized to 0xff on power-up?
1224      psxwritebyte(0x3fffda, 0xb5);
1225      psxwritebyte(0x3fffdb, 0x6b);
1226   }
12271190}
12281191
12291192static NVRAM_HANDLER( coh1000ta )
12301193{
1231   NVRAM_HANDLER_CALL(at28c16_0);
12321194   if (read_or_write)
12331195   {
12341196      mame_fwrite(file, taitofx1_eeprom1, taitofx1_eeprom_size1);
r3115r3116
12731235static MACHINE_DRIVER_START( coh1000ta )
12741236   MDRV_IMPORT_FROM( zn1_1mb_vram )
12751237
1276   MDRV_CPU_MODIFY( "MAIN" )
1277   MDRV_CPU_VBLANK_INT("main", coh1000t_vblank)
1278
12791238   MDRV_CPU_ADD("audio", Z80, 16000000 / 4 )   /* 4 MHz */
12801239   MDRV_CPU_PROGRAM_MAP( fx1a_sound_map, 0 )
12811240   MDRV_MACHINE_RESET( coh1000ta )
r3115r3116
13331292
13341293static NVRAM_HANDLER( coh1000tb )
13351294{
1336   NVRAM_HANDLER_CALL(at28c16_0);
13371295   if (read_or_write)
13381296   {
13391297      mame_fwrite(file, taitofx1_eeprom1, taitofx1_eeprom_size1);
r3115r3116
13541312static MACHINE_DRIVER_START( coh1000tb )
13551313   MDRV_IMPORT_FROM( zn1_2mb_vram )
13561314
1357   MDRV_CPU_MODIFY( "MAIN" )
1358   MDRV_CPU_VBLANK_INT("main", coh1000t_vblank)
1359
13601315   MDRV_MACHINE_RESET( coh1000tb )
13611316   MDRV_NVRAM_HANDLER( coh1000tb )
13621317MACHINE_DRIVER_END
r3115r3116
15221477   MDRV_IMPORT_FROM( zn2 )
15231478
15241479   MDRV_MACHINE_RESET( coh3002t )
1525   MDRV_NVRAM_HANDLER( at28c16_0 )
15261480MACHINE_DRIVER_END
15271481
15281482/*
r3115r3116
17041658   MDRV_IMPORT_FROM( zn1_2mb_vram )
17051659
17061660   MDRV_MACHINE_RESET( coh1000w )
1707   MDRV_NVRAM_HANDLER( at28c16_0 )
17081661
17091662   MDRV_IDE_CONTROLLER_ADD("ide", atpsx_interrupt)
17101663MACHINE_DRIVER_END
r3115r3116
19171870   MDRV_CPU_PROGRAM_MAP( psarc_snd_map, 0 )
19181871
19191872   MDRV_MACHINE_RESET( coh1002e )
1920   MDRV_NVRAM_HANDLER( at28c16_0 )
19211873
19221874   MDRV_SOUND_ADD( "ymf", YMF271, 16934400 )
19231875   MDRV_SOUND_ROUTE(0, "left", 1.0)
r3115r3116
20552007   MDRV_IMPORT_FROM( zn1_2mb_vram )
20562008
20572009   MDRV_MACHINE_RESET( bam2 )
2058   MDRV_NVRAM_HANDLER( at28c16_0 )
20592010MACHINE_DRIVER_END
20602011
20612012/*
r3115r3116
22382189
22392190static READ32_DEVICE_HANDLER( jdredd_idestat_r )
22402191{
2241   return ide_controller_r(device, 0x1f7);
2192   return ide_controller_r( device, 0x1f7 );
22422193}
22432194
22442195static READ32_DEVICE_HANDLER( jdredd_ide_r )
22452196{
2246   int reg = offset*2;
2247   int shift = 0;
2248   int ret;
2197   UINT32 data = 0;
22492198
2250   if (mem_mask == 0x00ff0000)
2199   if( ACCESSING_BITS_0_7 )
22512200   {
2252      shift = 16;
2253      reg++;
2201      data |= ide_controller_r( device, 0x1f0 + ( offset * 2 ) ) << 0;
22542202   }
2255   else if (mem_mask == 0x0000ffff)   // code sometimes reads shorts from the DATA register
2203   if( ACCESSING_BITS_8_15 )
22562204   {
2257      if (reg != 0)
2258      {
2259         logerror("JDREDD IDE: read 16-bit from non-DATA register %d!\n", reg);
2260      }
2205      data |= ide_controller_r( device, 0x1f0 + ( offset * 2 ) ) << 8;
2206   }
2207   if( ACCESSING_BITS_16_23 )
2208   {
2209      data |= ide_controller_r( device, 0x1f1 + ( offset * 2 ) ) << 16;
2210   }
2211   if( ACCESSING_BITS_24_31 )
2212   {
2213      data |= ide_controller_r( device, 0x1f1 + ( offset * 2 ) ) << 24;
2214   }
22612215
2262      return (ide_controller_r(device, 0x1f0) | (ide_controller_r(device, 0x1f0)<<8));
2216   return data;
2217}
2218
2219static WRITE32_DEVICE_HANDLER( jdredd_ide_w )
2220{
2221   if( ACCESSING_BITS_0_7 )
2222   {
2223      ide_controller_w( device, 0x1f0 + ( offset * 2 ), data >> 0 );
22632224   }
2225   if( ACCESSING_BITS_8_15 )
2226   {
2227      ide_controller_w( device, 0x1f0 + ( offset * 2 ), data >> 8 );
2228   }
2229   if( ACCESSING_BITS_16_23 )
2230   {
2231      ide_controller_w( device, 0x1f1 + ( offset * 2 ), data >> 16 );
2232   }
2233   if( ACCESSING_BITS_24_31 )
2234   {
2235      ide_controller_w( device, 0x1f1 + ( offset * 2 ), data >> 24 );
2236   }
2237}
22642238
2265   ret = ide_controller_r(device, 0x1f0 + reg) << shift;
2239static int jdredd_gun_mux = 0;
22662240
2267   return ret;
2241static CUSTOM_INPUT( jdredd_gun_mux_read )
2242{
2243   return jdredd_gun_mux;
22682244}
22692245
2270static WRITE32_DEVICE_HANDLER( jdredd_ide_w )
2246INTERRUPT_GEN( jdredd_vblank )
22712247{
2272   int reg = offset*2;
2248   int x;
2249   int y;
22732250
2274   if (mem_mask == 0x00ff0000)
2251   jdredd_gun_mux = !jdredd_gun_mux;
2252
2253   if( jdredd_gun_mux == 0 )
22752254   {
2276      data >>= 16;
2277      reg++;
2255      x = input_port_read(machine, "GUN1X");
2256      y = input_port_read(machine, "GUN1Y");
22782257   }
2258   else
2259   {
2260      x = input_port_read(machine, "GUN2X");
2261      y = input_port_read(machine, "GUN2Y");
2262   }
22792263
2280   ide_controller_w(device, 0x1f0 + reg, data);
2264   if( x > 0x393 && x < 0xcb2 &&
2265      y > 0x02d && y < 0x217 )
2266   {
2267      psx_lightgun_set( x, y );
2268   }
2269
2270   psx_vblank( machine, cpunum );
22812271}
22822272
22832273static size_t nbajamex_eeprom_size;
r3115r3116
23582348   MDRV_IMPORT_FROM( zn1_2mb_vram )
23592349
23602350   MDRV_MACHINE_RESET( coh1000a )
2361   MDRV_NVRAM_HANDLER( at28c16_0 )
23622351MACHINE_DRIVER_END
23632352
23642353static MACHINE_DRIVER_START( coh1000a_ide )
23652354   MDRV_IMPORT_FROM( zn1_2mb_vram )
23662355
2356   MDRV_CPU_MODIFY( "MAIN" )
2357   MDRV_CPU_VBLANK_INT("main", jdredd_vblank)
2358
23672359   MDRV_MACHINE_RESET( coh1000a )
2368   MDRV_NVRAM_HANDLER( at28c16_0 )
23692360
23702361   MDRV_IDE_CONTROLLER_ADD("ide", jdredd_ide_interrupt)
23712362MACHINE_DRIVER_END
r3115r3116
25122503//  MDRV_CPU_PROGRAM_MAP( atlus_snd_map, 0 )
25132504
25142505   MDRV_MACHINE_RESET( coh1001l )
2515   MDRV_NVRAM_HANDLER( at28c16_0 )
25162506
25172507//  MDRV_SOUND_ADD( "ymz", wYMZ280B, ymz280b_intf )
25182508MACHINE_DRIVER_END
r3115r3116
25512541   zn_machine_init(machine);
25522542}
25532543
2554static INTERRUPT_GEN( coh1002v_vblank )
2555{
2556   /* kludge: to stop dropping into test mode on bootup */
2557   if(strcmp( machine->gamedrv->name, "sncwgltd" ) == 0 )
2558   {
2559      if (psxreadbyte(0x0db422) == 0)
2560      {
2561         psxwritebyte(0x0db422, 1);
2562      }
2563      if (psxreadbyte(0x0db423) == 0)
2564      {
2565         psxwritebyte(0x0db423, 1);
2566      }
2567   }
2568   psx_vblank(machine, cpunum);
2569}
2570
25712544static MACHINE_DRIVER_START( coh1002v )
25722545   MDRV_IMPORT_FROM( zn1_2mb_vram )
25732546
2574   MDRV_CPU_MODIFY( "MAIN" )
2575   MDRV_CPU_VBLANK_INT("main", coh1002v_vblank)
2576
25772547   MDRV_MACHINE_RESET( coh1002v )
2578   MDRV_NVRAM_HANDLER( at28c16_0 )
25792548MACHINE_DRIVER_END
25802549
25812550/*
r3115r3116
28132782   MDRV_IMPORT_FROM( zn1_2mb_vram )
28142783
28152784   MDRV_MACHINE_RESET( coh1002m )
2816   MDRV_NVRAM_HANDLER( at28c16_0 )
28172785MACHINE_DRIVER_END
28182786
28192787static MACHINE_DRIVER_START( coh1002msnd )
r3115r3116
28242792   MDRV_CPU_IO_MAP( cbaj_z80_port_map, 0 )
28252793
28262794   MDRV_MACHINE_RESET( coh1002m )
2827   MDRV_NVRAM_HANDLER( at28c16_0 )
28282795
28292796   MDRV_SOUND_ADD("ymz", YMZ280B, 16934400)
28302797   MDRV_SOUND_ROUTE(0, "left", 1.0)
r3115r3116
28382805   MDRV_CPU_PROGRAM_MAP( link_map, 0 )
28392806
28402807   MDRV_MACHINE_RESET( coh1002m )
2841   MDRV_NVRAM_HANDLER( at28c16_0 )
28422808MACHINE_DRIVER_END
28432809
28442810static INPUT_PORTS_START( zn )
2845   PORT_START("P1")   /* IN0 */
2811   PORT_START("P1")
28462812   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
28472813   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
28482814   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
28522818   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
28532819   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
28542820
2855   PORT_START("P2")   /* IN1 */
2821   PORT_START("P2")
28562822   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
28572823   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
28582824   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
28622828   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
28632829   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
28642830
2865   PORT_START("SERVICE")   /* IN2 */
2831   PORT_START("SERVICE")
28662832   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
28672833   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
28682834   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
28692835   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
28702836
2871   PORT_START("SYSTEM")   /* IN3 */
2837   PORT_START("SYSTEM")
28722838   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
28732839   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
2840   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 )
2841   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 )
28742842   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
28752843   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
2876   PORT_BIT( 0xcc, IP_ACTIVE_LOW, IPT_UNKNOWN )
2844   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
2845   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN4 )
28772846
2878   PORT_START("EXTRA1")   /* IN4 */
2879   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 )
2880   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 )
2881   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 )
2882   PORT_BIT( 0x8f, IP_ACTIVE_LOW, IPT_UNKNOWN )
2847   PORT_START("P3")
2848   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
2849   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
2850   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
2851   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
2852   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
2853   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
2854   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
2855   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
28832856
2884   PORT_START("EXTRA2")   /* IN5 */
2885   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
2886   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
2887   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
2888   PORT_BIT( 0x8f, IP_ACTIVE_LOW, IPT_UNKNOWN )
2857   PORT_START("P4")
2858   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
2859   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
2860   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
2861   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
2862   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
2863   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
2864   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
2865   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
28892866
2890   PORT_START("UNK")   /* IN6 */
2891   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
2892
2893   PORT_START("DSW")   /* IN7 */
2867   PORT_START("DSW")
28942868   PORT_DIPNAME( 0x01, 0x01, "Freeze" )
28952869   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
28962870   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
29052879   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
29062880INPUT_PORTS_END
29072881
2882static INPUT_PORTS_START( zn6b )
2883   PORT_INCLUDE( zn )
29082884
2885   PORT_MODIFY("SYSTEM")
2886   PORT_BIT( 0xcc, IP_ACTIVE_LOW, IPT_UNUSED )
2887
2888   PORT_MODIFY("P3")
2889   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
2890   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 )
2891   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 )
2892   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 )
2893
2894   PORT_MODIFY("P4")
2895   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
2896   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
2897   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
2898   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
2899INPUT_PORTS_END
2900
2901INPUT_PORTS_START( jdredd )
2902   PORT_INCLUDE( zn )
2903
2904   PORT_MODIFY("P1")
2905   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2906   PORT_BIT( 0x6f, IP_ACTIVE_LOW, IPT_UNUSED )
2907
2908   PORT_MODIFY("P2")
2909   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2910   PORT_BIT( 0x6f, IP_ACTIVE_LOW, IPT_UNUSED )
2911
2912   PORT_MODIFY("SERVICE")
2913   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(jdredd_gun_mux_read, NULL)
2914   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2915   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2916
2917   PORT_MODIFY("SYSTEM")
2918   PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
2919
2920   PORT_MODIFY("P3")
2921   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
2922
2923   PORT_MODIFY("P4")
2924   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
2925
2926   PORT_START("GUN1X")
2927   PORT_BIT( 0xffff, 0x0822, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(0x393-1,0xcb2+1) PORT_SENSITIVITY(100) PORT_KEYDELTA(50) PORT_PLAYER(1)
2928
2929   PORT_START("GUN1Y")
2930   PORT_BIT( 0xffff, 0x0122, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0x02d-1,0x217+1) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_PLAYER(1)
2931
2932   PORT_START("GUN2X")
2933   PORT_BIT( 0xffff, 0x0822, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(0x393-1,0xcb2+1) PORT_SENSITIVITY(100) PORT_KEYDELTA(50) PORT_PLAYER(2)
2934
2935   PORT_START("GUN2Y")
2936   PORT_BIT( 0xffff, 0x0122, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0x02d-1,0x217+1) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_PLAYER(2)
2937INPUT_PORTS_END
2938
2939INPUT_PORTS_START( primrag2 )
2940   PORT_INCLUDE( zn )
2941
2942   PORT_MODIFY("SYSTEM")
2943   PORT_BIT( 0xcc, IP_ACTIVE_LOW, IPT_UNUSED )
2944
2945   PORT_MODIFY("P3")
2946   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
2947
2948   PORT_MODIFY("P4")
2949   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 )
2950   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 )
2951   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 )
2952   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2953   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
2954   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
2955   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
2956INPUT_PORTS_END
2957
29092958/* Capcom ZN1 */
29102959
29112960#define CPZN1_BIOS \
r3115r3116
38423891   ROM_LOAD( "ooo-6.u0223",  0x2000000, 0x400000, CRC(f74f38b6) SHA1(ff7f0ebff85fc982f8d1c13d6649d4c7c5da6c45) )
38433892   ROM_LOAD( "ooo-7.u0323",  0x2400000, 0x400000, CRC(0e58777c) SHA1(9f8ee3c6d6d8b1482522500e18217577056d8c98) )
38443893
3845   ROM_REGION( 0x800, "user4", 0 ) /* at28c16 */
3846        ROM_LOAD( "at28c16",      0x0000000, 0x000800, BAD_DUMP CRC(ff7b63e3) SHA1(febf073c91041394cabdc1c37cbce344b14cd6bd) )
3894   ROM_REGION( 0x800, "at28c16", 0 ) /* at28c16 */
3895   ROM_LOAD( "at28c16",      0x0000000, 0x000800, BAD_DUMP CRC(ff7b63e3) SHA1(febf073c91041394cabdc1c37cbce344b14cd6bd) )
38473896ROM_END
38483897
38493898/* video system */
r3115r3116
38523901   ROM_REGION32_LE( 0x080000, "user1", 0 ) \
38533902   ROM_LOAD( "coh-1002v.353", 0x0000000, 0x080000, CRC(5ff165f3) SHA1(8f59314c1093446b9bcb06d232244da6df78e206) )
38543903
3904ROM_START( vspsx )
3905   KN_BIOS
3906ROM_END
3907
3908ROM_START( aerofgts )
3909   KN_BIOS
3910
3911   ROM_REGION32_LE( 0x0280000, "user2", 0 )
3912   ROM_LOAD( "vs.ic5",      0x0000000, 0x080000, CRC(453dd514) SHA1(189fe5598485de160f5c0add90235ed63ed92747) )
3913   ROM_LOAD( "vs.ic6",      0x0080000, 0x080000, CRC(24257295) SHA1(fe6d969c407f2c26c3af2a2a5015dc83b1675e9a) )
3914   ROM_LOAD( "vs.ic7",      0x0100000, 0x080000, CRC(df5ba2f7) SHA1(19153084e7cff632380b67a2fff800644a2fbf7d) )
3915   ROM_LOAD( "vs.ic8",      0x0180000, 0x080000, CRC(df638f92) SHA1(5704eed2ef798a91a0398948af0324955ec38534) )
3916   ROM_LOAD( "vs.ic9",      0x0200000, 0x080000, CRC(1294aa24) SHA1(07ca2cc3f117cfd48d2ca558d9435a3fc238c0fe) )
3917
3918   ROM_REGION32_LE( 0x1800000, "user3", 0 )
3919   ROM_LOAD( "ic11.bin",     0x0000000, 0x400000, CRC(a93f6fee) SHA1(6f079643b50833f8fb497c49945ad23326cc9170) )
3920   ROM_LOAD( "ic12.bin",     0x0400000, 0x400000, CRC(9f584ef7) SHA1(12c04e198f17d1915f58e83aff45ca2e76773df8) )
3921   ROM_LOAD( "ic13.bin",     0x0800000, 0x400000, CRC(652e9c78) SHA1(a929b2944de72606338acb822c1031463e2b1cc5) )
3922   ROM_LOAD( "ic14.bin",     0x0c00000, 0x400000, CRC(c4ef1424) SHA1(1734a6ee6d0be94d24afefcf2a125b74747f53d0) )
3923   ROM_LOAD( "ic15.bin",     0x1000000, 0x400000, CRC(2551d816) SHA1(e1500d4bfa8cc55220c366a5852263ac2070da82) )
3924   ROM_LOAD( "ic16.bin",     0x1400000, 0x400000, CRC(21b401bc) SHA1(89374b80453c474aa1dd3a219422f557f95a262c) )
3925ROM_END
3926
38553927ROM_START( sncwgltd )
38563928   KN_BIOS
38573929
r3115r3116
43764448/* A dummy driver, so that the bios can be debugged, and to serve as */
43774449/* parent for the coh-1000c.353 file, so that we do not have to include */
43784450/* it in every zip file */
4379GAME( 1995, cpzn1,    0,        coh1000c, zn, coh1000c, ROT0, "Sony/Capcom", "ZN1", GAME_IS_BIOS_ROOT )
4451GAME( 1995, cpzn1,    0,        coh1000c, zn,   coh1000c, ROT0, "Sony/Capcom", "ZN1", GAME_IS_BIOS_ROOT )
43804452
4381GAME( 1995, ts2,      cpzn1,    coh1000c, zn, coh1000c, ROT0, "Capcom/Takara", "Battle Arena Toshinden 2 (USA 951124)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4382GAME( 1995, ts2j,     ts2,      coh1000c, zn, coh1000c, ROT0, "Capcom/Takara", "Battle Arena Toshinden 2 (JAPAN 951124)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4383GAME( 1996, starglad, cpzn1,    coh1000c, zn, coh1000c, ROT0, "Capcom", "Star Gladiator (USA 960627)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4384GAME( 1996, sfex,     cpzn1,    coh1002c, zn, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX (EURO 961219)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4385GAME( 1996, sfexu,    sfex,     coh1002c, zn, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX (USA 961219)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4386GAME( 1996, sfexa,    sfex,     coh1002c, zn, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX (ASIA 961219)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4387GAME( 1996, sfexj,    sfex,     coh1002c, zn, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX (JAPAN 961130)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4388GAME( 1996, glpracr,  cpzn1,    coh1000c, zn, coh1000c, ROT0, "Tecmo", "Gallop Racer (JAPAN Ver 9.01.12)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4389GAME( 1997, sfexp,    cpzn1,    coh1002c, zn, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX Plus (USA 970407)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4390GAME( 1997, sfexpu1,  sfexp,    coh1002c, zn, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX Plus (USA 970311)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4391GAME( 1997, sfexpj,   sfexp,    coh1002c, zn, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX Plus (JAPAN 970311)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4453GAME( 1995, ts2,      cpzn1,    coh1000c, zn6b, coh1000c, ROT0, "Capcom/Takara", "Battle Arena Toshinden 2 (USA 951124)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4454GAME( 1995, ts2j,     ts2,      coh1000c, zn6b, coh1000c, ROT0, "Capcom/Takara", "Battle Arena Toshinden 2 (JAPAN 951124)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4455GAME( 1996, starglad, cpzn1,    coh1000c, zn6b, coh1000c, ROT0, "Capcom", "Star Gladiator (USA 960627)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4456GAME( 1996, sfex,     cpzn1,    coh1002c, zn6b, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX (EURO 961219)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4457GAME( 1996, sfexu,    sfex,     coh1002c, zn6b, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX (USA 961219)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4458GAME( 1996, sfexa,    sfex,     coh1002c, zn6b, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX (ASIA 961219)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4459GAME( 1996, sfexj,    sfex,     coh1002c, zn6b, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX (JAPAN 961130)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4460GAME( 1996, glpracr,  cpzn1,    coh1000c, zn,   coh1000c, ROT0, "Tecmo", "Gallop Racer (JAPAN Ver 9.01.12)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4461GAME( 1997, sfexp,    cpzn1,    coh1002c, zn6b, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX Plus (USA 970407)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4462GAME( 1997, sfexpu1,  sfexp,    coh1002c, zn6b, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX Plus (USA 970311)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4463GAME( 1997, sfexpj,   sfexp,    coh1002c, zn6b, coh1000c, ROT0, "Capcom/Arika", "Street Fighter EX Plus (JAPAN 970311)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
43924464
43934465/* Capcom ZN2 */
43944466
43954467/* A dummy driver, so that the bios can be debugged, and to serve as */
43964468/* parent for the coh-3002c.353 file, so that we do not have to include */
43974469/* it in every zip file */
4398GAME( 1997, cpzn2,    0,        coh3002c, zn, coh3002c, ROT0, "Sony/Capcom", "ZN2", GAME_IS_BIOS_ROOT )
4470GAME( 1997, cpzn2,    0,        coh3002c, zn,   coh3002c, ROT0, "Sony/Capcom", "ZN2", GAME_IS_BIOS_ROOT )
43994471
4400GAME( 1997, rvschool, cpzn2,    coh3002c, zn, coh3002c, ROT0, "Capcom", "Rival Schools (USA 971117)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4401GAME( 1997, rvschola, rvschool, coh3002c, zn, coh3002c, ROT0, "Capcom", "Rival Schools (ASIA 971117)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4402GAME( 1997, jgakuen,  rvschool, coh3002c, zn, coh3002c, ROT0, "Capcom", "Justice Gakuen (JAPAN 971117)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4403GAME( 1998, sfex2,    cpzn2,    coh3002c, zn, coh3002c, ROT0, "Capcom/Arika", "Street Fighter EX 2 (USA 980526)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4404GAME( 1998, sfex2j,   sfex2,    coh3002c, zn, coh3002c, ROT0, "Capcom/Arika", "Street Fighter EX 2 (JAPAN 980312)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4405GAME( 1998, sfex2a,   sfex2,    coh3002c, zn, coh3002c, ROT0, "Capcom/Arika", "Street Fighter EX 2 (ASIA 980312)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4406GAME( 1998, plsmaswd, cpzn2,    coh3002c, zn, coh3002c, ROT0, "Capcom", "Plasma Sword (USA 980316)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4407GAME( 1998, stargld2, plsmaswd, coh3002c, zn, coh3002c, ROT0, "Capcom", "Star Gladiator 2 (JAPAN 980316)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4408GAME( 1998, plsmswda, plsmaswd, coh3002c, zn, coh3002c, ROT0, "Capcom", "Plasma Sword (ASIA 980316)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4409GAME( 1998, tgmj,     cpzn2,    coh3002c, zn, coh3002c, ROT0, "Capcom/Arika", "Tetris The Grand Master (JAPAN 980710)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4410GAME( 1998, techromn, cpzn2,    coh3002c, zn, coh3002c, ROT0, "Capcom", "Tech Romancer (EURO 980914)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4411GAME( 1998, techromu, techromn, coh3002c, zn, coh3002c, ROT0, "Capcom", "Tech Romancer (USA 980914)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4412GAME( 1998, kikaioh,  techromn, coh3002c, zn, coh3002c, ROT0, "Capcom", "Kikaioh (JAPAN 980914)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4413GAME( 1999, sfex2p,   cpzn2,    coh3002c, zn, coh3002c, ROT0, "Capcom/Arika", "Street Fighter EX 2 Plus (USA 990611)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4414GAME( 1999, sfex2pa,  sfex2p,   coh3002c, zn, coh3002c, ROT0, "Capcom/Arika", "Street Fighter EX 2 Plus (ASIA 990611)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4415GAME( 1999, sfex2pj,  sfex2p,   coh3002c, zn, coh3002c, ROT0, "Capcom/Arika", "Street Fighter EX 2 Plus (JAPAN 990611)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4416GAME( 1999, strider2, cpzn2,    coh3002c, zn, coh3002c, ROT0, "Capcom", "Strider 2 (USA 991213)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4417GAME( 1999, stridr2a, strider2, coh3002c, zn, coh3002c, ROT0, "Capcom", "Strider 2 (ASIA 991213)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4418GAME( 1999, shiryu2,  strider2, coh3002c, zn, coh3002c, ROT0, "Capcom", "Strider Hiryu 2 (JAPAN 991213)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4472GAME( 1997, rvschool, cpzn2,    coh3002c, zn6b, coh3002c, ROT0, "Capcom", "Rival Schools (USA 971117)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4473GAME( 1997, rvschola, rvschool, coh3002c, zn6b, coh3002c, ROT0, "Capcom", "Rival Schools (ASIA 971117)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4474GAME( 1997, jgakuen,  rvschool, coh3002c, zn6b, coh3002c, ROT0, "Capcom", "Justice Gakuen (JAPAN 971117)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4475GAME( 1998, sfex2,    cpzn2,    coh3002c, zn6b, coh3002c, ROT0, "Capcom/Arika", "Street Fighter EX 2 (USA 980526)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4476GAME( 1998, sfex2j,   sfex2,    coh3002c, zn6b, coh3002c, ROT0, "Capcom/Arika", "Street Fighter EX 2 (JAPAN 980312)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4477GAME( 1998, sfex2a,   sfex2,    coh3002c, zn6b, coh3002c, ROT0, "Capcom/Arika", "Street Fighter EX 2 (ASIA 980312)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4478GAME( 1998, plsmaswd, cpzn2,    coh3002c, zn6b, coh3002c, ROT0, "Capcom", "Plasma Sword (USA 980316)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4479GAME( 1998, stargld2, plsmaswd, coh3002c, zn6b, coh3002c, ROT0, "Capcom", "Star Gladiator 2 (JAPAN 980316)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4480GAME( 1998, plsmswda, plsmaswd, coh3002c, zn6b, coh3002c, ROT0, "Capcom", "Plasma Sword (ASIA 980316)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4481GAME( 1998, tgmj,     cpzn2,    coh3002c, zn,   coh3002c, ROT0, "Capcom/Arika", "Tetris The Grand Master (JAPAN 980710)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4482GAME( 1998, techromn, cpzn2,    coh3002c, zn6b, coh3002c, ROT0, "Capcom", "Tech Romancer (EURO 980914)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4483GAME( 1998, techromu, techromn, coh3002c, zn6b, coh3002c, ROT0, "Capcom", "Tech Romancer (USA 980914)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4484GAME( 1998, kikaioh,  techromn, coh3002c, zn6b, coh3002c, ROT0, "Capcom", "Kikaioh (JAPAN 980914)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4485GAME( 1999, sfex2p,   cpzn2,    coh3002c, zn6b, coh3002c, ROT0, "Capcom/Arika", "Street Fighter EX 2 Plus (USA 990611)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4486GAME( 1999, sfex2pa,  sfex2p,   coh3002c, zn6b, coh3002c, ROT0, "Capcom/Arika", "Street Fighter EX 2 Plus (ASIA 990611)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4487GAME( 1999, sfex2pj,  sfex2p,   coh3002c, zn6b, coh3002c, ROT0, "Capcom/Arika", "Street Fighter EX 2 Plus (JAPAN 990611)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4488GAME( 1999, strider2, cpzn2,    coh3002c, zn,   coh3002c, ROT0, "Capcom", "Strider 2 (USA 991213)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4489GAME( 1999, stridr2a, strider2, coh3002c, zn,   coh3002c, ROT0, "Capcom", "Strider 2 (ASIA 991213)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4490GAME( 1999, shiryu2,  strider2, coh3002c, zn,   coh3002c, ROT0, "Capcom", "Strider Hiryu 2 (JAPAN 991213)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44194491
44204492/* Atari */
44214493
44224494/* A dummy driver, so that the bios can be debugged, and to serve as */
44234495/* parent for the coh-1000w.353 file, so that we do not have to include */
44244496/* it in every zip file */
4425GAME( 1996, atpsx,    0,        coh1000w, zn, coh1000w, ROT0, "Atari", "Atari PSX", GAME_IS_BIOS_ROOT )
4497GAME( 1996, atpsx,    0,        coh1000w, zn,       coh1000w, ROT0, "Atari", "Atari PSX", GAME_IS_BIOS_ROOT )
44264498
4427GAME( 1996, primrag2, atpsx,    coh1000w, zn, coh1000w, ROT0, "Atari", "Primal Rage 2 (Ver 0.36a)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
4499GAME( 1996, primrag2, atpsx,    coh1000w, primrag2, coh1000w, ROT0, "Atari", "Primal Rage 2 (Ver 0.36a)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
44284500
44294501/* Acclaim */
44304502
r3115r3116
44334505/* it in every zip file */
44344506GAME( 1995, acpsx,    0,        coh1000a, zn, coh1000a, ROT0, "Acclaim", "Acclaim PSX", GAME_IS_BIOS_ROOT )
44354507
4436GAME( 1996, nbajamex, acpsx,    coh1000a, zn, coh1000a, ROT0, "Acclaim", "NBA Jam Extreme", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
4437GAME( 1996, jdredd,   acpsx,    coh1000a_ide, zn, coh1000a, ROT0, "Acclaim", "Judge Dredd (Rev C Dec. 17 1997)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
4438GAME( 1996, jdreddb,  jdredd,   coh1000a_ide, zn, coh1000a, ROT0, "Acclaim", "Judge Dredd (Rev B Nov. 26 1997)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
4508GAME( 1996, nbajamex, acpsx,    coh1000a,     zn,     coh1000a, ROT0, "Acclaim", "NBA Jam Extreme", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
4509GAME( 1996, jdredd,   acpsx,    coh1000a_ide, jdredd, coh1000a, ROT0, "Acclaim", "Judge Dredd (Rev C Dec. 17 1997)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4510GAME( 1996, jdreddb,  jdredd,   coh1000a_ide, jdredd, coh1000a, ROT0, "Acclaim", "Judge Dredd (Rev B Nov. 26 1997)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44394511
44404512/* Tecmo */
44414513
r3115r3116
44614533
44624534/* Video System */
44634535
4464/* only one game dumped on this system, so coh-1002v.353 is included in the game zip file */
4465GAME( 1996, sncwgltd, 0,        coh1002v, zn, coh1002v, ROT270, "Video System", "Sonic Wings Limited (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4536/* A dummy driver, so that the bios can be debugged, and to serve as */
4537/* parent for the coh-1002v.353 file, so that we do not have to include */
4538/* it in every zip file */
4539GAME( 1996, vspsx,    0,        coh1002v, zn, coh1002v, ROT0,   "Video System", "Video System PSX", GAME_IS_BIOS_ROOT )
44664540
4541GAME( 1996, aerofgts, vspsx,    coh1002v, zn, coh1002v, ROT270, "Video System", "Aero Fighters Special (TAIWAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4542GAME( 1996, sncwgltd, aerofgts, coh1002v, zn, coh1002v, ROT270, "Video System", "Sonic Wings Limited (JAPAN)",    GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4543
44674544/* Taito */
44684545
44694546/* A dummy driver, so that the bios can be debugged, and to serve as */
r3115r3116
44714548/* it in every zip file */
44724549GAME( 1995, taitofx1, 0,        coh1000ta,zn, coh1000ta, ROT0, "Sony/Taito", "Taito FX1", GAME_IS_BIOS_ROOT )
44734550
4474GAME( 1995, sfchamp,  taitofx1, coh1000ta,zn, coh1000ta, ROT0, "Taito", "Super Football Champ (Ver 2.5O)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
4475GAME( 1995, sfchampj, sfchamp,  coh1000ta,zn, coh1000ta, ROT0, "Taito", "Super Football Champ (Ver 2.4J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
4551GAME( 1995, sfchamp,  taitofx1, coh1000ta,zn, coh1000ta, ROT0, "Taito", "Super Football Champ (Ver 2.5O)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4552GAME( 1995, sfchampj, sfchamp,  coh1000ta,zn, coh1000ta, ROT0, "Taito", "Super Football Champ (Ver 2.4J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44764553GAME( 1995, psyforce, taitofx1, coh1000ta,zn, coh1000ta, ROT0, "Taito", "Psychic Force (Ver 2.4O)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44774554GAME( 1995, psyforcj, psyforce, coh1000ta,zn, coh1000ta, ROT0, "Taito", "Psychic Force (Ver 2.4J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44784555GAME( 1995, psyfrcex, psyforce, coh1000ta,zn, coh1000ta, ROT0, "Taito", "Psychic Force EX (Ver 2.0J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4479GAME( 1996, mgcldate, mgcldtex, coh1000ta,zn, coh1000ta, ROT0, "Taito", "Magical Date / Magical Date - dokidoki kokuhaku daisakusen (Ver 2.02J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
4556GAME( 1996, mgcldate, mgcldtex, coh1000ta,zn, coh1000ta, ROT0, "Taito", "Magical Date / Magical Date - dokidoki kokuhaku daisakusen (Ver 2.02J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44804557GAME( 1996, raystorm, taitofx1, coh1000tb,zn, coh1000tb, ROT0, "Taito", "Ray Storm (Ver 2.06A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44814558GAME( 1996, raystorj, raystorm, coh1000tb,zn, coh1000tb, ROT0, "Taito", "Ray Storm (Ver 2.05J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4482GAME( 1996, ftimpact, taitofx1, coh1000tb,zn, coh1000tb, ROT0, "Taito", "Fighters' Impact (Ver 2.02O)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
4483GAME( 1996, ftimpcta, ftimpact, coh1000tb,zn, coh1000tb, ROT0, "Taito", "Fighters' Impact A (Ver 2.00J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
4559GAME( 1996, ftimpact, ftimpcta, coh1000tb,zn, coh1000tb, ROT0, "Taito", "Fighters' Impact (Ver 2.02O)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4560GAME( 1997, ftimpcta, taitofx1, coh1000tb,zn, coh1000tb, ROT0, "Taito", "Fighters' Impact A (Ver 2.00J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44844561GAME( 1997, mgcldtex, taitofx1, coh1000ta,zn, coh1000ta, ROT0, "Taito", "Magical Date EX / Magical Date - sotsugyou kokuhaku daisakusen (Ver 2.01J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4485GAME( 1997, gdarius,  taitofx1, coh1000tb,zn, coh1000tb, ROT0, "Taito", "G-Darius (Ver 2.01J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4486GAME( 1997, gdariusb, gdarius,  coh1000tb,zn, coh1000tb, ROT0, "Taito", "G-Darius (Ver 2.02A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4487GAME( 1997, gdarius2, gdarius,  coh1000tb,zn, coh1000tb, ROT0, "Taito", "G-Darius Ver.2 (Ver 2.03J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4562GAME( 1997, gdarius,  gdarius2, coh1000tb,zn, coh1000tb, ROT0, "Taito", "G-Darius (Ver 2.01J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4563GAME( 1997, gdariusb, gdarius2, coh1000tb,zn, coh1000tb, ROT0, "Taito", "G-Darius (Ver 2.02A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4564GAME( 1997, gdarius2, taitofx1, coh1000tb,zn, coh1000tb, ROT0, "Taito", "G-Darius Ver.2 (Ver 2.03J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44884565
44894566/* A dummy driver, so that the bios can be debugged, and to serve as */
44904567/* parent for the coh-3002t.353 file, so that we do not have to include */
r3115r3116
44964573/* A dummy driver, so that the bios can be debugged, and to serve as */
44974574/* parent for the coh-1002e.353 file, so that we do not have to include */
44984575/* it in every zip file */
4499GAME( 1997, psarc95,  0,        coh1002e, zn, coh1002e, ROT0, "Sony/Eighting/Raizing", "PS Arcade 95", GAME_IS_BIOS_ROOT )
4576GAME( 1997, psarc95,  0,        coh1002e, zn,   coh1002e, ROT0, "Sony/Eighting/Raizing", "PS Arcade 95", GAME_IS_BIOS_ROOT )
45004577
4501GAME( 1997, beastrzr, psarc95,  coh1002e, zn, coh1002e, ROT0, "Eighting/Raizing", "Beastorizer (USA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4502GAME( 1997, beastrzb, psarc95,  coh1002e, zn, coh1002e, ROT0, "Eighting/Raizing", "Beastorizer (USA Bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
4503GAME( 1998, bldyror2, psarc95,  coh1002e, zn, coh1002e, ROT0, "Eighting/Raizing", "Bloody Roar 2 (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4504GAME( 2000, brvblade, tps,      coh1002e, zn, coh1002e, ROT270, "Eighting/Raizing", "Brave Blade (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4578GAME( 1997, beastrzr, psarc95,  coh1002e, zn,   coh1002e, ROT0, "Eighting/Raizing", "Beastorizer (USA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4579GAME( 1997, beastrzb, psarc95,  coh1002e, zn,   coh1002e, ROT0, "Eighting/Raizing", "Beastorizer (USA Bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
4580GAME( 1998, bldyror2, psarc95,  coh1002e, zn6b, coh1002e, ROT0, "Eighting/Raizing", "Bloody Roar 2 (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4581GAME( 2000, brvblade, tps,      coh1002e, zn,   coh1002e, ROT270, "Eighting/Raizing", "Brave Blade (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
45054582
45064583/* Bust a Move 2 uses the PSARC95 bios and ET series security but the top board is completely different */
45074584GAME( 1999, bam2,     psarc95,  bam2,     zn, bam2,     ROT0, "Metro/Enix/Namco", "Bust a Move 2 (JAPANESE ROM ver. 1999/07/17 10:00:00)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
src/mame/drivers/paradise.c
r3115r3116
9898
9999static ADDRESS_MAP_START( paradise_readport, ADDRESS_SPACE_IO, 8 )
100100   AM_RANGE(0x0000, 0x17ff) AM_READ(SMH_RAM         )   // Palette
101   AM_RANGE(0x2010, 0x2010) AM_READ(okim6295_status_0_r   )   // OKI 0
102   AM_RANGE(0x2030, 0x2030) AM_READ(okim6295_status_1_r   )   // OKI 1
103   AM_RANGE(0x2020, 0x2020) AM_READ(input_port_0_r      )   // DSW 1
104   AM_RANGE(0x2021, 0x2021) AM_READ(input_port_1_r      )   // DSW 2
105   AM_RANGE(0x2022, 0x2022) AM_READ(input_port_2_r      )   // P1
106   AM_RANGE(0x2023, 0x2023) AM_READ(input_port_3_r      )   // P2
107   AM_RANGE(0x2024, 0x2024) AM_READ(input_port_4_r      )   // Coins
101   AM_RANGE(0x2010, 0x2010) AM_READ(okim6295_status_0_r)   // OKI 0
102   AM_RANGE(0x2030, 0x2030) AM_READ(okim6295_status_1_r)   // OKI 1
103   AM_RANGE(0x2020, 0x2020) AM_READ_PORT("DSW1")
104   AM_RANGE(0x2021, 0x2021) AM_READ_PORT("DSW2")
105   AM_RANGE(0x2022, 0x2022) AM_READ_PORT("P1")
106   AM_RANGE(0x2023, 0x2023) AM_READ_PORT("P2")
107   AM_RANGE(0x2024, 0x2024) AM_READ_PORT("SYSTEM")
108108   AM_RANGE(0x8000, 0xffff) AM_READ(SMH_RAM         )   // Pixmap
109109ADDRESS_MAP_END
110110
r3115r3116
132132***************************************************************************/
133133
134134static INPUT_PORTS_START( paradise )
135   PORT_START("DSW1")   // IN0 - port $2020 - DSW 1
135   PORT_START("DSW1")   /* port $2020 */
136136   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
137137   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
138138   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
r3115r3116
155155   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
156156   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
157157
158   PORT_START("DSW2")   // IN1 - port $2021 - DSW 2
158   PORT_START("DSW2")   /* port $2021 */
159159   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
160160   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
161161   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
r3115r3116
180180   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
181181   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
182182
183   PORT_START("P1")   // IN2 - port $2022 - Player 1
184   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
185   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
186   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
187   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
188   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
189   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   // alias for button1?
190   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   // alias for button1?
191   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_START1  )
183   PORT_START("P1")   /* port $2022 */
184   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
185   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
186   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
187   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
188   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
189   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   // alias for button1?
190   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   // alias for button1?
191   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
192192
193   PORT_START("P2")   // IN3 - port $2023 - Player 2
194   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
195   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
196   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
197   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
198   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
199   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   // alias for button1?
200   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   // alias for button1?
201   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_START2  )
193   PORT_START("P2")   /* port $2023 */
194   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
195   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
196   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
197   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
198   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
199   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   // alias for button1?
200   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   // alias for button1?
201   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
202202
203   PORT_START("SYSTEM")   // IN4 - port $2024 - Coins
204   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
205   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5)
206   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
207   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
208   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
209   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
210   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_VBLANK  )
211   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
203   PORT_START("SYSTEM")   /* port $2024 */
204   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
205   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5)
206   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
207   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
208   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
209   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
210   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
211   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
212212INPUT_PORTS_END
213213
214214
215215static INPUT_PORTS_START( tgtball )
216   PORT_START("DSW1")   // IN0 - port $2020 - DSW 1
216   PORT_START("DSW1")   /* port $2020 */
217217   PORT_DIPNAME( 0x03, 0x02, "Time" )
218218   PORT_DIPSETTING(    0x03, "60" )
219219   PORT_DIPSETTING(    0x02, "80" )
r3115r3116
236236   PORT_DIPSETTING(    0x80, "Target Score" )
237237   PORT_DIPSETTING(    0x00, "Balls Sequence" )
238238
239   PORT_START("DSW2")   // IN1 - port $2021 - DSW 2
239   PORT_START("DSW2")   /* port $2021 */
240240   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
241241   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
242242   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
r3115r3116
260260   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
261261   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
262262
263   PORT_START("P1")   // IN2 - port $2022 - Player 1
264   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
265   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
266   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
267   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
268   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
269   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
270   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
271   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_START1  )
263   PORT_START("P1")   /* port $2022 */
264   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
265   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
266   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
267   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
268   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
269   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
270   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
271   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
272272
273   PORT_START("P2")   // IN3 - port $2023 - Player 2
274   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
275   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
276   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
277   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
278   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
279   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
280   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
281   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_START2  )
273   PORT_START("P2")   /* port $2023 */
274   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
275   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
276   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
277   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
278   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
279   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
280   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
281   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
282282
283   PORT_START("SYSTEM")   // IN4 - port $2024 - Coins
284   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
285   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5)
286   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
287   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_VBLANK  )
288   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
289   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
290   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
291   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
283   PORT_START("SYSTEM")   /* port $2024 */
284   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
285   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5)
286   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
287   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )
288   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
289   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
290   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
291   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
292292INPUT_PORTS_END
293293
294294static INPUT_PORTS_START( torus )
295   PORT_START("DSW1")   // IN0 - port $2020 - DSW 1
295   PORT_START("DSW1")   /* port $2020 */
296296   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
297297   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
298298   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
r3115r3116
317317   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
318318   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
319319
320   PORT_START("DSW2")   // IN1 - port $2021 - DSW 2
320   PORT_START("DSW2")   /* port $2021 */
321321   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
322322   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
323323   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
343343   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
344344   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
345345
346   PORT_START("P1")   // IN2 - port $2022 - Player 1
347   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
348   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
349   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
350   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
351   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
352   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
353   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
354   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_START1  )
346   PORT_START("P1")   /* port $2022 */
347   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
348   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
349   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
350   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
351   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
352   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
353   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
354   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
355355
356   PORT_START("P2")   // IN3 - port $2023 - Player 2
357   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
358   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
359   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
360   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
361   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
362   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
363   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
364   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_START2  )
356   PORT_START("P2")   /* port $2023 */
357   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
358   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
359   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
360   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
361   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
362   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
363   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
364   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
365365
366   PORT_START("SYSTEM")   // IN4 - port $2024 - Coins
367   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
368   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
369   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
370   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
371   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
372   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
373   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_VBLANK  )
374   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
366   PORT_START("SYSTEM")   /* port $2024 */
367   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
368   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
369   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
370   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
371   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
372   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
373   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
374   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
375375INPUT_PORTS_END
376376
377377
378378static INPUT_PORTS_START( madball )
379   PORT_START("DSW1")   /* 8bit DSW 1 */
379   PORT_START("DSW1")   /* port $2020 */
380380   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
381381   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
382382   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
r3115r3116
400400   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
401401   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
402402
403   PORT_START("DSW2")   /* 8bit DSW 2 */
403   PORT_START("DSW2")   /* port $2021 */
404404   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
405405   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
406406   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
r3115r3116
425425   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
426426   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
427427
428   PORT_START("P1")   // IN2 - port $2022 - Player 1
429   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
430   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
431   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
432   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
433   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
434   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
435   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
436   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_START1  )
428   PORT_START("P1")   /* port $2022 */
429   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
430   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
431   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
432   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
433   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
434   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
435   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
436   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
437437
438   PORT_START("P2")   // IN3 - port $2023 - Player 2
439   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
440   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
441   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
442   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
443   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
444   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
445   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
446   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_START2  )
438   PORT_START("P2")   /* port $2023 */
439   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
440   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
441   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
442   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
443   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
444   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
445   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
446   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
447447
448   PORT_START("SYSTEM")   // IN4 - port $2024 - Coins
449   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
450   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
451   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
452   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
453   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
454   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
455   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_VBLANK  )
456   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
448   PORT_START("SYSTEM")   /* port $2024 */
449   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
450   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
451   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
452   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
453   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
454   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
455   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
456   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
457457INPUT_PORTS_END
458458
459459/***************************************************************************
src/mame/drivers/balsente.c
r3115r3116
845845   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
846846   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "G1:7" )
847847
848   PORT_MODIFY("IN0")
849   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nstocker_bits_r, NULL)
850
848851   /* cheese alert -- we have to map this to player 2 so that it doesn't interfere with
849852       the crosshair controls */
850853   PORT_MODIFY("AN3")
r3115r3116
19481951}
19491952static DRIVER_INIT( nstocker )
19501953{
1951   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9902, 0x9902, 0, 0, nstocker_port2_r);
19521954   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
19531955   expand_roms(machine, EXPAND_NONE | SWAP_HALVES); balsente_shooter = 1; balsente_adc_shift = 1;
19541956}
src/mame/drivers/megadriv.c
r3115r3116
1
21/*
32
4Megadrive / Genesis Rewrite, Take 65498465432356345250432.3  August 06
3    Megadrive / Genesis support
4    PRELIMINARY
55
6Thanks to:
7Charles Macdonald for much useful information (cgfm2.emuviews.com)
6    The Megadrive / Genesis form the basis of a number of official Sega Arcade PCBs
7    as well as a selection of bootlegs.
88
9Long Decription names mostly taken from the GoodGen database
9 Current Issues
1010
11ToDo:
11    Timing is wrong
12     -- DMA timing not emulated
13     -- Sprite render timing incorrect
14     -- Interrupt Timing Problems
1215
13The Code here is terrible for now, this is just for testing
14Fix HV Counter & Raster Implementation (One line errors in some games, others not working eg. Dracula)
15Fix Horizontal timings (currently a kludge, currently doesn't change with resolution changes)
16Add Real DMA timings (using a timer)
17Add All VDP etc. Mirror addresses (not done yet as I prefer to catch odd cases for now)
18Investigate other Bugs (see list bloew)
19Rewrite (again) using cleaner, more readable and better optimized code with knowledge gained
20Add support for other peripherals (6 player pad, Teamplay Adapters, Lightguns, Sega Mouse etc.)
21Sort out set info, making sure all games have right manufacturers, dates etc.
22Make sure everything that needs backup RAM has it setup and working
23Fix Reset glitches
24Add 32X / SegaCD support
25Add Megaplay, Megatech support (needs SMS emulation too)
26Add other obscure features (palette flicker for mid-screen CRAM changes, undocumented register behavior)
27Figure out how sprite masking *really* works
28Add EEprom support in games that need it
16    Known Problems
17     -- g_lem / Lemmings (JU) (REV01) [!]
18      Rasters are off
19     -- g_drac / Bram Stoker's Dracula (U) [!]
20      Doesn't work, Timing Sensisitve
21     -- g_sscc / Sesame Street Counting Cafe (U) [!]
22      Doesn't work
23     -- g_fatr / Fatal Rewind (UE) [!] (and clones)
24      Doesn't work. Timing Sensitive
2925
30Known Issues:
31    Bass Masters Classic Pro Edition (U) [!] - Sega Logo is corrupt
32    Bram Stoker's Dracula (U) [!] - Doesn't Work (HV Timing)
33    Double Dragon 2 - The Revenge (J) [!] - Too Slow?
34    International Superstar Soccer Deluxe (E) [!] - Single line Raster Glitch
35    Lemmings (JU) (REV01) [!] - Rasters off by ~7-8 lines (strange case)
36    Mercs - Sometimes sound doesn't work..
26     -- various
27      Rasters off by 1 line, bottom line corrupt? bad frame timing?
3728
38    Some beta games without proper sound programs seem to crash because the z80 crashes
29    + more
3930
31    ToDo:
32
33    Fix bugs - comprehensive testing!
34
35    Add SegaCD / 32X support (not used by any arcade systems?)
36    Add PicoDrive support (not arcade)
37
38    Change SegaC2 to use the VDP emulation here
39    Change System18 to use the VDP emulation here
40
4041Known Non-Issues (confirmed on Real Genesis)
4142    Castlevania - Bloodlines (U) [!] - Pause text is missing on upside down level
4243    Blood Shot (E) (M4) [!] - corrupt texture in level 1 is correct...
4344*/
4445
46
4547#include "driver.h"
4648#include "deprecat.h"
4749#include "sound/sn76496.h"
r3115r3116
5456#define MEGADRIV_VDP_VRAM(address) megadrive_vdp_vram[(address)&0x7fff]
5557
5658/* the same on all systems? */
57#define MASTER_CLOCK      53693100
59#define MASTER_CLOCK_NTSC      53693100
5860/* timing details */
5961static int megadriv_framerate;
6062static int megadrive_total_scanlines;
r3115r3116
29042906   return megadrive_io_read_data_port_3button(portnum);
29052907}
29062908
2909
2910static READ16_HANDLER( svp_speedup_r )
2911{
2912    cpu_spinuntil_time(ATTOTIME_IN_USEC(100));
2913   return 0x0425;
2914}
2915
2916
29072917static void svp_init(running_machine *machine)
29082918{
29092919   UINT8 *ROM;
r3115r3116
29192929   memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x390000, 0x39ffff, 0, 0, svp_68k_cell1_r);
29202930   memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3a0000, 0x3affff, 0, 0, svp_68k_cell2_r);
29212931
2932   memory_install_read16_handler(machine, 2, ADDRESS_SPACE_PROGRAM, 0x438, 0x438, 0, 0, svp_speedup_r);
2933
29222934   svp.iram = auto_malloc(0x800);
29232935   memory_set_bankptr( 3, svp.iram );
29242936   /* SVP ROM just shares m68k region.. */
r3115r3116
29432955MACHINE_DRIVER_START( megdsvp )
29442956   MDRV_IMPORT_FROM(megadriv)
29452957
2946   MDRV_CPU_ADD("svp", SSP1601, MASTER_CLOCK / 7 * 3) /* ~23 MHz (guessed) */
2958   MDRV_CPU_ADD("svp", SSP1601, MASTER_CLOCK_NTSC / 7 * 3) /* ~23 MHz (guessed) */
29472959   MDRV_CPU_PROGRAM_MAP(svp_ssp_map, 0)
29482960   MDRV_CPU_IO_MAP(svp_ext_map, 0)
29492961   /* IRQs are not used by this CPU */
r3115r3116
50055017
50065018
50075019MACHINE_DRIVER_START( megadriv )
5008   MDRV_CPU_ADD("main", M68000, MASTER_CLOCK / 7) /* 7.67 MHz */
5020   MDRV_CPU_ADD("main", M68000, MASTER_CLOCK_NTSC / 7) /* 7.67 MHz */
50095021   MDRV_CPU_PROGRAM_MAP(megadriv_readmem,megadriv_writemem)
50105022   /* IRQs are handled via the timers */
50115023
5012   MDRV_CPU_ADD("sound", Z80, MASTER_CLOCK / 15) /* 3.58 MHz */
5024   MDRV_CPU_ADD("sound", Z80, MASTER_CLOCK_NTSC / 15) /* 3.58 MHz */
50135025   MDRV_CPU_PROGRAM_MAP(z80_readmem,z80_writemem)
50145026   MDRV_CPU_IO_MAP(z80_portmap,0)
50155027   /* IRQ handled via the timers */
r3115r3116
50385050#if 0
50395051   MDRV_SPEAKER_STANDARD_MONO("mono")
50405052
5041   MDRV_SOUND_ADD("ym", YM2612, MASTER_CLOCK/7) /* 7.67 MHz */
5053   MDRV_SOUND_ADD("ym", YM2612, MASTER_CLOCK_NTSC/7) /* 7.67 MHz */
50425054   MDRV_SOUND_ROUTE(0, "mono", 0.50)
50435055   MDRV_SOUND_ROUTE(1, "mono", 0.50)
50445056
50455057   /* sound hardware */
5046   MDRV_SOUND_ADD("sn", SN76496, MASTER_CLOCK/15)
5058   MDRV_SOUND_ADD("sn", SN76496, MASTER_CLOCK_NTSC/15)
50475059   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) /* 3.58 MHz */
50485060#else
50495061   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
50505062
5051   MDRV_SOUND_ADD("ym", YM2612, MASTER_CLOCK/7) /* 7.67 MHz */
5063   MDRV_SOUND_ADD("ym", YM2612, MASTER_CLOCK_NTSC/7) /* 7.67 MHz */
50525064   MDRV_SOUND_ROUTE(0, "left", 0.50)
50535065   MDRV_SOUND_ROUTE(1, "right", 0.50)
50545066
50555067   /* sound hardware */
5056   MDRV_SOUND_ADD("sn", SN76496, MASTER_CLOCK/15)
5068   MDRV_SOUND_ADD("sn", SN76496, MASTER_CLOCK_NTSC/15)
50575069   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.25) /* 3.58 MHz */
50585070   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right",0.25) /* 3.58 MHz */
50595071#endif
r3115r3116
50635075MACHINE_DRIVER_START( megadpal )
50645076   MDRV_IMPORT_FROM(megadriv)
50655077
5066   MDRV_SCREEN_MODIFY("main")
5078   MDRV_SCREEN_MODIFY("megadriv")
50675079   MDRV_SCREEN_REFRESH_RATE(50)
50685080MACHINE_DRIVER_END
50695081
r3115r3116
50795091   MDRV_CPU_PROGRAM_MAP(sh2slave_readmem,sh2slave_writemem)
50805092MACHINE_DRIVER_END
50815093
5082
50835094/* Callback when the genesis enters interrupt code */
50845095static IRQ_CALLBACK(genesis_int_callback)
50855096{
src/mame/drivers/itech32.c
r3115r3116
270270{
271271   int level = 0;
272272
273   /* update the states */
274   if (vint != -1) vint_state = vint;
275   if (xint != -1) xint_state = xint;
276   if (qint != -1) qint_state = qint;
277273
278274   /* determine which level is active */
279275   if (vint_state) level = 1;
r3115r3116
289285
290286void itech32_update_interrupts(running_machine *machine, int vint, int xint, int qint)
291287{
292   int level = determine_irq_state(vint, xint, qint);
288   /* update the states */
289   if (vint != -1) vint_state = vint;
290   if (xint != -1) xint_state = xint;
291   if (qint != -1) qint_state = qint;
293292
294   /* update it */
295   if (level)
296      cpunum_set_input_line(machine, 0, level, ASSERT_LINE);
297   else
298      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
293   if (is_drivedge) {
294      cpunum_set_input_line(machine, 0, 3, vint_state ? ASSERT_LINE : CLEAR_LINE);
295      cpunum_set_input_line(machine, 0, 4, xint_state ? ASSERT_LINE : CLEAR_LINE);
296      cpunum_set_input_line(machine, 0, 5, qint_state ? ASSERT_LINE : CLEAR_LINE);
297   } else {
298      cpunum_set_input_line(machine, 0, 1, vint_state ? ASSERT_LINE : CLEAR_LINE);
299      cpunum_set_input_line(machine, 0, 2, xint_state ? ASSERT_LINE : CLEAR_LINE);
300      cpunum_set_input_line(machine, 0, 3, qint_state ? ASSERT_LINE : CLEAR_LINE);
301   }
299302}
300303
301304
src/mame/drivers/sspeedr.c
r3115r3116
110110
111111static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
112112   ADDRESS_MAP_GLOBAL_MASK(0xff)
113   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
114   AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r)
115   AM_RANGE(0x03, 0x03) AM_READ(input_port_2_r)
116   AM_RANGE(0x04, 0x04) AM_READ(input_port_3_r)
113   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
114   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
115   AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW")
116   AM_RANGE(0x04, 0x04) AM_READ_PORT("IN2")
117117ADDRESS_MAP_END
118118
119119
r3115r3116
181181   PORT_DIPSETTING(    0xA0, "RAM/ROM Test" )
182182   PORT_DIPSETTING(    0xE0, "Accelerator Adjustment" )
183183
184   PORT_START("IN3")
185   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
186   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
187   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_TOGGLE /* gear shift lever */
188   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
189
184   PORT_START("IN2")
185   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
186   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
187   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_TOGGLE /* gear shift lever */
188   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
190189INPUT_PORTS_END
191190
192191
src/mame/drivers/terracre.c
r3115r3116
146146
147147static READ16_HANDLER( horekid_IN2_r )
148148{
149   int data = input_port_read(machine, "IN1");
149   int data = input_port_read(machine, "IN2");
150150
151151   if (!(data & 0x40))      // FAKE button 3 for "Debug Mode"
152152   {
r3115r3116
211211   AM_RANGE(0x020000, 0x0201ff) AM_READ(SMH_RAM)
212212   AM_RANGE(0x020200, 0x021fff) AM_READ(SMH_RAM)
213213   AM_RANGE(0x023000, 0x023fff) AM_READ(SMH_RAM)
214   AM_RANGE(0x024000, 0x024001) AM_READ(input_port_0_word_r)
215   AM_RANGE(0x024002, 0x024003) AM_READ(input_port_1_word_r)
216   AM_RANGE(0x024004, 0x024005) AM_READ(input_port_2_word_r)
217   AM_RANGE(0x024006, 0x024007) AM_READ(input_port_3_word_r)
214   AM_RANGE(0x024000, 0x024001) AM_READ_PORT("P1")
215   AM_RANGE(0x024002, 0x024003) AM_READ_PORT("P2")
216   AM_RANGE(0x024004, 0x024005) AM_READ_PORT("SYSTEM")
217   AM_RANGE(0x024006, 0x024007) AM_READ_PORT("DSW")
218218ADDRESS_MAP_END
219219
220220static ADDRESS_MAP_START( terracre_writemem, ADDRESS_SPACE_PROGRAM, 16 )
r3115r3116
233233static ADDRESS_MAP_START( amazon_readmem, ADDRESS_SPACE_PROGRAM, 16 )
234234   AM_RANGE(0x000000, 0x01ffff) AM_READ(SMH_ROM)
235235   AM_RANGE(0x040000, 0x040fff) AM_READ(SMH_RAM)
236   AM_RANGE(0x044000, 0x044001) AM_READ(input_port_0_word_r)
237   AM_RANGE(0x044002, 0x044003) AM_READ(input_port_1_word_r)
238   AM_RANGE(0x044004, 0x044005) AM_READ(input_port_2_word_r)
239   AM_RANGE(0x044006, 0x044007) AM_READ(input_port_3_word_r)
236   AM_RANGE(0x044000, 0x044001) AM_READ_PORT("IN0")
237   AM_RANGE(0x044002, 0x044003) AM_READ_PORT("IN1")
238   AM_RANGE(0x044004, 0x044005) AM_READ_PORT("IN2")
239   AM_RANGE(0x044006, 0x044007) AM_READ_PORT("IN3")
240240   AM_RANGE(0x070000, 0x070001) AM_READ(amazon_protection_r)
241241ADDRESS_MAP_END
242242
r3115r3116
287287ADDRESS_MAP_END
288288
289289static INPUT_PORTS_START( terracre )
290   PORT_START("IN0")
290   PORT_START("P1")
291291   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
292292   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
293293   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
r3115r3116
297297   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
298298   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
299299
300   PORT_START("IN1")
300   PORT_START("P2")
301301   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
302302   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
303303   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
r3115r3116
307307   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
308308   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
309309
310   PORT_START("IN2")
310   PORT_START("SYSTEM")
311311   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
312312   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
313313   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 )
r3115r3116
391391   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
392392   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
393393
394   PORT_START("DSW")
394   PORT_START("IN3")
395395   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) )
396396   PORT_DIPSETTING(      0x0003, "3" )
397397   PORT_DIPSETTING(      0x0002, "4" )
r3115r3116
435435INPUT_PORTS_END
436436
437437static INPUT_PORTS_START( horekid )
438   PORT_START("DSW")
438   PORT_START("IN0")
439439   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) )
440440   PORT_DIPSETTING(      0x0003, "3" )
441441   PORT_DIPSETTING(      0x0002, "4" )
r3115r3116
477477//  PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )      // duplicated setting
478478//  PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )      // duplicated setting
479479
480   PORT_START("IN0")
480   PORT_START("IN1")
481481   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
482482   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
483483   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 )
484484   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 )
485485   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE1 )
486   PORT_SERVICE_NO_TOGGLE(0x2000, IP_ACTIVE_LOW)
486   PORT_SERVICE_NO_TOGGLE( 0x2000, IP_ACTIVE_LOW)
487487   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
488488   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
489489
490   PORT_START("IN1")
490   PORT_START("IN2")
491491   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
492492   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
493493   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
497497   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME ("P2 Buttons 1+2 (Debug Cheat)")    // fake button for "Debug Mode" (see read handler)
498498   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
499499
500   PORT_START("IN2")
500   PORT_START("IN3")
501501   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
502502   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
503503   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
src/mame/drivers/undrfire.c
r3115r3116
285285            GAME INPUTS
286286**********************************************************/
287287
288static CUSTOM_INPUT(frame_counter_r)
289{
290   return frame_counter;
291}
292
288293static READ32_HANDLER( undrfire_input_r )
289294{
290295   switch (offset)
291296   {
292297      case 0x00:
293298      {
294         return (input_port_read(machine, "IN0") << 16) | input_port_read(machine, "IN1") |
295              (eeprom_read_bit() << 7) | frame_counter;
299         return input_port_read(machine, "INPUTS");
296300      }
297301
298302      case 0x01:
299303      {
300         return input_port_read(machine, "IN2") | (coin_word << 16);
304         return input_port_read(machine, "SYSTEM") | (coin_word << 16);
301305      }
302306    }
303307
r3115r3116
539543***********************************************************/
540544
541545static INPUT_PORTS_START( undrfire )
542   PORT_START("IN0")
543   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_UNKNOWN )
544   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
545   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
546   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1)   /* ? where is freeze input */
547   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(1)
548   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_PLAYER(1)
549   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(2)
550   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_PLAYER(2)
551   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_UNKNOWN )
552   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN )
553   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN )
554   PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_UNKNOWN )
555   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
556   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
557   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
558   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
546   PORT_START("INPUTS")
547   PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(frame_counter_r, NULL)   /* Frame counter */
548   PORT_BIT( 0x00000002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
549   PORT_BIT( 0x00000004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
550   PORT_BIT( 0x00000008, IP_ACTIVE_LOW,  IPT_UNKNOWN )
551   PORT_BIT( 0x00000010, IP_ACTIVE_LOW,  IPT_UNKNOWN )
552   PORT_BIT( 0x00000020, IP_ACTIVE_LOW,  IPT_UNKNOWN )
553   PORT_BIT( 0x00000040, IP_ACTIVE_LOW,  IPT_UNKNOWN )
554   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* reserved for EEROM */
555   PORT_BIT( 0x00000100, IP_ACTIVE_LOW,  IPT_UNKNOWN )
556   PORT_BIT( 0x00000200, IP_ACTIVE_LOW,  IPT_UNKNOWN )
557   PORT_BIT( 0x00000400, IP_ACTIVE_LOW,  IPT_UNKNOWN )
558   PORT_BIT( 0x00000800, IP_ACTIVE_LOW,  IPT_UNKNOWN )
559   PORT_BIT( 0x00001000, IP_ACTIVE_LOW,  IPT_START1 )
560   PORT_BIT( 0x00002000, IP_ACTIVE_LOW,  IPT_START2 )
561   PORT_BIT( 0x00004000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
562   PORT_BIT( 0x00008000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
559563
560   PORT_START("IN1")
561   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* Frame counter */
562   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
563   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
564   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN )
565   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_UNKNOWN )
566   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_UNKNOWN )
567   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_UNKNOWN )
568   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* reserved for EEROM */
569   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_UNKNOWN )
570   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN )
571   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN )
572   PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_UNKNOWN )
573   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_START1 )
574   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_START2 )
575   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
576   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
564   PORT_BIT( 0x00010000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
565   PORT_BIT( 0x00020000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
566   PORT_BIT( 0x00040000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
567   PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1)   /* ? where is freeze input */
568   PORT_BIT( 0x00100000, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(1)
569   PORT_BIT( 0x00200000, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_PLAYER(1)
570   PORT_BIT( 0x00400000, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(2)
571   PORT_BIT( 0x00800000, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_PLAYER(2)
572   PORT_BIT( 0x01000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
573   PORT_BIT( 0x02000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
574   PORT_BIT( 0x04000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
575   PORT_BIT( 0x08000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
576   PORT_BIT( 0x10000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
577   PORT_BIT( 0x20000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
578   PORT_BIT( 0x40000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
579   PORT_BIT( 0x80000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
577580
578   PORT_START("IN2")
581   PORT_START("SYSTEM")
579582   PORT_SERVICE_NO_TOGGLE(0x01, IP_ACTIVE_LOW)
580583   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_SERVICE1 )
581584   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_COIN1 )
r3115r3116
587590
588591   /* Gun inputs (real range is 0-0xffff: we use standard 0-255 and shift later) */
589592
590   PORT_START("GUNX1")   /* IN 3, P1X */
593   PORT_START("GUNX1")
591594   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)
592595
593   PORT_START("GUNY1")   /* IN 4, P1Y */
596   PORT_START("GUNY1")
594597   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_PLAYER(1)
595598
596   PORT_START("GUNX2")   /* IN 5, P2X */
599   PORT_START("GUNX2")
597600   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)
598601
599   PORT_START("GUNY2")   /* IN 6, P2Y */
602   PORT_START("GUNY2")
600603   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_PLAYER(2)
601604
602605   PORT_START("FAKE")
r3115r3116
608611
609612
610613static INPUT_PORTS_START( cbombers )
611   PORT_START("IN0")
612   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_UNKNOWN )
613   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
614   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
615   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON5 ) /* ? where is freeze input */
616   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_UNKNOWN )
617   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_UNKNOWN )
618   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_UNKNOWN )
619   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_UNKNOWN )
620   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_BUTTON4 ) PORT_NAME("Gear Shift") PORT_TOGGLE
621   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_BUTTON3 ) PORT_NAME("Nitro")
622   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_NAME("Accelerator")
623   PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_NAME("Brake")
624   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
625   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
626   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
627   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
614   PORT_START("INPUTS")
615   PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(frame_counter_r, NULL)   /* Frame counter */
616   PORT_BIT( 0x00000002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
617   PORT_BIT( 0x00000004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
618   PORT_BIT( 0x00000008, IP_ACTIVE_LOW,  IPT_UNKNOWN )
619   PORT_BIT( 0x00000010, IP_ACTIVE_LOW,  IPT_UNKNOWN )
620   PORT_BIT( 0x00000020, IP_ACTIVE_LOW,  IPT_UNKNOWN )
621   PORT_BIT( 0x00000040, IP_ACTIVE_LOW,  IPT_UNKNOWN )
622   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* reserved for EEROM */
623   PORT_BIT( 0x00000100, IP_ACTIVE_LOW,  IPT_UNKNOWN )
624   PORT_BIT( 0x00000200, IP_ACTIVE_LOW,  IPT_UNKNOWN )
625   PORT_BIT( 0x00000400, IP_ACTIVE_LOW,  IPT_UNKNOWN )
626   PORT_BIT( 0x00000800, IP_ACTIVE_LOW,  IPT_UNKNOWN )
627   PORT_BIT( 0x00001000, IP_ACTIVE_LOW,  IPT_START1 )
628   PORT_BIT( 0x00002000, IP_ACTIVE_LOW,  IPT_START2 )
629   PORT_BIT( 0x00004000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
630   PORT_BIT( 0x00008000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
628631
629   PORT_START("IN1")
630   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* Frame counter */
631   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
632   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
633   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN )
634   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_UNKNOWN )
635   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_UNKNOWN )
636   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_UNKNOWN )
637   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* reserved for EEROM */
638   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_UNKNOWN )
639   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN )
640   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN )
641   PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_UNKNOWN )
642   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_START1 )
643   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_START2 )
644   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
645   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
632   PORT_BIT( 0x00010000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
633   PORT_BIT( 0x00020000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
634   PORT_BIT( 0x00040000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
635   PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_BUTTON5 ) /* ? where is freeze input */
636   PORT_BIT( 0x00100000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
637   PORT_BIT( 0x00200000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
638   PORT_BIT( 0x00400000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
639   PORT_BIT( 0x00800000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
640   PORT_BIT( 0x01000000, IP_ACTIVE_LOW,  IPT_BUTTON4 ) PORT_NAME("Gear Shift") PORT_TOGGLE
641   PORT_BIT( 0x02000000, IP_ACTIVE_LOW,  IPT_BUTTON3 ) PORT_NAME("Nitro")
642   PORT_BIT( 0x04000000, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_NAME("Accelerator")
643   PORT_BIT( 0x08000000, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_NAME("Brake")
644   PORT_BIT( 0x10000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
645   PORT_BIT( 0x20000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
646   PORT_BIT( 0x40000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
647   PORT_BIT( 0x80000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
646648
647   PORT_START("IN2")
649   PORT_START("SYSTEM")
648650   PORT_SERVICE_NO_TOGGLE(0x01, IP_ACTIVE_LOW)
649651   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_SERVICE1 )
650652   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_COIN1 )
src/mame/drivers/vertigo.c
r3115r3116
3333   AM_RANGE(0x004000, 0x00400f) AM_READ(vertigo_io_convert) AM_MIRROR(0x001000)
3434   AM_RANGE(0x004010, 0x00401f) AM_READ(vertigo_io_adc) AM_MIRROR(0x001000)
3535   AM_RANGE(0x004020, 0x00402f) AM_READ(vertigo_coin_r) AM_MIRROR(0x001000)
36   AM_RANGE(0x004030, 0x00403f) AM_READ(input_port_3_word_r) AM_MIRROR(0x001000)
36   AM_RANGE(0x004030, 0x00403f) AM_READ_PORT("GIO") AM_MIRROR(0x001000)
3737   AM_RANGE(0x004040, 0x00404f) AM_READ(vertigo_sio_r) AM_MIRROR(0x001000)
3838   AM_RANGE(0x004050, 0x00405f) AM_RAM_WRITE(vertigo_audio_w) AM_MIRROR(0x001000)
3939   AM_RANGE(0x004060, 0x00406f) AM_WRITE(vertigo_motor_w) AM_MIRROR(0x001000)
src/mame/drivers/argus.c
r3115r3116
452452   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
453453   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
454454   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
455   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )\
455   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
456456   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
457457
458458   PORT_START("DSW1")
src/mame/drivers/drw80pkr.c
r3115r3116
2828***********************************************************************************/
2929#include "driver.h"
3030#include "sound/ay8910.h"
31#include "cpu/i8039/i8039.h"
31#include "cpu/mcs48/mcs48.h"
3232
3333static tilemap *bg_tilemap;
3434
r3115r3116
199199
200200static ADDRESS_MAP_START( drw80pkr_io_map, ADDRESS_SPACE_IO, 8 )
201201   AM_RANGE(0x00, 0xff) AM_READWRITE(drw80pkr_cmos_r, drw80pkr_cmos_w) AM_BASE(&pkr_cmos_ram)
202   AM_RANGE(I8039_t1, I8039_t1) AM_RAM
203   AM_RANGE(I8039_p1, I8039_p1) AM_READWRITE(p1_r, p1_w)
204   AM_RANGE(I8039_p2, I8039_p2) AM_READWRITE(p2_r, p2_w)
205    AM_RANGE(I8039_p4, I8039_p4) AM_RAM_WRITE(p4_w)
206    AM_RANGE(I8039_bus, I8039_bus) AM_READWRITE(bus_r, bus_w)
202   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_RAM
203   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(p1_r, p1_w)
204   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(p2_r, p2_w)
205    AM_RANGE(MCS48_PORT_P4, MCS48_PORT_P4) AM_RAM_WRITE(p4_w)
206    AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READWRITE(bus_r, bus_w)
207207ADDRESS_MAP_END
208208
209209/*************************
src/mame/drivers/shangkid.c
r3115r3116
280280   AM_RANGE(0xb003, 0xb003) AM_WRITE(SMH_NOP)      /* BBX interrupt-related */
281281   AM_RANGE(0xb004, 0xb004) AM_WRITE(shangkid_cpu_reset_w)
282282   AM_RANGE(0xb006, 0xb006) AM_WRITE(SMH_NOP)      /* coin counter */
283   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_0_r) /* SW1 */
284   AM_RANGE(0xb801, 0xb801) AM_READ(input_port_1_r) /* coin/start */
285   AM_RANGE(0xb802, 0xb802) AM_READ(input_port_2_r) /* player#2 */
286   AM_RANGE(0xb803, 0xb803) AM_READ(input_port_3_r) /* player#1 */
283   AM_RANGE(0xb800, 0xb800) AM_READ_PORT("DSW")
284   AM_RANGE(0xb801, 0xb801) AM_READ_PORT("SYSTEM")
285   AM_RANGE(0xb802, 0xb802) AM_READ_PORT("P2")
286   AM_RANGE(0xb803, 0xb803) AM_READ_PORT("P1")
287287   AM_RANGE(0xc000, 0xc002) AM_WRITE(SMH_RAM) AM_BASE(&shangkid_videoreg)
288288   AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(shangkid_videoram_w) AM_BASE(&videoram) AM_SHARE(1)
289289   AM_RANGE(0xe000, 0xfdff) AM_RAM AM_SHARE(2)
r3115r3116
301301   AM_RANGE(0xb004, 0xb004) AM_WRITE(shangkid_cpu_reset_w)
302302   AM_RANGE(0xb006, 0xb006) AM_WRITE(SMH_NOP)      /* coin counter */
303303   AM_RANGE(0xb007, 0xb007) AM_WRITE(shangkid_maincpu_bank_w)
304   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_0_r) /* SW1 */
305   AM_RANGE(0xb801, 0xb801) AM_READ(input_port_1_r) /* coin/start */
306   AM_RANGE(0xb802, 0xb802) AM_READ(input_port_2_r) /* player#2 */
307   AM_RANGE(0xb803, 0xb803) AM_READ(input_port_3_r) /* player#1 */
304   AM_RANGE(0xb800, 0xb800) AM_READ_PORT("DSW")
305   AM_RANGE(0xb801, 0xb801) AM_READ_PORT("SYSTEM")
306   AM_RANGE(0xb802, 0xb802) AM_READ_PORT("P2")
307   AM_RANGE(0xb803, 0xb803) AM_READ_PORT("P1")
308308   AM_RANGE(0xc000, 0xc002) AM_WRITE(SMH_RAM) AM_BASE(&shangkid_videoreg)
309309   AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(shangkid_videoram_w) AM_BASE(&videoram) AM_SHARE(1)
310310   AM_RANGE(0xe000, 0xfdff) AM_RAM AM_SHARE(2)
r3115r3116
322322   AM_RANGE(0xb003, 0xb003) AM_WRITE(SMH_NOP)      /* BBX interrupt-related */
323323   AM_RANGE(0xb004, 0xb004) AM_WRITE(shangkid_cpu_reset_w)
324324   AM_RANGE(0xb006, 0xb006) AM_WRITE(SMH_NOP)      /* coin counter */
325   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_0_r) /* SW1 */
326   AM_RANGE(0xb801, 0xb801) AM_READ(input_port_1_r) /* coin/start */
327   AM_RANGE(0xb802, 0xb802) AM_READ(input_port_2_r) /* player#2 */
328   AM_RANGE(0xb803, 0xb803) AM_READ(input_port_3_r) /* player#1 */
325   AM_RANGE(0xb800, 0xb800) AM_READ_PORT("DSW")
326   AM_RANGE(0xb801, 0xb801) AM_READ_PORT("SYSTEM")
327   AM_RANGE(0xb802, 0xb802) AM_READ_PORT("P2")
328   AM_RANGE(0xb803, 0xb803) AM_READ_PORT("P1")
329329   AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(shangkid_videoram_w) AM_SHARE(1)
330330   AM_RANGE(0xe000, 0xfdff) AM_RAM AM_SHARE(2)
331331   AM_RANGE(0xfe00, 0xffff) AM_RAM AM_SHARE(3)
r3115r3116
341341   AM_RANGE(0xb004, 0xb004) AM_WRITE(shangkid_cpu_reset_w)
342342   AM_RANGE(0xb006, 0xb006) AM_WRITE(SMH_NOP)      /* coin counter */
343343   AM_RANGE(0xb007, 0xb007) AM_WRITE(shangkid_maincpu_bank_w)
344   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_0_r) /* SW1 */
345   AM_RANGE(0xb801, 0xb801) AM_READ(input_port_1_r) /* coin/start */
346   AM_RANGE(0xb802, 0xb802) AM_READ(input_port_2_r) /* player#2 */
347   AM_RANGE(0xb803, 0xb803) AM_READ(input_port_3_r) /* player#1 */
344   AM_RANGE(0xb800, 0xb800) AM_READ_PORT("DSW")
345   AM_RANGE(0xb801, 0xb801) AM_READ_PORT("SYSTEM")
346   AM_RANGE(0xb802, 0xb802) AM_READ_PORT("P2")
347   AM_RANGE(0xb803, 0xb803) AM_READ_PORT("P1")
348348   AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(shangkid_videoram_w) AM_SHARE(1)
349349   AM_RANGE(0xe000, 0xfdff) AM_RAM AM_SHARE(2)
350350   AM_RANGE(0xfe00, 0xffff) AM_RAM AM_SHARE(3)
r3115r3116
457457   AM_RANGE(0xd800, 0xdbff) AM_RAM
458458   AM_RANGE(0xe000, 0xe000) AM_WRITENOP /* IRQ disable */
459459   AM_RANGE(0xe001, 0xe002) AM_RAM /* screen flip */
460   AM_RANGE(0xe800, 0xe800) AM_READ(input_port_0_r)
461   AM_RANGE(0xe801, 0xe801) AM_READ(input_port_1_r)
462   AM_RANGE(0xe802, 0xe802) AM_READ(input_port_2_r)
463   AM_RANGE(0xe803, 0xe803) AM_READ(input_port_3_r)
460   AM_RANGE(0xe800, 0xe800) AM_READ_PORT("SYSTEM")
461   AM_RANGE(0xe801, 0xe801) AM_READ_PORT("P1")
462   AM_RANGE(0xe802, 0xe802) AM_READ_PORT("P2")
463   AM_RANGE(0xe803, 0xe803) AM_READ_PORT("DSW")
464464   AM_RANGE(0xf000, 0xf7ff) AM_RAM /* work ram */
465465ADDRESS_MAP_END
466466
r3115r3116
503503/***************************************************************************************/
504504
505505static INPUT_PORTS_START( dynamski )
506   PORT_START("IN0")
506   PORT_START("SYSTEM")
507507   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
508508   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
509509   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service */
r3115r3116
513513   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
514514   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
515515
516   PORT_START("IN1")
516   PORT_START("P1")
517517   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
518518   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
519519   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
r3115r3116
523523   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
524524   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
525525
526   PORT_START("IN2")
526   PORT_START("P2")
527527   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
528528   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
529529   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
r3115r3116
559559INPUT_PORTS_END
560560
561561static INPUT_PORTS_START( chinhero )
562   PORT_START("SYSTEM")
563   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
564   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
565   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service */
566   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
567   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
568   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
569   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
570   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
571
572   PORT_START("P1")
573   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
574   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
575   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
576   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
577   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
578   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
579   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 )
580   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 )
581
582   PORT_START("P2")
583   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
584   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2)
585   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2)
586   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2)
587   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
588   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
589   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
590   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2)
591
562592   PORT_START("DSW")
563593   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
564594   PORT_DIPSETTING(   0x01, "3" )
r3115r3116
581611   PORT_DIPSETTING(   0x40, DEF_STR( Medium ) )
582612   PORT_DIPSETTING(   0x80, DEF_STR( Hard ) )
583613   PORT_DIPSETTING(   0xc0, DEF_STR( Hardest ) )
614INPUT_PORTS_END
584615
585   PORT_START("IN0")
616static INPUT_PORTS_START( shangkid )
617   PORT_START("SYSTEM")
586618   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
587619   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
588620   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service */
r3115r3116
590622   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
591623   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
592624   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
593   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
625   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* busy flag? */
594626
595   PORT_START("IN1")
596   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
597   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2)
598   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2)
599   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2)
600   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
601   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
602   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
603   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2)
627   PORT_START("P1")
628   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* kick */
629   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) /* punch */
630   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
631   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
632   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
633   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
634   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
635   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
604636
605   PORT_START("IN2")
606   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
607   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
608   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
609   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
610   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
611   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
612   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 )
613   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 )
614INPUT_PORTS_END
637   PORT_START("P2")
638   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) /* kick */
639   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) /* punch */
640   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
641   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
642   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
643   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
644   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
645   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
615646
616static INPUT_PORTS_START( shangkid )
617647   PORT_START("DSW")
618648   /*  There are also two potentiometers on the PCB for volume:
619649    **  RV1 - Music
r3115r3116
642672   PORT_DIPSETTING(   0x40, DEF_STR( Medium ) )
643673   PORT_DIPSETTING(   0x80, DEF_STR( Hard ) )
644674   PORT_DIPSETTING(   0xc0, DEF_STR( Hardest ) )
645
646   PORT_START("IN0")
647   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
648   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
649   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service */
650   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
651   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
652   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
653   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
654   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* busy flag? */
655
656   PORT_START("IN1")
657   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) /* kick */
658   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) /* punch */
659   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
660   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
661   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
662   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
663   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
664   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
665
666   PORT_START("IN2")
667   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* kick */
668   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) /* punch */
669   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
670   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
671   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
672   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
673   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
674   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
675675INPUT_PORTS_END
676676
677677/***************************************************************************************/
src/mame/drivers/trackfld.c
r3115r3116
116116
117117
118118static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
119   AM_RANGE(0x1200, 0x1200) AM_READ(input_port_4_r) /* DIP 2 */
120   AM_RANGE(0x1280, 0x1280) AM_READ(input_port_0_r) /* IO Coin */
121   AM_RANGE(0x1281, 0x1281) AM_READ(input_port_1_r) /* P1 IO */
122   AM_RANGE(0x1282, 0x1282) AM_READ(input_port_2_r) /* P2 IO */
123   AM_RANGE(0x1283, 0x1283) AM_READ(input_port_3_r) /* DIP 1 */
119   AM_RANGE(0x1200, 0x1200) AM_READ_PORT("DSW2")
120   AM_RANGE(0x1280, 0x1280) AM_READ_PORT("SYSTEM")
121   AM_RANGE(0x1281, 0x1281) AM_READ_PORT("IN0")
122   AM_RANGE(0x1282, 0x1282) AM_READ_PORT("IN1")
123   AM_RANGE(0x1283, 0x1283) AM_READ_PORT("DSW1")
124124   AM_RANGE(0x1800, 0x1fff) AM_READ(SMH_RAM)
125125   AM_RANGE(0x2800, 0x3fff) AM_READ(SMH_RAM)
126126   AM_RANGE(0x6000, 0xffff) AM_READ(SMH_ROM)
r3115r3116
152152static ADDRESS_MAP_START( reaktor_readmem, ADDRESS_SPACE_PROGRAM, 8 )
153153   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
154154   /* all usual addresses +0x8000 */
155   AM_RANGE(0x9200, 0x9200) AM_READ(input_port_4_r) /* DIP 2 */
156   AM_RANGE(0x9280, 0x9280) AM_READ(input_port_0_r) /* IO Coin */
157   AM_RANGE(0x9281, 0x9281) AM_READ(input_port_1_r) /* P1 IO */
158   AM_RANGE(0x9282, 0x9282) AM_READ(input_port_2_r) /* P2 IO */
159   AM_RANGE(0x9283, 0x9283) AM_READ(input_port_3_r) /* DIP 1 */
155   AM_RANGE(0x9200, 0x9200) AM_READ_PORT("DSW2")
156   AM_RANGE(0x9280, 0x9280) AM_READ_PORT("SYSTEM")
157   AM_RANGE(0x9281, 0x9281) AM_READ_PORT("IN0")
158   AM_RANGE(0x9282, 0x9282) AM_READ_PORT("IN1")
159   AM_RANGE(0x9283, 0x9283) AM_READ_PORT("DSW1")
160160   AM_RANGE(0x9800, 0x9fff) AM_READ(SMH_RAM)
161161   AM_RANGE(0xa800, 0xbfff) AM_READ(SMH_RAM)
162162ADDRESS_MAP_END
r3115r3116
197197ADDRESS_MAP_END
198198
199199static ADDRESS_MAP_START( mastkin_readmem, ADDRESS_SPACE_PROGRAM, 8 )
200   AM_RANGE(0x1200, 0x1200) AM_READ(input_port_4_r) /* DIP 2 */
201   AM_RANGE(0x1280, 0x1280) AM_READ(input_port_0_r) /* IO Coin */
202   AM_RANGE(0x1281, 0x1281) AM_READ(input_port_1_r) /* P1 IO */
203//  AM_RANGE(0x1282, 0x1282) AM_READ(input_port_2_r) /* unused */
204   AM_RANGE(0x1283, 0x1283) AM_READ(input_port_3_r) /* DIP 1 */
200   AM_RANGE(0x1200, 0x1200) AM_READ_PORT("DSW2")
201   AM_RANGE(0x1280, 0x1280) AM_READ_PORT("SYSTEM")
202   AM_RANGE(0x1281, 0x1281) AM_READ_PORT("IN0")
203//  AM_RANGE(0x1282, 0x1282) AM_READ_PORT("IN1") /* unused */
204   AM_RANGE(0x1283, 0x1283) AM_READ_PORT("DSW1")
205205   AM_RANGE(0x1800, 0x1fff) AM_READ(SMH_RAM)
206206   AM_RANGE(0x2800, 0x3fff) AM_READ(SMH_RAM)
207207   AM_RANGE(0x6000, 0xffff) AM_READ(SMH_ROM)
r3115r3116
235235   AM_RANGE(0x1083, 0x1084) AM_WRITE(coin_w)
236236   AM_RANGE(0x1087, 0x1087) AM_WRITE(interrupt_enable_w)
237237   AM_RANGE(0x1100, 0x1100) AM_WRITE(soundlatch_w)
238   AM_RANGE(0x1200, 0x1200) AM_READ(input_port_4_r) /* DIP 2 */
239   AM_RANGE(0x1280, 0x1280) AM_READ(input_port_0_r) /* IO Coin */
240   AM_RANGE(0x1281, 0x1281) AM_READ(input_port_1_r) /* P1 IO */
241   AM_RANGE(0x1282, 0x1282) AM_READ(input_port_2_r) /* P2 IO */
242   AM_RANGE(0x1283, 0x1283) AM_READ(input_port_3_r) /* DIP 1 */
238   AM_RANGE(0x1200, 0x1200) AM_READ_PORT("DSW2")
239   AM_RANGE(0x1280, 0x1280) AM_READ_PORT("SYSTEM")
240   AM_RANGE(0x1281, 0x1281) AM_READ_PORT("IN0")
241   AM_RANGE(0x1282, 0x1282) AM_READ_PORT("IN1")
242   AM_RANGE(0x1283, 0x1283) AM_READ_PORT("DSW1")
243243   AM_RANGE(0x1800, 0x183f) AM_RAM AM_BASE(&spriteram_2)
244244   AM_RANGE(0x1840, 0x185f) AM_RAM AM_BASE(&trackfld_scroll)
245245   AM_RANGE(0x1860, 0x1bff) AM_RAM
r3115r3116
308308
309309
310310static INPUT_PORTS_START( trackfld )
311   PORT_START("IN0")
311   PORT_START("SYSTEM")
312312   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
313313   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
314314   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
318318   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
319319   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
320320
321   PORT_START("IN1")
321   PORT_START("IN0")
322322   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
323323   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
324324   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
r3115r3116
328328   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
329329   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
330330
331   PORT_START("IN2")
331   PORT_START("IN1")
332332   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3  ) PORT_PLAYER(3) //PORT_COCKTAIL
333333   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2  ) PORT_PLAYER(3) //PORT_COCKTAIL
334334   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1  ) PORT_PLAYER(3) //PORT_COCKTAIL
r3115r3116
338338   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1  ) PORT_PLAYER(4) //PORT_COCKTAIL
339339   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
340340
341   PORT_START("DSW0")
341   PORT_START("DSW1")
342342   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
343343   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
344344   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
376376/* 0x00 disables Coin 2. It still accepts coins and makes the sound, but
377377   it doesn't give you any credit */
378378
379   PORT_START("DSW1")
379   PORT_START("DSW2")
380380   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
381381   PORT_DIPSETTING(    0x01, "1" )
382382   PORT_DIPSETTING(    0x00, "2" )
r3115r3116
385385   PORT_DIPSETTING(    0x00, "Game Continues" )
386386   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
387387   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
388   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ))
388   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
389389   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
390390   PORT_DIPSETTING(    0x08, DEF_STR( None ) )
391391   PORT_DIPSETTING(    0x00, "100000" )
r3115r3116
403403INPUT_PORTS_END
404404
405405static INPUT_PORTS_START( atlantol )
406   PORT_START("IN0")
406   PORT_START("SYSTEM")
407407   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
408408   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
409409   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
413413   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
414414   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
415415
416   PORT_START("IN1")
416   PORT_START("IN0")
417417   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
418418   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
419419   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
r3115r3116
423423   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
424424   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
425425
426   PORT_START("IN2")
426   PORT_START("IN1")
427427   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(3) //PORT_COCKTAIL
428428   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1  ) PORT_PLAYER(3) //PORT_COCKTAIL
429429   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(3) //PORT_COCKTAIL
r3115r3116
433433   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(4) //PORT_COCKTAIL
434434   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
435435
436   PORT_START("DSW0")
436   PORT_START("DSW1")
437437   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
438438   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
439439   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
471471/* 0x00 disables Coin 2. It still accepts coins and makes the sound, but
472472   it doesn't give you any credit */
473473
474   PORT_START("DSW1")
474   PORT_START("DSW2")
475475   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
476476   PORT_DIPSETTING(    0x01, "1" )
477477   PORT_DIPSETTING(    0x00, "2" )
r3115r3116
498498INPUT_PORTS_END
499499
500500static INPUT_PORTS_START( mastkin )
501   PORT_START("IN0")
501   PORT_START("SYSTEM")
502502   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
503503   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
504504   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
508508   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
509509   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
510510
511   PORT_START("IN1")
511   PORT_START("IN0")
512512   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
513513   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
514514   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
r3115r3116
518518   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
519519   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
520520
521   PORT_START("DSW0")
521   PORT_START("DSW1")
522522   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Allow_Continue ) )
523523   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
524524   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
539539   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )      // Stored at 0x284e but not read back
540540   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )      // Cocktail Mode, not used
541541
542   PORT_START("DSW1")
542   PORT_START("DSW2")
543543   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_B ) )
544544   PORT_DIPSETTING(    0x0a, DEF_STR( 4C_1C ) )
545545   PORT_DIPSETTING(    0x09, DEF_STR( 3C_1C ) )
r3115r3116
577577INPUT_PORTS_END
578578
579579static INPUT_PORTS_START( wizzquiz )
580   PORT_START("IN0")
580   PORT_START("SYSTEM")
581581   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
582582   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
583583   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
587587   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
588588   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
589589
590   PORT_START("IN1")
590   PORT_START("IN0")
591591   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 - C")
592592   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 - B")
593593   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 - A")
r3115r3116
597597   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 - A")
598598   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
599599
600   PORT_START("IN2")
600   PORT_START("IN1")
601601   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
602602   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
603603   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
r3115r3116
607607   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
608608   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
609609
610   PORT_START("DSW0")
610   PORT_START("DSW1")
611611   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
612612   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
613613   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
643643   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
644644   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) ) // must set both Free Play
645645
646   PORT_START("DSW1")
646   PORT_START("DSW2")
647647   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
648648   PORT_DIPSETTING(    0x03, "3" )
649649   PORT_DIPSETTING(    0x02, "4" )
r3115r3116
670670INPUT_PORTS_END
671671
672672static INPUT_PORTS_START( reaktor )
673   PORT_START("IN0")
673   PORT_START("SYSTEM")
674674   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
675675   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
676676   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
680680   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
681681   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
682682
683   PORT_START("IN1")
683   PORT_START("IN0")
684684   /* controls seem to be shared by both players */
685685   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_JOYSTICK_LEFT )
686686   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICK_RIGHT )
r3115r3116
691691   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // probably unused
692692   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // probably unused
693693
694   PORT_START("IN2")
694   PORT_START("IN1")
695695     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // probably unused
696696   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // probably unused
697697   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // probably unused
r3115r3116
701701   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // probably unused
702702   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // probably unused
703703
704   PORT_START("DSW0")
704   PORT_START("DSW1")
705705    PORT_DIPNAME( 0x01,   0x01, "Pricing" )
706706    PORT_DIPSETTING(      0x01, "10p / 25c per play" )
707707    PORT_DIPSETTING(      0x00, "20p / 50c per play" )
r3115r3116
726726    PORT_DIPSETTING(      0x80, "20000" )
727727    PORT_DIPSETTING(      0x00, "30000" )
728728
729   PORT_START("DSW1")
729   PORT_START("DSW2")
730730    PORT_DIPNAME( 0x01,   0x01, "Game Orientation" )
731731    PORT_DIPSETTING(      0x01, "For Vertical Monitor" )
732732    PORT_DIPSETTING(      0x00, "For Horizontal Monitor" )
src/mame/drivers/punchout.c
r3115r3116
136136
137137
138138
139static READ8_HANDLER( punchout_input_3_r )
139static CUSTOM_INPUT( punchout_vlm5030_busy_r )
140140{
141   int data = input_port_read(machine, "DSW1");
142   /* bit 4 is busy pin level */
143   if( vlm5030_bsy() ) data &= ~0x10;
144   else data |= 0x10;
145   return data;
141   /* bit 4 of DSW1 is busy pin level */
142   return (vlm5030_bsy()) ? 0x00 : 0x01;
146143}
147144
148145static WRITE8_HANDLER( punchout_speech_reset_w )
r3115r3116
429426   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
430427   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
431428   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW2")
432   AM_RANGE(0x03, 0x03) AM_READ(punchout_input_3_r)
429   AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1")
433430
434431   /* protection ports - Super Punchout only (move to install handler?) */
435432   AM_RANGE(0x07, 0x07) AM_READ(spunchout_prot_0_r)
r3115r3116
551548   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_5C ) )
552549   PORT_DIPSETTING(    0x07, DEF_STR( 1C_6C ) )
553550   PORT_DIPSETTING(    0x0f, DEF_STR( Free_Play ) )
554   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )      /* VLM5030 busy signal */
551   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(punchout_vlm5030_busy_r, NULL)   /* VLM5030 busy signal */
555552   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
556553   PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "R18:!1" )      /* Not documented, R18 resistor */
557554   PORT_DIPNAME( 0x80, 0x00, "Copyright" )            PORT_DIPLOCATION("R19:!1") /* Not documented, R19 resistor */
r3115r3116
638635   PORT_DIPSETTING(    0x0d, "d" )
639636   PORT_DIPSETTING(    0x0e, "e" )
640637   PORT_DIPSETTING(    0x0f, "f" )
638   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(punchout_vlm5030_busy_r, NULL)   /* VLM5030 busy signal */
641639   PORT_DIPNAME( 0x40, 0x00, "Coin Slots" )         PORT_DIPLOCATION("R18:!1") /* R18 resistor */
642640   PORT_DIPSETTING(    0x40, "1" )
643641   PORT_DIPSETTING(    0x00, "2" )
src/mame/drivers/tecmo.c
r3115r3116
6464VIDEO_START( tecmo );
6565VIDEO_UPDATE( tecmo );
6666
67static int adpcm_pos,adpcm_end;
68static int adpcm_data;
6769
6870
6971static WRITE8_HANDLER( tecmo_bankswitch_w )
r3115r3116
8284   cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE);
8385}
8486
85static int adpcm_pos,adpcm_end;
86
8787static WRITE8_HANDLER( tecmo_adpcm_start_w )
8888{
8989   adpcm_pos = data << 8;
r3115r3116
9999}
100100static void tecmo_adpcm_int(running_machine *machine, int num)
101101{
102   static int adpcm_data = -1;
103
104102   if (adpcm_pos >= adpcm_end ||
105103            adpcm_pos >= memory_region_length(machine, "adpcm"))
106104      msm5205_reset_w(0,1);
r3115r3116
124122   AM_RANGE(0x0000, 0xbfff) AM_READ(SMH_ROM)
125123   AM_RANGE(0xc000, 0xefff) AM_READ(SMH_RAM)
126124   AM_RANGE(0xf000, 0xf7ff) AM_READ(SMH_BANK1)
127   AM_RANGE(0xf800, 0xf800) AM_READ(input_port_0_r)
128   AM_RANGE(0xf801, 0xf801) AM_READ(input_port_1_r)
129   AM_RANGE(0xf802, 0xf802) AM_READ(input_port_2_r)
130   AM_RANGE(0xf803, 0xf803) AM_READ(input_port_3_r)
131   AM_RANGE(0xf804, 0xf804) AM_READ(input_port_4_r)
132   AM_RANGE(0xf805, 0xf805) AM_READ(input_port_5_r)
133   AM_RANGE(0xf806, 0xf806) AM_READ(input_port_6_r)
134   AM_RANGE(0xf807, 0xf807) AM_READ(input_port_7_r)
135   AM_RANGE(0xf808, 0xf808) AM_READ(input_port_8_r)
136   AM_RANGE(0xf809, 0xf809) AM_READ(input_port_9_r)
137   AM_RANGE(0xf80f, 0xf80f) AM_READ(input_port_10_r)
125   AM_RANGE(0xf800, 0xf800) AM_READ_PORT("JOY1")
126   AM_RANGE(0xf801, 0xf801) AM_READ_PORT("BUTTONS1")
127   AM_RANGE(0xf802, 0xf802) AM_READ_PORT("JOY2")
128   AM_RANGE(0xf803, 0xf803) AM_READ_PORT("BUTTONS2")
129   AM_RANGE(0xf804, 0xf804) AM_READ_PORT("SYS_0")
130   AM_RANGE(0xf805, 0xf805) AM_READ_PORT("SYS_1")
131   AM_RANGE(0xf806, 0xf806) AM_READ_PORT("DSWA_0")
132   AM_RANGE(0xf807, 0xf807) AM_READ_PORT("DSWA_1")
133   AM_RANGE(0xf808, 0xf808) AM_READ_PORT("DSWB_0")
134   AM_RANGE(0xf809, 0xf809) AM_READ_PORT("DSWB_1")
135   AM_RANGE(0xf80f, 0xf80f) AM_READ_PORT("SYS_2")
138136ADDRESS_MAP_END
139137
140138static ADDRESS_MAP_START( rygar_writemem, ADDRESS_SPACE_PROGRAM, 8 )
r3115r3116
228226
229227
230228static INPUT_PORTS_START( rygar )
231   PORT_START("JOY1")   /* IN0 bits 0-3 */
229   PORT_START("JOY1")
232230   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
233231   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
234232   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
235233   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
236234
237   PORT_START("BUTTONS1")   /* IN1 bits 0-3 */
235   PORT_START("BUTTONS1")
238236   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
239237   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
240238   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
241239   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
242240
243   PORT_START("JOY2")   /* IN2 bits 0-3 */
241   PORT_START("JOY2")
244242   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
245243   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
246244   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
247245   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
248246
249   PORT_START("BUTTONS2")   /* IN3 bits 0-3 */
247   PORT_START("BUTTONS2")
250248   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
251249   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
252250   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
253251   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
254252
255   PORT_START("SYS_0")   /* IN4 bits 0-3 */
253   PORT_START("SYS_0")
256254   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START2 )
257255   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
258256   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
259257   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
260258
261   PORT_START("SYS_1")   /* unused? */
259   PORT_START("SYS_1")      /* unused? */
262260   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
263261
264   PORT_START("DSWA_0")   /* DSWA bit 0-3 */
262   PORT_START("SYS_2")      /* unused? */
263   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
264
265   PORT_START("DSWA_0")
265266   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
266267   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
267268   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
r3115r3116
273274   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
274275   PORT_DIPSETTING(    0x0C, DEF_STR( 1C_3C ) )
275276
276   PORT_START("DSWA_1")   /* DSWA bit 4-7 */
277   PORT_START("DSWA_1")
277278   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
278279   PORT_DIPSETTING(    0x03, "2" )
279280   PORT_DIPSETTING(    0x00, "3" )
r3115r3116
286287   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
287288   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
288289
289   PORT_START("DSWB_0")   /* DSWB bit 0-3 */
290   PORT_START("DSWB_0")
290291   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
291292   PORT_DIPSETTING(    0x00, "50000 200000 500000" )
292293   PORT_DIPSETTING(    0x01, "100000 300000 600000" )
r3115r3116
299300   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
300301   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
301302
302   PORT_START("DSWB_1")   /* DSWB bit 4-7 */
303   PORT_START("DSWB_1")
303304   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
304305   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
305306   PORT_DIPSETTING(    0x01, DEF_STR( Normal ) )
r3115r3116
311312   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Allow_Continue ) )
312313   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
313314   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
314
315   PORT_START("UNK")   /* unused? */
316   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
317315INPUT_PORTS_END
318316
319317static INPUT_PORTS_START( gemini )
320   PORT_START("JOY1")   /* IN0 bits 0-3 */
318   PORT_START("JOY1")
321319   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
322320   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
323321   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
324322   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
325323
326   PORT_START("BUTTONS1")   /* IN1 bits 0-3 */
324   PORT_START("BUTTONS1")
327325   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 )
328326   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 )
329327   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
330328   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
331329
332   PORT_START("JOY2")   /* IN2 bits 0-3 */
330   PORT_START("JOY2")
333331   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
334332   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
335333   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
336334   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
337335
338   PORT_START("BUTTONS2")   /* IN3 bits 0-3 */
336   PORT_START("BUTTONS2")
339337   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
340338   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
341339   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
342340   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
343341
344   PORT_START("SYS_0")   /* unused? */
342   PORT_START("SYS_0")      /* unused? */
345343   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
346344
347   PORT_START("SYS_1")   /* IN4 bits 0-3 */
345   PORT_START("SYS_1")
348346   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
349347   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
350348   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
351349   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
352350
353   PORT_START("DSWA_0")   /* DSWA bit 0-3 */
351   PORT_START("SYS_2")      /* unused? */
352   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
353
354   PORT_START("DSWA_0")
354355   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_A ) )
355356   PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
356357   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
r3115r3116
364365   PORT_DIPSETTING(    0x00, "Round 6" )
365366   PORT_DIPSETTING(    0x08, "Round 7" )
366367
367   PORT_START("DSWA_1")   /* DSWA bit 4-7 */
368   PORT_START("DSWA_1")
368369   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_B ) )
369370   PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
370371   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
r3115r3116
378379   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
379380   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
380381
381   PORT_START("DSWB_0")   /* DSWB bit 0-3 */
382   PORT_START("DSWB_0")
382383   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
383384   PORT_DIPSETTING(    0x03, "2" )
384385   PORT_DIPSETTING(    0x00, "3" )
r3115r3116
390391   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
391392   PORT_DIPSETTING(    0x0c, DEF_STR( Hardest ) )
392393
393   PORT_START("DSWB_1")   /* DSWB bit 4-7 */
394   PORT_START("DSWB_1")
394395   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Bonus_Life ) )
395396   PORT_DIPSETTING(    0x00, "50000 200000" )
396397   PORT_DIPSETTING(    0x01, "50000 300000" )
r3115r3116
403404   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
404405   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
405406   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
406
407   PORT_START("UNK")   /* unused? */
408   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
409407INPUT_PORTS_END
410408
411409static INPUT_PORTS_START( silkworm )
412   PORT_START("JOY1")   /* IN0 bits 0-3 */
410   PORT_START("JOY1")
413411   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
414412   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
415413   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
416414   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
417415
418   PORT_START("BUTTONS1")   /* IN0 bits 4-7 */
416   PORT_START("BUTTONS1")
419417   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 )
420418   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 )
421419   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 )
422420   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* unused? */
423421
424   PORT_START("JOY2")   /* IN1 bits 0-3 */
422   PORT_START("JOY2")
425423   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
426424   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
427425   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
428426   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
429427
430   PORT_START("BUTTONS2")   /* IN1 bits 4-7 */
428   PORT_START("BUTTONS2")
431429   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
432430   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
433431   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
434432   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* unused? */
435433
436   PORT_START("SYS_0")   /* unused? */
434   PORT_START("SYS_0")      /* unused? */
437435   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
438436
439   PORT_START("SYS_1")   /* unused? */
437   PORT_START("SYS_1")      /* unused? */
440438   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
441439
442   PORT_START("DSWA_0")   /* DSWA bit 0-3 */
440   PORT_START("SYS_2")
441   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
442   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
443   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
444   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
445
446   PORT_START("DSWA_0")
443447   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
444448   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
445449   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
r3115r3116
451455   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
452456   PORT_DIPSETTING(    0x0C, DEF_STR( 1C_3C ) )
453457
454   PORT_START("DSWA_1")   /* DSWA bit 4-7 */
458   PORT_START("DSWA_1")
455459   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
456460   PORT_DIPSETTING(    0x03, "2" )
457461   PORT_DIPSETTING(    0x00, "3" )
r3115r3116
464468   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
465469   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
466470
467   PORT_START("DSWB_0")   /* DSWB bit 0-3 */
471   PORT_START("DSWB_0")
468472   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Bonus_Life ) )
469473   PORT_DIPSETTING(    0x00, "50000 200000 500000" )
470474   PORT_DIPSETTING(    0x01, "100000 300000 800000" )
r3115r3116
478482   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
479483   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
480484
481   PORT_START("DSWB_1")   /* DSWB bit 4-7 */
485   PORT_START("DSWB_1")
482486   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Difficulty ) )
483487   PORT_DIPSETTING(    0x00, "0" )
484488   PORT_DIPSETTING(    0x01, "1" )
r3115r3116
490494   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Allow_Continue ) )
491495   PORT_DIPSETTING(    0x08, DEF_STR( No ) )
492496   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
493
494   PORT_START("UNK")   /* COIN */
495   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
496   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
497   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
498   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
499497INPUT_PORTS_END
500498
501499
r3115r3116
561559};
562560
563561
562static MACHINE_RESET( rygar )
563{
564   adpcm_pos = 0;
565   adpcm_end = 0;
566   adpcm_data = -1;
567}
564568
565569static MACHINE_DRIVER_START( rygar )
566570
r3115r3116
586590   MDRV_VIDEO_START(tecmo)
587591   MDRV_VIDEO_UPDATE(tecmo)
588592
593   MDRV_MACHINE_RESET( rygar )
594
589595   /* sound hardware */
590596   MDRV_SPEAKER_STANDARD_MONO("mono")
591597
src/mame/drivers/news.c
r3115r3116
2121static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
2222   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
2323   AM_RANGE(0x8000, 0x8fff) AM_READ(SMH_RAM)
24   AM_RANGE(0xc000, 0xc000) AM_READ(input_port_0_r)
25   AM_RANGE(0xc001, 0xc001) AM_READ(input_port_1_r)
24   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("DSW")
25   AM_RANGE(0xc001, 0xc001) AM_READ_PORT("INPUTS")
2626   AM_RANGE(0xc002, 0xc002) AM_READ(okim6295_status_0_r)
2727   AM_RANGE(0xe000, 0xffff) AM_READ(SMH_RAM)
2828ADDRESS_MAP_END
r3115r3116
3939
4040
4141static INPUT_PORTS_START( news )
42   PORT_START("DSW")   /* DSW */
42   PORT_START("DSW")
4343   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SWA:1,2")
4444   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
4545   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
r3115r3116
7171INPUT_PORTS_END
7272
7373static INPUT_PORTS_START( newsa )
74   PORT_START("DSW")   /* DSW */
74   PORT_START("DSW")
7575   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SWA:1,2")
7676   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
7777   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
src/mame/drivers/finalizr.c
r3115r3116
1010#include "deprecat.h"
1111#include "machine/konami1.h"
1212#include "cpu/m6809/m6809.h"
13#include "cpu/i8039/i8039.h"
13#include "cpu/mcs48/mcs48.h"
1414#include "sound/sn76496.h"
1515#include "sound/dac.h"
1616
r3115r3116
143143
144144static ADDRESS_MAP_START( i8039_readport, ADDRESS_SPACE_IO, 8 )
145145   AM_RANGE(0x00, 0xff) AM_READ(soundlatch_r)
146   AM_RANGE(I8039_t1, I8039_t1) AM_READ(i8039_T1_r)
146   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(i8039_T1_r)
147147ADDRESS_MAP_END
148148
149149static ADDRESS_MAP_START( i8039_writeport, ADDRESS_SPACE_IO, 8 )
150   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(dac_0_data_w)
151   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(i8039_irqen_w)
152   AM_RANGE(I8039_t0, I8039_t0) AM_WRITE(i8039_T0_w)
150   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(dac_0_data_w)
151   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(i8039_irqen_w)
152   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_WRITE(i8039_T0_w)
153153ADDRESS_MAP_END
154154
155155
src/mame/drivers/segaybd.c
r3115r3116
6666
6767static void update_main_irqs(running_machine *machine)
6868{
69   int irq = 0;
69   cpunum_set_input_line(machine, 0, 2, timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
70   cpunum_set_input_line(machine, 1, 2, timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
71   cpunum_set_input_line(machine, 2, 2, timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
72   cpunum_set_input_line(machine, 0, 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
73   cpunum_set_input_line(machine, 1, 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
74   cpunum_set_input_line(machine, 2, 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
75   cpunum_set_input_line(machine, 0, 6, timer_irq_state && vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
76   cpunum_set_input_line(machine, 1, 6, timer_irq_state && vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
77   cpunum_set_input_line(machine, 2, 6, timer_irq_state && vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
7078
71   /* the IRQs are effectively ORed together */
72   if (vblank_irq_state)
73      irq |= 4;
74   if (timer_irq_state)
75      irq |= 2;
76
77   /* assert the lines that are live, or clear everything if nothing is live */
78   if (irq != 0)
79   {
80      cpunum_set_input_line(machine, 0, irq, ASSERT_LINE);
81      cpunum_set_input_line(machine, 1, irq, ASSERT_LINE);
82      cpunum_set_input_line(machine, 2, irq, ASSERT_LINE);
79   if(timer_irq_state || vblank_irq_state)
8380      cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(50));
84   }
85   else
86   {
87      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
88      cpunum_set_input_line(machine, 1, 7, CLEAR_LINE);
89      cpunum_set_input_line(machine, 2, 7, CLEAR_LINE);
90   }
9181}
9282
9383
src/mame/drivers/shuuz.c
r3115r3116
3232
3333static void update_interrupts(running_machine *machine)
3434{
35   int newstate = 0;
36
37   if (atarigen_scanline_int_state)
38      newstate = 4;
39
40   if (newstate)
41      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
42   else
43      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
35   cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
4436}
4537
4638
src/mame/drivers/speedspn.c
r3115r3116
147147
148148static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
149149   ADDRESS_MAP_GLOBAL_MASK(0xff)
150   AM_RANGE(0x10, 0x10) AM_READ(input_port_0_r) // inputs
151   AM_RANGE(0x11, 0x11) AM_READ(input_port_1_r) // inputs
152   AM_RANGE(0x12, 0x12) AM_READ(input_port_2_r) // inputs
153   AM_RANGE(0x13, 0x13) AM_READ(input_port_3_r)
154   AM_RANGE(0x14, 0x14) AM_READ(input_port_4_r) // inputs
150   AM_RANGE(0x10, 0x10) AM_READ_PORT("SYSTEM")
151   AM_RANGE(0x11, 0x11) AM_READ_PORT("P1")
152   AM_RANGE(0x12, 0x12) AM_READ_PORT("P2")
153   AM_RANGE(0x13, 0x13) AM_READ_PORT("DSW1")
154   AM_RANGE(0x14, 0x14) AM_READ_PORT("DSW2")
155155   AM_RANGE(0x16, 0x16) AM_READ(speedspn_irq_ack_r) // @@@ could be watchdog, value is discarded
156156ADDRESS_MAP_END
157157
r3115r3116
185185   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
186186   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
187187
188   PORT_START("P1") /* Player 1 Inputs */
188   PORT_START("P1")
189189   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
190190   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
191191   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
r3115r3116
195195   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
196196   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
197197
198   PORT_START("P2") /* Player 2 Inputs */
198   PORT_START("P2")
199199   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
200200   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
201201   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
r3115r3116
205205   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
206206   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
207207
208   PORT_START("DSW1") /* Dips */
208   PORT_START("DSW1")
209209   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
210210   PORT_DIPSETTING(    0x01, DEF_STR( 5C_1C ) )
211211   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
r3115r3116
241241   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
242242   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
243243
244   PORT_START("DSW2") /* Dips */
244   PORT_START("DSW2")
245245   PORT_DIPNAME( 0x01, 0x01, "World Cup" )
246246   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
247247   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
src/mame/drivers/segaorun.c
r3115r3116
169169
170170static void update_main_irqs(running_machine *machine)
171171{
172   int irq = 0;
172   cpunum_set_input_line(machine, 0, 2, irq2_state ? ASSERT_LINE : CLEAR_LINE);
173   cpunum_set_input_line(machine, 0, 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
174   cpunum_set_input_line(machine, 0, 6, vblank_irq_state && irq2_state ? ASSERT_LINE : CLEAR_LINE);
173175
174   /* the IRQs are effectively ORed together */
175   if (vblank_irq_state)
176      irq |= 4;
177   if (irq2_state)
178      irq |= 2;
179
180   /* assert the lines that are live, or clear everything if nothing is live */
181   if (irq != 0)
182   {
183      cpunum_set_input_line(machine, 0, irq, ASSERT_LINE);
176   if(vblank_irq_state || irq2_state)
184177      cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
185   }
186   else
187      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
188178}
189179
190180
r3115r3116
15541544   ROM_RELOAD(               0x28000, 0x08000 )
15551545   ROM_LOAD( "epr-10646.69", 0x30000, 0x08000, CRC(473cc411) SHA1(04ca2d047eb59581cd5d76e0ac6eca8b19eef497) )
15561546   ROM_RELOAD(               0x38000, 0x08000 )
1547
1548   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
1549   ROM_LOAD( "317-0034.key", 0x0000, 0x2000, CRC(263ca773) SHA1(8e80d69d61cf54fd02b0ca59dd397fa60c713f3d) )
15571550ROM_END
15581551
15591552/**************************************************************************************************************************
r3115r3116
16121605   ROM_RELOAD(               0x28000, 0x08000 )
16131606   ROM_LOAD( "epr-10646.69", 0x30000, 0x08000, CRC(473cc411) SHA1(04ca2d047eb59581cd5d76e0ac6eca8b19eef497) )
16141607   ROM_RELOAD(               0x38000, 0x08000 )
1608
1609   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
1610   ROM_LOAD( "317-0034.key", 0x0000, 0x2000, CRC(263ca773) SHA1(8e80d69d61cf54fd02b0ca59dd397fa60c713f3d) )
16151611ROM_END
16161612
16171613/**************************************************************************************************************************
r3115r3116
16701666   ROM_RELOAD(               0x28000, 0x08000 )
16711667   ROM_LOAD( "epr-10646.69", 0x30000, 0x08000, CRC(473cc411) SHA1(04ca2d047eb59581cd5d76e0ac6eca8b19eef497) )
16721668   ROM_RELOAD(               0x38000, 0x08000 )
1669
1670   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
1671   ROM_LOAD( "317-0034.key", 0x0000, 0x2000, CRC(263ca773) SHA1(8e80d69d61cf54fd02b0ca59dd397fa60c713f3d) )
16731672ROM_END
16741673
16751674/**************************************************************************************************************************
r3115r3116
18001799static DRIVER_INIT( shangon3 )
18011800{
18021801   outrun_generic_init(machine);
1803   fd1089_decrypt_0034(machine);
1802   fd1089b_decrypt(machine);
18041803   custom_io_r = shangon_custom_io_r;
18051804   custom_io_w = shangon_custom_io_w;
18061805}
src/mame/drivers/foodf.c
r3115r3116
114114
115115static void update_interrupts(running_machine *machine)
116116{
117   int newstate = 0;
118
119   if (atarigen_scanline_int_state)
120      newstate |= 1;
121   if (atarigen_video_int_state)
122      newstate |= 2;
123
124   if (newstate)
125      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
126   else
127      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
117   cpunum_set_input_line(machine, 0, 1, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
118   cpunum_set_input_line(machine, 0, 2, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
119   cpunum_set_input_line(machine, 0, 3, atarigen_scanline_int_state && atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
128120}
129121
130122
src/mame/drivers/dkong.c
r3115r3116
304304#include "includes/dkong.h"
305305#include "machine/8257dma.h"
306306#include "machine/z80dma.h"
307#include "machine/latch8.h"
307308
308309/*************************************
309310 *
r3115r3116
471472   memory_set_bank(1, 1);
472473}
473474
475
474476/*************************************
475477 *
476478 *  DMA handling
r3115r3116
562564
563565static READ8_HANDLER( dkong_in2_r )
564566{
567   /* mcu status (sound feedback) is inverted bit4 from port B (8039) */
568   const device_config *devvp2 = devtag_get_device(machine, LATCH8, "virtual_p2");
569   UINT8 mcustatus = latch8_bit4_q_r(devvp2, 0);
570
565571   UINT8 r;
566572
567#if DEBUG_DISC_SOUND
568   static UINT8 ui_snd = 0;
569   static UINT8 lst = 0;
570   if  (!lst && (input_port_read(machine, "TST") & 0x01))
571   {
572      ui_snd = (ui_snd + 1) % 10;
573      popmessage("Sound %d", ui_snd);
574   }
575   lst = input_port_read(machine, "TST") & 0x01;
576   if (ui_snd<8)
577      dkongjr_snd_w1(ui_snd, (input_port_read(machine, "TST") & 0x02)>>1);
578   else
579      dkongjr_snd_w2(ui_snd-8, (input_port_read(machine, "TST") & 0x02)>>1);
580#endif
573   r = (input_port_read(machine, "IN2") & 0xBF) | (mcustatus << 6);
574   coin_counter_w(offset, r >> 7);
575   if (r & 0x10)
576      r = (r & ~0x10) | 0x80; /* service ==> coin */
577   return r;
578}
581579
582   r = (input_port_read(machine, "IN2") & 0xBF) | (dkong_audio_status_r(machine,0) << 6);
580static READ8_HANDLER( dkongjr_in2_r )
581{
582   /* dkongjr does not have the mcu line connected */
583
584   UINT8 r;
585
586   r = (input_port_read(machine, "IN2") & 0xBF) | 0x40;
583587   coin_counter_w(offset, r >> 7);
584588   if (r & 0x10)
585      r = (r & ~0x10) | 0x80; /* service ==> coint */
589      r = (r & ~0x10) | 0x80; /* service ==> coin */
586590   return r;
587591}
588592
r3115r3116
596600   return data;
597601}
598602
603
599604static WRITE8_HANDLER( hunchbkd_mirror_w )
600605{
601606#if DEBUG_PROTECTION
r3115r3116
605610   program_write_byte(0x1000+offset,data);
606611}
607612
613
608614static READ8_HANDLER( epos_decrypt_rom )
609615{
610616   dkong_state *state = machine->driver_data;
r3115r3116
634640   return 0;
635641}
636642
643
637644static WRITE8_HANDLER( hunchbkd_data_w )
638645{
639646   dkong_state *state = machine->driver_data;
r3115r3116
641648   state->hunchloopback = data;
642649}
643650
651
644652static READ8_HANDLER( hunchbkd_port0_r )
645653{
646654   dkong_state *state = machine->driver_data;
r3115r3116
658666    return 0;
659667}
660668
669
661670static READ8_HANDLER( hunchbkd_port1_r )
662671{
663672   dkong_state *state = machine->driver_data;
r3115r3116
665674   return state->hunchloopback;
666675}
667676
677
668678static READ8_HANDLER( herbiedk_port1_r )
669679{
670680   switch (activecpu_get_pc())
r3115r3116
676686    return 1;
677687}
678688
689
679690static READ8_HANDLER( spclforc_port0_r )
680691{
681692   switch (activecpu_get_pc())
682693   {
683      case 0x00a3: // spclforc
684      case 0x007b: // spcfrcii
694      case 0x00a3: /* spclforc */
695      case 0x007b: /* spcfrcii */
685696         return 1;
686697   }
687698
r3115r3116
738749   }
739750}
740751
752
741753static READ8_HANDLER( strtheat_inputport_1_r )
742754{
743755   if(input_port_read(machine, "DSW0") & 0x40)
r3115r3116
767779   AM_RANGE(0x7400, 0x77ff) AM_RAM_WRITE(dkong_videoram_w)
768780                            AM_BASE_MEMBER(dkong_state, video_ram)
769781   AM_RANGE(0x7800, 0x780f) AM_DEVREADWRITE(DMA8257, "dma8257", dma8257_r, dma8257_w)   /* P8257 control registers */
770   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_WRITE(dkong_sh_tuneselect_w)  /* IN0, sound CPU intf */
782   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_LATCH8_WRITE("ls175.3d")      /* IN0, sound CPU intf */
771783   AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") AM_WRITE(radarscp_grid_color_w)  /* IN1 */
784
772785   AM_RANGE(0x7d00, 0x7d00) AM_READ(dkong_in2_r)                          /* IN2 */
773   AM_RANGE(0x7d00, 0x7d07) AM_WRITE(dkong_snd_disc_w)                       /* Sound signals */
786   AM_RANGE(0x7d00, 0x7d07) AM_DEVWRITE(LATCH8, "ls259.6h", latch8_bit0_w)       /* Sound signals */
787
774788   AM_RANGE(0x7d80, 0x7d80) AM_READ_PORT("DSW0") AM_WRITE(dkong_audio_irq_w)     /* DSW0 */
775789   AM_RANGE(0x7d81, 0x7d81) AM_WRITE(radarscp_grid_enable_w)
776790   AM_RANGE(0x7d82, 0x7d82) AM_WRITE(dkong_flipscreen_w)
r3115r3116
789803   AM_RANGE(0x7400, 0x77ff) AM_RAM_WRITE(dkong_videoram_w)
790804                           AM_BASE_MEMBER(dkong_state, video_ram)
791805   AM_RANGE(0x7800, 0x780f) AM_DEVREADWRITE(DMA8257, "dma8257", dma8257_r, dma8257_w)   /* P8257 control registers */
792   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_WRITE(dkongjr_sh_tuneselect_w)
806
807   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_LATCH8_WRITE("ls174.3d")    /* IN0, sound interface */
808
793809   AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") AM_WRITE(dkongjr_gfxbank_w)
794   AM_RANGE(0x7c81, 0x7c81) AM_WRITE(dkongjr_sh_test6_w)
795   AM_RANGE(0x7d00, 0x7d00) AM_READ(dkong_in2_r)                               /* IN2 */
796   AM_RANGE(0x7d00, 0x7d07) AM_WRITE(dkongjr_snd_w1)                           /* Sound addrs */
810   AM_RANGE(0x7c80, 0x7c87) AM_DEVWRITE(LATCH8, "ls259.4h", latch8_bit0_w)     /* latch for sound and signals above */
811
812   AM_RANGE(0x7d00, 0x7d00) AM_READ(dkongjr_in2_r)                               /* IN2 */
813   AM_RANGE(0x7d00, 0x7d07) AM_DEVWRITE(LATCH8, "ls259.6h",latch8_bit0_w)      /* Sound addrs */
814
797815   AM_RANGE(0x7d80, 0x7d80) AM_READ_PORT("DSW0") AM_WRITE(dkong_audio_irq_w)   /* DSW0 */
798   AM_RANGE(0x7d81, 0x7d81) AM_WRITE(dkongjr_snd_w2)                           /* Sound addrs */
799816   AM_RANGE(0x7d82, 0x7d82) AM_WRITE(dkong_flipscreen_w)
800817   AM_RANGE(0x7d83, 0x7d83) AM_WRITE(dkong_spritebank_w)                  /* 2 PSL Signal */
801818   AM_RANGE(0x7d84, 0x7d84) AM_WRITE(interrupt_enable_w)
802819   AM_RANGE(0x7d85, 0x7d85) AM_DEVWRITE(DMA8257, "dma8257", p8257_drq_w)      /* P8257 ==> /DRQ0 /DRQ1 */
803820   AM_RANGE(0x7d86, 0x7d87) AM_WRITE(dkong_palettebank_w)
821   AM_RANGE(0x7d80, 0x7d87) AM_DEVWRITE(LATCH8, "ls259.5h", latch8_bit0_w)     /* latch for sound and signals above*/
822
804823   AM_RANGE(0x8000, 0x9fff) AM_ROM                                               /* bootleg DKjr only */
805824   AM_RANGE(0xb000, 0xbfff) AM_ROM                                             /* pestplce only */
806825   AM_RANGE(0xd000, 0xdfff) AM_ROM                                               /* DK3 bootleg only */
r3115r3116
814833                           AM_SIZE_MEMBER(dkong_state, sprite_ram_size) /* sprite set 1 */
815834   AM_RANGE(0x7400, 0x77ff) AM_RAM_WRITE(dkong_videoram_w)
816835                           AM_BASE_MEMBER(dkong_state, video_ram)
817   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0")  AM_WRITE(soundlatch_w)
818   AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1")  AM_WRITE(soundlatch2_w)
819   AM_RANGE(0x7d00, 0x7d00) AM_READ_PORT("DSW0") AM_WRITE(soundlatch3_w)
836   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0")  AM_LATCH8_WRITE("latch1")
837   AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1")  AM_LATCH8_WRITE("latch2")
838   AM_RANGE(0x7d00, 0x7d00) AM_READ_PORT("DSW0") AM_LATCH8_WRITE("latch3")
820839   AM_RANGE(0x7d80, 0x7d80) AM_READ_PORT("DSW1") AM_WRITE(dkong3_2a03_reset_w)
821840   AM_RANGE(0x7e80, 0x7e80) AM_WRITE(dkong3_coin_counter_w)
822841   AM_RANGE(0x7e81, 0x7e81) AM_WRITE(dkong3_gfxbank_w)
823842   AM_RANGE(0x7e82, 0x7e82) AM_WRITE(dkong_flipscreen_w)
824   AM_RANGE(0x7e83, 0x7e83) AM_WRITE(dkong_spritebank_w)            /* 2 PSL Signal */
843   AM_RANGE(0x7e83, 0x7e83) AM_WRITE(dkong_spritebank_w)              /* 2 PSL Signal */
825844   AM_RANGE(0x7e84, 0x7e84) AM_WRITE(interrupt_enable_w)
826   AM_RANGE(0x7e85, 0x7e85) AM_DEVWRITE(Z80DMA, "z80dma", z80dma_rdy_w)   /* ==> DMA Chip */
845   AM_RANGE(0x7e85, 0x7e85) AM_DEVWRITE(Z80DMA, "z80dma", z80dma_rdy_w)  /* ==> DMA Chip */
827846   AM_RANGE(0x7e86, 0x7e87) AM_WRITE(dkong_palettebank_w)
828   AM_RANGE(0x8000, 0x9fff) AM_ROM                           /* DK3 and bootleg DKjr only */
847   AM_RANGE(0x8000, 0x9fff) AM_ROM                                         /* DK3 and bootleg DKjr only */
829848ADDRESS_MAP_END
830849
831850static ADDRESS_MAP_START( dkong3_io_map, ADDRESS_SPACE_IO, 8 )
r3115r3116
846865   AM_RANGE(0x0000, 0x0fff) AM_ROM
847866   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE_MEMBER(dkong_state, sprite_ram)
848867                           AM_SIZE_MEMBER(dkong_state, sprite_ram_size)  /* 0x7000 */
849   AM_RANGE(0x1400, 0x1400) AM_READ_PORT("IN0") AM_WRITE(dkong_sh_tuneselect_w)
868   AM_RANGE(0x1400, 0x1400) AM_READ_PORT("IN0") AM_DEVWRITE(LATCH8, "ls175.3d", latch8_w)
850869   AM_RANGE(0x1480, 0x1480) AM_READ_PORT("IN1")
851870   AM_RANGE(0x1500, 0x1500) AM_READ(dkong_in2_r)                                 /* IN2 */
852   AM_RANGE(0x1500, 0x1507) AM_WRITE(dkong_snd_disc_w)                       /* Sound signals */
871   AM_RANGE(0x1500, 0x1507) AM_DEVWRITE(LATCH8, "ls259.6h", latch8_bit0_w)       /* Sound signals */
853872   AM_RANGE(0x1580, 0x1580) AM_READ_PORT("DSW0") AM_WRITE(dkong_audio_irq_w)     /* DSW0 */
854873   AM_RANGE(0x1582, 0x1582) AM_WRITE(dkong_flipscreen_w)
855874   AM_RANGE(0x1583, 0x1583) AM_WRITE(dkong_spritebank_w)                    /* 2 PSL Signal */
r3115r3116
11971216   PORT_MODIFY("IN2")
11981217   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Start 1 / P1 Button 1") PORT_PLAYER(1)
11991218   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Start 2 / P1 Button 2") PORT_PLAYER(1)
1200   //PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1201   //PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1219   /* PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) */
1220   /* PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) */
12021221
12031222   PORT_START("DSW0")      /* DSW0 */
12041223   PORT_DIPNAME( 0x01, 0x00, "1" )
r3115r3116
13061325   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION( "SW1:!2" )
13071326   PORT_DIPSETTING(    0x00, "3" )
13081327   PORT_DIPSETTING(    0x02, "5" )
1309   PORT_DIPNAME( 0x0c, 0x00, "Difficulty?" )         PORT_DIPLOCATION( "SW1:!3,!4" ) // Stored at 0x1c99
1328   PORT_DIPNAME( 0x0c, 0x00, "Difficulty?" )         PORT_DIPLOCATION( "SW1:!3,!4" ) /* Stored at 0x1c99 */
13101329   PORT_DIPSETTING(    0x00, "0" )
13111330   PORT_DIPSETTING(    0x04, "1" )
13121331   PORT_DIPSETTING(    0x08, "2" )
r3115r3116
17271746
17281747   MDRV_GFXDECODE(pestplce)
17291748   MDRV_PALETTE_LENGTH(DK2B_PALETTE_LENGTH)
1730   MDRV_PALETTE_INIT(dkong2b)   // wrong!
1749   MDRV_PALETTE_INIT(dkong2b)   /* wrong! */
17311750   MDRV_VIDEO_UPDATE(pestplce)
17321751
17331752MACHINE_DRIVER_END
r3115r3116
17791798   MDRV_PALETTE_INIT(dkong3)
17801799MACHINE_DRIVER_END
17811800
1801/*************************************
1802 *
1803 * EPOS Machine drivers
1804 *
1805 *************************************/
1806
17821807static MACHINE_DRIVER_START( strtheat )
17831808   /* basic machine hardware */
17841809   MDRV_IMPORT_FROM(dkong2b)
r3115r3116
18621887   ROM_FILL(                 0x1000, 0x0800, 0xFF )
18631888
18641889   ROM_REGION( 0x0800, "tms", 0 )   /* speech rom */
1865   ROM_LOAD( "trs014ha.bin",      0x0000, 0x0800, CRC(d1f1b48c) SHA1(ee5584368d2e9f7bde271f5004585b53f5ff5c3f) ) // speech rom
1890   ROM_LOAD( "trs014ha.bin",      0x0000, 0x0800, CRC(d1f1b48c) SHA1(ee5584368d2e9f7bde271f5004585b53f5ff5c3f) ) /* speech rom */
18661891
18671892   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
18681893   ROM_LOAD( "trs01v3f",     0x0000, 0x0800, CRC(f095330e) SHA1(dd3de744f28ff108630d3336bd246d3323fa34af) )
r3115r3116
18841909   ROM_LOAD( "trs01c2j.bin",    0x0000, 0x0100, CRC(2a087c87) SHA1(dbf0c6173583dc4fa5d3f34d2f42cbaf2bd4b167) ) /* blue */
18851910   ROM_LOAD( "trs01c2k.bin",    0x0100, 0x0100, CRC(650c5daf) SHA1(72f91ee2fab9eee58ee42881327e6345aa70b7f9) ) /* green */
18861911   ROM_LOAD( "trs01c2l.bin",    0x0200, 0x0100, CRC(23087910) SHA1(afc05c322b11fefaf0af857fee06a5afd0d4593e) ) /* red */
1887   // Hack! The prom at pos 1D on video board has not been dumped
1888   // Rom 1D is a MB7051, only 5 address lines
1889   // Rom below from TRS02 dump: rs2-v.1hc
1912   /* Hack! The prom at pos 1D on video board has not been dumped
1913     * Rom 1D is a MB7051, only 5 address lines
1914     * Rom below from TRS02 dump: rs2-v.1hc
1915     */
18901916   ROM_LOAD( "trs01v1d.bin",    0x0300, 0x0100, BAD_DUMP CRC(1b828315) SHA1(00c9f8c5ae86b68d38c66f9071b5f1ef421c1005) ) /* character color codes on a per-column basis */
18911917ROM_END
18921918
r3115r3116
19211947
19221948ROM_START( dkongo )
19231949   ROM_REGION( 0x10000, "main", 0 )
1924   ROM_LOAD( "c_5f_b.bin",   0x0000, 0x1000, CRC(424f2b11) SHA1(e4f096f2bbd37281f42a5f8e083738f55c07f3dd) )   // tkg3c.5f
1925   ROM_LOAD( "c_5ct_g.bin",  0x1000, 0x1000, CRC(5ec461ec) SHA1(acb11a8fbdbb3ab46068385fe465f681e3c824bd) )   // tkg3c.5g
1926   ROM_LOAD( "c_5h_b.bin",   0x2000, 0x1000, CRC(1d28895d) SHA1(63792cab215fc2a7b0e8ee61d8115045571e9d42) )   // tkg3c.5h
1950   ROM_LOAD( "c_5f_b.bin",   0x0000, 0x1000, CRC(424f2b11) SHA1(e4f096f2bbd37281f42a5f8e083738f55c07f3dd) )   /* tkg3c.5f */
1951   ROM_LOAD( "c_5ct_g.bin",  0x1000, 0x1000, CRC(5ec461ec) SHA1(acb11a8fbdbb3ab46068385fe465f681e3c824bd) )   /* tkg3c.5g */
1952   ROM_LOAD( "c_5h_b.bin",   0x2000, 0x1000, CRC(1d28895d) SHA1(63792cab215fc2a7b0e8ee61d8115045571e9d42) )   /* tkg3c.5h */
19271953   ROM_LOAD( "tkg3c.5k",     0x3000, 0x1000, CRC(553b89bb) SHA1(61611df9e2748fdcd31821038dcc0e16dc933873) )
19281954   /* space for diagnostic ROM */
19291955
r3115r3116
27062732   ROM_REGION( 0x1000, "sound", 0 )   /* sound */
27072733   /* one is used for dkong conversions, the other one for dkongjr conversions */
27082734   ROM_LOAD( "2716.3h1",     0x0000, 0x0800, CRC(2a6ec016) SHA1(c95e185a39c8029f00798ce0a00759a4deb45677) ) /* dkongjr */
2709   //ROM_RELOAD(               0x0800, 0x0800 )
2710   //ROM_FILL(                 0x0800, 0x0800, 0xFF )
27112735
27122736   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
27132737   ROM_LOAD( "2716.3n",      0x0000, 0x0800, CRC(ea0e7f9a) SHA1(a8e2b43e15281d45e414eaae98e5248bad79c41b) )
r3115r3116
28252849   ROM_LOAD( "sg-01-0",     0x0000, 0x0800, CRC(f055a624) SHA1(5dfe89d7271092e665cdd5cd59d15a2b70f92f43) )
28262850
28272851   ROM_REGION( 0x1800, "tms", 0 )
2828   ROM_LOAD( "sg-01snd",    0x0000, 0x1000, CRC(644a0728) SHA1(e249fd57bc49572a2246aaf7c68a547f319f51bc) ) //sg-01-snd
2829   ROM_LOAD( "sg-01spk",    0x1000, 0x0800, CRC(aacaf730) SHA1(cd562093ab8931d165cb0877e332474fce131c67) ) //sg-01-spk
2852   ROM_LOAD( "sg-01snd",    0x0000, 0x1000, CRC(644a0728) SHA1(e249fd57bc49572a2246aaf7c68a547f319f51bc) ) /* sg-01-snd */
2853   ROM_LOAD( "sg-01spk",    0x1000, 0x0800, CRC(aacaf730) SHA1(cd562093ab8931d165cb0877e332474fce131c67) ) /* sg-01-spk */
28302854
2831   ROM_REGION( 0x2000, "user2", 0 ) // gun proms?
2855   ROM_REGION( 0x2000, "user2", 0 ) /* gun proms? */
28322856   ROM_LOAD( "sg-1",        0x0000, 0x0200, CRC(fda82517) SHA1(b36bac69b6f8218b280aae59133ea0d22d7a99f6) )
28332857   ROM_LOAD( "sg-2",        0x0200, 0x091d, CRC(6e065613) SHA1(26d048af5c302f921de8e2c1bc7c7bf48dc21b5a) )
28342858
src/mame/drivers/sprint4.c
r3115r3116
248248   AM_RANGE(0x0040, 0x0047) AM_MIRROR(0x718) AM_READ(sprint4_collision_r)
249249   AM_RANGE(0x0060, 0x0063) AM_MIRROR(0x71c) AM_READ(sprint4_options_r)
250250
251   AM_RANGE(0x1000, 0x17ff) AM_READ(input_port_0_r)
252   AM_RANGE(0x1800, 0x1fff) AM_READ(input_port_1_r)
251   AM_RANGE(0x1000, 0x17ff) AM_READ_PORT("IN0")
252   AM_RANGE(0x1800, 0x1fff) AM_READ_PORT("IN1")
253253
254254   AM_RANGE(0x0000, 0x0000) AM_MIRROR(0x71f) AM_WRITE(sprint4_attract_w)
255255   AM_RANGE(0x0020, 0x0027) AM_MIRROR(0x718) AM_WRITE(sprint4_collision_reset_w)
r3115r3116
298298   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
299299
300300   PORT_START("DIP")
301   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Language )) PORT_DIPLOCATION("DIP:8,7")
302   PORT_DIPSETTING(    0x00, DEF_STR( German ))
303   PORT_DIPSETTING(    0x01, DEF_STR( French ))
304   PORT_DIPSETTING(    0x02, DEF_STR( Spanish ))
305   PORT_DIPSETTING(    0x03, DEF_STR( English ))
306   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coinage )) PORT_DIPLOCATION("DIP:6")
307   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ))
308   PORT_DIPSETTING(    0x04, DEF_STR( 1C_1C ))
301   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Language ) ) PORT_DIPLOCATION("DIP:8,7")
302   PORT_DIPSETTING(    0x00, DEF_STR( German ) )
303   PORT_DIPSETTING(    0x01, DEF_STR( French ) )
304   PORT_DIPSETTING(    0x02, DEF_STR( Spanish ) )
305   PORT_DIPSETTING(    0x03, DEF_STR( English ) )
306   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DIP:6")
307   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
308   PORT_DIPSETTING(    0x04, DEF_STR( 1C_1C ) )
309309   PORT_DIPNAME( 0x08, 0x08, "Allow Late Entry" ) PORT_DIPLOCATION("DIP:5")
310   PORT_DIPSETTING(    0x08, DEF_STR( No ))
311   PORT_DIPSETTING(    0x00, DEF_STR( Yes ))
310   PORT_DIPSETTING(    0x08, DEF_STR( No ) )
311   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
312312   PORT_DIPNAME( 0xf0, 0xb0, "Play Time" ) PORT_DIPLOCATION("DIP:4,3,2,1")
313313   PORT_DIPSETTING(    0x70, "60 seconds" )
314314   PORT_DIPSETTING(    0xb0, "90 seconds" )
src/mame/drivers/chinagat.c
r3115r3116
7272#include "driver.h"
7373#include "cpu/m6809/m6809.h"
7474#include "cpu/z80/z80.h"
75#include "cpu/i8039/i8039.h"
75#include "cpu/mcs48/mcs48.h"
7676#include "sound/2151intf.h"
7777#include "sound/2203intf.h"
7878#include "sound/okim6295.h"
r3115r3116
342342ADDRESS_MAP_END
343343
344344static ADDRESS_MAP_START( i8748_portmap, ADDRESS_SPACE_IO, 8 )
345   AM_RANGE(I8039_bus, I8039_bus) AM_READ(saiyugb1_mcu_command_r)
346   AM_RANGE(I8039_t0, I8039_t0) AM_WRITE(saiyugb1_m5205_clk_w)       /* Drives the clock on the m5205 at 1/8 of this frequency */
347   AM_RANGE(I8039_t1, I8039_t1) AM_READ(saiyugb1_m5205_irq_r)
348   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(saiyugb1_adpcm_rom_addr_w)
349   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(saiyugb1_adpcm_control_w)
345   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(saiyugb1_mcu_command_r)
346   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_WRITE(saiyugb1_m5205_clk_w)       /* Drives the clock on the m5205 at 1/8 of this frequency */
347   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(saiyugb1_m5205_irq_r)
348   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(saiyugb1_adpcm_rom_addr_w)
349   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(saiyugb1_adpcm_control_w)
350350ADDRESS_MAP_END
351351
352352
r3115r3116
549549   MDRV_CPU_ADD("audio", Z80, 3579545)      /* 3.579545 MHz oscillator */
550550   MDRV_CPU_PROGRAM_MAP(saiyugb1_sound_map,0)
551551
552   MDRV_CPU_ADD("mcu", I8048,9263750/3)      /* 3.087916 MHz (9.263750 MHz oscillator) */
552   MDRV_CPU_ADD("mcu", I8048, 9263750)      /* 9.263750 MHz oscillator, divided by 3*5 internally */
553553   MDRV_CPU_PROGRAM_MAP(i8748_map,0)
554554   MDRV_CPU_IO_MAP(i8748_portmap,0)
555555
src/mame/drivers/gauntlet.c
r3115r3116
147147
148148static void update_interrupts(running_machine *machine)
149149{
150   int newstate = 0;
151
152   if (atarigen_video_int_state)
153      newstate |= 4;
154   if (atarigen_sound_int_state)
155      newstate |= 6;
156
157   if (newstate)
158      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
159   else
160      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
150   cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
151   cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
161152}
162153
163154
src/mame/drivers/ms32.c
r3115r3116
180180
181181/********** READ INPUTS **********/
182182
183static READ32_HANDLER ( ms32_mahjong_read_inputs1 )
183static CUSTOM_INPUT( mahjong_ctrl_r )
184184{
185185   UINT32 mj_input;
186186
187187   switch (ms32_mahjong_input_select[0])
188188   {
189189      case 0x01:
190         mj_input = input_port_read(machine, "MJ0");   // Player 1 inputs
190         mj_input = input_port_read(field->port->machine, "MJ0");
191191         break;
192192      case 0x02:
193         mj_input = input_port_read(machine, "MJ1");   // Player 1 inputs
193         mj_input = input_port_read(field->port->machine, "MJ1");
194194         break;
195195      case 0x04:
196         mj_input = input_port_read(machine, "MJ2");   // Player 1 inputs
196         mj_input = input_port_read(field->port->machine, "MJ2");
197197         break;
198198      case 0x08:
199         mj_input = input_port_read(machine, "MJ3");   // Player 1 inputs
199         mj_input = input_port_read(field->port->machine, "MJ3");
200200         break;
201201      case 0x10:
202         mj_input = input_port_read(machine, "MJ4");   // Player 1 inputs
202         mj_input = input_port_read(field->port->machine, "MJ4");
203203         break;
204204      default:
205205         mj_input = 0;
206206
207207   }
208208
209   return  (input_port_read(machine, "INPUTS") & ~0xff) | mj_input;
209   return  mj_input & 0xff;
210210}
211211
212
213static READ32_HANDLER ( ms32_read_inputs3 )
212static READ32_HANDLER( ms32_read_inputs3 )
214213{
215214   int a,b,c,d;
216215   a = input_port_read(machine, "AN2?"); // unused?
r3115r3116
448447   PORT_INCLUDE( ms32 )
449448
450449   PORT_MODIFY("INPUTS")
451   PORT_BIT( 0x000000ff, IP_ACTIVE_LOW, IPT_UNUSED )   // here we read mahjong keys
450   PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mahjong_ctrl_r, NULL)   // here we read mahjong keys
451   PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNUSED )
452   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN1 )
453   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 )
454   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_SERVICE1 )
455   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1)
456   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNUSED )   /* Start 1 is already mapped in mahjong inputs */
457   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED )   /* ms32.c mahjongs don't have P2 inputs -> no Start 2*/
458   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNKNOWN )
459   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNKNOWN )
452460
453461   PORT_START("MJ0")
454462   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_START1 )
r3115r3116
863871static INPUT_PORTS_START( kirarast )   // player 1 inputs done? others?
864872   PORT_INCLUDE( ms32_mahjong )
865873
866   PORT_MODIFY("INPUTS")
867   PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED )
868
869   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN1 )
870   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 )
871   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_SERVICE1 )
872   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1)
873//  PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_START1 ) /* already mapped in mahjong inputs */
874   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNUSED )
875//  PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_START2 ) /* ms32.c mahjongs don't have P2 inputs */
876   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED )
877   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNKNOWN )
878   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNKNOWN )
879
880874   PORT_MODIFY("DSW")
881875   PORT_DIPUNUSED_DIPLOC( 0x00000400, 0x00000400, "SW1:6" )
882876   PORT_DIPUNUSED_DIPLOC( 0x00000800, 0x00000800, "SW1:5" )
r3115r3116
918912   PORT_INCLUDE( kirarast )
919913
920914   PORT_MODIFY("INPUTS")
921//  PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 ) /* coin 2 is unused */
922   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_UNUSED )
915   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_UNUSED )    /* coin 2 is unused */
923916
924917   PORT_MODIFY("DSW")
925918   PORT_DIPNAME( 0x00000400, 0x00000400, "Campaign Mode" ) PORT_DIPLOCATION("SW1:6")
r3115r3116
21532146
21542147static DRIVER_INIT (kirarast)
21552148{
2156//  { 0xfcc00004, 0xfcc00007, ms32_mahjong_read_inputs1 }
2157   memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 );
2158
21592149   DRIVER_INIT_CALL(ss92047_01);
21602150}
21612151
21622152static DRIVER_INIT (47pie2)
21632153{
2164//  { 0xfcc00004, 0xfcc00007, ms32_mahjong_read_inputs1 }
2165   memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 );
2166
21672154   DRIVER_INIT_CALL(ss92048_01);
21682155}
21692156
r3115r3116
21782165
21792166static DRIVER_INIT (bnstars)
21802167{
2181//  { 0xfcc00004, 0xfcc00007, ms32_mahjong_read_inputs1 }
2182   memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfcc00004, 0xfcc00007, 0, 0, ms32_mahjong_read_inputs1 );
2183
21842168   DRIVER_INIT_CALL(ss92046_01);
21852169}
21862170
src/mame/drivers/mpu4.c
r3115r3116
401401   int pattern = 0,reel;
402402   for (reel = 0; reel < 6; reel++)
403403   {
404      Stepper_reset_position(reel);
405      if (Stepper_optic_state(reel)) pattern |= 1<<reel;
404      stepper_reset_position(reel);
405      if (stepper_optic_state(reel)) pattern |= 1<<reel;
406406   }
407407   optic_pattern = pattern;
408408}
r3115r3116
806806static WRITE8_HANDLER( pia_ic6_portb_w )
807807{
808808   LOG(("%04x IC6 PIA Port B Set to %2x (Reel A and B)\n", activecpu_get_previouspc(),data));
809   Stepper_update(0, data & 0x0F );
810   Stepper_update(1, (data>>4) & 0x0F );
809   stepper_update(0, data & 0x0F );
810   stepper_update(1, (data>>4) & 0x0F );
811811
812812/*  if ( pia_get_output_cb2(1)) */
813813   {
814      if ( Stepper_optic_state(0) ) optic_pattern |=  0x01;
814      if ( stepper_optic_state(0) ) optic_pattern |=  0x01;
815815      else                          optic_pattern &= ~0x01;
816816
817      if ( Stepper_optic_state(1) ) optic_pattern |=  0x02;
817      if ( stepper_optic_state(1) ) optic_pattern |=  0x02;
818818      else                          optic_pattern &= ~0x02;
819819   }
820820   draw_reel((0));
r3115r3116
869869static WRITE8_HANDLER( pia_ic7_porta_w )
870870{
871871   LOG(("%04x IC7 PIA Port A Set to %2x (Reel C and D)\n", activecpu_get_previouspc(),data));
872   Stepper_update(2, data & 0x0F );
873   Stepper_update(3, (data >> 4)& 0x0F );
872   stepper_update(2, data & 0x0F );
873   stepper_update(3, (data >> 4)& 0x0F );
874874
875875/*  if ( pia_get_output_cb2(1)) */
876876   {
877      if ( Stepper_optic_state(2) ) optic_pattern |=  0x04;
877      if ( stepper_optic_state(2) ) optic_pattern |=  0x04;
878878      else                          optic_pattern &= ~0x04;
879      if ( Stepper_optic_state(3) ) optic_pattern |=  0x08;
879      if ( stepper_optic_state(3) ) optic_pattern |=  0x08;
880880      else                          optic_pattern &= ~0x08;
881881   }
882882   draw_reel((2));
r3115r3116
12291229   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5)
12301230INPUT_PORTS_END
12311231
1232static const stepper_interface barcrest_reel_interface =
1233{
1234   BARCREST_48STEP_REEL,
1235   0,
1236   8,
1237   0x00
1238};
12321239
12331240/* Common configurations */
12341241static void mpu4_config_common(void)
r3115r3116
12571264   Mechmtr_init(8);
12581265
12591266   /* setup 4 reels */
1260   Stepper_init(0, BARCREST_48STEP_REEL);
1261   Stepper_init(1, BARCREST_48STEP_REEL);
1262   Stepper_init(2, BARCREST_48STEP_REEL);
1263   Stepper_init(3, BARCREST_48STEP_REEL);
1267   stepper_config(0, &barcrest_reel_interface);
1268   stepper_config(1, &barcrest_reel_interface);
1269   stepper_config(2, &barcrest_reel_interface);
1270   stepper_config(3, &barcrest_reel_interface);
12641271
12651272   /* setup the standard oki MSC1937 display */
12661273   ROC10937_init(0, MSC1937,0);
src/mame/drivers/skylncr.c
r3115r3116
173173static ADDRESS_MAP_START( io_map_skylncr, ADDRESS_SPACE_IO, 8 )
174174   ADDRESS_MAP_GLOBAL_MASK(0xff)
175175
176   AM_RANGE(0x00, 0x00) AM_READ( input_port_0_r )
177   AM_RANGE(0x01, 0x01) AM_READ( input_port_1_r )
178   AM_RANGE(0x02, 0x02) AM_READ( input_port_2_r )
179   AM_RANGE(0x10, 0x10) AM_READ( input_port_3_r )
180   AM_RANGE(0x11, 0x11) AM_READ( input_port_4_r )
181   AM_RANGE(0x12, 0x12) AM_READ( input_port_5_r )
176   AM_RANGE(0x00, 0x00) AM_READ_PORT("SYSTEM")
177   AM_RANGE(0x01, 0x01) AM_READ_PORT("BUTTONS")
178   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW1")
179   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW2")
180   AM_RANGE(0x11, 0x11) AM_READ_PORT("COIN1")
181   AM_RANGE(0x12, 0x12) AM_READ_PORT("COIN2")
182182
183183   AM_RANGE(0x20, 0x20) AM_WRITE( skylncr_coin_w )
184184
r3115r3116
262262GFXDECODE_END
263263
264264static INPUT_PORTS_START( skylncr )
265
266   PORT_START("SYSTEM")   // IN0 - $0 "PORT0 A"
265   PORT_START("SYSTEM")   /* $0 "PORT0 A" */
267266   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1)
268267   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2)
269268   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3)
r3115r3116
273272   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3)
274273   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4)
275274
276   PORT_START("BUTTONS")   // IN1 - $1 "PORT0 B"
275   PORT_START("BUTTONS")   /* $1 "PORT0 B" */
277276   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1)
278277   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2)
279278   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3)
r3115r3116
283282   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_PLAYER(2)
284283   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_PLAYER(2)
285284
286   PORT_START("DSW1")   // IN2 - $2 "DSW1"
285   PORT_START("DSW1")   /* $2 "DSW1" */
287286   PORT_DIPNAME( 0x01, 0x01, "DSW1" )
288287   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
289288   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
309308   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
310309   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
311310
312   PORT_START("DSW2")   // IN3 - $10 "DSW2"
311   PORT_START("DSW2")   /* $10 "DSW2" */
313312   PORT_DIPNAME( 0x01, 0x01, "DSW2" )
314313   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
315314   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
335334   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
336335   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
337336
338   PORT_START("COIN1")   // IN4 - $11 "PORT1 B"
337   PORT_START("COIN1")   /* $11 "PORT1 B" */
339338   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1   ) PORT_IMPULSE(5)
340339   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
341340   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
345344   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
346345   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
347346
348   PORT_START("COIN2")   // IN5 - $12 "PORT1 C"
347   PORT_START("COIN2")   /* $12 "PORT1 C" */
349348   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2)
350349   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
351350   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
355354   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
356355   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
357356
358   PORT_START("DSW4")   // IN6 - AY8910 port A
357   PORT_START("DSW4")   /* AY8910 port A */
359358   PORT_DIPNAME( 0x01, 0x01, "DSW4" )
360359   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
361360   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
381380   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
382381   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
383382
384   PORT_START("DSW3")   // IN7 - AY8910 port B
383   PORT_START("DSW3")   /* AY8910 port B */
385384   PORT_DIPNAME( 0x01, 0x01, "DSW3" )
386385   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
387386   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
406405   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
407406   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
408407   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
409
410408INPUT_PORTS_END
411409
412410static const ay8910_interface ay8910_config =
src/mame/drivers/spbactn.c
r3115r3116
150150   AM_RANGE(0x60000, 0x67fff) AM_READ(SMH_RAM)
151151   AM_RANGE(0x70000, 0x77fff) AM_READ(SMH_RAM)
152152   AM_RANGE(0x80000, 0x82fff) AM_READ(SMH_RAM)
153   AM_RANGE(0x90000, 0x90001) AM_READ(input_port_0_word_r)
154   AM_RANGE(0x90010, 0x90011) AM_READ(input_port_1_word_r)
155   AM_RANGE(0x90020, 0x90021) AM_READ(input_port_2_word_r)
156   AM_RANGE(0x90030, 0x90031) AM_READ(input_port_4_word_r)
157   AM_RANGE(0x90040, 0x90041) AM_READ(input_port_3_word_r)
153   AM_RANGE(0x90000, 0x90001) AM_READ_PORT("IN0")
154   AM_RANGE(0x90010, 0x90011) AM_READ_PORT("IN1")
155   AM_RANGE(0x90020, 0x90021) AM_READ_PORT("SYSTEM")
156   AM_RANGE(0x90030, 0x90031) AM_READ_PORT("DSW1")
157   AM_RANGE(0x90040, 0x90041) AM_READ_PORT("DSW2")
158158ADDRESS_MAP_END
159159
160160static ADDRESS_MAP_START( spbactn_writemem, ADDRESS_SPACE_PROGRAM, 16 )
r3115r3116
216216ADDRESS_MAP_END
217217
218218static INPUT_PORTS_START( spbactn )
219   PORT_START("IN0")   /* IN0 */
219   PORT_START("IN0")
220220   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
221221   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
222222   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
226226   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
227227   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
228228
229   PORT_START("IN1")   /* IN1 */
229   PORT_START("IN1")
230230   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
231231   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
232232   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
236236   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
237237   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
238238
239   PORT_START("SYSTEM")   /* IN2 */
239   PORT_START("SYSTEM")
240240   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
241241   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
242242   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )      // Press mulitple times for multiple players
r3115r3116
246246   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
247247   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
248248
249   PORT_START("DSW1")   /* DSW1 */
249   PORT_START("DSW1")
250250   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
251251   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
252252   PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ) )
r3115r3116
271271   PORT_DIPSETTING(    0x80, "4" )
272272   PORT_DIPSETTING(    0x40, "5" )
273273
274   PORT_START("DSW2")   /* DSW2 */
274   PORT_START("DSW2")
275275   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
276276   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
277277   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
src/mame/drivers/system16.c
r3115r3116
161161
162162#include "driver.h"
163163#include "cpu/z80/z80.h"
164#include "cpu/i8039/i8039.h"
164#include "cpu/mcs48/mcs48.h"
165165#include "system16.h"
166166#include "cpu/m68000/m68000.h"
167167#include "machine/fd1094.h"
r3115r3116
186186
187187/***************************************************************************/
188188
189// 7751 emulation
190WRITE8_HANDLER( sys16_7751_audio_8255_w );
191 READ8_HANDLER( sys16_7751_audio_8255_r );
192 READ8_HANDLER( sys16_7751_sh_rom_r );
193 READ8_HANDLER( sys16_7751_sh_t1_r );
194 READ8_HANDLER( sys16_7751_sh_command_r );
195WRITE8_HANDLER( sys16_7751_sh_dac_w );
196WRITE8_HANDLER( sys16_7751_sh_busy_w );
197WRITE8_HANDLER( sys16_7751_sh_offset_a0_a3_w );
198WRITE8_HANDLER( sys16_7751_sh_offset_a4_a7_w );
199WRITE8_HANDLER( sys16_7751_sh_offset_a8_a11_w );
200WRITE8_HANDLER( sys16_7751_sh_rom_select_w );
201
202/***************************************************************************/
203
204189static UINT16 coinctrl;
205190
206191static WRITE16_HANDLER( sys16_3d_coinctrl_w )
src/mame/drivers/redalert.c
r3115r3116
356356
357357ROM_START( ww3 )
358358   ROM_REGION( 0x10000, "main", 0 )
359   ROM_LOAD( "w3i5.3f",      0x5000, 0x1000, CRC(9fc24ad3) )
360   ROM_LOAD( "w3i6.3d",      0x6000, 0x1000, CRC(cb2a308c) )
361   ROM_LOAD( "w3i7b.3b",     0x7000, 0x1000, CRC(1a0c3936) )
362   ROM_LOAD( "w3i8.3g",      0x8000, 0x1000, CRC(9e18a92c) )
363   ROM_LOAD( "w3i9.3e",      0x9000, 0x1000, CRC(8c5884a4) )
364   ROM_LOAD( "w3ia.3c",      0xa000, 0x1000, CRC(dccb8605) )
365   ROM_LOAD( "w3ib.3a",      0xb000, 0x1000, CRC(3658e465) )
359   ROM_LOAD( "w3i5.3f",      0x5000, 0x1000, CRC(9fc24ad3) SHA1(697ab22555ff5aae09f50051ccda545c17a0ac8a) )
360   ROM_LOAD( "w3i6.3d",      0x6000, 0x1000, CRC(cb2a308c) SHA1(9f3bc22bad31165e080e81d4a3fb0ec2aad235fe) )
361   ROM_LOAD( "w3i7b.3b",     0x7000, 0x1000, CRC(1a0c3936) SHA1(fa2d0a1425624ae4d811adc9ea75850641207682) )
362   ROM_LOAD( "w3i8.3g",      0x8000, 0x1000, CRC(9e18a92c) SHA1(c352b7c66ebfc875bb44772874e58c5f6d8cabbc) )
363   ROM_LOAD( "w3i9.3e",      0x9000, 0x1000, CRC(8c5884a4) SHA1(e6f5a5e65d9e59ff37385ab02852c1fdce9088db) )
364   ROM_LOAD( "w3ia.3c",      0xa000, 0x1000, CRC(dccb8605) SHA1(f4c5e1a5de0828c5e39f37e2bf10f4f60bef856a) )
365   ROM_LOAD( "w3ib.3a",      0xb000, 0x1000, CRC(3658e465) SHA1(2c910b2e9d689cb577d8a63bc4d07d0770a6de68) )
366366
367367   ROM_REGION( 0x10000, "audio", 0 )
368368   ROM_LOAD( "w3s1",         0x7000, 0x0800, CRC(4af956a5) SHA1(25368a40d7ebc60316fd2d78ec4c686e701b96dc) )
src/mame/drivers/pengo.c
r3115r3116
103103   AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
104104   AM_RANGE(0x9000, 0x901f) AM_WRITE(pacman_sound_w) AM_BASE(&pacman_soundregs)
105105   AM_RANGE(0x9020, 0x902f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram_2)
106   AM_RANGE(0x9000, 0x903f) AM_READ(input_port_3_r)   /* DSW1 */
107   AM_RANGE(0x9040, 0x907f) AM_READ(input_port_2_r)   /* DSW0 */
106   AM_RANGE(0x9000, 0x903f) AM_READ_PORT("DSW1")
107   AM_RANGE(0x9040, 0x907f) AM_READ_PORT("DSW0")
108108   AM_RANGE(0x9040, 0x9040) AM_WRITE(interrupt_enable_w)
109109   AM_RANGE(0x9041, 0x9041) AM_WRITE(pacman_sound_enable_w)
110110   AM_RANGE(0x9042, 0x9042) AM_WRITE(pengo_palettebank_w)
r3115r3116
113113   AM_RANGE(0x9046, 0x9046) AM_WRITE(pengo_colortablebank_w)
114114   AM_RANGE(0x9047, 0x9047) AM_WRITE(pengo_gfxbank_w)
115115   AM_RANGE(0x9070, 0x9070) AM_WRITE(SMH_NOP)
116   AM_RANGE(0x9080, 0x90bf) AM_READ(input_port_1_r)   /* IN1 */
117   AM_RANGE(0x90c0, 0x90ff) AM_READ(input_port_0_r)   /* IN0 */
116   AM_RANGE(0x9080, 0x90bf) AM_READ_PORT("IN1")
117   AM_RANGE(0x90c0, 0x90ff) AM_READ_PORT("IN0")
118118ADDRESS_MAP_END
119119
120120
r3115r3116
126126   AM_RANGE(0x9000, 0x901f) AM_WRITE(pacman_sound_w) AM_BASE(&pacman_soundregs)
127127   AM_RANGE(0x9020, 0x902f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram_2)
128128   AM_RANGE(0x9030, 0x9030) AM_WRITE(jrpacman_scroll_w)
129   AM_RANGE(0x9040, 0x904f) AM_READ(input_port_2_r)   /* DSW1 */
129   AM_RANGE(0x9040, 0x904f) AM_READ_PORT("DSW")
130130   AM_RANGE(0x9040, 0x9040) AM_WRITE(interrupt_enable_w)
131131   AM_RANGE(0x9041, 0x9041) AM_WRITE(pacman_sound_enable_w)
132132   AM_RANGE(0x9042, 0x9042) AM_WRITE(pengo_palettebank_w)
r3115r3116
136136   AM_RANGE(0x9046, 0x9046) AM_WRITE(pengo_colortablebank_w)
137137   AM_RANGE(0x9047, 0x9047) AM_WRITE(jrpacman_charbank_w)
138138   AM_RANGE(0x9070, 0x9070) AM_WRITE(SMH_NOP)
139   AM_RANGE(0x9080, 0x90bf) AM_READ(input_port_1_r)   /* IN1 */
140   AM_RANGE(0x90c0, 0x90ff) AM_READ(input_port_0_r)   /* IN0 */
139   AM_RANGE(0x9080, 0x90bf) AM_READ_PORT("P1")
140   AM_RANGE(0x90c0, 0x90ff) AM_READ_PORT("P2")
141141ADDRESS_MAP_END
142142
143143
r3115r3116
238238
239239
240240static INPUT_PORTS_START( jrpacmbl )
241   PORT_START("IN0")
241   PORT_START("P1")
242242   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
243243   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
244244   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
r3115r3116
248248   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
249249   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
250250
251   PORT_START("IN1")
251   PORT_START("P2")
252252   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
253253   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
254254   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
r3115r3116
258258   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
259259   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
260260
261   PORT_START("DSW0")
261   PORT_START("DSW")
262262   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) )
263263   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
264264   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
src/mame/drivers/stadhero.c
r3115r3116
3131   switch (offset<<1)
3232   {
3333      case 0: /* Player 1 & 2 joystick & buttons */
34         return (input_port_read(machine, "P1") | (input_port_read(machine, "P2") << 8));
34         return input_port_read(machine, "INPUTS");
3535
3636      case 2: /* Credits, start buttons */
3737         return (input_port_read(machine, "COIN") | (input_port_read(machine, "COIN") << 8));
3838
3939      case 4: /* Dip switches */
40         return (input_port_read(machine, "DSW1") | (input_port_read(machine, "DSW2") << 8));
40         return input_port_read(machine, "DSW");
4141   }
4242
4343   logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",activecpu_get_pc(),0x30c000+offset);
r3115r3116
113113/******************************************************************************/
114114
115115static INPUT_PORTS_START( stadhero )
116   PORT_START("P1")   /* 0x30c001 : Player 1 controls */
117   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(1)
118   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_PLAYER(1)
119   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_PLAYER(1)
120   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
121   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
122   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
123   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
124   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
116   PORT_START("INPUTS")   /* 0x30c000 - 0x30c001 */
117   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
118   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
119   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
120   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
121   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
122   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
123   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
124   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
125   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
126   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
127   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
128   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
129   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
130   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
131   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
132   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
125133
126   PORT_START("P2")   /* 0x30c000 : Player 2 controls */
127   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(2)
128   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_PLAYER(2)
129   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_PLAYER(2)
130   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
131   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
132   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
133   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
134   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
135
136134   PORT_START("COIN")   /* 0x30c002 & 0x30c003 : Credits, start buttons */
137135   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )            /* related to music/sound */
138136   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )            /* related to music/sound */
r3115r3116
143141   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
144142   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
145143
146   PORT_START("DSW1")   /* 0x30c005 : Dip switch bank 1 */
147   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
148   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
149   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
150   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
151   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
152   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
153   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
154   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
155   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
156   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
157   PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW )
158   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
159   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
160   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
161   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
162   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
163   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
164   PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
165
166   PORT_START("DSW2")   /* 0x30c004 : Dip switch bank 2 */
167   PORT_DIPNAME( 0x03, 0x03, "Time (1P Vs CPU)" )          /* Table at 0x0014f6 */
168   PORT_DIPSETTING(    0x02, "600" )
169   PORT_DIPSETTING(    0x03, "500" )
170   PORT_DIPSETTING(    0x01, "450" )
171   PORT_DIPSETTING(    0x00, "400" )
172   PORT_DIPNAME( 0x0c, 0x0c, "Time (1P Vs 2P)" )           /* Table at 0x0014fe */
173   PORT_DIPSETTING(    0x08, "270" )
174   PORT_DIPSETTING(    0x0c, "210" )
175   PORT_DIPSETTING(    0x04, "180" )
176   PORT_DIPSETTING(    0x00, "120" )
177   PORT_DIPNAME( 0x30, 0x30, "Final Set" )                 /* Table at 0x00078c */
178   PORT_DIPSETTING(    0x20, "3 Credits" )
179   PORT_DIPSETTING(    0x30, "4 Credits" )
180   PORT_DIPSETTING(    0x10, "5 Credits" )
181   PORT_DIPSETTING(    0x00, "6 Credits" )
182   PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )
183   PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
144   PORT_START("DSW")   /* 0x30c004 - 0x30c005 */
145   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A ) )
146   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
147   PORT_DIPSETTING(      0x0001, DEF_STR( 2C_1C ) )
148   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) )
149   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_2C ) )
150   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B ) )
151   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
152   PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
153   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_1C ) )
154   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_2C ) )
155   PORT_DIPUNUSED( 0x0010, IP_ACTIVE_LOW )
156   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
157   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
158   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
159   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
160   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
161   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
162   PORT_DIPUNUSED( 0x0080, IP_ACTIVE_LOW )
163   PORT_DIPNAME( 0x0300, 0x0300, "Time (1P Vs CPU)" )          /* Table at 0x0014f6 */
164   PORT_DIPSETTING(      0x0200, "600" )
165   PORT_DIPSETTING(      0x0300, "500" )
166   PORT_DIPSETTING(      0x0100, "450" )
167   PORT_DIPSETTING(      0x0000, "400" )
168   PORT_DIPNAME( 0x0c00, 0x0c00, "Time (1P Vs 2P)" )           /* Table at 0x0014fe */
169   PORT_DIPSETTING(      0x0800, "270" )
170   PORT_DIPSETTING(      0x0c00, "210" )
171   PORT_DIPSETTING(      0x0400, "180" )
172   PORT_DIPSETTING(      0x0000, "120" )
173   PORT_DIPNAME( 0x3000, 0x3000, "Final Set" )                 /* Table at 0x00078c */
174   PORT_DIPSETTING(      0x2000, "3 Credits" )
175   PORT_DIPSETTING(      0x3000, "4 Credits" )
176   PORT_DIPSETTING(      0x1000, "5 Credits" )
177   PORT_DIPSETTING(      0x0000, "6 Credits" )
178   PORT_DIPUNUSED( 0x4000, IP_ACTIVE_LOW )
179   PORT_DIPUNUSED( 0x8000, IP_ACTIVE_LOW )
184180INPUT_PORTS_END
185181
186182/******************************************************************************/
src/mame/drivers/simpsons.c
r3115r3116
66Ernesto Corvi
77someone@secureshell.com
88
9PCB Layout
10----------
11
12GX072  PWB352346B
13|-----------------------------------------------------|
14| MB3722   072D04.1D  072D05.1F        8464           |
15|  VOL VOL     YM2151                        072B08.3N|
16|           YM3012     053260       053246            |
17|CN3                 3.579545MHz                      |
18|              Z80     072E03.6G                      |
19|J 052535                 8416      053247            |
20|A 052535                 2018               072B09.8N|
21|M 052535 053994          2018      053251            |
22|M 051550 053995                                      |
23|A                   8464                             |
24|    ER5911               052109    051962  072B10.12N|
25|TEST  072M13.13C                                     |
26|      072L12.15C                                     |
27|CN6   072G02.16C  053248  8464  072B06.16H 072B11.16L|
28|CN7   072G01.17C    24MHz 8464  072B07.18H           |
29|-----------------------------------------------------|
30Notes:
31       CN3 - 4 pin connector for sound output for right speaker (left speaker
32             is via the JAMMA connector)
33   CN6/CN7 - 15 pin connector for player 3 and player 4 controls
34    ER5911 - EEPROM (128bx8 == 93C46)
35      8464 - 8kx8 SRAM
36      8416 - 2kx8 SRAM
37      2018 - 2kx8 SRAM
38    MB3722 - Audio Power AMP
39       Z80 - clock 3.579545MHz
40    YM2151 - clock 3.579545MHz
41    YM3012 - clock 1.7897725MHz [3.579545/2]
42Custom ICs - 053260        - sound chip (QFP80)
43             053246/053247 - sprite generators (QFP120)
44             053251        - priority encoder (QFP100)
45             052535        - RGB DAC (ceramic encased SIP9)
46             051550        - I/O DAC (ceramic encased SIP23)
47             053994/053995 - PALs (MMI PAL16L8, DIP20)
48             052109/051962 - Tilemap Generators (QFP120)
49             053248        - CPU (QFP80), clock input 12.000MHz and 3.000MHz [24/2 and 24/8]
50      ROMs - 072D04 \  256kx8 DIP40 MaskROM
51             072D05 /  1Mx8 DIP40 MaskROM (Sound Samples)
52             072E03 -  32kx8 MaskROM (Z80 Sound Program)
53             072B08 \
54             072B09  |
55             072B10  | 512kx16 DIP40 MaskROM (Sprites)
56             072B11 /
57             072B06 \
58             072B07 /  256kx16 DIP40 MaskROM (Tiles)
59             072M13 \
60             072L12  |
61             072G02  | 128kx8 DIP32 MaskROM (Main Program)
62             072G01 /
63
64     VSync - 59.1856Hz
65     HSync - 15.1566kHz
66
967***************************************************************************/
1068
1169#include "driver.h"
src/mame/drivers/marvins.c
r3115r3116
3838
3939#define CREDITS "Phil Stroffolino\nTim Lindquist\nCarlos A. Lozano"
4040
41extern int marvins_gamegroup;
4142
43// FIXME this is definitely wrong, schematics clearly show that vblank triggers interrupt
44// on both CPU at the same time.
45static int snk_irq_delay = 1500;
46
47// see IRQ notes in drivers\marvins.c
48static TIMER_CALLBACK( irq_trigger_callback ) { cpunum_set_input_line(machine, param, 0, HOLD_LINE); }
49
50static INTERRUPT_GEN( snk_irq_BA )
51{
52   cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
53   timer_set(ATTOTIME_IN_USEC(snk_irq_delay), NULL, 0, irq_trigger_callback);
54}
55
56
4257/***************************************************************************
4358**
4459**  CPUA and CPUB communicate through shared RAM.
r3115r3116
739754static DRIVER_INIT( marvins )
740755{
741756   sound_cpu_busy = 0;
742   snk_gamegroup = 0;
757   marvins_gamegroup = 0;
743758}
744759
745760static DRIVER_INIT( madcrash )
r3115r3116
753768    mem[0x3a5d] = 0; mem[0x3a5e] = 0; mem[0x3a5f] = 0;
754769*/
755770   sound_cpu_busy = 0;
756   snk_gamegroup = 1;
771   marvins_gamegroup = 1;
757772   snk_irq_delay = 1700;
758773}
759774
760775static DRIVER_INIT( vangrd2 )
761776{
762777   sound_cpu_busy = 0;
763   snk_gamegroup = 2;
778   marvins_gamegroup = 2;
764779}
765780
766781
src/mame/drivers/polepos.c
r3115r3116
453453   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
454454   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
455455
456   PORT_START("DSWA")   /* DSW A */
456   PORT_START("DSWA")
457457   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
458458   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
459459   PORT_DIPSETTING(   0x03, DEF_STR( 2C_1C ) )
r3115r3116
477477   PORT_DIPSETTING(   0x80, "3" )
478478   PORT_DIPSETTING(   0x00, "4" )
479479
480   PORT_START("DSWB")   /* DSW B */
480   PORT_START("DSWB")
481481   PORT_DIPNAME( 0x07, 0x07, "Extended Rank" )
482482   PORT_DIPSETTING(   0x07, "A" )
483483   PORT_DIPSETTING(   0x03, "B" )
r3115r3116
503503   PORT_DIPSETTING(   0x80, DEF_STR( Off ))
504504   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
505505
506   PORT_START("BRAKE") /* IN1 - Brake */
506   PORT_START("BRAKE")
507507   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
508508
509   PORT_START("ACCEL") /* IN2 - Accel */
509   PORT_START("ACCEL")
510510   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
511511
512   PORT_START("STEER") /* IN3 - Steering */
512   PORT_START("STEER")
513513   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(4)
514514INPUT_PORTS_END
515515
r3115r3116
525525   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
526526   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
527527
528   PORT_START("DSWA")   /* DSW A */
528   PORT_START("DSWA")
529529   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
530530   PORT_DIPSETTING(   0xc0, DEF_STR( 3C_1C ) )
531531   PORT_DIPSETTING(   0x20, DEF_STR( 2C_1C ) )
r3115r3116
549549   PORT_DIPSETTING(   0x01, "3" )
550550   PORT_DIPSETTING(   0x00, "4" )
551551
552   PORT_START("DSWB")   /* DSW B */
552   PORT_START("DSWB")
553553   PORT_DIPNAME( 0xe0, 0xe0, "Practice Rank" )
554554   PORT_DIPSETTING(   0xe0, "A" )
555555   PORT_DIPSETTING(   0x60, "B" )
r3115r3116
575575   PORT_DIPSETTING(   0x01, DEF_STR( Off ))
576576   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
577577
578   PORT_START("BRAKE") /* IN1 - Brake */
578   PORT_START("BRAKE")
579579   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
580580
581   PORT_START("ACCEL") /* IN2 - Accel */
581   PORT_START("ACCEL")
582582   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
583583
584   PORT_START("STEER") /* IN3 - Steering */
584   PORT_START("STEER")
585585   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(4)
586586INPUT_PORTS_END
587587
r3115r3116
597597   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
598598   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
599599
600   PORT_START("DSWA")   /* DSW A */
600   PORT_START("DSWA")
601601   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
602602   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
603603   PORT_DIPSETTING(   0x03, DEF_STR( 2C_1C ) )
r3115r3116
621621   PORT_DIPSETTING(   0x80, "3" )
622622   PORT_DIPSETTING(   0x00, "4" )
623623
624   PORT_START("DSWB")   /* DSW B */
624   PORT_START("DSWB")
625625   PORT_DIPNAME( 0x07, 0x07, "Extended Rank" )
626626   PORT_DIPSETTING(   0x07, "A" )
627627   PORT_DIPSETTING(   0x03, "B" )
r3115r3116
647647   PORT_DIPSETTING(   0x80, DEF_STR( Off ))
648648   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
649649
650   PORT_START("BRAKE") /* IN1 - Brake */
650   PORT_START("BRAKE")
651651   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
652652
653   PORT_START("ACCEL") /* IN2 - Accel */
653   PORT_START("ACCEL")
654654   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
655655
656   PORT_START("STEER") /* IN3 - Steering */
656   PORT_START("STEER")
657657   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(4)
658658INPUT_PORTS_END
659659
r3115r3116
669669   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
670670   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
671671
672   PORT_START("DSWA")   /* DSW A */
672   PORT_START("DSWA")
673673   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
674674   PORT_DIPSETTING(   0xc0, DEF_STR( 3C_1C ) )
675675   PORT_DIPSETTING(   0x20, DEF_STR( 2C_1C ) )
r3115r3116
694694   PORT_DIPSETTING(   0x01, DEF_STR( Off ))
695695   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
696696
697   PORT_START("DSWB")   /* DSW B */
697   PORT_START("DSWB")
698698   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Game_Time ) )
699699   PORT_DIPSETTING(   0x80, "90 secs." )
700700   PORT_DIPSETTING(   0x00, "120 secs." )
r3115r3116
717717   PORT_DIPSETTING(   0x01, "Average" )
718718   PORT_DIPSETTING(   0x00, DEF_STR( High ) )
719719
720   PORT_START("BRAKE") /* IN1 - Brake */
720   PORT_START("BRAKE")
721721   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
722722
723   PORT_START("ACCEL") /* IN2 - Accel */
723   PORT_START("ACCEL")
724724   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
725725
726   PORT_START("STEER") /* IN3 - Steering */
726   PORT_START("STEER")
727727   PORT_BIT ( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(4)
728728INPUT_PORTS_END
729729
r3115r3116
17431743   polepos_gear_bit = 0x20;
17441744
17451745   /* extra direct mapped inputs read */
1746   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, input_port_5_r);
1747   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, input_port_0_r);
1748   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, input_port_1_r);
1746   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x02, 0x02, 0, 0, input_port_read_handler8(machine->portconfig, "STEER"));
1747   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, input_port_read_handler8(machine->portconfig, "IN0"));
1748   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, input_port_read_handler8(machine->portconfig, "DSWA"));
17491749
17501750}
17511751
src/mame/drivers/tank8.c
r3115r3116
9999
100100   AM_RANGE(0x1c00, 0x1c00) AM_READ(tank8_collision_r)
101101
102   AM_RANGE(0x1c01, 0x1c01) AM_READ(input_port_0_r)
103   AM_RANGE(0x1c02, 0x1c02) AM_READ(input_port_1_r)
104   AM_RANGE(0x1c03, 0x1c03) AM_READ(input_port_2_r)
105   AM_RANGE(0x1c04, 0x1c04) AM_READ(input_port_3_r)
106   AM_RANGE(0x1c05, 0x1c05) AM_READ(input_port_4_r)
107   AM_RANGE(0x1c06, 0x1c06) AM_READ(input_port_5_r)
108   AM_RANGE(0x1c07, 0x1c07) AM_READ(input_port_6_r)
109   AM_RANGE(0x1c08, 0x1c08) AM_READ(input_port_7_r)
110   AM_RANGE(0x1c09, 0x1c09) AM_READ(input_port_8_r)
111   AM_RANGE(0x1c0a, 0x1c0a) AM_READ(input_port_9_r)
112   AM_RANGE(0x1c0b, 0x1c0b) AM_READ(input_port_10_r)
113   AM_RANGE(0x1c0f, 0x1c0f) AM_READ(input_port_11_r)
102   AM_RANGE(0x1c01, 0x1c01) AM_READ_PORT("P1")
103   AM_RANGE(0x1c02, 0x1c02) AM_READ_PORT("P2")
104   AM_RANGE(0x1c03, 0x1c03) AM_READ_PORT("P3")
105   AM_RANGE(0x1c04, 0x1c04) AM_READ_PORT("P4")
106   AM_RANGE(0x1c05, 0x1c05) AM_READ_PORT("P5")
107   AM_RANGE(0x1c06, 0x1c06) AM_READ_PORT("P6")
108   AM_RANGE(0x1c07, 0x1c07) AM_READ_PORT("P7")
109   AM_RANGE(0x1c08, 0x1c08) AM_READ_PORT("P8")
110   AM_RANGE(0x1c09, 0x1c09) AM_READ_PORT("DSW1")
111   AM_RANGE(0x1c0a, 0x1c0a) AM_READ_PORT("DSW2")
112   AM_RANGE(0x1c0b, 0x1c0b) AM_READ_PORT("RC")
113   AM_RANGE(0x1c0f, 0x1c0f) AM_READ_PORT("VBLANK")
114114
115115   AM_RANGE(0x1800, 0x1bff) AM_WRITE(tank8_video_ram_w) AM_BASE(&tank8_video_ram)
116116   AM_RANGE(0x1c00, 0x1c0f) AM_WRITE(SMH_RAM) AM_BASE(&tank8_pos_h_ram)
r3115r3116
131131
132132
133133static INPUT_PORTS_START( tank8 )
134   PORT_START("P1") // 0
135   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
136   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_UP    ) PORT_2WAY PORT_PLAYER(1)
137   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_DOWN  ) PORT_2WAY PORT_PLAYER(1)
138   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_UP   ) PORT_2WAY PORT_PLAYER(1)
139   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(1)
140   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNUSED )
141   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
142   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(1)
134   PORT_START("P1")
135   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
136   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_2WAY PORT_PLAYER(1)
137   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_2WAY PORT_PLAYER(1)
138   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_2WAY PORT_PLAYER(1)
139   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(1)
140   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
141   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
142   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
143143
144   PORT_START("P2") // 1
145   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN2 )
146   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_UP    ) PORT_2WAY PORT_PLAYER(2)
147   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_DOWN  ) PORT_2WAY PORT_PLAYER(2)
148   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_UP   ) PORT_2WAY PORT_PLAYER(2)
149   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(2)
150   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNUSED )
151   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
152   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(2)
144   PORT_START("P2")
145   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )
146   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_2WAY PORT_PLAYER(2)
147   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_2WAY PORT_PLAYER(2)
148   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_2WAY PORT_PLAYER(2)
149   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(2)
150   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
151   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
152   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
153153
154   PORT_START("P3") // 2
155   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN3 )
156   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_UP    ) PORT_2WAY PORT_PLAYER(3)
157   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_DOWN  ) PORT_2WAY PORT_PLAYER(3)
158   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_UP   ) PORT_2WAY PORT_PLAYER(3)
159   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(3)
160   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNUSED )
161   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
162   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(3)
154   PORT_START("P3")
155   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
156   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_2WAY PORT_PLAYER(3)
157   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_2WAY PORT_PLAYER(3)
158   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_2WAY PORT_PLAYER(3)
159   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(3)
160   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
161   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
162   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
163163
164   PORT_START("P4") // 3
165   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN4 )
166   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_UP    ) PORT_2WAY PORT_PLAYER(4)
167   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_DOWN  ) PORT_2WAY PORT_PLAYER(4)
168   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_UP   ) PORT_2WAY PORT_PLAYER(4)
169   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(4)
170   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNUSED )
171   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
172   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(4)
164   PORT_START("P4")
165   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN4 )
166   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_2WAY PORT_PLAYER(4)
167   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_2WAY PORT_PLAYER(4)
168   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_2WAY PORT_PLAYER(4)
169   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(4)
170   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
171   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
172   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
173173
174   PORT_START("P5") // 4
175   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN5 )
176   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_UP    ) PORT_2WAY PORT_PLAYER(5)
177   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_DOWN  ) PORT_2WAY PORT_PLAYER(5)
178   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_UP   ) PORT_2WAY PORT_PLAYER(5)
179   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(5)
180   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNUSED )
181   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
182   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(5)
174   PORT_START("P5")
175   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN5 )
176   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_2WAY PORT_PLAYER(5)
177   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_2WAY PORT_PLAYER(5)
178   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_2WAY PORT_PLAYER(5)
179   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(5)
180   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
181   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
182   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(5)
183183
184   PORT_START("P6") // 5
185   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN6 )
186   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_UP    ) PORT_2WAY PORT_PLAYER(6)
187   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_DOWN  ) PORT_2WAY PORT_PLAYER(6)
188   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_UP   ) PORT_2WAY PORT_PLAYER(6)
189   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(6)
190   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNUSED )
191   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
192   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(6)
184   PORT_START("P6")
185   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN6 )
186   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_2WAY PORT_PLAYER(6)
187   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_2WAY PORT_PLAYER(6)
188   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_2WAY PORT_PLAYER(6)
189   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(6)
190   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
191   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
192   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(6)
193193
194   PORT_START("P7") // 6
195   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN7 )
196   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_UP    ) PORT_2WAY PORT_PLAYER(7)
197   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_DOWN  ) PORT_2WAY PORT_PLAYER(7)
198   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_UP   ) PORT_2WAY PORT_PLAYER(7)
199   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(7)
200   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNUSED )
201   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
202   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(7)
194   PORT_START("P7")
195   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN7 )
196   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_2WAY PORT_PLAYER(7)
197   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_2WAY PORT_PLAYER(7)
198   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_2WAY PORT_PLAYER(7)
199   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(7)
200   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
201   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
202   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(7)
203203
204   PORT_START("P8") // 7
205   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN8 )
206   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_UP    ) PORT_2WAY PORT_PLAYER(8)
207   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICKLEFT_DOWN  ) PORT_2WAY PORT_PLAYER(8)
208   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_UP   ) PORT_2WAY PORT_PLAYER(8)
209   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(8)
210   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNUSED )
211   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
212   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(8)
204   PORT_START("P8")
205   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN8 )
206   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_2WAY PORT_PLAYER(8)
207   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_2WAY PORT_PLAYER(8)
208   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_2WAY PORT_PLAYER(8)
209   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(8)
210   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
211   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
212   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(8)
213213
214214   /* play time is 4351 + N * 640 frames */
215
216   PORT_START("DSW1") // 8
215   PORT_START("DSW1")
217216   PORT_DIPNAME( 0x0f, 0x08, "Play Time" )
218217   PORT_DIPSETTING(    0x0f, "73 seconds" )
219218   PORT_DIPSETTING(    0x0e, "83 seconds" )
r3115r3116
233232   PORT_DIPSETTING(    0x00, "233 seconds" )
234233   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
235234
236   PORT_START("DSW2") // 9
235   PORT_START("DSW2")
237236   PORT_DIPNAME( 0x01, 0x01, "Remote" )
238   PORT_DIPSETTING(    0x01, DEF_STR( Off ))
239   PORT_DIPSETTING(    0x00, DEF_STR( On ))
237   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
238   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
240239   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "Team" )
241240   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "Remote Start" )
242241   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "Remote Team" )
r3115r3116
245244   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
246245   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
247246
248   PORT_START("RC") // 10
247   PORT_START("RC")
249248   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "RC 1" )
250249   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "RC 2" )
251250   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "RC 3" )
r3115r3116
255254   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "RC 7" )
256255   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "RC 8" )
257256
258   PORT_START("VBLANK") // 11
257   PORT_START("VBLANK")
259258   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
260259
261   PORT_START("CRASH") // 12
260   PORT_START("CRASH")
262261   PORT_ADJUSTER( 50, "Crash, Explosion Volume" )
263
264262INPUT_PORTS_END
265263
266264
src/mame/drivers/namcos86.c
r3115r3116
416416   AM_RANGE(ADDR_INPUT+0x00, ADDR_INPUT+0x01) AM_READ(ym2151_status_port_0_r)         \
417417   AM_RANGE(ADDR_INPUT+0x00, ADDR_INPUT+0x00) AM_WRITE(ym2151_register_port_0_w)      \
418418   AM_RANGE(ADDR_INPUT+0x01, ADDR_INPUT+0x01) AM_WRITE(ym2151_data_port_0_w)         \
419   AM_RANGE(ADDR_INPUT+0x20, ADDR_INPUT+0x20) AM_READ(input_port_0_r)               \
420   AM_RANGE(ADDR_INPUT+0x21, ADDR_INPUT+0x21) AM_READ(input_port_1_r)               \
419   AM_RANGE(ADDR_INPUT+0x20, ADDR_INPUT+0x20) AM_READ_PORT("IN0")                  \
420   AM_RANGE(ADDR_INPUT+0x21, ADDR_INPUT+0x21) AM_READ_PORT("IN1")                  \
421421   AM_RANGE(ADDR_INPUT+0x30, ADDR_INPUT+0x30) AM_READ(dsw0_r)                     \
422422   AM_RANGE(ADDR_INPUT+0x31, ADDR_INPUT+0x31) AM_READ(dsw1_r)                     \
423423   AM_RANGE(ADDR_LOWROM, ADDR_LOWROM+0x3fff) AM_ROM                           \
r3115r3116
444444}
445445
446446static ADDRESS_MAP_START( mcu_port_map, ADDRESS_SPACE_IO, 8 )
447   AM_RANGE(HD63701_PORT1, HD63701_PORT1) AM_READ(input_port_4_r)
447   AM_RANGE(HD63701_PORT1, HD63701_PORT1) AM_READ_PORT("IN2")
448448   AM_RANGE(HD63701_PORT2, HD63701_PORT2) AM_READ(readFF)   /* leds won't work otherwise */
449449   AM_RANGE(HD63701_PORT1, HD63701_PORT1) AM_WRITE(namcos86_coin_w)
450450   AM_RANGE(HD63701_PORT2, HD63701_PORT2) AM_WRITE(namcos86_led_w)
r3115r3116
474474   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
475475   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
476476
477   PORT_START("IN2")
478   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
479   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
480   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
481   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
482   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
483   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
484   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
485   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
486
477487   PORT_START("DSWA")
478488   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
479489   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) )
r3115r3116
520530   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
521531   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
522532   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
523
524   PORT_START("IN4")
525   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
526   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
527   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
528   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
529   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
530   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
531   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
532   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
533533INPUT_PORTS_END
534534
535535static INPUT_PORTS_START( skykiddx )
r3115r3116
553553   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
554554   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
555555
556   PORT_START("IN2")
557   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
558   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
559   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
560   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
561   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
562   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
563   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
564   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
565
556566   PORT_START("DSWA")
557567   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
558568   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) )
r3115r3116
598608   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
599609   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
600610   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
601
602   PORT_START("IN4")
603   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
604   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
605   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
606   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
607   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
608   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
609   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
610   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
611611INPUT_PORTS_END
612612
613613static INPUT_PORTS_START( roishtar )
r3115r3116
631631   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
632632   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
633633
634   PORT_START("IN2")
635   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
636   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
637   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
638   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
639   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_8WAY
640   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_8WAY
641   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
642   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY
643
634644   PORT_START("DSWA")
635645   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
636646   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
r3115r3116
680690   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
681691   PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
682692   PORT_DIPSETTING(    0x03, DEF_STR( 1C_6C ) )
683
684   PORT_START("IN4")
685   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
686   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
687   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
688   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
689   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_8WAY
690   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_8WAY
691   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
692   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY
693693INPUT_PORTS_END
694694
695695static INPUT_PORTS_START( genpeitd )
r3115r3116
713713   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
714714   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
715715
716   PORT_START("IN2")
717   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
718   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
719   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
720   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
721   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
722   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
723   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
724   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
725
716726   PORT_START("DSWA")
717727   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
718728   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) )
r3115r3116
758768   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Flip_Screen ) )
759769   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
760770   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
761
762   PORT_START("IN4")
763   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
764   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
765   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
766   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
767   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
768   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
769   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
770   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
771771INPUT_PORTS_END
772772
773773static INPUT_PORTS_START( rthunder )
r3115r3116
791791   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
792792   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
793793
794   PORT_START("IN2")
795   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
796   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
797   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
798   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
799   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
800   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
801   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
802   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
803
794804   PORT_START("DSWA")
795805   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
796806   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) )
r3115r3116
837847   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Continues ) )
838848   PORT_DIPSETTING(    0x00, "3" )
839849   PORT_DIPSETTING(    0x01, "6" )
840
841   PORT_START("IN4")
842   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
843   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
844   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
845   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
846   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
847   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
848   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
849   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
850850INPUT_PORTS_END
851851
852852static INPUT_PORTS_START( rthundro )
r3115r3116
870870   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
871871   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
872872
873   PORT_START("IN2")
874   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
875   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
876   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
877   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
878   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
879   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
880   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
881   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
882
873883   PORT_START("DSWA")
874884   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
875885   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) )
r3115r3116
916926   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Flip_Screen ) )
917927   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
918928   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
919
920   PORT_START("IN4")
921   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
922   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
923   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
924   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
925   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
926   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
927   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
928   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
929929INPUT_PORTS_END
930930
931931static INPUT_PORTS_START( wndrmomo )
r3115r3116
949949   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
950950   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
951951
952   PORT_START("IN2")
953   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
954   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
955   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
956   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
957   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
958   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
959   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
960   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
961
952962   PORT_START("DSWA")
953963   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
954964   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) )
r3115r3116
9951005   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
9961006   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
9971007   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
998
999   PORT_START("IN4")
1000   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin lockout */
1001   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 1 */
1002   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* OUT:coin counter 2 */
1003   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1004   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
1005   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1006   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1007   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
10081008INPUT_PORTS_END
10091009
10101010
src/mame/drivers/vaportra.c
r3115r3116
3636{
3737   switch (offset<<1)
3838   {
39      case 4: /* Dip Switches */
40         return (input_port_read(machine, "DSW2") + (input_port_read(machine, "DSW1") << 8));
41      case 2: /* Credits */
39      case 4:
40         return input_port_read(machine, "DSW");
41      case 2:
4242         return input_port_read(machine, "COINS");
43      case 0: /* Player 1 & Player 2 joysticks & fire buttons */
44         return (input_port_read(machine, "P1") + (input_port_read(machine, "P2") << 8));
43      case 0:
44         return input_port_read(machine, "PLAYERS");
4545   }
4646
4747   logerror("Unknown control read at %d\n",offset);
r3115r3116
117117/******************************************************************************/
118118
119119static INPUT_PORTS_START( vaportra )
120   PORT_START("P1")   /* Player 1 controls */
121   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
122   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
123   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
124   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
125   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
126   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
127   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
128   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
120   PORT_START("PLAYERS")
121   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
122   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
123   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
124   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
125   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
126   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )
127   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
128   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
129   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
130   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
131   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
132   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
133   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
134   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
135   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
136   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
129137
130   PORT_START("P2")   /* Player 2 controls */
131   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
132   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
133   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
134   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
135   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
136   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
137   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
138   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
138   PORT_START("COINS")
139   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
140   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
141   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
142   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
143   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
144   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
145   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
146   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
139147
140   PORT_START("COINS")   /* Credits */
141   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
142   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
143   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
144   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
145   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
146   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
147   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
148   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
148   PORT_START("DSW")
149   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) )
150   PORT_DIPSETTING(      0x0000, "2" )
151   PORT_DIPSETTING(      0x0003, "3" )
152   PORT_DIPSETTING(      0x0002, "4" )
153   PORT_DIPSETTING(      0x0001, "5" )
154   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
155   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
156   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
157   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
158   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
159   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Bonus_Life ) )
160   PORT_DIPSETTING(      0x0020, "150k, 300k and 600k" )
161   PORT_DIPSETTING(      0x0030, "200k and 600k" )
162   PORT_DIPSETTING(      0x0010, "300k only" )
163   PORT_DIPSETTING(      0x0000, DEF_STR( None ) )
164   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Allow_Continue ) )
165   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
166   PORT_DIPSETTING(      0x0040, DEF_STR( Yes ) )
167     PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Demo_Sounds ) )
168   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
169   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
149170
150   PORT_START("DSW1")   /* Dip switch bank 1 */
151   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
152   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
153   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
154   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
155   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
156   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
157   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
158   PORT_DIPSETTING(    0x03, DEF_STR( 1C_5C ) )
159   PORT_DIPSETTING(    0x02, DEF_STR( 1C_6C ) )
160   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )
161   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
162   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
163   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
164   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
165   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
166   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
167   PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C ) )
168   PORT_DIPSETTING(    0x10, DEF_STR( 1C_6C ) )
169   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
170   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
171   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
172   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
173
174   PORT_START("DSW2")   /* Dip switch bank 2 */
175   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
176   PORT_DIPSETTING(    0x00, "2" )
177   PORT_DIPSETTING(    0x03, "3" )
178   PORT_DIPSETTING(    0x02, "4" )
179   PORT_DIPSETTING(    0x01, "5" )
180   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
181   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
182   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
183   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
184   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
185   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
186   PORT_DIPSETTING(    0x20, "150k, 300k and 600k" )
187   PORT_DIPSETTING(    0x30, "200k and 600k" )
188   PORT_DIPSETTING(    0x10, "300k only" )
189   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
190   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )
191   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
192   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
193     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
194   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
195   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
171   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )
172   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
173   PORT_DIPSETTING(      0x0100, DEF_STR( 2C_1C ) )
174   PORT_DIPSETTING(      0x0700, DEF_STR( 1C_1C ) )
175   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_2C ) )
176   PORT_DIPSETTING(      0x0500, DEF_STR( 1C_3C ) )
177   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
178   PORT_DIPSETTING(      0x0300, DEF_STR( 1C_5C ) )
179   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_6C ) )
180   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )
181   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
182   PORT_DIPSETTING(      0x0800, DEF_STR( 2C_1C ) )
183   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )
184   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_2C ) )
185   PORT_DIPSETTING(      0x2800, DEF_STR( 1C_3C ) )
186   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )
187   PORT_DIPSETTING(      0x1800, DEF_STR( 1C_5C ) )
188   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_6C ) )
189   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Flip_Screen ) )
190   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
191   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
192   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
196193INPUT_PORTS_END
197194
198195/******************************************************************************/
src/mame/drivers/qdrmfgp.c
r3115r3116
4444 *
4545 *************************************/
4646
47static READ16_HANDLER( i_port1_r )
47static CUSTOM_INPUT( inputs_r )
4848{
49   if (control & 0x0080)
50      return input_port_read(machine, "IN0");
51   else
52      return input_port_read(machine, "DSW");
49   const char *tag1 = param;
50   const char *tag2 = tag1 + strlen(tag1) + 1;
51   return input_port_read(field->port->machine, (control & 0x0080) ? tag1 : tag2);
5352}
5453
55static READ16_HANDLER( i_port2_r )
54static CUSTOM_INPUT( battery_sensor_r )
5655{
5756   /* bit 0-1  battery power sensor: 3=good, 2=low, other=bad */
58   return (input_port_read(machine, "SENSOR") & 0xfffc) | 0x0003;
57   return 0x0003;
5958}
6059
6160
r3115r3116
345344   AM_RANGE(0x180000, 0x183fff) AM_READ(SMH_RAM)            /* backup ram */
346345   AM_RANGE(0x280000, 0x280fff) AM_READ(SMH_RAM)            /* color ram */
347346   AM_RANGE(0x320000, 0x32001f) AM_READ(K053252_word_r)      /* ccu */
348   AM_RANGE(0x330000, 0x330001) AM_READ(i_port2_r)            /* battery power & service sw */
349   AM_RANGE(0x340000, 0x340001) AM_READ(i_port1_r)            /* inputport */
347   AM_RANGE(0x330000, 0x330001) AM_READ_PORT("SENSOR")         /* battery power & service sw */
348   AM_RANGE(0x340000, 0x340001) AM_READ_PORT("340000")         /* inputport */
350349   AM_RANGE(0x800000, 0x80045f) AM_READ(k054539_word_r)      /* sound regs */
351350   AM_RANGE(0x880000, 0x881fff) AM_READ(K056832_ram_word_r)   /* vram */
352351   AM_RANGE(0x882000, 0x883fff) AM_READ(K056832_ram_word_r)   /* vram (mirror) */
r3115r3116
382381   AM_RANGE(0x180000, 0x183fff) AM_READ(SMH_RAM)            /* backup ram */
383382   AM_RANGE(0x280000, 0x280fff) AM_READ(SMH_RAM)            /* color ram */
384383   AM_RANGE(0x320000, 0x32001f) AM_READ(K053252_word_r)      /* ccu */
385   AM_RANGE(0x330000, 0x330001) AM_READ(i_port2_r)            /* battery power & service */
386   AM_RANGE(0x340000, 0x340001) AM_READ(i_port1_r)            /* inputport */
384   AM_RANGE(0x330000, 0x330001) AM_READ_PORT("SENSOR")         /* battery power & service */
385   AM_RANGE(0x340000, 0x340001) AM_READ_PORT("340000")         /* inputport */
387386   AM_RANGE(0x800000, 0x80045f) AM_READ(k054539_word_r)      /* sound regs */
388387   AM_RANGE(0x880000, 0x881fff) AM_READ(gp2_vram_r)         /* vram */
389388   AM_RANGE(0x89f000, 0x8a0fff) AM_READ(gp2_vram_mirror_r)      /* vram (mirror) */
r3115r3116
420419 *************************************/
421420
422421static INPUT_PORTS_START( qdrmfgp )
423   PORT_START("IN0")
422   PORT_START("340000")
423   PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(inputs_r, "INPUTS\0DSW")
424
425   PORT_START("INPUTS")
424426   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
425427   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
426428   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)   /* 1P STOP */
r3115r3116
493495   PORT_DIPSETTING(      0x0000, DEF_STR( Very_Hard ) )
494496
495497   PORT_START("SENSOR")
496   PORT_BIT( 0x0003, IP_ACTIVE_LOW, IPT_SPECIAL )      /* battery power sensor */
498   PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(battery_sensor_r, NULL)   /* battery power sensor */
497499   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE2 )
498500   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE3 )
499501   PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNUSED )
500502INPUT_PORTS_END
501503
502504static INPUT_PORTS_START( qdrmfgp2 )
503   PORT_START("IN0")
505   PORT_START("340000")
506   PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(inputs_r, "INPUTS\0DSW")
507
508   PORT_START("INPUTS")
504509   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
505510   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
506511   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)   /* 1P STOP */
r3115r3116
573578   PORT_DIPSETTING(      0x0000, DEF_STR( Very_Hard ) )
574579
575580   PORT_START("SENSOR")
576   PORT_BIT( 0x0003, IP_ACTIVE_LOW, IPT_SPECIAL )      /* battery power sensor */
581   PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(battery_sensor_r, NULL)   /* battery power sensor */
577582   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE2 )
578583   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE3 )
579584   PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/cps1.c
r3115r3116
746746   PORT_DIPSETTING(    0x01, "7" ) \
747747   PORT_DIPSETTING(    0x00, "8 (Hardest)" )
748748
749
750static INPUT_PORTS_START( forgottn )
749/* CPS1 games with 2 players and 3 buttons each */
750static INPUT_PORTS_START( cps1_3b )
751751   PORT_START("IN0")
752752   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
753753   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
r3115r3116
755755   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
756756   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
757757   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
758   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
758   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
759759   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
760760
761   PORT_START("DSWC")                        // The manual only mentions two DIP switch banks.
761   PORT_START("IN1")
762   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
763   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
764   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
765   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
766   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
767   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
768   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
769   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
770   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
771   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
772   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
773   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
774   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
775   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
776   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
777   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
778INPUT_PORTS_END
779
780/* CPS1 games with 2 players and 2 buttons each */
781static INPUT_PORTS_START( cps1_2b )
782   PORT_INCLUDE( cps1_3b )
783
784   PORT_MODIFY("IN1")
785   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )   // no button 3
786   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // no button 3
787INPUT_PORTS_END
788
789/* CPS1 games with 2 players and 1 button each */
790static INPUT_PORTS_START( cps1_1b )
791   PORT_INCLUDE( cps1_2b )
792
793   PORT_MODIFY("IN1")
794   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )   // no button 2
795   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // no button 2
796INPUT_PORTS_END
797
798/* CPS1 games with 3 players and 2 buttons each */
799static INPUT_PORTS_START( cps1_3players )
800   PORT_INCLUDE( cps1_2b )
801
802   PORT_START("IN2")      /* Player 3 */
803   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
804   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
805   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
806   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
807   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
808   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
809   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
810   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
811INPUT_PORTS_END
812
813/* CPS1 games with 4 players and 2 buttons each */
814static INPUT_PORTS_START( cps1_4players )
815   PORT_INCLUDE( cps1_3players )
816
817   PORT_START("IN3")      /* Player 4 */
818   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
819   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
820   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
821   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
822   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
823   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
824   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN4 )
825   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
826INPUT_PORTS_END
827
828/* CPS1 quiz games */
829static INPUT_PORTS_START( cps1_quiz )
830   PORT_INCLUDE( cps1_3b )
831
832   PORT_MODIFY("IN1")   /* no joystick and 4th button */
833   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
834   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
835   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
836   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
837   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
838   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
839   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
840   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
841   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
842   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
843INPUT_PORTS_END
844
845
846static INPUT_PORTS_START( forgottn )
847   PORT_INCLUDE( cps1_1b )
848
849   PORT_MODIFY("IN0")
850   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
851
852   PORT_START("DSWC")                           // The manual only mentions two DIP switch banks.
762853   PORT_DIPUNUSED( 0x80, 0x80 )                  // Is this port brought out to DIP switches or not?
763854   PORT_DIPUNKNOWN( 0x40, 0x40 )                  // Check code at 0x013c78 (0x013690 in 'lostwrld')
764855   PORT_DIPUNUSED( 0x20, 0x20 )
r3115r3116
787878   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
788879   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
789880
790   PORT_START("IN1")
791   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
792   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
793   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
794   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
795   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
796   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
797   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
798   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
799   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
800   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
801   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
802   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
803   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
804   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
805   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
806   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
807
808881   PORT_START("DIAL0")
809882   PORT_BIT( 0x0fff, 0x0000, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_PLAYER(1)
810883
r3115r3116
813886INPUT_PORTS_END
814887
815888static INPUT_PORTS_START( ghouls )
816   PORT_START("IN0")
817   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
818   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
819   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )  /* Service, but it doesn't give any credit */
820   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
821   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
822   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
823   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
824   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
889   PORT_INCLUDE( cps1_2b )
890   /* Service1 doesn't give any credit */
825891
826892   PORT_START("DSWC")
827893   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )         PORT_DIPLOCATION("SW(C):1,2")
r3115r3116
862928   PORT_DIPSETTING(    0x80, "Upright 2 Players" )
863929//  PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )         // Manual says these are both valid settings
864930   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )         // for 2-player cocktail cabinet
865
866   PORT_START("IN1")
867   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
868   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
869   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
870   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
871   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
872   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
873   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
874   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
875   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
876   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
877   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
878   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
879   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
880   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
881   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
882   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
883931INPUT_PORTS_END
884932
885933/* Same as 'ghouls' but additional "Freeze" Dip Switch, different "Lives" Dip Switch,
886934   and LOTS of "debug" features (read the notes to know how to activate them) */
887935static INPUT_PORTS_START( ghoulsu )
888   PORT_START("IN0")
889   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
890   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
891   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )  /* Service, but it doesn't give any credit */
892   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
893   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
894   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
895   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
896   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
936   PORT_INCLUDE( ghouls )
897937
898   PORT_START("DSWC")
899   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )            PORT_DIPLOCATION("SW(C):1,2")
938   PORT_MODIFY("DSWC")
939   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW(C):1,2")
900940   PORT_DIPSETTING(    0x00, "2" )
901941   PORT_DIPSETTING(    0x03, "3" )
902942   PORT_DIPSETTING(    0x02, "4" )
903943   PORT_DIPSETTING(    0x01, "5" )
904   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW(C):3" )
905   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW(C):4" )
906   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) )         PORT_DIPLOCATION("SW(C):5")
907   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
908   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
909   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )            PORT_DIPLOCATION("SW(C):6")
910   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )               // "Demo Sounds" in manual; doesn't work
911   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
912   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )      PORT_DIPLOCATION("SW(C):7")
913   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
914   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
915   PORT_DIPNAME( 0x80, 0x80, "Game Mode" )                  PORT_DIPLOCATION("SW(C):8")
916   PORT_DIPSETTING(    0x80, "Game" )
917   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
918944
919   PORT_START("DSWB")
945   PORT_MODIFY("DSWB")
920946   /* Standard Dip Switches */
921   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )           PORT_DIPLOCATION("SW(B):1,2,3")
922                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
923   PORT_DIPSETTING(    0x04, "1 (Easiest)" )                   PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
924   PORT_DIPSETTING(    0x05, "2" )                             PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
925   PORT_DIPSETTING(    0x06, "3" )                             PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
926   PORT_DIPSETTING(    0x07, "4 (Normal)" )                    PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
927   PORT_DIPSETTING(    0x03, "5" )                             PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
928   PORT_DIPSETTING(    0x02, "6" )                             PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
929   PORT_DIPSETTING(    0x01, "7" )                             PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
930   PORT_DIPSETTING(    0x00, "8 (Hardest)" )                   PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
931   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )            PORT_DIPLOCATION("SW(B):4")
932                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
933   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
934   PORT_DIPSETTING(    0x00, DEF_STR( On ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
935   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )           PORT_DIPLOCATION("SW(B):5,6")
936                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
937   PORT_DIPSETTING(    0x20, "10K, 30K and every 30K" )        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
938   PORT_DIPSETTING(    0x10, "20K, 50K and every 70K" )        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
939   PORT_DIPSETTING(    0x30, "30K, 60K and every 70K" )        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
940   PORT_DIPSETTING(    0x00, "40K, 70K and every 80K" )        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
947   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):1,2,3")
948   PORT_DIPSETTING(    0x04, "1 (Easiest)" )
949   PORT_DIPSETTING(    0x05, "2" )
950   PORT_DIPSETTING(    0x06, "3" )
951   PORT_DIPSETTING(    0x07, "4 (Normal)" )
952   PORT_DIPSETTING(    0x03, "5" )
953   PORT_DIPSETTING(    0x02, "6" )
954   PORT_DIPSETTING(    0x01, "7" )
955   PORT_DIPSETTING(    0x00, "8 (Hardest)" )
956   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):4")
957   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
958   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
959   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )  PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):5,6")
960   PORT_DIPSETTING(    0x20, "10K, 30K and every 30K" )
961   PORT_DIPSETTING(    0x10, "20K, 50K and every 70K" )
962   PORT_DIPSETTING(    0x30, "30K, 60K and every 70K" )
963   PORT_DIPSETTING(    0x00, "40K, 70K and every 80K" )
941964   /* Debug Dip Switches */
942   PORT_DIPNAME( 0x07, 0x07, "Starting Weapon" )               PORT_DIPLOCATION("SW(B):1,2,3")
943                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
944   PORT_DIPSETTING(    0x07, "Spear" )                         PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
945   PORT_DIPSETTING(    0x06, "Knife" )                         PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
946   PORT_DIPSETTING(    0x05, "Torch" )                         PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
947   PORT_DIPSETTING(    0x04, "Sword" )                         PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
948   PORT_DIPSETTING(    0x03, "Axe" )                           PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
949   PORT_DIPSETTING(    0x02, "Shield" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
950   PORT_DIPSETTING(    0x01, "Super Weapon" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
951//  PORT_DIPSETTING(    0x00, "INVALID !" )                     PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
952   PORT_DIPNAME( 0x38, 0x30, "Armor on New Life" )             PORT_DIPLOCATION("SW(B):4,5,6")
953                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
954//  PORT_DIPSETTING(    0x38, "Silver Armor" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
955   PORT_DIPSETTING(    0x18, "Golden Armor" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
956   PORT_DIPSETTING(    0x30, "Silver Armor" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
957   PORT_DIPSETTING(    0x28, "None (young man)" )              PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
958   PORT_DIPSETTING(    0x20, "None (old man)" )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
959//  PORT_DIPSETTING(    0x10, "INVALID !" )                     PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
960//  PORT_DIPSETTING(    0x08, "INVALID !" )                     PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
961//  PORT_DIPSETTING(    0x00, "INVALID !" )                     PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
965   PORT_DIPNAME( 0x07, 0x07, "Starting Weapon" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):1,2,3")
966   PORT_DIPSETTING(    0x07, "Spear" )
967   PORT_DIPSETTING(    0x06, "Knife" )
968   PORT_DIPSETTING(    0x05, "Torch" )
969   PORT_DIPSETTING(    0x04, "Sword" )
970   PORT_DIPSETTING(    0x03, "Axe" )
971   PORT_DIPSETTING(    0x02, "Shield" )
972   PORT_DIPSETTING(    0x01, "Super Weapon" )
973//  PORT_DIPSETTING(    0x00, "INVALID !" )
974   PORT_DIPNAME( 0x38, 0x30, "Armor on New Life" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):4,5,6")
975//  PORT_DIPSETTING(    0x38, "Silver Armor" )
976   PORT_DIPSETTING(    0x18, "Golden Armor" )
977   PORT_DIPSETTING(    0x30, "Silver Armor" )
978   PORT_DIPSETTING(    0x28, "None (young man)" )
979   PORT_DIPSETTING(    0x20, "None (old man)" )
980//  PORT_DIPSETTING(    0x10, "INVALID !" )
981//  PORT_DIPSETTING(    0x08, "INVALID !" )
982//  PORT_DIPSETTING(    0x00, "INVALID !" )
962983
963984   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW(B):7" )
964   PORT_DIPNAME( 0x80, 0x80, "Freeze" )                  PORT_DIPLOCATION("SW(B):8")
985   PORT_DIPNAME( 0x80, 0x80, "Freeze" ) PORT_DIPLOCATION("SW(B):8")
965986   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
966987   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
967988
968   PORT_START("DSWA")
989   PORT_MODIFY("DSWA")
969990   /* Standard Dip Switches */
970   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )            PORT_DIPLOCATION("SW(A):1,2,3")
971                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
972   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
973   PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
974   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
975   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
976   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
977   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
978   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
979   PORT_DIPSETTING(    0x03, DEF_STR( 1C_6C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
980   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )            PORT_DIPLOCATION("SW(A):4,5,6")
981                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
982   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
983   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
984   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
985   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
986   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
987   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
988   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
989   PORT_DIPSETTING(    0x18, DEF_STR( 1C_6C ) )                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
991   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):1,2,3")
992   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
993   PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
994   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
995   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
996   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
997   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
998   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
999   PORT_DIPSETTING(    0x03, DEF_STR( 1C_6C ) )
1000   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):4,5,6")
1001   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
1002   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
1003   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
1004   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
1005   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
1006   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
1007   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
1008   PORT_DIPSETTING(    0x18, DEF_STR( 1C_6C ) )
9901009   /* Debug Dip Switches */
991   PORT_DIPNAME( 0x0f, 0x0f, "Starting Level" )                PORT_DIPLOCATION("SW(A):1,2,3,4")
992                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
993   PORT_DIPSETTING(    0x0f, "Level 1 (1st half)" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
994   PORT_DIPSETTING(    0x0e, "Level 1 (2nd half)" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
995   PORT_DIPSETTING(    0x0d, "Level 2 (1st half)" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
996   PORT_DIPSETTING(    0x0c, "Level 2 (2nd half)" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
997   PORT_DIPSETTING(    0x0b, "Level 3 (1st half)" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
998   PORT_DIPSETTING(    0x0a, "Level 3 (2nd half)" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
999   PORT_DIPSETTING(    0x09, "Level 4 (1st half)" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1000   PORT_DIPSETTING(    0x08, "Level 4 (2nd half)" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1001   PORT_DIPSETTING(    0x07, "Level 5 (1st half)" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1002   PORT_DIPSETTING(    0x06, "Level 5 (2nd half)" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1003   PORT_DIPSETTING(    0x05, "Level 6" )                       PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1004//  PORT_DIPSETTING(    0x04, "INVALID !" )                     PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1005//  PORT_DIPSETTING(    0x03, "INVALID !" )                     PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1006//  PORT_DIPSETTING(    0x02, "INVALID !" )                     PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1007//  PORT_DIPSETTING(    0x01, "INVALID !" )                     PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1008//  PORT_DIPSETTING(    0x00, "INVALID !" )                     PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1009   PORT_DIPNAME( 0x10, 0x10, "Invulnerability" )               PORT_DIPLOCATION("SW(A):5")
1010                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1011   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1012   PORT_DIPSETTING(    0x00, DEF_STR( On ) )                   PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1013   PORT_DIPNAME( 0x20, 0x20, "Slow Motion" )                   PORT_DIPLOCATION("SW(A):6")
1014                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1015   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1016   PORT_DIPSETTING(    0x00, DEF_STR( On ) )                   PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1010   PORT_DIPNAME( 0x0f, 0x0f, "Starting Level" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):1,2,3,4")
1011   PORT_DIPSETTING(    0x0f, "Level 1 (1st half)" )
1012   PORT_DIPSETTING(    0x0e, "Level 1 (2nd half)" )
1013   PORT_DIPSETTING(    0x0d, "Level 2 (1st half)" )
1014   PORT_DIPSETTING(    0x0c, "Level 2 (2nd half)" )
1015   PORT_DIPSETTING(    0x0b, "Level 3 (1st half)" )
1016   PORT_DIPSETTING(    0x0a, "Level 3 (2nd half)" )
1017   PORT_DIPSETTING(    0x09, "Level 4 (1st half)" )
1018   PORT_DIPSETTING(    0x08, "Level 4 (2nd half)" )
1019   PORT_DIPSETTING(    0x07, "Level 5 (1st half)" )
1020   PORT_DIPSETTING(    0x06, "Level 5 (2nd half)" )
1021   PORT_DIPSETTING(    0x05, "Level 6" )
1022//  PORT_DIPSETTING(    0x04, "INVALID !" )
1023//  PORT_DIPSETTING(    0x03, "INVALID !" )
1024//  PORT_DIPSETTING(    0x02, "INVALID !" )
1025//  PORT_DIPSETTING(    0x01, "INVALID !" )
1026//  PORT_DIPSETTING(    0x00, "INVALID !" )
1027   PORT_DIPNAME( 0x10, 0x10, "Invulnerability" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):5")
1028   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1029   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1030   PORT_DIPNAME( 0x20, 0x20, "Slow Motion" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):6")
1031   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1032   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10171033
1018   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Cabinet ) )            PORT_DIPLOCATION("SW(A):7,8")
1034   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW(A):7,8")
10191035   PORT_DIPSETTING(    0xc0, "Upright 1 Player" )
10201036   PORT_DIPSETTING(    0x80, "Upright 2 Players" )
10211037//  PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )             // Manual says these are both valid settings
10221038   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )            // for 2-player cocktail cabinet
1023
1024   PORT_START("IN1")
1025   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1026   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1027   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1028   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1029   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1030   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1031   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1032   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1033   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1034   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1035   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1036   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1037   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1038   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1039   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1040   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
10411039INPUT_PORTS_END
10421040
10431041/* Same as 'ghouls' but additional "Freeze" Dip Switch */
r3115r3116
10521050
10531051/* "Debug" features to be implemented */
10541052static INPUT_PORTS_START( strider )
1055   PORT_START("IN0")
1056   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1057   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1058   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1059   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1060   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1061   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1062   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
1063   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1053   PORT_INCLUDE( cps1_3b )
10641054
10651055   PORT_START("DSWA")
10661056   CPS1_COINAGE_1( "SW(A)" )
r3115r3116
11131103   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                  PORT_DIPLOCATION("SW(C):8")
11141104   PORT_DIPSETTING(    0x80, "Game" )
11151105   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )               // To enable the "debug" features
1116
1117   PORT_START("IN1")
1118   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1119   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1120   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1121   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1122   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1123   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1124   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1125   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1126   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1127   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1128   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1129   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1130   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1131   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1132   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1133   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
11341106INPUT_PORTS_END
11351107
11361108/* Same as 'strider' but additional "2 Coins to Start, 1 to Continue" Dip Switch */
11371109/* "Debug" features to be implemented */
11381110static INPUT_PORTS_START( stridrua )
1139   PORT_START("IN0")
1140   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1141   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1142   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1143   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1144   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1145   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1146   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
1147   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1111   PORT_INCLUDE( strider )
11481112
1149   PORT_START("DSWA")
1150   CPS1_COINAGE_1( "SW(A)" )
1151   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Cabinet ) )               PORT_DIPLOCATION("SW(A):7,8")
1152   PORT_DIPSETTING(    0xc0, "Upright 1 Player" )               // These switches are not documented in the
1153   PORT_DIPSETTING(    0x80, "Upright 2 Players" )               // manual
1154//  PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
1155   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1156
1157   PORT_START("DSWB")
1158   CPS1_DIFFICULTY_2( "SW(B)" )
1113   PORT_MODIFY("DSWB")
11591114   /* In 'striderj', bit 3 is stored at 0xff8e77 ($e77,A5) via code at 0x000a2a,
11601115       but this address is never checked again.
11611116       In 'strider' and 'stridrja', this code even doesn't exist ! */
11621117   PORT_DIPNAME( 0x08, 0x08, "2 Coins to Start, 1 to Continue" )   PORT_DIPLOCATION("SW(B):4")
11631118   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )                  // This works in this revision
11641119   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1165   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )            PORT_DIPLOCATION("SW(B):5,6")
1166   PORT_DIPSETTING(    0x30, "20K, 40K then every 60K" )
1167   PORT_DIPSETTING(    0x20, "30K, 50K then every 70K" )
1168   PORT_DIPSETTING(    0x10, "20K & 60K only" )
1169   PORT_DIPSETTING(    0x00, "30K & 60K only" )
1170   PORT_DIPNAME( 0xc0, 0x80, "Internal Diff. on Life Loss" )      PORT_DIPLOCATION("SW(B):7,8")
1171   PORT_DIPSETTING(    0xc0, "-3" )                        // Check code at 0x00d15a
1172//  PORT_DIPSETTING(    0x40, "-1" )                                // These switches are not documented in the
1173   PORT_DIPSETTING(    0x00, "-1" )                        // manual
1174   PORT_DIPSETTING(    0x80, "Default" )
1175
1176   PORT_START("DSWC")
1177   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )               PORT_DIPLOCATION("SW(C):1,2")
1178   PORT_DIPSETTING(    0x00, "2" )                           // "6" in the "test mode" and manual
1179   PORT_DIPSETTING(    0x03, "3" )
1180   PORT_DIPSETTING(    0x02, "4" )
1181   PORT_DIPSETTING(    0x01, "5" )
1182   PORT_DIPNAME( 0x04, 0x04, "Freeze" )                     PORT_DIPLOCATION("SW(C):3")
1183   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1184   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1185   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Free_Play ) )            PORT_DIPLOCATION("SW(C):4")
1186   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1187   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1188   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) )            PORT_DIPLOCATION("SW(C):5")
1189   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1190   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1191   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )            PORT_DIPLOCATION("SW(C):6")
1192   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1193   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1194   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )         PORT_DIPLOCATION("SW(C):7")
1195   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1196   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
1197   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                     PORT_DIPLOCATION("SW(C):8")
1198   PORT_DIPSETTING(    0x80, "Game" )
1199   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )                  // To enable the "debug" features
1200
1201   PORT_START("IN1")
1202   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1203   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1204   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1205   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1206   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1207   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1208   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1209   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1210   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1211   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1212   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1213   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1214   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1215   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1216   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1217   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
12181120INPUT_PORTS_END
12191121
12201122static INPUT_PORTS_START( dynwar )
1221   PORT_START("IN0")
1222   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1223   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1224   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1225   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1226   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1227   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1228   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
1229   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1123   PORT_INCLUDE( cps1_3b )
12301124
12311125   PORT_START("DSWC")
12321126   PORT_DIPNAME( 0x01, 0x01, "Freeze" )                  PORT_DIPLOCATION("SW(C):1")
r3115r3116
12661160   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) )         PORT_DIPLOCATION("SW(A):8")
12671161   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )               // This switch is not documented in the manual
12681162   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1269
1270   PORT_START("IN1")
1271   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1272   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1273   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1274   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1275   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1276   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1277   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1278   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1279   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1280   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1281   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1282   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1283   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1284   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1285   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1286   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
12871163INPUT_PORTS_END
12881164
12891165/* Read the notes to know how to activate the "debug" features */
12901166static INPUT_PORTS_START( willow )
1291   PORT_START("IN0")
1292   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1293   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1294   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1295   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1296   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1297   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1167   PORT_INCLUDE( cps1_3b )
1168
1169   PORT_MODIFY("IN0")
12981170   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
1299   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
13001171
13011172   PORT_START("DSWC")
13021173   /* Standard Dip Switches */
1303   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )            PORT_DIPLOCATION("SW(C):1,2")
1304                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1305   PORT_DIPSETTING(    0x02, "1" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1306   PORT_DIPSETTING(    0x03, "2" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1307   PORT_DIPSETTING(    0x01, "3" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1308   PORT_DIPSETTING(    0x00, "4" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1309   PORT_DIPNAME( 0x0c, 0x0c, "Vitality" )                  PORT_DIPLOCATION("SW(C):3,4")
1310                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1311   PORT_DIPSETTING(    0x00, "2" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1312   PORT_DIPSETTING(    0x0c, "3" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1313   PORT_DIPSETTING(    0x08, "4" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1314   PORT_DIPSETTING(    0x04, "5" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1174   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(C):1,2")
1175   PORT_DIPSETTING(    0x02, "1" )
1176   PORT_DIPSETTING(    0x03, "2" )
1177   PORT_DIPSETTING(    0x01, "3" )
1178   PORT_DIPSETTING(    0x00, "4" )
1179   PORT_DIPNAME( 0x0c, 0x0c, "Vitality" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(C):3,4")
1180   PORT_DIPSETTING(    0x00, "2" )
1181   PORT_DIPSETTING(    0x0c, "3" )
1182   PORT_DIPSETTING(    0x08, "4" )
1183   PORT_DIPSETTING(    0x04, "5" )
13151184   /* Debug Dip Switches */
1316   PORT_DIPNAME( 0x01, 0x01, "Turbo Mode" )               PORT_DIPLOCATION("SW(C):1")
1317                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1318   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1319   PORT_DIPSETTING(    0x00, DEF_STR( On ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1320   PORT_DIPNAME( 0x02, 0x02, "Freeze" )                  PORT_DIPLOCATION("SW(C):2")
1321                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1322   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1323   PORT_DIPSETTING(    0x00, DEF_STR( On ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1324   PORT_DIPNAME( 0x04, 0x04, "Slow Motion" )               PORT_DIPLOCATION("SW(C):3")
1325                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1326   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1327   PORT_DIPSETTING(    0x00, DEF_STR( On ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1328   PORT_DIPNAME( 0x08, 0x08, "Invulnerability" )            PORT_DIPLOCATION("SW(C):4")
1329                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1330   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1331   PORT_DIPSETTING(    0x00, DEF_STR( On ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1185   PORT_DIPNAME( 0x01, 0x01, "Turbo Mode" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):1")
1186   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1187   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1188   PORT_DIPNAME( 0x02, 0x02, "Freeze" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):2")
1189   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1190   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1191   PORT_DIPNAME( 0x04, 0x04, "Slow Motion" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):3")
1192   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1193   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1194   PORT_DIPNAME( 0x08, 0x08, "Invulnerability" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):4")
1195   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1196   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13321197
13331198   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) )         PORT_DIPLOCATION("SW(C):5")
13341199   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
13351200   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13361201
13371202   /* Standard Dip Switches */
1338   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )         PORT_DIPLOCATION("SW(C):6")
1339                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1340   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1341   PORT_DIPSETTING(    0x20, DEF_STR( On ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1203   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(C):6")
1204   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1205   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
13421206   /* Debug Dip Switches */
1343   PORT_DIPNAME( 0x20, 0x20, "Display Debug Infos" )         PORT_DIPLOCATION("SW(C):6")
1344                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1345   PORT_DIPSETTING(    0x20, DEF_STR( No ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1346   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1207   PORT_DIPNAME( 0x20, 0x20, "Display Debug Infos" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(C):6")
1208   PORT_DIPSETTING(    0x20, DEF_STR( No ) )
1209   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
13471210
13481211   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )      PORT_DIPLOCATION("SW(C):7")
13491212   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
r3115r3116
13541217
13551218   PORT_START("DSWB")
13561219   /* Standard Dip Switches */
1357   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )         PORT_DIPLOCATION("SW(B):1,2,3")
1358                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1359   PORT_DIPSETTING(    0x04, "1 (Easiest)" )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1360   PORT_DIPSETTING(    0x05, "2" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1361   PORT_DIPSETTING(    0x06, "3" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1362   PORT_DIPSETTING(    0x07, "4 (Normal)" )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1363   PORT_DIPSETTING(    0x03, "5" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1364   PORT_DIPSETTING(    0x02, "6" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1365   PORT_DIPSETTING(    0x01, "7" )                        PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1366   PORT_DIPSETTING(    0x00, "8 (Hardest)" )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1367   PORT_DIPNAME( 0x18, 0x18, "Nando Speed" )               PORT_DIPLOCATION("SW(B):4,5")
1368                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1369   PORT_DIPSETTING(    0x10, "Slow" )                     PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1370   PORT_DIPSETTING(    0x18, DEF_STR( Normal ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1371   PORT_DIPSETTING(    0x08, "Fast" )                     PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1372   PORT_DIPSETTING(    0x00, "Very Fast" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1373   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )            PORT_DIPLOCATION("SW(B):6")
1374                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1375   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1376   PORT_DIPSETTING(    0x00, DEF_STR( On ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1377   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )            PORT_DIPLOCATION("SW(B):7")
1378                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1379   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1380   PORT_DIPSETTING(    0x00, DEF_STR( On ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1381   PORT_DIPNAME( 0x80, 0x80, "Stage Magic Continue" )         PORT_DIPLOCATION("SW(B):8")
1382                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1383   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1384   PORT_DIPSETTING(    0x00, DEF_STR( On ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1220   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):1,2,3")
1221   PORT_DIPSETTING(    0x04, "1 (Easiest)" )
1222   PORT_DIPSETTING(    0x05, "2" )
1223   PORT_DIPSETTING(    0x06, "3" )
1224   PORT_DIPSETTING(    0x07, "4 (Normal)" )
1225   PORT_DIPSETTING(    0x03, "5" )
1226   PORT_DIPSETTING(    0x02, "6" )
1227   PORT_DIPSETTING(    0x01, "7" )
1228   PORT_DIPSETTING(    0x00, "8 (Hardest)" )
1229   PORT_DIPNAME( 0x18, 0x18, "Nando Speed" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):4,5")
1230   PORT_DIPSETTING(    0x10, "Slow" )
1231   PORT_DIPSETTING(    0x18, DEF_STR( Normal ) )
1232   PORT_DIPSETTING(    0x08, "Fast" )
1233   PORT_DIPSETTING(    0x00, "Very Fast" )
1234   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):6")
1235   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1236   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1237   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):7")
1238   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1239   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1240   PORT_DIPNAME( 0x80, 0x80, "Stage Magic Continue" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(B):8")
1241   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1242   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13851243   /* Debug Dip Switches */
1386   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )            PORT_DIPLOCATION("SW(B):1")
1387                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1388   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1389   PORT_DIPSETTING(    0x00, DEF_STR( On ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1390   PORT_DIPNAME( 0x1e, 0x1e, "Slow Motion Delay" )            PORT_DIPLOCATION("SW(B):2,3,4,5")
1391                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1392   PORT_DIPSETTING(    0x1e, "2 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1393   PORT_DIPSETTING(    0x1c, "3 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1394   PORT_DIPSETTING(    0x1a, "4 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1395   PORT_DIPSETTING(    0x18, "5 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1396   PORT_DIPSETTING(    0x16, "6 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1397   PORT_DIPSETTING(    0x14, "7 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1398   PORT_DIPSETTING(    0x12, "8 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1399   PORT_DIPSETTING(    0x10, "9 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1400   PORT_DIPSETTING(    0x0e, "10 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1401   PORT_DIPSETTING(    0x0c, "11 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1402   PORT_DIPSETTING(    0x0a, "12 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1403   PORT_DIPSETTING(    0x08, "13 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1404   PORT_DIPSETTING(    0x06, "14 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1405   PORT_DIPSETTING(    0x04, "15 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1406   PORT_DIPSETTING(    0x02, "16 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1407   PORT_DIPSETTING(    0x00, "17 Frames" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1408   PORT_DIPNAME( 0xe0, 0xe0, "Starting Level" )            PORT_DIPLOCATION("SW(B):6,7,8")
1409                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1410   PORT_DIPSETTING(    0xe0, "Level 1" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1411   PORT_DIPSETTING(    0xc0, "Level 2" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1412   PORT_DIPSETTING(    0xa0, "Level 3" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1413   PORT_DIPSETTING(    0x80, "Level 4" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1414   PORT_DIPSETTING(    0x60, "Level 5" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1415   PORT_DIPSETTING(    0x40, "Level 6" )                  PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1416//  PORT_DIPSETTING(    0x20, "INVALID !" )                     PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1417//  PORT_DIPSETTING(    0x00, "INVALID !" )                     PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1244   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):1")
1245   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1246   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1247   PORT_DIPNAME( 0x1e, 0x1e, "Slow Motion Delay" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):2,3,4,5")
1248   PORT_DIPSETTING(    0x1e, "2 Frames" )
1249   PORT_DIPSETTING(    0x1c, "3 Frames" )
1250   PORT_DIPSETTING(    0x1a, "4 Frames" )
1251   PORT_DIPSETTING(    0x18, "5 Frames" )
1252   PORT_DIPSETTING(    0x16, "6 Frames" )
1253   PORT_DIPSETTING(    0x14, "7 Frames" )
1254   PORT_DIPSETTING(    0x12, "8 Frames" )
1255   PORT_DIPSETTING(    0x10, "9 Frames" )
1256   PORT_DIPSETTING(    0x0e, "10 Frames" )
1257   PORT_DIPSETTING(    0x0c, "11 Frames" )
1258   PORT_DIPSETTING(    0x0a, "12 Frames" )
1259   PORT_DIPSETTING(    0x08, "13 Frames" )
1260   PORT_DIPSETTING(    0x06, "14 Frames" )
1261   PORT_DIPSETTING(    0x04, "15 Frames" )
1262   PORT_DIPSETTING(    0x02, "16 Frames" )
1263   PORT_DIPSETTING(    0x00, "17 Frames" )
1264   PORT_DIPNAME( 0xe0, 0xe0, "Starting Level" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(B):6,7,8")
1265   PORT_DIPSETTING(    0xe0, "Level 1" )
1266   PORT_DIPSETTING(    0xc0, "Level 2" )
1267   PORT_DIPSETTING(    0xa0, "Level 3" )
1268   PORT_DIPSETTING(    0x80, "Level 4" )
1269   PORT_DIPSETTING(    0x60, "Level 5" )
1270   PORT_DIPSETTING(    0x40, "Level 6" )
1271//  PORT_DIPSETTING(    0x20, "INVALID !" )
1272//  PORT_DIPSETTING(    0x00, "INVALID !" )
14181273
14191274   PORT_START("DSWA")
14201275   /* Standard Dip Switches */
1421   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )            PORT_DIPLOCATION("SW(A):1,2,3")
1422                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1423   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1424   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1425   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1426   PORT_DIPSETTING(    0x00, "2 Coins/1 Credit (1 to continue)" )   PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1427   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1428   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1429   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1430   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1431   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )            PORT_DIPLOCATION("SW(A):4,5,6")
1432                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1433   PORT_DIPSETTING(    0x08, DEF_STR( 4C_1C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1434   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1435   PORT_DIPSETTING(    0x18, DEF_STR( 2C_1C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1436   PORT_DIPSETTING(    0x00, "2 Coins/1 Credit (1 to continue)" )   PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1437   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1438   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1439   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1440   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1441   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Cabinet ) )            PORT_DIPLOCATION("SW(A):7,8")
1442                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1443   PORT_DIPSETTING(    0xc0, "Upright 1 Player" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1444   PORT_DIPSETTING(    0x80, "Upright 2 Players" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1445//  PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )             PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1446   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x80)
1276   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):1,2,3")
1277   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
1278   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
1279   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
1280   PORT_DIPSETTING(    0x00, "2 Coins/1 Credit (1 to continue)" )
1281   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
1282   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
1283   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
1284   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
1285   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):4,5,6")
1286   PORT_DIPSETTING(    0x08, DEF_STR( 4C_1C ) )
1287   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
1288   PORT_DIPSETTING(    0x18, DEF_STR( 2C_1C ) )
1289   PORT_DIPSETTING(    0x00, "2 Coins/1 Credit (1 to continue)" )
1290   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
1291   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
1292   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
1293   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
1294   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Cabinet ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x80) PORT_DIPLOCATION("SW(A):7,8")
1295   PORT_DIPSETTING(    0xc0, "Upright 1 Player" )
1296   PORT_DIPSETTING(    0x80, "Upright 2 Players" )
1297//  PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
1298   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
14471299   /* Debug Dip Switches */
1448   PORT_DIPNAME( 0x3f, 0x3f, DEF_STR( Free_Play ) )         PORT_DIPLOCATION("SW(A):1,2,3,4,5,6")
1449                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1450   PORT_DIPSETTING(    0x3f, DEF_STR( Off ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1451   PORT_DIPSETTING(    0x38, DEF_STR( On ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1300   PORT_DIPNAME( 0x3f, 0x3f, DEF_STR( Free_Play ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):1,2,3,4,5,6")
1301   PORT_DIPSETTING(    0x3f, DEF_STR( Off ) )
1302   PORT_DIPSETTING(    0x38, DEF_STR( On ) )
14521303   /* Other values don't give free play */
1453   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )            PORT_DIPLOCATION("SW(A):7")
1454                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1455   PORT_DIPSETTING(    0x40, "Upright 1 Player" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1456   PORT_DIPSETTING(    0x00, "Upright 2 Players" )            PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1457   PORT_DIPNAME( 0x80, 0x80, "Maximum magic/sword power" )      PORT_DIPLOCATION("SW(A):8")
1458                                                PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1459   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1460   PORT_DIPSETTING(    0x00, DEF_STR( On ) )               PORT_CONDITION("DSWC",0x80,PORTCOND_EQUALS,0x00)
1461
1462   PORT_START("IN1")
1463   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1464   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1465   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1466   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1467   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1468   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1469   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* BUTTON3 in the "Input" test screen */
1470   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1471   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1472   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1473   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1474   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1475   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1476   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1477   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* BUTTON3 in the "Input" test screen */
1478   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1304   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):7")
1305   PORT_DIPSETTING(    0x40, "Upright 1 Player" )
1306   PORT_DIPSETTING(    0x00, "Upright 2 Players" )
1307   PORT_DIPNAME( 0x80, 0x80, "Maximum magic/sword power" ) PORT_CONDITION("DSWC", 0x80, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):8")
1308   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1309   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14791310INPUT_PORTS_END
14801311
14811312/* To enable extra choices in the "test mode", you must press "Coin 1" ('5') AND "Service Mode" ('F2') */
14821313static INPUT_PORTS_START( unsquad )
1483   PORT_START("IN0")
1484   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1485   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1486   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1487   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1488   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1489   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1314   PORT_INCLUDE( cps1_3b )
1315
1316   PORT_MODIFY("IN0")
14901317   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
1491   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
14921318
14931319   PORT_START("DSWA")
14941320   CPS1_COINAGE_3( "SW(A)" )
r3115r3116
15291355   PORT_DIPNAME( 0x80, 0x80, "Game Mode")               PORT_DIPLOCATION("SW(C):8")
15301356   PORT_DIPSETTING(    0x80, "Game" )
15311357   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
1532
1533   PORT_START("IN1")
1534   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1535   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1536   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1537   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1538   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1539   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1540   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1541   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1542   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1543   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1544   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1545   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1546   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1547   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1548   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1549   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15501358INPUT_PORTS_END
15511359
15521360/* To enable other choices in the "test mode", you must press ("P1 Button 1" ('Ctrl')
15531361   or "P1 Button 2" ('Alt')) when "Service Mode" is ON */
15541362static INPUT_PORTS_START( ffight )
1555   PORT_START("IN0")
1556   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1557   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1558   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1559   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1560   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1561   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1562   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
1563   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1363   PORT_INCLUDE( cps1_3b )
15641364
1365   PORT_MODIFY("IN1")
1366   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME ("P1 Button 3 (Cheat)")
1367   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME ("P2 Button 3 (Cheat)")
1368
15651369   PORT_START("DSWA")
15661370   CPS1_COINAGE_1( "SW(A)" )
15671371   PORT_DIPNAME( 0x40, 0x40, "2 Coins to Start, 1 to Continue" )   PORT_DIPLOCATION("SW(A):7")
r3115r3116
16151419   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                     PORT_DIPLOCATION("SW(C):8")
16161420   PORT_DIPSETTING(    0x80, "Game" )
16171421   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
1618
1619   PORT_START("IN1")
1620   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1621   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1622   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1623   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1624   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1625   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1626   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME ("P1 Button 3 (Cheat)")
1627   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1628   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1629   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1630   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1631   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1632   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1633   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1634   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME ("P2 Button 3 (Cheat)")
1635   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
16361422INPUT_PORTS_END
16371423
16381424static INPUT_PORTS_START( 1941 )
1639   PORT_START("IN0")
1640   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1641   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1642   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1643   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1644   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1645   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1646   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
1647   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1425   PORT_INCLUDE( cps1_2b )
16481426
16491427   PORT_START("DSWA")
16501428   CPS1_COINAGE_1( "SW(A)" )
r3115r3116
16921470   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                     PORT_DIPLOCATION("SW(C):8")
16931471   PORT_DIPSETTING(    0x80, "Game" )
16941472   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
1695
1696   PORT_START("IN1")
1697   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1698   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1699   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1700   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1701   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1702   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1703   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1704   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1705   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1706   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1707   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1708   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1709   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1710   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1711   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1712   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
17131473INPUT_PORTS_END
17141474
17151475static INPUT_PORTS_START( mercs )
1716   PORT_START("IN0")
1717   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1718   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1719   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1720   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1721   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1722   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1476   PORT_INCLUDE( cps1_3players )
1477
1478   PORT_MODIFY("IN0")
17231479   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1724   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
17251480
17261481   PORT_START("DSWA")
17271482   CPS1_COINAGE_2( "SW(A)" )
r3115r3116
17621517   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
17631518   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
17641519   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW(C):8" )
1765
1766   PORT_START("IN1")
1767   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1768   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1769   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1770   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1771   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1772   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1773   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1774   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1775   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1776   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1777   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1778   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1779   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1780   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1781   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1782   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1783
1784   PORT_START("IN2")
1785   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
1786   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
1787   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
1788   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
1789   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1790   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
1791   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
1792   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
17931520INPUT_PORTS_END
17941521
17951522/* According to code at 0x001c4e ('mtwins') or ('chikij') , ALL bits 0 to 5 of DSWA
r3115r3116
18061533     - 0xff156b.w : energy (player 2)
18071534*/
18081535static INPUT_PORTS_START( mtwins )
1809   PORT_START("IN0")
1810   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1811   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1812   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1813   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1814   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1815   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1536   PORT_INCLUDE( cps1_3b )
1537
1538   PORT_MODIFY("IN0")
18161539   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
1817   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
18181540
18191541   PORT_START("DSWA")
18201542   CPS1_COINAGE_1( "SW(A)" )
r3115r3116
18561578   PORT_DIPNAME( 0x80, 0x80, "Game Mode")               PORT_DIPLOCATION("SW(C):8")
18571579   PORT_DIPSETTING(    0x80, "Game" )
18581580   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
1859
1860   PORT_START("IN1")
1861   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1862   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1863   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1864   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1865   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1866   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1867   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1868   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1869   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1870   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1871   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1872   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1873   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1874   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1875   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1876   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
18771581INPUT_PORTS_END
18781582
18791583/* I guess that bit 8 of DSWB was used for debug purpose :
r3115r3116
18821586     - code at 0x01c322 ('msword' and 'mswordr1'), 0x01c39e ('mswordu') or 0x01c3e0 ('mswordj') : unknown effect
18831587   These features are not available because of the 'bra' instruction after the test of bit 7. */
18841588static INPUT_PORTS_START( msword )
1885   PORT_START("IN0")
1886   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1887   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1888   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1889   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1890   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1891   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1589   PORT_INCLUDE( cps1_3b )
1590
1591   PORT_MODIFY("IN0")
18921592   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
1893   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
18941593
18951594   PORT_START("DSWA")
18961595   CPS1_COINAGE_1( "SW(A)" )
r3115r3116
19471646   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                        PORT_DIPLOCATION("SW(C):8")
19481647   PORT_DIPSETTING(    0x80, "Game" )
19491648   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
1950
1951   PORT_START("IN1")
1952   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1953   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1954   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1955   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1956   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1957   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1958   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1959   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1960   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1961   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1962   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1963   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1964   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1965   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1966   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1967   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
19681649INPUT_PORTS_END
19691650
19701651static INPUT_PORTS_START( cawing )
1971   PORT_START("IN0")
1972   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1973   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1974   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1975   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1976   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1977   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1652   PORT_INCLUDE( cps1_3b )
1653
1654   PORT_MODIFY("IN0")
19781655   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
1979   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
19801656
19811657   PORT_START("DSWA")
19821658   CPS1_COINAGE_1( "SW(A)" )
r3115r3116
20251701   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                        PORT_DIPLOCATION("SW(C):8")
20261702   PORT_DIPSETTING(    0x80, "Game" )
20271703   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
2028
2029   PORT_START("IN1")
2030   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2031   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2032   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2033   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2034   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2035   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2036   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
2037   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2038   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2039   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2040   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2041   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2042   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2043   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2044   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2045   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
20461704INPUT_PORTS_END
20471705
20481706/* "Debug" features to be implemented */
20491707static INPUT_PORTS_START( nemo )
2050   PORT_START("IN0")
2051   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2052   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2053   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2054   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2055   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
2056   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1708   PORT_INCLUDE( cps1_3b )
1709
1710   PORT_MODIFY("IN0")
20571711   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
2058   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
20591712
20601713   PORT_START("DSWA")
20611714   CPS1_COINAGE_1( "SW(A)" )
r3115r3116
20991752   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                     PORT_DIPLOCATION("SW(C):8")
21001753   PORT_DIPSETTING(    0x80, "Game" )
21011754   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )               // To enable the "debug" features
2102
2103   PORT_START("IN1")
2104   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2105   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2106   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2107   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2108   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2109   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2110   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
2111   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2112   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2113   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2114   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2115   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2116   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2117   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2118   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2119   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
21201755INPUT_PORTS_END
21211756
21221757static INPUT_PORTS_START( sf2 )
2123   PORT_START("IN0")
2124   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2125   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2126   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2127   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN  )
2128   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
2129   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1758   PORT_INCLUDE( cps1_3b )
1759
1760   PORT_MODIFY("IN0")
21301761   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
2131   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN  )
21321762
21331763   PORT_START("DSWA")
21341764   CPS1_COINAGE_1( "SW(A)" )
r3115r3116
21671797   PORT_DIPSETTING(    0x80, "Game" )
21681798   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
21691799
2170   PORT_START("IN1")
2171   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2172   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2173   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2174   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2175   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2176   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2177   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
2178   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2179   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2180   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2181   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2182   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2183   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2184   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2185   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
2186   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2187
21881800   PORT_START("IN2")      /* Extra buttons */
21891801   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
21901802   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
r3115r3116
21981810
21991811/* Needs further checking */
22001812static INPUT_PORTS_START( sf2j )
2201   PORT_START("IN0")
2202   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2203   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2204   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2205   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN  )
2206   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
2207   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2208   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
2209   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1813   PORT_INCLUDE( sf2 )
22101814
2211   PORT_START("DSWA")
2212   CPS1_COINAGE_1( "SW(A)" )
2213   PORT_DIPNAME( 0x40, 0x40, "2 Coins to Start, 1 to Continue" )   PORT_DIPLOCATION("SW(A):7")
2214   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2215   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2216   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW(A):8" )
2217
2218   PORT_START("DSWB")
2219   CPS1_DIFFICULTY_1( "SW(B)" )
1815   PORT_MODIFY("DSWB")
22201816   PORT_DIPNAME( 0x08, 0x00, "2 Players Game" )               PORT_DIPLOCATION("SW(B):4")
22211817   PORT_DIPSETTING(    0x08, "1 Credit/No Continue" )
22221818   PORT_DIPSETTING(    0x00, "2 Credits/Winner Continue" ) //Winner stays, loser pays, in other words.
2223   PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW(B):5" )
2224   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW(B):6" )
2225   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW(B):7" )
2226   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW(B):8" )
1819INPUT_PORTS_END
22271820
2228   PORT_START("DSWC")
2229   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW(C):1" )
2230   PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW(C):2" )
2231   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Free_Play ) )            PORT_DIPLOCATION("SW(C):3")
2232   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2233   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2234   PORT_DIPNAME( 0x08, 0x08, "Freeze" )                     PORT_DIPLOCATION("SW(C):4")
2235   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2236   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2237   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) )            PORT_DIPLOCATION("SW(C):5")
2238   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2239   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2240   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) )            PORT_DIPLOCATION("SW(C):6")
2241   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2242   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2243   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) )         PORT_DIPLOCATION("SW(C):7")
2244   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
2245   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
2246   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                     PORT_DIPLOCATION("SW(C):8")
2247   PORT_DIPSETTING(    0x80, "Game" )
2248   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
1821static INPUT_PORTS_START( sf2hack )
1822   PORT_INCLUDE( sf2 )
22491823
2250   PORT_START("IN1")
2251   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2252   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2253   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2254   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2255   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2256   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2257   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
2258   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2259   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2260   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2261   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2262   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2263   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2264   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2265   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1824   PORT_MODIFY("IN2")      /* Extra buttons */
1825   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
1826   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1827   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
1828   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
1829   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1830   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1831   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
1832   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
22661833   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1834INPUT_PORTS_END
22671835
2268   PORT_START("IN2")      /* Extra buttons */
2269   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
2270   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
2271   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
2272   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2273   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
2274   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
2275   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
2276   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1836static INPUT_PORTS_START( sf2m2 )
1837   PORT_INCLUDE( sf2hack )
1838
1839   PORT_MODIFY("DSWB")
1840   PORT_DIPNAME( 0x10, 0x00, "It needs to be High" )                  PORT_DIPLOCATION("SW(B):5")
1841   PORT_DIPSETTING(    0x10, DEF_STR ( Low ) )
1842   PORT_DIPSETTING(    0x00, DEF_STR ( High ) )
22771843INPUT_PORTS_END
22781844
1845static INPUT_PORTS_START( sf2m4 )
1846   PORT_INCLUDE( sf2hack )
1847
1848   PORT_MODIFY("DSWB")
1849   PORT_DIPNAME( 0x08, 0x00, "2 Players Game" )               PORT_DIPLOCATION("SW(B):4")
1850   PORT_DIPSETTING(    0x08, "1 Credit/No Continue" )
1851   PORT_DIPSETTING(    0x00, "2 Credits/Winner Continue" ) //Winner stays, loser pays, in other words.
1852INPUT_PORTS_END
1853
22791854static INPUT_PORTS_START( 3wonders )
2280   PORT_START("IN0")
2281   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2282   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2283   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2284   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2285   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
2286   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1855   PORT_INCLUDE( cps1_3b )
1856
1857   PORT_MODIFY("IN0")
22871858   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
2288   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
22891859
22901860   PORT_START("DSWA")
22911861   CPS1_COINAGE_1( "SW(A)" )
2292   PORT_DIPNAME( 0x40, 0x40, "2 Coins to Start, 1 to Continue" )   PORT_DIPLOCATION("SW(A):7")
2293                                                   PORT_CONDITION("DSWA",0x3f,PORTCOND_NOTEQUALS,0x00)
2294   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )                  PORT_CONDITION("DSWA",0x3f,PORTCOND_NOTEQUALS,0x00)
2295   PORT_DIPSETTING(    0x00, DEF_STR( On ) )                  PORT_CONDITION("DSWA",0x3f,PORTCOND_NOTEQUALS,0x00)
2296   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )            PORT_DIPLOCATION("SW(A):7")
2297                                                   PORT_CONDITION("DSWA",0x3f,PORTCOND_EQUALS,0x00)
2298   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )                  PORT_CONDITION("DSWA",0x3f,PORTCOND_EQUALS,0x00)
2299   PORT_DIPSETTING(    0x00, DEF_STR( On ) )                  PORT_CONDITION("DSWA",0x3f,PORTCOND_EQUALS,0x00)
1862   PORT_DIPNAME( 0x40, 0x40, "2 Coins to Start, 1 to Continue" ) PORT_CONDITION("DSWA", 0x3f,PORTCOND_NOTEQUALS,0x00) PORT_DIPLOCATION("SW(A):7")
1863   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1864   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1865   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_CONDITION("DSWA", 0x3f, PORTCOND_EQUALS, 0x00) PORT_DIPLOCATION("SW(A):7")
1866   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1867   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
23001868   /* Free Play: ALL bits 0 to 7 must be ON ; 4C_1C, 4C_1C, 2 Coins to Start, 1 to Continue ON */
23011869   PORT_DIPNAME( 0x80, 0x80, "Freeze" )                     PORT_DIPLOCATION("SW(A):8")
23021870   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
r3115r3116
23471915   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                     PORT_DIPLOCATION("SW(C):8")
23481916   PORT_DIPSETTING(    0x80, "Game" )
23491917   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
2350
2351   PORT_START("IN1")
2352   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2353   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2354   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2355   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2356   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2357   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2358   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
2359   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2360   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2361   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2362   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2363   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2364   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2365   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2366   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
2367   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
23681918INPUT_PORTS_END
23691919
23701920static INPUT_PORTS_START( kod )
2371   PORT_START("IN0")
2372   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2373   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2374   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2375   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2376   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
2377   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1921   PORT_INCLUDE( cps1_3players )
1922
1923   PORT_MODIFY("IN0")
23781924   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
2379   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
23801925
23811926   PORT_START("DSWA")
23821927   CPS1_COINAGE_2( "SW(A)" )
r3115r3116
24301975   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                     PORT_DIPLOCATION("SW(C):8")
24311976   PORT_DIPSETTING(    0x80, "Game" )
24321977   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
2433
2434   PORT_START("IN1")
2435   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2436   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2437   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2438   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2439   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2440   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2441   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
2442   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2443   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2444   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2445   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2446   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2447   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2448   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2449   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2450   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2451
2452   PORT_START("IN2")      /* Player 3 */
2453   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
2454   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
2455   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
2456   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
2457   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
2458   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
2459   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
2460   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
24611978INPUT_PORTS_END
24621979
24631980/* Needs further checking
r3115r3116
24751992
24761993
24771994static INPUT_PORTS_START( captcomm )
2478   PORT_START("IN0")
2479   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2480   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2481   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2482   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2483   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
2484   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1995   PORT_INCLUDE( cps1_4players )
1996
1997   PORT_MODIFY("IN0")
24851998   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
2486   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
24871999
24882000   PORT_START("DSWA")
24892001   CPS1_COINAGE_2( "SW(A)" )
r3115r3116
25412053   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                     PORT_DIPLOCATION("SW(C):8")
25422054   PORT_DIPSETTING(    0x80, "Game" )
25432055   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
2544
2545   PORT_START("IN1")
2546   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2547   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2548   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2549   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2550   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2551   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2552   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
2553   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2554   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2555   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2556   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2557   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2558   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2559   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2560   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2561   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2562
2563   PORT_START("IN2")      /* Player 3 */
2564   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
2565   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
2566   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
2567   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
2568   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
2569   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
2570   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
2571   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
2572
2573   PORT_START("IN3")      /* Player 4 */
2574   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
2575   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
2576   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
2577   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
2578   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
2579   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
2580   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN4 )
2581   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
25822056INPUT_PORTS_END
25832057
25842058static INPUT_PORTS_START( knights )
2585   PORT_START("IN0")
2586   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2587   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2588   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2589   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2590   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
2591   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2059   PORT_INCLUDE( cps1_3players )
2060
2061   PORT_MODIFY("IN0")
25922062   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
2593   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
25942063
25952064   PORT_START("DSWA")
25962065   CPS1_COINAGE_2( "SW(A)" )
r3115r3116
26522121   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                     PORT_DIPLOCATION("SW(C):8")
26532122   PORT_DIPSETTING(    0x80, "Game" )
26542123   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
2655
2656   PORT_START("IN1")
2657   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2658   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2659   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2660   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2661   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2662   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2663   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
2664   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2665   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2666   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2667   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2668   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2669   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2670   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2671   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2672   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2673
2674   PORT_START("IN2")      /* Player 3 */
2675   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
2676   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
2677   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
2678   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
2679   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
2680   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
2681   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
2682   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
26832124INPUT_PORTS_END
26842125
26852126static INPUT_PORTS_START( varth )
2686   PORT_START("IN0")
2687   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2688   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2689   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2690   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2691   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
2692   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2127   PORT_INCLUDE( cps1_3b )
2128
2129   PORT_MODIFY("IN0")
26932130   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
2694   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
26952131
26962132   PORT_START("DSWA")
26972133   CPS1_COINAGE_1( "SW(A)" )
r3115r3116
27352171   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                     PORT_DIPLOCATION("SW(C):8")
27362172   PORT_DIPSETTING(    0x80, "Game" )
27372173   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
2738
2739   PORT_START("IN1")
2740   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2741   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2742   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2743   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2744   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2745   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2746   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
2747   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2748   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2749   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2750   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2751   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2752   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2753   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2754   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2755   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
27562174INPUT_PORTS_END
27572175
27582176/* Needs further checking */
27592177static INPUT_PORTS_START( cworld2j )
2760   PORT_START("IN0")
2761   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2762   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2763   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2764   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2765   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
2766   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2178   PORT_INCLUDE( cps1_quiz )
2179
2180   PORT_MODIFY("IN0")
27672181   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
2768   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
27692182
27702183   PORT_START("DSWA")
27712184   CPS1_COINAGE_2( "SW(A)" )
r3115r3116
28192232   PORT_DIPSETTING(    0x80, "Game" )
28202233   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
28212234
2822   PORT_START("IN1")
2823   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
2824   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
2825   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
2826   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
2827   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2828   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2829   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
2830   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
2831   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
2832   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
2833   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
2834   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
2835   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2836   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2837   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
2838   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
2839
28402235   PORT_START("IN2")  /* check code at 0x000614, 0x0008ac and 0x000e36 */
28412236   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
28422237INPUT_PORTS_END
28432238
28442239/* Needs further checking */
28452240static INPUT_PORTS_START( wof )
2846   PORT_START("IN0")
2847   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2848   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2849   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2850   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2851   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
2852   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2241   PORT_INCLUDE( cps1_3players )
2242
2243   PORT_MODIFY("IN0")
28532244   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
2854   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
28552245
28562246   PORT_START("DSWA")      /* (not used, EEPROM) */
28572247   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
28652255   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
28662256   PORT_BIT( 0xf7, IP_ACTIVE_LOW, IPT_UNKNOWN )
28672257
2868   PORT_START("IN1")
2869   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2870   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2871   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2872   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2873   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2874   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2875   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
2876   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2877   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2878   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2879   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2880   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2881   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2882   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2883   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2884   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2885
2886   PORT_START("IN2")      /* Player 3 */
2887   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
2888   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
2889   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
2890   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
2891   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
2892   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
2893   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
2894   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
2895
28962258   PORT_START("IN3")      /* Player 4 - not used */
28972259   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
28982260INPUT_PORTS_END
28992261
29002262/* Needs further checking */
29012263static INPUT_PORTS_START( dino )
2902   PORT_START("IN0")
2903   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2904   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2905   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2906   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2907   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
2908   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2264   PORT_INCLUDE( cps1_3players )
2265
2266   PORT_MODIFY("IN0")
29092267   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
2910   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
29112268
29122269   PORT_START("DSWA")      /* (not used, EEPROM) */
29132270   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
29212278   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
29222279   PORT_BIT( 0xf7, IP_ACTIVE_LOW, IPT_UNKNOWN )
29232280
2924   PORT_START("IN1")
2925   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2926   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2927   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2928   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2929   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2930   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2931   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
2932   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2933   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2934   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2935   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2936   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2937   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2938   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2939   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2940   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2941
2942   PORT_START("IN2")      /* Player 3 */
2943   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
2944   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
2945   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
2946   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
2947   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
2948   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
2949   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
2950   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
2951
29522281   PORT_START("IN3")      /* Player 4 - not used */
29532282   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
29542283INPUT_PORTS_END
29552284
29562285/* Needs further checking */
29572286static INPUT_PORTS_START( punisher )
2958   PORT_START("IN0")
2959   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2960   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2961   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2962   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2963   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
2964   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2287   PORT_INCLUDE( cps1_2b )
2288
2289   PORT_MODIFY("IN0")
29652290   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
2966   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
29672291
29682292   PORT_START("DSWA")      /* (not used, EEPROM) */
29692293   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
29772301   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
29782302   PORT_BIT( 0xf7, IP_ACTIVE_LOW, IPT_UNKNOWN )
29792303
2980   PORT_START("IN1")
2981   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2982   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2983   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2984   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2985   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2986   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2987   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
2988   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2989   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2990   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2991   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2992   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2993   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2994   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2995   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2996   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2997
29982304   PORT_START("IN2")      /* Player 3 - not used */
29992305   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
30002306
r3115r3116
30042310
30052311/* Needs further checking */
30062312static INPUT_PORTS_START( slammast )
3007   PORT_START("IN0")
3008   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
3009   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
3010   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3011   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3012   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
3013   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2313   PORT_INCLUDE( cps1_4players )
2314
2315   PORT_MODIFY("IN0")
30142316   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
3015   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
30162317
2318   PORT_MODIFY("IN1")
2319   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
2320   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
2321   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
2322   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
2323
30172324   PORT_START("DSWA")      /* (not used, EEPROM) */
30182325   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
30192326
r3115r3116
30252332   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
30262333   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
30272334   PORT_BIT( 0xf7, IP_ACTIVE_LOW, IPT_UNKNOWN )
3028
3029   PORT_START("IN1")
3030   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
3031   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
3032   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
3033   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
3034   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
3035   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
3036   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
3037   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
3038   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
3039   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
3040   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
3041   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
3042   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3043   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
3044   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
3045   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
3046
3047   PORT_START("IN2")     /* Player 3 */
3048   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
3049   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
3050   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
3051   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
3052   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
3053   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
3054   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
3055   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
3056
3057   PORT_START("IN3")     /* Player 4 */
3058   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
3059   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
3060   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
3061   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
3062   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
3063   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
3064   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN4 )
3065   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
30662335INPUT_PORTS_END
30672336
30682337/* Needs further checking */
30692338static INPUT_PORTS_START( pnickj )
3070   PORT_START("IN0")
3071   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
3072   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
3073   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3074   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3075   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
3076   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2339   PORT_INCLUDE( cps1_3b )
2340
2341   PORT_MODIFY("IN0")
30772342   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
3078   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
30792343
30802344   PORT_START("DSWA")
30812345   CPS1_COINAGE_2( "SW(A)" )
r3115r3116
31152379   PORT_DIPNAME( 0x80, 0x80, "Game Mode")               PORT_DIPLOCATION("SW(C):8")
31162380   PORT_DIPSETTING(    0x80, "Game" )
31172381   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
3118
3119   PORT_START("IN1")
3120   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
3121   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
3122   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
3123   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
3124   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
3125   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
3126   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
3127   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
3128   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
3129   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
3130   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
3131   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
3132   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3133   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
3134   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
3135   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
31362382INPUT_PORTS_END
31372383
31382384/* Needs further checking */
31392385static INPUT_PORTS_START( qad )
3140   PORT_START("IN0")
3141   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
3142   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
3143   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3144   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3145   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
3146   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2386   PORT_INCLUDE( cps1_quiz )
2387
2388   PORT_MODIFY("IN0")
31472389   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
3148   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
31492390
31502391   PORT_START("DSWA")
31512392   CPS1_COINAGE_2( "SW(A)" )
r3115r3116
32042445   PORT_DIPSETTING(    0x80, "Game" )
32052446   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
32062447
3207   PORT_START("IN1")
3208   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
3209   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
3210   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
3211   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
3212   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
3213   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
3214   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
3215   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
3216   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
3217   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
3218   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
3219   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
3220   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3221   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
3222   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
3223   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
3224
32252448   PORT_START("IN2")  /* check code at 0x01d2d2 */
32262449   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
32272450INPUT_PORTS_END
32282451
32292452/* Needs further checking */
32302453static INPUT_PORTS_START( qadj )
3231   PORT_START("IN0")
3232   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
3233   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
3234   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3235   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3236   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
3237   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
3238   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
3239   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2454   PORT_INCLUDE( qad )
32402455
3241   PORT_START("DSWA")
3242   CPS1_COINAGE_2( "SW(A)" )
3243   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW(A):4" )               // Manual says these are for coin 2, but they
3244   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW(A):5" )               // coin to setting, but they clearly don't do
3245   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW(A):6" )               // that.
3246   PORT_DIPNAME( 0x40, 0x40, "2 Coins to Start, 1 to Continue" )   PORT_DIPLOCATION("SW(A):7")
3247   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3248   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3249   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW(A):8" )
3250
3251   PORT_START("DSWB")
2456   PORT_MODIFY("DSWB")
32522457   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )            PORT_DIPLOCATION("SW(B):1,2,3")
32532458   PORT_DIPSETTING(    0x07, "0" )
32542459   PORT_DIPSETTING(    0x06, "1" )
r3115r3116
32702475//  PORT_DIPSETTING(    0x40, "2" )
32712476//  PORT_DIPSETTING(    0x60, "3" )
32722477
3273   PORT_START("DSWC")
3274   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW(C):1" )
3275   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW(C):2" )
3276   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Free_Play ) )            PORT_DIPLOCATION("SW(C):3")
3277   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
3278   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3279   PORT_DIPNAME( 0x08, 0x08, "Freeze" )                     PORT_DIPLOCATION("SW(C):4")
3280   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
3281   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3282   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) )            PORT_DIPLOCATION("SW(C):5")
3283   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
3284   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3285   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) )            PORT_DIPLOCATION("SW(C):6")
3286   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
3287   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3288   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )         PORT_DIPLOCATION("SW(C):7")
3289   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
3290   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
3291   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                     PORT_DIPLOCATION("SW(C):8")
3292   PORT_DIPSETTING(    0x80, "Game" )
3293   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
3294
3295   PORT_START("IN1")
3296   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
3297   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
3298   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
3299   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
3300   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
3301   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
3302   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
3303   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
3304   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
3305   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
3306   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
3307   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
3308   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3309   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
3310   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
3311   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
3312
3313   PORT_START("IN2")  /* check code at 0x000c48 */
2478   PORT_MODIFY("IN2")  /* check code at 0x000c48 */
33142479   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
33152480
33162481   PORT_START("IN3")  /* check code at 0x000c3e */
r3115r3116
33192484
33202485/* Needs further checking */
33212486static INPUT_PORTS_START( qtono2 )
3322   PORT_START("IN0")
3323   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
3324   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
3325   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3326   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3327   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
3328   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2487   PORT_INCLUDE( cps1_quiz )
2488
2489   PORT_MODIFY("IN0")
33292490   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
3330   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
33312491
33322492   PORT_START("DSWA")
33332493   CPS1_COINAGE_2( "SW(A)" )
r3115r3116
33772537   PORT_DIPSETTING(    0x80, "Game" )
33782538   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
33792539
3380   PORT_START("IN1")
3381   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
3382   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
3383   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
3384   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
3385   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
3386   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
3387   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
3388   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
3389   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
3390   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
3391   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
3392   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
3393   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3394   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
3395   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
3396   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
3397
33982540   PORT_START("IN2")  /* check code at 0x000f80 */
33992541   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
34002542
r3115r3116
34042546
34052547/* Needs further checking */
34062548static INPUT_PORTS_START( pang3 )
3407   PORT_START("IN0")
3408   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
3409   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
3410   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3411   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3412   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
3413   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2549   PORT_INCLUDE( cps1_3b )
2550
2551   PORT_MODIFY("IN0")
34142552   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
3415   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
34162553
34172554   PORT_START("DSWA")      /* (not used, EEPROM) */
34182555   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
34242561   PORT_DIPNAME( 0x08, 0x08, "Freeze" )
34252562   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
34262563   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3427
3428   PORT_START("IN1")
3429   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
3430   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
3431   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
3432   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
3433   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
3434   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
3435   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
3436   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
3437   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
3438   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
3439   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
3440   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
3441   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3442   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
3443   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
3444   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
34452564INPUT_PORTS_END
34462565
34472566/* Needs further checking */
34482567static INPUT_PORTS_START( megaman )
3449   PORT_START("IN0")
3450   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
3451   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
3452   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3453   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3454   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
3455   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2568   PORT_INCLUDE( cps1_3b )
2569
2570   PORT_MODIFY("IN0")
34562571   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
3457   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
34582572
34592573   PORT_START("DSWA")
34602574   PORT_DIPNAME( 0x1f, 0x1f, DEF_STR( Coinage ) )               PORT_DIPLOCATION("SW(A):1,2,3,4,5")
r3115r3116
35202634   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                     PORT_DIPLOCATION("SW(C):8")
35212635   PORT_DIPSETTING(    0x80, "Game" )
35222636   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
3523
3524   PORT_START("IN1")
3525   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
3526   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
3527   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
3528   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
3529   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
3530   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
3531   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
3532   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
3533   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
3534   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
3535   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
3536   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
3537   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3538   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
3539   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
3540   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
35412637INPUT_PORTS_END
35422638
35432639/* Needs further checking */
r3115r3116
35902686   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
35912687
35922688   PORT_MODIFY("IN1")
3593   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
3594   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
3595   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
3596   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
3597   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
3598   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
35992689   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
3600   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
3601   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
3602   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
3603   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
3604   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
3605   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3606   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
36072690   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
3608   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
36092691
36102692   PORT_MODIFY("IN2")      /* Player 3 */
3611   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
3612   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
3613   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
3614   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
3615   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
3616   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
3617//  PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
3618   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
3619   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
2693   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Coin 3 (P3 Button 3 in-game)")
36202694INPUT_PORTS_END
36212695
36222696
r3115r3116
92848358GAME( 1992, sf2v004,  sf2ce,    cps1_12MHz, sf2,      cps1,     ROT0,   "bootleg","Street Fighter II! - Champion Edition (V004, bootleg)", 0 )         // "102092" !!! - based on (heavily modified) World version
92858359GAME( 1992, sf2accp2, sf2ce,    cps1_12MHz, sf2,      cps1,     ROT0,   "bootleg","Street Fighter II' - Champion Edition (Accelerator Pt.II, bootleg)" , 0)  // 920313 - based on USA version
92868360GAME( 1992, sf2m1,    sf2ce,    cps1_12MHz, sf2,      cps1,     ROT0,   "bootleg","Street Fighter II' - Champion Edition (M1, bootleg)", GAME_NOT_WORKING )
9287GAME( 1992, sf2m2,    sf2ce,    cps1_12MHz, sf2,      cps1,     ROT0,   "bootleg","Street Fighter II' - Champion Edition (M2, bootleg)", GAME_NOT_WORKING )
8361GAME( 1992, sf2m2,    sf2ce,    cps1_12MHz, sf2m2,    sf2hack,  ROT0,   "bootleg","Street Fighter II' - Champion Edition (M2, bootleg)", 0 )
92888362GAME( 1992, sf2m3,    sf2ce,    cps1_12MHz, sf2,      cps1,     ROT0,   "bootleg","Street Fighter II' - Champion Edition (M3, bootleg)", GAME_NOT_WORKING )
9289GAME( 1992, sf2m4,    sf2ce,    cps1_12MHz, sf2j,     sf2hack,  ROT0,   "bootleg","Street Fighter II' - Champion Edition (M4, bootleg)", 0 )
9290GAME( 1992, sf2m5,    sf2ce,    cps1_12MHz, sf2,      sf2hack,  ROT0,   "bootleg","Street Fighter II' - Champion Edition (M5, bootleg)", 0 )
9291GAME( 1992, sf2m6,    sf2ce,    cps1_12MHz, sf2,      sf2hack,  ROT0,   "bootleg","Street Fighter II' - Champion Edition (M6, bootleg)", 0 )
9292GAME( 1992, sf2m7,    sf2ce,    cps1_12MHz, sf2,      sf2hack,  ROT0,   "bootleg","Street Fighter II' - Champion Edition (M7, bootleg)", 0 )
9293GAME( 1992, sf2yyc,   sf2ce,    cps1_12MHz, sf2,      sf2hack,  ROT0,   "bootleg","Street Fighter II' - Champion Edition (YYC, bootleg)", 0 )
9294GAME( 1992, sf2koryu, sf2ce,    cps1_12MHz, sf2,      sf2hack,  ROT0,   "bootleg","Street Fighter II' - Champion Edition (Xiang Long, Chinese bootleg)", 0 )
9295GAME( 1992, sf2mdt,   sf2ce,    sf2mdt,     sf2,      sf2mdt,   ROT0,   "bootleg","Street Fighter II' - Champion Edition (Magic Delta Turbo, bootleg)", GAME_NOT_WORKING|GAME_NO_SOUND ); // heavily modified, different sound & gfx hardware
8363GAME( 1992, sf2m4,    sf2ce,    cps1_12MHz, sf2m4,    sf2hack,  ROT0,   "bootleg","Street Fighter II' - Champion Edition (M4, bootleg)", 0 )
8364GAME( 1992, sf2m5,    sf2ce,    cps1_12MHz, sf2hack,  sf2hack,  ROT0,   "bootleg","Street Fighter II' - Champion Edition (M5, bootleg)", 0 )
8365GAME( 1992, sf2m6,    sf2ce,    cps1_12MHz, sf2hack,  sf2hack,  ROT0,   "bootleg","Street Fighter II' - Champion Edition (M6, bootleg)", 0 )
8366GAME( 1992, sf2m7,    sf2ce,    cps1_12MHz, sf2hack,  sf2hack,  ROT0,   "bootleg","Street Fighter II' - Champion Edition (M7, bootleg)", 0 )
8367GAME( 1992, sf2yyc,   sf2ce,    cps1_12MHz, sf2hack,  sf2hack,  ROT0,   "bootleg","Street Fighter II' - Champion Edition (YYC, bootleg)", 0 )
8368GAME( 1992, sf2koryu, sf2ce,    cps1_12MHz, sf2hack,  sf2hack,  ROT0,   "bootleg","Street Fighter II' - Champion Edition (Xiang Long, Chinese bootleg)", 0 )
8369GAME( 1992, sf2mdt,   sf2ce,    sf2mdt,     sf2hack,  sf2mdt,   ROT0,   "bootleg","Street Fighter II' - Champion Edition (Magic Delta Turbo, bootleg)", GAME_NOT_WORKING|GAME_NO_SOUND ); // heavily modified, different sound & gfx hardware
92968370GAME( 1992, varth,    0,        cps1_12MHz, varth,    cps1,     ROT270, "Capcom", "Varth - Operation Thunderstorm (World 920714)" , 0)      // "ETC"    12MHz not verified but game slows down at 10MHz
92978371GAME( 1992, varthr1,  varth,    cps1_12MHz, varth,    cps1,     ROT270, "Capcom", "Varth - Operation Thunderstorm (World 920612)" , 0)      // "ETC"
92988372GAME( 1992, varthu,   varth,    cps1_12MHz, varth,    cps1,     ROT270, "Capcom (Romstar license)", "Varth - Operation Thunderstorm (US 920612)", 0 )
src/mame/drivers/nova2001.c
r3115r3116
133133
134134static UINT8 ninjakun_io_a002_ctrl;
135135
136static READ8_HANDLER( ninjakun_io_A002_r )
136static CUSTOM_INPUT( ninjakun_io_A002_ctrl_r )
137137{
138   return ninjakun_io_a002_ctrl | input_port_read(machine, "IN2"); /* vblank */
138   return ninjakun_io_a002_ctrl;
139139}
140140
141141static WRITE8_HANDLER( ninjakun_cpu1_io_A002_w )
142142{
143   if( data == 0x80 ) ninjakun_io_a002_ctrl |= 0x04;
144   if( data == 0x40 ) ninjakun_io_a002_ctrl &= ~0x08;
143   if( data == 0x80 ) ninjakun_io_a002_ctrl |= 0x01;
144   if( data == 0x40 ) ninjakun_io_a002_ctrl &= ~0x02;
145145}
146146
147147static WRITE8_HANDLER( ninjakun_cpu2_io_A002_w )
148148{
149   if( data == 0x40 ) ninjakun_io_a002_ctrl |= 0x08;
150   if( data == 0x80 ) ninjakun_io_a002_ctrl &= ~0x04;
149   if( data == 0x40 ) ninjakun_io_a002_ctrl |= 0x02;
150   if( data == 0x80 ) ninjakun_io_a002_ctrl &= ~0x01;
151151}
152152
153153
r3115r3116
183183   AM_RANGE(0xc002, 0xc002) AM_WRITE(ay8910_control_port_0_w)
184184   AM_RANGE(0xc003, 0xc003) AM_WRITE(ay8910_control_port_1_w)
185185   AM_RANGE(0xc004, 0xc004) AM_READ(watchdog_reset_r)
186   AM_RANGE(0xc006, 0xc006) AM_READ(input_port_0_r)
187   AM_RANGE(0xc007, 0xc007) AM_READ(input_port_1_r)
188   AM_RANGE(0xc00e, 0xc00e) AM_READ(input_port_2_r)
186   AM_RANGE(0xc006, 0xc006) AM_READ_PORT("IN0")
187   AM_RANGE(0xc007, 0xc007) AM_READ_PORT("IN1")
188   AM_RANGE(0xc00e, 0xc00e) AM_READ_PORT("IN2")
189189   AM_RANGE(0xe000, 0xe7ff) AM_RAM
190190ADDRESS_MAP_END
191191
r3115r3116
197197   AM_RANGE(0x8001, 0x8001) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
198198   AM_RANGE(0x8002, 0x8002) AM_WRITE(ay8910_control_port_1_w)
199199   AM_RANGE(0x8003, 0x8003) AM_READWRITE(ay8910_read_port_1_r, ay8910_write_port_1_w)
200   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
201   AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r)
202   AM_RANGE(0xa002, 0xa002) AM_READWRITE(ninjakun_io_A002_r, ninjakun_cpu1_io_A002_w)
200   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
201   AM_RANGE(0xa001, 0xa001) AM_READ_PORT("IN1")
202   AM_RANGE(0xa002, 0xa002) AM_READ_PORT("IN2") AM_WRITE(ninjakun_cpu1_io_A002_w)
203203   AM_RANGE(0xa003, 0xa003) AM_WRITE(pkunwar_flipscreen_w)
204204   AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(nova2001_fg_videoram_w) AM_BASE(&nova2001_fg_videoram) AM_SHARE(1)
205205   AM_RANGE(0xc800, 0xcfff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_BASE(&nova2001_bg_videoram) AM_SHARE(2)
r3115r3116
216216   AM_RANGE(0x8001, 0x8001) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
217217   AM_RANGE(0x8002, 0x8002) AM_WRITE(ay8910_control_port_1_w)
218218   AM_RANGE(0x8003, 0x8003) AM_READWRITE(ay8910_read_port_1_r, ay8910_write_port_1_w)
219   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
220   AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r)
221   AM_RANGE(0xa002, 0xa002) AM_READWRITE(ninjakun_io_A002_r, ninjakun_cpu2_io_A002_w)
219   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
220   AM_RANGE(0xa001, 0xa001) AM_READ_PORT("IN1")
221   AM_RANGE(0xa002, 0xa002) AM_READ_PORT("IN2") AM_WRITE(ninjakun_cpu2_io_A002_w)
222222   AM_RANGE(0xa003, 0xa003) AM_WRITE(nova2001_flipscreen_w)
223223   AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(nova2001_fg_videoram_w) AM_SHARE(1)
224224   AM_RANGE(0xc800, 0xcfff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_SHARE(2)
r3115r3116
317317   PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNUSED )
318318   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
319319
320   PORT_START("DSW1")  /* dsw0 */
320   PORT_START("DSW1")
321321   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1")
322322   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
323323   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
r3115r3116
341341   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
342342   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
343343
344   PORT_START("DSW2")  /* dsw1 */
344   PORT_START("DSW2")
345345   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
346346   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
347347   PORT_DIPSETTING(    0x03, DEF_STR( Medium ) )
r3115r3116
382382
383383   PORT_START("IN2")   /* 0xa002 */
384384   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
385   PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ninjakun_io_A002_ctrl_r, NULL)
385386
386387   PORT_START("DSW1")
387388   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
r3115r3116
435436INPUT_PORTS_END
436437
437438static INPUT_PORTS_START( pkunwar )
438   PORT_START("IN0")   /* IN0 */
439   PORT_START("IN0")
439440   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
440441   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
441442   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
r3115r3116
445446   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
446447   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
447448
448   PORT_START("IN1")   /* IN1 */
449   PORT_START("IN1")
449450   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
450451   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
451452   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
r3115r3116
455456   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
456457   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
457458
458   PORT_START("IN2")   /* DSW0 */
459   PORT_START("IN2")
459460   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
460461   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
461462   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
481482   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
482483   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
483484
484   PORT_START("DSW1")   /* DSW1 */
485   PORT_START("DSW1")
485486   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
486487   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
487488   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
r3115r3116
527528   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
528529   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
529530
530   PORT_START("DSW1")   /* DSW1 */
531   PORT_START("DSW1")
531532   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
532533   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
533534   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
r3115r3116
551552   PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
552553   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
553554
554   PORT_START("DSW2")   /* DSW2*/
555   PORT_START("DSW2")
555556   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
556557   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
557558   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
576577   PORT_DIPNAME( 0x80, 0x80, "Unlimited Lives (If Free Play)" )
577578   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
578579   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
579
580580INPUT_PORTS_END
581581
582582
src/mame/drivers/starcrus.c
r3115r3116
4545ADDRESS_MAP_END
4646
4747static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
48    AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
49    AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r)
48    AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
49    AM_RANGE(0x01, 0x01) AM_READ_PORT("P2")
5050    AM_RANGE(0x02, 0x02) AM_READ(starcrus_coll_det_r)
51    AM_RANGE(0x03, 0x03) AM_READ(input_port_2_r)
51    AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW")
5252ADDRESS_MAP_END
5353
5454static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
r3115r3116
6969
7070
7171static INPUT_PORTS_START( starcrus )
72   PORT_START("P1")   /* player 1 */
73   PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY /* ccw */
74   PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* engine */
75   PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY /* cw */
76   PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
77   PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* torpedo */
78   PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
79   PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* phaser */
80   PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
72   PORT_START("P1")
73   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY /* ccw */
74   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* engine */
75   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY /* cw */
76   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
77   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* torpedo */
78   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
79   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* phaser */
80   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
8181
82   PORT_START("P2")  /* player 2 */
83   PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) /* ccw */
84   PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) /* engine */
85   PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) /* cw */
86   PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
87   PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) /* torpedo */
88   PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
89   PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) /* phaser */
90   PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
82   PORT_START("P2")
83   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) /* ccw */
84   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) /* engine */
85   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) /* cw */
86   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
87   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) /* torpedo */
88   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
89   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) /* phaser */
90   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
9191
9292   PORT_START("DSW")
93   PORT_DIPNAME ( 0x03, 0x02, DEF_STR( Game_Time ) )
94   PORT_DIPSETTING ( 0x03, "60 secs" )
95   PORT_DIPSETTING ( 0x02, "90 secs" )
96   PORT_DIPSETTING ( 0x01, "120 secs" )
97   PORT_DIPSETTING ( 0x00, "150 secs" )
98   PORT_DIPNAME ( 0x04, 0x00, DEF_STR( Coinage ))
99   PORT_DIPSETTING ( 0x04, DEF_STR( 2C_1C ))
100   PORT_DIPSETTING ( 0x00, DEF_STR( 1C_1C ))
101   PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_COIN2 )
102   PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_COIN1 )
103   PORT_DIPNAME ( 0x20, 0x20, "Mode" )
104   PORT_DIPSETTING ( 0x20, DEF_STR( Standard ) )
105   PORT_DIPSETTING ( 0x00, DEF_STR( Alternate ) )
106   PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
107   PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
93   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Game_Time ) )
94   PORT_DIPSETTING(    0x03, "60 secs" )
95   PORT_DIPSETTING(    0x02, "90 secs" )
96   PORT_DIPSETTING(    0x01, "120 secs" )
97   PORT_DIPSETTING(    0x00, "150 secs" )
98   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Coinage ))
99   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ))
100   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ))
101   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
102   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
103   PORT_DIPNAME( 0x20, 0x20, "Mode" )
104   PORT_DIPSETTING(    0x20, DEF_STR( Standard ) )
105   PORT_DIPSETTING(    0x00, DEF_STR( Alternate ) )
106   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
107   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
108108INPUT_PORTS_END
109109
110110
src/mame/drivers/scobra.c
r3115r3116
451451   AM_RANGE(0x80, 0x80) AM_WRITE(ay8910_write_port_0_w)
452452ADDRESS_MAP_END
453453
454#define SCOBRA_IN0\
455   PORT_START("IN0")\
456   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL\
457   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )\
458   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )\
459   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )\
460   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY\
461   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY\
462   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )\
454static INPUT_PORTS_START( scobra )
455   PORT_START("IN0")
456   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
457   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
458   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
459   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
460   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
461   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
462   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
463463   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
464464
465#define SCOBRA_IN1\
466   PORT_START("IN1")\
467   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Allow_Continue ) )\
468   PORT_DIPSETTING(    0x00, DEF_STR( No ) )\
469   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )\
470   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )\
471   PORT_DIPSETTING(    0x00, "3" )\
472   PORT_DIPSETTING(    0x02, "4" )\
473   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL\
474   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL\
475   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL\
476   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL\
477   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )\
478   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
479
480#define SCOBRA_IN2\
481   PORT_START("IN2")\
482   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL\
483   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )\
484   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )\
485   PORT_DIPSETTING(    0x06, DEF_STR( 4C_3C ) )\
486   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )\
487   PORT_DIPSETTING(    0x00, "1 Coin/99 Credits" )\
488   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )\
489   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )\
490   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )\
491   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY\
492   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )\
493   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY\
494   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
495
496static INPUT_PORTS_START( scobra )
497SCOBRA_IN0
498SCOBRA_IN1
499SCOBRA_IN2
500INPUT_PORTS_END
501
502/* identical to scobra apart from the number of lives */
503static INPUT_PORTS_START( scobras )
504SCOBRA_IN0
505
506465   PORT_START("IN1")
507466   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Allow_Continue ) )
508467   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
509468   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
510469   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
511470   PORT_DIPSETTING(    0x00, "3" )
512   PORT_DIPSETTING(    0x02, "5" )
471   PORT_DIPSETTING(    0x02, "4" )
513472   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
514473   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
515474   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
r3115r3116
517476   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
518477   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
519478
520SCOBRA_IN2
479   PORT_START("IN2")
480   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
481   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
482   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
483   PORT_DIPSETTING(    0x06, DEF_STR( 4C_3C ) )
484   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
485   PORT_DIPSETTING(    0x00, "1 Coin/99 Credits" )
486   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
487   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
488   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
489   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
490   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
491   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
492   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
521493INPUT_PORTS_END
522494
495/* identical to scobra apart from the number of lives */
496static INPUT_PORTS_START( scobras )
497   PORT_INCLUDE( scobra )
498
499   PORT_MODIFY("IN1")
500   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
501   PORT_DIPSETTING(    0x00, "3" )
502   PORT_DIPSETTING(    0x02, "5" )
503INPUT_PORTS_END
504
505
506/* stratgyx coinage DIPs are spread accross two input ports */
507static CUSTOM_INPUT( stratgyx_coinage_r )
508{
509   int bit_mask = (FPTR)param;
510   return (input_port_read(field->port->machine, "IN4") & bit_mask) ? 0x01 : 0x00;
511}
512
513
523514static INPUT_PORTS_START( stratgyx )
524SCOBRA_IN0
515   PORT_START("IN0")
516   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
517   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
518   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
519   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
520   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
521   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
522   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
523   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
525524
526525   PORT_START("IN1")
527526   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
r3115r3116
538537
539538   PORT_START("IN2")
540539   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
541   PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_SPECIAL ) /* lower 2 coinage DIPs */
540   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stratgyx_coinage_r, (void *)0x01) /* lower 2 coinage DIPs */
541   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stratgyx_coinage_r, (void *)0x02) /* lower 2 coinage DIPs */
542542   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
543543   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
544544   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
r3115r3116
548548   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
549549
550550   PORT_START("IN3")
551   PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_SPECIAL ) /* upper 2 coinage DIPs */
551   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stratgyx_coinage_r, (void *)0x04) /* upper 2 coinage DIPs */
552   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stratgyx_coinage_r, (void *)0x08) /* upper 2 coinage DIPs */
552553   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )   /* none of these appear to be used */
553554   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
554555   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
588589   PORT_DIPSETTING(    0x00, "A 1/99  B 1/3" )
589590INPUT_PORTS_END
590591
591
592
593592/* cocktail mode is N/A */
594593static INPUT_PORTS_START( darkplnt )
595594   PORT_START("IN0")
r3115r3116
10281027   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
10291028INPUT_PORTS_END
10301029
1031#define MM_COMMON1\
1032   PORT_START("IN0")\
1033   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)\
1034   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )\
1035   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )\
1036   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )\
1037   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY\
1038   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY\
1039   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )\
1030static INPUT_PORTS_START( mimonkey )
1031   PORT_START("IN0")
1032   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1033   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1034   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1035   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1036   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1037   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1038   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
10401039   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
10411040
1042#define MM_COMMON2\
1043   PORT_START("IN2")\
1044   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)\
1045   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )\
1046   PORT_DIPSETTING(    0x06, DEF_STR( 3C_1C ) )\
1047   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )\
1048   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )\
1049   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )\
1050   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )\
1051   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )\
1052   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )\
1053   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY\
1054   PORT_DIPNAME( 0x20, 0x00, "Infinite Lives (Cheat)")\
1055   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )\
1056   PORT_DIPSETTING(    0x20, DEF_STR( On ) )\
1057   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY\
1058   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )   /* used, something to do with the bullets */\
1059   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )\
1060   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1061
1062static INPUT_PORTS_START( mimonkey )
1063   MM_COMMON1
1064
10651041   PORT_START("IN1")
10661042   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
10671043   PORT_DIPSETTING(    0x00, "3" )
r3115r3116
10751051   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
10761052   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
10771053
1078   MM_COMMON2
1079
1054   PORT_START("IN2")
1055   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1056   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
1057   PORT_DIPSETTING(    0x06, DEF_STR( 3C_1C ) )
1058   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
1059   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1060   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
1061   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1062   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1063   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1064   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1065   PORT_DIPNAME( 0x20, 0x00, "Infinite Lives (Cheat)")
1066   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1067   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1068   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1069   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )   /* used, something to do with the bullets */
1070   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1071   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10801072INPUT_PORTS_END
10811073
10821074/* Same as 'mimonkey' but different "Lives" Dip Switch */
10831075static INPUT_PORTS_START( mimonsco )
1084   MM_COMMON1
1076   PORT_INCLUDE( mimonkey )
10851077
1086   PORT_START("IN1")   /* IN1 */
1078   PORT_MODIFY("IN1")
10871079   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
10881080   PORT_DIPSETTING(    0x00, "1" )
10891081   PORT_DIPSETTING(    0x01, "2" )
10901082   PORT_DIPSETTING(    0x02, "3" )
10911083   PORT_DIPSETTING(    0x03, "4" )
1092   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1093   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1094   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1095   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1096   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1097   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1098
1099MM_COMMON2
11001084INPUT_PORTS_END
11011085
11021086
src/mame/drivers/stactics.c
r3115r3116
217217    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 )
218218    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
219219    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
220    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_motor_not_ready, 0)
220    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_motor_not_ready, NULL)
221221
222222    PORT_START("IN1")   /* IN1 */
223223    PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_B ) )
r3115r3116
246246    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
247247
248248    PORT_START("IN2")   /* IN2 */
249    PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_rng, 0)
250    PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_frame_count_d3, 0)
249    PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_rng, NULL)
250    PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_frame_count_d3, NULL)
251251    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
252252    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
253253    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
r3115r3116
257257
258258    PORT_START("IN3")   /* IN3 */
259259    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
260    PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_shot_standby, 0)
260    PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_shot_standby, NULL)
261261    PORT_DIPNAME( 0x04, 0x04, "Number of Barriers" )
262262    PORT_DIPSETTING(    0x04, "4" )
263263    PORT_DIPSETTING(    0x00, "6" )
r3115r3116
269269    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
270270    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
271271    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
272    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_not_shot_arrive, 0)
272    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_not_shot_arrive, NULL)
273273
274274   PORT_START("FAKE")   /* FAKE */
275275    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
src/mame/drivers/namcos11.c
r3115r3116
750750   AM_RANGE(0x1f802040, 0x1f802043) AM_WRITENOP
751751   AM_RANGE(0x1fa04000, 0x1fa0ffff) AM_READWRITE(sharedram_r, sharedram_w) AM_BASE(&namcos11_sharedram) /* shared ram */
752752   AM_RANGE(0x1fa20000, 0x1fa2ffff) AM_WRITE(keycus_w) AM_BASE(&namcos11_keycus) AM_SIZE(&namcos11_keycus_size) /* keycus */
753   AM_RANGE(0x1fa30000, 0x1fa30fff) AM_READWRITE8(at28c16_0_r, at28c16_0_w, 0x00ff00ff) /* eeprom */
753   AM_RANGE(0x1fa30000, 0x1fa30fff) AM_DEVREADWRITE8(AT28C16, "at28c16", at28c16_r, at28c16_w, 0x00ff00ff) /* eeprom */
754754   AM_RANGE(0x1fb00000, 0x1fb00003) AM_WRITENOP /* ?? */
755755   AM_RANGE(0x1fbf6000, 0x1fbf6003) AM_WRITENOP /* ?? */
756756   AM_RANGE(0x1fc00000, 0x1fffffff) AM_ROM AM_SHARE(2) AM_REGION("user1", 0) /* bios */
r3115r3116
861861   }
862862
863863   state_save_register_global( m_n_oldcoin );
864
865   at28c16_init( 0, NULL, NULL );
866864}
867865
868866static MACHINE_RESET( namcos11 )
r3115r3116
878876   MDRV_CPU_VBLANK_INT("main", namcos11_vblank)
879877
880878   MDRV_MACHINE_RESET( namcos11 )
881   MDRV_NVRAM_HANDLER( at28c16_0 )
882879
883880   /* video hardware */
884881   MDRV_SCREEN_ADD("main", RASTER)
r3115r3116
896893
897894   NAMCO_C7X_MCU_SHARED(16384000)
898895   NAMCO_C7X_SOUND(16384000)
896
897   MDRV_DEVICE_ADD( "at28c16", AT28C16 )
899898MACHINE_DRIVER_END
900899
901900static MACHINE_DRIVER_START( coh110 )
r3115r3116
11861185   ROM_LOAD16_BYTE( "dc1rom3l.ic1", 0x0c00000, 0x200000, CRC(a76bcd4c) SHA1(817abdc43158b7aaac329c3ea17782277acb36a4) )
11871186   ROM_LOAD16_BYTE( "dc1rom3u.ic9", 0x0c00001, 0x200000, CRC(1405d123) SHA1(3d7be5558358740f5a0a3a3022543cf5aca4cf24) )
11881187
1189   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1188   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
11901189   ROM_LOAD( "dc1sprog.6d",  0x0000000, 0x040000, CRC(96cd7788) SHA1(68a5a53a5fc50e2b6b684c99d27d81e3a8c56287) )
11911190   NAMCO_C7X_BIOS
11921191
r3115r3116
12121211   ROM_LOAD16_BYTE( "dm1rom1u.ic8", 0x0400001, 0x200000, CRC(01e905d3) SHA1(430b2ae0c67265b6acc8aa4dd50f6144929993f8) )
12131212   ROM_CONTINUE( 0x0400001, 0x200000 ) /* first & second half identical */
12141213
1215   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1214   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
12161215   ROM_LOAD( "dm1sprog.6d",  0x0000000, 0x040000, CRC(de1cbc78) SHA1(855ebece1841f50ae324d7d6b8b18ab6f657d28e) )
12171216   NAMCO_C7X_BIOS
12181217
r3115r3116
12381237   ROM_LOAD16_BYTE( "dm1rom1u.ic8", 0x0400001, 0x200000, CRC(01e905d3) SHA1(430b2ae0c67265b6acc8aa4dd50f6144929993f8) )
12391238   ROM_CONTINUE( 0x0400001, 0x200000 ) /* first & second half identical */
12401239
1241   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1240   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
12421241   ROM_LOAD( "dm1sprog.6d",  0x0000000, 0x040000, CRC(de1cbc78) SHA1(855ebece1841f50ae324d7d6b8b18ab6f657d28e) )
12431242   NAMCO_C7X_BIOS
12441243
r3115r3116
12571256   ROM_LOAD16_BYTE( "kqt1prg1l.ic3", 0x1000000, 0x800000, CRC(298d8eeb) SHA1(c421b1bdd5fd46c026a41e2cec47cafd1a69d33d) )
12581257   ROM_LOAD16_BYTE( "kqt1prg1u.ic6", 0x1000001, 0x800000, CRC(911783db) SHA1(1005fc9b38e212844e397150a6f98f43ad88d4b9) )
12591258
1260   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1259   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
12611260   ROM_LOAD( "kqt1sprog.7e", 0x0000000, 0x040000, CRC(bb1888a6) SHA1(4db07738079725413cdba7eb75252ee71ae50a66) )
12621261   NAMCO_C7X_BIOS
12631262
r3115r3116
12751274   ROM_LOAD16_BYTE( "pkr1rom0l.ic5", 0x000000, 0x200000, CRC(6c9b074c) SHA1(885f342bd178e4146e1f75259206f6625c0b3c18) )
12761275   ROM_LOAD16_BYTE( "pkr1rom0u.ic6", 0x000001, 0x200000, CRC(a55c0906) SHA1(3b6abfa877f88a4d96222d98af02498b0c777af6) )
12771276
1278   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1277   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
12791278   ROM_LOAD( "pkr1verb.6d",  0x000000, 0x040000, CRC(9bf08992) SHA1(fca7943f7bcf0ee758fa63fbdef8f7456b9e46cb) )
12801279   NAMCO_C7X_BIOS
12811280
r3115r3116
12991298   ROM_LOAD16_BYTE( "pg1rom1l.ic8", 0x0400001, 0x200000, CRC(59b5a71c) SHA1(ddc1f0a5488466166c21fd0c84ab2b4cf04316bf) )
13001299   ROM_CONTINUE( 0x0400001, 0x200000 ) /* first & second half identical */
13011300
1302   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1301   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
13031302   ROM_LOAD( "pg1sprog.6d",  0x0000000, 0x040000, CRC(e7c3396d) SHA1(12bbb8ebcaab1b40462a12917dd9b58bd9ab8663) )
13041303   NAMCO_C7X_BIOS
13051304
r3115r3116
13191318   ROM_LOAD16_BYTE( "gnb1prg0l.ic2", 0x000000, 0x800000, CRC(78746037) SHA1(d130ca1153a730e3c967945248f00662f9fab304) )
13201319   ROM_LOAD16_BYTE( "gnb1prg0u.ic5", 0x000001, 0x800000, CRC(697d3279) SHA1(40302780f7494d9413888b2d1da38bd14a9a444f) )
13211320
1322   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1321   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
13231322   ROM_LOAD( "gnb1vera.6d",  0x0000000, 0x040000, CRC(6461ae77) SHA1(1377b716a69ef9d4d2e48083d23f22bd5c103c00) )
13241323   NAMCO_C7X_BIOS
13251324
r3115r3116
13451344   ROM_LOAD16_BYTE( "so1rom3u.ic1", 0x0c00000, 0x200000, CRC(f11bd521) SHA1(baf936dec58cebfeef1c74f95e455b2fe74eb982) )
13461345   ROM_LOAD16_BYTE( "so1rom3l.ic9", 0x0c00001, 0x200000, CRC(84465bcc) SHA1(d8be888d41cfe194c3a1853d9146d3a74ef7bab1) )
13471346
1348   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1347   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
13491348   ROM_LOAD( "so1sprogc.6d", 0x0000000, 0x040000, CRC(2bbc118c) SHA1(4168a9aa525f1f0ce6cf6e14cfe4c118c4c0d773) )
13501349   NAMCO_C7X_BIOS
13511350
r3115r3116
13711370   ROM_LOAD16_BYTE( "so1rom3u.ic1", 0x0c00000, 0x200000, CRC(f11bd521) SHA1(baf936dec58cebfeef1c74f95e455b2fe74eb982) )
13721371   ROM_LOAD16_BYTE( "so1rom3l.ic9", 0x0c00001, 0x200000, CRC(84465bcc) SHA1(d8be888d41cfe194c3a1853d9146d3a74ef7bab1) )
13731372
1374   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1373   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
13751374   ROM_LOAD( "so1sprogc.6d", 0x0000000, 0x040000, CRC(2bbc118c) SHA1(4168a9aa525f1f0ce6cf6e14cfe4c118c4c0d773) )
13761375   NAMCO_C7X_BIOS
13771376
r3115r3116
13971396   ROM_LOAD16_BYTE( "so1rom3u.ic1", 0x0c00000, 0x200000, CRC(f11bd521) SHA1(baf936dec58cebfeef1c74f95e455b2fe74eb982) )
13981397   ROM_LOAD16_BYTE( "so1rom3l.ic9", 0x0c00001, 0x200000, CRC(84465bcc) SHA1(d8be888d41cfe194c3a1853d9146d3a74ef7bab1) )
13991398
1400   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1399   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
14011400   ROM_LOAD( "so1sprog.6d",  0x0000000, 0x040000, CRC(f6f682b7) SHA1(a64e19be3f6e630b8c34f34b46b95aadfabd3f63) )
14021401   NAMCO_C7X_BIOS
14031402
r3115r3116
14221421   ROM_LOAD16_BYTE( "so1rom3u.ic1", 0x0c00000, 0x200000, CRC(f11bd521) SHA1(baf936dec58cebfeef1c74f95e455b2fe74eb982) )
14231422   ROM_LOAD16_BYTE( "so1rom3l.ic9", 0x0c00001, 0x200000, CRC(84465bcc) SHA1(d8be888d41cfe194c3a1853d9146d3a74ef7bab1) )
14241423
1425   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1424   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
14261425   ROM_LOAD( "so1sprog.6d",  0x0000000, 0x040000, CRC(f6f682b7) SHA1(a64e19be3f6e630b8c34f34b46b95aadfabd3f63) )
14271426   NAMCO_C7X_BIOS
14281427
r3115r3116
14381437
14391438   ROM_REGION32_LE( 0x0100000, "user2", ROMREGION_ERASE00 ) /* main data */
14401439
1441   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1440   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
14421441   ROM_LOAD( "stp1sprog.7e", 0x0000000, 0x040000, CRC(08aaaf6a) SHA1(51c913a39ff7c154aef8bb10139cc8b92eb4756a) )
14431442   NAMCO_C7X_BIOS
14441443
r3115r3116
14621461   ROM_LOAD16_BYTE( "te1rom2l.ic4", 0x0800000, 0x200000, CRC(41d77846) SHA1(eeab049135c02a255899fe37e225c1111b2fbb7d) )
14631462   ROM_LOAD16_BYTE( "te1rom2u.ic7", 0x0800001, 0x200000, CRC(a678987e) SHA1(c62c00ce5cf4d001723c999b2bc3dbb90283def1) )
14641463
1465   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1464   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
14661465   ROM_LOAD( "te1sprog.6d",  0x0000000, 0x040000, CRC(849587e9) SHA1(94c6a757b24758a866a41bd8acd46aa46844f74b) )
14671466   NAMCO_C7X_BIOS
14681467
r3115r3116
14851484   ROM_LOAD16_BYTE( "te1rom2l.ic4", 0x0800000, 0x200000, CRC(41d77846) SHA1(eeab049135c02a255899fe37e225c1111b2fbb7d) )
14861485   ROM_LOAD16_BYTE( "te1rom2u.ic7", 0x0800001, 0x200000, CRC(a678987e) SHA1(c62c00ce5cf4d001723c999b2bc3dbb90283def1) )
14871486
1488   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1487   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
14891488   ROM_LOAD( "te1sprog.6d",  0x0000000, 0x040000, CRC(849587e9) SHA1(94c6a757b24758a866a41bd8acd46aa46844f74b) )
14901489   NAMCO_C7X_BIOS
14911490
r3115r3116
15081507   ROM_LOAD16_BYTE( "te1rom2l.ic4", 0x0800000, 0x200000, CRC(41d77846) SHA1(eeab049135c02a255899fe37e225c1111b2fbb7d) )
15091508   ROM_LOAD16_BYTE( "te1rom2u.ic7", 0x0800001, 0x200000, CRC(a678987e) SHA1(c62c00ce5cf4d001723c999b2bc3dbb90283def1) )
15101509
1511   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1510   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
15121511   ROM_LOAD( "te1sprog.6d",  0x0000000, 0x040000, CRC(849587e9) SHA1(94c6a757b24758a866a41bd8acd46aa46844f74b) )
15131512   NAMCO_C7X_BIOS
15141513
r3115r3116
15311530   ROM_LOAD16_BYTE( "te1rom2l.ic4", 0x0800000, 0x200000, CRC(41d77846) SHA1(eeab049135c02a255899fe37e225c1111b2fbb7d) )
15321531   ROM_LOAD16_BYTE( "te1rom2u.ic7", 0x0800001, 0x200000, CRC(a678987e) SHA1(c62c00ce5cf4d001723c999b2bc3dbb90283def1) )
15331532
1534   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1533   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
15351534   ROM_LOAD( "te1sprog.6d",  0x0000000, 0x040000, CRC(849587e9) SHA1(94c6a757b24758a866a41bd8acd46aa46844f74b) )
15361535   NAMCO_C7X_BIOS
15371536
r3115r3116
15561555   ROM_LOAD16_BYTE( "tes1rom3l.ic9", 0x0c00000, 0x200000, CRC(d5ac0f18) SHA1(342d063f7974bd1f90b5ca4832dfa4fbc9605453) )
15571556   ROM_LOAD16_BYTE( "tes1rom3u.ic1", 0x0c00001, 0x200000, CRC(44ed509d) SHA1(27e26aaf5ce72ab686f3f05743b1d91b5334b4e0) )
15581557
1559   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1558   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
15601559   ROM_LOAD( "tes1sprog.6d", 0x0000000, 0x040000, CRC(af18759f) SHA1(aabd7d1384925781d37f860605a5d4622e0fc2e4) )
15611560   NAMCO_C7X_BIOS
15621561
r3115r3116
15811580   ROM_LOAD16_BYTE( "tes1rom3l.ic9", 0x0c00000, 0x200000, CRC(d5ac0f18) SHA1(342d063f7974bd1f90b5ca4832dfa4fbc9605453) )
15821581   ROM_LOAD16_BYTE( "tes1rom3u.ic1", 0x0c00001, 0x200000, CRC(44ed509d) SHA1(27e26aaf5ce72ab686f3f05743b1d91b5334b4e0) )
15831582
1584   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1583   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
15851584   ROM_LOAD( "tes1sprog.6d", 0x0000000, 0x040000, CRC(af18759f) SHA1(aabd7d1384925781d37f860605a5d4622e0fc2e4) )
15861585   NAMCO_C7X_BIOS
15871586
r3115r3116
16061605   ROM_LOAD16_BYTE( "tes1rom3l.ic9", 0x0c00000, 0x200000, CRC(d5ac0f18) SHA1(342d063f7974bd1f90b5ca4832dfa4fbc9605453) )
16071606   ROM_LOAD16_BYTE( "tes1rom3u.ic1", 0x0c00001, 0x200000, CRC(44ed509d) SHA1(27e26aaf5ce72ab686f3f05743b1d91b5334b4e0) )
16081607
1609   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1608   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
16101609   ROM_LOAD( "tes1sprog.6d", 0x0000000, 0x040000, CRC(af18759f) SHA1(aabd7d1384925781d37f860605a5d4622e0fc2e4) )
16111610   NAMCO_C7X_BIOS
16121611
r3115r3116
16291628   ROM_LOAD16_BYTE( "xv31rom2l.ic4", 0x0800000, 0x200000, CRC(8403a277) SHA1(35193211351494a086d8422e3b0b71a8d3a262a6) )
16301629   ROM_LOAD16_BYTE( "xv31rom2u.ic7", 0x0800001, 0x200000, CRC(ecf70432) SHA1(bec128a215e0aef66e9a8707bb0d1eb7b098a356) )
16311630
1632   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1631   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
16331632   ROM_LOAD( "xv31sprog.6d", 0x0000000, 0x040000, CRC(e50b856a) SHA1(631da4f60c9ce08387fca26a70481a2fdacf9765) )
16341633   NAMCO_C7X_BIOS
16351634
src/mame/drivers/itech8.c
r3115r3116
554554   /* handle the 68000 case */
555555   else
556556   {
557      int level = 0;
558
559      /* determine which level is active */
560      if (blitter_int) level = 2;
561      if (periodic_int) level = 3;
562
563      /* update it */
564      if (level)
565         cpunum_set_input_line(machine, 0, level, ASSERT_LINE);
566      else
567         cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
557      cpunum_set_input_line(machine, 0, 2, blitter_int ? ASSERT_LINE : CLEAR_LINE);
558      cpunum_set_input_line(machine, 0, 3, periodic_int ? ASSERT_LINE : CLEAR_LINE);
568559   }
569560}
570561
src/mame/drivers/othldrby.c
r3115r3116
102102   AM_RANGE(0x400000, 0x400fff) AM_READ(SMH_RAM)
103103   AM_RANGE(0x600000, 0x600001) AM_READ(okim6295_status_0_lsb_r)
104104   AM_RANGE(0x700000, 0x700001) AM_READ(pap)   // scanline???
105   AM_RANGE(0x700004, 0x700005) AM_READ(input_port_0_word_r)
106   AM_RANGE(0x700008, 0x700009) AM_READ(input_port_1_word_r)
107   AM_RANGE(0x70000c, 0x70000d) AM_READ(input_port_2_word_r)
108   AM_RANGE(0x700010, 0x700011) AM_READ(input_port_3_word_r)
109   AM_RANGE(0x70001c, 0x70001d) AM_READ(input_port_4_word_r)
105   AM_RANGE(0x700004, 0x700005) AM_READ_PORT("DSW1")
106   AM_RANGE(0x700008, 0x700009) AM_READ_PORT("DSW2")
107   AM_RANGE(0x70000c, 0x70000d) AM_READ_PORT("P1")
108   AM_RANGE(0x700010, 0x700011) AM_READ_PORT("P2")
109   AM_RANGE(0x70001c, 0x70001d) AM_READ_PORT("SYSTEM")
110110ADDRESS_MAP_END
111111
112112static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 16 )
src/mame/drivers/snk.c
r3115r3116
11/*
2
23snk.c
4
35various SNK triple Z80 games
46
5Known Issues:
6- consolidate gfx decode/drivers, if possible
7- emulate protection (get rid of patches)
7ay8910x2 + namco wave
8Jumping Cross
89
9Bryan McPhail, 27/01/00:
10ay8910x2
11Gladiator 1984
1012
11  Fixed Gwar, Gwarj, both working properly now.
12  Renamed Gwarjp to Gwarj.
13  Added Gwara
14  Removed strcmp(drv->names) :)
15  Made Gwara (the new clone) the main set, and old gwar to gwara.  This is
16  because (what is now) gwara seemingly has a different graphics board.  Fix
17  chars and scroll registers are in different locations, while gwar (new)
18  matches the bootleg and original japanese versions.
13ym3526
14ASO, Tank
1915
20  Added Bermuda Triangle (alternate), World Wars, these are the 'early'
21  versions of the main set with different sprites, gameplay etc.  All roms
22  are different except for the samples, technically Bermuda Triangle (Alt)
23  is a clone of World Wars rather than the main Bermuda set.
16ym3526x2
17Athena, Ikari
2418
25  Bermuda Triangle (alt) has some tile banking problems (see attract mode),
26  this may also be the cause of the title screen corruption in Bermuda
27  Triangle (main set).
19ym3526 + y8950
20Victory Road, Psycho Soldier, Bermuda Triangle, Touchdown Fever, Guerrilla War
2821
22ym3812 + y8950
23Chopper1
2924
30Oct. 5, 2003:
25ym3812
26Fighting Golf
3127
32  Added tdfever2, all ROMs are replacements for those in tdfever except
33  td22.6l, td21.6k, and td20.8k. td20.8k is the reason the new gfx code
34  is needed. Though the gfx appear strange on the vs. screens / choose
35  number of players screens eg. the numbers aren't in the boxes, they're
36  in the lower right corners, and there is no background color like
37  there is in tdfever, this is not a bug, we have confirmed it to be
38  correct against my pcb.
28y8950
29Fighting Soccer
3930
4031
41Stephh's notes (based on the games Z80 code and some tests) :
32Credits (in alphabetical order)
33    Marco Cassili
34    Ernesto Corvi
35    Carlos A. Lozano
36    Bryan McPhail
37    Jarek Parchanski
38    Nicola Salmoria
39    Tomasz Slanina
40    Phil Stroffolino
41    Acho A. Tang
42    Victor Trucco
4243
431)  'fsoccerb'
4444
45  - The code to support the rotary jotsticks has been removed and/or patched
46    in this version (check the 'jmp' instruction at 0x00f1).
47    I'm SURE that I've played a version in France with the rotary joysticks,
48    and IMO it isn't dumped at the moment 8(
45Notes:
46------
47- How to enter test mode:
48  1984 jcross: n/a
49  1984 sgladiat: keep F2 pressed during boot
50  1985 tnk3: keep 1 pressed during boot
51  1985 aso: keep 1 pressed during boot
52  1986 athena: keep 1 pressed during boot
53  1986 ikari: keep 1 pressed during boot
54  1986 victroad: keep 1 pressed during boot
55  1987 bermudat: keep 1 pressed during boot
56  1987 worldwar: keep F2 pressed during boot
57  1987 gwar: keep F2 pressed during boot
58  1987 psychos: use the service mode dip switch
59  1987 tdfever: keep F2 pressed during boot
60  1988 tdfever2: keep F2 pressed during boot
61  1988 chopper: keep F2 pressed during boot
62  1988 fsoccer: use the service mode dip switch
63  1988 fitegolf: use the service mode dip switch
4964
50  - DEF_STR( Game_Time ) Dip Switch is the time for match type A. Here is what you
51    have to add for games B to E :
65- the I/O area (C000-CFFF) is probably mirrored in large part on the two main
66  CPUs, however I mapped only the addresses actually used by the games.
5267
53      Match Type       B        C        D        E
54      Time to add    00:30    01:00    01:30    02:00
68- sgladiat runs on a modified jcross pcb (same pcb ID with flying wires).
5569
56  - When "Game Mode" Dip Switch is set to "Win Match Against CPU", this has an
57    effect on matches types A and B : player is awarded 99 goals at the end of
58    the round, which is enough to win all matches then see the ending credits.
70- the original sgladiat pcb is verified to have huge sprite lag.
5971
60  - Here are the buttons mapped to start a game :
61      * IPT_START1    : starts game A
62      * IPT_START2    : starts game B
63      * IPT_START3    : starts game C
64      * IPT_START4    : starts game D
65      * IPT_SERVICE2  : starts game E
72- RAM test fails in sgladiat when "Debug" Dip Switch is ON. Correct behaviour ?
6673
74- there are two versions of the Ikari Warriors board, one has the standard JAMMA
75  connector while the other has the custom SNK connector. The video and audio
76  PCBs are the same, only the CPU PCB changes.
6777
682a) 'bermudat'
78- gwara seemingly has a different video board. Fix chars and scroll registers are
79  in different locations, while gwar (new) matches the bootleg and original
80  japanese versions.
6981
70  - Japan version (5 letters when entering initials, and "TOKYO" as default names)
82- there has been great confusion in the past about the four Bermuda Triangle /
83  World Wars sets. World Wars was thought to be an earlier version, since it
84  appears to have simpler gameplay and graphics. In reality, there is strong
85  evidence that proves that World Wars is a follow-up to Bermuda Triangle.
86  The gameplay is significantly different, and the only ROMs in common are the
87  audio samples, so it cannot be considered a simple clone, even if bermudaa
88  has the worldwar gameplay and the bermudat title screen!! What might have
89  happened is that bermudat performed poorly in Japan/world arcades so it was
90  redesigned before releasing it in the US/different parts of the world.
91  Possibly the Bermuda Triangle title screen was kept for the US since it
92  hand't been relased there yet, while it was changed to World Wars for places
93  where it had already been released.
7194
72  - How to enter the "test mode" : while "front turbo check" is displayed on screen,
73    press '1' (start player 1) until a grid is displayed. You can then press '1'
74    to go to the next part or press '2' to reset the game.
95  The most compelling pieces of evidence to indicate which sets are newer are
96  the following:
97  - to enter test mode, bermudat/bermudaj use P1 start (old style: older games
98    from tnk3 to victroad do it). worldwar/bermudaa use a dedicated service
99    button (new style: newer games like gwar do it).
100  - some of the tiles in the fg ROM (letters saying "standard", "power",
101    "hyper", "safety", "danger") are present in all sets, but are actually used
102    only in bermudat/bermudaj.
103  - the worldwar test mode shows wrong descriptions for the dip switches, which
104    are actually correct for bermudaj.
75105
76  - The typo bug from 'bermudao' "test mode" is fixed.
106  So in the end the cronology of the four sets is:
107  1) bermudat
108  - Old gameplay
109  - World version? (English speech)
110  - 5 letters when entering initials, and "TOKYO" as default names
111  - Test mode accessed using P1 start
112  - There is bug in test mode: when the "Bonus Life" dip switches are set to
113    "60k 120k", it shows "80000P 160000P".
114  2) bermudaj
115  - Old gameplay
116  - Definitely Japan version (Japanese speech)
117  - 5 letters when entering initials, and "TOKYO" as default names
118  - Test mode accessed using P1 start
119  - The test mode bug is fixed.
120  3) worldwar
121  - New gameplay
122  - World version?
123  - 5 letters when entering initials, and "WORLD" as default names
124  - Test mode accessed using dedicated service button
125  - Dip switches description in test mode are wrong: they are the same as
126    bermudaj, even if the actual behaviour has changed.
127  4) bermudaa
128  - New gameplay
129  - US version
130  - 3 letters when entering initials, and "SNK  " as default names
131  - Test mode accessed using dedicated service button
132  - Dip switches descriptions updated.
77133
134- ikari/victroad do a "front hard check" during boot. This appears to be
135  hardware bounds checking test which is also used during the game.
136  However the game also does software collision detection, because making
137  the test always return true is enough to make the game work.
78138
792b) 'bermudao'
139- bermudat/bermudaj do a "turbo front check" during boot, which is missing in
140  bermudaa/worldwar. Perhaps they realised that as a protection device it was
141  useless since the game doesn't use the hardware after the check.
80142
81  - Japan version (5 letters when entering initials, and "TOKYO" as default names)
143- tdfever2: though the gfx appear strange on the vs. screens / choose number of
144  players screens eg. the numbers aren't in the boxes, they're in the lower
145  right corners, and there is no background color like there is in tdfever, this
146  is not a bug, it is confirmed to be correct against the pcb.
82147
83  - How to enter the "test mode" : while "front turbo check" is displayed on screen,
84    press '1' (start player 1) until a grid is displayed. You can then press '1'
85    to go to the next part or press '2' to reset the game.
148- the gwarb bootleg has two Y8950 instead of YM3526+Y8950. However, the sound
149  program ROM is identical to gwar, so the replacement Y8950 is definitely used
150  only in its YM3526 compatible part, without using its additional ADPCM
151  capabilities. It should be noted that the gwara sound program has a small
152  patch that apparently would set two extra bits in register 04 which should
153  only exist in the Y8950, not in the YM3526.
86154
87  - There is typo bug in the "test mode" : when "Bonus Life" Dip Switch is set to
88    "60k 120k", it is written "80000P  160000P every".
155- while tdfever2 does write to the addresses where the YM3526 is mapped in
156  tdfever, those seem to be bogus writes since it causes sound to malfunction
157  (a continuous scale is played by the Y8950). Taking the YM3526 out appears to
158  fix the problem since all game sounds are apparently played by the Y8950 alone.
89159
90160
912c) 'bermudaa'
161TODO:
162-----
92163
93  - US version (3 letters when entering initials, and "SNK  " as default names)
164- jcross might be a bad dump. The current ROM set is made by mixing two sets
165  which were marked as 'bad'.
94166
95  - How to enter the "test mode" : reset the game and press F2 until is a grid is
96    displayed. You can then press F2 again to go to the next part.
167- jcross: only the first bank of the fg charset is used. The second bank is
168  almost identical apart from a few characters. Should it be used? When?
97169
170- sgladiat: unknown writes to D200/DA00, probably video related. Also some bits
171  of A600 are unknown.
98172
992d) 'worldwar'
173- ASO: unknown writes to CE00, probably video related. Always 05?
174  Also unknown writes to F002 by the sound CPU, during reset.
100175
101  - World version (5 letters when entering initials, and "WORLD" as default names)
102    And this had been confirmed by the guy who loant the PCB.
176- Fighting Golf: unknown writes to CF00, probably video related.
103177
104  - How to enter the "test mode" : reset the game and press F2 until is a grid is
105    displayed. You can then press F2 again to go to the next part.
178- The Fighting Golf flyer shows a different gameplay, where button A is pressed
179  multiple times to select the spin. The flyer also says that the game "includes
180  the unique feature of 2 distinct styles of game play, selectable by dipswitch
181  setting. For the avid golfer, a more challenging style of swing.".
182  Either a different ROM set exists, or we are missing some configuration option.
106183
107  - Don't trust the "test mode" for the Dip Switches ! The infos which are
108    displayed are the one from 'bermudao' (see what the "unknown" Dip Switches do).
184- ikari/victroad: unknown writes to C980. This is probably (also) related to the
185  color used to draw the FG layer, and supporting it is needed to fix the color
186  test in ikaria/ikarijp.
109187
188- gwar: unknown writes to CA00/CA40. Always 0?
110189
111AT042903:
112 - fixed Psycho Soldier lyrics tempo
113 - fixed char layer alignment in Fighting Golf, Athena and TNK3
114 - cleaned garbage tiles in Bermuda Triangle and improved sprite priority
115 - corrected tile ROM loading in Bermuda(alt)/Worldwar
116 - corrected sound ROM loading and palette in Touchdown Fever
117 - various sprite adjustments from MAME32 plus
190- tdfever/fsoccer: the dots in the radar flicker. In fsoccer, this is greatly
191  improved by forcing partial screen updates when the sprite RAM is changed (see
192  snk68.c for another game that needs this). tdfever dots still flicker a lot,
193  however I'm not sure if this is an emulation bug or the real game behaviour.
118194
119AT08XX03:
120 - revamped CPU handshaking, improved clipping and made changes public to
121   marvins.c, hal21.c and sgladiat.c
122 - fixed shadows in tnk3, athena, fitegolf, countryc,
123 and fsoccer
124 - added highlights to tdfever and fsoccer(needs masking at team selection)
125 - notes:
195- psychos: in all games using the gwar video, palette colors 0x180-0x1ff are not
196  used because bit 3 of the sprite attribute is used for tile bank select instead.
197  In all games, those colors 0x180-0x1ff are a copy of 0x100-0x17f so even if the
198  bit was wired to the palette, it would make no difference. In psychos, however,
199  the colors are different. Game colors appear to be correct as they are, and
200  connecting bit 3 would break them, so it's unknown if colors 0x180-0x1ff should
201  be used and how.
126202
127    Mad Crasher and Gladiator(sgladiat.c) have different memory maps but
128    their code base and port layouts are quite similar. The following are
129    some distinctive designs of these two games common to many other SNK
130    triple Z80 boards made in the mid-80's.
203***************************************************************************/
131204
132    1) Shared RAM
205#include "driver.h"
206#include "snk.h"
207#include "sound/ay8910.h"
208#include "sound/namco.h"
209#include "sound/3812intf.h"
133210
134        The "shared" RAM in Mad Crasher is more appropriately
135        "switched" RAM. Marvin's schematics indicate selector
136        circuits and when a CPU wants to access specific part of
137        the memory it will write to the first byte of the 4k page
138        and give the selector a few cycles to settle.
139211
140        It is not known what exactly happens when more than one CPU
141        try to access the same page.
212static int countryc_trackball;
142213
143    2) IRQ
214// FIXME this should be initialised on machine reset
215static int sound_status;
144216
145        CPUA starts recalculating game logic and constructing
146        sprites for the next frame upon receiving IRQ0. When CPUB
147        receives its own IRQ0 it copies sprite data prepared by
148        CPUA in the previous frame to VRAM and updates scroll
149        registers. The process takes about 2ms which fits in vblank
150        nicely. However, if CPUA modifies sprite data before
151        blitting is complete sprites for the current frame may get
152        overwritten by those for the next and it creates a funny
153        rubber-band effect.
217/*********************************************************************/
218// Interrupt Handlers Common to All SNK Triple Z80 Games
154219
155        In essence CPUA's IRQ0 should fire 1-2ms later than CPUB's
156        to maintain visual stability. Increasing the delay will only
157        waste cycles in idle loops. Note that certain games may have
158        CPUA and B switched roles.
220READ8_HANDLER ( snk_cpuA_nmi_trigger_r )
221{
222   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE);
223   return 0;
224}
159225
160    3) NMI
226WRITE8_HANDLER( snk_cpuA_nmi_ack_w )
227{
228   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE);
229}
161230
162        CPUA and B handshake through NMIs. They were implemented in
163        all SNK triple Z80 drivers as
231READ8_HANDLER ( snk_cpuB_nmi_trigger_r )
232{
233   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE);
234   return 0;
235}
164236
165            ENABLE->SIGNAL->HOLDUP->MAKEUP->ACKNOWLEDGE
237WRITE8_HANDLER( snk_cpuB_nmi_ack_w )
238{
239   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
240}
166241
167        but upon close examination of the games code no evidence of
168        any game relying on this behavior to function correctly was
169        found. Sometimes it even has adverse effects by triggering
170        extra NMI's therefore handshaking has been reduced to basic
242/*********************************************************************/
171243
172            SIGNAL->ACKNOWLEDGE
244enum
245{
246   YM1IRQ_ASSERT,
247   YM1IRQ_CLEAR,
248   YM2IRQ_ASSERT,
249   YM2IRQ_CLEAR,
250   CMDIRQ_BUSY_ASSERT,
251   BUSY_CLEAR,
252   CMDIRQ_CLEAR
253};
173254
174    4) Sound Latching
175255
176        Each game has a byte-size sound command port being
177        represented by Marvin's scheme as a single unit consists
178        of one flip-flop and two latches. The flip-flop may be
179        responsible for the sound busy flag but the second latch's
180        function is unclear. HAL21 seems to have the most complex
181        soundlatch circuit and the hardware is able to report
182        playback status in six different bits.
256static TIMER_CALLBACK( sgladiat_sndirq_update_callback )
257{
258   switch(param)
259   {
260      case CMDIRQ_BUSY_ASSERT:
261         sound_status |= 8|4;
262         break;
183263
184        The sound busy flag is raised when CPUA writes to the
185        soundlatch and is lowered when a designated port is read.
186        For games based on Marvin's hardware the designated port is
187        the soundlatch itself. Most games clear the flag within the
188        alerting IRQ autonomously but some like ASO and HAL21 do it
189        shortly after the sound CPU has finished modulating an effect.
264      case BUSY_CLEAR:
265         sound_status &= ~4;
266         break;
190267
191****************************************************************************
268      case CMDIRQ_CLEAR:
269         sound_status &= ~8;
270         break;
271   }
192272
193ym3526
194Aso, Tank
273   cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, (sound_status & 0x8) ? ASSERT_LINE : CLEAR_LINE);
274}
195275
196ym3526x2
197Athena, Ikari, Fighting Golf
198276
199ym3526 + y8950
200Victory Road, Psycho Soldier, Bermuda Triangle, Touchdown Fever, Guerilla War
277static WRITE8_HANDLER( sgladiat_soundlatch_w )
278{
279   soundlatch_w(machine, offset, data);
280   timer_call_after_resynch(NULL, CMDIRQ_BUSY_ASSERT, sgladiat_sndirq_update_callback);
281}
201282
202ym3812 + y8950
203Legofair, Chopper1
283static READ8_HANDLER( sgladiat_soundlatch_r )
284{
285   timer_call_after_resynch(NULL, BUSY_CLEAR, sgladiat_sndirq_update_callback);
286   return soundlatch_r(machine,0);
287}
204288
205y8950
206Fighting Soccer
289static READ8_HANDLER( sgladiat_sound_nmi_ack_r )
290{
291   timer_call_after_resynch(NULL, CMDIRQ_CLEAR, sgladiat_sndirq_update_callback);
292   return 0xff;
293}
207294
208Credits (in alphabetical order)
209    Ernesto Corvi
210    Carlos A. Lozano
211    Jarek Parchanski
212    Phil Stroffolino (pjstroff@hotmail.com)
213    Victor Trucco
214    Marco Cassili
295static READ8_HANDLER( sgladiat_sound_irq_ack_r )
296{
297   cpunum_set_input_line(machine, 2, 0, CLEAR_LINE);
298   return 0xff;
299}
215300
216***************************************************************************/
217301
218#include "driver.h"
219#include "deprecat.h"
220#include "cpu/z80/z80.h"
221#include "snk.h"
222#include "sound/3812intf.h"
302/*********************************************************************/
223303
304
305/*
306    All the later games (from athena onwards) have the same sound status flag handling.
307
308    This 4 bit register is mapped at 0xf800.
309
310    Writes to this register always contain 0x0f in the lower nibble.
311    The upper nibble contains a mask, which clears bits
312
313    bit 0:  irq request from first YM chip
314    bit 1:  irq request from second YM chip
315    bit 2:  sound cpu busy
316    bit 3:  sound command pending
317
318    The main CPU can read the busy flag using an input port.
319
320    The earlier games are different. E.g. in tnk3 there are only three status
321    bits since there is only one YM chip, and the bits are cleared using
322    separate memory addresses. Additionally, clearing the cmd irq also
323    clears the sound latch.
324*/
325
224326/*********************************************************************/
225// Variables and Interrupt Handlers Common to All SNK Triple Z80 Games
226327
227int snk_gamegroup = 0;
228int snk_sound_busy_bit = 0;
229int snk_irq_delay = 1500;
230static int use_input_cp_hack = 0;
328static TIMER_CALLBACK( sndirq_update_callback )
329{
330   switch(param)
331   {
332      case YM1IRQ_ASSERT:
333         sound_status |= 1;
334         break;
231335
232static const UINT32 dial_8_gray[8]   = { 0x0a,0x08,0x0c,0x04,0x05,0x01,0x03,0x0f };
336      case YM1IRQ_CLEAR:
337         sound_status &= ~1;
338         break;
233339
234// see IRQ notes in drivers\marvins.c
235static TIMER_CALLBACK( irq_trigger_callback ) { cpunum_set_input_line(machine, param, 0, HOLD_LINE); }
340      case YM2IRQ_ASSERT:
341         sound_status |= 2;
342         break;
236343
237INTERRUPT_GEN( snk_irq_AB )
344      case YM2IRQ_CLEAR:
345         sound_status &= ~2;
346         break;
347
348      case CMDIRQ_BUSY_ASSERT:
349         sound_status |= 8|4;
350         break;
351
352      case BUSY_CLEAR:
353         sound_status &= ~4;
354         break;
355
356      case CMDIRQ_CLEAR:
357         sound_status &= ~8;
358         break;
359   }
360
361   cpunum_set_input_line(machine, 2, 0, (sound_status & 0xb) ? ASSERT_LINE : CLEAR_LINE);
362}
363
364
365
366static const namco_interface snkwave_interface =
238367{
239   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
240   timer_set(ATTOTIME_IN_USEC(snk_irq_delay), NULL, 1, irq_trigger_callback);
368   1,
369   0               /* stereo */
370};
371
372
373static void ymirq_callback_1(running_machine *machine, int irq)
374{
375   if (irq)
376      timer_call_after_resynch(NULL, YM1IRQ_ASSERT, sndirq_update_callback);
241377}
242378
243INTERRUPT_GEN( snk_irq_BA )
379static void ymirq_callback_2(running_machine *machine, int irq)
244380{
245   cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
246   timer_set(ATTOTIME_IN_USEC(snk_irq_delay), NULL, 0, irq_trigger_callback);
381   if (irq)
382      timer_call_after_resynch(NULL, YM2IRQ_ASSERT, sndirq_update_callback);
247383}
248384
249// NMI handshakes between CPUs are determined to be much simpler
250READ8_HANDLER ( snk_cpuA_nmi_trigger_r ) { cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); return 0; }
251WRITE8_HANDLER( snk_cpuA_nmi_ack_w ) { cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, CLEAR_LINE); }
252385
253READ8_HANDLER ( snk_cpuB_nmi_trigger_r ) { cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, ASSERT_LINE); return 0; }
254WRITE8_HANDLER( snk_cpuB_nmi_ack_w ) { cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE); }
386static const ym3526_interface ym3526_config_1 =
387{
388   ymirq_callback_1
389};
255390
256/*********************************************************************/
391static const ym3526_interface ym3526_config_2 =
392{
393   ymirq_callback_2
394};
257395
258#define SNK_MAX_INPUT_PORTS 13
396static const ym3812_interface ym3812_config_1 =
397{
398   ymirq_callback_1
399};
259400
260typedef enum {
261   SNK_UNUSED,
262   SNK_INP0,
263   SNK_INP1,SNK_INP2,SNK_INP3,SNK_INP4,
264   SNK_INP5,SNK_INP6,SNK_INP7,SNK_INP8,
265   SNK_DSW1,SNK_DSW2,SNK_INP9,
266   SNK_ROT_PLAYER1, SNK_ROT_PLAYER2
267} SNK_INPUT_PORT_TYPE;
401static const y8950_interface y8950_config_2 =
402{
403   ymirq_callback_2
404};
268405
269UINT8 *snk_rambase;
270static UINT8 *io_ram;
271static const SNK_INPUT_PORT_TYPE *snk_io; /* input port configuration */
272406
273static int hard_flags;
274407
275/*********************************************************************/
408static WRITE8_HANDLER( snk_soundlatch_w )
409{
410   soundlatch_w(machine, offset, data);
411   timer_call_after_resynch(NULL, CMDIRQ_BUSY_ASSERT, sndirq_update_callback);
412}
276413
277/*
278    This 4 bit register is mapped at 0xf800.
414static CUSTOM_INPUT( snk_sound_busy )
415{
416   return (sound_status & 4) ? 1 : 0;
417}
279418
280    Writes to this register always contain 0x0f in the lower nibble.
281    The upper nibble contains a mask, which clears bits
282419
283    bit 0:  set by YM3526/YM3812 callback?
284    bit 1:  set by Y8950 callback?
285    bit 2:  sound cpu busy
286    bit 3:  sound command pending
287*/
288static int snk_sound_register;
289420
290/*********************************************************************/
421static READ8_HANDLER( snk_sound_status_r )
422{
423   return sound_status;
424}
291425
426static WRITE8_HANDLER( snk_sound_status_w )
427{
428   if (~data & 0x10)   // ack YM1 irq
429      timer_call_after_resynch(NULL, YM1IRQ_CLEAR, sndirq_update_callback);
292430
293static int snk_rot( running_machine *machine, int which )
431   if (~data & 0x20)   // ack YM2 irq
432      timer_call_after_resynch(NULL, YM2IRQ_CLEAR, sndirq_update_callback);
433
434   if (~data & 0x40)   // clear busy flag
435      timer_call_after_resynch(NULL, BUSY_CLEAR, sndirq_update_callback);
436
437   if (~data & 0x80)   // ack command from main cpu
438      timer_call_after_resynch(NULL, CMDIRQ_CLEAR, sndirq_update_callback);
439}
440
441
442
443static READ8_HANDLER( tnk3_cmdirq_ack_r )
294444{
445   timer_call_after_resynch(NULL, CMDIRQ_CLEAR, sndirq_update_callback);
446   return 0xff;
447}
448
449static READ8_HANDLER( tnk3_ymirq_ack_r )
450{
451   timer_call_after_resynch(NULL, YM1IRQ_CLEAR, sndirq_update_callback);
452   return 0xff;
453}
454
455static READ8_HANDLER( tnk3_busy_clear_r )
456{
457   // it's uncertain whether the latch should be cleared here or when it's read
458   soundlatch_clear_w(machine, 0, 0);
459   timer_call_after_resynch(NULL, BUSY_CLEAR, sndirq_update_callback);
460   return 0xff;
461}
462
463
464
465/*****************************************************************************
466
467"Hard Flags" simulation
468
469Apparently this is just a hardware bounds checking test.
470
471The details might be slightly wrong, however this implementation passes the
472startup checks, and is good enough to make collision detection work in the
473game, so it cannot be far from correct (e.g. inverting the bit order in
474hardflags_check8 will make collision detection not work).
475
476In particular, the hf_size handling might be wrong.
477
478A trojan could be used on the board to verify the exact behaviour.
479
480*****************************************************************************/
481
482static int hf_posy, hf_posx;
483
484static WRITE8_HANDLER( hardflags_scrollx_w )
485{
486   hf_posx = (hf_posx & ~0xff) | data;
487}
488
489static WRITE8_HANDLER( hardflags_scrolly_w )
490{
491   hf_posy = (hf_posy & ~0xff) | data;
492}
493
494static WRITE8_HANDLER( hardflags_scroll_msb_w )
495{
496   hf_posx = (hf_posx & 0xff) | ((data & 0x80) << 1);
497   hf_posy = (hf_posy & 0xff) | ((data & 0x40) << 2);
498
499   // low 6 bits might indicate radius, but it's not clear
500}
501
502static int hardflags_check(int num)
503{
504   const UINT8 *sr = &spriteram[0x800 + 4*num];
505   int x = sr[2] + ((sr[3] & 0x80) << 1);
506   int y = sr[0] + ((sr[3] & 0x10) << 4);
507
508   int dx = (x - hf_posx) & 0x1ff;
509   int dy = (y - hf_posy) & 0x1ff;
510
511   if (dx > 0x20 && dx <= 0x1e0 && dy > 0x20 && dy <= 0x1e0)
512      return 0;
513   else
514      return 1;
515}
516
517static int hardflags_check8(int num)
518{
519   return
520      (hardflags_check(num + 0) << 0) |
521      (hardflags_check(num + 1) << 1) |
522      (hardflags_check(num + 2) << 2) |
523      (hardflags_check(num + 3) << 3) |
524      (hardflags_check(num + 4) << 4) |
525      (hardflags_check(num + 5) << 5) |
526      (hardflags_check(num + 6) << 6) |
527      (hardflags_check(num + 7) << 7);
528}
529
530static READ8_HANDLER( hardflags1_r )   { return hardflags_check8(0*8); }
531static READ8_HANDLER( hardflags2_r )   { return hardflags_check8(1*8); }
532static READ8_HANDLER( hardflags3_r )   { return hardflags_check8(2*8); }
533static READ8_HANDLER( hardflags4_r )   { return hardflags_check8(3*8); }
534static READ8_HANDLER( hardflags5_r )   { return hardflags_check8(4*8); }
535static READ8_HANDLER( hardflags6_r )   { return hardflags_check8(5*8); }
536static READ8_HANDLER( hardflags7_r )
537{
538   // apparently the startup tests use bits 0&1 while the game uses bits 4&5
539   return
540      (hardflags_check(6*8 + 0) << 0) |
541      (hardflags_check(6*8 + 1) << 1) |
542      (hardflags_check(6*8 + 0) << 4) |
543      (hardflags_check(6*8 + 1) << 5);
544}
545
546
547
548/*****************************************************************************
549
550"Turbo Front" simulation
551
552This is used by Bermuda Triangle, and appears to be similar to Ikari Warriors.
553In this case, however, the test is only done during boot and not used at all
554in the game.
555
556The simulation is modeled on the ikari one, however all we can do is that it
557passes the startup checks. There is not enough evidence to infer more.
558
559A trojan could be used on the board to verify the exact behaviour.
560
561*****************************************************************************/
562
563static int tc16_posy, tc16_posx, tc32_posy, tc32_posx;
564
565static WRITE8_HANDLER( turbocheck16_1_w )
566{
567   tc16_posy = (tc16_posy & ~0xff) | data;
568}
569
570static WRITE8_HANDLER( turbocheck16_2_w )
571{
572   tc16_posx = (tc16_posx & ~0xff) | data;
573}
574
575static WRITE8_HANDLER( turbocheck32_1_w )
576{
577   tc32_posy = (tc32_posy & ~0xff) | data;
578}
579
580static WRITE8_HANDLER( turbocheck32_2_w )
581{
582   tc32_posx = (tc32_posx & ~0xff) | data;
583}
584
585static WRITE8_HANDLER( turbocheck_msb_w )
586{
587   tc16_posx = (tc16_posx & 0xff) | ((data & 0x80) << 1);
588   tc16_posy = (tc16_posy & 0xff) | ((data & 0x40) << 2);
589   tc32_posx = (tc32_posx & 0xff) | ((data & 0x80) << 1);
590   tc32_posy = (tc32_posy & 0xff) | ((data & 0x40) << 2);
591
592   // low 6 bits might indicate radius, but it's not clear
593}
594
595static int turbofront_check(int small, int num)
596{
597   const UINT8 *sr = &spriteram[0x800*small + 4*num];
598   int x = sr[2] + ((sr[3] & 0x80) << 1);
599   int y = sr[0] + ((sr[3] & 0x10) << 4);
600
601   int dx = (x - (small ? tc16_posx : tc32_posx)) & 0x1ff;
602   int dy = (y - (small ? tc16_posy : tc32_posy)) & 0x1ff;
603
604   if (dx > 0x20 && dx <= 0x1e0 && dy > 0x20 && dy <= 0x1e0)
605      return 0;
606   else
607      return 1;
608}
609
610static int turbofront_check8(int small, int num)
611{
612   return
613      (turbofront_check(small, num + 0) << 0) |
614      (turbofront_check(small, num + 1) << 1) |
615      (turbofront_check(small, num + 2) << 2) |
616      (turbofront_check(small, num + 3) << 3) |
617      (turbofront_check(small, num + 4) << 4) |
618      (turbofront_check(small, num + 5) << 5) |
619      (turbofront_check(small, num + 6) << 6) |
620      (turbofront_check(small, num + 7) << 7);
621}
622
623static READ8_HANDLER( turbocheck16_1_r )   { return turbofront_check8(1, 0*8); }
624static READ8_HANDLER( turbocheck16_2_r )   { return turbofront_check8(1, 1*8); }
625static READ8_HANDLER( turbocheck16_3_r )   { return turbofront_check8(1, 2*8); }
626static READ8_HANDLER( turbocheck16_4_r )   { return turbofront_check8(1, 3*8); }
627static READ8_HANDLER( turbocheck16_5_r )   { return turbofront_check8(1, 4*8); }
628static READ8_HANDLER( turbocheck16_6_r )   { return turbofront_check8(1, 5*8); }
629static READ8_HANDLER( turbocheck16_7_r )   { return turbofront_check8(1, 6*8); }
630static READ8_HANDLER( turbocheck16_8_r )   { return turbofront_check8(1, 7*8); }
631static READ8_HANDLER( turbocheck32_1_r )   { return turbofront_check8(0, 0*8); }
632static READ8_HANDLER( turbocheck32_2_r )   { return turbofront_check8(0, 1*8); }
633static READ8_HANDLER( turbocheck32_3_r )   { return turbofront_check8(0, 2*8); }
634static READ8_HANDLER( turbocheck32_4_r )   { return turbofront_check8(0, 3*8); }
635
636
637
638/*****************************************************************************
639
640Guerrilla War protection
641
642We add a 0xf value for 1 input read once every 8 rotations.
6430xf isn't a valid direction, but avoids the "joystick error" protection
644which happens when direction changes directly from 0x5<->0x6 8 times.
645The rotary joystick is a mechanical 12-way positional switch, so what happens
646is that occasionally while rotating the stick none of the switches will be
647closed. The protection test verifies that this happens, to prevent replacement
648of the rotary stick with a simple TTL counter.
649Note that returning 0xf just once is enough to disable the test. On the other
650hand, always returning 0xf inbetween valid values confuses the game.
651
652*****************************************************************************/
653
654CUSTOM_INPUT( gwar_rotary )
655{
295656   static int last_value[2] = {0, 0};
296657   static int cp_count[2] = {0, 0};
297   static const char *ports[] = { "IN1", "IN2" };
298   int value = input_port_read(machine, ports[which]);
299   int bttn;
658   static const char *ports[] = { "P1ROT", "P2ROT" };
659   int which = (int)(FPTR)param;
660   int value = input_port_read(field->port->machine, ports[which]);
300661
301   /* For Guerilla War we add a 0xf0 value for 1 input read once every 8 rotations.
302     * 0xf0 isn't a valid direction, but avoids the "joystick error" protection
303     * which happens when direction changes directly from 0x50<->0x60 8 times.
304    */
305   if (use_input_cp_hack)
662   if ((last_value[which] == 0x5 && value == 0x6) || (last_value[which] == 0x6 && value == 0x5))
306663   {
307      bttn = value & 0x0f;
308      value &= 0xf0;
309      if ((last_value[which] == 0x50 && value == 0x60) || (last_value[which] == 0x60 && value == 0x50))
310      {
311         if (!cp_count[which]) value = 0xf0;
312         cp_count[which] = (cp_count[which] + 1) & 0x07;
313      }
314      last_value[which] = value;
315      value |= bttn;
664      if (!cp_count[which])
665         value = 0xf;
666      cp_count[which] = (cp_count[which] + 1) & 0x07;
316667   }
668   last_value[which] = value;
317669
318670   return value;
319671}
320672
321static int snk_input_port_r( running_machine *machine, int which ){
322   switch( snk_io[which] )
323   {
324      case SNK_INP0:
325      {
326         int value = input_port_read(machine, "IN0");
327         if( (snk_sound_register & 0x04) == 0 ) value &= ~snk_sound_busy_bit;
328         return value;
329      }
330673
331      case SNK_ROT_PLAYER1: return snk_rot(machine, 0);
332      case SNK_ROT_PLAYER2: return snk_rot(machine, 1);
674/************************************************************************/
333675
334      case SNK_INP1: return input_port_read(machine, "IN1");
335      case SNK_INP2: return input_port_read(machine, "IN2");
336      case SNK_INP3: return input_port_read(machine, "IN3");
337      case SNK_INP4: return input_port_read(machine, "IN4");
338      case SNK_INP5: return input_port_read(machine, "IN5");
339      case SNK_INP6: return input_port_read(machine, "IN6");
340      case SNK_INP7: return input_port_read(machine, "IN7");
341      case SNK_INP8: return input_port_read(machine, "IN8");
342      case SNK_INP9: return input_port_read(machine, "IN9");
343676
344      case SNK_DSW1: return input_port_read(machine, "DSW1");
345      case SNK_DSW2: return input_port_read(machine, "DSW2");
677static WRITE8_HANDLER( athena_coin_counter_w )
678{
679   coin_counter_w(0, ~data & 2);
680   coin_counter_w(1, ~data & 1);
681}
346682
347      default:
348      logerror("read from unmapped input port:%d\n", which );
349      break;
683static WRITE8_HANDLER( ikari_coin_counter_w )
684{
685   if (~data & 0x80)
686   {
687      coin_counter_w(0, 1);
688      coin_counter_w(0, 0);
350689   }
351   return 0;
690
691   if (~data & 0x40)
692   {
693      coin_counter_w(1, 1);
694      coin_counter_w(1, 0);
695   }
352696}
353697
354/*********************************************************************/
355
356static WRITE8_HANDLER( snk_sound_register_w ){
357   snk_sound_register &= (data>>4);
698static WRITE8_HANDLER( tdfever_coin_counter_w )
699{
700   coin_counter_w(0, data & 1);
701   coin_counter_w(1, data & 2);
358702}
359703
360static READ8_HANDLER( snk_sound_register_r ){
361   return snk_sound_register;// | 0x2; /* hack; lets chopper1 play music */
704static WRITE8_HANDLER( countryc_trackball_w )
705{
706   countryc_trackball = data & 1;
362707}
363708
364static void snk_sound_callback0_w( running_machine *machine, int state ){ /* ? */
365   if( state ) snk_sound_register |= 0x01;
709static CUSTOM_INPUT( countryc_trackball_x )
710{
711   return input_port_read(field->port->machine, countryc_trackball ? "TRACKBALLX2" : "TRACKBALLX1");
366712}
367713
368static void snk_sound_callback1_w( running_machine *machine, int state ){ /* ? */
369   if( state ) snk_sound_register |= 0x02;
714static CUSTOM_INPUT( countryc_trackball_y )
715{
716   return input_port_read(field->port->machine, countryc_trackball ? "TRACKBALLY2" : "TRACKBALLY1");
370717}
371718
372static const ym3526_interface ym3526_interface_0 = {
373   snk_sound_callback0_w /* ? */
374};
375719
376static const ym3526_interface ym3526_interface_1 = {
377   snk_sound_callback1_w /* ? */
378};
720/************************************************************************/
379721
380static const y8950_interface y8950_config = {
381   snk_sound_callback1_w /* ? */
382};
722static CUSTOM_INPUT( snk_older_bonus_r )
723{
724   int bit_mask = (FPTR)param;
383725
384static const ym3812_interface ym3812_config = {
385   snk_sound_callback0_w /* ? */
386};
387
388static WRITE8_HANDLER( snk_soundlatch_w ){
389   snk_sound_register |= 0x08 | 0x04;
390   soundlatch_w( machine, offset, data );
726   switch (bit_mask)
727   {
728      case 0x01:
729         return ((input_port_read(field->port->machine, "BONUS") & bit_mask) >> 0);
730      case 0xc0:
731         return ((input_port_read(field->port->machine, "BONUS") & bit_mask) >> 6);
732      default:
733         logerror("snk_older_bonus_r : invalid %02X bit_mask\n",bit_mask);
734         return 0;
735   }
391736}
392737
393static READ8_HANDLER( snk_soundlatch_clear_r ){ /* TNK3 */
394   soundlatch_w( machine, 0, 0 );
395   snk_sound_register = 0;
396   return 0x00;
738#if 0
739static CUSTOM_INPUT( snk_later_bonus_r )
740{
741   int bit_mask = (FPTR)param;
742
743   switch (bit_mask)
744   {
745      case 0x04:
746         return ((input_port_read(field->port->machine, "BONUS") & bit_mask) >> 2);
747      case 0x30:
748         return ((input_port_read(field->port->machine, "BONUS") & bit_mask) >> 4);
749      default:
750         logerror("snk_later_bonus_r : invalid %02X bit_mask\n",bit_mask);
751         return 0;
752   }
397753}
754#endif
398755
399/*********************************************************************/
756/************************************************************************/
400757
401static ADDRESS_MAP_START( YM3526_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
758static ADDRESS_MAP_START( jcross_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
759   AM_RANGE(0x0000, 0x9fff) AM_ROM
760   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
761   AM_RANGE(0xa100, 0xa100) AM_READ_PORT("IN1")
762   AM_RANGE(0xa200, 0xa200) AM_READ_PORT("IN2")
763   AM_RANGE(0xa300, 0xa300) AM_WRITE(sgladiat_soundlatch_w)
764   AM_RANGE(0xa400, 0xa400) AM_READ_PORT("DSW1")
765   AM_RANGE(0xa500, 0xa500) AM_READ_PORT("DSW2")
766   AM_RANGE(0xa600, 0xa600) AM_WRITE(sgladiat_flipscreen_w)
767   AM_RANGE(0xa700, 0xa700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w)
768   AM_RANGE(0xd300, 0xd300) AM_WRITE(jcross_scroll_msb_w)
769   AM_RANGE(0xd400, 0xd400) AM_WRITE(snk_sp16_scrolly_w)
770   AM_RANGE(0xd500, 0xd500) AM_WRITE(snk_sp16_scrollx_w)
771   AM_RANGE(0xd600, 0xd600) AM_WRITE(snk_bg_scrolly_w)
772   AM_RANGE(0xd700, 0xd700) AM_WRITE(snk_bg_scrollx_w)
773   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_BASE(&spriteram) AM_SHARE(1)
774   AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(aso_bg_videoram_w) AM_SHARE(2) AM_BASE(&snk_bg_videoram)
775   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(3) AM_BASE(&snk_fg_videoram)   // + work RAM
776   AM_RANGE(0xffff, 0xffff) AM_WRITENOP   // simply a program patch to not write to two not existing video registers?
777ADDRESS_MAP_END
778
779static ADDRESS_MAP_START( jcross_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
402780   AM_RANGE(0x0000, 0x7fff) AM_ROM
781   AM_RANGE(0xa700, 0xa700) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)
782   AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE(1)
783   AM_RANGE(0xc800, 0xd7ff) AM_RAM_WRITE(aso_bg_videoram_w) AM_SHARE(2)
784   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(3)
785ADDRESS_MAP_END
786
787
788static ADDRESS_MAP_START( sgladiat_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
789   AM_RANGE(0x0000, 0x9fff) AM_ROM
790   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
791   AM_RANGE(0xa100, 0xa100) AM_READ_PORT("IN1")
792   AM_RANGE(0xa200, 0xa200) AM_READ_PORT("IN2")
793   AM_RANGE(0xa300, 0xa300) AM_WRITE(sgladiat_soundlatch_w)
794   AM_RANGE(0xa400, 0xa400) AM_READ_PORT("DSW1")
795   AM_RANGE(0xa500, 0xa500) AM_READ_PORT("DSW2")
796   AM_RANGE(0xa600, 0xa600) AM_WRITE(sgladiat_flipscreen_w)
797   AM_RANGE(0xa700, 0xa700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w)
798   AM_RANGE(0xd200, 0xd200) AM_WRITENOP   // unknown
799   AM_RANGE(0xd300, 0xd300) AM_WRITE(sgladiat_scroll_msb_w)
800   AM_RANGE(0xd400, 0xd400) AM_WRITE(snk_sp16_scrolly_w)
801   AM_RANGE(0xd500, 0xd500) AM_WRITE(snk_sp16_scrollx_w)
802   AM_RANGE(0xd600, 0xd600) AM_WRITE(snk_bg_scrolly_w)
803   AM_RANGE(0xd700, 0xd700) AM_WRITE(snk_bg_scrollx_w)
804   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_BASE(&spriteram) AM_SHARE(1)
805   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(aso_bg_videoram_w) AM_SHARE(2) AM_BASE(&snk_bg_videoram)
806   AM_RANGE(0xe800, 0xefff) AM_RAM
807   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(3) AM_BASE(&snk_fg_videoram)   // + work RAM
808ADDRESS_MAP_END
809
810static ADDRESS_MAP_START( sgladiat_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
811   AM_RANGE(0x0000, 0x7fff) AM_ROM
812   AM_RANGE(0xa000, 0xa000) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)
813   AM_RANGE(0xa600, 0xa600) AM_WRITE(sgladiat_flipscreen_w)
814   AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE(1)
815   AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(aso_bg_videoram_w) AM_SHARE(2)
816   AM_RANGE(0xda00, 0xda00) AM_WRITENOP   // unknown
817   AM_RANGE(0xdb00, 0xdb00) AM_WRITE(sgladiat_scroll_msb_w)
818   AM_RANGE(0xdc00, 0xdc00) AM_WRITE(snk_sp16_scrolly_w)
819   AM_RANGE(0xdd00, 0xdd00) AM_WRITE(snk_sp16_scrollx_w)
820   AM_RANGE(0xde00, 0xde00) AM_WRITE(snk_bg_scrolly_w)
821   AM_RANGE(0xdf00, 0xdf00) AM_WRITE(snk_bg_scrollx_w)
822   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(3)
823ADDRESS_MAP_END
824
825
826static ADDRESS_MAP_START( aso_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
827   AM_RANGE(0x0000, 0xbfff) AM_ROM
828   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("IN0")
829   AM_RANGE(0xc100, 0xc100) AM_READ_PORT("IN1")
830   AM_RANGE(0xc200, 0xc200) AM_READ_PORT("IN2")
831   AM_RANGE(0xc400, 0xc400) AM_WRITE(snk_soundlatch_w)
832   AM_RANGE(0xc500, 0xc500) AM_READ_PORT("DSW1")
833   AM_RANGE(0xc600, 0xc600) AM_READ_PORT("DSW2")
834   AM_RANGE(0xc700, 0xc700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w)
835   AM_RANGE(0xc800, 0xc800) AM_WRITE(aso_videoattrs_w)   // flip screen, scroll msb
836   AM_RANGE(0xc900, 0xc900) AM_WRITE(snk_sp16_scrolly_w)
837   AM_RANGE(0xca00, 0xca00) AM_WRITE(snk_sp16_scrollx_w)
838   AM_RANGE(0xcb00, 0xcb00) AM_WRITE(snk_bg_scrolly_w)
839   AM_RANGE(0xcc00, 0xcc00) AM_WRITE(snk_bg_scrollx_w)
840   AM_RANGE(0xce00, 0xce00) AM_WRITENOP   // always 05?
841   AM_RANGE(0xcf00, 0xcf00) AM_WRITE(aso_bg_bank_w)   // tile and palette bank
842   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE(1)
843   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE(2) AM_BASE(&spriteram)   // + work ram
844   AM_RANGE(0xe800, 0xf7ff) AM_RAM_WRITE(aso_bg_videoram_w) AM_SHARE(3) AM_BASE(&snk_bg_videoram)
845   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(4) AM_BASE(&snk_fg_videoram)   // + work RAM
846ADDRESS_MAP_END
847
848static ADDRESS_MAP_START( aso_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
849   AM_RANGE(0x0000, 0xbfff) AM_ROM
850   AM_RANGE(0xc000, 0xc000) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)
851   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE(1)
852   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE(2)
853   AM_RANGE(0xd800, 0xe7ff) AM_RAM_WRITE(aso_bg_videoram_w) AM_SHARE(3)
854   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(4)
855ADDRESS_MAP_END
856
857
858static ADDRESS_MAP_START( tnk3_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
859   AM_RANGE(0x0000, 0xbfff) AM_ROM
860   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("IN0")
861   AM_RANGE(0xc100, 0xc100) AM_READ_PORT("IN1")
862   AM_RANGE(0xc200, 0xc200) AM_READ_PORT("IN2")
863   // c300 is an input in tnk3, output in athena/fitegolf (coin counter)
864   // and in countryc (trackball select) (see DRIVER_INIT).
865   AM_RANGE(0xc300, 0xc300) AM_READ_PORT("IN3") AM_WRITE(athena_coin_counter_w)
866   AM_RANGE(0xc400, 0xc400) AM_WRITE(snk_soundlatch_w)
867   AM_RANGE(0xc500, 0xc500) AM_READ_PORT("DSW1")
868   AM_RANGE(0xc600, 0xc600) AM_READ_PORT("DSW2")
869   AM_RANGE(0xc700, 0xc700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w)
870   AM_RANGE(0xc800, 0xc800) AM_WRITE(tnk3_videoattrs_w)   // flip screen, char bank, scroll msb
871   AM_RANGE(0xc900, 0xc900) AM_WRITE(snk_sp16_scrolly_w)
872   AM_RANGE(0xca00, 0xca00) AM_WRITE(snk_sp16_scrollx_w)
873   AM_RANGE(0xcb00, 0xcb00) AM_WRITE(snk_bg_scrolly_w)
874   AM_RANGE(0xcc00, 0xcc00) AM_WRITE(snk_bg_scrollx_w)
875   AM_RANGE(0xcf00, 0xcf00) AM_WRITENOP   // fitegolf/countryc only. Either 0 or 1. Video related?
876   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE(1) AM_BASE(&spriteram)   // + work ram
877   AM_RANGE(0xd800, 0xf7ff) AM_RAM_WRITE(snk_bg_videoram_w) AM_SHARE(2) AM_BASE(&snk_bg_videoram)
878   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(3) AM_BASE(&snk_fg_videoram)   // + work RAM
879ADDRESS_MAP_END
880
881static ADDRESS_MAP_START( tnk3_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
882   AM_RANGE(0x0000, 0xbfff) AM_ROM
883   AM_RANGE(0xc000, 0xc000) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)   // tnk3, athena
884   AM_RANGE(0xc700, 0xc700) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)   // fitegolf
885   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE(1)
886   AM_RANGE(0xd000, 0xefff) AM_RAM_WRITE(snk_bg_videoram_w) AM_SHARE(2)
887   AM_RANGE(0xf000, 0xf7ff) AM_RAM
888   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(3)
889ADDRESS_MAP_END
890
891
892static ADDRESS_MAP_START( ikari_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
893   AM_RANGE(0x0000, 0xbfff) AM_ROM
894   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("IN0")
895   AM_RANGE(0xc100, 0xc100) AM_READ_PORT("IN1")
896   AM_RANGE(0xc200, 0xc200) AM_READ_PORT("IN2")
897   AM_RANGE(0xc300, 0xc300) AM_READ_PORT("IN3") AM_WRITE(ikari_coin_counter_w)   // ikarijp doesn't use the coin counter
898   AM_RANGE(0xc400, 0xc400) AM_WRITE(snk_soundlatch_w)
899   AM_RANGE(0xc500, 0xc500) AM_READ_PORT("DSW1")
900   AM_RANGE(0xc600, 0xc600) AM_READ_PORT("DSW2")
901   AM_RANGE(0xc700, 0xc700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w)
902   AM_RANGE(0xc800, 0xc800) AM_WRITE(snk_bg_scrolly_w)
903   AM_RANGE(0xc880, 0xc880) AM_WRITE(snk_bg_scrollx_w)
904   AM_RANGE(0xc900, 0xc900) AM_WRITE(ikari_bg_scroll_msb_w)
905   AM_RANGE(0xc980, 0xc980) AM_WRITE(ikari_unknown_video_w)
906   AM_RANGE(0xca00, 0xca00) AM_WRITE(snk_sp16_scrolly_w)
907   AM_RANGE(0xca80, 0xca80) AM_WRITE(snk_sp16_scrollx_w)
908   AM_RANGE(0xcb00, 0xcb00) AM_WRITE(snk_sp32_scrolly_w)
909   AM_RANGE(0xcb80, 0xcb80) AM_WRITE(snk_sp32_scrollx_w)
910   AM_RANGE(0xcc00, 0xcc00) AM_WRITE(hardflags_scrolly_w)
911   AM_RANGE(0xcc80, 0xcc80) AM_WRITE(hardflags_scrollx_w)
912   AM_RANGE(0xcd00, 0xcd00) AM_WRITE(ikari_sp_scroll_msb_w)
913   AM_RANGE(0xcd80, 0xcd80) AM_WRITE(hardflags_scroll_msb_w)
914   AM_RANGE(0xce00, 0xce00) AM_READ(hardflags1_r)
915   AM_RANGE(0xce20, 0xce20) AM_READ(hardflags2_r)
916   AM_RANGE(0xce40, 0xce40) AM_READ(hardflags3_r)
917   AM_RANGE(0xce60, 0xce60) AM_READ(hardflags4_r)
918   AM_RANGE(0xce80, 0xce80) AM_READ(hardflags5_r)
919   AM_RANGE(0xcea0, 0xcea0) AM_READ(hardflags6_r)
920   AM_RANGE(0xcee0, 0xcee0) AM_READ(hardflags7_r)
921   // note the mirror. ikari and victroad use d800, ikarijp uses d000
922   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(snk_bg_videoram_w) AM_MIRROR(0x0800) AM_SHARE(2) AM_BASE(&snk_bg_videoram)
923   AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(3) AM_BASE(&spriteram)   // + work ram
924   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(4) AM_BASE(&snk_fg_videoram)   // + work RAM
925ADDRESS_MAP_END
926
927static ADDRESS_MAP_START( ikari_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
928   AM_RANGE(0x0000, 0xbfff) AM_ROM
929   AM_RANGE(0xc000, 0xc000) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)
930   AM_RANGE(0xc980, 0xc980) AM_WRITE(ikari_unknown_video_w)
931   AM_RANGE(0xcc00, 0xcc00) AM_WRITE(hardflags_scrolly_w)
932   AM_RANGE(0xcc80, 0xcc80) AM_WRITE(hardflags_scrollx_w)
933   AM_RANGE(0xcd80, 0xcd80) AM_WRITE(hardflags_scroll_msb_w)
934   AM_RANGE(0xce00, 0xce00) AM_READ(hardflags1_r)
935   AM_RANGE(0xce20, 0xce20) AM_READ(hardflags2_r)
936   AM_RANGE(0xce40, 0xce40) AM_READ(hardflags3_r)
937   AM_RANGE(0xce60, 0xce60) AM_READ(hardflags4_r)
938   AM_RANGE(0xce80, 0xce80) AM_READ(hardflags5_r)
939   AM_RANGE(0xcea0, 0xcea0) AM_READ(hardflags6_r)
940   AM_RANGE(0xcee0, 0xcee0) AM_READ(hardflags7_r)
941   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(snk_bg_videoram_w) AM_MIRROR(0x0800) AM_SHARE(2)
942   AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(3)
943   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(4)
944ADDRESS_MAP_END
945
946
947static ADDRESS_MAP_START( bermudat_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
948   AM_RANGE(0x0000, 0xbfff) AM_ROM
949   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("IN0")
950   AM_RANGE(0xc100, 0xc100) AM_READ_PORT("IN1")
951   AM_RANGE(0xc200, 0xc200) AM_READ_PORT("IN2")
952   AM_RANGE(0xc300, 0xc300) AM_READ_PORT("IN3") AM_WRITE(ikari_coin_counter_w)
953   AM_RANGE(0xc400, 0xc400) AM_WRITE(snk_soundlatch_w)
954   AM_RANGE(0xc500, 0xc500) AM_READ_PORT("DSW1")
955   AM_RANGE(0xc600, 0xc600) AM_READ_PORT("DSW2")
956   AM_RANGE(0xc700, 0xc700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w)
957   AM_RANGE(0xc800, 0xc800) AM_WRITE(snk_bg_scrolly_w)
958   AM_RANGE(0xc840, 0xc840) AM_WRITE(snk_bg_scrollx_w)
959   AM_RANGE(0xc880, 0xc880) AM_WRITE(gwara_videoattrs_w)   // flip screen, scroll msb
960   AM_RANGE(0xc8c0, 0xc8c0) AM_WRITE(gwar_fg_bank_w)   // char and palette bank
961   AM_RANGE(0xc900, 0xc900) AM_WRITE(snk_sp16_scrolly_w)
962   AM_RANGE(0xc940, 0xc940) AM_WRITE(snk_sp16_scrollx_w)
963   AM_RANGE(0xc980, 0xc980) AM_WRITE(snk_sp32_scrolly_w)
964   AM_RANGE(0xc9c0, 0xc9c0) AM_WRITE(snk_sp32_scrollx_w)
965   // the "turbo check" addresses are only used by bermudat/bermudaj, not bermudaa/worldwar or the other games
966   AM_RANGE(0xca00, 0xca00) AM_WRITE(turbocheck16_1_w)
967   AM_RANGE(0xca40, 0xca40) AM_WRITE(turbocheck16_2_w)
968   AM_RANGE(0xca80, 0xca80) AM_WRITE(gwara_sp_scroll_msb_w)
969   AM_RANGE(0xcac0, 0xcac0) AM_WRITE(gwar_sprite_split_point_w)
970   AM_RANGE(0xcb00, 0xcb00) AM_READ(turbocheck16_1_r)
971   AM_RANGE(0xcb10, 0xcb10) AM_READ(turbocheck16_2_r)
972   AM_RANGE(0xcb20, 0xcb20) AM_READ(turbocheck16_3_r)
973   AM_RANGE(0xcb30, 0xcb30) AM_READ(turbocheck16_4_r)
974   AM_RANGE(0xcb40, 0xcb40) AM_READ(turbocheck16_5_r)
975   AM_RANGE(0xcb50, 0xcb50) AM_READ(turbocheck16_6_r)
976   AM_RANGE(0xcb60, 0xcb60) AM_READ(turbocheck16_7_r)
977   AM_RANGE(0xcb70, 0xcb70) AM_READ(turbocheck16_8_r)
978   AM_RANGE(0xcc00, 0xcc00) AM_WRITE(turbocheck32_1_w)
979   AM_RANGE(0xcc40, 0xcc40) AM_WRITE(turbocheck32_2_w)
980   AM_RANGE(0xcc80, 0xcc80) AM_WRITE(turbocheck_msb_w)
981   AM_RANGE(0xccc0, 0xccc0) AM_READ(turbocheck32_1_r)
982   AM_RANGE(0xccd0, 0xccd0) AM_READ(turbocheck32_2_r)
983   AM_RANGE(0xcce0, 0xcce0) AM_READ(turbocheck32_3_r)
984   AM_RANGE(0xccf0, 0xccf0) AM_READ(turbocheck32_4_r)
985   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(snk_bg_videoram_w) AM_SHARE(1) AM_BASE(&snk_bg_videoram)
986   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE(2)
987   AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(3) AM_BASE(&spriteram)   // + work ram
988   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(4) AM_BASE(&snk_fg_videoram)   // + work RAM
989ADDRESS_MAP_END
990
991static ADDRESS_MAP_START( bermudat_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
992   AM_RANGE(0x0000, 0xbfff) AM_ROM
993   AM_RANGE(0xc700, 0xc700) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)
994   AM_RANGE(0xc800, 0xc800) AM_WRITE(snk_bg_scrolly_w)
995   AM_RANGE(0xc840, 0xc840) AM_WRITE(snk_bg_scrollx_w)
996   AM_RANGE(0xc880, 0xc880) AM_WRITE(gwara_videoattrs_w)   // flip screen, scroll msb
997   AM_RANGE(0xc8c0, 0xc8c0) AM_WRITE(gwar_fg_bank_w)   // char and palette bank
998   AM_RANGE(0xc900, 0xc900) AM_WRITE(snk_sp16_scrolly_w)
999   AM_RANGE(0xc940, 0xc940) AM_WRITE(snk_sp16_scrollx_w)
1000   AM_RANGE(0xc980, 0xc980) AM_WRITE(snk_sp32_scrolly_w)
1001   AM_RANGE(0xc9c0, 0xc9c0) AM_WRITE(snk_sp32_scrollx_w)
1002   AM_RANGE(0xca80, 0xca80) AM_WRITE(gwara_sp_scroll_msb_w)
1003   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(snk_bg_videoram_w) AM_SHARE(1)
1004   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE(2)
1005   AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(3)
1006   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(4)
1007ADDRESS_MAP_END
1008
1009
1010static ADDRESS_MAP_START( gwar_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
1011   AM_RANGE(0x0000, 0xbfff) AM_ROM
1012   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("IN0")
1013   AM_RANGE(0xc100, 0xc100) AM_READ_PORT("IN1")
1014   AM_RANGE(0xc200, 0xc200) AM_READ_PORT("IN2")
1015   AM_RANGE(0xc300, 0xc300) AM_READ_PORT("IN3") AM_WRITE(ikari_coin_counter_w)
1016   AM_RANGE(0xc400, 0xc400) AM_WRITE(snk_soundlatch_w)
1017   AM_RANGE(0xc500, 0xc500) AM_READ_PORT("DSW1")
1018   AM_RANGE(0xc600, 0xc600) AM_READ_PORT("DSW2")
1019   AM_RANGE(0xc700, 0xc700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w)
1020   AM_RANGE(0xc800, 0xc800) AM_WRITE(snk_bg_scrolly_w)
1021   AM_RANGE(0xc840, 0xc840) AM_WRITE(snk_bg_scrollx_w)
1022   AM_RANGE(0xc880, 0xc880) AM_WRITE(gwar_videoattrs_w)   // flip screen, scroll msb
1023   AM_RANGE(0xc8c0, 0xc8c0) AM_WRITE(gwar_fg_bank_w)   // char and palette bank
1024   AM_RANGE(0xc900, 0xc900) AM_WRITE(snk_sp16_scrolly_w)
1025   AM_RANGE(0xc940, 0xc940) AM_WRITE(snk_sp16_scrollx_w)
1026   AM_RANGE(0xc980, 0xc980) AM_WRITE(snk_sp32_scrolly_w)
1027   AM_RANGE(0xc9c0, 0xc9c0) AM_WRITE(snk_sp32_scrollx_w)
1028   AM_RANGE(0xca00, 0xca00) AM_WRITENOP   // always 0?
1029   AM_RANGE(0xca40, 0xca40) AM_WRITENOP   // always 0?
1030   AM_RANGE(0xcac0, 0xcac0) AM_WRITE(gwar_sprite_split_point_w)
1031   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(snk_bg_videoram_w) AM_SHARE(1) AM_BASE(&snk_bg_videoram)
1032   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE(2)
1033   AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(3) AM_BASE(&spriteram)   // + work ram
1034   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(4) AM_BASE(&snk_fg_videoram)   // + work RAM
1035ADDRESS_MAP_END
1036
1037static ADDRESS_MAP_START( gwar_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
1038   AM_RANGE(0x0000, 0xbfff) AM_ROM
1039   AM_RANGE(0xc000, 0xc000) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)
1040   AM_RANGE(0xc8c0, 0xc8c0) AM_WRITE(gwar_fg_bank_w)   // char and palette bank
1041   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(snk_bg_videoram_w) AM_SHARE(1)
1042   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE(2)
1043   AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(3)
1044   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(4)
1045ADDRESS_MAP_END
1046
1047
1048static ADDRESS_MAP_START( gwara_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
1049   AM_RANGE(0x0000, 0xbfff) AM_ROM
1050   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("IN0")
1051   AM_RANGE(0xc100, 0xc100) AM_READ_PORT("IN1")
1052   AM_RANGE(0xc200, 0xc200) AM_READ_PORT("IN2")
1053   AM_RANGE(0xc300, 0xc300) AM_READ_PORT("IN3") AM_WRITE(ikari_coin_counter_w)
1054   AM_RANGE(0xc400, 0xc400) AM_WRITE(snk_soundlatch_w)
1055   AM_RANGE(0xc500, 0xc500) AM_READ_PORT("DSW1")
1056   AM_RANGE(0xc600, 0xc600) AM_READ_PORT("DSW2")
1057   AM_RANGE(0xc700, 0xc700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w)
1058   AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(1) AM_BASE(&snk_fg_videoram)   // + work RAM
1059   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(snk_bg_videoram_w) AM_SHARE(2) AM_BASE(&snk_bg_videoram)
1060   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE(3)
1061   AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(4) AM_BASE(&spriteram)   // + work ram
1062   AM_RANGE(0xf800, 0xf800) AM_WRITE(snk_bg_scrolly_w)
1063   AM_RANGE(0xf840, 0xf840) AM_WRITE(snk_bg_scrollx_w)
1064   AM_RANGE(0xf880, 0xf880) AM_WRITE(gwara_videoattrs_w)   // flip screen, scroll msb
1065   AM_RANGE(0xf8c0, 0xf8c0) AM_WRITE(gwar_fg_bank_w)   // char and palette bank
1066   AM_RANGE(0xf900, 0xf900) AM_WRITE(snk_sp16_scrolly_w)
1067   AM_RANGE(0xf940, 0xf940) AM_WRITE(snk_sp16_scrollx_w)
1068   AM_RANGE(0xf980, 0xf980) AM_WRITE(snk_sp32_scrolly_w)
1069   AM_RANGE(0xf9c0, 0xf9c0) AM_WRITE(snk_sp32_scrollx_w)
1070   AM_RANGE(0xfa80, 0xfa80) AM_WRITE(gwara_sp_scroll_msb_w)
1071   AM_RANGE(0xfac0, 0xfac0) AM_WRITE(gwar_sprite_split_point_w)
1072ADDRESS_MAP_END
1073
1074static ADDRESS_MAP_START( gwara_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
1075   AM_RANGE(0x0000, 0xbfff) AM_ROM
1076   AM_RANGE(0xc000, 0xc000) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)
1077   AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(1)
1078   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(snk_bg_videoram_w) AM_SHARE(2)
1079   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE(3)
1080   AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(4) AM_BASE(&spriteram)   // + work ram
1081   AM_RANGE(0xf8c0, 0xf8c0) AM_WRITE(gwar_fg_bank_w)   // char and palette bank
1082ADDRESS_MAP_END
1083
1084
1085static ADDRESS_MAP_START( tdfever_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
1086   AM_RANGE(0x0000, 0xbfff) AM_ROM
1087   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("IN0")
1088   AM_RANGE(0xc080, 0xc080) AM_READ_PORT("IN1")
1089   AM_RANGE(0xc100, 0xc100) AM_READ_PORT("IN2")
1090   AM_RANGE(0xc180, 0xc180) AM_READ_PORT("IN3")
1091   AM_RANGE(0xc200, 0xc200) AM_READ_PORT("IN4")
1092   AM_RANGE(0xc280, 0xc280) AM_READ_PORT("IN5")
1093   AM_RANGE(0xc300, 0xc300) AM_READ_PORT("IN6")
1094   AM_RANGE(0xc380, 0xc380) AM_READ_PORT("IN7")
1095   AM_RANGE(0xc400, 0xc400) AM_READ_PORT("IN8")
1096   AM_RANGE(0xc480, 0xc480) AM_READ_PORT("IN9")
1097   AM_RANGE(0xc500, 0xc500) AM_WRITE(snk_soundlatch_w)
1098   AM_RANGE(0xc580, 0xc580) AM_READ_PORT("DSW1")
1099   AM_RANGE(0xc600, 0xc600) AM_READ_PORT("DSW2")
1100   AM_RANGE(0xc680, 0xc680) AM_WRITE(tdfever_coin_counter_w)
1101   AM_RANGE(0xc700, 0xc700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w)
1102   AM_RANGE(0xc800, 0xc800) AM_WRITE(snk_bg_scrolly_w)
1103   AM_RANGE(0xc840, 0xc840) AM_WRITE(snk_bg_scrollx_w)
1104   AM_RANGE(0xc880, 0xc880) AM_WRITE(gwara_videoattrs_w)   // flip screen, scroll msb
1105   AM_RANGE(0xc8c0, 0xc8c0) AM_WRITE(gwar_fg_bank_w)   // char and palette bank
1106   AM_RANGE(0xc900, 0xc900) AM_WRITE(tdfever_sp_scroll_msb_w)
1107   AM_RANGE(0xc980, 0xc980) AM_WRITE(snk_sp32_scrolly_w)
1108   AM_RANGE(0xc9c0, 0xc9c0) AM_WRITE(snk_sp32_scrollx_w)
1109   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(snk_bg_videoram_w) AM_SHARE(1) AM_BASE(&snk_bg_videoram)
1110   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE(2)
1111   AM_RANGE(0xe000, 0xf7ff) AM_RAM_WRITE(tdfever_spriteram_w) AM_SHARE(3) AM_BASE(&spriteram)   // + work ram
1112   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(4) AM_BASE(&snk_fg_videoram)   // + work RAM
1113ADDRESS_MAP_END
1114
1115static ADDRESS_MAP_START( tdfever_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
1116   AM_RANGE(0x0000, 0xbfff) AM_ROM
1117   AM_RANGE(0xc000, 0xc000) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)   // tdfever, tdfever2
1118   AM_RANGE(0xc700, 0xc700) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)   // fsoccer
1119   AM_RANGE(0xc8c0, 0xc8c0) AM_WRITE(gwar_fg_bank_w)   // char and palette bank
1120   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(snk_bg_videoram_w) AM_SHARE(1)
1121   AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE(2)
1122   AM_RANGE(0xe000, 0xf7ff) AM_RAM_WRITE(tdfever_spriteram_w) AM_SHARE(3)
1123   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(snk_fg_videoram_w) AM_SHARE(4)
1124ADDRESS_MAP_END
1125
1126/***********************************************************************/
1127
1128static ADDRESS_MAP_START( jcross_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1129   AM_RANGE(0x0000, 0x3fff) AM_ROM AM_BASE(&namco_wavedata)
4031130   AM_RANGE(0x8000, 0x87ff) AM_RAM
1131   AM_RANGE(0xa000, 0xa000) AM_READ(sgladiat_soundlatch_r)
1132   AM_RANGE(0xc000, 0xc000) AM_READ(sgladiat_sound_nmi_ack_r)
1133   AM_RANGE(0xe000, 0xe000) AM_WRITE(ay8910_control_port_0_w)
1134   AM_RANGE(0xe001, 0xe001) AM_WRITE(ay8910_write_port_0_w)
1135   AM_RANGE(0xe002, 0xe007) AM_WRITE(snkwave_w)
1136   AM_RANGE(0xe008, 0xe008) AM_WRITE(ay8910_control_port_1_w)
1137   AM_RANGE(0xe009, 0xe009) AM_WRITE(ay8910_write_port_1_w)
1138ADDRESS_MAP_END
1139
1140static ADDRESS_MAP_START( sgladiat_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1141   AM_RANGE(0x0000, 0x3fff) AM_ROM
1142   AM_RANGE(0x8000, 0x87ff) AM_RAM
1143   AM_RANGE(0xa000, 0xa000) AM_READ(sgladiat_soundlatch_r)
1144   AM_RANGE(0xc000, 0xc000) AM_READ(sgladiat_sound_nmi_ack_r)
1145   AM_RANGE(0xe000, 0xe000) AM_WRITE(ay8910_control_port_0_w)
1146   AM_RANGE(0xe001, 0xe001) AM_WRITE(ay8910_write_port_0_w)
1147   AM_RANGE(0xe002, 0xe003) AM_WRITENOP   // leftover wave generator ports?
1148   AM_RANGE(0xe004, 0xe004) AM_WRITE(ay8910_control_port_1_w)
1149   AM_RANGE(0xe005, 0xe005) AM_WRITE(ay8910_write_port_1_w)
1150ADDRESS_MAP_END
1151
1152static ADDRESS_MAP_START( jcross_sound_portmap, ADDRESS_SPACE_IO, 8 )
1153   ADDRESS_MAP_GLOBAL_MASK(0xff)
1154   AM_RANGE(0x00, 0x00) AM_READ(sgladiat_sound_irq_ack_r)
1155ADDRESS_MAP_END
1156
1157static ADDRESS_MAP_START( tnk3_YM3526_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1158   AM_RANGE(0x0000, 0x7fff) AM_ROM
1159   AM_RANGE(0x8000, 0x87ff) AM_RAM
4041160   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r)
405   AM_RANGE(0xc000, 0xc000) AM_READ(snk_soundlatch_clear_r)
1161   AM_RANGE(0xc000, 0xc000) AM_READ(tnk3_busy_clear_r)
4061162   AM_RANGE(0xe000, 0xe000) AM_READWRITE(ym3526_status_port_0_r, ym3526_control_port_0_w)
4071163   AM_RANGE(0xe001, 0xe001) AM_WRITE(ym3526_write_port_0_w)
1164   AM_RANGE(0xe004, 0xe004) AM_READ(tnk3_cmdirq_ack_r)
1165   AM_RANGE(0xe006, 0xe006) AM_READ(tnk3_ymirq_ack_r)
4081166ADDRESS_MAP_END
4091167
1168static ADDRESS_MAP_START( aso_YM3526_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1169   AM_RANGE(0x0000, 0xbfff) AM_ROM
1170   AM_RANGE(0xc000, 0xc7ff) AM_RAM
1171   AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r)
1172   AM_RANGE(0xe000, 0xe000) AM_READ(tnk3_busy_clear_r)
1173   AM_RANGE(0xf000, 0xf000) AM_READWRITE(ym3526_status_port_0_r, ym3526_control_port_0_w)
1174   AM_RANGE(0xf001, 0xf001) AM_WRITE(ym3526_write_port_0_w)
1175//  AM_RANGE(0xf002, 0xf002) AM_READNOP unknown
1176   AM_RANGE(0xf004, 0xf004) AM_READ(tnk3_cmdirq_ack_r)
1177   AM_RANGE(0xf006, 0xf006) AM_READ(tnk3_ymirq_ack_r)
1178ADDRESS_MAP_END
4101179
4111180static ADDRESS_MAP_START( YM3526_YM3526_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
4121181   AM_RANGE(0x0000, 0xbfff) AM_ROM
r3115r3116
4161185   AM_RANGE(0xec00, 0xec00) AM_WRITE(ym3526_write_port_0_w)
4171186   AM_RANGE(0xf000, 0xf000) AM_READWRITE(ym3526_status_port_1_r, ym3526_control_port_1_w)
4181187   AM_RANGE(0xf400, 0xf400) AM_WRITE(ym3526_write_port_1_w)
419   AM_RANGE(0xf800, 0xf800) AM_READWRITE(snk_sound_register_r, snk_sound_register_w)
1188   AM_RANGE(0xf800, 0xf800) AM_READWRITE(snk_sound_status_r, snk_sound_status_w)
4201189ADDRESS_MAP_END
4211190
1191static ADDRESS_MAP_START( YM3812_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1192   AM_RANGE(0x0000, 0xbfff) AM_ROM
1193   AM_RANGE(0xc000, 0xcfff) AM_RAM
1194   AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
1195   AM_RANGE(0xe800, 0xe800) AM_READWRITE(ym3812_status_port_0_r, ym3812_control_port_0_w)
1196   AM_RANGE(0xec00, 0xec00) AM_WRITE(ym3812_write_port_0_w)
1197   AM_RANGE(0xf800, 0xf800) AM_READWRITE(snk_sound_status_r, snk_sound_status_w)
1198ADDRESS_MAP_END
4221199
4231200static ADDRESS_MAP_START( YM3526_Y8950_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
4241201   AM_RANGE(0x0000, 0xbfff) AM_ROM
r3115r3116
4281205   AM_RANGE(0xec00, 0xec00) AM_WRITE(ym3526_write_port_0_w)
4291206   AM_RANGE(0xf000, 0xf000) AM_READWRITE(y8950_status_port_0_r, y8950_control_port_0_w)
4301207   AM_RANGE(0xf400, 0xf400) AM_WRITE(y8950_write_port_0_w)
431   AM_RANGE(0xf800, 0xf800) AM_READWRITE(snk_sound_register_r, snk_sound_register_w)
1208   AM_RANGE(0xf800, 0xf800) AM_READWRITE(snk_sound_status_r, snk_sound_status_w)
4321209ADDRESS_MAP_END
4331210
434
4351211static ADDRESS_MAP_START( YM3812_Y8950_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
4361212   AM_RANGE(0x0000, 0xbfff) AM_ROM
4371213   AM_RANGE(0xc000, 0xcfff) AM_RAM
r3115r3116
4401216   AM_RANGE(0xec00, 0xec00) AM_WRITE(ym3812_write_port_0_w)
4411217   AM_RANGE(0xf000, 0xf000) AM_READWRITE(y8950_status_port_0_r, y8950_control_port_0_w)
4421218   AM_RANGE(0xf400, 0xf400) AM_WRITE(y8950_write_port_0_w)
443   AM_RANGE(0xf800, 0xf800) AM_READWRITE(snk_sound_register_r, snk_sound_register_w)
1219   AM_RANGE(0xf800, 0xf800) AM_READWRITE(snk_sound_status_r, snk_sound_status_w)
4441220ADDRESS_MAP_END
4451221
446
4471222static ADDRESS_MAP_START( Y8950_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
4481223   AM_RANGE(0x0000, 0xbfff) AM_ROM
4491224   AM_RANGE(0xc000, 0xcfff) AM_RAM
4501225   AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
4511226   AM_RANGE(0xf000, 0xf000) AM_READWRITE(y8950_status_port_0_r, y8950_control_port_0_w)
4521227   AM_RANGE(0xf400, 0xf400) AM_WRITE(y8950_write_port_0_w)
453   AM_RANGE(0xf800, 0xf800) AM_READWRITE(snk_sound_register_r, snk_sound_register_w)
1228   AM_RANGE(0xf800, 0xf800) AM_READWRITE(snk_sound_status_r, snk_sound_status_w)
4541229ADDRESS_MAP_END
4551230
1231/*********************************************************************/
4561232
457/**********************  Tnk3, Athena, Fighting Golf ********************/
1233static INPUT_PORTS_START( jcross )
1234   PORT_START("IN0")
1235   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1236   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1237   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1238   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
1239   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
1240   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1241   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1242   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
4581243
459static READ8_HANDLER( cpuA_io_r )
460{
461   switch( offset )
462   {
463      case 0x000: return snk_input_port_r(machine, 0);   // coin input, player start
464      case 0x100: return snk_input_port_r(machine, 1);   // joy1
465      case 0x180: return snk_input_port_r(machine, 2);   // joy2
466      case 0x200: return snk_input_port_r(machine, 3);   // joy3
467      case 0x280: return snk_input_port_r(machine, 4);   // joy4
468      case 0x300: return snk_input_port_r(machine, 5);   // aim1
469      case 0x380: return snk_input_port_r(machine, 6);   // aim2
470      case 0x400: return snk_input_port_r(machine, 7);   // aim3
471      case 0x480: return snk_input_port_r(machine, 8);   // aim4
472      case 0x500: return snk_input_port_r(machine, 9);   // unused by tdfever
473      case 0x580: return snk_input_port_r(machine, 10);   // dsw
474      case 0x600: return snk_input_port_r(machine, 11);   // dsw
475      case 0x080: return snk_input_port_r(machine, 12);   // player start (types C and D in 'fsoccer')
1244   PORT_START("IN1")
1245   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY
1246   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY
1247   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY
1248   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1249   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
1250   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
1251   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1252   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
4761253
477      case 0x700: return(snk_cpuB_nmi_trigger_r(machine, 0));
1254   PORT_START("IN2")
1255   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY PORT_COCKTAIL
1256   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_COCKTAIL
1257   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_COCKTAIL
1258   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1259   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1260   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1261   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1262   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
4781263
479      /* "Hard Flags" */
480      case 0xe00:
481      case 0xe20:
482      case 0xe40:
483      case 0xe60:
484      case 0xe80:
485      case 0xea0:
486      case 0xee0: if( hard_flags ) return 0xff;
487   }
488   return io_ram[offset];
489}
1264   PORT_START("DSW1")
1265   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Cabinet ) )          PORT_DIPLOCATION("DSW1:1,2")
1266   PORT_DIPSETTING(    0x03, "Upright, Single Controls" )
1267//  PORT_DIPSETTING(    0x01, "Upright, Single Controls" )  /* duplicated setting + unknown additional stuff (code at 0x03ff) */
1268   PORT_DIPSETTING(    0x00, "Upright, Dual Controls" )
1269   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
1270   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )            PORT_DIPLOCATION("DSW1:3")
1271   PORT_DIPSETTING(    0x04, "3" )
1272   PORT_DIPSETTING(    0x00, "5" )
1273   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coinage ) )          PORT_DIPLOCATION("DSW1:4,5,6")
1274   PORT_DIPSETTING(    0x28, DEF_STR( 3C_1C ) )
1275   PORT_DIPSETTING(    0x30, DEF_STR( 2C_1C ) )
1276   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
1277   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
1278   PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
1279   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1280//  PORT_DIPSETTING(    0x10, "INVALID !" )                 /* settings table at 0x0378 is only 5 bytes wide */
1281//  PORT_DIPSETTING(    0x08, "INVALID !" )                 /* settings table at 0x0378 is only 5 bytes wide */
1282   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_older_bonus_r, (void *)0xc0)
4901283
491static WRITE8_HANDLER( cpuA_io_w )
492{
493   switch( offset )
494   {
495      case 0x000:
496      break;
1284   PORT_START("DSW2")
1285   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_older_bonus_r, (void *)0x01)
1286   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("DSW2:2,3")
1287   PORT_DIPSETTING(    0x06, DEF_STR( Easy ) )
1288   PORT_DIPSETTING(    0x04, DEF_STR( Normal ) )
1289   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1290   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1291   PORT_DIPNAME( 0x18, 0x10, "Game mode" )                 PORT_DIPLOCATION("DSW2:4,5")
1292   PORT_DIPSETTING(    0x18, "Demo Sounds Off" )
1293   PORT_DIPSETTING(    0x10, "Demo Sounds On" )
1294   PORT_DIPSETTING(    0x00, "Freeze" )
1295   PORT_DIPSETTING(    0x08, "Infinite Lives (Cheat)" )
1296   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )      PORT_DIPLOCATION("DSW2:6")
1297   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1298   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1299   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "DSW2:7" )
1300   PORT_DIPNAME( 0x80, 0x80, "Debug Mode (No BG Collision)" ) PORT_DIPLOCATION("DSW2:8")
1301   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1302   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4971303
498      case 0x400: /* most games */
499      case 0x500: /* tdfever */
500      snk_soundlatch_w( machine, 0, data );
501      break;
1304   PORT_START("BONUS")  /* fake port to handle bonus lives settings via multiple input ports */
1305   PORT_DIPNAME( 0xc1, 0xc1, DEF_STR( Bonus_Life ) )       PORT_DIPLOCATION("DSW2:1,DSW1:7,8")
1306   PORT_DIPSETTING(    0xc1, "20k 60k 40k+" )
1307   PORT_DIPSETTING(    0x81, "40k 120k 80k+" )
1308   PORT_DIPSETTING(    0x41, "60k 160k 100k+" )
1309   PORT_DIPSETTING(    0xc0, "20k" )
1310   PORT_DIPSETTING(    0x80, "40k" )
1311   PORT_DIPSETTING(    0x40, "60k" )
1312//  PORT_DIPSETTING(    0x01, DEF_STR( None ) )             /* duplicated setting */
1313   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1314INPUT_PORTS_END
5021315
503      case 0x700:
504      snk_cpuA_nmi_ack_w(machine, 0, 0);
505      break;
5061316
507      default:
508      io_ram[offset] = data;
509      break;
510   }
511}
1317static INPUT_PORTS_START( sgladiat )
1318   PORT_START("IN0")
1319   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1320   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1321   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
1322   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
1323   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
1324   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1325   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1326   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE )            /* code at 0x054e */
5121327
513static READ8_HANDLER( cpuB_io_r )
514{
515   switch( offset )
516   {
517      case 0x000:
518      case 0x700: return(snk_cpuA_nmi_trigger_r(machine, 0));
1328   PORT_START("IN1")
1329   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY
1330   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY
1331   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY
1332   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1333   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
1334   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
1335   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1336   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
5191337
520      /* "Hard Flags" they are needed here, otherwise ikarijp/b doesn't work right */
521      case 0xe00:
522      case 0xe20:
523      case 0xe40:
524      case 0xe60:
525      case 0xe80:
526      case 0xea0:
527      case 0xee0: if( hard_flags ) return 0xff;
528   }
529   return io_ram[offset];
530}
1338   PORT_START("IN2")
1339   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY PORT_COCKTAIL
1340   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_COCKTAIL
1341   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_COCKTAIL
1342   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1343   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1344   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1345   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1346   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
5311347
532static WRITE8_HANDLER( cpuB_io_w )
533{
534   io_ram[offset] = data;
1348   PORT_START("DSW1")
1349   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "DSW1:1" )
1350   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )          PORT_DIPLOCATION("DSW1:2")
1351   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )          /* Single Controls */
1352   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
1353   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:3")
1354   PORT_DIPSETTING(    0x04, "3" )
1355   PORT_DIPSETTING(    0x00, "5" )
1356   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coinage ) )          PORT_DIPLOCATION("DSW1:4,5,6")
1357   PORT_DIPSETTING(    0x10, DEF_STR( 5C_1C ) )
1358//  PORT_DIPSETTING(    0x08, DEF_STR( 5C_1C ) )            /* duplicated setting */
1359   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1360   PORT_DIPSETTING(    0x18, DEF_STR( 2C_1C ) )
1361   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
1362   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
1363   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
1364   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1365   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_older_bonus_r, (void *)0xc0)
5351366
536   if (offset==0 || offset==0x700) snk_cpuB_nmi_ack_w(machine, 0, 0);
537}
1367   PORT_START("DSW2")
1368   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_older_bonus_r, (void *)0x01)
1369   PORT_DIPNAME( 0x02, 0x02, "Time" )                      PORT_DIPLOCATION("DSW2:2")
1370   PORT_DIPSETTING(    0x02, "More" )                      /* Hazard race 2:30 / Chariot race 3:30 */
1371   PORT_DIPSETTING(    0x00, "Less" )                      /* Hazard race 2:00 / Chariot race 3:00 */
1372   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "DSW2:3" )
1373   PORT_DIPNAME( 0x18, 0x10, "Game Mode" )                 PORT_DIPLOCATION("DSW2:4,5")
1374   PORT_DIPSETTING(    0x18, "Demo Sounds Off" )
1375   PORT_DIPSETTING(    0x10, "Demo Sounds On" )
1376   PORT_DIPSETTING(    0x00, "Freeze" )
1377   PORT_DIPSETTING(    0x08, "Infinite Lives (Cheat)")
1378   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )      PORT_DIPLOCATION("DSW2:6")
1379   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1380   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1381   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )          PORT_DIPLOCATION("DSW2:7")    /* code at 0x4169 */
1382   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1383   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1384   PORT_DIPNAME( 0x80, 0x80, "Debug Mode (No Opponents)" ) PORT_DIPLOCATION("DSW2:8")
1385   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1386   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5381387
539/**********************  Tnk3, Athena, Fighting Golf ********************/
1388   PORT_START("BONUS")  /* fake port to handle bonus lives settings via multiple input ports */
1389   PORT_DIPNAME( 0xc1, 0xc1, DEF_STR( Bonus_Life ) )       PORT_DIPLOCATION("DSW2:1,DSW1:7,8")
1390   PORT_DIPSETTING(    0xc1, "20k 60k 60k+" )
1391   PORT_DIPSETTING(    0x81, "40k 90k 90k+" )
1392   PORT_DIPSETTING(    0x41, "50k 120k 120k+" )
1393   PORT_DIPSETTING(    0xc0, "20k" )
1394   PORT_DIPSETTING(    0x80, "40k" )
1395   PORT_DIPSETTING(    0x40, "50k" )
1396//  PORT_DIPSETTING(    0x01, DEF_STR( None ) )             /* duplicated setting */
1397   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1398INPUT_PORTS_END
5401399
541static ADDRESS_MAP_START( tnk3_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
542   AM_RANGE(0x0000, 0xbfff) AM_ROM
543   AM_RANGE(0xc000, 0xcfff) AM_READWRITE(cpuA_io_r, cpuA_io_w) AM_BASE(&io_ram)
544   AM_RANGE(0xd000, 0xf7ff) AM_RAM AM_SHARE(2) AM_BASE(&snk_rambase)
545   AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE(1)
546ADDRESS_MAP_END
5471400
548static ADDRESS_MAP_START( tnk3_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
549   AM_RANGE(0x0000, 0xbfff) AM_ROM
550   AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(cpuB_io_r, cpuB_io_w)
551   AM_RANGE(0xc800, 0xefff) AM_RAM AM_SHARE(2)
552   AM_RANGE(0xf000, 0xf7ff) AM_RAM
553   AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE(1)
554ADDRESS_MAP_END
1401static INPUT_PORTS_START( aso )
1402   PORT_START("IN0")
1403   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1404   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
1405   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
1406   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
1407   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
1408   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1409   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1410   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
5551411
1412   PORT_START("IN1")
1413   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1414   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1415   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1416   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1417   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 )
1418   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
1419   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
1420   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
5561421
557/* Chopper I, T.D.Fever, Psycho S., Bermuda T. */
1422   PORT_START("IN2")
1423   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1424   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1425   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1426   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1427   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
1428   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1429   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1430   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
5581431
559static ADDRESS_MAP_START( cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
560   AM_RANGE(0x0000, 0xbfff) AM_ROM
561   AM_RANGE(0xc000, 0xcfff) AM_READWRITE(cpuA_io_r, cpuA_io_w) AM_BASE(&io_ram)
562   AM_RANGE(0xd000, 0xffff) AM_RAM AM_SHARE(1) AM_BASE(&snk_rambase)
563ADDRESS_MAP_END
1432   PORT_START("DSW1")
1433   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW1:1")
1434   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
1435   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1436   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:2")
1437   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1438   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
1439   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:3")
1440   PORT_DIPSETTING(    0x04, "3" )
1441   PORT_DIPSETTING(    0x00, "5" )
1442   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW1:4,5,6")
1443   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
1444   PORT_DIPSETTING(    0x28, DEF_STR( 3C_1C ) )
1445   PORT_DIPSETTING(    0x30, DEF_STR( 2C_1C ) )
1446   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
1447   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
1448   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
1449   PORT_DIPSETTING(    0x08, DEF_STR( 1C_4C ) )
1450   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
1451   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW1:7,8")
1452   PORT_DIPSETTING(    0xc0, "50k 100k" )
1453   PORT_DIPSETTING(    0x80, "60k 120k" )
1454   PORT_DIPSETTING(    0x40, "100k 200k" )
1455   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
5641456
565static ADDRESS_MAP_START( cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
566   AM_RANGE(0x0000, 0xbfff) AM_ROM
567   AM_RANGE(0xc000, 0xcfff) AM_READWRITE(cpuB_io_r, cpuB_io_w)
568   AM_RANGE(0xd000, 0xffff) AM_RAM AM_SHARE(1)
569ADDRESS_MAP_END
1457   PORT_START("DSW2")
1458   PORT_DIPNAME( 0x01, 0x01, "Bonus Occurrence" ) PORT_DIPLOCATION("DSW2:1")
1459   PORT_DIPSETTING(    0x01, "1st & every 2nd" )
1460   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
1461   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:2,3")
1462   PORT_DIPSETTING(    0x06, DEF_STR( Easy ) )
1463   PORT_DIPSETTING(    0x04, DEF_STR( Normal ) )
1464   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1465   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1466   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW2:4")
1467   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1468   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1469   PORT_DIPNAME( 0x10, 0x10, "Effect of some kind (Cheat)") PORT_DIPLOCATION("DSW2:5")
1470   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1471   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1472   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW2:6")
1473   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1474   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1475   PORT_DIPNAME( 0xc0, 0xc0, "Start Area" ) PORT_DIPLOCATION("DSW2:7,8")
1476   PORT_DIPSETTING(    0xc0, "1" )
1477   PORT_DIPSETTING(    0x80, "2" )
1478   PORT_DIPSETTING(    0x40, "3" )
1479   PORT_DIPSETTING(    0x00, "4" )
1480INPUT_PORTS_END
5701481
1482
1483static INPUT_PORTS_START( tnk3 )
1484   PORT_START("IN0")
1485   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1486   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1487   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
1488   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
1489   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
1490   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1491   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1492   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1493
1494   PORT_START("IN1")
1495   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1496   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1497   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1498   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1499   PORT_BIT( 0xf0, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12) \
1500
1501   PORT_START("IN2")
1502   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1503   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1504   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1505   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1506   PORT_BIT( 0xf0, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
1507
1508   PORT_START("IN3")
1509   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
1510   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1511   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1512   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1513   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1514   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1515   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1516   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1517
1518   PORT_START("DSW1")
1519   PORT_DIPNAME( 0x01, 0x01, "Walk everywhere (Cheat)") PORT_DIPLOCATION("DSW1:1")
1520   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1521   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1522   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:2")
1523   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1524   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
1525   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:3")
1526   PORT_DIPSETTING(    0x04, "3" )
1527   PORT_DIPSETTING(    0x00, "5" )
1528   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW1:4,5,6")
1529   /* 0x08 and 0x10: 1 Coin/1 Credit */
1530   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1531   PORT_DIPSETTING(    0x18, DEF_STR( 2C_1C ) )
1532   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
1533   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
1534   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
1535   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1536   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW1:7,8")
1537   PORT_DIPSETTING(    0xc0, "20k 60k" )
1538   PORT_DIPSETTING(    0x80, "40k 90k" )
1539   PORT_DIPSETTING(    0x40, "50k 120k" )
1540   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1541
1542   PORT_START("DSW2")
1543   PORT_DIPNAME( 0x01, 0x01, "Bonus Occurrence" ) PORT_DIPLOCATION("DSW2:1")
1544   PORT_DIPSETTING(    0x01, "1st & every 2nd" )
1545   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
1546   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:2,3")
1547   PORT_DIPSETTING(    0x06, DEF_STR( Easy ) )
1548   PORT_DIPSETTING(    0x04, DEF_STR( Normal ) )
1549   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1550   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1551   PORT_DIPNAME( 0x18, 0x10, "Game Mode" ) PORT_DIPLOCATION("DSW2:4,5")
1552   PORT_DIPSETTING(    0x18, "Demo Sounds Off" )
1553   PORT_DIPSETTING(    0x10, "Demo Sounds On" )
1554   PORT_DIPSETTING(    0x00, "Freeze" )
1555   PORT_DIPSETTING(    0x08, "Infinite Lives (Cheat)")
1556   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW2:6")
1557   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1558   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1559   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:7") // unused in manual
1560   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1561   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1562   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW2:8")
1563   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
1564   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1565INPUT_PORTS_END
1566
1567
1568static INPUT_PORTS_START( athena )
1569   PORT_START("IN0")
1570   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1571   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
1572   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1573   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1574   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
1575   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
1576   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1577   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1578
1579   PORT_START("IN1")
1580   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1581   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1582   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1583   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1584   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
1585   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
1586   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1587   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1588
1589   PORT_START("IN2")
1590   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1591   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1592   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1593   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1594   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1595   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1596   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1597   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1598
1599   PORT_START("IN3")
1600   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1601
1602   PORT_START("DSW1")
1603   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1") /* Listed as "Unused" in the manual */
1604   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1605   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1606   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:2")
1607   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1608   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
1609   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" ) PORT_DIPLOCATION("DSW1:3")
1610   PORT_DIPSETTING(    0x04, "1st & every 2nd" )
1611   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
1612   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
1613   PORT_DIPSETTING(    0x08, "3" )
1614   PORT_DIPSETTING(    0x00, "5" )
1615   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW1:5,6")
1616   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
1617   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
1618   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
1619   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
1620   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW1:7,8")
1621   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
1622   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1623   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
1624   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
1625
1626   PORT_START("DSW2")
1627   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:1,2")
1628   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
1629   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
1630   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
1631   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1632   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW2:3")
1633   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1634   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1635   PORT_DIPNAME( 0x08, 0x08, "Freeze" ) PORT_DIPLOCATION("DSW2:4")
1636   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1637   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1638   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW2:5,6")
1639   PORT_DIPSETTING(    0x30, "50k 100k" )
1640   PORT_DIPSETTING(    0x20, "80k 160k" )
1641   PORT_DIPSETTING(    0x10, "100k 200k" )
1642   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1643   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:7") /* Listed as "Unused" in the manual */
1644   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1645   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1646   PORT_DIPNAME( 0x80, 0x80, "Energy" ) PORT_DIPLOCATION("DSW2:8")
1647   PORT_DIPSETTING(    0x80, "12" )
1648   PORT_DIPSETTING(    0x00, "14" )
1649INPUT_PORTS_END
1650
1651
1652static INPUT_PORTS_START( fitegolf )
1653   PORT_START("IN0")
1654   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1655   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
1656   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )  /* reset */
1657   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE )   // same as the dip switch
1658   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
1659   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
1660   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1661   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1662
1663   PORT_START("IN1")
1664   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1665   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1666   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1667   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1668   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1669   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1670   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1671   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1672
1673   PORT_START("IN2")
1674   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1675   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1676   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1677   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1678   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_8WAY PORT_PLAYER(2)
1679   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_8WAY PORT_PLAYER(2)
1680   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1681   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1682
1683   PORT_START("IN3")
1684   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1685
1686   PORT_START("DSW1")
1687   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Language ) ) PORT_DIPLOCATION("DSW1:1") /* Version */
1688   PORT_DIPSETTING(    0x01, DEF_STR( English ) )  /* Over Sea */
1689   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) ) /* Domestic */
1690   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW1:2")
1691   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1692   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1693   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:3")
1694   PORT_DIPSETTING(    0x04, "Upright 2 Players" )
1695   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1696   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW1:4,5")
1697   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
1698   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
1699   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
1700   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
1701   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW1:6,7")
1702   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
1703   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1704   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
1705   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
1706
1707   PORT_START("DSW2")
1708   PORT_DIPNAME( 0x01, 0x01, "Shot Time" ) PORT_DIPLOCATION("DSW2:1")
1709   PORT_DIPSETTING(    0x00, "Short (10 sec)" )
1710   PORT_DIPSETTING(    0x01, "Long (12 sec)" )
1711   PORT_DIPNAME( 0x02, 0x02, "Bonus Holes" ) PORT_DIPLOCATION("DSW2:2")
1712   PORT_DIPSETTING(    0x02, "5 (Par 1,Birdie 2,Eagle 3)" )
1713   PORT_DIPSETTING(    0x00, "3 (Par 0,Birdie 1,Eagle 2)" )
1714   PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" ) PORT_DIPLOCATION("DSW2:3,4")
1715   PORT_DIPSETTING(    0x04, "Demo Sounds Off" )
1716   PORT_DIPSETTING(    0x0c, "Demo Sounds On" )
1717   PORT_DIPSETTING(    0x00, "Freeze" )
1718   PORT_DIPSETTING(    0x08, "Endless Game (Cheat)")
1719   PORT_DIPNAME( 0x30, 0x30, "Play Holes" ) PORT_DIPLOCATION("DSW2:5,6")
1720   PORT_DIPSETTING(    0x30, "2" )
1721   PORT_DIPSETTING(    0x20, "3" )
1722   PORT_DIPSETTING(    0x10, "4" )
1723   PORT_DIPSETTING(    0x00, "5" )
1724   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW2:7")
1725   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1726   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
1727   PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) PORT_DIPLOCATION("DSW2:8")
1728INPUT_PORTS_END
1729
1730
1731static INPUT_PORTS_START( countryc )
1732   PORT_INCLUDE( fitegolf )
1733
1734   PORT_MODIFY("IN1")
1735   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(countryc_trackball_x, 0)
1736
1737   PORT_MODIFY("IN2")
1738   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(countryc_trackball_y, 0)
1739
1740   PORT_START("TRACKBALLX1")
1741   PORT_BIT( 0x7f, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_REVERSE PORT_PLAYER(1)
1742   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1743
1744   PORT_START("TRACKBALLY1")
1745   PORT_BIT( 0x7f, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_PLAYER(1)
1746   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1747
1748   PORT_START("TRACKBALLX2")
1749   PORT_BIT( 0x7f, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_REVERSE PORT_PLAYER(2)
1750   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1751
1752   PORT_START("TRACKBALLY2")
1753   PORT_BIT( 0x7f, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_PLAYER(2)
1754   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1755
1756   PORT_MODIFY("DSW1")
1757   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Controls ) ) PORT_DIPLOCATION("DSW1:3")
1758   PORT_DIPSETTING(    0x00, DEF_STR( Single ) )
1759   PORT_DIPSETTING(    0x04, DEF_STR( Dual ) )
1760   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW1:6,7")
1761   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )
1762   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
1763   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1764   PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) )
1765INPUT_PORTS_END
1766
1767
1768static INPUT_PORTS_START( ikari )
1769   PORT_START("IN0")
1770   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1771   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
1772   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1773   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1774   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
1775   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
1776   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1777   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1778
1779   PORT_START("IN1")
1780   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1781   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1782   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1783   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1784   PORT_BIT( 0xf0, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
1785
1786   PORT_START("IN2")
1787   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1788   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1789   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1790   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1791   PORT_BIT( 0xf0, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
1792
1793   PORT_START("IN3")
1794   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1795   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1796   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1797   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1798   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1799   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1800   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1801   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1802
1803   PORT_START("DSW1")
1804   PORT_DIPNAME( 0x01, 0x01, "Allow killing each other" ) PORT_DIPLOCATION("DSW1:1")
1805   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
1806   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1807   PORT_DIPNAME( 0x02, 0x02, "P1 & P2 Fire Buttons" ) PORT_DIPLOCATION("DSW1:2")
1808   PORT_DIPSETTING(    0x02, "Separate" )
1809   PORT_DIPSETTING(    0x00, "Common" )
1810   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" ) PORT_DIPLOCATION("DSW1:3")
1811   PORT_DIPSETTING(    0x04, "1st & every 2nd" )
1812   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
1813   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
1814   PORT_DIPSETTING(    0x08, "3" )
1815   PORT_DIPSETTING(    0x00, "5" )
1816   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW1:5,6")
1817   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
1818   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
1819   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
1820   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
1821   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW1:7,8")
1822   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
1823   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1824   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
1825   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
1826
1827   PORT_START("DSW2")
1828   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:1,2")
1829   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
1830   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
1831   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
1832   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1833   PORT_DIPNAME( 0x0c, 0x08, "Game Mode" ) PORT_DIPLOCATION("DSW2:3,4")
1834   PORT_DIPSETTING(    0x0c, "Demo Sounds Off" )
1835   PORT_DIPSETTING(    0x08, "Demo Sounds On" )
1836   PORT_DIPSETTING(    0x04, "Freeze" )
1837   PORT_DIPSETTING(    0x00, "Infinite Lives (Cheat)")
1838   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW2:5,6")
1839   PORT_DIPSETTING(    0x30, "50k 100k" )
1840   PORT_DIPSETTING(    0x20, "60k 120k" )
1841   PORT_DIPSETTING(    0x10, "100k 200k" )
1842   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1843   PORT_DIPNAME( 0x40 ,0x40, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW2:7")
1844   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1845   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1846   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW2:8")
1847   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
1848   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1849INPUT_PORTS_END
1850
1851
1852static INPUT_PORTS_START( ikarijp )
1853   PORT_INCLUDE( ikari )
1854
1855   PORT_MODIFY("IN0")
1856   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1857   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1858   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1859   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
1860   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
1861   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1862   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1863   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_TILT )  /* reset */
1864
1865   PORT_MODIFY("DSW2")
1866   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:8")
1867   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1868   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1869INPUT_PORTS_END
1870
1871
1872static INPUT_PORTS_START( ikarijpb )
1873   PORT_INCLUDE( ikarijp )
1874
1875   // no rotary joystick in this version. Player fires in the direction he's facing.
1876   // this is accomplished by hooking the joystick input to the rotary input, plus
1877   // of course the code is patched to handle that.
1878
1879   PORT_MODIFY("IN1")
1880   PORT_BIT( 0x21, 0x01, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1881   PORT_BIT( 0x42, 0x02, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1882   PORT_BIT( 0x84, 0x04, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1883   PORT_BIT( 0x18, 0x08, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1884
1885   PORT_MODIFY("IN2")
1886   PORT_BIT( 0x21, 0x01, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1887   PORT_BIT( 0x42, 0x02, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1888   PORT_BIT( 0x84, 0x04, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1889   PORT_BIT( 0x18, 0x08, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1890INPUT_PORTS_END
1891
1892
1893static INPUT_PORTS_START( victroad )
1894   PORT_START("IN0")
1895   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1896   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
1897   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )  /* reset */
1898   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1899   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
1900   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
1901   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1902   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1903
1904   PORT_START("IN1")
1905   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1906   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1907   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1908   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1909   PORT_BIT( 0xf0, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
1910
1911   PORT_START("IN2")
1912   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1913   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1914   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1915   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1916   PORT_BIT( 0xf0, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
1917
1918   PORT_START("IN3")
1919   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1920   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1921   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1922   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1923   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1924   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1925   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1926   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1927
1928   PORT_START("DSW1")
1929   PORT_DIPNAME( 0x01, 0x01, "Kill friend & walk everywhere (Cheat)") PORT_DIPLOCATION("DSW1:1")
1930   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
1931   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1932   PORT_DIPNAME( 0x02, 0x02, "P1 & P2 Fire Buttons" ) PORT_DIPLOCATION("DSW1:2")
1933   PORT_DIPSETTING(    0x02, "Separate" )
1934   PORT_DIPSETTING(    0x00, "Common" )
1935   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" ) PORT_DIPLOCATION("DSW1:3")
1936   PORT_DIPSETTING(    0x04, "1st & every 2nd" )
1937   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
1938   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
1939   PORT_DIPSETTING(    0x08, "3" )
1940   PORT_DIPSETTING(    0x00, "5" )
1941   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW1:5,6")
1942   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
1943   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
1944   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
1945   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
1946   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW1:7,8")
1947   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
1948   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1949   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
1950   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
1951
1952   PORT_START("DSW2")
1953   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:1,2")
1954   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
1955   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
1956   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
1957   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1958   PORT_DIPNAME( 0x0c, 0x08, "Game Mode" ) PORT_DIPLOCATION("DSW2:3,4")
1959   PORT_DIPSETTING(    0x0c, "Demo Sounds Off" )
1960   PORT_DIPSETTING(    0x08, "Demo Sounds On" )
1961   PORT_DIPSETTING(    0x00, "Freeze" )
1962   PORT_DIPSETTING(    0x04, "Infinite Lives (Cheat)")
1963   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW2:5,6")
1964   PORT_DIPSETTING(    0x30, "50k 100k" )
1965   PORT_DIPSETTING(    0x20, "60k 120k" )
1966   PORT_DIPSETTING(    0x10, "100k 200k" )
1967   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1968   PORT_DIPNAME( 0x40 ,0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW2:7")
1969   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
1970   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1971   PORT_DIPNAME( 0x80, 0x80, "Credits Buy Lives During Play" ) PORT_DIPLOCATION("DSW2:8")
1972   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1973   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
1974INPUT_PORTS_END
1975
1976
1977static INPUT_PORTS_START( dogosokb )
1978   PORT_INCLUDE( victroad )
1979
1980   // no rotary joystick in this version. Player fires in the direction he's facing.
1981
1982   PORT_MODIFY("IN1")
1983   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
1984
1985   PORT_MODIFY("IN2")
1986   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
1987
1988   PORT_MODIFY("DSW2")
1989   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:8")
1990   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1991   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1992INPUT_PORTS_END
1993
1994
1995static INPUT_PORTS_START( bermudat )
1996   PORT_START("IN0")
1997   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1998   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
1999   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* tilt? */
2000   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2001   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2002   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2003   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2004   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2005
2006   PORT_START("IN1")
2007   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2008   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2009   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2010   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2011   PORT_BIT( 0xf0, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
2012
2013   PORT_START("IN2")
2014   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2015   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2016   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2017   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2018   PORT_BIT( 0xf0, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
2019
2020   PORT_START("IN3")
2021   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2022   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2023   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2024   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2025   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2026   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2027   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2028   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2029
2030   PORT_START("DSW1")
2031   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW1:1")
2032   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2033   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2034   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW1:2")
2035   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2036   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2037   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" ) PORT_DIPLOCATION("DSW1:3")
2038   PORT_DIPSETTING(    0x04, "1st & every 2nd" )
2039   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
2040   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
2041   PORT_DIPSETTING(    0x08, "3" )
2042   PORT_DIPSETTING(    0x00, "5" )
2043   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW1:5,6")
2044   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
2045   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
2046   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
2047   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
2048   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW1:7,8")
2049   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
2050   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
2051   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
2052   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
2053
2054   PORT_START("DSW2")
2055   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:1,2")
2056   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
2057   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
2058   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
2059   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2060   PORT_DIPNAME( 0x0c, 0x08, "Game Mode" ) PORT_DIPLOCATION("DSW2:3,4")
2061   PORT_DIPSETTING(    0x0c, "Demo Sounds Off" )
2062   PORT_DIPSETTING(    0x08, "Demo Sounds On" )
2063   PORT_DIPSETTING(    0x00, "Freeze" )
2064   PORT_DIPSETTING(    0x04, "Infinite Lives (Cheat)")
2065   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW2:5,6")
2066   PORT_DIPSETTING(    0x30, "50k 100k" )
2067   PORT_DIPSETTING(    0x20, "60k 120k" )
2068   PORT_DIPSETTING(    0x10, "100k 200k" )
2069   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
2070   PORT_DIPNAME( 0xc0, 0xc0, "Game Style" ) PORT_DIPLOCATION("DSW2:7,8")
2071   PORT_DIPSETTING(    0xc0, "Normal without continue" )
2072   PORT_DIPSETTING(    0x80, "Normal with continue" )
2073   PORT_DIPSETTING(    0x40, "Time attack 3 minutes" )
2074   PORT_DIPSETTING(    0x00, "Time attack 5 minutes" )
2075INPUT_PORTS_END
2076
2077
2078static INPUT_PORTS_START( worldwar )
2079   PORT_INCLUDE( bermudat )
2080
2081   PORT_MODIFY("IN0")
2082   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
2083
2084   PORT_MODIFY("DSW1")
2085   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW1:1")
2086   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
2087   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
2088
2089   PORT_MODIFY("DSW2")
2090   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW2:5,6")
2091   PORT_DIPSETTING(    0x30, "50k 100k" )
2092   PORT_DIPSETTING(    0x20, "80k 160k" )
2093   PORT_DIPSETTING(    0x10, "100k 200k" )
2094   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
2095   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW2:7")
2096   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2097   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2098   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW2:8")
2099   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2100   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2101INPUT_PORTS_END
2102
2103
2104static INPUT_PORTS_START( bermudaa )
2105   PORT_INCLUDE( worldwar )
2106
2107   PORT_MODIFY("DSW2")
2108   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW2:5,6")
2109   PORT_DIPSETTING(    0x30, "25k 50k" )
2110   PORT_DIPSETTING(    0x20, "35k 70k" )
2111   PORT_DIPSETTING(    0x10, "50K 100k" )
2112   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
2113INPUT_PORTS_END
2114
2115
2116static INPUT_PORTS_START( gwar )
2117   PORT_START("IN0")
2118   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2119   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
2120   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )   /* tilt? causes reset */
2121   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
2122   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2123   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2124   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2125   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2126
2127   PORT_START("IN1")
2128   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2129   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2130   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2131   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2132   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gwar_rotary, (void*)0)
2133
2134   PORT_START("P1ROT")
2135   PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
2136
2137   PORT_START("IN2")
2138   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2139   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2140   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2141   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2142   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gwar_rotary, (void*)1)
2143
2144   PORT_START("P2ROT")
2145   PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
2146
2147   PORT_START("IN3")
2148   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2149   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2150   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2151   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2152   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2153   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2154   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2155   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2156
2157   PORT_START("DSW1")
2158   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW1:1")
2159   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2160   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
2161   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW1:2")
2162   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2163   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2164   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" ) PORT_DIPLOCATION("DSW1:3")
2165   PORT_DIPSETTING(    0x04, "1st & 2nd only" )
2166   PORT_DIPSETTING(    0x00, "1st & every 2nd" )
2167   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
2168   PORT_DIPSETTING(    0x08, "3" )
2169   PORT_DIPSETTING(    0x00, "5" )
2170   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW1:5,6")
2171   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
2172   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
2173   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
2174   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
2175   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW1:7,8")
2176   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
2177   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
2178   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
2179   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
2180
2181   PORT_START("DSW2")
2182   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:1,2")
2183   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
2184   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
2185   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
2186   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2187   PORT_DIPNAME( 0x0c, 0x08, "Game Mode" ) PORT_DIPLOCATION("DSW2:3,4")
2188   PORT_DIPSETTING(    0x0c, "Demo Sounds Off" )
2189   PORT_DIPSETTING(    0x08, "Demo Sounds On" )
2190   PORT_DIPSETTING(    0x00, "Freeze" )
2191   PORT_DIPSETTING(    0x04, "Infinite Lives (Cheat)")
2192   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW2:5,6")
2193   PORT_DIPSETTING(    0x30, "30k 60k" )
2194   PORT_DIPSETTING(    0x20, "40k 80k" )
2195   PORT_DIPSETTING(    0x10, "50k 100k" )
2196   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
2197   PORT_DIPNAME( 0x40 ,0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:7")
2198   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2199   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2200   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:8")
2201   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2202   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2203INPUT_PORTS_END
2204
2205
2206static INPUT_PORTS_START( psychos )
2207   PORT_START("IN0")
2208   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2209   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2210   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )  /* reset */
2211   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2212   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2213   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2214   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2215   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2216
2217   PORT_START("IN1")
2218   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2219   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2220   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2221   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2222   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2223   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2224   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2225   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2226
2227   PORT_START("IN2")
2228   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2229   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2230   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2231   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2232   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2233   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2234   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2235   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2236
2237   PORT_START("IN3")
2238   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2239
2240   PORT_START("DSW1")
2241   PORT_SERVICE( 0x01, IP_ACTIVE_LOW ) PORT_DIPLOCATION("DSW1:1")
2242   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW1:2")
2243   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2244   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2245   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" ) PORT_DIPLOCATION("DSW1:3")
2246   PORT_DIPSETTING(    0x00, "1st & every 2nd" )
2247   PORT_DIPSETTING(    0x04, "1st & 2nd only" )
2248   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
2249   PORT_DIPSETTING(    0x08, "3" )
2250   PORT_DIPSETTING(    0x00, "5" )
2251   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW1:5,6")
2252   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
2253   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
2254   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
2255   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
2256   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW1:7,8")
2257   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
2258   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
2259   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
2260   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
2261
2262   PORT_START("DSW2")
2263   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:1,2")
2264   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
2265   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
2266   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
2267   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2268   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW2:3")
2269   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2270   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
2271   PORT_DIPNAME( 0x08, 0x08, "Freeze" ) PORT_DIPLOCATION("DSW2:4")
2272   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2273   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2274   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW2:5,6")
2275   PORT_DIPSETTING(    0x30, "50K 100K" )
2276   PORT_DIPSETTING(    0x20, "60K 120K" )
2277   PORT_DIPSETTING(    0x10, "100K 200K" )
2278   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
2279   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW2:7")
2280   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
2281   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
2282   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW2:8")
2283   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2284   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2285INPUT_PORTS_END
2286
2287
2288static INPUT_PORTS_START( chopper )
2289   PORT_START("IN0")
2290   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2291   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
2292   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )  /* Reset */
2293   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
2294   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2295   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2296   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2297   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2298
2299   PORT_START("IN1")
2300   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
2301   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
2302   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
2303   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
2304   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
2305   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
2306   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
2307   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
2308
2309   PORT_START("IN2")
2310   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
2311   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
2312   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2313   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
2314   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
2315   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2316   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2317   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2318
2319   PORT_START("IN3")
2320   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2321
2322   PORT_START("DSW1")
2323   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW1:1")
2324   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2325   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2326   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:2")
2327   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
2328   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
2329   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" ) PORT_DIPLOCATION("DSW1:3")
2330   PORT_DIPSETTING(    0x00, "1st & every 2nd" )
2331   PORT_DIPSETTING(    0x04, "1st & 2nd only" )
2332   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4")
2333   PORT_DIPSETTING(    0x08, "3" )
2334   PORT_DIPSETTING(    0x00, "5" )
2335   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW1:5,6")
2336   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
2337   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
2338   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
2339   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
2340   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW1:7,8")
2341   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
2342   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
2343   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
2344   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
2345
2346   PORT_START("DSW2")
2347   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:1,2")
2348   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
2349   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
2350   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
2351   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2352   PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" ) PORT_DIPLOCATION("DSW2:3,4")
2353   PORT_DIPSETTING(    0x08, "Demo Sounds Off" )
2354   PORT_DIPSETTING(    0x0c, "Demo Sounds On" )
2355   PORT_DIPSETTING(    0x00, "Freeze" )
2356   PORT_DIPSETTING(    0x04, "Infinite Lives (Cheat)")
2357   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW2:5,6")
2358   PORT_DIPSETTING(    0x30, "50k 100k" )
2359   PORT_DIPSETTING(    0x20, "75k 150k" )
2360   PORT_DIPSETTING(    0x10, "100k 200k" )
2361   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
2362   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW2:7")
2363   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2364   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
2365   PORT_DIPNAME( 0x80, 0x80, "Invulnerability (Cheat)") PORT_DIPLOCATION("DSW2:8")
2366   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2367   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2368INPUT_PORTS_END
2369
2370static INPUT_PORTS_START( choppera )
2371   PORT_INCLUDE( chopper )
2372
2373   // P1 and P2 inputs are split in two ports
2374
2375   PORT_MODIFY("IN1")
2376   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
2377   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
2378   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
2379   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
2380   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
2381
2382   PORT_MODIFY("IN2")
2383   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
2384   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
2385   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
2386   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
2387   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
2388
2389   PORT_MODIFY("IN3")
2390   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
2391   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
2392   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2393   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
2394   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
2395   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2396   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2397   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2398INPUT_PORTS_END
2399
2400
2401static INPUT_PORTS_START( tdfever )
2402   PORT_START("IN0")
2403   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2404   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
2405   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2406   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2407   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
2408   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
2409   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A")
2410   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Start Game B")
2411
2412   PORT_START("IN1")
2413   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2414   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2415   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2416   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2417   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2418   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2419   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 ) PORT_NAME("Start Game C")
2420   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 ) PORT_NAME("Start Game D")
2421
2422   PORT_START("IN2")
2423   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2424   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2425   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2426   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2427   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2428   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2429   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2430   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2431
2432   PORT_START("IN3")
2433   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2434   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2435   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2436   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2437   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2438   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2439   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2440   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2441
2442   PORT_START("IN4")
2443   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
2444   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
2445   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2446   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START5 ) PORT_NAME("Start Game E")
2447   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
2448   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
2449   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
2450   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
2451
2452   PORT_START("IN5")
2453   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
2454   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
2455   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2456   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2457   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
2458   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
2459   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
2460   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
2461
2462   PORT_START("IN6")
2463   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_PLAYER(1)
2464   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
2465
2466   PORT_START("IN7")
2467   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2)
2468   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
2469
2470   PORT_START("IN8")
2471   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(3)
2472   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
2473
2474   PORT_START("IN9")
2475   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(4)
2476   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
2477
2478   PORT_START("DSW1")
2479   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW1:1")
2480   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
2481   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
2482   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:2")
2483   PORT_DIPSETTING(    0x02, "2 Player Upright" )
2484   PORT_DIPSETTING(    0x00, "4 Player Cocktail" )
2485   PORT_DIPNAME( 0x0c, 0x00, "1st Down Bonus Time" ) PORT_DIPLOCATION("DSW1:3,4")
2486   PORT_DIPSETTING(    0x00, "Every 1st Down" )
2487   PORT_DIPSETTING(    0x04, "Every 4 1st Downs" )
2488   PORT_DIPSETTING(    0x08, "Every 6 1st Downs" )
2489   PORT_DIPSETTING(    0x0c, "Every 8 1st Downs" )
2490   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW1:5,6")
2491   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
2492   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
2493   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
2494   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
2495   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW1:7,8")   /* Manual shows these two as blank */
2496   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
2497   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
2498   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
2499   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
2500
2501   PORT_START("DSW2")
2502   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:1,2")
2503   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
2504   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
2505   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
2506   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2507   PORT_DIPNAME( 0x0c, 0x08, "Game Mode" ) PORT_DIPLOCATION("DSW2:3,4")
2508   PORT_DIPSETTING(    0x0c, "Demo Sound Off" )
2509   PORT_DIPSETTING(    0x08, "Demo Sound On" )
2510   PORT_DIPSETTING(    0x00, "Freeze" )
2511   PORT_DIPSETTING(    0x04, "Never Finish (Cheat)")
2512/*
2513Actual Play Times listed in manual based on Players & cabinet type:
2514
2515                Upright/Cocktail     Cocktail Only
2516 Dip Switch       A       B         C      D      E    <-- Start button "MODE"
2517 SW6 SW7 SW8    1PvsCPU 2PvsCPU   1Pvs2P 2Pvs1P 2Pvs2P
2518 OFF OFF OFF     1:00    1:10      2:00   2:10   3:00
2519 ON  OFF OFF     1:10    1:20      2:10   2:20   3:10
2520 OFF ON  OFF     1:20    1:30      2:20   2:30   3:20
2521 ON  ON  OFF     1:30    1:40      2:30   2:40   3:30
2522 OFF OFF ON      1:40    1:50      2:40   2:50   3:40
2523 ON  OFF ON      1:50    2:00      2:50   3:00   3:50
2524 OFF ON  ON      2:00    2:10      3:00   3:10   4:00
2525 ON  ON  ON      2:10    2:20      3:10   3:20   4:10
2526*/
2527   PORT_DIPNAME( 0x70, 0x70, "Play Time (Type A)" ) PORT_DIPLOCATION("DSW2:5,6,7")
2528   PORT_DIPSETTING(    0x70, "1:00" )
2529   PORT_DIPSETTING(    0x60, "1:10" )
2530   PORT_DIPSETTING(    0x50, "1:20" )
2531   PORT_DIPSETTING(    0x40, "1:30" )
2532   PORT_DIPSETTING(    0x30, "1:40" )
2533   PORT_DIPSETTING(    0x20, "1:50" )
2534   PORT_DIPSETTING(    0x10, "2:00" )
2535   PORT_DIPSETTING(    0x00, "2:10" )
2536   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW2:8")
2537   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2538   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2539INPUT_PORTS_END
2540
2541
2542static INPUT_PORTS_START( fsoccer )
2543   PORT_START("IN0")
2544   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2545   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE )   // same as the dip switch
2546   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2547   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2548   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
2549   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
2550   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A")
2551   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Start Game B")
2552
2553   PORT_START("IN1")
2554   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2555   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2556   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2557   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2558   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2559   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2560   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 ) PORT_NAME("Start Game C")
2561   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 ) PORT_NAME("Start Game D")
2562
2563   PORT_START("IN2")
2564   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2565   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2566   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2567   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2568   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2569   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2570   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2571   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2572
2573   PORT_START("IN3")
2574   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2575   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2576   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2577   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2578   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2579   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2580   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2581   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2582
2583   PORT_START("IN4")
2584   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
2585   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
2586   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2587   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START5 ) PORT_NAME("Start Game E")
2588   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
2589   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
2590   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
2591   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
2592
2593   PORT_START("IN5")
2594   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
2595   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
2596   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2597   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2598   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
2599   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
2600   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
2601   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
2602
2603   PORT_START("IN6")
2604   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_PLAYER(1)
2605   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
2606
2607   PORT_START("IN7")
2608   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2)
2609   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
2610
2611   PORT_START("IN8")
2612   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(3)
2613   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
2614
2615   PORT_START("IN9")
2616   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(4)
2617   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
2618
2619   PORT_START("DSW1")
2620   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:1,2")
2621   PORT_DIPSETTING(    0x03, "Upright (With VS)" )
2622   PORT_DIPSETTING(    0x02, "Upright (Without VS)" )
2623   PORT_DIPSETTING(    0x00, "Cocktail (2 Players)" )
2624   PORT_DIPSETTING(    0x01, "Cocktail (4 Players)" )
2625   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Version ) ) PORT_DIPLOCATION("DSW1:3,4")
2626   PORT_DIPSETTING(    0x04, DEF_STR( Europe ) )
2627   PORT_DIPSETTING(    0x00, DEF_STR( USA ) )
2628   PORT_DIPSETTING(    0x08, DEF_STR( Japan ) )
2629//  PORT_DIPSETTING(    0x0c, DEF_STR( Europe ) )
2630   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW1:5,6")
2631   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
2632   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
2633   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
2634   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
2635   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW1:7,8")
2636   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
2637   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
2638   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
2639   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
2640
2641   PORT_START("DSW2")
2642   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DSW2:1")
2643   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2644   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
2645   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW2:2")
2646   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2647   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2648   PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" ) PORT_DIPLOCATION("DSW2:3,4")
2649   PORT_DIPSETTING(    0x08, "Demo Sound Off" )
2650   PORT_DIPSETTING(    0x0c, "Demo Sound On" )
2651   PORT_DIPSETTING(    0x00, "Freeze" )
2652   PORT_DIPSETTING(    0x04, "Win Match Against CPU (Cheat)")
2653/*
2654Dip Switch settings are the time for match type A. Here is what you
2655have to add for games B to E :
2656
2657Match Type       B        C        D        E
2658Time to add    00:30    01:00    01:30    02:00
2659*/
2660   PORT_DIPNAME( 0x70, 0x70, "Play Time (Type A)" ) PORT_DIPLOCATION("DSW2:5,6,7")
2661   PORT_DIPSETTING(    0x10, "1:00" )
2662   PORT_DIPSETTING(    0x60, "1:10" )
2663   PORT_DIPSETTING(    0x50, "1:20" )
2664   PORT_DIPSETTING(    0x40, "1:30" )
2665   PORT_DIPSETTING(    0x30, "1:40" )
2666   PORT_DIPSETTING(    0x20, "1:50" )
2667   PORT_DIPSETTING(    0x70, "2:00" )
2668   PORT_DIPSETTING(    0x00, "2:10" )
2669   PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) PORT_DIPLOCATION("DSW2:8")
2670INPUT_PORTS_END
2671
2672
2673static INPUT_PORTS_START( fsoccerb )
2674
2675   PORT_INCLUDE( fsoccer )
2676
2677   // no spinners in this version. Player shoots in the direction he's facing
2678   // (see the 'jmp' instruction at 0x00f1)
2679
2680   PORT_MODIFY("IN6")
2681   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2682
2683   PORT_MODIFY("IN7")
2684   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2685
2686   PORT_MODIFY("IN8")
2687   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2688
2689   PORT_MODIFY("IN9")
2690   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2691INPUT_PORTS_END
2692
2693
5712694/*********************************************************************/
5722695
5732696static const gfx_layout charlayout_4bpp =
r3115r3116
6702793/*********************************************************************/
6712794
6722795static GFXDECODE_START( tnk3 )
673   GFXDECODE_ENTRY( "gfx1", 0, charlayout_4bpp,   0x180, 0x080>>4 )
674   GFXDECODE_ENTRY( "gfx2", 0, charlayout_4bpp,   0x080, 0x100>>4 )
675   GFXDECODE_ENTRY( "gfx3", 0, spritelayout_3bpp, 0x000, 0x080>>3 )
2796   GFXDECODE_ENTRY( "fg_tiles",   0, charlayout_4bpp,   0x180, 0x080>>4 )
2797   GFXDECODE_ENTRY( "bg_tiles",   0, charlayout_4bpp,   0x080, 0x100>>4 )
2798   GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_3bpp, 0x000, 0x080>>3 )
6762799   /* colors 0x200-0x3ff contain shadows */
6772800GFXDECODE_END
6782801
6792802static GFXDECODE_START( ikari )
680   GFXDECODE_ENTRY( "gfx1", 0, charlayout_4bpp,      0x100, 0x100>>4 )
681   GFXDECODE_ENTRY( "gfx2", 0, tilelayout_4bpp,      0x100, 0x100>>4 )
682   GFXDECODE_ENTRY( "gfx3", 0, spritelayout_3bpp,    0x000, 0x080>>3 )
683   GFXDECODE_ENTRY( "gfx4", 0, bigspritelayout_3bpp, 0x080, 0x080>>3 )
2803   GFXDECODE_ENTRY( "fg_tiles",   0, charlayout_4bpp,      0x180, 0x080>>4 )
2804   GFXDECODE_ENTRY( "bg_tiles",   0, tilelayout_4bpp,      0x100, 0x080>>4 )
2805   GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_3bpp,    0x000, 0x080>>3 )
2806   GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_3bpp, 0x080, 0x080>>3 )
6842807   /* colors 0x200-0x3ff contain shadows */
6852808GFXDECODE_END
6862809
6872810static GFXDECODE_START( gwar )
688   GFXDECODE_ENTRY( "gfx1", 0, charlayout_4bpp,      0x000, 0x100>>4 )
689   GFXDECODE_ENTRY( "gfx2", 0, tilelayout_4bpp,      0x300, 0x100>>4 )
690   GFXDECODE_ENTRY( "gfx3", 0, spritelayout_4bpp,    0x100, 0x100>>4 )
691   GFXDECODE_ENTRY( "gfx4", 0, bigspritelayout_4bpp, 0x200, 0x100>>4 )
2811   GFXDECODE_ENTRY( "fg_tiles",   0, charlayout_4bpp,      0x000, 0x100>>4 )
2812   GFXDECODE_ENTRY( "bg_tiles",   0, tilelayout_4bpp,      0x300, 0x100>>4 )
2813   GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_4bpp,    0x100, 0x080>>4 )
2814   GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_4bpp, 0x200, 0x100>>4 )
2815   /* what about colors 0x180-0x1ff? */
6922816GFXDECODE_END
6932817
6942818static GFXDECODE_START( tdfever )
695   GFXDECODE_ENTRY( "gfx1", 0, charlayout_4bpp,      0x000, 0x100>>4 )
696   GFXDECODE_ENTRY( "gfx2", 0, tilelayout_4bpp,      0x200, 0x100>>4 )
697   GFXDECODE_ENTRY( "gfx3", 0, bigspritelayout_4bpp, 0x100, 0x100>>4 )
2819   GFXDECODE_ENTRY( "fg_tiles",   0, charlayout_4bpp,      0x000, 0x100>>4 )
2820   GFXDECODE_ENTRY( "bg_tiles",   0, tilelayout_4bpp,      0x200, 0x100>>4 )
2821   GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_4bpp, 0x100, 0x100>>4 )
6982822   /* colors 0x300-0x3ff contain shadows */
6992823GFXDECODE_END
7002824
7012825/**********************************************************************/
7022826
703static MACHINE_DRIVER_START( tnk3 )
2827static MACHINE_DRIVER_START( jcross )
7042828
7052829   /* basic machine hardware */
706   MDRV_CPU_ADD("main", Z80, XTAL_13_4MHz/4) /* verified on pcb */
707   MDRV_CPU_PROGRAM_MAP(tnk3_cpuA_map,0)
2830   MDRV_CPU_ADD("main", Z80, 3250000) /* NOT verified */
2831   MDRV_CPU_PROGRAM_MAP(jcross_cpuA_map,0)
7082832   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
7092833
710   MDRV_CPU_ADD("sub", Z80, XTAL_13_4MHz/4) /* verified on pcb */
711   MDRV_CPU_PROGRAM_MAP(tnk3_cpuB_map,0)
2834   MDRV_CPU_ADD("sub", Z80, 3250000) /* NOT verified */
2835   MDRV_CPU_PROGRAM_MAP(jcross_cpuB_map,0)
7122836   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
7132837
714   MDRV_CPU_ADD("audio", Z80, XTAL_8MHz/2) /* verified on pcb */
715   MDRV_CPU_PROGRAM_MAP(YM3526_sound_map,0)
716   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)
2838   MDRV_CPU_ADD("audio", Z80, 4000000) /* NOT verified */
2839   MDRV_CPU_PROGRAM_MAP(jcross_sound_map,0)
2840   MDRV_CPU_IO_MAP(jcross_sound_portmap,0)
2841   MDRV_CPU_PERIODIC_INT(irq0_line_assert, 244)   // Marvin's frequency, sounds ok
7172842
7182843   MDRV_INTERLEAVE(100)
7192844
r3115r3116
7222847
7232848   MDRV_SCREEN_ADD("main", RASTER)
7242849   MDRV_SCREEN_REFRESH_RATE(60)
725   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
7262850   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
7272851   MDRV_SCREEN_SIZE(36*8, 28*8)
7282852   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 28*8-1)
r3115r3116
7302854   MDRV_GFXDECODE(tnk3)
7312855   MDRV_PALETTE_LENGTH(0x400)
7322856
733   MDRV_PALETTE_INIT(aso)
734   MDRV_VIDEO_START(snk_3bpp_shadow)
2857   MDRV_PALETTE_INIT(tnk3)
2858   MDRV_VIDEO_START(jcross)
7352859   MDRV_VIDEO_UPDATE(tnk3)
7362860
7372861   /* sound hardware */
7382862   MDRV_SPEAKER_STANDARD_MONO("mono")
7392863
740   MDRV_SOUND_ADD("ym", YM3526, XTAL_8MHz/2) /* verified on pcb */
741   MDRV_SOUND_CONFIG(ym3526_interface_0)
742   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2864   MDRV_SOUND_ADD("ay1", AY8910, 2000000)   /* NOT verified */
2865   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
2866
2867   MDRV_SOUND_ADD("ay2", AY8910, 2000000)   /* NOT verified */
2868   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
2869
2870   MDRV_SOUND_ADD("namco", NAMCO, 24000)
2871   MDRV_SOUND_CONFIG(snkwave_interface)
2872   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.08)
7432873MACHINE_DRIVER_END
7442874
7452875
746static MACHINE_DRIVER_START( athena )
2876static MACHINE_DRIVER_START( sgladiat )
7472877
2878   MDRV_IMPORT_FROM(jcross)
2879
7482880   /* basic machine hardware */
2881   MDRV_CPU_MODIFY("main")
2882   MDRV_CPU_PROGRAM_MAP(sgladiat_cpuA_map,0)
2883
2884   MDRV_CPU_MODIFY("sub")
2885   MDRV_CPU_PROGRAM_MAP(sgladiat_cpuB_map,0)
2886
2887   MDRV_CPU_MODIFY("audio")
2888   MDRV_CPU_PROGRAM_MAP(sgladiat_sound_map,0)
2889
2890   /* video hardware */
2891   /* visible area is correct. Debug info is shown in the black bars at the sides
2892       of the screen when the Debug dip switch is on */
2893
2894   MDRV_VIDEO_START(sgladiat)
2895
2896   /* sound hardware */
2897   MDRV_SOUND_REMOVE("namco")
2898MACHINE_DRIVER_END
2899
2900
2901static MACHINE_DRIVER_START( tnk3 )
2902
2903   /* basic machine hardware */
7492904   MDRV_CPU_ADD("main", Z80, XTAL_13_4MHz/4) /* verified on pcb */
7502905   MDRV_CPU_PROGRAM_MAP(tnk3_cpuA_map,0)
7512906   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
r3115r3116
7552910   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
7562911
7572912   MDRV_CPU_ADD("audio", Z80, XTAL_8MHz/2) /* verified on pcb */
758   MDRV_CPU_PROGRAM_MAP(YM3526_YM3526_sound_map,0)
759   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2)
2913   MDRV_CPU_PROGRAM_MAP(tnk3_YM3526_sound_map,0)
7602914
761   MDRV_INTERLEAVE(300)
2915   MDRV_INTERLEAVE(100)
7622916
7632917   /* video hardware */
7642918   MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
7652919
7662920   MDRV_SCREEN_ADD("main", RASTER)
7672921   MDRV_SCREEN_REFRESH_RATE(60)
768   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
7692922   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
7702923   MDRV_SCREEN_SIZE(36*8, 28*8)
7712924   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 28*8-1)
r3115r3116
7732926   MDRV_GFXDECODE(tnk3)
7742927   MDRV_PALETTE_LENGTH(0x400)
7752928
776   MDRV_PALETTE_INIT(aso)
777   MDRV_VIDEO_START(snk_3bpp_shadow)
778   MDRV_VIDEO_UPDATE(athena)
2929   MDRV_PALETTE_INIT(tnk3)
2930   MDRV_VIDEO_START(tnk3)
2931   MDRV_VIDEO_UPDATE(tnk3)
7792932
7802933   /* sound hardware */
7812934   MDRV_SPEAKER_STANDARD_MONO("mono")
7822935
7832936   MDRV_SOUND_ADD("ym1", YM3526, XTAL_8MHz/2) /* verified on pcb */
784   MDRV_SOUND_CONFIG(ym3526_interface_0)
785   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
786
787   MDRV_SOUND_ADD("ym2", YM3526, XTAL_8MHz/2) /* verified on pcb */
788   MDRV_SOUND_CONFIG(ym3526_interface_1)
789   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2937   MDRV_SOUND_CONFIG(ym3526_config_1)
2938   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
7902939MACHINE_DRIVER_END
7912940
7922941
793static MACHINE_DRIVER_START( ikari )
2942static MACHINE_DRIVER_START( aso )
7942943
2944   MDRV_IMPORT_FROM(tnk3)
2945
7952946   /* basic machine hardware */
796   MDRV_CPU_ADD("main", Z80, XTAL_13_4MHz/4) /* verified on pcb */
797   MDRV_CPU_PROGRAM_MAP(cpuA_map,0)
798   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
2947   MDRV_CPU_MODIFY("main")
2948   MDRV_CPU_PROGRAM_MAP(aso_cpuA_map,0)
7992949
800   MDRV_CPU_ADD("sub", Z80, XTAL_13_4MHz/4) /* verified on pcb */
801   MDRV_CPU_PROGRAM_MAP(cpuB_map,0)
802   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
2950   MDRV_CPU_MODIFY("sub")
2951   MDRV_CPU_PROGRAM_MAP(aso_cpuB_map,0)
8032952
804   MDRV_CPU_ADD("audio", Z80, XTAL_8MHz/2) /* verified on pcb */
805   MDRV_CPU_PROGRAM_MAP(YM3526_YM3526_sound_map,0)
806   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
2953   MDRV_CPU_MODIFY("audio")
2954   MDRV_CPU_PROGRAM_MAP(aso_YM3526_sound_map,0)
8072955
808   MDRV_INTERLEAVE(100)
809
8102956   /* video hardware */
811   MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
2957   MDRV_VIDEO_START(aso)
2958MACHINE_DRIVER_END
8122959
813   MDRV_SCREEN_ADD("main", RASTER)
814   MDRV_SCREEN_REFRESH_RATE(60)
815   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
816   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
817   MDRV_SCREEN_SIZE(36*8, 28*8)
818   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 28*8-1)
8192960
820   MDRV_GFXDECODE(ikari)
821   MDRV_PALETTE_LENGTH(0x400)
2961static MACHINE_DRIVER_START( athena )
8222962
823   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
824   MDRV_VIDEO_START(snk_3bpp_shadow)
825   MDRV_VIDEO_UPDATE(ikari)
2963   MDRV_IMPORT_FROM(tnk3)
8262964
2965   /* basic machine hardware */
2966   MDRV_CPU_MODIFY("audio")
2967   MDRV_CPU_PROGRAM_MAP(YM3526_YM3526_sound_map,0)
2968
8272969   /* sound hardware */
828   MDRV_SPEAKER_STANDARD_MONO("mono")
2970   MDRV_SOUND_ADD("ym2", YM3526, XTAL_8MHz/2) /* verified on pcb */
2971   MDRV_SOUND_CONFIG(ym3526_config_2)
2972   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
2973MACHINE_DRIVER_END
8292974
830   MDRV_SOUND_ADD("ym1", YM3526, XTAL_8MHz/2) /* verified on pcb */
831   MDRV_SOUND_CONFIG(ym3526_interface_0)
832   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
8332975
834   MDRV_SOUND_ADD("ym2", YM3526, XTAL_8MHz/2) /* verified on pcb */
835   MDRV_SOUND_CONFIG(ym3526_interface_1)
836   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2976static MACHINE_DRIVER_START( fitegolf )
2977
2978   MDRV_IMPORT_FROM(tnk3)
2979
2980   /* basic machine hardware */
2981   MDRV_CPU_MODIFY("audio")
2982   // xtal is 4MHz instead of 8MHz/2 but the end result is the same
2983   MDRV_CPU_PROGRAM_MAP(YM3812_sound_map,0)
2984
2985   /* sound hardware */
2986   MDRV_SOUND_REPLACE("ym1", YM3812, XTAL_4MHz) /* verified on pcb */
2987   MDRV_SOUND_CONFIG(ym3812_config_1)
2988   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
8372989MACHINE_DRIVER_END
8382990
8392991
840static MACHINE_DRIVER_START( victroad )
2992static MACHINE_DRIVER_START( ikari )
8412993
8422994   /* basic machine hardware */
8432995   MDRV_CPU_ADD("main", Z80, XTAL_13_4MHz/4) /* verified on pcb */
844   MDRV_CPU_PROGRAM_MAP(cpuA_map,0)
2996   MDRV_CPU_PROGRAM_MAP(ikari_cpuA_map,0)
8452997   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
8462998
8472999   MDRV_CPU_ADD("sub", Z80, XTAL_13_4MHz/4) /* verified on pcb */
848   MDRV_CPU_PROGRAM_MAP(cpuB_map,0)
3000   MDRV_CPU_PROGRAM_MAP(ikari_cpuB_map,0)
8493001   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
8503002
8513003   MDRV_CPU_ADD("audio", Z80, XTAL_8MHz/2) /* verified on pcb */
852   MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0)
853   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
3004   MDRV_CPU_PROGRAM_MAP(YM3526_YM3526_sound_map,0)
8543005
8553006   MDRV_INTERLEAVE(100)
8563007
r3115r3116
8593010
8603011   MDRV_SCREEN_ADD("main", RASTER)
8613012   MDRV_SCREEN_REFRESH_RATE(60)
862   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
8633013   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
8643014   MDRV_SCREEN_SIZE(36*8, 28*8)
8653015   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 28*8-1)
r3115r3116
8683018   MDRV_PALETTE_LENGTH(0x400)
8693019
8703020   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
871   MDRV_VIDEO_START(snk_3bpp_shadow)
3021   MDRV_VIDEO_START(ikari)
8723022   MDRV_VIDEO_UPDATE(ikari)
8733023
8743024   /* sound hardware */
8753025   MDRV_SPEAKER_STANDARD_MONO("mono")
8763026
8773027   MDRV_SOUND_ADD("ym1", YM3526, XTAL_8MHz/2) /* verified on pcb */
878   MDRV_SOUND_CONFIG(ym3526_interface_0)
879   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
3028   MDRV_SOUND_CONFIG(ym3526_config_1)
3029   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
8803030
881   MDRV_SOUND_ADD("ym2", Y8950, XTAL_8MHz/2) /* verified on pcb */
882   MDRV_SOUND_CONFIG(y8950_config)
883   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
3031   MDRV_SOUND_ADD("ym2", YM3526, XTAL_8MHz/2) /* verified on pcb */
3032   MDRV_SOUND_CONFIG(ym3526_config_2)
3033   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
8843034MACHINE_DRIVER_END
8853035
8863036
887static MACHINE_DRIVER_START( gwar )
3037static MACHINE_DRIVER_START( victroad )
8883038
3039   MDRV_IMPORT_FROM(ikari)
3040
8893041   /* basic machine hardware */
3042   MDRV_CPU_MODIFY("audio")
3043   MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0)
3044
3045   /* sound hardware */
3046   MDRV_SOUND_REPLACE("ym2", Y8950, XTAL_8MHz/2) /* verified on pcb */
3047   MDRV_SOUND_CONFIG(y8950_config_2)
3048   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
3049MACHINE_DRIVER_END
3050
3051
3052static MACHINE_DRIVER_START( bermudat )
3053
3054   /* basic machine hardware */
8903055   MDRV_CPU_ADD("main", Z80, XTAL_8MHz/2) /* verified on pcb */
891   MDRV_CPU_PROGRAM_MAP(cpuA_map,0)
3056   MDRV_CPU_PROGRAM_MAP(bermudat_cpuA_map,0)
8923057   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
8933058
8943059   MDRV_CPU_ADD("sub", Z80, XTAL_8MHz/2) /* verified on pcb */
895   MDRV_CPU_PROGRAM_MAP(cpuB_map,0)
3060   MDRV_CPU_PROGRAM_MAP(bermudat_cpuB_map,0)
8963061   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
8973062
8983063   MDRV_CPU_ADD("audio", Z80, XTAL_8MHz/2) /* verified on pcb */
8993064   MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0)
900   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
9013065
9023066   MDRV_INTERLEAVE(100)
9033067
9043068   /* video hardware */
9053069   MDRV_SCREEN_ADD("main", RASTER)
9063070   MDRV_SCREEN_REFRESH_RATE(60)
907   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
9083071   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
909   MDRV_SCREEN_SIZE(400, 224)
910   MDRV_SCREEN_VISIBLE_AREA(8, 399-8, 0, 223)
3072   // visible area uncertain but this size avoids glitches at the bottom of the screen
3073   // in worldwar at the beginning of the game
3074   MDRV_SCREEN_SIZE(50*8, 28*8)
3075   MDRV_SCREEN_VISIBLE_AREA(2*8, 48*8-1, 0*8, 28*8-1)
9113076
9123077   MDRV_GFXDECODE(gwar)
9133078   MDRV_PALETTE_LENGTH(0x400)
9143079
9153080   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
916   MDRV_VIDEO_START(snk)
3081   MDRV_VIDEO_START(gwar)
9173082   MDRV_VIDEO_UPDATE(gwar)
9183083
9193084   /* sound hardware */
9203085   MDRV_SPEAKER_STANDARD_MONO("mono")
9213086
9223087   MDRV_SOUND_ADD("ym1", YM3526, XTAL_8MHz/2) /* verified on pcb */
923   MDRV_SOUND_CONFIG(ym3526_interface_0)
924   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
3088   MDRV_SOUND_CONFIG(ym3526_config_1)
3089   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
9253090
9263091   MDRV_SOUND_ADD("ym2", Y8950, XTAL_8MHz/2) /* verified on pcb */
927   MDRV_SOUND_CONFIG(y8950_config)
928   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
3092   MDRV_SOUND_CONFIG(y8950_config_2)
3093   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
9293094MACHINE_DRIVER_END
9303095
9313096
932static MACHINE_DRIVER_START( bermudat )
3097static MACHINE_DRIVER_START( gwar )
9333098
3099   MDRV_IMPORT_FROM(bermudat)
3100
9343101   /* basic machine hardware */
935   MDRV_CPU_ADD("main", Z80, 4000000)
936   MDRV_CPU_PROGRAM_MAP(cpuA_map,0)
937   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
3102   MDRV_CPU_MODIFY("main")
3103   MDRV_CPU_PROGRAM_MAP(gwar_cpuA_map,0)
9383104
939   // 5MHz gives CPUB higher priority or ROM test will fail if the first NMI is triggered too early by CPUA
940   MDRV_CPU_ADD("sub", Z80, 5000000)
941   MDRV_CPU_PROGRAM_MAP(cpuB_map,0)
942   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
3105   MDRV_CPU_MODIFY("sub")
3106   MDRV_CPU_PROGRAM_MAP(gwar_cpuB_map,0)
9433107
944   MDRV_CPU_ADD("audio", Z80, 4000000)
945   MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0)
946   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
947
948   MDRV_INTERLEAVE(100)
949
9503108   /* video hardware */
951   MDRV_SCREEN_ADD("main", RASTER)
952   MDRV_SCREEN_REFRESH_RATE(60)
953   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
954   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
955   MDRV_SCREEN_SIZE(400, 224)
956   MDRV_SCREEN_VISIBLE_AREA(16, 399, 0, 223)
3109   MDRV_SCREEN_MODIFY("main")
3110   // this visible area matches pcb screenshots
3111   MDRV_SCREEN_SIZE(49*8, 28*8)
3112   MDRV_SCREEN_VISIBLE_AREA(1*8, 48*8-1, 0*8, 28*8-1)
3113MACHINE_DRIVER_END
9573114
958   MDRV_GFXDECODE(gwar)
959   MDRV_PALETTE_LENGTH(0x400)
9603115
961   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
962   MDRV_VIDEO_START(snk)
963   MDRV_VIDEO_UPDATE(gwar)
3116static MACHINE_DRIVER_START( gwara )
9643117
965   /* sound hardware */
966   MDRV_SPEAKER_STANDARD_MONO("mono")
3118   MDRV_IMPORT_FROM(bermudat)
9673119
968   MDRV_SOUND_ADD("ym1", YM3526, 4000000)
969   MDRV_SOUND_CONFIG(ym3526_interface_0)
970   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
3120   /* basic machine hardware */
3121   MDRV_CPU_MODIFY("main")
3122   MDRV_CPU_PROGRAM_MAP(gwara_cpuA_map,0)
9713123
972   MDRV_SOUND_ADD("ym2", Y8950, 4000000)
973   MDRV_SOUND_CONFIG(y8950_config)
974   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
3124   MDRV_CPU_MODIFY("sub")
3125   MDRV_CPU_PROGRAM_MAP(gwara_cpuB_map,0)
9753126MACHINE_DRIVER_END
9763127
9773128
978static MACHINE_DRIVER_START( psychos )
3129static MACHINE_DRIVER_START( chopper1 )
9793130
3131   MDRV_IMPORT_FROM(bermudat)
3132
9803133   /* basic machine hardware */
981   MDRV_CPU_ADD("main", Z80, 4000000)
982   MDRV_CPU_PROGRAM_MAP(cpuA_map,0)
983   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
3134   MDRV_CPU_MODIFY("sub")
3135   MDRV_CPU_PROGRAM_MAP(gwar_cpuB_map,0)
9843136
985   MDRV_CPU_ADD("sub", Z80, 4000000)
986   MDRV_CPU_PROGRAM_MAP(cpuB_map,0)
987   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
3137   MDRV_CPU_MODIFY("audio")
3138   MDRV_CPU_PROGRAM_MAP(YM3812_Y8950_sound_map,0)
9883139
989   MDRV_CPU_ADD("audio", Z80, 4000000)
990   MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0)
991   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2)
992
993   MDRV_INTERLEAVE(100)
994
9953140   /* video hardware */
996   MDRV_SCREEN_ADD("main", RASTER)
997   MDRV_SCREEN_REFRESH_RATE(60)
998   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
999   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1000   MDRV_SCREEN_SIZE(400, 224)
1001   MDRV_SCREEN_VISIBLE_AREA(8, 399-8, 0, 223)
3141   MDRV_SCREEN_MODIFY("main")
3142   // this visible area matches the flyer
3143   MDRV_SCREEN_SIZE(51*8, 28*8)
3144   MDRV_SCREEN_VISIBLE_AREA(1*8, 50*8-1, 0*8, 28*8-1)
10023145
1003   MDRV_GFXDECODE(gwar)
1004   MDRV_PALETTE_LENGTH(0x400)
3146   /* sound hardware */
3147   MDRV_SOUND_REPLACE("ym1", YM3812, 4000000)
3148   MDRV_SOUND_CONFIG(ym3812_config_1)
3149   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
3150MACHINE_DRIVER_END
10053151
1006   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
1007   MDRV_VIDEO_START(snk)
1008   MDRV_VIDEO_UPDATE(gwar)
10093152
1010   /* sound hardware */
1011   MDRV_SPEAKER_STANDARD_MONO("mono")
3153static MACHINE_DRIVER_START( choppera )
10123154
1013   MDRV_SOUND_ADD("ym1", YM3526, 4000000)
1014   MDRV_SOUND_CONFIG(ym3526_interface_0)
1015   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
3155   MDRV_IMPORT_FROM(chopper1)
10163156
1017   MDRV_SOUND_ADD("ym2", Y8950, 4000000)
1018   MDRV_SOUND_CONFIG(y8950_config)
1019   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
3157   /* basic machine hardware */
3158   MDRV_CPU_MODIFY("main")
3159   MDRV_CPU_PROGRAM_MAP(gwar_cpuA_map,0)
10203160MACHINE_DRIVER_END
10213161
10223162
1023static MACHINE_DRIVER_START( chopper1 )
3163static MACHINE_DRIVER_START( tdfever )
10243164
10253165   /* basic machine hardware */
10263166   MDRV_CPU_ADD("main", Z80, 4000000)
1027   MDRV_CPU_PROGRAM_MAP(cpuA_map,0)
3167   MDRV_CPU_PROGRAM_MAP(tdfever_cpuA_map,0)
10283168   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
10293169
10303170   MDRV_CPU_ADD("sub", Z80, 4000000)
1031   MDRV_CPU_PROGRAM_MAP(cpuB_map,0)
3171   MDRV_CPU_PROGRAM_MAP(tdfever_cpuB_map,0)
10323172   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
10333173
10343174   MDRV_CPU_ADD("audio", Z80, 4000000)
1035   MDRV_CPU_PROGRAM_MAP(YM3812_Y8950_sound_map,0)
1036   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
3175   MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0)
10373176
10383177   MDRV_INTERLEAVE(100)
10393178
10403179   /* video hardware */
3180   MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
3181
10413182   MDRV_SCREEN_ADD("main", RASTER)
10423183   MDRV_SCREEN_REFRESH_RATE(60)
1043   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
10443184   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1045   MDRV_SCREEN_SIZE(400, 224)
1046   MDRV_SCREEN_VISIBLE_AREA(8, 399-8, 0, 223)
3185   MDRV_SCREEN_SIZE(50*8, 28*8)
3186   MDRV_SCREEN_VISIBLE_AREA(0*8, 50*8-1, 0*8, 28*8-1)
10473187
1048   MDRV_GFXDECODE(gwar)
3188   MDRV_GFXDECODE(tdfever)
10493189   MDRV_PALETTE_LENGTH(0x400)
10503190
10513191   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
1052   MDRV_VIDEO_START(snk)
1053   MDRV_VIDEO_UPDATE(gwar)
3192   MDRV_VIDEO_START(tdfever)
3193   MDRV_VIDEO_UPDATE(tdfever)
10543194
10553195   /* sound hardware */
10563196   MDRV_SPEAKER_STANDARD_MONO("mono")
10573197
1058   MDRV_SOUND_ADD("ym1", YM3812, 4000000)
1059   MDRV_SOUND_CONFIG(ym3812_config)
3198   MDRV_SOUND_ADD("ym1", YM3526, 4000000)
3199   MDRV_SOUND_CONFIG(ym3526_config_1)
10603200   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
10613201
10623202   MDRV_SOUND_ADD("ym2", Y8950, 4000000)
1063   MDRV_SOUND_CONFIG(y8950_config)
3203   MDRV_SOUND_CONFIG(y8950_config_2)
10643204   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
10653205MACHINE_DRIVER_END
10663206
10673207
1068static MACHINE_DRIVER_START( tdfever )
3208static MACHINE_DRIVER_START( tdfever2 )
10693209
3210   MDRV_IMPORT_FROM(tdfever)
3211
10703212   /* basic machine hardware */
1071   MDRV_CPU_ADD("main", Z80, 4000000)
1072   MDRV_CPU_PROGRAM_MAP(cpuA_map,0)
1073   MDRV_CPU_VBLANK_INT("main", snk_irq_AB)
3213   MDRV_CPU_MODIFY("audio")
3214   MDRV_CPU_PROGRAM_MAP(Y8950_sound_map,0)
10743215
1075   MDRV_CPU_ADD("sub", Z80, 4000000)
1076   MDRV_CPU_PROGRAM_MAP(cpuB_map,0)
1077//  MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
3216   /* sound hardware */
10783217
1079   MDRV_CPU_ADD("audio", Z80, 4000000)
1080   MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0)
1081   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
3218   // apparently, no "ym1" in tdfever2
3219   // (registers are written to but they cause sound not to work)
3220   MDRV_SOUND_REMOVE("ym1")
3221MACHINE_DRIVER_END
10823222
1083   MDRV_INTERLEAVE(300)
10843223
1085   /* video hardware */
1086   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK | VIDEO_HAS_SHADOWS)
3224/***********************************************************************/
10873225
1088   MDRV_SCREEN_ADD("main", RASTER)
1089   MDRV_SCREEN_REFRESH_RATE(60)
1090   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1000))
1091   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1092   MDRV_SCREEN_SIZE(400,224)
1093   MDRV_SCREEN_VISIBLE_AREA(8, 399-8, 0, 223)
3226ROM_START( jcross )
3227   ROM_REGION( 0x10000, "main", 0 )
3228   ROM_LOAD( "jcrossa0.10b",  0x0000, 0x2000, CRC(0e79bbcd) SHA1(7088a8effd30080529b797991e24e9807bf90475) )
3229   ROM_LOAD( "jcrossa1.12b",  0x2000, 0x2000, CRC(999b2bcc) SHA1(e5d13c9c11a82cedee15777341e6424639ecf2f5) )
3230   ROM_LOAD( "jcrossa2.13b",  0x4000, 0x2000, CRC(ac89e49c) SHA1(9b9a0eec8ad341ce7af58bffe55f10bec696af62) )
3231   ROM_LOAD( "jcrossa3.14b",  0x6000, 0x2000, CRC(4fd7848d) SHA1(870aea0b8e027616814df87afd24418fd140f736) )
3232   ROM_LOAD( "jcrossa4.15b",  0x8000, 0x2000, CRC(8500575d) SHA1(b8751b86508de484f2eb8a6702c63a47ec882036) )
10943233
1095   MDRV_GFXDECODE(tdfever)
1096   MDRV_PALETTE_LENGTH(0x400)
3234   ROM_REGION( 0x10000, "sub", 0 )
3235   ROM_LOAD( "jcrossb0.15a",  0x0000, 0x2000, CRC(77ed51e7) SHA1(56b457846f71f442da6f99889231d4b71d5fcb6c) )
3236   ROM_LOAD( "jcrossb1.14a",  0x2000, 0x2000, CRC(23cf0f70) SHA1(f258e899f332a026eeb0db92330fd60c478218af) )
3237   ROM_LOAD( "jcrossb2.13a",  0x4000, 0x2000, CRC(5bed3118) SHA1(f105ca55223a4bfbc8e2d61c365c76cf2153254c) )
3238   ROM_LOAD( "jcrossb3.12a",  0x6000, 0x2000, CRC(cd75dc95) SHA1(ef03d2b0f66f30fad5132e7b6aee9ec978650b53) )
10973239
1098   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
1099   MDRV_VIDEO_START(snk_4bpp_shadow)
1100   MDRV_VIDEO_UPDATE(tdfever)
3240   ROM_REGION( 0x10000, "audio", 0 )
3241   ROM_LOAD( "jcrosss0.f1",   0x0000, 0x2000, CRC(9ae8ea93) SHA1(1d824302305a41bf5c354c36e2e11981d1aa5ea4) )
3242   ROM_LOAD( "jcrosss1.h2",   0x2000, 0x2000, CRC(83785601) SHA1(cd3d484ef5464090c4b543b1edbbedcc52b15071) )
11013243
1102   /* sound hardware */
1103   MDRV_SPEAKER_STANDARD_MONO("mono")
3244   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
3245   ROM_LOAD( "jcrossb4.10a",  0x0000, 0x2000, CRC(08ad93fe) SHA1(04baf2d9735b0d794b114abeced5a6b899958ce7) )
3246   ROM_LOAD( "jcrosss.d2",    0x2000, 0x2000, CRC(3ebb5beb) SHA1(de0a1f0fdb5b08b76dab9fa64d9ae3047c4ff84b) )
11043247
1105   MDRV_SOUND_ADD("ym1", YM3526, 4000000)
1106   MDRV_SOUND_CONFIG(ym3526_interface_0)
1107   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
3248   ROM_REGION( 0x2000, "bg_tiles", ROMREGION_DISPOSE )
3249   ROM_LOAD( "jcrossb1.a2",   0x0000, 0x2000, CRC(ea3dfbc9) SHA1(eee56acd1c9dbc6c3ecdee4ffe860273e65cc09b) )
11083250
1109   MDRV_SOUND_ADD("ym2", Y8950, 4000000)
1110   MDRV_SOUND_CONFIG(y8950_config)
1111   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1112MACHINE_DRIVER_END
3251   ROM_REGION( 0x6000, "sp16_tiles", ROMREGION_DISPOSE )
3252   ROM_LOAD( "jcrossf0.l2",   0x0000, 0x2000, CRC(4532509b) SHA1(c99f87e2b06b94d815e6099bccb2aee0edf8c98d) )
3253   ROM_LOAD( "jcrossf1.k2",   0x2000, 0x2000, CRC(70d219bf) SHA1(9ff9f88221edd141e8204ac810434b4290db7cff) )
3254   ROM_LOAD( "jcrossf2.j2",   0x4000, 0x2000, CRC(42a12b9d) SHA1(9f2bdb1f84f444442282cf0fc1f7b3c7f9a9bf48) )
11133255
3256   ROM_REGION( 0x0c00, "proms", 0 )
3257   ROM_LOAD( "jcrossp2.j7",  0x000, 0x400, CRC(b72a96a5) SHA1(20d40e4b6a2652e61dc3ad0c4afaec04e3c7cf74) )
3258   ROM_LOAD( "jcrossp1.j8",  0x400, 0x400, CRC(35650448) SHA1(17e4a661ff304c093bb0253efceaf4e9b2498924) )
3259   ROM_LOAD( "jcrossp0.j9",  0x800, 0x400, CRC(99f54d48) SHA1(9bd20eaa9706d28eaca9f5e195204d89e302272f) )
3260ROM_END
11143261
1115static MACHINE_DRIVER_START( tdfever2 )
3262/***********************************************************************/
11163263
1117   /* basic machine hardware */
1118   MDRV_CPU_ADD("main", Z80, 4000000)
1119   MDRV_CPU_PROGRAM_MAP(cpuA_map,0)
1120   MDRV_CPU_VBLANK_INT("main", snk_irq_AB)
3264ROM_START( sgladiat )
3265   ROM_REGION( 0x10000, "main", 0 )
3266   ROM_LOAD( "glad.005",   0x0000, 0x4000, CRC(4bc60f0b) SHA1(19baf7533b8fc6bab372f1d35603068a6b93627c) )
3267   ROM_LOAD( "glad.004",   0x4000, 0x4000, CRC(db557f46) SHA1(dc3565096c95a20d2c64dd4f5d0b465fbd85e041) )
3268   ROM_LOAD( "glad.003",   0x8000, 0x2000, CRC(55ce82b4) SHA1(703f017a8501e4dd5166b5717b244aa6b1e7dc0a) )
11213269
1122   MDRV_CPU_ADD("sub", Z80, 4000000)
1123   MDRV_CPU_PROGRAM_MAP(cpuB_map,0)
1124//  MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
3270   ROM_REGION( 0x10000, "sub", 0 )
3271   ROM_LOAD( "glad.002",   0x0000, 0x4000, CRC(8350261c) SHA1(046099128d5d941b3a37dce559ff5f0aa7f61683) )
3272   ROM_LOAD( "glad.001",   0x4000, 0x4000, CRC(5ee9d3fb) SHA1(6c8d8db7a966d3d3a2e8c46fd779e12e1f1e3716) )
11253273
1126   MDRV_CPU_ADD("audio", Z80, 4000000)
1127   MDRV_CPU_PROGRAM_MAP(YM3526_Y8950_sound_map,0)
1128   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
3274   ROM_REGION( 0x10000, "audio", 0 )
3275   ROM_LOAD( "glad.007",  0x0000, 0x2000, CRC(c25b6731) SHA1(519c6844bfec958b9bb65f148b3527b41fe38b99) )
3276   ROM_LOAD( "glad.006",  0x2000, 0x2000, CRC(2024d716) SHA1(6ff069fc53524d13c386e8e714ba3056509adc4d) )
11293277
1130   MDRV_INTERLEAVE(300)
3278   ROM_REGION( 0x2000, "fg_tiles", ROMREGION_DISPOSE )
3279   ROM_LOAD( "glad.011",   0x0000, 0x2000, CRC(305bb294) SHA1(e148571a581b12ff9502a65ec428e4d19bc757cb) )
11313280
1132   /* video hardware */
1133   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK | VIDEO_HAS_SHADOWS)
3281   ROM_REGION( 0x2000, "bg_tiles", ROMREGION_DISPOSE )
3282   ROM_LOAD( "glad.012",   0x0000, 0x2000, CRC(b7dd519f) SHA1(7bd760e54712648105d1049e678fa6b9effa600b) )
11343283
1135   MDRV_SCREEN_ADD("main", RASTER)
1136   MDRV_SCREEN_REFRESH_RATE(60)
1137   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1000))
1138   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1139   MDRV_SCREEN_SIZE(400,224)
1140   MDRV_SCREEN_VISIBLE_AREA(8, 399-8, 0, 223)
3284   ROM_REGION( 0x6000, "sp16_tiles", ROMREGION_DISPOSE )
3285   ROM_LOAD( "glad.008", 0x0000, 0x2000, CRC(bcf42587) SHA1(1546fe903fbc6dc0b410c83ab51887c33c91ec2d) )
3286   ROM_LOAD( "glad.009", 0x2000, 0x2000, CRC(912a20e0) SHA1(9621b955bc00b7c52ed8363bb441b568efb55863) )
3287   ROM_LOAD( "glad.010", 0x4000, 0x2000, CRC(8b1db3a5) SHA1(5ca403d40071ab13deb7fdb04cb0e055e6b30b05) )
11413288
1142   MDRV_GFXDECODE(tdfever)
1143   MDRV_PALETTE_LENGTH(0x400)
3289   ROM_REGION( 0xc00, "proms", 0 )
3290   ROM_LOAD( "82s137.001",  0x000, 0x400, CRC(d9184823) SHA1(455c6a437d54c29673dddb8248ca78d000c7f354) )
3291   ROM_LOAD( "82s137.002",  0x400, 0x400, CRC(1a6b0953) SHA1(552ac2897abe507f2fd9ca11c8128a0314af215c) )
3292   ROM_LOAD( "82s137.003",  0x800, 0x400, CRC(c0e70308) SHA1(d7dbc500bc9991c2d1b95850f3723a2a224fbfbb) )
3293ROM_END
11443294
1145   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
1146   MDRV_VIDEO_START(snk_4bpp_shadow)
1147   MDRV_VIDEO_UPDATE(tdfever)
3295/***********************************************************************/
11483296
1149   /* sound hardware */
1150   MDRV_SPEAKER_STANDARD_MONO("mono")
3297ROM_START( aso )
3298   ROM_REGION( 0x10000, "main", 0 )
3299   ROM_LOAD( "p1.bin",  0x0000, 0x8000, CRC(3fc9d5e4) SHA1(1318904d3d896affd5affd8e475ac9ee6929b955) )
3300   ROM_LOAD( "p3.bin",  0x8000, 0x4000, CRC(39a666d2) SHA1(b5426520eb600d44bc5566d742d7b88194076494) )
11513301
1152   MDRV_SOUND_ADD("ym1", YM3526, 4000000)
1153   MDRV_SOUND_CONFIG(ym3526_interface_0)
1154   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
3302   ROM_REGION( 0x10000, "sub", 0 )
3303   ROM_LOAD( "p4.bin",  0x0000, 0x8000, CRC(2429792b) SHA1(674e81880f359f7e8d34d0ad9074267360afadbf) )
3304   ROM_LOAD( "p6.bin",  0x8000, 0x4000, CRC(c0bfdf1f) SHA1(65b15ce9c2e78df79cb603c58639421d29701633) )
11553305
1156   MDRV_SOUND_ADD("ym2", Y8950, 4000000)
1157   MDRV_SOUND_CONFIG(y8950_config)
1158   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1159MACHINE_DRIVER_END
3306   ROM_REGION( 0x10000, "audio", 0 )
3307   ROM_LOAD( "p7.bin",  0x0000, 0x8000, CRC(49258162) SHA1(c265b79d012be1e065389f910f7b4ce61f5b27ce) )
3308   ROM_LOAD( "p9.bin",  0x8000, 0x4000, CRC(aef5a4f4) SHA1(e908e79e27ff892fe75d1ba5cb0bc9dc6b7b4268) )
11603309
3310   ROM_REGION( 0x2000, "fg_tiles", ROMREGION_DISPOSE )
3311   ROM_LOAD( "p14.bin", 0x0000, 0x2000, CRC(8baa2253) SHA1(e6e4a5aa005e89744c4e2a19a080cf322edc6b52) )
11613312
1162static MACHINE_DRIVER_START( fsoccer )
3313   ROM_REGION( 0x8000, "bg_tiles", ROMREGION_DISPOSE )
3314   ROM_LOAD( "p10.bin", 0x0000, 0x8000, CRC(00dff996) SHA1(4f6ce4c0f2da0d2a711bcbf9aa998b4e31d0d9bf) )
11633315
1164   /* basic machine hardware */
1165   MDRV_CPU_ADD("main", Z80, XTAL_8MHz/2) /* verified on pcb */
1166   MDRV_CPU_PROGRAM_MAP(cpuA_map,0)
1167   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
3316   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
3317   ROM_LOAD( "p11.bin", 0x04000, 0x4000, CRC(7feac86c) SHA1(13b81f006ec587583416c1e7432da4c3f0375924) )
3318   ROM_CONTINUE(        0x00000, 0x4000)
3319   ROM_LOAD( "p12.bin", 0x0c000, 0x4000, CRC(6895990b) SHA1(e84554cae9a768021c3dc7183bc3d28e2dd768ee) )
3320   ROM_CONTINUE(        0x08000, 0x4000)
3321   ROM_LOAD( "p13.bin", 0x14000, 0x4000, CRC(87a81ce1) SHA1(28c1069e6c08ecd579f99620c1cb6df01ad1aa74) )
3322   ROM_CONTINUE(        0x10000, 0x4000)
11683323
1169   MDRV_CPU_ADD("sub", Z80, XTAL_8MHz/2) /* verified on pcb */
1170   MDRV_CPU_PROGRAM_MAP(cpuB_map,0)
1171   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
3324   ROM_REGION( 0x0c00, "proms", 0 )
3325   ROM_LOAD( "mb7122h.f12",  0x000, 0x00400, CRC(5b0a0059) SHA1(f61e17c8959f1cd6cc12b38f2fb7c6190ebd0e0c) )
3326   ROM_LOAD( "mb7122h.f13",  0x400, 0x00400, CRC(37e28dd8) SHA1(681726e490872a574dd0295823a44d64ef3a7b45) )
3327   ROM_LOAD( "mb7122h.f14",  0x800, 0x00400, CRC(c3fd1dd3) SHA1(c48030cc458f0bebea0ffccf3d3c43260da6a7fb) )
11723328
1173   MDRV_CPU_ADD("audio", Z80, XTAL_8MHz/2) /* verified on pcb */
1174   MDRV_CPU_PROGRAM_MAP(Y8950_sound_map, 0)
1175   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2)
3329   ROM_REGION( 0x0600, "plds", ROMREGION_DISPOSE )
3330   ROM_LOAD( "pal16l8a-1.bin", 0x0000, 0x0104, CRC(4e3f9e0d) SHA1(de448d50c0d1cdef159a8c4028846142210eba0b) )
3331   ROM_LOAD( "pal16l8a-2.bin", 0x0200, 0x0104, CRC(2a681f9e) SHA1(b26eb631d3e4fa6850a109a9a63d377cf86923bc) )
3332   ROM_LOAD( "pal16r6a.bin",   0x0400, 0x0104, CRC(59c03681) SHA1(d21090b35596c28d44862782386e84dfc1feff0c) )
3333ROM_END
11763334
1177   MDRV_INTERLEAVE(100)
3335ROM_START( alphamis )
3336   ROM_REGION( 0x10000, "main", 0 )
3337   ROM_LOAD( "p1.rom",  0x0000, 0x4000, CRC(69af874b) SHA1(11a13574614e7e3b9e33c2b2827571946a805376) )
3338   ROM_LOAD( "p2.rom",  0x4000, 0x4000, CRC(7707bfe3) SHA1(fb1f4ef862f6762d2479e537fc67a819d11ace76) )
3339   ROM_LOAD( "p3.rom",  0x8000, 0x4000, CRC(b970d642) SHA1(d3a8045f05f001e5e2fae8ef7900cf87ab17fc74) )
11783340
1179   /* video hardware */
1180   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK | VIDEO_HAS_SHADOWS)
3341   ROM_REGION( 0x10000, "sub", 0 )
3342   ROM_LOAD( "p4.rom",  0x0000, 0x4000, CRC(91a89d3c) SHA1(46ef8718c81aac2f09dd1884538750edf9662760) )
3343   ROM_LOAD( "p5.rom",  0x4000, 0x4000, CRC(9879e506) SHA1(0bce5fcb9d05ce77cd8e9ad1cac04ef617928db0) )
3344   ROM_LOAD( "p6.bin",  0x8000, 0x4000, CRC(c0bfdf1f) SHA1(65b15ce9c2e78df79cb603c58639421d29701633) )
11813345
1182   MDRV_SCREEN_ADD("main", RASTER)
1183   MDRV_SCREEN_REFRESH_RATE(60)
1184   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
1185   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1186   MDRV_SCREEN_SIZE(400,224)
1187   MDRV_SCREEN_VISIBLE_AREA(8, 399-8, 0, 223)
3346   ROM_REGION( 0x10000, "audio", 0 )
3347   ROM_LOAD( "p7.rom",  0x0000, 0x4000, CRC(dbc19736) SHA1(fe365d70ead8243374979d2162c395fed9870405) )
3348   ROM_LOAD( "p8.rom",  0x4000, 0x4000, CRC(537726a9) SHA1(ddf66946be71d2e6ab2cc53150e3b36d45dde2eb) )
3349   ROM_LOAD( "p9.bin",  0x8000, 0x4000, CRC(aef5a4f4) SHA1(e908e79e27ff892fe75d1ba5cb0bc9dc6b7b4268) )
11883350
1189   MDRV_GFXDECODE(tdfever)
1190   MDRV_PALETTE_LENGTH(0x400)
3351   ROM_REGION( 0x2000, "fg_tiles", ROMREGION_DISPOSE )
3352   ROM_LOAD( "p14.rom", 0x0000, 0x2000, CRC(acbe29b2) SHA1(e304c6d30888fa7549d25e6329ba94d5088bd8b7) )
11913353
1192   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
1193   MDRV_VIDEO_START(snk_4bpp_shadow)
1194   MDRV_VIDEO_UPDATE(tdfever)
3354   ROM_REGION( 0x8000, "bg_tiles", ROMREGION_DISPOSE )
3355   ROM_LOAD( "p10.bin", 0x0000, 0x8000, CRC(00dff996) SHA1(4f6ce4c0f2da0d2a711bcbf9aa998b4e31d0d9bf) )
11953356
1196   /* sound hardware */
1197   MDRV_SPEAKER_STANDARD_MONO("mono")
3357   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
3358   ROM_LOAD( "p11.bin", 0x04000, 0x4000, CRC(7feac86c) SHA1(13b81f006ec587583416c1e7432da4c3f0375924) )
3359   ROM_CONTINUE(        0x00000, 0x4000)
3360   ROM_LOAD( "p12.bin", 0x0c000, 0x4000, CRC(6895990b) SHA1(e84554cae9a768021c3dc7183bc3d28e2dd768ee) )
3361   ROM_CONTINUE(        0x08000, 0x4000)
3362   ROM_LOAD( "p13.bin", 0x14000, 0x4000, CRC(87a81ce1) SHA1(28c1069e6c08ecd579f99620c1cb6df01ad1aa74) )
3363   ROM_CONTINUE(        0x10000, 0x4000)
11983364
1199   MDRV_SOUND_ADD("ym", Y8950, XTAL_8MHz/2) /* verified on pcb */
1200   MDRV_SOUND_CONFIG(y8950_config)
1201   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1202MACHINE_DRIVER_END
3365   ROM_REGION( 0x0c00, "proms", 0 )
3366   ROM_LOAD( "mb7122h.f12",  0x000, 0x00400, CRC(5b0a0059) SHA1(f61e17c8959f1cd6cc12b38f2fb7c6190ebd0e0c) )
3367   ROM_LOAD( "mb7122h.f13",  0x400, 0x00400, CRC(37e28dd8) SHA1(681726e490872a574dd0295823a44d64ef3a7b45) )
3368   ROM_LOAD( "mb7122h.f14",  0x800, 0x00400, CRC(c3fd1dd3) SHA1(c48030cc458f0bebea0ffccf3d3c43260da6a7fb) )
12033369
3370   ROM_REGION( 0x0600, "plds", ROMREGION_DISPOSE )
3371   ROM_LOAD( "pal16l8a-1.bin", 0x0000, 0x0104, CRC(4e3f9e0d) SHA1(de448d50c0d1cdef159a8c4028846142210eba0b) )
3372   ROM_LOAD( "pal16l8a-2.bin", 0x0200, 0x0104, CRC(2a681f9e) SHA1(b26eb631d3e4fa6850a109a9a63d377cf86923bc) )
3373   ROM_LOAD( "pal16r6a.bin",   0x0400, 0x0104, CRC(59c03681) SHA1(d21090b35596c28d44862782386e84dfc1feff0c) )
3374ROM_END
12043375
3376ROM_START( arian )
3377   ROM_REGION( 0x10000, "main", 0 )
3378   ROM_LOAD( "p1.d8",   0x0000, 0x4000, CRC(0ca89307) SHA1(d0ecb97b1e147a4001a4383fd5709394e2358a45) ) /* roms that differ from above sets all had a red stripe on the label */
3379   ROM_LOAD( "p2.d7",   0x4000, 0x4000, CRC(724518c3) SHA1(debbfe2a485af5f452d208a04705dbd48d47d90f) ) /* IE: P1 through P4 and P14 */
3380   ROM_LOAD( "p3.d6",   0x8000, 0x4000, CRC(4d8db650) SHA1(184141847d38077737ee7140861d94832018e2e2) )
3381
3382   ROM_REGION( 0x10000, "sub", 0 )
3383   ROM_LOAD( "p4.d3",   0x0000, 0x4000, CRC(47baf1db) SHA1(3947a679745811e5499d690f2b73b4f28b1d47f9) )
3384   ROM_LOAD( "p5.rom",  0x4000, 0x4000, CRC(9879e506) SHA1(0bce5fcb9d05ce77cd8e9ad1cac04ef617928db0) )
3385   ROM_LOAD( "p6.bin",  0x8000, 0x4000, CRC(c0bfdf1f) SHA1(65b15ce9c2e78df79cb603c58639421d29701633) )
3386
3387   ROM_REGION( 0x10000, "audio", 0 )
3388   ROM_LOAD( "p7.rom",  0x0000, 0x4000, CRC(dbc19736) SHA1(fe365d70ead8243374979d2162c395fed9870405) )
3389   ROM_LOAD( "p8.rom",  0x4000, 0x4000, CRC(537726a9) SHA1(ddf66946be71d2e6ab2cc53150e3b36d45dde2eb) )
3390   ROM_LOAD( "p9.bin",  0x8000, 0x4000, CRC(aef5a4f4) SHA1(e908e79e27ff892fe75d1ba5cb0bc9dc6b7b4268) )
3391
3392   ROM_REGION( 0x2000, "fg_tiles", ROMREGION_DISPOSE )
3393   ROM_LOAD( "p14.h1",  0x0000, 0x2000, CRC(e599bd30) SHA1(bf70aae9a15d548bb532ca1fc8d7220dfa150d6e) )
3394
3395   ROM_REGION( 0x8000, "bg_tiles", ROMREGION_DISPOSE )
3396   ROM_LOAD( "p10.bin", 0x0000, 0x8000, CRC(00dff996) SHA1(4f6ce4c0f2da0d2a711bcbf9aa998b4e31d0d9bf) )
3397
3398   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
3399   ROM_LOAD( "p11.bin", 0x04000, 0x4000, CRC(7feac86c) SHA1(13b81f006ec587583416c1e7432da4c3f0375924) )
3400   ROM_CONTINUE(        0x00000, 0x4000)
3401   ROM_LOAD( "p12.bin", 0x0c000, 0x4000, CRC(6895990b) SHA1(e84554cae9a768021c3dc7183bc3d28e2dd768ee) )
3402   ROM_CONTINUE(        0x08000, 0x4000)
3403   ROM_LOAD( "p13.bin", 0x14000, 0x4000, CRC(87a81ce1) SHA1(28c1069e6c08ecd579f99620c1cb6df01ad1aa74) )
3404   ROM_CONTINUE(        0x10000, 0x4000)
3405
3406   ROM_REGION( 0x0c00, "proms", 0 )
3407   ROM_LOAD( "mb7122h.f12",  0x000, 0x00400, CRC(5b0a0059) SHA1(f61e17c8959f1cd6cc12b38f2fb7c6190ebd0e0c) )
3408   ROM_LOAD( "mb7122h.f13",  0x400, 0x00400, CRC(37e28dd8) SHA1(681726e490872a574dd0295823a44d64ef3a7b45) )
3409   ROM_LOAD( "mb7122h.f14",  0x800, 0x00400, CRC(c3fd1dd3) SHA1(c48030cc458f0bebea0ffccf3d3c43260da6a7fb) )
3410
3411   ROM_REGION( 0x0600, "plds", ROMREGION_DISPOSE )
3412   ROM_LOAD( "pal16l8a-1.bin", 0x0000, 0x0104, CRC(4e3f9e0d) SHA1(de448d50c0d1cdef159a8c4028846142210eba0b) )
3413   ROM_LOAD( "pal16l8a-2.bin", 0x0200, 0x0104, CRC(2a681f9e) SHA1(b26eb631d3e4fa6850a109a9a63d377cf86923bc) )
3414   ROM_LOAD( "pal16r6a.bin",   0x0400, 0x0104, CRC(59c03681) SHA1(d21090b35596c28d44862782386e84dfc1feff0c) )
3415ROM_END
3416
12053417/***********************************************************************/
12063418
12073419ROM_START( tnk3 )
1208   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
3420   ROM_REGION( 0x10000, "main", 0 )
12093421   ROM_LOAD( "tnk3-p1.bin",  0x0000, 0x4000, CRC(0d2a8ca9) SHA1(eba950dab044496e8c1c02af20a9d380996ea20a) )
12103422   ROM_LOAD( "tnk3-p2.bin",  0x4000, 0x4000, CRC(0ae0a483) SHA1(6a1ba86da4fd75bfb00855db04eac2727ec4159e) )
12113423   ROM_LOAD( "tnk3-p3.bin",  0x8000, 0x4000, CRC(d16dd4db) SHA1(dcbc61251c13e11ce3cdd7a5ad200cd2d2758cab) )
12123424
1213   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
3425   ROM_REGION( 0x10000, "sub", 0 )
12143426   ROM_LOAD( "tnk3-p4.bin",  0x0000, 0x4000, CRC(01b45a90) SHA1(85ba3b157cd6463c92ed831bb48d38f3a16f9537) )
12153427   ROM_LOAD( "tnk3-p5.bin",  0x4000, 0x4000, CRC(60db6667) SHA1(9c4bb99473c6d9b8ac9086b7364b6278b70757f6) )
12163428   ROM_LOAD( "tnk3-p6.bin",  0x8000, 0x4000, CRC(4761fde7) SHA1(dadf60e33f5dd8108478ca480bcef6b2624cfca8) )
12173429
1218   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
3430   ROM_REGION( 0x10000, "audio", 0 )
12193431   ROM_LOAD( "tnk3-p10.bin",  0x0000, 0x4000, CRC(7bf0a517) SHA1(0197feeaf511ac59f3df8195ec57e947fb08e995) )
12203432   ROM_LOAD( "tnk3-p11.bin",  0x4000, 0x4000, CRC(0569ce27) SHA1(7aa73f57ad97445ce5729f05cd8d24973886dbf5) )
12213433
r3115r3116
12243436   ROM_LOAD( "7122.1",  0x400, 0x400, CRC(6d0ac66a) SHA1(e792218ec43dd10473dc020afed8527cf43ea0d0) )
12253437   ROM_LOAD( "7122.0",  0x800, 0x400, CRC(4662b4c8) SHA1(391c2b8a17ce2e092b46a17fc4170dc1e3bde426) )
12263438
1227   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE ) /* characters */
3439   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
12283440   ROM_LOAD( "tnk3-p14.bin", 0x0000, 0x2000, CRC(1fd18c43) SHA1(611b5aa97df84c0117681772deb006f32a899ad3) )
12293441   ROM_RELOAD(               0x2000, 0x2000 )
12303442
1231   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE ) /* background tiles */
3443   ROM_REGION( 0x8000, "bg_tiles", ROMREGION_DISPOSE )
12323444   ROM_LOAD( "tnk3-p12.bin", 0x0000, 0x4000, CRC(ff495a16) SHA1(e6b97a63efe58018260ff34f0ea4edc81718cb14) )
12333445   ROM_LOAD( "tnk3-p13.bin", 0x4000, 0x4000, CRC(f8344843) SHA1(c741dc84b48f830f6d4eaa4476f5c2a391153acc) )
12343446
1235   ROM_REGION( 0x0c000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
3447   ROM_REGION( 0x0c000, "sp16_tiles", ROMREGION_DISPOSE )
12363448   ROM_LOAD( "tnk3-p7.bin", 0x00000, 0x4000, CRC(06b92c88) SHA1(b39c2cc4a58937d89f9b0c9093b9742509db64a3) )
12373449   ROM_LOAD( "tnk3-p8.bin", 0x04000, 0x4000, CRC(63d0e2eb) SHA1(96182639bb620d9692a4c8266130769c44dd29f8) )
12383450   ROM_LOAD( "tnk3-p9.bin", 0x08000, 0x4000, CRC(872e3fac) SHA1(98e7e9315fe7ccc51151c67dc60a362a1c2d8372) )
12393451ROM_END
12403452
12413453ROM_START( tnk3j )
1242   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
3454   ROM_REGION( 0x10000, "main", 0 )
12433455   ROM_LOAD( "p1.4e",  0x0000, 0x4000, CRC(03aca147) SHA1(9ce4cfdfbd22f10e13c8e474dc2e5aa3bfd57e0b) )
12443456   ROM_LOAD( "tnk3-p2.bin",  0x4000, 0x4000, CRC(0ae0a483) SHA1(6a1ba86da4fd75bfb00855db04eac2727ec4159e) )
12453457   ROM_LOAD( "tnk3-p3.bin",  0x8000, 0x4000, CRC(d16dd4db) SHA1(dcbc61251c13e11ce3cdd7a5ad200cd2d2758cab) )
12463458
1247   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
3459   ROM_REGION( 0x10000, "sub", 0 )
12483460   ROM_LOAD( "tnk3-p4.bin",  0x0000, 0x4000, CRC(01b45a90) SHA1(85ba3b157cd6463c92ed831bb48d38f3a16f9537) )
12493461   ROM_LOAD( "tnk3-p5.bin",  0x4000, 0x4000, CRC(60db6667) SHA1(9c4bb99473c6d9b8ac9086b7364b6278b70757f6) )
12503462   ROM_LOAD( "tnk3-p6.bin",  0x8000, 0x4000, CRC(4761fde7) SHA1(dadf60e33f5dd8108478ca480bcef6b2624cfca8) )
12513463
1252   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
3464   ROM_REGION( 0x10000, "audio", 0 )
12533465   ROM_LOAD( "tnk3-p10.bin",  0x0000, 0x4000, CRC(7bf0a517) SHA1(0197feeaf511ac59f3df8195ec57e947fb08e995) )
12543466   ROM_LOAD( "tnk3-p11.bin",  0x4000, 0x4000, CRC(0569ce27) SHA1(7aa73f57ad97445ce5729f05cd8d24973886dbf5) )
12553467
r3115r3116
12583470   ROM_LOAD( "7122.1",  0x400, 0x400, CRC(6d0ac66a) SHA1(e792218ec43dd10473dc020afed8527cf43ea0d0) )
12593471   ROM_LOAD( "7122.0",  0x800, 0x400, CRC(4662b4c8) SHA1(391c2b8a17ce2e092b46a17fc4170dc1e3bde426) )
12603472
1261   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE ) /* characters */
3473   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
12623474   ROM_LOAD( "p14.1e", 0x0000, 0x2000, CRC(6bd575ca) SHA1(446bb929fa19a7ff8b92731f71ab3e3252899f07) )
12633475   ROM_RELOAD(         0x2000, 0x2000 )
12643476
1265   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE ) /* background tiles */
3477   ROM_REGION( 0x8000, "bg_tiles", ROMREGION_DISPOSE )
12663478   ROM_LOAD( "tnk3-p12.bin", 0x0000, 0x4000, CRC(ff495a16) SHA1(e6b97a63efe58018260ff34f0ea4edc81718cb14) )
12673479   ROM_LOAD( "tnk3-p13.bin", 0x4000, 0x4000, CRC(f8344843) SHA1(c741dc84b48f830f6d4eaa4476f5c2a391153acc) )
12683480
1269   ROM_REGION( 0x0c000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
3481   ROM_REGION( 0x0c000, "sp16_tiles", ROMREGION_DISPOSE )
12703482   ROM_LOAD( "tnk3-p7.bin", 0x00000, 0x4000, CRC(06b92c88) SHA1(b39c2cc4a58937d89f9b0c9093b9742509db64a3) )
12713483   ROM_LOAD( "tnk3-p8.bin", 0x04000, 0x4000, CRC(63d0e2eb) SHA1(96182639bb620d9692a4c8266130769c44dd29f8) )
12723484   ROM_LOAD( "tnk3-p9.bin", 0x08000, 0x4000, CRC(872e3fac) SHA1(98e7e9315fe7ccc51151c67dc60a362a1c2d8372) )
r3115r3116
12753487/***********************************************************************/
12763488
12773489ROM_START( athena )
1278   ROM_REGION( 0x10000, "main", 0 ) /* 64k for cpuA code */
3490   ROM_REGION( 0x10000, "main", 0 )
12793491   ROM_LOAD( "up02_p4.rom",  0x0000, 0x4000,  CRC(900a113c) SHA1(3a85f87cbf79d60f58858df4852d6d97300c9280) )
12803492   ROM_LOAD( "up02_m4.rom",  0x4000, 0x8000,  CRC(61c69474) SHA1(93f1222a3908c84fe6679e2deb90afbe4a22e675) )
12813493
1282   ROM_REGION(  0x10000 , "sub", 0 ) /* 64k for cpuB code */
3494   ROM_REGION(  0x10000 , "sub", 0 )
12833495   ROM_LOAD( "up02_p8.rom",  0x0000, 0x4000, CRC(df50af7e) SHA1(2a69089aecf598cb11f4f1c9b42d81670f9bd68e) )
12843496   ROM_LOAD( "up02_m8.rom",  0x4000, 0x8000, CRC(f3c933df) SHA1(70a0bf63230be53da9196fae4c3e604205275ddd) )
12853497
1286   ROM_REGION( 0x10000, "audio", 0 ) /* 64k for sound code */
3498   ROM_REGION( 0x10000, "audio", 0 )
12873499   ROM_LOAD( "up02_g6.rom",  0x0000, 0x4000, CRC(42dbe029) SHA1(9aa311860693bd3e73f2b72ca4b171cb95f069ee) )
12883500   ROM_LOAD( "up02_k6.rom",  0x4000, 0x8000, CRC(596f1c8a) SHA1(8f1400c77473c845e57a14fa479cf4f7ac66a909) )
12893501
r3115r3116
12923504   ROM_LOAD( "up02_b1.rom",  0x400, 0x400, CRC(d25c9099) SHA1(f3933075cce1255affc61dfefd9559b6e15ed29c) )
12933505   ROM_LOAD( "up02_c1.rom",  0x800, 0x400, CRC(a4a4e7dc) SHA1(aa694c2d44dcabc6cfd46307c55c3759eff57236) )
12943506
1295   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE ) /* characters */
3507   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
12963508   ROM_LOAD( "up01_d2.rom",  0x0000, 0x4000,  CRC(18b4bcca) SHA1(2476aa6c8d55e117d840202a97fe2a65e252ad7f) )
12973509
1298   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE ) /* background tiles */
3510   ROM_REGION( 0x8000, "bg_tiles", ROMREGION_DISPOSE )
12993511   ROM_LOAD( "up01_b2.rom",  0x0000, 0x8000,  CRC(f269c0eb) SHA1(a947c6e4d82e0aafa616d25395ef63c33d9beb06) )
13003512
1301   ROM_REGION( 0x18000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
3513   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
13023514   ROM_LOAD( "up01_p2.rom",  0x00000, 0x8000, CRC(c63a871f) SHA1(0ab8ebebd750fdcad283eed427179f2124b300ae) )
13033515   ROM_LOAD( "up01_s2.rom",  0x08000, 0x8000, CRC(760568d8) SHA1(9dc447c446791c79322e21e3caef6ceae347e2fb) )
13043516   ROM_LOAD( "up01_t2.rom",  0x10000, 0x8000, CRC(57b35c73) SHA1(6d15b94b50c3734f7d60bd9bd1c5e6c76591d829) )
r3115r3116
13073519/***********************************************************************/
13083520
13093521ROM_START( fitegolf )
1310   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
3522   ROM_REGION( 0x10000, "main", 0 )
13113523   ROM_LOAD( "gu2",    0x0000, 0x4000, CRC(19be7ad6) SHA1(6f0faf606e44a3f8cc027699cc816aa3414a1b98) )
13123524   ROM_LOAD( "gu1",    0x4000, 0x8000, CRC(bc32568f) SHA1(35fec3dbdd773ec7f427ecdd81066fb8f1b74e05) )
13133525
1314   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
3526   ROM_REGION( 0x10000, "sub", 0 )
13153527   ROM_LOAD( "gu6",    0x0000, 0x4000, CRC(2b9978c5) SHA1(5490e9f796697318650fc5f70c0e64d6785ad7fc) )
13163528   ROM_LOAD( "gu5",    0x4000, 0x8000, CRC(ea3d138c) SHA1(af0a0bfe2d266179946948cf42fe697505798a4f) )
13173529
1318   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
3530   ROM_REGION( 0x10000, "audio", 0 )
13193531   ROM_LOAD( "gu3",    0x0000, 0x4000, CRC(811b87d7) SHA1(fb387f42085d6e0e5a88729ca0e50656411ce037) )
13203532   ROM_LOAD( "gu4",    0x4000, 0x8000, CRC(2d998e2b) SHA1(a471cfbb4dabc90fcc29c562620b9965eaff6861) )
13213533
r3115r3116
13243536   ROM_LOAD( "82s137.1b",  0x00400, 0x00400, CRC(29e7986f) SHA1(85ba8d3443458c27728f633745857a1315dd183f) )
13253537   ROM_LOAD( "82s137.1c",  0x00800, 0x00400, CRC(27ba9ff9) SHA1(f021d10460f40de4447560df5ac47fa53bb57ff9) )
13263538
1327   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE ) /* characters */
3539   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
13283540   ROM_LOAD( "gu8",   0x0000, 0x4000, CRC(f1628dcf) SHA1(efea343d3a9dd45ef74947c297e166e34afbb680) )
13293541
1330   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
3542   ROM_REGION( 0x8000, "bg_tiles", ROMREGION_DISPOSE )
13313543   ROM_LOAD( "gu7",  0x0000, 0x8000, CRC(4655f94e) SHA1(08526206d8e929bb01d61fff8de2ee99fd287c17) )
13323544
1333   ROM_REGION( 0x18000, "gfx3", ROMREGION_DISPOSE ) /* sprites */
3545   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
13343546   ROM_LOAD( "gu9",   0x00000, 0x8000, CRC(d4957ec5) SHA1(8ead7866ba5ac66ead6b707aa868bcae30c486e1) )
13353547   ROM_LOAD( "gu10",  0x08000, 0x8000, CRC(b3acdac2) SHA1(7377480d5e1b5ab2c49f5fee2927623ce8240e19) )
13363548   ROM_LOAD( "gu11",  0x10000, 0x8000, CRC(b99cf73b) SHA1(23989fc3914e77d364807a9eb96a4ddf75ad7cf1) )
r3115r3116
13423554ROM_END
13433555
13443556ROM_START( fitegol2 )
1345   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
3557   ROM_REGION( 0x10000, "main", 0 )
13463558   ROM_LOAD( "np45.128", 0x0000, 0x4000, CRC(16e8e763) SHA1(0b5296f2a91a7f3176b7461ca4958865ce998241) )
13473559   ROM_LOAD( "mn45.256", 0x4000, 0x8000, CRC(a4fa09d5) SHA1(ae7f0cb47de06006ae71252c4201a93a01a26887) )
13483560
1349   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
3561   ROM_REGION( 0x10000, "sub", 0 )
13503562   ROM_LOAD( "gu6",    0x0000, 0x4000, CRC(2b9978c5) SHA1(5490e9f796697318650fc5f70c0e64d6785ad7fc) )   // NP8.256
13513563   ROM_LOAD( "gu5",    0x4000, 0x8000, CRC(ea3d138c) SHA1(af0a0bfe2d266179946948cf42fe697505798a4f) )   // MN8.256
13523564
1353   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
3565   ROM_REGION( 0x10000, "audio", 0 )
13543566   ROM_LOAD( "gu3",    0x0000, 0x4000, CRC(811b87d7) SHA1(fb387f42085d6e0e5a88729ca0e50656411ce037) )   // FG67.256
13553567   ROM_LOAD( "gu4",    0x4000, 0x8000, CRC(2d998e2b) SHA1(a471cfbb4dabc90fcc29c562620b9965eaff6861) )   // K67.256
13563568
r3115r3116
13593571   ROM_LOAD( "82s137.1b",  0x00400, 0x00400, CRC(29e7986f) SHA1(85ba8d3443458c27728f633745857a1315dd183f) )
13603572   ROM_LOAD( "82s137.1c",  0x00800, 0x00400, CRC(27ba9ff9) SHA1(f021d10460f40de4447560df5ac47fa53bb57ff9) )
13613573
1362   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE ) /* characters */
3574   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
13633575   ROM_LOAD( "gu8",   0x0000, 0x4000, CRC(f1628dcf) SHA1(efea343d3a9dd45ef74947c297e166e34afbb680) )      // D2.128
13643576
1365   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
3577   ROM_REGION( 0x8000, "bg_tiles", ROMREGION_DISPOSE )
13663578   ROM_LOAD( "gu7",  0x0000, 0x8000, CRC(4655f94e) SHA1(08526206d8e929bb01d61fff8de2ee99fd287c17) )      // BC2.256
13673579
1368   ROM_REGION( 0x18000, "gfx3", ROMREGION_DISPOSE ) /* sprites */
3580   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
13693581   ROM_LOAD( "gu9",   0x00000, 0x8000, CRC(d4957ec5) SHA1(8ead7866ba5ac66ead6b707aa868bcae30c486e1) )   // P2.256
13703582   ROM_LOAD( "gu10",  0x08000, 0x8000, CRC(b3acdac2) SHA1(7377480d5e1b5ab2c49f5fee2927623ce8240e19) )   // R2.256
13713583   ROM_LOAD( "gu11",  0x10000, 0x8000, CRC(b99cf73b) SHA1(23989fc3914e77d364807a9eb96a4ddf75ad7cf1) )   // S2.256
r3115r3116
13763588   ROM_LOAD( "pal20l8a.6r", 0x0400, 0x0144, CRC(0f011673) SHA1(383e6f6e78daec9c874d5b48378111ca60f5ed64) )
13773589ROM_END
13783590
3591/***********************************************************************/
13793592
13803593/*
13813594Country Club
r3115r3116
14093622        cc8.7e      27c256      \
14103623        cc9.7g        ''         | gfx
14113624        cc10.7h       ''        /
1412    cc1pr.5f    63s441      \
1413    cc2pr.5g      ''         | proms
1414    cc3pr.5h      ''        /
3625        cc1pr.5f    63s441      \
3626        cc2pr.5g      ''         | proms
3627        cc3pr.5h      ''        /
14153628
14163629
141736303rd PCB (Video board)
r3115r3116
14273640*/
14283641
14293642ROM_START( countryc )
1430   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuA code */
3643   ROM_REGION( 0x10000, "sub", 0 )
14313644   ROM_LOAD( "cc2.2e",  0x0000, 0x04000,  CRC(43d205e0) SHA1(d32f597bf2b70e326e68583cb95e0beeea34d5d0) )
14323645   ROM_LOAD( "cc3.2g",  0x4000, 0x04000,  CRC(7290770f) SHA1(41184047e3e21f6ff4f724d59f4c6f34b19bcfc1) )
14333646   ROM_LOAD( "cc4.2h",  0x8000, 0x04000,  CRC(61990582) SHA1(b12e6da3b8d7690bf6848a624b42dcb93f69ead7) )
14343647
1435   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuB code */
3648   ROM_REGION( 0x10000, "main", 0 )
14363649   ROM_LOAD( "cc5.4e",  0x00000, 0x4000, CRC(07666af8) SHA1(4b4c51bd1bc5ee49bb516e6851b2e6b5a7780576) )
14373650   ROM_LOAD( "cc6.4g",  0x04000, 0x4000, CRC(ab18fd9f) SHA1(30a30998191cb81a6bfcd672e54f8a155639ccd7) )
14383651   ROM_LOAD( "cc7.4h",  0x08000, 0x4000, CRC(58a1ec0c) SHA1(877935463121a992851e9b76074e1a4d033a0b2e) )
14393652
1440   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
3653   ROM_REGION( 0x10000, "audio", 0 )
14413654   ROM_LOAD( "cc1.1f",  0x00000, 0x10000, CRC(863f1624) SHA1(11c0aeefaddf16cc9e1c259e97b90fe418d70c89) )
14423655
14433656   ROM_REGION( 0x0c00, "proms", 0 )
r3115r3116
14453658   ROM_LOAD( "cc2pr.5g",  0x400, 0x00400, CRC(982e4f46) SHA1(c4703a35201bc4c6b43f629a9a6a4c66354c6305) )
14463659   ROM_LOAD( "cc3pr.5h",  0x800, 0x00400, CRC(47f2b83d) SHA1(6335be47f09ad33d7e05fda26a2f3fb9048dbbc2) )
14473660
1448   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE ) /* characters */
3661   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
14493662   ROM_LOAD( "cc11.1e",  0x0000, 0x4000, CRC(ce927ac7) SHA1(a0dd281912aa9ae7e408c2132fae30bffbc83750) )
14503663
1451   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
3664   ROM_REGION( 0x8000, "bg_tiles", ROMREGION_DISPOSE )
14523665   ROM_LOAD( "cc13.2d",  0x0000, 0x4000, CRC(ef86c388) SHA1(19e443f6a4901a3c9db868964c08b0f58be1983d) )
14533666   ROM_LOAD( "cc12.2c",  0x4000, 0x4000, CRC(d7d55a36) SHA1(1956097c2633f603cc1557f6e686b3c06b199dd8) )
14543667
1455   ROM_REGION( 0x18000, "gfx3", ROMREGION_DISPOSE ) /* 32x32 sprites */
3668   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
14563669   ROM_LOAD( "cc10.7h",  0x00000, 0x8000, CRC(90091667) SHA1(d0d3813a0c3ac7e9e9ab824292dccb27c2087ea7) )
14573670   ROM_LOAD( "cc9.7g",   0x08000, 0x8000, CRC(56249142) SHA1(10b703f15977ba21757aee3d212790372b35cc66) )
14583671   ROM_LOAD( "cc8.7e",   0x10000, 0x8000, CRC(55943065) SHA1(ea545c6e8666c915994836d2f2cfc02db35e37c1) )
r3115r3116
14613674/***********************************************************************/
14623675
14633676ROM_START( ikari )
1464   ROM_REGION( 0x10000, "main", 0 )   /* CPU A */
3677   ROM_REGION( 0x10000, "main", 0 )
14653678   ROM_LOAD( "1.rom",  0x0000, 0x10000, CRC(52a8b2dd) SHA1(a896387d68ed9a55c313bdb81acdf8d68b7a1264) )
14663679
1467   ROM_REGION( 0x10000, "sub", 0 )   /* CPU B */
3680   ROM_REGION( 0x10000, "sub", 0 )
14683681   ROM_LOAD( "2.rom",  0x0000, 0x10000, CRC(45364d55) SHA1(323b998f782a4681ceb18016c5fb0fa1d6361aac) )
14693682
1470   ROM_REGION( 0x10000, "audio", 0 )   /* Sound CPU */
3683   ROM_REGION( 0x10000, "audio", 0 )
14713684   ROM_LOAD( "3.rom",  0x0000, 0x10000, CRC(56a26699) SHA1(e9ccb27f1e711e4648fdfe3c7ff956038d3e101c) )
14723685
14733686   ROM_REGION( 0x0c00, "proms", 0 )
r3115r3116
14753688   ROM_LOAD( "7122eg.prm",  0x400, 0x400, CRC(0703a770) SHA1(62861ef4987003d4965ef5018ccdf7157981d939) )
14763689   ROM_LOAD( "7122eb.prm",  0x800, 0x400, CRC(0a11cdde) SHA1(faae17398341317e7afbd06b903b8e9e65967bf1) )
14773690
1478   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE ) /* characters */
3691   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
14793692   ROM_LOAD( "7.rom",    0x00000, 0x4000, CRC(a7eb4917) SHA1(6c07323cc243df4c5c30bc0daedbff3887309f65) )
14803693
1481   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
3694   ROM_REGION( 0x20000, "bg_tiles", ROMREGION_DISPOSE )
14823695   ROM_LOAD( "17.rom", 0x00000, 0x8000, CRC(e0dba976) SHA1(5a8f14f7a199b5fb1862debda0bceee42cddac59) )
14833696   ROM_LOAD( "18.rom", 0x08000, 0x8000, CRC(24947d5f) SHA1(ffd18074ced8171c9da56c839e8289afc29af2c9) )
14843697   ROM_LOAD( "19.rom", 0x10000, 0x8000, CRC(9ee59e91) SHA1(fe51d13ab73cb596a233669e304b2be66f9becae) )
14853698   ROM_LOAD( "20.rom", 0x18000, 0x8000, CRC(5da7ec1a) SHA1(4b212c1dfe4c18eced90ee3a783e7edf8d23c906) )
14863699
1487   ROM_REGION( 0x18000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
3700   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
14883701   ROM_LOAD( "8.rom",  0x00000, 0x8000, CRC(9827c14a) SHA1(b54dcee95c6f6e46c187a117b4e7aaf1c0ece6c6) )
14893702   ROM_LOAD( "9.rom",  0x08000, 0x8000, CRC(545c790c) SHA1(7738738f4a1343b04efd029ecaefac74010451f0) )
14903703   ROM_LOAD( "10.rom", 0x10000, 0x8000, CRC(ec9ba07e) SHA1(6b492b2cd7b8cca948ce39c3450f1cc153f41d90) )
14913704
1492   ROM_REGION( 0x30000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
3705   ROM_REGION( 0x30000, "sp32_tiles", ROMREGION_DISPOSE )
14933706   ROM_LOAD( "11.rom", 0x00000, 0x8000, CRC(5c75ea8f) SHA1(4e8ee56a2dbeb9ac2dd74bc584dba29433d91ae0) )
14943707   ROM_LOAD( "14.rom", 0x08000, 0x8000, CRC(3293fde4) SHA1(3e2f0fa00c22f1c0c1427d8d3de57dd9ec7682a9) )
14953708   ROM_LOAD( "12.rom", 0x10000, 0x8000, CRC(95138498) SHA1(8ac3d2cd793312434b9ffb8c47c30473f713e0e8) )
r3115r3116
14983711   ROM_LOAD( "16.rom", 0x28000, 0x8000, CRC(e9b03e07) SHA1(124e5328a965ea2af28c4d74934a82394a2ffd72) )
14993712ROM_END
15003713
3714ROM_START( ikaria )
3715   ROM_REGION( 0x10000, "main", 0 )
3716   ROM_LOAD( "p1",  0x0000, 0x4000, CRC(738fcec4) SHA1(24a29f9487064b745262638350a332996b986e5d) )
3717   ROM_LOAD( "p2",  0x4000, 0x8000, CRC(89f7945a) SHA1(39f7f40b2028a77d6e7c79f27c2420b8422b5dab) )
3718
3719   ROM_REGION( 0x10000, "sub", 0 )
3720   ROM_LOAD( "p3",  0x0000, 0x4000, CRC(8a9bd1f0) SHA1(dbf855e328daeddd38c64b7af2d303426d13bf3b) )
3721   ROM_LOAD( "p4",  0x4000, 0x8000, CRC(f4101cb4) SHA1(cee0eb1cae9f584fb5a866d3a8725f6a3feba912) )
3722
3723   ROM_REGION( 0x10000, "audio", 0 )
3724   ROM_LOAD( "ik5",  0x0000, 0x4000, CRC(863448fa) SHA1(19cad05dc9c4495f36e0d8627927ea6d0a971824) )   // p5
3725   ROM_LOAD( "ik6",  0x4000, 0x8000, CRC(9b16aa57) SHA1(69866ce41c587721702c92ac2e9ba3f6645004cf) )   // p6
3726
3727   ROM_REGION( 0x0c00, "proms", 0 )
3728   ROM_LOAD( "7122er.prm",  0x000, 0x400, CRC(b9bf2c2c) SHA1(8eb62152dcb04f463baf6ec2a66148eb947403ef) )
3729   ROM_LOAD( "7122eg.prm",  0x400, 0x400, CRC(0703a770) SHA1(62861ef4987003d4965ef5018ccdf7157981d939) )
3730   ROM_LOAD( "7122eb.prm",  0x800, 0x400, CRC(0a11cdde) SHA1(faae17398341317e7afbd06b903b8e9e65967bf1) )
3731
3732   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
3733   ROM_LOAD( "7.rom",    0x00000, 0x4000, CRC(a7eb4917) SHA1(6c07323cc243df4c5c30bc0daedbff3887309f65) )   // p7
3734
3735   ROM_REGION( 0x20000, "bg_tiles", ROMREGION_DISPOSE )
3736   ROM_LOAD( "17.rom", 0x00000, 0x8000, CRC(e0dba976) SHA1(5a8f14f7a199b5fb1862debda0bceee42cddac59) )
3737   ROM_LOAD( "18.rom", 0x08000, 0x8000, CRC(24947d5f) SHA1(ffd18074ced8171c9da56c839e8289afc29af2c9) )
3738   ROM_LOAD( "19.rom", 0x10000, 0x8000, CRC(9ee59e91) SHA1(fe51d13ab73cb596a233669e304b2be66f9becae) )
3739   ROM_LOAD( "20.rom", 0x18000, 0x8000, CRC(5da7ec1a) SHA1(4b212c1dfe4c18eced90ee3a783e7edf8d23c906) )
3740
3741   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
3742   ROM_LOAD( "8.rom",  0x00000, 0x8000, CRC(9827c14a) SHA1(b54dcee95c6f6e46c187a117b4e7aaf1c0ece6c6) )   // p8
3743   ROM_LOAD( "9.rom",  0x08000, 0x8000, CRC(545c790c) SHA1(7738738f4a1343b04efd029ecaefac74010451f0) )   // p9
3744   ROM_LOAD( "10.rom", 0x10000, 0x8000, CRC(ec9ba07e) SHA1(6b492b2cd7b8cca948ce39c3450f1cc153f41d90) )   // p10
3745
3746   ROM_REGION( 0x30000, "sp32_tiles", ROMREGION_DISPOSE )
3747   ROM_LOAD( "11.rom", 0x00000, 0x8000, CRC(5c75ea8f) SHA1(4e8ee56a2dbeb9ac2dd74bc584dba29433d91ae0) )
3748   ROM_LOAD( "14.rom", 0x08000, 0x8000, CRC(3293fde4) SHA1(3e2f0fa00c22f1c0c1427d8d3de57dd9ec7682a9) )
3749   ROM_LOAD( "12.rom", 0x10000, 0x8000, CRC(95138498) SHA1(8ac3d2cd793312434b9ffb8c47c30473f713e0e8) )
3750   ROM_LOAD( "15.rom", 0x18000, 0x8000, CRC(65a61c99) SHA1(767694c919180de208b6211b593db68fc5a66ff1) )
3751   ROM_LOAD( "13.rom", 0x20000, 0x8000, CRC(315383d7) SHA1(1c1c5931e3447c4dcbd54fc8ae383b03cb5fbf5b) )
3752   ROM_LOAD( "16.rom", 0x28000, 0x8000, CRC(e9b03e07) SHA1(124e5328a965ea2af28c4d74934a82394a2ffd72) )
3753
3754   ROM_REGION( 0x0800, "plds", ROMREGION_DISPOSE )
3755   ROM_LOAD( "ampal16r6a-a5004.1", 0x0000, 0x0104, CRC(a2e9a162) SHA1(35abf667725abea74d36c76552387e7a1debe75a) )
3756   ROM_LOAD( "pal20l8a-a5004.2",   0x0200, 0x0144, CRC(28f2c404) SHA1(d0832ef9e6be6449018f9b224d5f7203820a5135) )
3757   ROM_LOAD( "ampal16l8a-a5004.3", 0x0400, 0x0104, CRC(540351f2) SHA1(d9c3aebb839935c8b49678693b87cc2bca2a674d) )
3758   ROM_LOAD( "ampal16l8a-a5004.4", 0x0600, 0x0104, CRC(540351f2) SHA1(d9c3aebb839935c8b49678693b87cc2bca2a674d) )
3759ROM_END
3760
15013761ROM_START( ikarijp )
1502   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
3762   ROM_REGION( 0x10000, "main", 0 )
15033763   ROM_LOAD( "up03_l4.rom",  0x0000, 0x4000, CRC(cde006be) SHA1(a42e23659cf0ea5194f8a7a9a1679ebcaed75ead) )
15043764   ROM_LOAD( "up03_k4.rom",  0x4000, 0x8000, CRC(26948850) SHA1(bfeba5f7019f6eaacf2a5464756d9cb283c5f5a2) )
15053765
1506   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
3766   ROM_REGION( 0x10000, "sub", 0 )
15073767   ROM_LOAD( "ik3",  0x0000, 0x4000, CRC(9bb385f8) SHA1(70cc30bece54c28205017e755dc32a1c088f9f80) )
15083768   ROM_LOAD( "ik4",  0x4000, 0x8000, CRC(3a144bca) SHA1(c1b09bffb8d89e607332304b1d8845794f25273f) )
15093769
1510   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
3770   ROM_REGION( 0x10000, "audio", 0 )
15113771   ROM_LOAD( "ik5",  0x0000, 0x4000, CRC(863448fa) SHA1(19cad05dc9c4495f36e0d8627927ea6d0a971824) )
15123772   ROM_LOAD( "ik6",  0x4000, 0x8000, CRC(9b16aa57) SHA1(69866ce41c587721702c92ac2e9ba3f6645004cf) )
15133773
r3115r3116
15163776   ROM_LOAD( "7122eg.prm",  0x400, 0x400, CRC(0703a770) SHA1(62861ef4987003d4965ef5018ccdf7157981d939) )
15173777   ROM_LOAD( "7122eb.prm",  0x800, 0x400, CRC(0a11cdde) SHA1(faae17398341317e7afbd06b903b8e9e65967bf1) )
15183778
1519   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE ) /* characters */
1520   ROM_LOAD( "ik7",    0x00000, 0x4000, CRC(9e88f536) SHA1(80e9aadeb626e60318a2139fd1b3875f6256c492) )   /* characters */
3779   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
3780   ROM_LOAD( "ik7",    0x00000, 0x4000, CRC(9e88f536) SHA1(80e9aadeb626e60318a2139fd1b3875f6256c492) )
15213781
1522   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
3782   ROM_REGION( 0x20000, "bg_tiles", ROMREGION_DISPOSE )
15233783   ROM_LOAD( "17.rom", 0x00000, 0x8000, CRC(e0dba976) SHA1(5a8f14f7a199b5fb1862debda0bceee42cddac59) )
15243784   ROM_LOAD( "18.rom", 0x08000, 0x8000, CRC(24947d5f) SHA1(ffd18074ced8171c9da56c839e8289afc29af2c9) )
1525   ROM_LOAD( "ik19", 0x10000, 0x8000, CRC(566242ec) SHA1(ca25587460491597d462d2526d59afbc9b92fb75) )
3785   ROM_LOAD( "ik19",   0x10000, 0x8000, CRC(566242ec) SHA1(ca25587460491597d462d2526d59afbc9b92fb75) )
15263786   ROM_LOAD( "20.rom", 0x18000, 0x8000, CRC(5da7ec1a) SHA1(4b212c1dfe4c18eced90ee3a783e7edf8d23c906) )
15273787
1528   ROM_REGION( 0x18000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
3788   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
15293789   ROM_LOAD( "ik8",  0x00000, 0x8000, CRC(75d796d0) SHA1(395c1d22b935c92c50a326edc8b6cd9aab235f7c) )
15303790   ROM_LOAD( "ik9",  0x08000, 0x8000, CRC(2c34903b) SHA1(1949fc0cef4b30665ad288fa8e506a05741face0) )
15313791   ROM_LOAD( "ik10", 0x10000, 0x8000, CRC(da9ccc94) SHA1(be3c9d44a887ac823039153b832dfae18fe69965) )
15323792
1533   ROM_REGION( 0x30000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
3793   ROM_REGION( 0x30000, "sp32_tiles", ROMREGION_DISPOSE )
15343794   ROM_LOAD( "11.rom", 0x00000, 0x8000, CRC(5c75ea8f) SHA1(4e8ee56a2dbeb9ac2dd74bc584dba29433d91ae0) )
15353795   ROM_LOAD( "14.rom", 0x08000, 0x8000, CRC(3293fde4) SHA1(3e2f0fa00c22f1c0c1427d8d3de57dd9ec7682a9) )
15363796   ROM_LOAD( "12.rom", 0x10000, 0x8000, CRC(95138498) SHA1(8ac3d2cd793312434b9ffb8c47c30473f713e0e8) )
r3115r3116
15463806ROM_END
15473807
15483808ROM_START( ikarijpb )
1549   ROM_REGION( 0x10000, "main", 0 ) /* CPU A */
3809   ROM_REGION( 0x10000, "main", 0 )
15503810   ROM_LOAD( "ik1",     0x00000, 0x4000, CRC(2ef87dce) SHA1(4b52567fee81018f7a4b33bac79ea521c7d19d52) )
15513811   ROM_LOAD( "up03_k4.rom",  0x04000, 0x8000, CRC(26948850) SHA1(bfeba5f7019f6eaacf2a5464756d9cb283c5f5a2) )
15523812
1553   ROM_REGION( 0x10000, "sub", 0 ) /* CPU B code */
3813   ROM_REGION( 0x10000, "sub", 0 )
15543814   ROM_LOAD( "ik3",    0x0000, 0x4000, CRC(9bb385f8) SHA1(70cc30bece54c28205017e755dc32a1c088f9f80) )
15553815   ROM_LOAD( "ik4",    0x4000, 0x8000, CRC(3a144bca) SHA1(c1b09bffb8d89e607332304b1d8845794f25273f) )
15563816
1557   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
3817   ROM_REGION( 0x10000, "audio", 0 )
15583818   ROM_LOAD( "ik5",    0x0000, 0x4000, CRC(863448fa) SHA1(19cad05dc9c4495f36e0d8627927ea6d0a971824) )
15593819   ROM_LOAD( "ik6",    0x4000, 0x8000, CRC(9b16aa57) SHA1(69866ce41c587721702c92ac2e9ba3f6645004cf) )
15603820
r3115r3116
15633823   ROM_LOAD( "7122eg.prm", 0x400, 0x400, CRC(0703a770) SHA1(62861ef4987003d4965ef5018ccdf7157981d939) )
15643824   ROM_LOAD( "7122eb.prm", 0x800, 0x400, CRC(0a11cdde) SHA1(faae17398341317e7afbd06b903b8e9e65967bf1) )
15653825
1566   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE ) /* characters */
3826   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
15673827   ROM_LOAD( "ik7", 0x0000, 0x4000, CRC(9e88f536) SHA1(80e9aadeb626e60318a2139fd1b3875f6256c492) )
15683828
1569   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
3829   ROM_REGION( 0x20000, "bg_tiles", ROMREGION_DISPOSE )
15703830   ROM_LOAD( "17.rom", 0x00000, 0x8000, CRC(e0dba976) SHA1(5a8f14f7a199b5fb1862debda0bceee42cddac59) )
15713831   ROM_LOAD( "18.rom", 0x08000, 0x8000, CRC(24947d5f) SHA1(ffd18074ced8171c9da56c839e8289afc29af2c9) )
15723832   ROM_LOAD( "ik19",   0x10000, 0x8000, CRC(566242ec) SHA1(ca25587460491597d462d2526d59afbc9b92fb75) )
15733833   ROM_LOAD( "20.rom", 0x18000, 0x8000, CRC(5da7ec1a) SHA1(4b212c1dfe4c18eced90ee3a783e7edf8d23c906) )
15743834
1575   ROM_REGION( 0x18000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
3835   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
15763836   ROM_LOAD( "ik8",    0x00000, 0x8000, CRC(75d796d0) SHA1(395c1d22b935c92c50a326edc8b6cd9aab235f7c) )
15773837   ROM_LOAD( "ik9",    0x08000, 0x8000, CRC(2c34903b) SHA1(1949fc0cef4b30665ad288fa8e506a05741face0) )
15783838   ROM_LOAD( "ik10",   0x10000, 0x8000, CRC(da9ccc94) SHA1(be3c9d44a887ac823039153b832dfae18fe69965) )
15793839
1580   ROM_REGION( 0x30000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
3840   ROM_REGION( 0x30000, "sp32_tiles", ROMREGION_DISPOSE )
15813841   ROM_LOAD( "11.rom", 0x00000, 0x8000, CRC(5c75ea8f) SHA1(4e8ee56a2dbeb9ac2dd74bc584dba29433d91ae0) )
15823842   ROM_LOAD( "14.rom", 0x08000, 0x8000, CRC(3293fde4) SHA1(3e2f0fa00c22f1c0c1427d8d3de57dd9ec7682a9) )
15833843   ROM_LOAD( "12.rom", 0x10000, 0x8000, CRC(95138498) SHA1(8ac3d2cd793312434b9ffb8c47c30473f713e0e8) )
r3115r3116
15893849/***********************************************************************/
15903850
15913851ROM_START( victroad )
1592   ROM_REGION( 0x10000, "main", 0 )   /* CPU A code */
3852   ROM_REGION( 0x10000, "main", 0 )
15933853   ROM_LOAD( "p1",  0x0000, 0x10000,  CRC(e334acef) SHA1(f6d8da554276abbe5579c92eea46591a92623f6e) )
15943854
1595   ROM_REGION(  0x10000 , "sub", 0 )   /* CPU B code */
3855   ROM_REGION(  0x10000 , "sub", 0 )
15963856   ROM_LOAD( "p2",  0x00000, 0x10000, CRC(907fac83) SHA1(691d95f95ef7a308c7f5e7defb20971b54423745) )
15973857
1598   ROM_REGION( 0x10000, "audio", 0 )   /* sound code */
3858   ROM_REGION( 0x10000, "audio", 0 )
15993859   ROM_LOAD( "p3",  0x00000, 0x10000, CRC(bac745f6) SHA1(c118d94aff16cbf1b85615ff5a93292f6e98c149) )
16003860
16013861   ROM_REGION( 0x0c00, "proms", 0 )
r3115r3116
16033863   ROM_LOAD( "mb7122e.2l", 0x400, 0x400, CRC(8feca424) SHA1(c3d666f4b4b914199b24ded02f9a1b643bf90d26) )
16043864   ROM_LOAD( "mb7122e.1l", 0x800, 0x400, CRC(220076ca) SHA1(a353c770c0ffb1105fb93c97977597ad2fda8ac8) )
16053865
1606   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE ) /* characters */
3866   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
16073867   ROM_LOAD( "p7",  0x0000, 0x4000,  CRC(2b6ed95b) SHA1(dddf3aa21776778153572a20d29d47928a7116d8) )
16083868
1609   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
3869   ROM_REGION( 0x20000, "bg_tiles", ROMREGION_DISPOSE )
16103870   ROM_LOAD( "p17",  0x00000, 0x8000, CRC(19d4518c) SHA1(133ac6e3d75af6cfc9aa9d1d467f16696c7f3794) )
16113871   ROM_LOAD( "p18",  0x08000, 0x8000, CRC(d818be43) SHA1(274827b13e8572f68302b7e0b5964d3e32544303) )
16123872   ROM_LOAD( "p19",  0x10000, 0x8000, CRC(d64e0f89) SHA1(41204d5b0bc9d2f2599c3e881f10b73bddae3c5c) )
16133873   ROM_LOAD( "p20",  0x18000, 0x8000, CRC(edba0f31) SHA1(b3fc886d3cf7a34b470dd72cc0268a193f9a64d7) )
16143874
1615   ROM_REGION( 0x18000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
3875   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
16163876   ROM_LOAD( "p8",  0x00000, 0x8000, CRC(df7f252a) SHA1(435aade99144c9be51f65d76583256aa089cce78) )
16173877   ROM_LOAD( "p9",  0x08000, 0x8000, CRC(9897bc05) SHA1(ec181dc64dd78ff2fab193509743376ab192b99e) )
16183878   ROM_LOAD( "p10", 0x10000, 0x8000, CRC(ecd3c0ea) SHA1(f398b6a64706fcaa727ff1c150e05888091cb77c) )
16193879
1620   ROM_REGION( 0x30000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
3880   ROM_REGION( 0x30000, "sp32_tiles", ROMREGION_DISPOSE )
16213881   ROM_LOAD( "p11", 0x00000, 0x8000, CRC(668b25a4) SHA1(235423e3b442271581dde0195fdff2a37596a9bc) )
16223882   ROM_LOAD( "p14", 0x08000, 0x8000, CRC(a7031d4a) SHA1(9ea184990372909de7d8fe0891bb3e0441b13f90) )
16233883   ROM_LOAD( "p12", 0x10000, 0x8000, CRC(f44e95fa) SHA1(6633bd1e9e947cae5ba696f6fd393bf0cd7969b0) )
r3115r3116
16303890   ROM_LOAD( "p5",  0x10000, 0x10000, CRC(93e5f110) SHA1(065a78805e50ce6a48cb7930f264bada236feb13) )
16313891ROM_END
16323892
1633ROM_START( dogosoke ) /* Victory Road Japan */
1634   ROM_REGION( 0x10000, "main", 0 )   /* CPU A code */
3893ROM_START( dogosoke )
3894   ROM_REGION( 0x10000, "main", 0 )
16353895   ROM_LOAD( "up03_p4.rom",  0x0000, 0x10000,  CRC(37867ad2) SHA1(4444e428eb7126451f34351b1a2bc193484ca641) )
16363896
1637   ROM_REGION( 0x10000, "sub", 0 )   /* CPU B code */
3897   ROM_REGION( 0x10000, "sub", 0 )
16383898   ROM_LOAD( "p2",  0x00000, 0x10000, CRC(907fac83) SHA1(691d95f95ef7a308c7f5e7defb20971b54423745) )
16393899
1640   ROM_REGION( 0x10000, "audio", 0 )   /* sound code */
3900   ROM_REGION( 0x10000, "audio", 0 )
16413901   ROM_LOAD( "up03_k7.rom",  0x00000, 0x10000, CRC(173fa571) SHA1(fb9c783e5377fa86f70afee6804c8ee9061b27fd) )
16423902
16433903   ROM_REGION( 0x0c00, "proms", 0 )
r3115r3116
16453905   ROM_LOAD( "up03_l2.rom",  0x400, 0x400, CRC(99dc9792) SHA1(dcdcea2bad524776e17eaeb70dd4882283f1b125) )
16463906   ROM_LOAD( "up03_l1.rom",  0x800, 0x400, CRC(e7213160) SHA1(bc762a346e1639c8a9636fe85c18d68a08c1b586) )
16473907
1648   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE ) /* characters */
3908   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
16493909   ROM_LOAD( "up02_b3.rom",  0x0000, 0x4000,  CRC(51a4ec83) SHA1(8cb743c68a51b71ef3d78127b2cf6ab0877b13f6) )
16503910
1651   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
3911   ROM_REGION( 0x20000, "bg_tiles", ROMREGION_DISPOSE )
16523912   ROM_LOAD( "p17",  0x00000, 0x8000, CRC(19d4518c) SHA1(133ac6e3d75af6cfc9aa9d1d467f16696c7f3794) )
16533913   ROM_LOAD( "p18",  0x08000, 0x8000, CRC(d818be43) SHA1(274827b13e8572f68302b7e0b5964d3e32544303) )
16543914   ROM_LOAD( "p19",  0x10000, 0x8000, CRC(d64e0f89) SHA1(41204d5b0bc9d2f2599c3e881f10b73bddae3c5c) )
16553915   ROM_LOAD( "p20",  0x18000, 0x8000, CRC(edba0f31) SHA1(b3fc886d3cf7a34b470dd72cc0268a193f9a64d7) )
16563916
1657   ROM_REGION( 0x18000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
3917   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
16583918   ROM_LOAD( "up02_d3.rom",  0x00000, 0x8000, CRC(d43044f8) SHA1(4d5bc3730ea1bb1978ae246745416b71979cb100) )
16593919   ROM_LOAD( "up02_e3.rom",  0x08000, 0x8000, CRC(365ed2d8) SHA1(e0f600c936483e3d0d03709ae709321d072145bd) )
16603920   ROM_LOAD( "up02_g3.rom",  0x10000, 0x8000, CRC(92579bf3) SHA1(eb2084bf5c62cbbf08dc25997702f8e8eb3dcc5d) )
16613921
1662   ROM_REGION( 0x30000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
3922   ROM_REGION( 0x30000, "sp32_tiles", ROMREGION_DISPOSE )
16633923   ROM_LOAD( "p11", 0x00000, 0x8000, CRC(668b25a4) SHA1(235423e3b442271581dde0195fdff2a37596a9bc) )
16643924   ROM_LOAD( "p14", 0x08000, 0x8000, CRC(a7031d4a) SHA1(9ea184990372909de7d8fe0891bb3e0441b13f90) )
16653925   ROM_LOAD( "p12", 0x10000, 0x8000, CRC(f44e95fa) SHA1(6633bd1e9e947cae5ba696f6fd393bf0cd7969b0) )
r3115r3116
16723932   ROM_LOAD( "up03_g5.rom", 0x10000, 0x10000, CRC(aae30cd6) SHA1(9d0d2c0f947387a0924bf0ed73de9305c1625054) )
16733933ROM_END
16743934
1675ROM_START( dogosokj ) /* Victory Road Japan (Joystik version) */
1676   ROM_REGION( 0x10000, "main", 0 )   /* CPU A code */
3935ROM_START( dogosokb )
3936   ROM_REGION( 0x10000, "main", 0 )
16773937   ROM_LOAD( "01",  0x00000, 0x10000, CRC(53b0ad90) SHA1(7581365d6c82b35189852d96437b0f19abe2cf74) )
16783938
1679   ROM_REGION(  0x10000 , "sub", 0 )   /* CPU B code */
3939   ROM_REGION(  0x10000 , "sub", 0 )
16803940   ROM_LOAD( "p2",  0x00000, 0x10000, CRC(907fac83) SHA1(691d95f95ef7a308c7f5e7defb20971b54423745) )
16813941
1682   ROM_REGION( 0x10000, "audio", 0 )   /* sound code */
3942   ROM_REGION( 0x10000, "audio", 0 )
16833943   ROM_LOAD( "up03_k7.rom",  0x00000, 0x10000, CRC(173fa571) SHA1(fb9c783e5377fa86f70afee6804c8ee9061b27fd) )
16843944
16853945   ROM_REGION( 0x0c00, "proms", 0 )
1686   ROM_LOAD( "mb7122e.1k", 0x000, 0x400, CRC(491ab831) SHA1(2801d68d8a7fddaca5c48f09d421fc48ff53d244) )
1687   ROM_LOAD( "mb7122e.2l", 0x400, 0x400, CRC(8feca424) SHA1(c3d666f4b4b914199b24ded02f9a1b643bf90d26) )
1688   ROM_LOAD( "mb7122e.1l", 0x800, 0x400, CRC(220076ca) SHA1(a353c770c0ffb1105fb93c97977597ad2fda8ac8) )
3946   ROM_LOAD( "up03_k1.rom",  0x000, 0x400, CRC(10a2ce2b) SHA1(8de93250b81fbabb012c96454ef3a888b2783ab5) )
3947   ROM_LOAD( "up03_l2.rom",  0x400, 0x400, CRC(99dc9792) SHA1(dcdcea2bad524776e17eaeb70dd4882283f1b125) )
3948   ROM_LOAD( "up03_l1.rom",  0x800, 0x400, CRC(e7213160) SHA1(bc762a346e1639c8a9636fe85c18d68a08c1b586) )
16893949
1690   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE ) /* characters */
3950   ROM_REGION( 0x4000, "fg_tiles", ROMREGION_DISPOSE )
16913951   ROM_LOAD( "up02_b3.rom",  0x0000, 0x4000,  CRC(51a4ec83) SHA1(8cb743c68a51b71ef3d78127b2cf6ab0877b13f6) )
16923952
1693   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
3953   ROM_REGION( 0x20000, "bg_tiles", ROMREGION_DISPOSE )
16943954   ROM_LOAD( "p17",  0x00000, 0x8000, CRC(19d4518c) SHA1(133ac6e3d75af6cfc9aa9d1d467f16696c7f3794) )
16953955   ROM_LOAD( "p18",  0x08000, 0x8000, CRC(d818be43) SHA1(274827b13e8572f68302b7e0b5964d3e32544303) )
16963956   ROM_LOAD( "p19",  0x10000, 0x8000, CRC(d64e0f89) SHA1(41204d5b0bc9d2f2599c3e881f10b73bddae3c5c) )
16973957   ROM_LOAD( "p20",  0x18000, 0x8000, CRC(edba0f31) SHA1(b3fc886d3cf7a34b470dd72cc0268a193f9a64d7) )
16983958
1699   ROM_REGION( 0x18000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
3959   ROM_REGION( 0x18000, "sp16_tiles", ROMREGION_DISPOSE )
17003960   ROM_LOAD( "up02_d3.rom",  0x00000, 0x8000, CRC(d43044f8) SHA1(4d5bc3730ea1bb1978ae246745416b71979cb100) )
17013961   ROM_LOAD( "up02_e3.rom",  0x08000, 0x8000, CRC(365ed2d8) SHA1(e0f600c936483e3d0d03709ae709321d072145bd) )
17023962   ROM_LOAD( "up02_g3.rom",  0x10000, 0x8000, CRC(92579bf3) SHA1(eb2084bf5c62cbbf08dc25997702f8e8eb3dcc5d) )
17033963
1704   ROM_REGION( 0x30000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
3964   ROM_REGION( 0x30000, "sp32_tiles", ROMREGION_DISPOSE )
17053965   ROM_LOAD( "p11", 0x00000, 0x8000, CRC(668b25a4) SHA1(235423e3b442271581dde0195fdff2a37596a9bc) )
17063966   ROM_LOAD( "p14", 0x08000, 0x8000, CRC(a7031d4a) SHA1(9ea184990372909de7d8fe0891bb3e0441b13f90) )
17073967   ROM_LOAD( "p12", 0x10000, 0x8000, CRC(f44e95fa) SHA1(6633bd1e9e947cae5ba696f6fd393bf0cd7969b0) )
r3115r3116
17163976
17173977/***********************************************************************/
17183978
1719ROM_START( gwar )
1720   ROM_REGION( 0x10000, "main", 0 )
1721   ROM_LOAD( "7g",  0x00000, 0x10000, CRC(5bcfa7dc) SHA1(1af2c36df287c9c84be8e7fc173b66f3dde5375e) )
1722
1723   ROM_REGION( 0x10000, "sub", 0 )
1724   ROM_LOAD( "g02",  0x00000, 0x10000, CRC(86d931bf) SHA1(8bf7c7a7c01561568973d01956e5398bbc9c3463) )
1725
1726   ROM_REGION( 0x10000, "audio", 0 )
1727   ROM_LOAD( "g03",  0x00000, 0x10000, CRC(eb544ab9) SHA1(433af63feb4c4ef0e3bd383f2f9bc19e436fb103) )
1728
1729   ROM_REGION( 0x2400, "proms", 0 )
1730   ROM_LOAD( "guprom.3",  0x0000, 0x0400, CRC(090236a3) SHA1(40d066e34291492c6baf8c120657e3d547274b59) ) /* red */
1731   ROM_LOAD( "guprom.2",  0x0400, 0x0400, CRC(9147de69) SHA1(e4b3b546e429c195e82f97322e2a295882e38a58) ) /* green */
1732   ROM_LOAD( "guprom.1",  0x0800, 0x0400, CRC(7f9c839e) SHA1(2fa60fa335f76891d961c9bd0066fa7f82f76779) ) /* blue */
1733   ROM_LOAD( "btj_h.prm", 0x0c00, 0x0400, CRC(c20b197b) SHA1(504cb28d652029fe87a5411d6239e78d93c83e91) ) /* h-decode */
1734   ROM_LOAD( "btj_v.prm", 0x1000, 0x0400, CRC(5d0c617f) SHA1(845e52173c33500227cabe1e21b34919d2856215) ) /* v-decode */
1735   ROM_LOAD( "ls.bin",    0x1400, 0x1000, CRC(73df921d) SHA1(c0f765da3e0e80d104b0baaa7a83bdcc399254b3) ) /* ls-joystick encoder */
1736
1737   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE )
1738   ROM_LOAD( "g05",  0x0000, 0x08000, CRC(80f73e2e) SHA1(820824fb10f7dfec6247b46dde8ff7124bde3734) )
1739
1740   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE )
1741   ROM_LOAD( "g06",  0x00000, 0x10000, CRC(f1dcdaef) SHA1(d9b65e7f4025787037628528d3bef699be2eb874) )
1742   ROM_LOAD( "g07",  0x10000, 0x10000, CRC(326e4e5e) SHA1(6935429925d748bb43072429db0d3b08ffdbc95d) )
1743   ROM_LOAD( "g08",  0x20000, 0x10000, CRC(0aa70967) SHA1(a6cbadbb960280b5e79660c0bbd43089ced39a44) )
1744   ROM_LOAD( "g09",  0x30000, 0x10000, CRC(b7686336) SHA1(d654d282862ff00488be38fb9c1302c8bb6f7e7c) )
1745
1746   ROM_REGION( 0x40000, "gfx3", ROMREGION_DISPOSE )
1747   ROM_LOAD( "g10",  0x00000, 0x10000, CRC(58600f7d) SHA1(3dcd25d1ed07e6f74f3316ebe41768eb155f4c45) )
1748   ROM_LOAD( "g11",  0x10000, 0x10000, CRC(a3f9b463) SHA1(ee83d18cf08972c792b05c277b1ca25d732e294d) )
1749   ROM_LOAD( "g12",  0x20000, 0x10000, CRC(092501be) SHA1(85d9a8922dde6824805a4b8e6c52b2a9ad092df9) )
1750   ROM_LOAD( "g13",  0x30000, 0x10000, CRC(25801ea6) SHA1(1aa61716d6be399a1eee2ee5079f13da0f1bd4e8) )
1751
1752   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE )
1753   ROM_LOAD( "g20",  0x00000, 0x10000, CRC(2b46edff) SHA1(db97e042621dcbedfeed71937ead6d715899d4f7) )
1754   ROM_LOAD( "g21",  0x10000, 0x10000, CRC(be19888d) SHA1(bc7b1b6236d41685faacc2008d51ae2da9a82909) )
1755   ROM_LOAD( "g18",  0x20000, 0x10000, CRC(2d653f0c) SHA1(99eb7883822b10f61b6e922c0d0519aacac83732) )
1756   ROM_LOAD( "g19",  0x30000, 0x10000, CRC(ebbf3ba2) SHA1(bc3631c43058faf1ec6b21ed8017b744afee6f5d) )
1757   ROM_LOAD( "g16",  0x40000, 0x10000, CRC(aeb3707f) SHA1(58d1a71cf83ab0f5f0dd67d441edbc8ece8c2ba5) )
1758   ROM_LOAD( "g17",  0x50000, 0x10000, CRC(0808f95f) SHA1(f67763cceb287a02e3b946ade52105a72161e540) )
1759   ROM_LOAD( "g14",  0x60000, 0x10000, CRC(8dfc7b87) SHA1(e3d75020aa1b90f12633f6515a0386f87441b225) )
1760   ROM_LOAD( "g15",  0x70000, 0x10000, CRC(06822aac) SHA1(630d438cbebe0b5af571948d0d3f4996f52aae1d) )
1761
1762   ROM_REGION( 0x10000, "ym2", 0 )
1763   ROM_LOAD( "g04",  0x00000, 0x10000, CRC(2255f8dd) SHA1(fac31b617762d0fa39cf82a658be250b91ab73ce) )
1764ROM_END
1765
1766ROM_START( gwara )
1767   ROM_REGION( 0x10000, "main", 0 )
1768   ROM_LOAD( "gv3",  0x00000, 0x10000, CRC(24936d83) SHA1(33842322ead66e426946c6cfaa04e56afea90d78) )
1769
1770   ROM_REGION( 0x10000, "sub", 0 )
1771   ROM_LOAD( "gv4",  0x00000, 0x10000, CRC(26335a55) SHA1(de3e7d9e204a969745367aa37326d7b3e28c7424) )
1772
1773   ROM_REGION( 0x10000, "audio", 0 )
1774   ROM_LOAD( "gv2",  0x00000, 0x10000, CRC(896682dd) SHA1(dc2125c2378a01291197b2798a5eef6459cf5b99) )
1775
1776   ROM_REGION( 0x2400, "proms", 0 )
1777   ROM_LOAD( "guprom.3", 0x000, 0x400, CRC(090236a3) SHA1(40d066e34291492c6baf8c120657e3d547274b59) ) /* red */
1778   ROM_LOAD( "guprom.2", 0x400, 0x400, CRC(9147de69) SHA1(e4b3b546e429c195e82f97322e2a295882e38a58) ) /* green */
1779   ROM_LOAD( "guprom.1", 0x800, 0x400, CRC(7f9c839e) SHA1(2fa60fa335f76891d961c9bd0066fa7f82f76779) ) /* blue */
1780   ROM_LOAD( "btj_h.prm", 0x0c00, 0x0400, CRC(c20b197b) SHA1(504cb28d652029fe87a5411d6239e78d93c83e91) ) /* h-decode */
1781   ROM_LOAD( "btj_v.prm", 0x1000, 0x0400, CRC(5d0c617f) SHA1(845e52173c33500227cabe1e21b34919d2856215) ) /* v-decode */
1782   ROM_LOAD( "ls.bin",    0x1400, 0x1000, CRC(73df921d) SHA1(c0f765da3e0e80d104b0baaa7a83bdcc399254b3) ) /* ls-joystick encoder */
1783
1784   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE )
1785   ROM_LOAD( "g05",  0x0000, 0x08000, CRC(80f73e2e) SHA1(820824fb10f7dfec6247b46dde8ff7124bde3734) )
1786
1787   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE )
1788   ROM_LOAD( "g06",  0x00000, 0x10000, CRC(f1dcdaef) SHA1(d9b65e7f4025787037628528d3bef699be2eb874) )
1789   ROM_LOAD( "g07",  0x10000, 0x10000, CRC(326e4e5e) SHA1(6935429925d748bb43072429db0d3b08ffdbc95d) )
1790   ROM_LOAD( "g08",  0x20000, 0x10000, CRC(0aa70967) SHA1(a6cbadbb960280b5e79660c0bbd43089ced39a44) )
1791   ROM_LOAD( "g09",  0x30000, 0x10000, CRC(b7686336) SHA1(d654d282862ff00488be38fb9c1302c8bb6f7e7c) )
1792
1793   ROM_REGION( 0x40000, "gfx3", ROMREGION_DISPOSE )
1794   ROM_LOAD( "g10",  0x00000, 0x10000, CRC(58600f7d) SHA1(3dcd25d1ed07e6f74f3316ebe41768eb155f4c45) )
1795   ROM_LOAD( "g11",  0x10000, 0x10000, CRC(a3f9b463) SHA1(ee83d18cf08972c792b05c277b1ca25d732e294d) )
1796   ROM_LOAD( "g12",  0x20000, 0x10000, CRC(092501be) SHA1(85d9a8922dde6824805a4b8e6c52b2a9ad092df9) )
1797   ROM_LOAD( "g13",  0x30000, 0x10000, CRC(25801ea6) SHA1(1aa61716d6be399a1eee2ee5079f13da0f1bd4e8) )
1798
1799   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE )
1800   ROM_LOAD( "g20",  0x00000, 0x10000, CRC(2b46edff) SHA1(db97e042621dcbedfeed71937ead6d715899d4f7) )
1801   ROM_LOAD( "g21",  0x10000, 0x10000, CRC(be19888d) SHA1(bc7b1b6236d41685faacc2008d51ae2da9a82909) )
1802   ROM_LOAD( "g18",  0x20000, 0x10000, CRC(2d653f0c) SHA1(99eb7883822b10f61b6e922c0d0519aacac83732) )
1803   ROM_LOAD( "g19",  0x30000, 0x10000, CRC(ebbf3ba2) SHA1(bc3631c43058faf1ec6b21ed8017b744afee6f5d) )
1804   ROM_LOAD( "g16",  0x40000, 0x10000, CRC(aeb3707f) SHA1(58d1a71cf83ab0f5f0dd67d441edbc8ece8c2ba5) )
1805   ROM_LOAD( "g17",  0x50000, 0x10000, CRC(0808f95f) SHA1(f67763cceb287a02e3b946ade52105a72161e540) )
1806   ROM_LOAD( "g14",  0x60000, 0x10000, CRC(8dfc7b87) SHA1(e3d75020aa1b90f12633f6515a0386f87441b225) )
1807   ROM_LOAD( "g15",  0x70000, 0x10000, CRC(06822aac) SHA1(630d438cbebe0b5af571948d0d3f4996f52aae1d) )
1808
1809   ROM_REGION( 0x10000, "ym2", 0 )
1810   ROM_LOAD( "g04",  0x00000, 0x10000, CRC(2255f8dd) SHA1(fac31b617762d0fa39cf82a658be250b91ab73ce) )
1811ROM_END
1812
1813ROM_START( gwarj )
1814   ROM_REGION( 0x10000, "main", 0 )
1815   ROM_LOAD( "7y3047",  0x00000, 0x10000, CRC(7f8a880c) SHA1(1eb1c3eb45aa933118e5bd116eb3f81f39063ae3) )
1816
1817   ROM_REGION( 0x10000, "sub", 0 )
1818   ROM_LOAD( "g02",  0x00000, 0x10000, CRC(86d931bf) SHA1(8bf7c7a7c01561568973d01956e5398bbc9c3463) )
1819
1820   ROM_REGION( 0x10000, "audio", 0 )
1821   ROM_LOAD( "g03",  0x00000, 0x10000, CRC(eb544ab9) SHA1(433af63feb4c4ef0e3bd383f2f9bc19e436fb103) )
1822
1823   ROM_REGION( 0x2400, "proms", 0 )
1824   ROM_LOAD( "guprom.3", 0x000, 0x400, CRC(090236a3) SHA1(40d066e34291492c6baf8c120657e3d547274b59) ) /* red */
1825   ROM_LOAD( "guprom.2", 0x400, 0x400, CRC(9147de69) SHA1(e4b3b546e429c195e82f97322e2a295882e38a58) ) /* green */
1826   ROM_LOAD( "guprom.1", 0x800, 0x400, CRC(7f9c839e) SHA1(2fa60fa335f76891d961c9bd0066fa7f82f76779) ) /* blue */
1827   ROM_LOAD( "btj_h.prm", 0x0c00, 0x0400, CRC(c20b197b) SHA1(504cb28d652029fe87a5411d6239e78d93c83e91) ) /* h-decode */
1828   ROM_LOAD( "btj_v.prm", 0x1000, 0x0400, CRC(5d0c617f) SHA1(845e52173c33500227cabe1e21b34919d2856215) ) /* v-decode */
1829   ROM_LOAD( "ls.bin",    0x1400, 0x1000, CRC(73df921d) SHA1(c0f765da3e0e80d104b0baaa7a83bdcc399254b3) ) /* ls-joystick encoder */
1830
1831   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE )
1832   ROM_LOAD( "792001",  0x0000, 0x08000, CRC(99d7ddf3) SHA1(4e4bc400d184e1fb9d0af3a33cc6f6d099bb3bee) )
1833
1834   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE )
1835   ROM_LOAD( "g06",  0x00000, 0x10000, CRC(f1dcdaef) SHA1(d9b65e7f4025787037628528d3bef699be2eb874) )
1836   ROM_LOAD( "g07",  0x10000, 0x10000, CRC(326e4e5e) SHA1(6935429925d748bb43072429db0d3b08ffdbc95d) )
1837   ROM_LOAD( "g08",  0x20000, 0x10000, CRC(0aa70967) SHA1(a6cbadbb960280b5e79660c0bbd43089ced39a44) )
1838   ROM_LOAD( "g09",  0x30000, 0x10000, CRC(b7686336) SHA1(d654d282862ff00488be38fb9c1302c8bb6f7e7c) )
1839
1840   ROM_REGION( 0x40000, "gfx3", ROMREGION_DISPOSE )
1841   ROM_LOAD( "g10",  0x00000, 0x10000, CRC(58600f7d) SHA1(3dcd25d1ed07e6f74f3316ebe41768eb155f4c45) )
1842   ROM_LOAD( "g11",  0x10000, 0x10000, CRC(a3f9b463) SHA1(ee83d18cf08972c792b05c277b1ca25d732e294d) )
1843   ROM_LOAD( "g12",  0x20000, 0x10000, CRC(092501be) SHA1(85d9a8922dde6824805a4b8e6c52b2a9ad092df9) )
1844   ROM_LOAD( "g13",  0x30000, 0x10000, CRC(25801ea6) SHA1(1aa61716d6be399a1eee2ee5079f13da0f1bd4e8) )
1845
1846   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE )
1847   ROM_LOAD( "g20",  0x00000, 0x10000, CRC(2b46edff) SHA1(db97e042621dcbedfeed71937ead6d715899d4f7) )
1848   ROM_LOAD( "g21",  0x10000, 0x10000, CRC(be19888d) SHA1(bc7b1b6236d41685faacc2008d51ae2da9a82909) )
1849   ROM_LOAD( "g18",  0x20000, 0x10000, CRC(2d653f0c) SHA1(99eb7883822b10f61b6e922c0d0519aacac83732) )
1850   ROM_LOAD( "g19",  0x30000, 0x10000, CRC(ebbf3ba2) SHA1(bc3631c43058faf1ec6b21ed8017b744afee6f5d) )
1851   ROM_LOAD( "g16",  0x40000, 0x10000, CRC(aeb3707f) SHA1(58d1a71cf83ab0f5f0dd67d441edbc8ece8c2ba5) )
1852   ROM_LOAD( "g17",  0x50000, 0x10000, CRC(0808f95f) SHA1(f67763cceb287a02e3b946ade52105a72161e540) )
1853   ROM_LOAD( "g14",  0x60000, 0x10000, CRC(8dfc7b87) SHA1(e3d75020aa1b90f12633f6515a0386f87441b225) )
1854   ROM_LOAD( "g15",  0x70000, 0x10000, CRC(06822aac) SHA1(630d438cbebe0b5af571948d0d3f4996f52aae1d) )
1855
1856   ROM_REGION( 0x10000, "ym2", 0 )
1857   ROM_LOAD( "g04",  0x00000, 0x10000, CRC(2255f8dd) SHA1(fac31b617762d0fa39cf82a658be250b91ab73ce) )
1858ROM_END
1859
1860ROM_START( gwarb )
1861   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
1862   ROM_LOAD( "g01",  0x00000, 0x10000, CRC(ce1d3c80) SHA1(605ada3529d0b26425e6c573c31117249bb7a7db) )
1863
1864   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
1865   ROM_LOAD( "g02",  0x00000, 0x10000, CRC(86d931bf) SHA1(8bf7c7a7c01561568973d01956e5398bbc9c3463) )
1866
1867   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
1868   ROM_LOAD( "g03",  0x00000, 0x10000, CRC(eb544ab9) SHA1(433af63feb4c4ef0e3bd383f2f9bc19e436fb103) )
1869
1870   ROM_REGION( 0x0c00, "proms", 0 )
1871   ROM_LOAD( "guprom.3", 0x000, 0x400, CRC(090236a3) SHA1(40d066e34291492c6baf8c120657e3d547274b59) ) /* red */ // up03_k1.rom
1872   ROM_LOAD( "guprom.2", 0x400, 0x400, CRC(9147de69) SHA1(e4b3b546e429c195e82f97322e2a295882e38a58) ) /* green */ // up03_l1.rom
1873   ROM_LOAD( "guprom.1", 0x800, 0x400, CRC(7f9c839e) SHA1(2fa60fa335f76891d961c9bd0066fa7f82f76779) ) /* blue */ // up03_k2.rom
1874
1875   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
1876   ROM_LOAD( "g05",  0x0000, 0x08000, CRC(80f73e2e) SHA1(820824fb10f7dfec6247b46dde8ff7124bde3734) )
1877
1878   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE ) /* background tiles */
1879   ROM_LOAD( "g06",  0x00000, 0x10000, CRC(f1dcdaef) SHA1(d9b65e7f4025787037628528d3bef699be2eb874) )
1880   ROM_LOAD( "g07",  0x10000, 0x10000, CRC(326e4e5e) SHA1(6935429925d748bb43072429db0d3b08ffdbc95d) )
1881   ROM_LOAD( "g08",  0x20000, 0x10000, CRC(0aa70967) SHA1(a6cbadbb960280b5e79660c0bbd43089ced39a44) )
1882   ROM_LOAD( "g09",  0x30000, 0x10000, CRC(b7686336) SHA1(d654d282862ff00488be38fb9c1302c8bb6f7e7c) )
1883
1884   ROM_REGION( 0x40000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
1885   ROM_LOAD( "g10",  0x00000, 0x10000, CRC(58600f7d) SHA1(3dcd25d1ed07e6f74f3316ebe41768eb155f4c45) )
1886   ROM_LOAD( "g11",  0x10000, 0x10000, CRC(a3f9b463) SHA1(ee83d18cf08972c792b05c277b1ca25d732e294d) )
1887   ROM_LOAD( "g12",  0x20000, 0x10000, CRC(092501be) SHA1(85d9a8922dde6824805a4b8e6c52b2a9ad092df9) )
1888   ROM_LOAD( "g13",  0x30000, 0x10000, CRC(25801ea6) SHA1(1aa61716d6be399a1eee2ee5079f13da0f1bd4e8) )
1889
1890   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
1891   ROM_LOAD( "g20",  0x00000, 0x10000, CRC(2b46edff) SHA1(db97e042621dcbedfeed71937ead6d715899d4f7) )
1892   ROM_LOAD( "g21",  0x10000, 0x10000, CRC(be19888d) SHA1(bc7b1b6236d41685faacc2008d51ae2da9a82909) )
1893   ROM_LOAD( "g18",  0x20000, 0x10000, CRC(2d653f0c) SHA1(99eb7883822b10f61b6e922c0d0519aacac83732) )
1894   ROM_LOAD( "g19",  0x30000, 0x10000, CRC(ebbf3ba2) SHA1(bc3631c43058faf1ec6b21ed8017b744afee6f5d) )
1895   ROM_LOAD( "g16",  0x40000, 0x10000, CRC(aeb3707f) SHA1(58d1a71cf83ab0f5f0dd67d441edbc8ece8c2ba5) )
1896   ROM_LOAD( "g17",  0x50000, 0x10000, CRC(0808f95f) SHA1(f67763cceb287a02e3b946ade52105a72161e540) )
1897   ROM_LOAD( "g14",  0x60000, 0x10000, CRC(8dfc7b87) SHA1(e3d75020aa1b90f12633f6515a0386f87441b225) )
1898   ROM_LOAD( "g15",  0x70000, 0x10000, CRC(06822aac) SHA1(630d438cbebe0b5af571948d0d3f4996f52aae1d) )
1899
1900   ROM_REGION( 0x10000, "ym2", 0 )
1901   ROM_LOAD( "g04",  0x00000, 0x10000, CRC(2255f8dd) SHA1(fac31b617762d0fa39cf82a658be250b91ab73ce) )
1902ROM_END
1903
19043979/*
19053980pals
19063981----
r3115r3116
21404215/***********************************************************************/
21414216
21424217ROM_START( bermudat )
2143   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
4218   ROM_REGION( 0x10000, "main", 0 )
21444219   ROM_LOAD( "bt_p1.rom",  0x0000, 0x10000,  CRC(43dec5e9) SHA1(2b29016d4af2a0a6be87f440f235a6a76f8a52a0) )
21454220
2146   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
4221   ROM_REGION( 0x10000, "sub", 0 )
21474222   ROM_LOAD( "bt_p2.rom",  0x00000, 0x10000, CRC(0e193265) SHA1(765ad63d1f752920d3d7829747e8f2808670ee84) )
21484223
2149   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
2150   ROM_LOAD( "bt_p3.rom",  0x00000, 0x10000, CRC(53a82e50) SHA1(ce1e72f0ddc5e19c2d8a6a545ce205c7c39da2dd) )    /* YM3526 */
4224   ROM_REGION( 0x10000, "audio", 0 )
4225   ROM_LOAD( "bt_p3.rom",  0x00000, 0x10000, CRC(53a82e50) SHA1(ce1e72f0ddc5e19c2d8a6a545ce205c7c39da2dd) )
21514226
21524227   ROM_REGION( 0x1400, "proms", 0 )
21534228   ROM_LOAD( "btj_01r.prm", 0x0000, 0x0400, CRC(f4b54d06) SHA1(620ea513dbf3219844cdb36ea5d7e2a1b13e3198) ) /* red */
r3115r3116
21564231   ROM_LOAD( "btj_h.prm",   0x0c00, 0x0400, CRC(c20b197b) SHA1(504cb28d652029fe87a5411d6239e78d93c83e91) ) /* ? */
21574232   ROM_LOAD( "btj_v.prm",   0x1000, 0x0400, CRC(5d0c617f) SHA1(845e52173c33500227cabe1e21b34919d2856215) ) /* ? */
21584233
2159   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
4234   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
21604235   ROM_LOAD( "bt_p10.rom", 0x0000, 0x8000,  CRC(d3650211) SHA1(cc7cfe05c5903caf33f8f02c416f68e6d2f6baa7) )
21614236
2162   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
4237   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
21634238   ROM_LOAD( "bt_p22.rom", 0x00000, 0x10000, CRC(8daf7df4) SHA1(c6b5157821f3751bc70411ba0e1ea43d223ad0f6) )
21644239   ROM_LOAD( "bt_p21.rom", 0x10000, 0x10000, CRC(b7689599) SHA1(ffa35b480efbc55948e5d0202e7a7ab6446db905) )
21654240   ROM_LOAD( "bt_p20.rom", 0x20000, 0x10000, CRC(ab6217b7) SHA1(fb4b0fcd9ff1f04cf772a46b6727d3de531beb0e) )
21664241   ROM_LOAD( "bt_p19.rom", 0x30000, 0x10000, CRC(8ed759a0) SHA1(cd039ed9cb4127729bd29c6232dcbb77b85a4159) )
21674242
2168   ROM_REGION( 0x20000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
4243   ROM_REGION( 0x20000, "sp16_tiles", ROMREGION_DISPOSE )
21694244   ROM_LOAD( "bt_p6.rom",  0x00000, 0x8000, CRC(8ffdf969) SHA1(68672dc74156ebbf59316dfeae25b155d699d0eb) )
21704245   ROM_LOAD( "bt_p7.rom",  0x08000, 0x8000, CRC(268d10df) SHA1(6a297bbd7b4248306d8756a80f4403c45d833eb3) )
21714246   ROM_LOAD( "bt_p8.rom",  0x10000, 0x8000, CRC(3e39e9dd) SHA1(394c85841113a1b2bdd744445e3e4e3acc7099c6) )
21724247   ROM_LOAD( "bt_p9.rom",  0x18000, 0x8000, CRC(bf56da61) SHA1(855687b6a0a4cef3b8294ca359abe14b11ad5749) )
21734248
2174   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
4249   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
21754250   ROM_LOAD( "bt_p11.rom", 0x00000, 0x10000, CRC(aae7410e) SHA1(19dcd13fc53c05bac05d2242965129ab1e3a4a88) )
21764251   ROM_LOAD( "bt_p12.rom", 0x10000, 0x10000, CRC(18914f70) SHA1(2c4e7db8b6e70dffb27d10032f750932c7379a66) )
21774252   ROM_LOAD( "bt_p13.rom", 0x20000, 0x10000, CRC(cd79ce81) SHA1(00f205f8a97f839e2592bdfb624fe6b902ce5a93) )
r3115r3116
21864261   ROM_LOAD( "bt_p5.rom",  0x10000, 0x10000, CRC(817bd62c) SHA1(d3ee2ff01a4da8b928728b2fd4948fabd2b04420) )
21874262ROM_END
21884263
2189ROM_START( bermudao )
2190   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
4264ROM_START( bermudaj )
4265   ROM_REGION( 0x10000, "main", 0 )
21914266   ROM_LOAD( "btj_p01.bin", 0x0000, 0x10000,  CRC(eda75f36) SHA1(d6fcb46dc45007a77bf6a8ca7aa53aefedcecf92) )
21924267
2193   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
4268   ROM_REGION( 0x10000, "sub", 0 )
21944269   ROM_LOAD( "bt_p2.rom",   0x00000, 0x10000, CRC(0e193265) SHA1(765ad63d1f752920d3d7829747e8f2808670ee84) )
21954270
2196   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
2197   ROM_LOAD( "btj_p03.bin", 0x00000, 0x10000, CRC(fea8a096) SHA1(593e34a20ab6f5bae9d74415af5a834646d2444e) )    /* YM3526 */
4271   ROM_REGION( 0x10000, "audio", 0 )
4272   ROM_LOAD( "btj_p03.bin", 0x00000, 0x10000, CRC(fea8a096) SHA1(593e34a20ab6f5bae9d74415af5a834646d2444e) )
21984273
21994274   ROM_REGION( 0x1400, "proms", 0 )
22004275   ROM_LOAD( "btj_01r.prm", 0x0000, 0x0400, CRC(f4b54d06) SHA1(620ea513dbf3219844cdb36ea5d7e2a1b13e3198) ) /* red */
r3115r3116
22034278   ROM_LOAD( "btj_h.prm",   0x0c00, 0x0400, CRC(c20b197b) SHA1(504cb28d652029fe87a5411d6239e78d93c83e91) ) /* ? */
22044279   ROM_LOAD( "btj_v.prm",   0x1000, 0x0400, CRC(5d0c617f) SHA1(845e52173c33500227cabe1e21b34919d2856215) ) /* ? */
22054280
2206   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
4281   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
22074282   ROM_LOAD( "bt_p10.rom",  0x0000, 0x8000,  CRC(d3650211) SHA1(cc7cfe05c5903caf33f8f02c416f68e6d2f6baa7) )
22084283
2209   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
4284   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
22104285   ROM_LOAD( "bt_p22.rom",  0x00000, 0x10000, CRC(8daf7df4) SHA1(c6b5157821f3751bc70411ba0e1ea43d223ad0f6) )
22114286   ROM_LOAD( "bt_p21.rom",  0x10000, 0x10000, CRC(b7689599) SHA1(ffa35b480efbc55948e5d0202e7a7ab6446db905) )
22124287   ROM_LOAD( "bt_p20.rom",  0x20000, 0x10000, CRC(ab6217b7) SHA1(fb4b0fcd9ff1f04cf772a46b6727d3de531beb0e) )
22134288   ROM_LOAD( "bt_p19.rom",  0x30000, 0x10000, CRC(8ed759a0) SHA1(cd039ed9cb4127729bd29c6232dcbb77b85a4159) )
22144289
2215   ROM_REGION( 0x20000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
4290   ROM_REGION( 0x20000, "sp16_tiles", ROMREGION_DISPOSE )
22164291   ROM_LOAD( "bt_p6.rom",   0x00000, 0x8000, CRC(8ffdf969) SHA1(68672dc74156ebbf59316dfeae25b155d699d0eb) )
22174292   ROM_LOAD( "bt_p7.rom",   0x08000, 0x8000, CRC(268d10df) SHA1(6a297bbd7b4248306d8756a80f4403c45d833eb3) )
22184293   ROM_LOAD( "bt_p8.rom",   0x10000, 0x8000, CRC(3e39e9dd) SHA1(394c85841113a1b2bdd744445e3e4e3acc7099c6) )
22194294   ROM_LOAD( "bt_p9.rom",   0x18000, 0x8000, CRC(bf56da61) SHA1(855687b6a0a4cef3b8294ca359abe14b11ad5749) )
22204295
2221   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
4296   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
22224297   ROM_LOAD( "bt_p11.rom",  0x00000, 0x10000, CRC(aae7410e) SHA1(19dcd13fc53c05bac05d2242965129ab1e3a4a88) )
22234298   ROM_LOAD( "bt_p12.rom",  0x10000, 0x10000, CRC(18914f70) SHA1(2c4e7db8b6e70dffb27d10032f750932c7379a66) )
22244299   ROM_LOAD( "bt_p13.rom",  0x20000, 0x10000, CRC(cd79ce81) SHA1(00f205f8a97f839e2592bdfb624fe6b902ce5a93) )
r3115r3116
22344309ROM_END
22354310
22364311ROM_START( worldwar )
2237   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
4312   ROM_REGION( 0x10000, "main", 0 )
22384313   ROM_LOAD( "ww4.bin",  0x0000, 0x10000,  CRC(bc29d09f) SHA1(9bd5a47565934590347b7152457869331ae94375) )
22394314
2240   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
4315   ROM_REGION( 0x10000, "sub", 0 )
22414316   ROM_LOAD( "ww5.bin",  0x00000, 0x10000, CRC(8dc15909) SHA1(dc0f0e969c36469cc91ecfb1a98cfdb1020972eb) )
22424317
2243   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
4318   ROM_REGION( 0x10000, "audio", 0 )
22444319   ROM_LOAD( "ww3.bin",  0x00000, 0x10000, CRC(8b74c951) SHA1(f4560380f16bcd396d08f48541c65f7be5b290d0) )
22454320
22464321   ROM_REGION( 0x1400, "proms", 0 )
r3115r3116
22504325   ROM_LOAD( "btj_h.prm",   0x0c00, 0x0400, CRC(c20b197b) SHA1(504cb28d652029fe87a5411d6239e78d93c83e91) ) /* ? */
22514326   ROM_LOAD( "btj_v.prm",   0x1000, 0x0400, CRC(5d0c617f) SHA1(845e52173c33500227cabe1e21b34919d2856215) ) /* ? */
22524327
2253   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
4328   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
22544329   ROM_LOAD( "ww6.bin", 0x0000, 0x8000,  CRC(d57570ab) SHA1(98997de12225d177be4916c7f2e6a7a2df24b8f2) )
22554330
2256   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
4331   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
22574332   ROM_LOAD( "ww11.bin", 0x00000, 0x10000, CRC(603ddcb5) SHA1(766d477672f7936a2b12d3aef435b59aaa77886d) )
22584333   ROM_LOAD( "ww12.bin", 0x10000, 0x10000, CRC(388093ff) SHA1(b449031c8225b10d7e27e3a2a0636cfd8cb4e03d) )
22594334   ROM_LOAD( "ww13.bin", 0x20000, 0x10000, CRC(83a7ef62) SHA1(692be1db8b0b0ff518ffe6e000fa8eb0ca7d8b06) )
22604335   ROM_LOAD( "ww14.bin", 0x30000, 0x10000, CRC(04c784be) SHA1(1a485eeb65dee295c791006d58e4e7305bdcf490) )
22614336
2262   ROM_REGION( 0x20000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
4337   ROM_REGION( 0x20000, "sp16_tiles", ROMREGION_DISPOSE )
22634338   ROM_LOAD( "ww10.bin", 0x00000, 0x08000, CRC(f68a2d51) SHA1(bf3bfcb7fcb77f4605472775025dc69e979155c8) )
22644339   ROM_LOAD( "ww9.bin",  0x08000, 0x08000, CRC(d9d35911) SHA1(74c23f2967be76ced82522a67291de233528b099) )
22654340   ROM_LOAD( "ww8.bin",  0x10000, 0x08000, CRC(0ec15086) SHA1(6f5fb4a0f96b3ab745f402c04c2cdc2bacaf4844) )
22664341   ROM_LOAD( "ww7.bin",  0x18000, 0x08000, CRC(53c4b24e) SHA1(5f72848f585dcee857715d6ca0020237dd23abc3) )
22674342
2268   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
4343   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
4344   ROM_LOAD( "ww21.bin", 0x00000, 0x10000, CRC(be974fbe) SHA1(bcfafb85ad858fc0a3dceb2d5fe319d812df50fc) )
4345   ROM_LOAD( "ww22.bin", 0x10000, 0x10000, CRC(9914972a) SHA1(57a27173bc525b18f42699eab9300d4c8652a7c6) )
4346   ROM_LOAD( "ww19.bin", 0x20000, 0x10000, CRC(c39ac1a7) SHA1(9f8048250306ee23c6c66c751b64f19168123ff3) )
4347   ROM_LOAD( "ww20.bin", 0x30000, 0x10000, CRC(8504170f) SHA1(e9970d006dbc63640234bb4baa76a10d84f22bcd) )
22694348   ROM_LOAD( "ww15.bin", 0x40000, 0x10000, CRC(d55ce063) SHA1(c0845db7e928e735746822ab94e5f148f38e73cc) )
22704349   ROM_LOAD( "ww16.bin", 0x50000, 0x10000, CRC(a2d19ce5) SHA1(ec1e22c8aa1d24b24fa97015c43e651aebb5a3bb) )
22714350   ROM_LOAD( "ww17.bin", 0x60000, 0x10000, CRC(a9a6b128) SHA1(bd09fcf91211739a304771f633f04235d32b057d) )
22724351   ROM_LOAD( "ww18.bin", 0x70000, 0x10000, CRC(c712d24c) SHA1(59858d446491e63f8bd0fd1f8aa20262fa0522ef) )
2273   ROM_LOAD( "ww19.bin", 0x20000, 0x10000, CRC(c39ac1a7) SHA1(9f8048250306ee23c6c66c751b64f19168123ff3) )
2274   ROM_LOAD( "ww20.bin", 0x30000, 0x10000, CRC(8504170f) SHA1(e9970d006dbc63640234bb4baa76a10d84f22bcd) )
2275   ROM_LOAD( "ww21.bin", 0x00000, 0x10000, CRC(be974fbe) SHA1(bcfafb85ad858fc0a3dceb2d5fe319d812df50fc) )
2276   ROM_LOAD( "ww22.bin", 0x10000, 0x10000, CRC(9914972a) SHA1(57a27173bc525b18f42699eab9300d4c8652a7c6) )
22774352
2278   ROM_REGION( 0x20000, "ym2", 0 )   /* ADPCM samples */
4353   ROM_REGION( 0x20000, "ym2", 0 )
22794354   ROM_LOAD( "bt_p4.rom",  0x00000, 0x10000, CRC(4bc83229) SHA1(b58d08ebed0b02279385a7ac2f385e62443e3de6) )
22804355   ROM_LOAD( "bt_p5.rom",  0x10000, 0x10000, CRC(817bd62c) SHA1(d3ee2ff01a4da8b928728b2fd4948fabd2b04420) )
22814356ROM_END
22824357
22834358ROM_START( bermudaa )
2284   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
4359   ROM_REGION( 0x10000, "main", 0 )
22854360   ROM_LOAD( "4",  0x0000, 0x10000,  CRC(4de39d01) SHA1(4312660c6658079c2d148c07d24f741804f3e45c) )
22864361
2287   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
4362   ROM_REGION( 0x10000, "sub", 0 )
22884363   ROM_LOAD( "5",  0x00000, 0x10000, CRC(76158e94) SHA1(221e59b3fd87c6193755753d6ac6a96807e23120) )
22894364
2290   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
4365   ROM_REGION( 0x10000, "audio", 0 )
22914366   ROM_LOAD( "3",  0x00000, 0x10000, CRC(c79134a8) SHA1(247459d31022f1491978ba7fcc62dd71983c9057) )
22924367
22934368   ROM_REGION( 0x1400, "proms", 0 )
r3115r3116
22974372   ROM_LOAD( "btj_h.prm",   0x0c00, 0x0400, CRC(c20b197b) SHA1(504cb28d652029fe87a5411d6239e78d93c83e91) ) /* ? */
22984373   ROM_LOAD( "btj_v.prm",   0x1000, 0x0400, CRC(5d0c617f) SHA1(845e52173c33500227cabe1e21b34919d2856215) ) /* ? */
22994374
2300   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
4375   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
23014376   ROM_LOAD( "6", 0x0000, 0x8000,  CRC(a0e6710c) SHA1(28010eaed046681295661b6fa3e76090ba86592b) )
23024377
2303   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
4378   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
23044379   ROM_LOAD( "ww11.bin", 0x00000, 0x10000, CRC(603ddcb5) SHA1(766d477672f7936a2b12d3aef435b59aaa77886d) )
23054380   ROM_LOAD( "ww12.bin", 0x10000, 0x10000, CRC(388093ff) SHA1(b449031c8225b10d7e27e3a2a0636cfd8cb4e03d) )
23064381   ROM_LOAD( "ww13.bin", 0x20000, 0x10000, CRC(83a7ef62) SHA1(692be1db8b0b0ff518ffe6e000fa8eb0ca7d8b06) )
23074382   ROM_LOAD( "ww14.bin", 0x30000, 0x10000, CRC(04c784be) SHA1(1a485eeb65dee295c791006d58e4e7305bdcf490) )
23084383
2309   ROM_REGION( 0x20000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
4384   ROM_REGION( 0x20000, "sp16_tiles", ROMREGION_DISPOSE )
23104385   ROM_LOAD( "ww10.bin", 0x00000, 0x08000, CRC(f68a2d51) SHA1(bf3bfcb7fcb77f4605472775025dc69e979155c8) )
23114386   ROM_LOAD( "ww9.bin",  0x08000, 0x08000, CRC(d9d35911) SHA1(74c23f2967be76ced82522a67291de233528b099) )
23124387   ROM_LOAD( "ww8.bin",  0x10000, 0x08000, CRC(0ec15086) SHA1(6f5fb4a0f96b3ab745f402c04c2cdc2bacaf4844) )
23134388   ROM_LOAD( "ww7.bin",  0x18000, 0x08000, CRC(53c4b24e) SHA1(5f72848f585dcee857715d6ca0020237dd23abc3) )
23144389
2315   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
4390   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
4391   ROM_LOAD( "ww21.bin", 0x00000, 0x10000, CRC(be974fbe) SHA1(bcfafb85ad858fc0a3dceb2d5fe319d812df50fc) )
4392   ROM_LOAD( "ww22.bin", 0x10000, 0x10000, CRC(9914972a) SHA1(57a27173bc525b18f42699eab9300d4c8652a7c6) )
4393   ROM_LOAD( "ww19.bin", 0x20000, 0x10000, CRC(c39ac1a7) SHA1(9f8048250306ee23c6c66c751b64f19168123ff3) )
4394   ROM_LOAD( "ww20.bin", 0x30000, 0x10000, CRC(8504170f) SHA1(e9970d006dbc63640234bb4baa76a10d84f22bcd) )
23164395   ROM_LOAD( "ww15.bin", 0x40000, 0x10000, CRC(d55ce063) SHA1(c0845db7e928e735746822ab94e5f148f38e73cc) )
23174396   ROM_LOAD( "ww16.bin", 0x50000, 0x10000, CRC(a2d19ce5) SHA1(ec1e22c8aa1d24b24fa97015c43e651aebb5a3bb) )
23184397   ROM_LOAD( "ww17.bin", 0x60000, 0x10000, CRC(a9a6b128) SHA1(bd09fcf91211739a304771f633f04235d32b057d) )
23194398   ROM_LOAD( "ww18.bin", 0x70000, 0x10000, CRC(c712d24c) SHA1(59858d446491e63f8bd0fd1f8aa20262fa0522ef) )
2320   ROM_LOAD( "ww19.bin", 0x20000, 0x10000, CRC(c39ac1a7) SHA1(9f8048250306ee23c6c66c751b64f19168123ff3) )
2321   ROM_LOAD( "ww20.bin", 0x30000, 0x10000, CRC(8504170f) SHA1(e9970d006dbc63640234bb4baa76a10d84f22bcd) )
2322   ROM_LOAD( "ww21.bin", 0x00000, 0x10000, CRC(be974fbe) SHA1(bcfafb85ad858fc0a3dceb2d5fe319d812df50fc) )
2323   ROM_LOAD( "ww22.bin", 0x10000, 0x10000, CRC(9914972a) SHA1(57a27173bc525b18f42699eab9300d4c8652a7c6) )
23244399
2325   ROM_REGION( 0x20000, "ym2", 0 )   /* ADPCM samples */
4400   ROM_REGION( 0x20000, "ym2", 0 )
23264401   ROM_LOAD( "bt_p4.rom",  0x00000, 0x10000, CRC(4bc83229) SHA1(b58d08ebed0b02279385a7ac2f385e62443e3de6) )
23274402   ROM_LOAD( "bt_p5.rom",  0x10000, 0x10000, CRC(817bd62c) SHA1(d3ee2ff01a4da8b928728b2fd4948fabd2b04420) )
23284403ROM_END
r3115r3116
23304405/***********************************************************************/
23314406
23324407ROM_START( psychos )
2333   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
4408   ROM_REGION( 0x10000, "main", 0 )
23344409   ROM_LOAD( "p7",  0x00000, 0x10000, CRC(562809f4) SHA1(71d2a0fbfbe953e2bc4169d3c0a4f259911f04c3) )
23354410
2336   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
4411   ROM_REGION( 0x10000, "sub", 0 )
23374412   ROM_LOAD( "up03_m8.rom",  0x00000, 0x10000, CRC(5f426ddb) SHA1(d4b2215122b23066ba2b231992f0f27057259ded) )
23384413
2339   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
4414   ROM_REGION( 0x10000, "audio", 0 )
23404415   ROM_LOAD( "p5",  0x0000, 0x10000,  CRC(64503283) SHA1(e380164ac4268eda1d9ca2404b3dddc5fd3f9dcc) )
23414416
23424417   ROM_REGION( 0x1400, "proms", 0 )
2343   ROM_LOAD( "up03_k1.rom",  0x00000, 0x00400, CRC(27b8ca8c) SHA1(a2dbc22ca10c2c2c874bf766fe64981f9be75aba) ) /* red */
2344   ROM_LOAD( "up03_l1.rom",  0x00400, 0x00400, CRC(40e78c9e) SHA1(779c84e5a40365d36088a018d9d1a3524f53844a) ) /* green */
2345   ROM_LOAD( "up03_k2.rom",  0x00800, 0x00400, CRC(d845d5ac) SHA1(e1e0954c44264456a02aebe5e3b0bba6031b837b) ) /* blue */
4418   ROM_LOAD( "up03_k1.rom",  0x0000, 0x400, CRC(27b8ca8c) SHA1(a2dbc22ca10c2c2c874bf766fe64981f9be75aba) ) /* red */
4419   ROM_LOAD( "up03_l1.rom",  0x0400, 0x400, CRC(40e78c9e) SHA1(779c84e5a40365d36088a018d9d1a3524f53844a) ) /* green */
4420   ROM_LOAD( "up03_k2.rom",  0x0800, 0x400, CRC(d845d5ac) SHA1(e1e0954c44264456a02aebe5e3b0bba6031b837b) ) /* blue */
23464421   ROM_LOAD( "mb7122e.8j",   0x0c00, 0x400, CRC(c20b197b) SHA1(504cb28d652029fe87a5411d6239e78d93c83e91) ) /* ? */
23474422   ROM_LOAD( "mb7122e.8k",   0x1000, 0x400, CRC(5d0c617f) SHA1(845e52173c33500227cabe1e21b34919d2856215) ) /* ? */
23484423
2349   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
4424   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
23504425   ROM_LOAD( "up02_a3.rom",  0x0000, 0x8000,  CRC(11a71919) SHA1(ffb8c54ad5162ea5040508ccb9244b7cd087c047) )
23514426
2352   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
4427   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
23534428   ROM_LOAD( "up01_f1.rom",  0x00000, 0x10000, CRC(167e5765) SHA1(5deb66255278e1891c344e0e9665c6f0fda59391) )
23544429   ROM_LOAD( "up01_d1.rom",  0x10000, 0x10000, CRC(8b0fe8d0) SHA1(30b24878e0e333a635dae475b6527b03b9e0302c) )
23554430   ROM_LOAD( "up01_c1.rom",  0x20000, 0x10000, CRC(f4361c50) SHA1(59d0915c4c4d07e26d205ffee95d7628f8eefb6d) )
23564431   ROM_LOAD( "up01_a1.rom",  0x30000, 0x10000, CRC(e4b0b95e) SHA1(8e35138f9d1fc6c1d787cf09ec17a900710db375) )
23574432
2358   ROM_REGION( 0x20000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
4433   ROM_REGION( 0x20000, "sp16_tiles", ROMREGION_DISPOSE )
23594434   ROM_LOAD( "up02_f3.rom",  0x00000, 0x8000, CRC(f96f82db) SHA1(8062721431762dfcf7cc499a1f050e4cbe0fc793) )
23604435   ROM_LOAD( "up02_e3.rom",  0x08000, 0x8000, CRC(2b007733) SHA1(7b808a134a9aa70aef1cf2a503b7ea786fd05275) )
23614436   ROM_LOAD( "up02_c3.rom",  0x10000, 0x8000, CRC(efa830e1) SHA1(0a41a764a751a6566b9bb58086a417cfb7925d50) )
23624437   ROM_LOAD( "up02_b3.rom",  0x18000, 0x8000, CRC(24559ee1) SHA1(ca2166558a8dffba9042349db2f85f9111bd8d93) )
23634438
2364   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
4439   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
23654440   ROM_LOAD( "up01_f10.rom",  0x00000, 0x10000, CRC(2bac250e) SHA1(aaf424fb9663e14c19d4063a402fb3c4c5c5b059) )
23664441   ROM_LOAD( "up01_h10.rom",  0x10000, 0x10000, CRC(5e1ba353) SHA1(1219cd11d5837c6680f6cbbf91cfece6564cacaa) )
23674442   ROM_LOAD( "up01_j10.rom",  0x20000, 0x10000, CRC(9ff91a97) SHA1(064047800f3d7cb6eaf35988e0db0dc4dfa7e10f) )
r3115r3116
23794454ROM_END
23804455
23814456ROM_START( psychosj )
2382   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
4457   ROM_REGION( 0x10000, "main", 0 )
23834458   ROM_LOAD( "up03_m4.rom",  0x0000, 0x10000,  CRC(05dfb409) SHA1(e6c378c86689c7ab9190908c8e4aa2d4563c3774) )
23844459
2385   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
4460   ROM_REGION( 0x10000, "sub", 0 )
23864461   ROM_LOAD( "up03_m8.rom",  0x00000, 0x10000, CRC(5f426ddb) SHA1(d4b2215122b23066ba2b231992f0f27057259ded) )
23874462
2388   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
4463   ROM_REGION( 0x10000, "audio", 0 )
23894464   ROM_LOAD( "up03_j6.rom",  0x00000, 0x10000, CRC(bbd0a8e3) SHA1(ea8ca9de8f6042cf14ebfc83bc956751358f9521) )
23904465
23914466   ROM_REGION( 0x1400, "proms", 0 )
2392   ROM_LOAD( "up03_k1.rom",  0x00000, 0x00400, CRC(27b8ca8c) SHA1(a2dbc22ca10c2c2c874bf766fe64981f9be75aba) ) /* red */
2393   ROM_LOAD( "up03_l1.rom",  0x00400, 0x00400, CRC(40e78c9e) SHA1(779c84e5a40365d36088a018d9d1a3524f53844a) ) /* green */
2394   ROM_LOAD( "up03_k2.rom",  0x00800, 0x00400, CRC(d845d5ac) SHA1(e1e0954c44264456a02aebe5e3b0bba6031b837b) ) /* blue */
4467   ROM_LOAD( "up03_k1.rom",  0x0000, 0x400, CRC(27b8ca8c) SHA1(a2dbc22ca10c2c2c874bf766fe64981f9be75aba) ) /* red */
4468   ROM_LOAD( "up03_l1.rom",  0x0400, 0x400, CRC(40e78c9e) SHA1(779c84e5a40365d36088a018d9d1a3524f53844a) ) /* green */
4469   ROM_LOAD( "up03_k2.rom",  0x0800, 0x400, CRC(d845d5ac) SHA1(e1e0954c44264456a02aebe5e3b0bba6031b837b) ) /* blue */
23954470   ROM_LOAD( "mb7122e.8j",   0x0c00, 0x400, CRC(c20b197b) SHA1(504cb28d652029fe87a5411d6239e78d93c83e91) ) /* ? */
23964471   ROM_LOAD( "mb7122e.8k",   0x1000, 0x400, CRC(5d0c617f) SHA1(845e52173c33500227cabe1e21b34919d2856215) ) /* ? */
23974472
2398   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
4473   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
23994474   ROM_LOAD( "up02_a3.rom",  0x0000, 0x8000,  CRC(11a71919) SHA1(ffb8c54ad5162ea5040508ccb9244b7cd087c047) )
24004475
2401   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
4476   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
24024477   ROM_LOAD( "up01_f1.rom",  0x00000, 0x10000, CRC(167e5765) SHA1(5deb66255278e1891c344e0e9665c6f0fda59391) )
24034478   ROM_LOAD( "up01_d1.rom",  0x10000, 0x10000, CRC(8b0fe8d0) SHA1(30b24878e0e333a635dae475b6527b03b9e0302c) )
24044479   ROM_LOAD( "up01_c1.rom",  0x20000, 0x10000, CRC(f4361c50) SHA1(59d0915c4c4d07e26d205ffee95d7628f8eefb6d) )
24054480   ROM_LOAD( "up01_a1.rom",  0x30000, 0x10000, CRC(e4b0b95e) SHA1(8e35138f9d1fc6c1d787cf09ec17a900710db375) )
24064481
2407   ROM_REGION( 0x20000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
4482   ROM_REGION( 0x20000, "sp16_tiles", ROMREGION_DISPOSE )
24084483   ROM_LOAD( "up02_f3.rom",  0x00000, 0x8000, CRC(f96f82db) SHA1(8062721431762dfcf7cc499a1f050e4cbe0fc793) )
24094484   ROM_LOAD( "up02_e3.rom",  0x08000, 0x8000, CRC(2b007733) SHA1(7b808a134a9aa70aef1cf2a503b7ea786fd05275) )
24104485   ROM_LOAD( "up02_c3.rom",  0x10000, 0x8000, CRC(efa830e1) SHA1(0a41a764a751a6566b9bb58086a417cfb7925d50) )
24114486   ROM_LOAD( "up02_b3.rom",  0x18000, 0x8000, CRC(24559ee1) SHA1(ca2166558a8dffba9042349db2f85f9111bd8d93) )
24124487
2413   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
4488   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
24144489   ROM_LOAD( "up01_f10.rom",  0x00000, 0x10000, CRC(2bac250e) SHA1(aaf424fb9663e14c19d4063a402fb3c4c5c5b059) )
24154490   ROM_LOAD( "up01_h10.rom",  0x10000, 0x10000, CRC(5e1ba353) SHA1(1219cd11d5837c6680f6cbbf91cfece6564cacaa) )
24164491   ROM_LOAD( "up01_j10.rom",  0x20000, 0x10000, CRC(9ff91a97) SHA1(064047800f3d7cb6eaf35988e0db0dc4dfa7e10f) )
r3115r3116
24294504
24304505/***********************************************************************/
24314506
4507ROM_START( gwar )
4508   ROM_REGION( 0x10000, "main", 0 )
4509   ROM_LOAD( "7g",  0x00000, 0x10000, CRC(5bcfa7dc) SHA1(1af2c36df287c9c84be8e7fc173b66f3dde5375e) )
4510
4511   ROM_REGION( 0x10000, "sub", 0 )
4512   ROM_LOAD( "g02",  0x00000, 0x10000, CRC(86d931bf) SHA1(8bf7c7a7c01561568973d01956e5398bbc9c3463) )
4513
4514   ROM_REGION( 0x10000, "audio", 0 )
4515   ROM_LOAD( "g03",  0x00000, 0x10000, CRC(eb544ab9) SHA1(433af63feb4c4ef0e3bd383f2f9bc19e436fb103) )
4516
4517   ROM_REGION( 0x2400, "proms", 0 )
4518   ROM_LOAD( "guprom.3",  0x0000, 0x0400, CRC(090236a3) SHA1(40d066e34291492c6baf8c120657e3d547274b59) ) /* red */
4519   ROM_LOAD( "guprom.2",  0x0400, 0x0400, CRC(9147de69) SHA1(e4b3b546e429c195e82f97322e2a295882e38a58) ) /* green */
4520   ROM_LOAD( "guprom.1",  0x0800, 0x0400, CRC(7f9c839e) SHA1(2fa60fa335f76891d961c9bd0066fa7f82f76779) ) /* blue */
4521   ROM_LOAD( "btj_h.prm", 0x0c00, 0x0400, CRC(c20b197b) SHA1(504cb28d652029fe87a5411d6239e78d93c83e91) ) /* h-decode */
4522   ROM_LOAD( "btj_v.prm", 0x1000, 0x0400, CRC(5d0c617f) SHA1(845e52173c33500227cabe1e21b34919d2856215) ) /* v-decode */
4523   ROM_LOAD( "ls.bin",    0x1400, 0x1000, CRC(73df921d) SHA1(c0f765da3e0e80d104b0baaa7a83bdcc399254b3) ) /* ls-joystick encoder */
4524
4525   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
4526   ROM_LOAD( "g05",  0x0000, 0x08000, CRC(80f73e2e) SHA1(820824fb10f7dfec6247b46dde8ff7124bde3734) )
4527
4528   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
4529   ROM_LOAD( "g06",  0x00000, 0x10000, CRC(f1dcdaef) SHA1(d9b65e7f4025787037628528d3bef699be2eb874) )
4530   ROM_LOAD( "g07",  0x10000, 0x10000, CRC(326e4e5e) SHA1(6935429925d748bb43072429db0d3b08ffdbc95d) )
4531   ROM_LOAD( "g08",  0x20000, 0x10000, CRC(0aa70967) SHA1(a6cbadbb960280b5e79660c0bbd43089ced39a44) )
4532   ROM_LOAD( "g09",  0x30000, 0x10000, CRC(b7686336) SHA1(d654d282862ff00488be38fb9c1302c8bb6f7e7c) )
4533
4534   ROM_REGION( 0x40000, "sp16_tiles", ROMREGION_DISPOSE )
4535   ROM_LOAD( "g10",  0x00000, 0x10000, CRC(58600f7d) SHA1(3dcd25d1ed07e6f74f3316ebe41768eb155f4c45) )
4536   ROM_LOAD( "g11",  0x10000, 0x10000, CRC(a3f9b463) SHA1(ee83d18cf08972c792b05c277b1ca25d732e294d) )
4537   ROM_LOAD( "g12",  0x20000, 0x10000, CRC(092501be) SHA1(85d9a8922dde6824805a4b8e6c52b2a9ad092df9) )
4538   ROM_LOAD( "g13",  0x30000, 0x10000, CRC(25801ea6) SHA1(1aa61716d6be399a1eee2ee5079f13da0f1bd4e8) )
4539
4540   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
4541   ROM_LOAD( "g20",  0x00000, 0x10000, CRC(2b46edff) SHA1(db97e042621dcbedfeed71937ead6d715899d4f7) )
4542   ROM_LOAD( "g21",  0x10000, 0x10000, CRC(be19888d) SHA1(bc7b1b6236d41685faacc2008d51ae2da9a82909) )
4543   ROM_LOAD( "g18",  0x20000, 0x10000, CRC(2d653f0c) SHA1(99eb7883822b10f61b6e922c0d0519aacac83732) )
4544   ROM_LOAD( "g19",  0x30000, 0x10000, CRC(ebbf3ba2) SHA1(bc3631c43058faf1ec6b21ed8017b744afee6f5d) )
4545   ROM_LOAD( "g16",  0x40000, 0x10000, CRC(aeb3707f) SHA1(58d1a71cf83ab0f5f0dd67d441edbc8ece8c2ba5) )
4546   ROM_LOAD( "g17",  0x50000, 0x10000, CRC(0808f95f) SHA1(f67763cceb287a02e3b946ade52105a72161e540) )
4547   ROM_LOAD( "g14",  0x60000, 0x10000, CRC(8dfc7b87) SHA1(e3d75020aa1b90f12633f6515a0386f87441b225) )
4548   ROM_LOAD( "g15",  0x70000, 0x10000, CRC(06822aac) SHA1(630d438cbebe0b5af571948d0d3f4996f52aae1d) )
4549
4550   ROM_REGION( 0x10000, "ym2", 0 )
4551   ROM_LOAD( "g04",  0x00000, 0x10000, CRC(2255f8dd) SHA1(fac31b617762d0fa39cf82a658be250b91ab73ce) )
4552ROM_END
4553
4554ROM_START( gwara )
4555   ROM_REGION( 0x10000, "main", 0 )
4556   ROM_LOAD( "gv3",  0x00000, 0x10000, CRC(24936d83) SHA1(33842322ead66e426946c6cfaa04e56afea90d78) )
4557
4558   ROM_REGION( 0x10000, "sub", 0 )
4559   ROM_LOAD( "gv4",  0x00000, 0x10000, CRC(26335a55) SHA1(de3e7d9e204a969745367aa37326d7b3e28c7424) )
4560
4561   ROM_REGION( 0x10000, "audio", 0 )
4562   ROM_LOAD( "gv2",  0x00000, 0x10000, CRC(896682dd) SHA1(dc2125c2378a01291197b2798a5eef6459cf5b99) )
4563
4564   ROM_REGION( 0x2400, "proms", 0 )
4565   ROM_LOAD( "guprom.3",  0x0000, 0x0400, CRC(090236a3) SHA1(40d066e34291492c6baf8c120657e3d547274b59) ) /* red */
4566   ROM_LOAD( "guprom.2",  0x0400, 0x0400, CRC(9147de69) SHA1(e4b3b546e429c195e82f97322e2a295882e38a58) ) /* green */
4567   ROM_LOAD( "guprom.1",  0x0800, 0x0400, CRC(7f9c839e) SHA1(2fa60fa335f76891d961c9bd0066fa7f82f76779) ) /* blue */
4568   ROM_LOAD( "btj_h.prm", 0x0c00, 0x0400, CRC(c20b197b) SHA1(504cb28d652029fe87a5411d6239e78d93c83e91) ) /* h-decode */
4569   ROM_LOAD( "btj_v.prm", 0x1000, 0x0400, CRC(5d0c617f) SHA1(845e52173c33500227cabe1e21b34919d2856215) ) /* v-decode */
4570   ROM_LOAD( "ls.bin",    0x1400, 0x1000, CRC(73df921d) SHA1(c0f765da3e0e80d104b0baaa7a83bdcc399254b3) ) /* ls-joystick encoder */
4571
4572   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
4573   ROM_LOAD( "g05",  0x0000, 0x08000, CRC(80f73e2e) SHA1(820824fb10f7dfec6247b46dde8ff7124bde3734) )
4574
4575   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
4576   ROM_LOAD( "g06",  0x00000, 0x10000, CRC(f1dcdaef) SHA1(d9b65e7f4025787037628528d3bef699be2eb874) )
4577   ROM_LOAD( "g07",  0x10000, 0x10000, CRC(326e4e5e) SHA1(6935429925d748bb43072429db0d3b08ffdbc95d) )
4578   ROM_LOAD( "g08",  0x20000, 0x10000, CRC(0aa70967) SHA1(a6cbadbb960280b5e79660c0bbd43089ced39a44) )
4579   ROM_LOAD( "g09",  0x30000, 0x10000, CRC(b7686336) SHA1(d654d282862ff00488be38fb9c1302c8bb6f7e7c) )
4580
4581   ROM_REGION( 0x40000, "sp16_tiles", ROMREGION_DISPOSE )
4582   ROM_LOAD( "g10",  0x00000, 0x10000, CRC(58600f7d) SHA1(3dcd25d1ed07e6f74f3316ebe41768eb155f4c45) )
4583   ROM_LOAD( "g11",  0x10000, 0x10000, CRC(a3f9b463) SHA1(ee83d18cf08972c792b05c277b1ca25d732e294d) )
4584   ROM_LOAD( "g12",  0x20000, 0x10000, CRC(092501be) SHA1(85d9a8922dde6824805a4b8e6c52b2a9ad092df9) )
4585   ROM_LOAD( "g13",  0x30000, 0x10000, CRC(25801ea6) SHA1(1aa61716d6be399a1eee2ee5079f13da0f1bd4e8) )
4586
4587   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
4588   ROM_LOAD( "g20",  0x00000, 0x10000, CRC(2b46edff) SHA1(db97e042621dcbedfeed71937ead6d715899d4f7) )
4589   ROM_LOAD( "g21",  0x10000, 0x10000, CRC(be19888d) SHA1(bc7b1b6236d41685faacc2008d51ae2da9a82909) )
4590   ROM_LOAD( "g18",  0x20000, 0x10000, CRC(2d653f0c) SHA1(99eb7883822b10f61b6e922c0d0519aacac83732) )
4591   ROM_LOAD( "g19",  0x30000, 0x10000, CRC(ebbf3ba2) SHA1(bc3631c43058faf1ec6b21ed8017b744afee6f5d) )
4592   ROM_LOAD( "g16",  0x40000, 0x10000, CRC(aeb3707f) SHA1(58d1a71cf83ab0f5f0dd67d441edbc8ece8c2ba5) )
4593   ROM_LOAD( "g17",  0x50000, 0x10000, CRC(0808f95f) SHA1(f67763cceb287a02e3b946ade52105a72161e540) )
4594   ROM_LOAD( "g14",  0x60000, 0x10000, CRC(8dfc7b87) SHA1(e3d75020aa1b90f12633f6515a0386f87441b225) )
4595   ROM_LOAD( "g15",  0x70000, 0x10000, CRC(06822aac) SHA1(630d438cbebe0b5af571948d0d3f4996f52aae1d) )
4596
4597   ROM_REGION( 0x10000, "ym2", 0 )
4598   ROM_LOAD( "g04",  0x00000, 0x10000, CRC(2255f8dd) SHA1(fac31b617762d0fa39cf82a658be250b91ab73ce) )
4599ROM_END
4600
4601ROM_START( gwarj )
4602   ROM_REGION( 0x10000, "main", 0 )
4603   ROM_LOAD( "7y3047",  0x00000, 0x10000, CRC(7f8a880c) SHA1(1eb1c3eb45aa933118e5bd116eb3f81f39063ae3) )
4604
4605   ROM_REGION( 0x10000, "sub", 0 )
4606   ROM_LOAD( "g02",  0x00000, 0x10000, CRC(86d931bf) SHA1(8bf7c7a7c01561568973d01956e5398bbc9c3463) )
4607
4608   ROM_REGION( 0x10000, "audio", 0 )
4609   ROM_LOAD( "g03",  0x00000, 0x10000, CRC(eb544ab9) SHA1(433af63feb4c4ef0e3bd383f2f9bc19e436fb103) )
4610
4611   ROM_REGION( 0x2400, "proms", 0 )
4612   ROM_LOAD( "guprom.3",  0x0000, 0x0400, CRC(090236a3) SHA1(40d066e34291492c6baf8c120657e3d547274b59) ) /* red */
4613   ROM_LOAD( "guprom.2",  0x0400, 0x0400, CRC(9147de69) SHA1(e4b3b546e429c195e82f97322e2a295882e38a58) ) /* green */
4614   ROM_LOAD( "guprom.1",  0x0800, 0x0400, CRC(7f9c839e) SHA1(2fa60fa335f76891d961c9bd0066fa7f82f76779) ) /* blue */
4615   ROM_LOAD( "btj_h.prm", 0x0c00, 0x0400, CRC(c20b197b) SHA1(504cb28d652029fe87a5411d6239e78d93c83e91) ) /* h-decode */
4616   ROM_LOAD( "btj_v.prm", 0x1000, 0x0400, CRC(5d0c617f) SHA1(845e52173c33500227cabe1e21b34919d2856215) ) /* v-decode */
4617   ROM_LOAD( "ls.bin",    0x1400, 0x1000, CRC(73df921d) SHA1(c0f765da3e0e80d104b0baaa7a83bdcc399254b3) ) /* ls-joystick encoder */
4618
4619   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
4620   ROM_LOAD( "792001",  0x0000, 0x08000, CRC(99d7ddf3) SHA1(4e4bc400d184e1fb9d0af3a33cc6f6d099bb3bee) )
4621
4622   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
4623   ROM_LOAD( "g06",  0x00000, 0x10000, CRC(f1dcdaef) SHA1(d9b65e7f4025787037628528d3bef699be2eb874) )
4624   ROM_LOAD( "g07",  0x10000, 0x10000, CRC(326e4e5e) SHA1(6935429925d748bb43072429db0d3b08ffdbc95d) )
4625   ROM_LOAD( "g08",  0x20000, 0x10000, CRC(0aa70967) SHA1(a6cbadbb960280b5e79660c0bbd43089ced39a44) )
4626   ROM_LOAD( "g09",  0x30000, 0x10000, CRC(b7686336) SHA1(d654d282862ff00488be38fb9c1302c8bb6f7e7c) )
4627
4628   ROM_REGION( 0x40000, "sp16_tiles", ROMREGION_DISPOSE )
4629   ROM_LOAD( "g10",  0x00000, 0x10000, CRC(58600f7d) SHA1(3dcd25d1ed07e6f74f3316ebe41768eb155f4c45) )
4630   ROM_LOAD( "g11",  0x10000, 0x10000, CRC(a3f9b463) SHA1(ee83d18cf08972c792b05c277b1ca25d732e294d) )
4631   ROM_LOAD( "g12",  0x20000, 0x10000, CRC(092501be) SHA1(85d9a8922dde6824805a4b8e6c52b2a9ad092df9) )
4632   ROM_LOAD( "g13",  0x30000, 0x10000, CRC(25801ea6) SHA1(1aa61716d6be399a1eee2ee5079f13da0f1bd4e8) )
4633
4634   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
4635   ROM_LOAD( "g20",  0x00000, 0x10000, CRC(2b46edff) SHA1(db97e042621dcbedfeed71937ead6d715899d4f7) )
4636   ROM_LOAD( "g21",  0x10000, 0x10000, CRC(be19888d) SHA1(bc7b1b6236d41685faacc2008d51ae2da9a82909) )
4637   ROM_LOAD( "g18",  0x20000, 0x10000, CRC(2d653f0c) SHA1(99eb7883822b10f61b6e922c0d0519aacac83732) )
4638   ROM_LOAD( "g19",  0x30000, 0x10000, CRC(ebbf3ba2) SHA1(bc3631c43058faf1ec6b21ed8017b744afee6f5d) )
4639   ROM_LOAD( "g16",  0x40000, 0x10000, CRC(aeb3707f) SHA1(58d1a71cf83ab0f5f0dd67d441edbc8ece8c2ba5) )
4640   ROM_LOAD( "g17",  0x50000, 0x10000, CRC(0808f95f) SHA1(f67763cceb287a02e3b946ade52105a72161e540) )
4641   ROM_LOAD( "g14",  0x60000, 0x10000, CRC(8dfc7b87) SHA1(e3d75020aa1b90f12633f6515a0386f87441b225) )
4642   ROM_LOAD( "g15",  0x70000, 0x10000, CRC(06822aac) SHA1(630d438cbebe0b5af571948d0d3f4996f52aae1d) )
4643
4644   ROM_REGION( 0x10000, "ym2", 0 )
4645   ROM_LOAD( "g04",  0x00000, 0x10000, CRC(2255f8dd) SHA1(fac31b617762d0fa39cf82a658be250b91ab73ce) )
4646ROM_END
4647
4648ROM_START( gwarb )
4649   ROM_REGION( 0x10000, "main", 0 )
4650   ROM_LOAD( "g01",  0x00000, 0x10000, CRC(ce1d3c80) SHA1(605ada3529d0b26425e6c573c31117249bb7a7db) )
4651
4652   ROM_REGION( 0x10000, "sub", 0 )
4653   ROM_LOAD( "g02",  0x00000, 0x10000, CRC(86d931bf) SHA1(8bf7c7a7c01561568973d01956e5398bbc9c3463) )
4654
4655   ROM_REGION( 0x10000, "audio", 0 )
4656   ROM_LOAD( "g03",  0x00000, 0x10000, CRC(eb544ab9) SHA1(433af63feb4c4ef0e3bd383f2f9bc19e436fb103) )
4657
4658   ROM_REGION( 0x0c00, "proms", 0 )
4659   ROM_LOAD( "guprom.3", 0x000, 0x400, CRC(090236a3) SHA1(40d066e34291492c6baf8c120657e3d547274b59) ) /* red */ // up03_k1.rom
4660   ROM_LOAD( "guprom.2", 0x400, 0x400, CRC(9147de69) SHA1(e4b3b546e429c195e82f97322e2a295882e38a58) ) /* green */ // up03_l1.rom
4661   ROM_LOAD( "guprom.1", 0x800, 0x400, CRC(7f9c839e) SHA1(2fa60fa335f76891d961c9bd0066fa7f82f76779) ) /* blue */ // up03_k2.rom
4662
4663   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
4664   ROM_LOAD( "g05",  0x0000, 0x08000, CRC(80f73e2e) SHA1(820824fb10f7dfec6247b46dde8ff7124bde3734) )
4665
4666   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
4667   ROM_LOAD( "g06",  0x00000, 0x10000, CRC(f1dcdaef) SHA1(d9b65e7f4025787037628528d3bef699be2eb874) )
4668   ROM_LOAD( "g07",  0x10000, 0x10000, CRC(326e4e5e) SHA1(6935429925d748bb43072429db0d3b08ffdbc95d) )
4669   ROM_LOAD( "g08",  0x20000, 0x10000, CRC(0aa70967) SHA1(a6cbadbb960280b5e79660c0bbd43089ced39a44) )
4670   ROM_LOAD( "g09",  0x30000, 0x10000, CRC(b7686336) SHA1(d654d282862ff00488be38fb9c1302c8bb6f7e7c) )
4671
4672   ROM_REGION( 0x40000, "sp16_tiles", ROMREGION_DISPOSE )
4673   ROM_LOAD( "g10",  0x00000, 0x10000, CRC(58600f7d) SHA1(3dcd25d1ed07e6f74f3316ebe41768eb155f4c45) )
4674   ROM_LOAD( "g11",  0x10000, 0x10000, CRC(a3f9b463) SHA1(ee83d18cf08972c792b05c277b1ca25d732e294d) )
4675   ROM_LOAD( "g12",  0x20000, 0x10000, CRC(092501be) SHA1(85d9a8922dde6824805a4b8e6c52b2a9ad092df9) )
4676   ROM_LOAD( "g13",  0x30000, 0x10000, CRC(25801ea6) SHA1(1aa61716d6be399a1eee2ee5079f13da0f1bd4e8) )
4677
4678   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
4679   ROM_LOAD( "g20",  0x00000, 0x10000, CRC(2b46edff) SHA1(db97e042621dcbedfeed71937ead6d715899d4f7) )
4680   ROM_LOAD( "g21",  0x10000, 0x10000, CRC(be19888d) SHA1(bc7b1b6236d41685faacc2008d51ae2da9a82909) )
4681   ROM_LOAD( "g18",  0x20000, 0x10000, CRC(2d653f0c) SHA1(99eb7883822b10f61b6e922c0d0519aacac83732) )
4682   ROM_LOAD( "g19",  0x30000, 0x10000, CRC(ebbf3ba2) SHA1(bc3631c43058faf1ec6b21ed8017b744afee6f5d) )
4683   ROM_LOAD( "g16",  0x40000, 0x10000, CRC(aeb3707f) SHA1(58d1a71cf83ab0f5f0dd67d441edbc8ece8c2ba5) )
4684   ROM_LOAD( "g17",  0x50000, 0x10000, CRC(0808f95f) SHA1(f67763cceb287a02e3b946ade52105a72161e540) )
4685   ROM_LOAD( "g14",  0x60000, 0x10000, CRC(8dfc7b87) SHA1(e3d75020aa1b90f12633f6515a0386f87441b225) )
4686   ROM_LOAD( "g15",  0x70000, 0x10000, CRC(06822aac) SHA1(630d438cbebe0b5af571948d0d3f4996f52aae1d) )
4687
4688   ROM_REGION( 0x10000, "ym2", 0 )
4689   ROM_LOAD( "g04",  0x00000, 0x10000, CRC(2255f8dd) SHA1(fac31b617762d0fa39cf82a658be250b91ab73ce) )
4690ROM_END
4691
4692/***********************************************************************/
4693
24324694ROM_START( chopper )
2433   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
4695   ROM_REGION( 0x10000, "main", 0 )
24344696   ROM_LOAD( "kk_01.rom",  0x0000, 0x10000,  CRC(8fa2f839) SHA1(13cfdbeb433aa3e1dc7e7927c00690e02ed08274) )
24354697
2436   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
4698   ROM_REGION( 0x10000, "sub", 0 )
24374699   ROM_LOAD( "kk_04.rom",  0x00000, 0x10000, CRC(004f7d9a) SHA1(4d1c830f69dbf2f1523f9ad7da9b3275fd6b5dfb) )
24384700
2439   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
2440   ROM_LOAD( "kk_03.rom",  0x00000, 0x10000, CRC(dbaafb87) SHA1(e7d7f68250bda217230560481ba51da335fc05d7) )   /* YM3526 */
4701   ROM_REGION( 0x10000, "audio", 0 )
4702   ROM_LOAD( "kk_03.rom",  0x00000, 0x10000, CRC(dbaafb87) SHA1(e7d7f68250bda217230560481ba51da335fc05d7) )
24414703
24424704   ROM_REGION( 0x0c00, "proms", 0 )
24434705   ROM_LOAD( "up03_k1.rom",  0x0000, 0x0400, CRC(7f07a45c) SHA1(f751d01d9c25609195b19643395290dab8b8bc5c) ) /* red */
24444706   ROM_LOAD( "up03_l1.rom",  0x0400, 0x0400, CRC(15359fc3) SHA1(4ced674fb18b80ebe5fd6459e0fb9542461dbc74) ) /* green */
24454707   ROM_LOAD( "up03_k2.rom",  0x0800, 0x0400, CRC(79b50f7d) SHA1(41579e498046570a6a74309310b5341fcde9c7de) ) /* blue */
24464708
2447   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
4709   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
24484710   ROM_LOAD( "kk_05.rom",  0x0000, 0x8000, CRC(defc0987) SHA1(ea8eca852aadce90857eb8e65d78631409faac01) )
24494711
2450   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
4712   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
24514713   ROM_LOAD( "kk_10.rom",  0x00000, 0x10000, CRC(5cf4d22b) SHA1(b66864740898478becb188d7dd34d61187926e4d) )
24524714   ROM_LOAD( "kk_11.rom",  0x10000, 0x10000, CRC(9af4cad0) SHA1(dd8c1a76e6a90661c5442c0a096cb9ffe496d12a) )
24534715   ROM_LOAD( "kk_12.rom",  0x20000, 0x10000, CRC(02fec778) SHA1(477a3e22f913cc7783d6cbfce86f98fea9eaf3ec) )
24544716   ROM_LOAD( "kk_13.rom",  0x30000, 0x10000, CRC(2756817d) SHA1(acde21454ddf843425deff3357c9e3a7e7a2baec) )
24554717
2456   ROM_REGION( 0x20000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
4718   ROM_REGION( 0x20000, "sp16_tiles", ROMREGION_DISPOSE )
24574719   ROM_LOAD( "kk_09.rom",  0x00000, 0x08000, CRC(653c4342) SHA1(aacb3a7772dcea4c88f0010b3654f4159cfb6a8b) )
24584720   ROM_LOAD( "kk_08.rom",  0x08000, 0x08000, CRC(2da45894) SHA1(09f1ac544a119c9d3a9eeb0606f35585d35c2d1d) )
24594721   ROM_LOAD( "kk_07.rom",  0x10000, 0x08000, CRC(a0ebebdf) SHA1(83d8a9ba7b7ffd42e50afb017e4d0d40fe3e2739) )
24604722   ROM_LOAD( "kk_06.rom",  0x18000, 0x08000, CRC(284fad9e) SHA1(7bb572d7d5983a514e8381954ac89a720b86e9ba) )
24614723
2462   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
4724   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
24634725   ROM_LOAD( "kk_18.rom",  0x00000, 0x10000, CRC(6abbff36) SHA1(8dde3163e454876a4b666b25c81c09b0740143b5) )
24644726   ROM_LOAD( "kk_19.rom",  0x10000, 0x10000, CRC(5283b4d3) SHA1(980f74d3f468203cf9c1a5f3bc256139975035f3) )
24654727   ROM_LOAD( "kk_20.rom",  0x20000, 0x10000, CRC(6403ddf2) SHA1(54a044d9a1ba89fec3bea0e771f75fcc532e7aad) )
r3115r3116
24774739ROM_END
24784740
24794741ROM_START( choppera )
2480   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
4742   ROM_REGION( 0x10000, "main", 0 )
24814743   ROM_LOAD( "1a.rom",  0x0000, 0x10000,  CRC(dc325860) SHA1(89391897e6f31d9c1d3b7f27618f63fe8018d42a) )
24824744
2483   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
4745   ROM_REGION( 0x10000, "sub", 0 )
24844746   ROM_LOAD( "4a.rom",  0x00000, 0x10000, CRC(56d10ba3) SHA1(345a80239fd425c7fe1dfec9385c99a307511e00) )
24854747
2486   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
2487   ROM_LOAD( "kk_03.rom",  0x00000, 0x10000, CRC(dbaafb87) SHA1(e7d7f68250bda217230560481ba51da335fc05d7) )   /* YM3526 */
4748   ROM_REGION( 0x10000, "audio", 0 )
4749   ROM_LOAD( "kk_03.rom",  0x00000, 0x10000, CRC(dbaafb87) SHA1(e7d7f68250bda217230560481ba51da335fc05d7) )
24884750
24894751   ROM_REGION( 0x0c00, "proms", 0 )
24904752   ROM_LOAD( "up03_k1.rom",  0x0000, 0x0400, CRC(7f07a45c) SHA1(f751d01d9c25609195b19643395290dab8b8bc5c) ) /* red */
24914753   ROM_LOAD( "up03_l1.rom",  0x0400, 0x0400, CRC(15359fc3) SHA1(4ced674fb18b80ebe5fd6459e0fb9542461dbc74) ) /* green */
24924754   ROM_LOAD( "up03_k2.rom",  0x0800, 0x0400, CRC(79b50f7d) SHA1(41579e498046570a6a74309310b5341fcde9c7de) ) /* blue */
24934755
2494   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
4756   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
24954757   ROM_LOAD( "kk_05.rom",  0x0000, 0x8000, CRC(defc0987) SHA1(ea8eca852aadce90857eb8e65d78631409faac01) )
24964758
2497   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
4759   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
24984760   ROM_LOAD( "kk_10.rom",  0x00000, 0x10000, CRC(5cf4d22b) SHA1(b66864740898478becb188d7dd34d61187926e4d) )
24994761   ROM_LOAD( "11a.rom",     0x10000, 0x10000, CRC(881ac259) SHA1(6cce41878c9d9712996d4987a9a578f1301b8feb) )
25004762   ROM_LOAD( "12a.rom",     0x20000, 0x10000, CRC(de96b331) SHA1(725cfe739f7ed0f37eb620d9566bfda1369f4d50) )
25014763   ROM_LOAD( "kk_13.rom",  0x30000, 0x10000, CRC(2756817d) SHA1(acde21454ddf843425deff3357c9e3a7e7a2baec) )
25024764
2503   ROM_REGION( 0x20000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
4765   ROM_REGION( 0x20000, "sp16_tiles", ROMREGION_DISPOSE )
25044766   ROM_LOAD( "9a.rom",  0x00000, 0x08000, CRC(106c2dcc) SHA1(919497757664c92e9955db50f5096ac81cec33c3) )
25054767   ROM_LOAD( "8a.rom",  0x08000, 0x08000, CRC(d4f88f62) SHA1(ac89ffa83e0e207acce39711b93d94affc61c1cc) )
25064768   ROM_LOAD( "7a.rom",  0x10000, 0x08000, CRC(28ae39f9) SHA1(7d51489b824b76710f6d4434a77f5f2833fcc532) )
25074769   ROM_LOAD( "6a.rom",  0x18000, 0x08000, CRC(16774a36) SHA1(d1207513f790a30eef8802e63cfeeb10321d6ff7) )
25084770
2509   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
4771   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
25104772   ROM_LOAD( "kk_18.rom",  0x00000, 0x10000, CRC(6abbff36) SHA1(8dde3163e454876a4b666b25c81c09b0740143b5) )
25114773   ROM_LOAD( "kk_19.rom",  0x10000, 0x10000, CRC(5283b4d3) SHA1(980f74d3f468203cf9c1a5f3bc256139975035f3) )
25124774   ROM_LOAD( "kk_20.rom",  0x20000, 0x10000, CRC(6403ddf2) SHA1(54a044d9a1ba89fec3bea0e771f75fcc532e7aad) )
r3115r3116
25244786ROM_END
25254787
25264788ROM_START( chopperb )
2527   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
4789   ROM_REGION( 0x10000, "main", 0 )
25284790   ROM_LOAD( "chpri-1.bin",  0x0000, 0x10000,  CRC(a4e6e978) SHA1(dafc2a3da3725344023a09f5bdaedd0e8e1dbbe2) )
25294791
2530   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
4792   ROM_REGION( 0x10000, "sub", 0 )
25314793   ROM_LOAD( "chpri-4.bin",  0x00000, 0x10000, CRC(56d10ba3) SHA1(345a80239fd425c7fe1dfec9385c99a307511e00) )
25324794
2533   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
2534   ROM_LOAD( "kk_03.rom",  0x00000, 0x10000, CRC(dbaafb87) SHA1(e7d7f68250bda217230560481ba51da335fc05d7) )   /* YM3526 */
4795   ROM_REGION( 0x10000, "audio", 0 )
4796   ROM_LOAD( "kk_03.rom",  0x00000, 0x10000, CRC(dbaafb87) SHA1(e7d7f68250bda217230560481ba51da335fc05d7) )
25354797
25364798   ROM_REGION( 0x0c00, "proms", 0 )
25374799   ROM_LOAD( "up03_k1.rom",  0x0000, 0x0400, CRC(7f07a45c) SHA1(f751d01d9c25609195b19643395290dab8b8bc5c) ) /* red */
25384800   ROM_LOAD( "up03_l1.rom",  0x0400, 0x0400, CRC(15359fc3) SHA1(4ced674fb18b80ebe5fd6459e0fb9542461dbc74) ) /* green */
25394801   ROM_LOAD( "up03_k2.rom",  0x0800, 0x0400, CRC(79b50f7d) SHA1(41579e498046570a6a74309310b5341fcde9c7de) ) /* blue */
25404802
2541   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
4803   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
25424804   ROM_LOAD( "kk_05.rom",  0x0000, 0x8000, CRC(defc0987) SHA1(ea8eca852aadce90857eb8e65d78631409faac01) )
25434805
2544   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
4806   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
25454807   ROM_LOAD( "kk_10.rom",    0x00000, 0x10000, CRC(5cf4d22b) SHA1(b66864740898478becb188d7dd34d61187926e4d) )
25464808   ROM_LOAD( "chpri-11.bin", 0x10000, 0x10000, CRC(881ac259) SHA1(6cce41878c9d9712996d4987a9a578f1301b8feb) )
25474809   ROM_LOAD( "chpri-12.bin", 0x20000, 0x10000, CRC(de96b331) SHA1(725cfe739f7ed0f37eb620d9566bfda1369f4d50) )
25484810   ROM_LOAD( "kk_13.rom",    0x30000, 0x10000, CRC(2756817d) SHA1(acde21454ddf843425deff3357c9e3a7e7a2baec) )
25494811
2550   ROM_REGION( 0x20000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
4812   ROM_REGION( 0x20000, "sp16_tiles", ROMREGION_DISPOSE )
25514813   ROM_LOAD( "chpri-9.bin",  0x00000, 0x08000, CRC(106c2dcc) SHA1(919497757664c92e9955db50f5096ac81cec33c3) )
25524814   ROM_LOAD( "chpri-8.bin",  0x08000, 0x08000, CRC(d4f88f62) SHA1(ac89ffa83e0e207acce39711b93d94affc61c1cc) )
25534815   ROM_LOAD( "chpri-7.bin",  0x10000, 0x08000, CRC(28ae39f9) SHA1(7d51489b824b76710f6d4434a77f5f2833fcc532) )
25544816   ROM_LOAD( "chpri-6.bin",  0x18000, 0x08000, CRC(16774a36) SHA1(d1207513f790a30eef8802e63cfeeb10321d6ff7) )
25554817
2556   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
4818   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
25574819   ROM_LOAD( "kk_18.rom",  0x00000, 0x10000, CRC(6abbff36) SHA1(8dde3163e454876a4b666b25c81c09b0740143b5) )
25584820   ROM_LOAD( "kk_19.rom",  0x10000, 0x10000, CRC(5283b4d3) SHA1(980f74d3f468203cf9c1a5f3bc256139975035f3) )
25594821   ROM_LOAD( "kk_20.rom",  0x20000, 0x10000, CRC(6403ddf2) SHA1(54a044d9a1ba89fec3bea0e771f75fcc532e7aad) )
r3115r3116
25704832   ROM_LOAD( "pal16r6b.2c", 0x0000, 0x0104, CRC(311e5ae6) SHA1(8a3799e1611ac4086dda2755c5ad44c0dc16ff5b) )
25714833ROM_END
25724834
2573ROM_START( legofair ) /* ChopperI (Japan) */
2574   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
4835ROM_START( legofair )
4836   ROM_REGION( 0x10000, "main", 0 )
25754837   ROM_LOAD( "up03_m4.rom",  0x0000, 0x10000,  CRC(79a485c0) SHA1(bbf51e7321656b6a04223909d4958ceb4892193a) )
25764838
2577   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
4839   ROM_REGION( 0x10000, "sub", 0 )
25784840   ROM_LOAD( "up03_m8.rom",  0x00000, 0x10000, CRC(96d3a4d9) SHA1(e23a06e6117eca14b24de2d6fd48f5aa2a26d3bb) )
25794841
2580   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
4842   ROM_REGION( 0x10000, "audio", 0 )
25814843   ROM_LOAD( "kk_03.rom",  0x00000, 0x10000, CRC(dbaafb87) SHA1(e7d7f68250bda217230560481ba51da335fc05d7) )
25824844
25834845   ROM_REGION( 0x0c00, "proms", 0 )
r3115r3116
25854847   ROM_LOAD( "up03_l1.rom",  0x0400, 0x0400, CRC(15359fc3) SHA1(4ced674fb18b80ebe5fd6459e0fb9542461dbc74) ) /* green */
25864848   ROM_LOAD( "up03_k2.rom",  0x0800, 0x0400, CRC(79b50f7d) SHA1(41579e498046570a6a74309310b5341fcde9c7de) ) /* blue */
25874849
2588   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
4850   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
25894851   ROM_LOAD( "kk_05.rom",  0x0000, 0x8000, CRC(defc0987) SHA1(ea8eca852aadce90857eb8e65d78631409faac01) )
25904852
2591   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
4853   ROM_REGION( 0x40000, "bg_tiles", ROMREGION_DISPOSE )
25924854   ROM_LOAD( "kk_10.rom",  0x00000, 0x10000, CRC(5cf4d22b) SHA1(b66864740898478becb188d7dd34d61187926e4d) )
25934855   ROM_LOAD( "kk_11.rom",  0x10000, 0x10000, CRC(9af4cad0) SHA1(dd8c1a76e6a90661c5442c0a096cb9ffe496d12a) )
25944856   ROM_LOAD( "kk_12.rom",  0x20000, 0x10000, CRC(02fec778) SHA1(477a3e22f913cc7783d6cbfce86f98fea9eaf3ec) )
25954857   ROM_LOAD( "kk_13.rom",  0x30000, 0x10000, CRC(2756817d) SHA1(acde21454ddf843425deff3357c9e3a7e7a2baec) )
25964858
2597   ROM_REGION( 0x20000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
4859   ROM_REGION( 0x20000, "sp16_tiles", ROMREGION_DISPOSE )
25984860   ROM_LOAD( "kk_09.rom",  0x00000, 0x08000, CRC(653c4342) SHA1(aacb3a7772dcea4c88f0010b3654f4159cfb6a8b) )
25994861   ROM_LOAD( "kk_08.rom",  0x08000, 0x08000, CRC(2da45894) SHA1(09f1ac544a119c9d3a9eeb0606f35585d35c2d1d) )
26004862   ROM_LOAD( "kk_07.rom",  0x10000, 0x08000, CRC(a0ebebdf) SHA1(83d8a9ba7b7ffd42e50afb017e4d0d40fe3e2739) )
26014863   ROM_LOAD( "kk_06.rom",  0x18000, 0x08000, CRC(284fad9e) SHA1(7bb572d7d5983a514e8381954ac89a720b86e9ba) )
26024864
2603   ROM_REGION( 0x80000, "gfx4", ROMREGION_DISPOSE ) /* 32x32 sprites */
4865   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
26044866   ROM_LOAD( "kk_18.rom",  0x00000, 0x10000, CRC(6abbff36) SHA1(8dde3163e454876a4b666b25c81c09b0740143b5) )
26054867   ROM_LOAD( "kk_19.rom",  0x10000, 0x10000, CRC(5283b4d3) SHA1(980f74d3f468203cf9c1a5f3bc256139975035f3) )
26064868   ROM_LOAD( "kk_20.rom",  0x20000, 0x10000, CRC(6403ddf2) SHA1(54a044d9a1ba89fec3bea0e771f75fcc532e7aad) )
r3115r3116
26174879/***********************************************************************/
26184880
26194881ROM_START( fsoccer )
2620   ROM_REGION( 0x10000, "main", 0 )     /* 64k for cpuA code */
4882   ROM_REGION( 0x10000, "main", 0 )
26214883   ROM_LOAD( "fs3_ver4.bin",  0x00000, 0x10000, CRC(94c3f918) SHA1(7c8343556d6c3897e72f8b41c6fbdc5c58e78b8c) )
26224884
2623   ROM_REGION( 0x10000, "sub", 0 )     /* 64k for cpuB code */
4885   ROM_REGION( 0x10000, "sub", 0 )
26244886   ROM_LOAD( "fs1_ver4.bin",  0x00000, 0x10000, CRC(97830108) SHA1(dab241baf8d889c768e1fbe25f1e5059b3cbbab6) )
26254887
2626   ROM_REGION( 0x10000, "audio", 0 )     /* 64k for sound code */
4888   ROM_REGION( 0x10000, "audio", 0 )
26274889   ROM_LOAD( "fs2.3j",  0x00000, 0x10000, CRC(9ee54ea1) SHA1(4e3bbacaa0e247eb8c4043f394e763817a4f9a28) )
26284890
26294891   ROM_REGION( 0x0c00, "proms", 0 )
r3115r3116
26314893   ROM_LOAD( "1.8d", 0x400, 0x400, CRC(1bac8010) SHA1(16854b1b6f3d1be48a247796d65aeb90547099b6) ) /* green */
26324894   ROM_LOAD( "3.9e", 0x800, 0x400, CRC(dbeddb14) SHA1(6053b587a3c8272aefe728a7198a15aa7fb9b2fa) ) /* blue */
26334895
2634   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
4896   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
26354897   ROM_LOAD( "fs13.4n",  0x0000, 0x08000, CRC(0de7b7ad) SHA1(4fa54b2acf83f03d09d16fc054ad6623cafe0f4a) )
26364898
2637   ROM_REGION( 0x50000, "gfx2", ROMREGION_DISPOSE ) /* background tiles */
4899   ROM_REGION( 0x50000, "bg_tiles", ROMREGION_DISPOSE )
26384900   ROM_LOAD( "fs14.8d",  0x00000, 0x10000, CRC(38c38b40) SHA1(c4580add0946720441f5ef751d0d4a944cd92ad5) )
26394901   ROM_LOAD( "fs15.8e",  0x10000, 0x10000, CRC(a614834f) SHA1(d73930e4bd780915e1b0d7f3fe7cbeaad19c233f) )
26404902
2641   ROM_REGION( 0x80000, "gfx3", ROMREGION_DISPOSE ) /* 32x32 sprites */
4903   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
26424904   ROM_LOAD( "fs12.2t", 0x00000, 0x10000, CRC(b2442c30) SHA1(ba9331810659726389494ddc7c94c5a02ba80747) )
26434905   ROM_LOAD( "fs11.2s", 0x10000, 0x10000, CRC(022f3e96) SHA1(57aa423b8f62015566bc3021300ac7e9682ed500) )
26444906   ROM_LOAD( "fs10.2r", 0x20000, 0x10000, CRC(e42864d8) SHA1(fe18f58e5507676780fe181e2fb0e0e9d72e276e) )
r3115r3116
26484910   ROM_LOAD( "fs6.2k",  0x60000, 0x10000, CRC(588d14b3) SHA1(c0489b061503677a38e4c5800ea8be17aabf4039) )
26494911   ROM_LOAD( "fs5.2j",  0x70000, 0x10000, CRC(def2f1d8) SHA1(b72e4dec3306d8afe461ac812b2de67ee85f9dd9) )
26504912
2651   ROM_REGION( 0x10000, "ym", 0 )
4913   ROM_REGION( 0x10000, "ym2", 0 )
26524914   ROM_LOAD( "fs4.bin",  0x00000, 0x10000, CRC(435c3716) SHA1(42053741f60594e7ae8516b3ba600f5badb3620f) )
26534915ROM_END
26544916
26554917ROM_START( fsoccerj )
2656   ROM_REGION( 0x10000, "main", 0 )     /* 64k for cpuA code */
4918   ROM_REGION( 0x10000, "main", 0 )
26574919   ROM_LOAD( "fs3.6c",  0x00000, 0x10000, CRC(c5f505fa) SHA1(bc54a6482029735c7ec1d6dd819cad6bac32ac20) )
26584920
2659   ROM_REGION( 0x10000, "sub", 0 )     /* 64k for cpuB code */
4921   ROM_REGION( 0x10000, "sub", 0 )
26604922   ROM_LOAD( "fs1.2c",  0x00000, 0x10000, CRC(2f68e38b) SHA1(0cbf2de24a5a5ae2134eb6f1e1404691554192bc) )
26614923
2662   ROM_REGION( 0x10000, "audio", 0 )     /* 64k for sound code */
4924   ROM_REGION( 0x10000, "audio", 0 )
26634925   ROM_LOAD( "fs2.3j",  0x00000, 0x10000, CRC(9ee54ea1) SHA1(4e3bbacaa0e247eb8c4043f394e763817a4f9a28) )
26644926
26654927   ROM_REGION( 0x0c00, "proms", 0 )
r3115r3116
26674929   ROM_LOAD( "1.8d", 0x400, 0x400, CRC(1bac8010) SHA1(16854b1b6f3d1be48a247796d65aeb90547099b6) ) /* green */
26684930   ROM_LOAD( "3.9e", 0x800, 0x400, CRC(dbeddb14) SHA1(6053b587a3c8272aefe728a7198a15aa7fb9b2fa) ) /* blue */
26694931
2670   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
4932   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
26714933   ROM_LOAD( "fs13.4n",  0x0000, 0x08000, CRC(0de7b7ad) SHA1(4fa54b2acf83f03d09d16fc054ad6623cafe0f4a) )
26724934
2673   ROM_REGION( 0x50000, "gfx2", ROMREGION_DISPOSE ) /* background tiles */
4935   ROM_REGION( 0x50000, "bg_tiles", ROMREGION_DISPOSE )
26744936   ROM_LOAD( "fs14.8d",  0x00000, 0x10000, CRC(38c38b40) SHA1(c4580add0946720441f5ef751d0d4a944cd92ad5) )
26754937   ROM_LOAD( "fs15.8e",  0x10000, 0x10000, CRC(a614834f) SHA1(d73930e4bd780915e1b0d7f3fe7cbeaad19c233f) )
26764938
2677   ROM_REGION( 0x80000, "gfx3", ROMREGION_DISPOSE ) /* 32x32 sprites */
4939   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
26784940   ROM_LOAD( "fs12.2t", 0x00000, 0x10000, CRC(b2442c30) SHA1(ba9331810659726389494ddc7c94c5a02ba80747) )
26794941   ROM_LOAD( "fs11.2s", 0x10000, 0x10000, CRC(022f3e96) SHA1(57aa423b8f62015566bc3021300ac7e9682ed500) )
26804942   ROM_LOAD( "fs10.2r", 0x20000, 0x10000, CRC(e42864d8) SHA1(fe18f58e5507676780fe181e2fb0e0e9d72e276e) )
r3115r3116
26844946   ROM_LOAD( "fs6.2k",  0x60000, 0x10000, CRC(588d14b3) SHA1(c0489b061503677a38e4c5800ea8be17aabf4039) )
26854947   ROM_LOAD( "fs5.2j",  0x70000, 0x10000, CRC(def2f1d8) SHA1(b72e4dec3306d8afe461ac812b2de67ee85f9dd9) )
26864948
2687   ROM_REGION( 0x10000, "ym", 0 )
4949   ROM_REGION( 0x10000, "ym2", 0 )
26884950   ROM_LOAD( "fs4.7p",  0x00000, 0x10000, CRC(435c3716) SHA1(42053741f60594e7ae8516b3ba600f5badb3620f) )
26894951ROM_END
26904952
26914953ROM_START( fsoccerb )
2692   ROM_REGION( 0x10000, "main", 0 )     /* 64k for cpuA code */
4954   ROM_REGION( 0x10000, "main", 0 )
26934955   ROM_LOAD( "ft-003.bin",  0x00000, 0x10000, CRC(649d4448) SHA1(876a4cf3ce3211ee19390deb17a661ec52b419d2) )
26944956
2695   ROM_REGION( 0x10000, "sub", 0 )     /* 64k for cpuB code */
4957   ROM_REGION( 0x10000, "sub", 0 )
26964958   ROM_LOAD( "ft-001.bin",  0x00000, 0x10000, CRC(2f68e38b) SHA1(0cbf2de24a5a5ae2134eb6f1e1404691554192bc) )
26974959
2698   ROM_REGION( 0x10000, "audio", 0 )     /* 64k for sound code */
4960   ROM_REGION( 0x10000, "audio", 0 )
26994961   ROM_LOAD( "fs2.3j",  0x00000, 0x10000, CRC(9ee54ea1) SHA1(4e3bbacaa0e247eb8c4043f394e763817a4f9a28) )
27004962
27014963   ROM_REGION( 0x0c00, "proms", 0 )
r3115r3116
27034965   ROM_LOAD( "1.8d", 0x400, 0x400, CRC(1bac8010) SHA1(16854b1b6f3d1be48a247796d65aeb90547099b6) ) /* green */
27044966   ROM_LOAD( "3.9e", 0x800, 0x400, CRC(dbeddb14) SHA1(6053b587a3c8272aefe728a7198a15aa7fb9b2fa) ) /* blue */
27054967
2706   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
4968   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
27074969   ROM_LOAD( "fs13.4n",  0x0000, 0x08000, CRC(0de7b7ad) SHA1(4fa54b2acf83f03d09d16fc054ad6623cafe0f4a) )
27084970
2709   ROM_REGION( 0x50000, "gfx2", ROMREGION_DISPOSE ) /* background tiles */
4971   ROM_REGION( 0x50000, "bg_tiles", ROMREGION_DISPOSE )
27104972   ROM_LOAD( "fs14.8d",  0x00000, 0x10000, CRC(38c38b40) SHA1(c4580add0946720441f5ef751d0d4a944cd92ad5) )
27114973   ROM_LOAD( "fs15.8e",  0x10000, 0x10000, CRC(a614834f) SHA1(d73930e4bd780915e1b0d7f3fe7cbeaad19c233f) )
27124974
2713   ROM_REGION( 0x80000, "gfx3", ROMREGION_DISPOSE ) /* 32x32 sprites */
4975   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
27144976   ROM_LOAD( "fs12.2t", 0x00000, 0x10000, CRC(b2442c30) SHA1(ba9331810659726389494ddc7c94c5a02ba80747) )
27154977   ROM_LOAD( "fs11.2s", 0x10000, 0x10000, CRC(022f3e96) SHA1(57aa423b8f62015566bc3021300ac7e9682ed500) )
27164978   ROM_LOAD( "fs10.2r", 0x20000, 0x10000, CRC(e42864d8) SHA1(fe18f58e5507676780fe181e2fb0e0e9d72e276e) )
r3115r3116
27204982   ROM_LOAD( "fs6.2k",  0x60000, 0x10000, CRC(588d14b3) SHA1(c0489b061503677a38e4c5800ea8be17aabf4039) )
27214983   ROM_LOAD( "fs5.2j",  0x70000, 0x10000, CRC(def2f1d8) SHA1(b72e4dec3306d8afe461ac812b2de67ee85f9dd9) )
27224984
2723   ROM_REGION( 0x10000, "ym", 0 )
4985   ROM_REGION( 0x10000, "ym2", 0 )
27244986   ROM_LOAD( "fs4.bin",  0x00000, 0x10000, CRC(435c3716) SHA1(42053741f60594e7ae8516b3ba600f5badb3620f) )
27254987ROM_END
27264988
27274989/***********************************************************************/
27284990
2729ROM_START( tdfever ) /* USA set */
2730   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
4991ROM_START( tdfever )
4992   ROM_REGION( 0x10000, "main", 0 )
27314993   ROM_LOAD( "td2-ver3.6c",  0x0000, 0x10000,  CRC(92138fe4) SHA1(17a2bc12f516cdbea3cc5e283b0a8a2d101dfa47) )
27324994
2733   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
4995   ROM_REGION( 0x10000, "sub", 0 )
27344996   ROM_LOAD( "td1-ver3.2c",  0x00000, 0x10000, CRC(798711f5) SHA1(a67d6b71c08df00592cf1a18806ed1c2ee757066) )
27354997
2736   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
4998   ROM_REGION( 0x10000, "audio", 0 )
27374999   ROM_LOAD( "td3-ver3.3j",  0x00000, 0x10000, CRC(5d13e0b1) SHA1(a8d8d7cbc4f5be1c0bf10bceff54104d421758c2) )
27385000
27395001   ROM_REGION( 0x0c00, "proms", 0 )
r3115r3116
27415003   ROM_LOAD( "up03_d8.rom",  0x400, 0x00400, CRC(9c4a9198) SHA1(2d9be23c6a622eba5d3fb0d9912bad03658e563b) )
27425004   ROM_LOAD( "up03_e9.rom",  0x800, 0x00400, CRC(c93c18e8) SHA1(9d4ca20c44bd35aabccab5f94cb45057361ccd99) )
27435005
2744   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
5006   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
27455007   ROM_LOAD( "td14ver3.4n",  0x0000, 0x8000,  CRC(e841bf1a) SHA1(ba93163b00e973eb5da9ddc64becce2bbe9ede05) )
27465008
2747   ROM_REGION( 0x50000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
5009   ROM_REGION( 0x50000, "bg_tiles", ROMREGION_DISPOSE )
27485010   ROM_LOAD( "up01_d8.rom",  0x00000, 0x10000, CRC(ad6e0927) SHA1(dd1c346fbf908af7b3e314f416937f48ade6af4c) )
27495011   ROM_LOAD( "up01_e8.rom",  0x10000, 0x10000, CRC(181db036) SHA1(2c5ed172950fce1467517490a8ab3b7ac6594121) )
27505012   ROM_LOAD( "up01_f8.rom",  0x20000, 0x10000, CRC(c5decca3) SHA1(12aff8adc0ad2bf903122ad065d182692d32fb7a) )
27515013   ROM_LOAD( "td18ver2.8gh", 0x30000, 0x10000, CRC(3924da37) SHA1(6100eb438fb090f74639739ddcc2844f5daa7180) )
27525014   ROM_LOAD( "up01_j8.rom",  0x40000, 0x10000, CRC(bc17ea7f) SHA1(5c3fe43c7fc204d33b5b2a71f22da00e2ba7fbdf) )
27535015
2754   ROM_REGION( 0x80000, "gfx3", ROMREGION_DISPOSE ) /* 32x32 sprites */
5016   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
27555017   ROM_LOAD( "up01_t2.rom",  0x00000, 0x10000, CRC(88e2e819) SHA1(6d5529792dbd2ba63a1bc470e9d3ea63b876cfd8) )
27565018   ROM_LOAD( "up01_s2.rom",  0x10000, 0x10000, CRC(f6f83d63) SHA1(15780a2c1fc7c8456fe073c372f2f4828125e800) )
27575019   ROM_LOAD( "up01_r2.rom",  0x20000, 0x10000, CRC(a0d53fbd) SHA1(a49f29b3f07ec833651aa0e37b0e87f3f72e0e3a) )
r3115r3116
27675029ROM_END
27685030
27695031ROM_START( tdfeverj )
2770   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
5032   ROM_REGION( 0x10000, "main", 0 )
27715033   ROM_LOAD( "up02_c6.rom",  0x0000, 0x10000,  CRC(88d88ec4) SHA1(774de920290b5c787b0f3d0076883dda106364be) )
27725034
2773   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
5035   ROM_REGION( 0x10000, "sub", 0 )
27745036   ROM_LOAD( "up02_c2.rom",  0x00000, 0x10000, CRC(191e6442) SHA1(6a4d0d7efea734443eef538e99562ce4e2949a84) )
27755037
2776   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
5038   ROM_REGION( 0x10000, "audio", 0 )
27775039   ROM_LOAD( "up02_j3.rom",  0x00000, 0x10000, CRC(4e4d71c7) SHA1(93744c7d4822ab1750a50ab895a83f77dfcb4bb3) )
27785040
27795041   ROM_REGION( 0x0c00, "proms", 0 )
r3115r3116
27815043   ROM_LOAD( "up03_d8.rom",  0x400, 0x00400, CRC(9c4a9198) SHA1(2d9be23c6a622eba5d3fb0d9912bad03658e563b) ) /* green */
27825044   ROM_LOAD( "up03_e9.rom",  0x800, 0x00400, CRC(c93c18e8) SHA1(9d4ca20c44bd35aabccab5f94cb45057361ccd99) ) /* blue */
27835045
2784   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
5046   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
27855047   ROM_LOAD( "up01_n4.rom",  0x0000, 0x8000,  CRC(af9bced5) SHA1(ec8b9c0649d33e4b0ed4f7d84530016581370278) )
27865048
2787   ROM_REGION( 0x50000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
5049   ROM_REGION( 0x50000, "bg_tiles", ROMREGION_DISPOSE )
27885050   ROM_LOAD( "up01_d8.rom",  0x00000, 0x10000, CRC(ad6e0927) SHA1(dd1c346fbf908af7b3e314f416937f48ade6af4c) )
27895051   ROM_LOAD( "up01_e8.rom",  0x10000, 0x10000, CRC(181db036) SHA1(2c5ed172950fce1467517490a8ab3b7ac6594121) )
27905052   ROM_LOAD( "up01_f8.rom",  0x20000, 0x10000, CRC(c5decca3) SHA1(12aff8adc0ad2bf903122ad065d182692d32fb7a) )
27915053   ROM_LOAD( "up01_g8.rom",  0x30000, 0x10000, CRC(4512cdfb) SHA1(f9e57804801962e85fdd3412e6e3774e75160535) )
27925054   ROM_LOAD( "up01_j8.rom",  0x40000, 0x10000, CRC(bc17ea7f) SHA1(5c3fe43c7fc204d33b5b2a71f22da00e2ba7fbdf) )
27935055
2794   ROM_REGION( 0x80000, "gfx3", ROMREGION_DISPOSE ) /* 32x32 sprites */
5056   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
27955057   ROM_LOAD( "up01_t2.rom",  0x00000, 0x10000, CRC(88e2e819) SHA1(6d5529792dbd2ba63a1bc470e9d3ea63b876cfd8) )
27965058   ROM_LOAD( "up01_s2.rom",  0x10000, 0x10000, CRC(f6f83d63) SHA1(15780a2c1fc7c8456fe073c372f2f4828125e800) )
27975059   ROM_LOAD( "up01_r2.rom",  0x20000, 0x10000, CRC(a0d53fbd) SHA1(a49f29b3f07ec833651aa0e37b0e87f3f72e0e3a) )
r3115r3116
28075069ROM_END
28085070
28095071ROM_START( tdfever2 )
2810   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
5072   ROM_REGION( 0x10000, "main", 0 )
28115073   ROM_LOAD( "tdmain.6c",     0x0000,  0x10000, CRC(9e3eaed8) SHA1(4a591767b22a46605747740a1e1de9aada2893fe) )
28125074
2813   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
5075   ROM_REGION( 0x10000, "sub", 0 )
28145076   ROM_LOAD( "tdsub.1c",     0x00000, 0x10000, CRC(0ec294c0) SHA1(b16656e5fef1c78310f20633d25cda6d6018bf52) )
28155077
2816   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
5078   ROM_REGION( 0x10000, "audio", 0 )
28175079   ROM_LOAD( "td03.2j",     0x00000, 0x10000, CRC(4092f16c) SHA1(0821a8afc91862e95e742546367724a862fc6c9f) )
28185080
28195081   ROM_REGION( 0x0c00, "proms", 0 )
r3115r3116
28215083   ROM_LOAD( "up03_d82.rom", 0x400,   0x00400, CRC(ac9df947) SHA1(214855e1015f7b519e336159c6ea62ab1f576353) )
28225084   ROM_LOAD( "up03_e92.rom", 0x800,   0x00400, CRC(73cdf192) SHA1(63d1aa1b00035bbfe5bebd9bc9992a5d6f5abd10) )
28235085
2824   ROM_REGION( 0x8000, "gfx1", ROMREGION_DISPOSE ) /* characters */
5086   ROM_REGION( 0x8000, "fg_tiles", ROMREGION_DISPOSE )
28255087   ROM_LOAD( "td06.3n",     0x0000,  0x8000,  CRC(d6521b0d) SHA1(79aba420b2f039d580892fa34de5d63be1a4f222) )
28265088
2827   ROM_REGION( 0x60000, "gfx2", ROMREGION_DISPOSE ) /* tiles */
5089   ROM_REGION( 0x60000, "bg_tiles", ROMREGION_DISPOSE )
28285090   ROM_LOAD( "up01_d8.rom",  0x00000, 0x10000, CRC(ad6e0927) SHA1(dd1c346fbf908af7b3e314f416937f48ade6af4c) )
28295091   ROM_LOAD( "up01_e8.rom",  0x10000, 0x10000, CRC(181db036) SHA1(2c5ed172950fce1467517490a8ab3b7ac6594121) )
28305092   ROM_LOAD( "up01_f8.rom",  0x20000, 0x10000, CRC(c5decca3) SHA1(12aff8adc0ad2bf903122ad065d182692d32fb7a) )
r3115r3116
28325094   ROM_LOAD( "td19.8j",      0x40000, 0x10000, CRC(f1081329) SHA1(efcc210d50923a8c9125227c741ba4b71cd9f688) )
28335095   ROM_LOAD( "td20.8k",      0x50000, 0x10000, CRC(86cbb2e6) SHA1(77ecd6eefc7bb1933374ecd21a5b46798bdbb94d) )
28345096
2835   ROM_REGION( 0x80000, "gfx3", ROMREGION_DISPOSE ) /* 32x32 sprites */
5097   ROM_REGION( 0x80000, "sp32_tiles", ROMREGION_DISPOSE )
28365098   ROM_LOAD( "up01_t2.rom",  0x00000, 0x10000, CRC(88e2e819) SHA1(6d5529792dbd2ba63a1bc470e9d3ea63b876cfd8) )
28375099   ROM_LOAD( "td14.2s",      0x10000, 0x10000, CRC(c9bb9138) SHA1(955101e343e643320b29a29116bea556a25d696f) )
28385100   ROM_LOAD( "up01_r2.rom",  0x20000, 0x10000, CRC(a0d53fbd) SHA1(a49f29b3f07ec833651aa0e37b0e87f3f72e0e3a) )
r3115r3116
28515113
28525114/***********************************************************************/
28535115
2854#define SNK_JOY1_PORT \
2855   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) \
2856   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) \
2857   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) \
2858   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) \
2859   PORT_BIT( 0xf0, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(5) PORT_KEYDELTA(5) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12) \
2860
2861#define SNK_JOY2_PORT \
2862   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) \
2863   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) \
2864   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) \
2865   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) \
2866   PORT_BIT( 0xf0, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(5) PORT_KEYDELTA(5) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
2867
2868#define SNK_JOY1_NODIAL_PORT \
2869   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) \
2870   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) \
2871   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) \
2872   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) \
2873   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
2874
2875#define SNK_JOY2_NODIAL_PORT \
2876   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) \
2877   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) \
2878   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) \
2879   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) \
2880   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
2881
2882#define SNK_BUTTON_PORT \
2883   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) \
2884   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) \
2885   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
2886   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) \
2887   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) \
2888   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
2889   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
2890   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2891
2892#define SNK_COINAGE \
2893   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) \
2894   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) \
2895   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) ) \
2896   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) \
2897   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) \
2898   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) ) \
2899   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) ) \
2900   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) ) \
2901   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) ) \
2902   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
2903
2904static INPUT_PORTS_START( ikari )
2905   PORT_START("IN0")
2906   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* sound CPU status */
2907   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
2908   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2909   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2910   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2911   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2912   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2913   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2914
2915   PORT_START("IN1")
2916   SNK_JOY1_PORT
2917
2918
2919
2920   PORT_START("IN2")
2921   SNK_JOY2_PORT
2922
2923
2924   PORT_START("IN3")
2925   SNK_BUTTON_PORT
2926
2927
2928   PORT_START("DSW1")
2929   PORT_DIPNAME( 0x01, 0x01, "Allow killing each other" )
2930   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
2931   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
2932   PORT_DIPNAME( 0x02, 0x02, "P1 & P2 Fire Buttons" )
2933   PORT_DIPSETTING(    0x02, "Separate" )
2934   PORT_DIPSETTING(    0x00, "Common" )
2935   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" )
2936   PORT_DIPSETTING(    0x04, "1st & every 2nd" )
2937   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
2938   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
2939   PORT_DIPSETTING(    0x08, "3" )
2940   PORT_DIPSETTING(    0x00, "5" )
2941   SNK_COINAGE
2942
2943   PORT_START("DSW2")
2944   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
2945   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
2946   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
2947   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
2948   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2949   PORT_DIPNAME( 0x0c, 0x08, "Game Mode" )
2950   PORT_DIPSETTING(    0x0c, "Demo Sounds Off" )
2951   PORT_DIPSETTING(    0x08, "Demo Sounds On" )
2952   PORT_DIPSETTING(    0x04, "Freeze" )
2953   PORT_DIPSETTING(    0x00, "Infinite Lives (Cheat)")
2954   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
2955   PORT_DIPSETTING(    0x30, "50k 100k" )
2956   PORT_DIPSETTING(    0x20, "60k 120k" )
2957   PORT_DIPSETTING(    0x10, "100k 200k" )
2958   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
2959   PORT_DIPNAME( 0x40 ,0x40, DEF_STR( Unused ) )
2960   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2961   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2962   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )
2963   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
2964   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
2965INPUT_PORTS_END
2966
2967static INPUT_PORTS_START( ikarijp )
2968   PORT_START("IN0")
2969   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2970   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2971   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2972   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
2973   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
2974   PORT_BIT( 0x20, IP_ACTIVE_LOW,IPT_UNKNOWN ) /* sound CPU status */
2975   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2976   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* tilt? */
2977
2978   PORT_START("IN1")
2979   SNK_JOY1_PORT
2980
2981
2982
2983   PORT_START("IN2")
2984   SNK_JOY2_PORT
2985
2986
2987   PORT_START("IN3")
2988   SNK_BUTTON_PORT
2989
2990
2991   PORT_START("DSW1")
2992   PORT_DIPNAME( 0x01, 0x01, "Allow killing each other" )
2993   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
2994   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
2995   PORT_DIPNAME( 0x02, 0x02, "P1 & P2 Fire Buttons" )
2996   PORT_DIPSETTING(    0x02, "Separate" )
2997   PORT_DIPSETTING(    0x00, "Common" )
2998   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" )
2999   PORT_DIPSETTING(    0x04, "1st & every 2nd" )
3000   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
3001   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
3002   PORT_DIPSETTING(    0x08, "3" )
3003   PORT_DIPSETTING(    0x00, "5" )
3004   SNK_COINAGE
3005
3006   PORT_START("DSW2")
3007   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
3008   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
3009   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
3010   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
3011   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
3012   PORT_DIPNAME( 0x0c, 0x08, "Game Mode" )
3013   PORT_DIPSETTING(    0x0c, "Demo Sounds Off" )
3014   PORT_DIPSETTING(    0x08, "Demo Sounds On" )
3015   PORT_DIPSETTING(    0x04, "Freeze" )
3016   PORT_DIPSETTING(    0x00, "Infinite Lives (Cheat)")
3017   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
3018   PORT_DIPSETTING(    0x30, "50k 100k" )
3019   PORT_DIPSETTING(    0x20, "60k 120k" )
3020   PORT_DIPSETTING(    0x10, "100k 200k" )
3021   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3022   PORT_DIPNAME( 0x40 ,0x40, DEF_STR( Unused ) )
3023   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3024   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3025   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
3026   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3027   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3028INPUT_PORTS_END
3029
3030
3031static INPUT_PORTS_START( ikarijpb )
3032   PORT_INCLUDE(ikarijp)
3033
3034   PORT_MODIFY("IN1")
3035   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
3036   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
3037   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
3038   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
3039   PORT_BIT( 0xf0, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(8) PORT_WRAPS PORT_REMAP_TABLE(dial_8_gray) PORT_SENSITIVITY(5) PORT_KEYDELTA(5) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_FULL_TURN_COUNT(8)
3040
3041   PORT_MODIFY("IN2")
3042   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
3043   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
3044   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
3045   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
3046   PORT_BIT( 0xf0, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(8) PORT_WRAPS PORT_REMAP_TABLE(dial_8_gray) PORT_SENSITIVITY(5) PORT_KEYDELTA(5) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_FULL_TURN_COUNT(8)
3047INPUT_PORTS_END
3048
3049
3050static INPUT_PORTS_START( victroad )
3051   PORT_START("IN0")
3052   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* sound related ??? */
3053   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
3054   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3055   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3056   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
3057   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
3058   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
3059   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
3060
3061   PORT_START("IN1")
3062   SNK_JOY1_PORT
3063
3064
3065
3066   PORT_START("IN2")
3067   SNK_JOY2_PORT
3068
3069
3070   PORT_START("IN3")
3071   SNK_BUTTON_PORT
3072
3073
3074   PORT_START("DSW1")
3075   PORT_DIPNAME( 0x01, 0x01, "Kill friend & walk everywhere (Cheat)")
3076   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
3077   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
3078   PORT_DIPNAME( 0x02, 0x02, "P1 & P2 Fire Buttons" )
3079   PORT_DIPSETTING(    0x02, "Separate" )
3080   PORT_DIPSETTING(    0x00, "Common" )
3081   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" )
3082   PORT_DIPSETTING(    0x04, "1st & every 2nd" )
3083   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
3084   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
3085   PORT_DIPSETTING(    0x08, "3" )
3086   PORT_DIPSETTING(    0x00, "5" )
3087   SNK_COINAGE
3088
3089   PORT_START("DSW2")
3090   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
3091   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
3092   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
3093   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
3094   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
3095   PORT_DIPNAME( 0x0c, 0x08, "Game Mode" )
3096   PORT_DIPSETTING(    0x0c, "Demo Sounds Off" )
3097   PORT_DIPSETTING(    0x08, "Demo Sounds On" )
3098   PORT_DIPSETTING(    0x00, "Freeze" )
3099   PORT_DIPSETTING(    0x04, "Infinite Lives (Cheat)")
3100   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
3101   PORT_DIPSETTING(    0x30, "50k 100k" )
3102   PORT_DIPSETTING(    0x20, "60k 120k" )
3103   PORT_DIPSETTING(    0x10, "100k 200k" )
3104   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3105   PORT_DIPNAME( 0x40 ,0x00, DEF_STR( Allow_Continue ) )
3106   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
3107   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
3108   PORT_DIPNAME( 0x80, 0x80, "Credits Buy Lives During Play" )
3109   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
3110   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
3111INPUT_PORTS_END
3112
3113
3114static INPUT_PORTS_START( dogosokj )
3115   PORT_START("IN0")
3116   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* sound related ??? */
3117   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
3118   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3119   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3120   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
3121   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
3122   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
3123   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
3124
3125   PORT_START("IN1")
3126   SNK_JOY1_NODIAL_PORT
3127
3128
3129   PORT_START("IN2")
3130   SNK_JOY2_NODIAL_PORT
3131
3132
3133   PORT_START("IN3")
3134   SNK_BUTTON_PORT
3135
3136
3137   PORT_START("DSW1")
3138   PORT_DIPNAME( 0x01, 0x01, "Kill friend & walk everywhere (Cheat)")
3139   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
3140   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
3141   PORT_DIPNAME( 0x02, 0x02, "P1 & P2 Fire Buttons" )
3142   PORT_DIPSETTING(    0x02, "Separate" )
3143   PORT_DIPSETTING(    0x00, "Common" )
3144   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" )
3145   PORT_DIPSETTING(    0x04, "1st & every 2nd" )
3146   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
3147   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
3148   PORT_DIPSETTING(    0x08, "3" )
3149   PORT_DIPSETTING(    0x00, "5" )
3150   SNK_COINAGE
3151
3152   PORT_START("DSW2")
3153   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
3154   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
3155   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
3156   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
3157   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
3158   PORT_DIPNAME( 0x0c, 0x08, "Game Mode" )
3159   PORT_DIPSETTING(    0x0c, "Demo Sounds Off" )
3160   PORT_DIPSETTING(    0x08, "Demo Sounds On" )
3161   PORT_DIPSETTING(    0x00, "Freeze" )
3162   PORT_DIPSETTING(    0x04, "Infinite Lives (Cheat)")
3163   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
3164   PORT_DIPSETTING(    0x30, "50k 100k" )
3165   PORT_DIPSETTING(    0x20, "60k 120k" )
3166   PORT_DIPSETTING(    0x10, "100k 200k" )
3167   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3168   PORT_DIPNAME( 0x40 ,0x00, DEF_STR( Allow_Continue ) )
3169   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
3170   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
3171   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
3172   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3173   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
3174INPUT_PORTS_END
3175
3176
3177static INPUT_PORTS_START( gwar )
3178   PORT_START("IN0")
3179   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* sound related ??? */
3180   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
3181   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* causes reset */
3182   PORT_SERVICE_NO_TOGGLE(0x08, IP_ACTIVE_LOW)
3183   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
3184   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
3185   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
3186   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
3187
3188   PORT_START("IN1")
3189   SNK_JOY1_PORT
3190
3191
3192
3193   PORT_START("IN2")
3194   SNK_JOY2_PORT
3195
3196
3197   PORT_START("IN3")
3198   SNK_BUTTON_PORT
3199
3200
3201   PORT_START("DSW1")
3202   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) )
3203   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
3204   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
3205   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
3206   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3207   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3208   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" )
3209   PORT_DIPSETTING(    0x04, "1st & 2nd only" )
3210   PORT_DIPSETTING(    0x00, "1st & every 2nd" )
3211   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
3212   PORT_DIPSETTING(    0x08, "3" )
3213   PORT_DIPSETTING(    0x00, "5" )
3214   SNK_COINAGE
3215
3216   PORT_START("DSW2")
3217   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
3218   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
3219   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
3220   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
3221   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
3222   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) )
3223   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
3224   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3225   PORT_DIPNAME( 0x08, 0x08, "Freeze" )
3226   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
3227   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3228   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
3229   PORT_DIPSETTING(    0x30, "30k 60k" )
3230   PORT_DIPSETTING(    0x20, "40k 80k" )
3231   PORT_DIPSETTING(    0x10, "50k 100k" )
3232   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3233   PORT_DIPNAME( 0x40 ,0x40, DEF_STR( Unknown ) )
3234   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3235   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3236   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
3237   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3238   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3239INPUT_PORTS_END
3240
3241static INPUT_PORTS_START( athena )
3242   PORT_START("IN0")
3243   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )  /* sound CPU status */
3244   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
3245   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3246   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3247   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
3248   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
3249   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
3250   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
3251
3252   PORT_START("IN1")
3253   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
3254   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
3255   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
3256   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
3257   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
3258   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
3259   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3260   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3261
3262   PORT_START("IN2")
3263   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
3264   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
3265   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
3266   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
3267   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
3268   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
3269   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3270   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3271
3272   PORT_START("DSW1")
3273   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) /* Listed as "Unused" in the manual */
3274   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
3275   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3276   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
3277   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
3278   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
3279   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" )
3280   PORT_DIPSETTING(    0x04, "1st & every 2nd" )
3281   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
3282   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
3283   PORT_DIPSETTING(    0x08, "3" )
3284   PORT_DIPSETTING(    0x00, "5" )
3285   SNK_COINAGE
3286
3287   PORT_START("DSW2")
3288   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
3289   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
3290   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
3291   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
3292   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
3293   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) )
3294   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
3295   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3296   PORT_DIPNAME( 0x08, 0x08, "Freeze" )
3297   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
3298   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3299   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
3300   PORT_DIPSETTING(    0x30, "50k 100k" )
3301   PORT_DIPSETTING(    0x20, "80k 160k" )
3302   PORT_DIPSETTING(    0x10, "100k 200k" )
3303   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3304   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) /* Listed as "Unused" in the manual */
3305   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3306   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3307   PORT_DIPNAME( 0x80, 0x80, "Energy" )
3308   PORT_DIPSETTING(    0x80, "12" )
3309   PORT_DIPSETTING(    0x00, "14" )
3310INPUT_PORTS_END
3311
3312static INPUT_PORTS_START( tnk3 )
3313   PORT_START("IN0")
3314   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )
3315   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
3316   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
3317   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
3318   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
3319   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* sound CPU status */
3320   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3321   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3322
3323   PORT_START("IN1")
3324   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
3325   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
3326   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
3327   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
3328   PORT_BIT( 0xf0, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X)
3329
3330   PORT_START("IN2")
3331   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL
3332   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
3333   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
3334   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
3335   PORT_BIT( 0xf0, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2)
3336
3337   PORT_START("IN3")
3338   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
3339   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
3340   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3341   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
3342   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
3343   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
3344   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3345   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3346
3347   PORT_START("DSW1")
3348   PORT_DIPNAME( 0x01, 0x01, "Walk everywhere (Cheat)")
3349   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
3350   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3351   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
3352   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
3353   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
3354   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
3355   PORT_DIPSETTING(    0x04, "3" )
3356   PORT_DIPSETTING(    0x00, "5" )
3357   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coinage ) )
3358   /* 0x08 and 0x10: 1 Coin/1 Credit */
3359   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
3360   PORT_DIPSETTING(    0x18, DEF_STR( 2C_1C ) )
3361   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
3362   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
3363   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
3364   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
3365   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) )
3366   PORT_DIPSETTING(    0xc0, "20k 60k" )
3367   PORT_DIPSETTING(    0x80, "40k 90k" )
3368   PORT_DIPSETTING(    0x40, "50k 120k" )
3369   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3370
3371   PORT_START("DSW2")
3372   PORT_DIPNAME( 0x01, 0x01, "Bonus Occurrence" )
3373   PORT_DIPSETTING(    0x01, "1st & every 2nd" )
3374   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
3375   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )
3376   PORT_DIPSETTING(    0x06, DEF_STR( Easy ) )
3377   PORT_DIPSETTING(    0x04, DEF_STR( Normal ) )
3378   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
3379   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
3380   PORT_DIPNAME( 0x18, 0x10, "Game Mode" )
3381   PORT_DIPSETTING(    0x18, "Demo Sounds Off" )
3382   PORT_DIPSETTING(    0x10, "Demo Sounds On" )
3383   PORT_DIPSETTING(    0x00, "Freeze" )
3384   PORT_DIPSETTING(    0x08, "Infinite Lives (Cheat)")
3385   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
3386   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
3387   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3388   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) // unused in manual
3389   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3390   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3391   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )
3392   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
3393   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
3394INPUT_PORTS_END
3395
3396static INPUT_PORTS_START( bermudat )
3397   PORT_START("IN0")
3398   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* sound CPU status */
3399   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
3400   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* tile? */
3401   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3402   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
3403   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
3404   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
3405   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
3406
3407   PORT_START("IN1")
3408   SNK_JOY1_PORT
3409
3410
3411
3412   PORT_START("IN2")
3413   SNK_JOY2_PORT
3414
3415
3416   PORT_START("IN3")
3417   SNK_BUTTON_PORT
3418
3419
3420   PORT_START("DSW1")
3421   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )
3422   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
3423   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3424   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
3425   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3426   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3427   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" )
3428   PORT_DIPSETTING(    0x04, "1st & every 2nd" )
3429   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
3430   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
3431   PORT_DIPSETTING(    0x08, "3" )
3432   PORT_DIPSETTING(    0x00, "5" )
3433   SNK_COINAGE
3434
3435   PORT_START("DSW2")
3436   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
3437   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
3438   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
3439   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
3440   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
3441   PORT_DIPNAME( 0x0c, 0x08, "Game Mode" )
3442   PORT_DIPSETTING(    0x0c, "Demo Sounds Off" )
3443   PORT_DIPSETTING(    0x08, "Demo Sounds On" )
3444   PORT_DIPSETTING(    0x00, "Freeze" )
3445   PORT_DIPSETTING(    0x04, "Infinite Lives (Cheat)")
3446   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
3447   PORT_DIPSETTING(    0x30, "50k 100k" )
3448   PORT_DIPSETTING(    0x20, "60k 120k" )
3449   PORT_DIPSETTING(    0x10, "100k 200k" )
3450   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3451   PORT_DIPNAME( 0xc0, 0xc0, "Game Style" )
3452   PORT_DIPSETTING(    0xc0, "Normal without continue" )
3453   PORT_DIPSETTING(    0x80, "Normal with continue" )
3454   PORT_DIPSETTING(    0x40, "Time attack 3 minutes" )
3455   PORT_DIPSETTING(    0x00, "Time attack 5 minutes" )
3456INPUT_PORTS_END
3457
3458static INPUT_PORTS_START( bermudaa )
3459   PORT_INCLUDE( bermudat )
3460
3461   PORT_MODIFY("IN0")
3462   PORT_SERVICE_NO_TOGGLE(0x08, IP_ACTIVE_LOW)
3463
3464   PORT_MODIFY("DSW1")
3465   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Allow_Continue ) )
3466   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
3467   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
3468
3469   PORT_MODIFY("DSW2")
3470   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
3471   PORT_DIPSETTING(    0x30, "25k 50k" )
3472   PORT_DIPSETTING(    0x20, "35k 70k" )
3473   PORT_DIPSETTING(    0x10, "50K 100k" )
3474   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3475   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
3476   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3477   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3478   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
3479   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3480   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3481INPUT_PORTS_END
3482
3483/* Same as Bermudaa, but has different Bonus Life */
3484static INPUT_PORTS_START( worldwar )
3485   PORT_INCLUDE( bermudaa )
3486
3487   PORT_MODIFY("DSW2")
3488   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
3489   PORT_DIPSETTING(    0x30, "50k 100k" )
3490   PORT_DIPSETTING(    0x20, "80k 160k" )
3491   PORT_DIPSETTING(    0x10, "100k 200k" )
3492   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3493INPUT_PORTS_END
3494
3495static INPUT_PORTS_START( psychos )
3496   PORT_START("IN0")
3497   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )  /* sound related */
3498   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
3499   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )  /* reset */
3500   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3501   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
3502   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
3503   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
3504   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
3505
3506   PORT_START("IN1")
3507   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
3508   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
3509   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
3510   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
3511   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
3512   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
3513   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
3514   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
3515
3516   PORT_START("IN2")
3517   SNK_BUTTON_PORT
3518
3519
3520   PORT_START("DSW1")
3521   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
3522   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
3523   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3524   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3525   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" )
3526   PORT_DIPSETTING(    0x00, "1st & every 2nd" )
3527   PORT_DIPSETTING(    0x04, "1st & 2nd only" )
3528   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
3529   PORT_DIPSETTING(    0x08, "3" )
3530   PORT_DIPSETTING(    0x00, "5" )
3531   SNK_COINAGE
3532
3533   PORT_START("DSW2")
3534   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
3535   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
3536   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
3537   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
3538   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
3539   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )
3540   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3541   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
3542   PORT_DIPNAME( 0x08, 0x08, "Freeze" )
3543   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
3544   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3545   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
3546   PORT_DIPSETTING(    0x30, "50K 100K" )
3547   PORT_DIPSETTING(    0x20, "60K 120K" )
3548   PORT_DIPSETTING(    0x10, "100K 200K" )
3549   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3550   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) )
3551   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
3552   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
3553   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
3554   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3555   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3556INPUT_PORTS_END
3557
3558static INPUT_PORTS_START( legofair )
3559   PORT_START("IN0")
3560   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )  /* sound CPU status */
3561   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
3562   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )  /* Reset */
3563   PORT_SERVICE_NO_TOGGLE(0x08, 0x08 )
3564   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
3565   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
3566   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
3567   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
3568
3569   PORT_START("IN1")
3570   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
3571   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
3572   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
3573   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
3574   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
3575   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
3576   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
3577   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
3578
3579   PORT_START("IN2")
3580   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
3581   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
3582   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3583   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
3584   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
3585   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
3586   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3587   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3588
3589   PORT_START("DSW1")
3590   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
3591   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
3592   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3593   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
3594   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
3595   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
3596   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" )
3597   PORT_DIPSETTING(    0x00, "1st & every 2nd" )
3598   PORT_DIPSETTING(    0x04, "1st & 2nd only" )
3599   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
3600   PORT_DIPSETTING(    0x08, "3" )
3601   PORT_DIPSETTING(    0x00, "5" )
3602   SNK_COINAGE
3603
3604   PORT_START("DSW2")
3605   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
3606   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
3607   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
3608   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
3609   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
3610   PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" )
3611   PORT_DIPSETTING(    0x08, "Demo Sounds Off" )
3612   PORT_DIPSETTING(    0x0c, "Demo Sounds On" )
3613   PORT_DIPSETTING(    0x00, "Freeze" )
3614   PORT_DIPSETTING(    0x04, "Infinite Lives (Cheat)")
3615   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
3616   PORT_DIPSETTING(    0x30, "50k 100k" )
3617   PORT_DIPSETTING(    0x20, "75k 150k" )
3618   PORT_DIPSETTING(    0x10, "100k 200k" )
3619   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3620   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )
3621   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
3622   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
3623   PORT_DIPNAME( 0x80, 0x80, "Invulnerability (Cheat)")
3624   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3625   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3626INPUT_PORTS_END
3627
3628static INPUT_PORTS_START( choppera )
3629   PORT_START("IN0")
3630   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )  /* sound CPU status */
3631   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
3632   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )  /* Reset */
3633   PORT_SERVICE_NO_TOGGLE(0x08, 0x08)
3634   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
3635   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
3636   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
3637   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
3638
3639   PORT_START("IN1")
3640   SNK_JOY1_NODIAL_PORT
3641
3642
3643   PORT_START("IN2")
3644   SNK_JOY2_NODIAL_PORT
3645
3646
3647   PORT_START("IN3")
3648   SNK_BUTTON_PORT
3649
3650
3651   PORT_START("DSW1")
3652   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
3653   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
3654   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3655   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
3656   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
3657   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
3658   PORT_DIPNAME( 0x04, 0x04, "Bonus Occurrence" )
3659   PORT_DIPSETTING(    0x00, "1st & every 2nd" )
3660   PORT_DIPSETTING(    0x04, "1st & 2nd only" )
3661   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
3662   PORT_DIPSETTING(    0x08, "3" )
3663   PORT_DIPSETTING(    0x00, "5" )
3664   SNK_COINAGE
3665
3666   PORT_START("DSW2")
3667   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
3668   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
3669   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
3670   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
3671   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
3672   PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" )
3673   PORT_DIPSETTING(    0x08, "Demo Sounds Off" )
3674   PORT_DIPSETTING(    0x0c, "Demo Sounds On" )
3675   PORT_DIPSETTING(    0x00, "Freeze" )
3676   PORT_DIPSETTING(    0x04, "Infinite Lives (Cheat)")
3677   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
3678   PORT_DIPSETTING(    0x30, "50k 100k" )
3679   PORT_DIPSETTING(    0x20, "75k 150k" )
3680   PORT_DIPSETTING(    0x10, "100k 200k" )
3681   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
3682   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )
3683   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
3684   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
3685   PORT_DIPNAME( 0x80, 0x80, "Invulnerability (Cheat)")
3686   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3687   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3688INPUT_PORTS_END
3689
3690static INPUT_PORTS_START( fitegolf )
3691   PORT_START("IN0")
3692   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )  /* sound related? */
3693   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
3694   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3695   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3696   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
3697   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
3698   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
3699   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
3700
3701   PORT_START("IN1")
3702   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
3703   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
3704   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
3705   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
3706   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
3707   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
3708   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3709   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3710
3711   PORT_START("IN2")
3712   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
3713   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
3714   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
3715   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
3716   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3717   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
3718   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3719   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3720
3721   PORT_START("DSW1")
3722   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Language ) ) /* Version */
3723   PORT_DIPSETTING(    0x01, DEF_STR( English ) )  /* Over Sea */
3724   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) ) /* Domestic */
3725   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
3726   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3727   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3728   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
3729   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
3730   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
3731   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
3732   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
3733   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
3734   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
3735   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
3736   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
3737   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
3738   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
3739   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
3740   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
3741
3742   PORT_START("DSW2")
3743   PORT_DIPNAME( 0x01, 0x01, "Shot Time" )
3744   PORT_DIPSETTING(    0x00, "Short (10 sec)" )
3745   PORT_DIPSETTING(    0x01, "Long (12 sec)" )
3746   PORT_DIPNAME( 0x02, 0x02, "Bonus Holes" )
3747   PORT_DIPSETTING(    0x02, "5 (Par 1,Birdie 2,Eagle 3)" )
3748   PORT_DIPSETTING(    0x00, "3 (Par 0,Birdie 1,Eagle 2)" )
3749   PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" )
3750   PORT_DIPSETTING(    0x08, "Endless Game (Cheat)")
3751   PORT_DIPSETTING(    0x0c, "Demo Sound On" )
3752   PORT_DIPSETTING(    0x00, "Freeze" )
3753   PORT_DIPSETTING(    0x04, "Demo Sound Off" )
3754   PORT_DIPNAME( 0x30, 0x30, "Play Holes" )
3755   PORT_DIPSETTING(    0x30, "2" )
3756   PORT_DIPSETTING(    0x20, "3" )
3757   PORT_DIPSETTING(    0x10, "4" )
3758   PORT_DIPSETTING(    0x00, "5" )
3759   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )
3760   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3761   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3762   PORT_DIPNAME( 0x80, 0x80, "Test Mode" )
3763   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3764   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3765INPUT_PORTS_END
3766
3767static INPUT_PORTS_START( countryc )
3768   PORT_START("IN0")
3769   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )  /* sound related? */
3770   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
3771   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3772   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3773   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
3774   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
3775   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
3776   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
3777
3778   PORT_START("IN1")
3779   PORT_BIT( 0x7f, 0x00, IPT_TRACKBALL_X  ) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_REVERSE
3780   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
3781
3782   PORT_START("IN2")
3783   PORT_BIT( 0x7f, 0x00, IPT_TRACKBALL_Y  ) PORT_SENSITIVITY(50) PORT_KEYDELTA(30)
3784   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
3785
3786   PORT_START("DSW1")
3787   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Language ) ) /* NOT showed in Test Mode/Manual */
3788   PORT_DIPSETTING(    0x01, DEF_STR( English ) )
3789   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
3790   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
3791   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3792   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3793   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )  /* Trackball */
3794   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )  /* 1 System */
3795   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) ) /* 2 Systems */
3796   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
3797   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
3798   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
3799   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
3800   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
3801   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
3802   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )
3803   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
3804   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
3805   PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) )
3806
3807   PORT_START("DSW2")
3808   PORT_DIPNAME( 0x01, 0x01, "Shot Time" )
3809   PORT_DIPSETTING(    0x00, "Short (10 sec)" )
3810   PORT_DIPSETTING(    0x01, "Long (12 sec)" )
3811   PORT_DIPNAME( 0x02, 0x02, "Bonus Holes" )
3812   PORT_DIPSETTING(    0x02, "5 (Par 1,Birdie 2,Eagle 3)" )
3813   PORT_DIPSETTING(    0x00, "3 (Par 0,Birdie 1,Eagle 2)" )
3814   PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" )
3815   PORT_DIPSETTING(    0x08, "Endless Game (Cheat)")
3816   PORT_DIPSETTING(    0x0c, "Demo Sound On" )
3817   PORT_DIPSETTING(    0x00, "Freeze" )
3818   PORT_DIPSETTING(    0x04, "Demo Sound Off" )
3819   PORT_DIPNAME( 0x30, 0x30, "Play Holes" )
3820   PORT_DIPSETTING(    0x30, "2" )
3821   PORT_DIPSETTING(    0x20, "3" )
3822   PORT_DIPSETTING(    0x10, "4" )
3823   PORT_DIPSETTING(    0x00, "5" )
3824   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )
3825   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3826   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3827   PORT_DIPNAME( 0x80, 0x80, "Test Mode" )
3828   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3829   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3830INPUT_PORTS_END
3831
3832static INPUT_PORTS_START( fsoccer )
3833   PORT_START("IN0")
3834   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
3835   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
3836   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3837   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )  /* sound CPU status */
3838   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
3839   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
3840   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A")
3841   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Start Game B")
3842
3843   PORT_START("IN1")
3844   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
3845   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
3846   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3847   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3848   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
3849   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
3850   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
3851   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
3852
3853   PORT_START("IN2")
3854   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3855   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
3856   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3857   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3858   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
3859   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
3860   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
3861   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
3862
3863   PORT_START("IN3")
3864   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
3865   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
3866   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3867   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Start Game E")
3868   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
3869   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
3870   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
3871   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
3872
3873   PORT_START("IN4")
3874   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
3875   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
3876   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3877   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3878   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
3879   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
3880   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
3881   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
3882
3883   PORT_START("IN5")   /* Only used in the "test mode" in this version */
3884   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_PLAYER(1)
3885   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
3886
3887   PORT_START("IN6")   /* Only used in the "test mode" in this version */
3888   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2)
3889   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
3890
3891   PORT_START("IN7")   /* Only used in the "test mode" in this version */
3892   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(3)
3893   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
3894
3895   PORT_START("IN8")   /* Only used in the "test mode" in this version */
3896   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(4)
3897   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
3898
3899   PORT_START("DSW1")
3900   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Cabinet ) )
3901   PORT_DIPSETTING(    0x03, "Upright (With VS)" )
3902   PORT_DIPSETTING(    0x02, "Upright (Without VS)" )
3903   PORT_DIPSETTING(    0x00, "Cocktail (2 Players)" )
3904   PORT_DIPSETTING(    0x01, "Cocktail (4 Players)" )
3905   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Version ) )
3906   PORT_DIPSETTING(    0x04, DEF_STR( Europe ) )
3907   PORT_DIPSETTING(    0x00, DEF_STR( USA ) )
3908   PORT_DIPSETTING(    0x08, DEF_STR( Japan ) )
3909/*  PORT_DIPSETTING(    0x0c, DEF_STR( Europe ) ) */
3910   SNK_COINAGE
3911
3912   PORT_START("DSW2")
3913   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) )
3914   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
3915   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
3916   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
3917   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3918   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3919   PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" )
3920   PORT_DIPSETTING(    0x08, "Demo Sound Off" )
3921   PORT_DIPSETTING(    0x0c, "Demo Sound On" )
3922   PORT_DIPSETTING(    0x00, "Freeze" )
3923   PORT_DIPSETTING(    0x04, "Win Match Against CPU (Cheat)")
3924   PORT_DIPNAME( 0x70, 0x70, DEF_STR( Game_Time ) )   /* See notes */
3925   PORT_DIPSETTING(    0x10, "1:00" )
3926   PORT_DIPSETTING(    0x60, "1:10" )
3927   PORT_DIPSETTING(    0x50, "1:20" )
3928   PORT_DIPSETTING(    0x40, "1:30" )
3929   PORT_DIPSETTING(    0x30, "1:40" )
3930   PORT_DIPSETTING(    0x20, "1:50" )
3931   PORT_DIPSETTING(    0x70, "2:00" )
3932   PORT_DIPSETTING(    0x00, "2:10" )
3933   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
3934
3935   PORT_START("IN9")
3936   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
3937   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
3938   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3939   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3940   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
3941   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
3942   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 ) PORT_NAME("Start Game C")
3943   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 ) PORT_NAME("Start Game D")
3944INPUT_PORTS_END
3945
3946static INPUT_PORTS_START( tdfever )
3947   PORT_START("IN0")
3948   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
3949   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
3950   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3951   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )  /* sound CPU status */
3952   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
3953   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
3954   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A")
3955   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Start Game B")
3956
3957   PORT_START("IN1")
3958   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
3959   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
3960   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
3961   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
3962   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
3963   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
3964   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
3965   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
3966
3967   PORT_START("IN2")
3968   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3969   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
3970   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
3971   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
3972   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
3973   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
3974   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
3975   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
3976
3977   PORT_START("IN3")
3978   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
3979   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
3980   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3981   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Start Game E")
3982   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
3983   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
3984   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
3985   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
3986
3987   PORT_START("IN4")
3988   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
3989   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
3990   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
3991   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3992   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
3993   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
3994   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
3995   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
3996
3997   PORT_START("IN5")
3998   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X)
3999   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
4000
4001   PORT_START("IN6")
4002   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2)
4003   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
4004
4005   PORT_START("IN7")
4006   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(3)
4007   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
4008
4009   PORT_START("IN8")
4010   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(4)
4011   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
4012
4013   PORT_START("DSW1")
4014   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Allow_Continue ) )
4015   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
4016   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
4017   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
4018   PORT_DIPSETTING(    0x02, "2 Player Upright" )
4019   PORT_DIPSETTING(    0x00, "4 Player Cocktail" )
4020   PORT_DIPNAME( 0x0c, 0x00, "1st Down Bonus Time" )
4021   PORT_DIPSETTING(    0x00, "Every 1st Down" )
4022   PORT_DIPSETTING(    0x04, "Every 4 1st Downs" )
4023   PORT_DIPSETTING(    0x08, "Every 6 1st Downs" )
4024   PORT_DIPSETTING(    0x0c, "Every 8 1st Downs" )
4025   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
4026   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
4027   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
4028   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
4029   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
4030   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )   /* Manual shows these two as blank */
4031   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4032   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4033   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
4034   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4035   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4036
4037   PORT_START("DSW2")
4038   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
4039   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
4040   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
4041   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
4042   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
4043   PORT_DIPNAME( 0x0c, 0x08, "Game Mode" )
4044   PORT_DIPSETTING(    0x0c, "Demo Sound Off" )
4045   PORT_DIPSETTING(    0x08, "Demo Sound On" )
4046   PORT_DIPSETTING(    0x00, "Freeze" )
4047   PORT_DIPSETTING(    0x04, "Never Finish (Cheat)")
4048   PORT_DIPNAME( 0x70, 0x70, "Play Time" )
4049   PORT_DIPSETTING(    0x70, "1:00" )
4050   PORT_DIPSETTING(    0x60, "1:10" )
4051   PORT_DIPSETTING(    0x50, "1:20" )
4052   PORT_DIPSETTING(    0x40, "1:30" )
4053   PORT_DIPSETTING(    0x30, "1:40" )
4054   PORT_DIPSETTING(    0x20, "1:50" )
4055   PORT_DIPSETTING(    0x10, "2:00" )
4056   PORT_DIPSETTING(    0x00, "2:10" )
4057/*
4058Actual Play Times listed in manual based on Players & cabinet type:
4059
4060                Upright/Cocktail     Cocktail Only
4061 Dip Switch       A       B         C      D      E    <-- Start button "MODE"
4062 SW6 SW7 SW8    1PvsCPU 2PvsCPU   1Pvs2P 2Pvs1P 2Pvs2P
4063 OFF OFF OFF     1:00    1:10      2:00   2:10   3:00
4064 ON  OFF OFF     1:10    1:20      2:10   2:20   3:10
4065 OFF ON  OFF     1:20    1:30      2:20   2:30   3:20
4066 ON  ON  OFF     1:30    1:40      2:30   2:40   3:30
4067 OFF OFF ON      1:40    1:50      2:40   2:50   3:40
4068 ON  OFF ON      1:50    2:00      2:50   3:00   3:50
4069 OFF ON  ON      2:00    2:10      3:00   3:10   4:00
4070 ON  ON  ON      2:10    2:20      3:10   3:20   4:10
4071*/
4072   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
4073   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4074   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4075
4076   PORT_START("IN9")
4077   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
4078   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
4079   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
4080   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
4081   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
4082   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
4083   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 ) PORT_NAME("Start Game C")
4084   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 ) PORT_NAME("Start Game D")
4085INPUT_PORTS_END
4086
4087static INPUT_PORTS_START( tdfeverj )
4088   PORT_START("IN0")
4089   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
4090   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
4091   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
4092   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )  /* sound CPU status */
4093   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
4094   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
4095   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A")
4096   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Start Game B")
4097
4098   PORT_START("IN1")
4099   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
4100   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
4101   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
4102   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
4103   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
4104   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
4105   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
4106   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
4107
4108   PORT_START("IN2")
4109   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
4110   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
4111   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
4112   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
4113   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
4114   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
4115   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
4116   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
4117
4118   PORT_START("IN3")
4119   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
4120   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
4121   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
4122   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Start Game E")
4123   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
4124   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
4125   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
4126   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
4127
4128   PORT_START("IN4")
4129   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
4130   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
4131   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
4132   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
4133   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
4134   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
4135   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
4136   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
4137
4138   PORT_START("IN5")
4139   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X)
4140   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
4141
4142   PORT_START("IN6")
4143   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2)
4144   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
4145
4146   PORT_START("IN7")
4147   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(3)
4148   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
4149
4150   PORT_START("IN8")
4151   PORT_BIT( 0x7f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_PLAYER(4)
4152   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
4153
4154   PORT_START("DSW1")
4155   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Allow_Continue ) )
4156   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
4157   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
4158   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
4159   PORT_DIPSETTING(    0x00, "2 Player Upright" )
4160   PORT_DIPSETTING(    0x02, "4 Player Cocktail" )
4161   PORT_DIPNAME( 0x0c, 0x00, "1st Down Bonus Time" )
4162   PORT_DIPSETTING(    0x00, "Every 1st Down" )
4163   PORT_DIPSETTING(    0x04, "Every 4 1st Downs" )
4164   PORT_DIPSETTING(    0x08, "Every 6 1st Downs" )
4165   PORT_DIPSETTING(    0x0c, "Every 8 1st Downs" )
4166   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
4167   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
4168   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
4169   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
4170   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
4171   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )   /* Manual shows these two as blank */
4172   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4173   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4174   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
4175   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4176   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4177
4178   PORT_START("DSW2")
4179   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
4180   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
4181   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
4182   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
4183   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
4184   PORT_DIPNAME( 0x0c, 0x08, "Game Mode" )
4185   PORT_DIPSETTING(    0x0c, "Demo Sound Off" )
4186   PORT_DIPSETTING(    0x08, "Demo Sound On" )
4187   PORT_DIPSETTING(    0x00, "Freeze" )
4188   PORT_DIPSETTING(    0x04, "Never Finish (Cheat)")
4189   PORT_DIPNAME( 0x70, 0x70, "Play Time" )
4190   PORT_DIPSETTING(    0x70, "1:00" )
4191   PORT_DIPSETTING(    0x60, "1:10" )
4192   PORT_DIPSETTING(    0x50, "1:20" )
4193   PORT_DIPSETTING(    0x40, "1:30" )
4194   PORT_DIPSETTING(    0x30, "1:40" )
4195   PORT_DIPSETTING(    0x20, "1:50" )
4196   PORT_DIPSETTING(    0x10, "2:00" )
4197   PORT_DIPSETTING(    0x00, "2:10" )
4198/*
4199Actual Play Times listed in manual based on Players & cabinet type:
4200
4201                Upright/Cocktail     Cocktail Only
4202 Dip Switch       A       B         C      D      E    <-- Start button "MODE"
4203 SW6 SW7 SW8    1PvsCPU 2PvsCPU   1Pvs2P 2Pvs1P 2Pvs2P
4204 OFF OFF OFF     1:00    1:10      2:00   2:10   3:00
4205 ON  OFF OFF     1:10    1:20      2:10   2:20   3:10
4206 OFF ON  OFF     1:20    1:30      2:20   2:30   3:20
4207 ON  ON  OFF     1:30    1:40      2:30   2:40   3:30
4208 OFF OFF ON      1:40    1:50      2:40   2:50   3:40
4209 ON  OFF ON      1:50    2:00      2:50   3:00   3:50
4210 OFF ON  ON      2:00    2:10      3:00   3:10   4:00
4211 ON  ON  ON      2:10    2:20      3:10   3:20   4:10
4212*/
4213   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
4214   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4215   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4216
4217   PORT_START("IN9")
4218   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
4219   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
4220   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
4221   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
4222   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
4223   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
4224   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 ) PORT_NAME("Start Game C")
4225   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 ) PORT_NAME("Start Game D")
4226INPUT_PORTS_END
4227
4228/***********************************************************************/
4229
4230/* input port configuration */
4231
4232static const SNK_INPUT_PORT_TYPE athena_io[SNK_MAX_INPUT_PORTS] = {
4233   /* c000 */ SNK_INP0,
4234   /* c100 */ SNK_INP1,   SNK_UNUSED,
4235   /* c200 */ SNK_INP2,   SNK_UNUSED,
4236   /* c300 */ SNK_UNUSED,   SNK_UNUSED,
4237   /* c400 */ SNK_UNUSED,   SNK_UNUSED,
4238   /* c500 */ SNK_DSW1,   SNK_UNUSED,
4239   /* c600 */ SNK_DSW2,
4240   /* c080 */ SNK_UNUSED
4241};
4242
4243static const SNK_INPUT_PORT_TYPE ikari_io[SNK_MAX_INPUT_PORTS] = {
4244   /* c000 */ SNK_INP0,
4245   /* c100 */ SNK_ROT_PLAYER1,   SNK_UNUSED,
4246   /* c200 */ SNK_ROT_PLAYER2,   SNK_UNUSED,
4247   /* c300 */ SNK_INP3,   SNK_UNUSED,
4248   /* c400 */ SNK_UNUSED,   SNK_UNUSED,
4249   /* c500 */ SNK_DSW1,   SNK_UNUSED,
4250   /* c600 */ SNK_DSW2,
4251   /* c080 */ SNK_UNUSED
4252};
4253
4254static const SNK_INPUT_PORT_TYPE choppera_io[SNK_MAX_INPUT_PORTS] = {
4255   /* c000 */ SNK_INP0,
4256   /* c100 */ SNK_INP1,   SNK_UNUSED,
4257   /* c200 */ SNK_INP2,   SNK_UNUSED,
4258   /* c300 */ SNK_INP3,   SNK_UNUSED,
4259   /* c400 */ SNK_UNUSED,   SNK_UNUSED,
4260   /* c500 */ SNK_DSW1,   SNK_UNUSED,
4261   /* c600 */ SNK_DSW2,
4262   /* c080 */ SNK_UNUSED
4263};
4264
4265static const SNK_INPUT_PORT_TYPE fsoccer_io[SNK_MAX_INPUT_PORTS] = {
4266   /* c000 */ SNK_INP0,
4267   /* c100 */ SNK_INP1, SNK_INP2, SNK_INP3, SNK_INP4, /* joy1..joy4 */
4268   /* c300 */ SNK_INP5, SNK_INP6, SNK_INP7, SNK_INP8, /* aim1..aim4 */
4269   /* c500 */ SNK_UNUSED,
4270   /* c580 */ SNK_DSW1,   /* DSW1 */
4271   /* c600 */ SNK_DSW2,   /* DSW2 */
4272   /* c080 */ SNK_INP9      /* Start games type C & D */
4273};
4274
4275static const SNK_INPUT_PORT_TYPE tdfever_io[SNK_MAX_INPUT_PORTS] = {
4276   /* c000 */ SNK_INP0,
4277   /* c100 */ SNK_INP1, SNK_INP2, SNK_INP3, SNK_INP4, /* joy1..joy4 */
4278   /* c300 */ SNK_INP5, SNK_INP6, SNK_INP7, SNK_INP8, /* aim1..aim4 */
4279   /* c500 */ SNK_UNUSED,
4280   /* c580 */ SNK_DSW1,   /* DSW1 */
4281   /* c600 */ SNK_DSW2,   /* DSW2 */
4282   /* c080 */ SNK_INP9      /* Start games type C & D */
4283};
4284
4285static DRIVER_INIT( ikari ){
4286   UINT8 *RAM = memory_region(machine, "main");
4287   /*  Hack ROM test */
4288   RAM[0x11a6] = 0x00;
4289   RAM[0x11a7] = 0x00;
4290   RAM[0x11a8] = 0x00;
4291
4292   /* Hack Incorrect port value */
4293   RAM[0x1003] = 0xc3;
4294   RAM[0x1004] = 0x02;
4295   RAM[0x1005] = 0x10;
4296
4297   snk_sound_busy_bit = 0x01;
4298   snk_io = ikari_io;
4299   hard_flags = 1;
4300   videoram = snk_rambase + 0x800;
4301   snk_gamegroup = 1;
5116static DRIVER_INIT( countryc )
5117{
5118   // replace coin counter with trackball select
5119   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc300, 0xc300, 0, 0, countryc_trackball_w);
43025120}
43035121
4304static DRIVER_INIT( ikarijp ){
4305   UINT8 *RAM = memory_region(machine, "main");
4306   RAM[0x190b] = 0xc9; /* faster test */
43075122
4308   snk_sound_busy_bit = 0x20;
4309   snk_io = ikari_io;
4310   hard_flags = 1;
4311   videoram = snk_rambase + 0x000;
4312   snk_gamegroup = 1;
4313}
43145123
4315static DRIVER_INIT( ikarijpb ){
4316   UINT8 *RAM = memory_region(machine, "main");
4317   RAM[0x190b] = 0xc9; /* faster test */
5124GAME( 1984, jcross,   0,        jcross,   jcross,   0,        ROT270, "SNK", "Jumping Cross", 0 )
5125GAME( 1984, sgladiat, 0,        sgladiat, sgladiat, 0,        ROT0,   "SNK", "Gladiator 1984", 0 )
43185126
4319   snk_sound_busy_bit = 0x20;
4320   snk_io = ikari_io;
4321   hard_flags = 1;
4322   videoram = snk_rambase + 0x000;
4323   snk_gamegroup = 1;
4324}
5127GAME( 1985, aso,      0,        aso,      aso,      0,        ROT270, "SNK", "ASO - Armored Scrum Object", 0 )
5128GAME( 1985, alphamis, aso,      aso,      aso,      0,        ROT270, "SNK", "Alpha Mission", 0 )
5129GAME( 1985, arian,    aso,      aso,      aso,      0,        ROT270, "SNK", "Arian Mission", 0 )
5130GAME( 1985, tnk3,     0,        tnk3,     tnk3,     0,        ROT270, "SNK", "T.N.K III (US)", 0 )
5131GAME( 1985, tnk3j,    tnk3,     tnk3,     tnk3,     0,        ROT270, "SNK", "T.A.N.K (Japan)", 0 )
5132GAME( 1986, athena,   0,        athena,   athena,   0,        ROT0,   "SNK", "Athena", 0 )
5133GAME( 1988, fitegolf, 0,        fitegolf, fitegolf, 0,        ROT0,   "SNK", "Fighting Golf (World?)", 0 )
5134GAME( 1988, fitegol2, fitegolf, fitegolf, fitegolf, 0,        ROT0,   "SNK", "Fighting Golf (US)", 0 )
5135GAME( 1988, countryc, 0,        fitegolf, countryc, countryc, ROT0,   "SNK", "Country Club", 0 )
43255136
4326static DRIVER_INIT( victroad ){
4327   UINT8 *RAM = memory_region(machine, "main");
4328   /* Hack ROM test */
4329   RAM[0x17bd] = 0x00;
4330   RAM[0x17be] = 0x00;
4331   RAM[0x17bf] = 0x00;
5137GAME( 1986, ikari,    0,        ikari,    ikari,    0,        ROT270, "SNK", "Ikari Warriors (US JAMMA)", 0 )
5138GAME( 1986, ikaria,   ikari,    ikari,    ikarijp,  0,        ROT270, "SNK", "Ikari Warriors (US)", 0 )
5139GAME( 1986, ikarijp,  ikari,    ikari,    ikarijp,  0,        ROT270, "SNK", "Ikari (Japan)", 0 )
5140GAME( 1986, ikarijpb, ikari,    ikari,    ikarijpb, 0,        ROT270, "bootleg", "Ikari (Joystick hack bootleg)", 0 )
5141GAME( 1986, victroad, 0,        victroad, victroad, 0,        ROT270, "SNK", "Victory Road", 0 )
5142GAME( 1986, dogosoke, victroad, victroad, victroad, 0,        ROT270, "SNK", "Dogou Souken", 0 )
5143GAME( 1986, dogosokb, victroad, victroad, dogosokb, 0,        ROT270, "bootleg", "Dogou Souken (Joystick hack bootleg)", 0 )
43325144
4333   /* Hack Incorrect port value */
4334   RAM[0x161a] = 0xc3;
4335   RAM[0x161b] = 0x19;
4336   RAM[0x161c] = 0x16;
5145GAME( 1987, bermudat, 0,        bermudat, bermudat, 0,        ROT270, "SNK", "Bermuda Triangle (World?)", 0 )
5146GAME( 1987, bermudaj, bermudat, bermudat, bermudat, 0,        ROT270, "SNK", "Bermuda Triangle (Japan)", 0 )
5147GAME( 1987, worldwar, 0,        bermudat, worldwar, 0,        ROT270, "SNK", "World Wars (World?)", 0 )
5148GAME( 1987, bermudaa, worldwar, bermudat, bermudaa, 0,        ROT270, "SNK", "Bermuda Triangle (World Wars) (US)", 0 )
5149GAME( 1987, psychos,  0,        bermudat, psychos,  0,        ROT0,   "SNK", "Psycho Soldier (US)", 0 )
5150GAME( 1987, psychosj, psychos,  bermudat, psychos,  0,        ROT0,   "SNK", "Psycho Soldier (Japan)", 0 )
5151GAME( 1987, gwar,     0,        gwar,     gwar,     0,        ROT270, "SNK", "Guerrilla War (US)", 0 )
5152GAME( 1987, gwarj,    gwar,     gwar,     gwar,     0,        ROT270, "SNK", "Guevara (Japan)", 0 )
5153GAME( 1987, gwara,    gwar,     gwara,    gwar,     0,        ROT270, "SNK", "Guerrilla War (Version 1)", 0 )
5154GAME( 1987, gwarb,    gwar,     gwar,     gwar,     0,        ROT270, "bootleg", "Guerrilla War (bootleg)", 0 )
5155GAME( 1988, chopper,  0,        chopper1, chopper,  0,        ROT270, "SNK", "Chopper I (US set 1)", 0 )
5156GAME( 1988, choppera, chopper,  choppera, choppera, 0,        ROT270, "SNK", "Chopper I (US set 2)", 0 )
5157GAME( 1988, chopperb, chopper,  chopper1, chopper,  0,        ROT270, "SNK", "Chopper I (US set 3)", 0 )
5158GAME( 1988, legofair, chopper,  chopper1, chopper,  0,        ROT270, "SNK", "Koukuu Kihei Monogatari - The Legend of Air Cavalry (Japan)", 0 )
43375159
4338   snk_sound_busy_bit = 0x01;
4339   snk_io = ikari_io;
4340   hard_flags = 1;
4341   videoram = snk_rambase + 0x800;
4342   snk_gamegroup = 1;
4343}
4344
4345static DRIVER_INIT( dogosoke ){
4346   UINT8 *RAM = memory_region(machine, "main");
4347   /* Hack ROM test */
4348   RAM[0x179f] = 0x00;
4349   RAM[0x17a0] = 0x00;
4350   RAM[0x17a1] = 0x00;
4351
4352   /* Hack Incorrect port value */
4353   RAM[0x15fc] = 0xc3;
4354   RAM[0x15fd] = 0xfb;
4355   RAM[0x15fe] = 0x15;
4356
4357   snk_sound_busy_bit = 0x01;
4358   snk_io = ikari_io;
4359   hard_flags = 1;
4360   videoram = snk_rambase + 0x800;
4361   snk_gamegroup = 1;
4362}
4363
4364static DRIVER_INIT( gwar ){
4365   snk_sound_busy_bit = 0x01;
4366   snk_io = ikari_io;
4367   hard_flags = 0;
4368   videoram = snk_rambase + 0x800;
4369   snk_gamegroup = 2;
4370   use_input_cp_hack = 1;
4371}
4372
4373static DRIVER_INIT( gwara ){
4374   snk_sound_busy_bit = 0x01;
4375   snk_io = ikari_io;
4376   hard_flags = 0;
4377   videoram = snk_rambase + 0x800;
4378   snk_gamegroup = 4;
4379   use_input_cp_hack = 1;
4380}
4381
4382static DRIVER_INIT( chopper ){
4383   snk_sound_busy_bit = 0x01;
4384   snk_io = athena_io;
4385   hard_flags = 0;
4386   videoram = snk_rambase + 0x800;
4387   snk_gamegroup = 0;
4388}
4389
4390static DRIVER_INIT( choppera ){
4391   snk_sound_busy_bit = 0x01;
4392   snk_io = choppera_io;
4393   hard_flags = 0;
4394   videoram = snk_rambase + 0x800;
4395   snk_gamegroup = 2;
4396}
4397
4398static DRIVER_INIT( bermudat ){
4399   UINT8 *RAM = memory_region(machine, "main");
4400
4401   // Patch "Turbo Error"
4402   RAM[0x127e] = 0xc9;
4403   RAM[0x118d] = 0x00;
4404   RAM[0x118e] = 0x00;
4405
4406   snk_sound_busy_bit = 0x01;
4407   snk_io = ikari_io;
4408   hard_flags = 0;
4409   videoram = snk_rambase + 0x800;
4410   snk_gamegroup = 0;
4411}
4412
4413static DRIVER_INIT( worldwar ){
4414   snk_sound_busy_bit = 0x01;
4415   snk_io = ikari_io;
4416   hard_flags = 0;
4417   videoram = snk_rambase + 0x800;
4418   snk_gamegroup = 0;
4419}
4420
4421static DRIVER_INIT( tdfever ){
4422   snk_sound_busy_bit = 0x08;
4423   snk_io = tdfever_io;
4424   hard_flags = 0;
4425   videoram = snk_rambase + 0x800;
4426   snk_gamegroup = (!strcmp(machine->gamedrv->name,"tdfeverj")) ? 5 : 3;
4427   snk_irq_delay = 1000;
4428}
4429
4430static DRIVER_INIT( tdfever2 ){
4431   snk_sound_busy_bit = 0x08;
4432   snk_io = tdfever_io;
4433   hard_flags = 0;
4434   videoram = snk_rambase + 0x800;
4435   snk_gamegroup = (!strcmp(machine->gamedrv->name,"tdfeverj")) ? 5 : 3;
4436   snk_irq_delay = 1000;
4437}
4438
4439static DRIVER_INIT( fsoccer ){
4440   snk_sound_busy_bit = 0x08;
4441   snk_io = fsoccer_io;
4442   hard_flags = 0;
4443   videoram = snk_rambase + 0x800;
4444   snk_gamegroup = 7;
4445}
4446
4447static DRIVER_INIT( tnk3 ){
4448   snk_sound_busy_bit = 0x20;
4449   snk_io = ikari_io;
4450   hard_flags = 0;
4451   videoram = snk_rambase + 0x800;
4452   snk_gamegroup = 1;
4453}
4454
4455static DRIVER_INIT( athena ){
4456   snk_sound_busy_bit = 0x01;
4457   snk_io = athena_io;
4458   hard_flags = 0;
4459   videoram = snk_rambase + 0x800;
4460   snk_gamegroup = 1;
4461}
4462
4463static DRIVER_INIT( fitegolf ){
4464   snk_sound_busy_bit = 0x01;
4465   snk_io = athena_io;
4466   hard_flags = 0;
4467   videoram = snk_rambase + 0x800;
4468   snk_gamegroup = 1;
4469}
4470
4471static DRIVER_INIT( psychos ){
4472   snk_sound_busy_bit = 0x01;
4473   snk_io = athena_io;
4474   hard_flags = 0;
4475   videoram = snk_rambase + 0x800;
4476   snk_gamegroup = 0;
4477}
4478
4479/*          rom       parent    machine   inp       init */
4480GAME( 1985, tnk3,     0,        tnk3,     tnk3,     tnk3,     ROT270, "SNK", "T.N.K. III (US)", GAME_NO_COCKTAIL )
4481GAME( 1985, tnk3j,    tnk3,     tnk3,     tnk3,     tnk3,     ROT270, "SNK", "T.A.N.K. (Japan)", GAME_NO_COCKTAIL )
4482GAME( 1986, athena,   0,        athena,   athena,   athena,   ROT0,   "SNK", "Athena", GAME_NO_COCKTAIL )
4483GAME( 1988, fitegolf, 0,        athena,   fitegolf, fitegolf, ROT0,   "SNK", "Fighting Golf (World?)", GAME_NO_COCKTAIL )
4484GAME( 1988, fitegol2, fitegolf, athena,   fitegolf, fitegolf, ROT0,   "SNK", "Fighting Golf (US)", GAME_NO_COCKTAIL )
4485GAME( 1988, countryc, fitegolf, athena,   countryc, fitegolf, ROT0,   "SNK", "Country Club", GAME_NO_COCKTAIL )
4486GAME( 1986, ikari,    0,        ikari,    ikari,    ikari,    ROT270, "SNK", "Ikari Warriors (US)", GAME_NO_COCKTAIL )
4487GAME( 1986, ikarijp,  ikari,    ikari,    ikarijp,  ikarijp,  ROT270, "SNK", "Ikari (Japan)", GAME_NO_COCKTAIL )
4488GAME( 1986, ikarijpb, ikari,    ikari,    ikarijpb, ikarijpb, ROT270, "bootleg", "Ikari (Japan bootleg)", GAME_NO_COCKTAIL )
4489GAME( 1986, victroad, 0,        victroad, victroad, victroad, ROT270, "SNK", "Victory Road", GAME_NO_COCKTAIL )
4490GAME( 1986, dogosoke, victroad, victroad, victroad, dogosoke, ROT270, "SNK", "Dogou Souken", GAME_NO_COCKTAIL )
4491GAME( 1986, dogosokj, victroad, victroad, dogosokj, dogosoke, ROT270, "bootleg", "Dogou Souken (Joystick hack bootleg)", GAME_NO_COCKTAIL )
4492GAME( 1987, gwar,     0,        gwar,     gwar,     gwar,     ROT270, "SNK", "Guerrilla War (US)", GAME_NO_COCKTAIL )
4493GAME( 1987, gwarj,    gwar,     gwar,     gwar,     gwar,     ROT270, "SNK", "Guevara (Japan)", GAME_NO_COCKTAIL )
4494GAME( 1987, gwara,    gwar,     gwar,     gwar,     gwara,    ROT270, "SNK", "Guerrilla War (Version 1)", GAME_NO_COCKTAIL )
4495GAME( 1987, gwarb,    gwar,     gwar,     gwar,     gwar,     ROT270, "bootleg", "Guerrilla War (bootleg)", GAME_NO_COCKTAIL )
4496GAME( 1987, bermudat, 0,        bermudat, bermudat, bermudat, ROT270, "SNK", "Bermuda Triangle (Japan)", GAME_NO_COCKTAIL )
4497GAME( 1987, bermudao, bermudat, bermudat, bermudat, bermudat, ROT270, "SNK", "Bermuda Triangle (Japan old version)", GAME_NO_COCKTAIL )
4498GAME( 1987, bermudaa, bermudat, bermudat, bermudaa, worldwar, ROT270, "SNK", "Bermuda Triangle (US older version)", GAME_NO_COCKTAIL )
4499GAME( 1987, worldwar, bermudat, bermudat, worldwar, worldwar, ROT270, "SNK", "World Wars (World)", GAME_NO_COCKTAIL )
4500GAME( 1987, psychos,  0,        psychos,  psychos,  psychos,  ROT0,   "SNK", "Psycho Soldier (US)", GAME_NO_COCKTAIL )
4501GAME( 1987, psychosj, psychos,  psychos,  psychos,  psychos,  ROT0,   "SNK", "Psycho Soldier (Japan)", GAME_NO_COCKTAIL )
4502GAME( 1988, chopper,  0,        chopper1, legofair, chopper,  ROT270, "SNK", "Chopper I (US set 1)", GAME_NO_COCKTAIL )
4503GAME( 1988, choppera, chopper,  chopper1, choppera, choppera, ROT270, "SNK", "Chopper I (US set 2)", GAME_NO_COCKTAIL )
4504GAME( 1988, chopperb, chopper,  chopper1, legofair, chopper,  ROT270, "SNK", "Chopper I (US set 3)", GAME_NO_COCKTAIL )
4505GAME( 1988, legofair, chopper,  chopper1, legofair, chopper,  ROT270, "SNK", "Koukuu Kihei Monogatari - The Legend of Air Cavalry (Japan)", GAME_NO_COCKTAIL )
4506GAME( 1987, tdfever,  0,        tdfever,  tdfever,  tdfever,  ROT270, "SNK", "TouchDown Fever", GAME_NO_COCKTAIL )
4507GAME( 1987, tdfeverj, tdfever,  tdfever,  tdfeverj, tdfever, ROT270, "SNK", "TouchDown Fever (Japan)", GAME_NO_COCKTAIL )
4508GAME( 1988, tdfever2, tdfever,  tdfever2, tdfever,  tdfever2, ROT270, "SNK", "TouchDown Fever 2", GAME_NO_COCKTAIL ) /* upgrade kit for Touchdown Fever */
4509GAME( 1988, fsoccer,  0,        fsoccer,  fsoccer,  fsoccer,  ROT0,   "SNK", "Fighting Soccer (version 4)", GAME_NO_COCKTAIL )
4510GAME( 1988, fsoccerj, fsoccer,  fsoccer,  fsoccer,  fsoccer,  ROT0,   "SNK", "Fighting Soccer (Japan)", GAME_NO_COCKTAIL )
4511GAME( 1988, fsoccerb, fsoccer,  fsoccer,  fsoccer,  fsoccer,  ROT0,   "bootleg", "Fighting Soccer (joystick hack bootleg)", GAME_NO_COCKTAIL )
4512
5160GAME( 1987, tdfever,  0,        tdfever,  tdfever,  0,        ROT90,  "SNK", "TouchDown Fever (US?)", 0 )
5161GAME( 1987, tdfeverj, tdfever,  tdfever,  tdfever,  0,        ROT90,  "SNK", "TouchDown Fever (Japan)", 0 )
5162GAME( 1988, tdfever2, tdfever,  tdfever2, tdfever,  0,        ROT90,  "SNK", "TouchDown Fever 2", 0 ) /* upgrade kit for Touchdown Fever */
5163GAME( 1988, fsoccer,  0,        tdfever2, fsoccer,  0,        ROT0,   "SNK", "Fighting Soccer (version 4)", 0 )
5164GAME( 1988, fsoccerj, fsoccer,  tdfever2, fsoccer,  0,        ROT0,   "SNK", "Fighting Soccer (Japan)", 0 )
5165GAME( 1988, fsoccerb, fsoccer,  tdfever2, fsoccerb, 0,        ROT0,   "bootleg", "Fighting Soccer (joystick hack bootleg)", 0 )
src/mame/drivers/arcadecl.c
r3115r3116
8383
8484static void update_interrupts(running_machine *machine)
8585{
86   int newstate = 0;
87
88   if (atarigen_scanline_int_state)
89      newstate = 4;
90
91   if (newstate)
92      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
93   else
94      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
86   cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
9587}
9688
9789
src/mame/drivers/namconb1.c
r3115r3116
1212Main CPU : Motorola 68020 32-bit processor @ 25MHz
1313Secondary CPUs : C329 + 137 (both custom)
1414Custom Graphics Chips : GFX:123,145,156,C116 - Motion Objects:C355,187,C347
15Sound CPU : C351 (custom)
15Sound CPU : C75 (custom)
1616PCM Sound chip : C352 (custom)
1717I/O Chip : 160 (custom)
1818Board composition : Single board
r3115r3116
5252                  - 137  custom PLD       (28 pin NDIP)
5353                  - C366 Key Custom
5454
55Sound processor   - C351 custom           (160 pin PQFP)
55Sound processor   - C75 custom
5656 (PCM)            - C352 custom           (100 pin PQFP)
5757 (control inputs) - 160  custom           (80 pin PQFP)
5858
r3115r3116
161161                  - 137  custom PLD       (28 pin NDIP)
162162                  - C366 Key Custom
163163
164Sound processor   - C351 custom           (160 pin PQFP)
164Sound processor   - C75 custom
165165 (PCM)            - C352 custom           (100 pin PQFP)
166166 (control inputs) - 160  custom           (80 pin PQFP)
167167
r3115r3116
285285
286286/****************************************************************************/
287287
288static UINT32 *namconb_cpureg32;
288static UINT8 namconb_cpureg[32];
289static int vblank_irq_active, pos_irq_active;
289290
290static int
291GetCPURegister(int which)
291static TIMER_CALLBACK( namconb1_TriggerPOSIRQ )
292292{
293   return (namconb_cpureg32[which/4]<<((which&3)*8))>>24;
294}
293   if(pos_irq_active || !(namconb_cpureg[0x02] & 0xf0))
294      return;
295295
296static TIMER_CALLBACK( namconb1_TriggerPOSIRQ )
297{
298   int irqlevel = GetCPURegister(0x04)>>4;
299296   video_screen_update_partial(machine->primary_screen, param);
300   cpunum_set_input_line(machine, 0, irqlevel, PULSE_LINE);
297   pos_irq_active = 1;
298   cpunum_set_input_line(machine, 0, namconb_cpureg[0x02] & 0xf, ASSERT_LINE);
301299}
302300
303static TIMER_CALLBACK( namconb2_TriggerPOSIRQ )
304{
305   int irqlevel = GetCPURegister(0x02);
306   video_screen_update_partial(machine->primary_screen, param);
307   cpunum_set_input_line(machine, 0, irqlevel, PULSE_LINE);
308} /* namconb2_TriggerPOSIRQ */
309
310static INTERRUPT_GEN( namconb2_interrupt )
311{
312   /**
313     * f00000 0x01 // VBLANK irq level
314     * f00001 0x00
315     * f00002 0x05 // POSIRQ level
316     * f00003 0x00
317     *
318     * f00004 VBLANK ack
319     * f00005
320     * f00006 POSIRQ ack
321     * f00007
322     *
323     * f00008
324     *
325     * f00009 0x62
326     * f0000a 0x0f
327     * f0000b 0x41
328     * f0000c 0x70
329     * f0000d 0x70
330     * f0000e 0x23
331     * f0000f 0x50
332     * f00010 0x00
333     * f00011 0x64
334     * f00012 0x18
335     * f00013 0xe7
336     * f00014 (watchdog)
337     * f00016 0x00
338     * f0001e 0x00
339     * f0001f 0x01
340     */
341   int scanline = (paletteram32[0x1808/4]&0xffff)-32;
342   int irqlevel = GetCPURegister(0x00);
343   cpunum_set_input_line(machine, 0, irqlevel, HOLD_LINE);
344
345   if( scanline<0 )
346      scanline = 0;
347
348   if( scanline < NAMCONB1_VBSTART )
349      timer_set( video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), NULL, scanline, namconb2_TriggerPOSIRQ );
350} /* namconb2_interrupt */
351301static INTERRUPT_GEN( namconb1_interrupt )
352302{
353303   /**
r3115r3116
385335     * 40001f 0x00
386336     */
387337   int scanline = (paletteram32[0x1808/4]&0xffff)-32;
388   int irqlevel = GetCPURegister(0x04)&0xf;
389   cpunum_set_input_line(machine, 0, irqlevel, HOLD_LINE);
338
339   if((!vblank_irq_active) && (namconb_cpureg[0x04] & 0xf0)) {
340      cpunum_set_input_line(machine, 0, namconb_cpureg[0x04] & 0xf, ASSERT_LINE);
341      vblank_irq_active = 1;
342   }
343
390344   if( scanline<0 )
391345   {
392346      scanline = 0;
r3115r3116
397351   }
398352} /* namconb1_interrupt */
399353
400static WRITE32_HANDLER( namconb_cpureg_w )
354
355static TIMER_CALLBACK( namconb2_TriggerPOSIRQ )
401356{
402   COMBINE_DATA( &namconb_cpureg32[offset] );
403} /* namconb_cpureg_w */
357   video_screen_update_partial(machine->primary_screen, param);
358   pos_irq_active = 1;
359   cpunum_set_input_line(machine, 0, namconb_cpureg[0x02], ASSERT_LINE);
360}
404361
362static INTERRUPT_GEN( namconb2_interrupt )
363{
364   /**
365     * f00000 0x01 // VBLANK irq level
366     * f00001 0x00
367     * f00002 0x05 // POSIRQ level
368     * f00003 0x00
369     *
370     * f00004 VBLANK ack
371     * f00005
372     * f00006 POSIRQ ack
373     * f00007
374     *
375     * f00008
376     *
377     * f00009 0x62
378     * f0000a 0x0f
379     * f0000b 0x41
380     * f0000c 0x70
381     * f0000d 0x70
382     * f0000e 0x23
383     * f0000f 0x50
384     * f00010 0x00
385     * f00011 0x64
386     * f00012 0x18
387     * f00013 0xe7
388     * f00014 (watchdog)
389     * f00016 0x00
390     * f0001e 0x00
391     * f0001f 0x01
392     */
393   int scanline = (paletteram32[0x1808/4]&0xffff)-32;
394
395   if((!vblank_irq_active) && namconb_cpureg[0x00]) {
396      cpunum_set_input_line(machine, 0, namconb_cpureg[0x00], ASSERT_LINE);
397      vblank_irq_active = 1;
398   }
399
400   if( scanline<0 )
401      scanline = 0;
402
403   if( scanline < NAMCONB1_VBSTART )
404      timer_set( video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), NULL, scanline, namconb2_TriggerPOSIRQ );
405} /* namconb2_interrupt */
406
407static void namconb1_cpureg8_w(running_machine *machine, int reg, UINT8 data)
408{
409   UINT8 prev = namconb_cpureg[reg];
410   namconb_cpureg[reg] = data;
411   switch(reg) {
412   case 0x02: // POS IRQ level/enable
413      if(pos_irq_active && (((prev & 0xf) != (data & 0xf)) || !(data & 0xf0))) {
414         cpunum_set_input_line(machine, 0, prev & 0xf, CLEAR_LINE);
415         if(data & 0xf0)
416            cpunum_set_input_line(machine, 0, data & 0xf, ASSERT_LINE);
417         else
418            pos_irq_active = 0;
419      }
420      break;
421
422   case 0x04: // VBLANK IRQ level/enable
423      if(vblank_irq_active && (((prev & 0xf) != (data & 0xf)) || !(data & 0xf0))) {
424         cpunum_set_input_line(machine, 0, prev & 0xf, CLEAR_LINE);
425         if(data & 0xf0)
426            cpunum_set_input_line(machine, 0, data & 0xf, ASSERT_LINE);
427         else
428            vblank_irq_active = 0;
429      }
430      break;
431
432   case 0x07: // POS ack
433      if(pos_irq_active) {
434         cpunum_set_input_line(machine, 0, namconb_cpureg[0x02] & 0xf, CLEAR_LINE);
435         pos_irq_active = 0;
436      }
437      break;
438
439   case 0x09: // VBLANK ack
440      if(vblank_irq_active) {
441         cpunum_set_input_line(machine, 0, namconb_cpureg[0x04] & 0xf, CLEAR_LINE);
442         vblank_irq_active = 0;
443      }
444      break;
445
446   case 0x16: // Watchdog
447      break;
448
449   case 0x18: // C75 Control
450      if(data & 1) {
451         cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
452         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
453         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
454      } else
455         cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
456      break;
457   }
458}
459
460static WRITE32_HANDLER( namconb1_cpureg_w )
461{
462   if(mem_mask & 0xff000000)
463      namconb1_cpureg8_w(machine, offset*4, data >> 24);
464   if(mem_mask & 0x00ff0000)
465      namconb1_cpureg8_w(machine, offset*4+1, data >> 16);
466   if(mem_mask & 0x0000ff00)
467      namconb1_cpureg8_w(machine, offset*4+2, data >> 8);
468   if(mem_mask & 0x000000ff)
469      namconb1_cpureg8_w(machine, offset*4+3, data);
470}
471
472
473static void namconb2_cpureg8_w(running_machine *machine, int reg, UINT8 data)
474{
475   UINT8 prev = namconb_cpureg[reg];
476   namconb_cpureg[reg] = data;
477   switch(reg) {
478   case 0x00: // VBLANK IRQ level
479      if(vblank_irq_active && (prev != data)) {
480         cpunum_set_input_line(machine, 0, prev, CLEAR_LINE);
481         if(data)
482            cpunum_set_input_line(machine, 0, data, ASSERT_LINE);
483         else
484            vblank_irq_active = 0;
485      }
486      break;
487
488   case 0x02: // POS IRQ level
489      if(pos_irq_active && (prev != data)) {
490         cpunum_set_input_line(machine, 0, prev, CLEAR_LINE);
491         if(data)
492            cpunum_set_input_line(machine, 0, data, ASSERT_LINE);
493         else
494            pos_irq_active = 0;
495      }
496      break;
497
498   case 0x04: // VBLANK ack
499      if(vblank_irq_active) {
500         cpunum_set_input_line(machine, 0, namconb_cpureg[0x00], CLEAR_LINE);
501         vblank_irq_active = 0;
502      }
503      break;
504
505   case 0x06: // POS ack
506      if(pos_irq_active) {
507         cpunum_set_input_line(machine, 0, namconb_cpureg[0x02], CLEAR_LINE);
508         pos_irq_active = 0;
509      }
510      break;
511
512   case 0x14: // Watchdog
513      break;
514
515   case 0x16: // C75 Control
516      if(data & 1) {
517         cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
518         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
519         cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
520      } else {
521         cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
522      }
523      break;
524   }
525}
526
527static WRITE32_HANDLER( namconb2_cpureg_w )
528{
529   if(mem_mask & 0xff000000)
530      namconb2_cpureg8_w(machine, offset*4, data >> 24);
531   if(mem_mask & 0x00ff0000)
532      namconb2_cpureg8_w(machine, offset*4+1, data >> 16);
533   if(mem_mask & 0x0000ff00)
534      namconb2_cpureg8_w(machine, offset*4+2, data >> 8);
535   if(mem_mask & 0x000000ff)
536      namconb2_cpureg8_w(machine, offset*4+3, data);
537}
538
539static READ32_HANDLER(namconb_cpureg_r)
540{
541   return (namconb_cpureg[offset*4] << 24) | (namconb_cpureg[offset*4+1] << 16)
542      | (namconb_cpureg[offset*4+2] << 8) | namconb_cpureg[offset*4+3];
543}
544
545
405546/****************************************************************************/
406547
407548static NVRAM_HANDLER( namconb1 )
r3115r3116
441582   }
442583} /* namconb1 */
443584
585static MACHINE_START(namconb)
586{
587   vblank_irq_active = 0;
588   pos_irq_active = 0;
589   memset(namconb_cpureg, 0, sizeof(namconb_cpureg));
590}
591
444592static DRIVER_INIT( nebulray )
445593{
446594   UINT8 *pMem = (UINT8 *)memory_region(machine, NAMCONB1_TILEMASKREGION);
r3115r3116
669817     */
670818} /* srand_w */
671819
672static WRITE32_HANDLER( sharedram_w )
673{
674   if (offset < 0xb0)
675   {
676      if (mem_mask == 0xffff0000)
677      {
678         namcoc7x_sound_write16((data>>16), offset*2);
679      }
680      else if (mem_mask == 0x0000ffff)
681      {
682         namcoc7x_sound_write16((data&0xffff), (offset*2)+1);
683      }
684   }
685
686   COMBINE_DATA(&namconb1_workram32[offset]);
687}
688
689820static ADDRESS_MAP_START( namconb1_am, ADDRESS_SPACE_PROGRAM, 32 )
690821   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM) AM_WRITE(SMH_ROM)
691822   AM_RANGE(0x100000, 0x10001f) AM_READ(gunbulet_gun_r)
692823   AM_RANGE(0x1c0000, 0x1cffff) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM)
693824   AM_RANGE(0x1e4000, 0x1e4003) AM_READWRITE(randgen_r,srand_w)
694   AM_RANGE(0x200000, 0x2fffff) AM_READ(SMH_RAM) AM_WRITE(sharedram_w) AM_BASE(&namconb1_workram32) /* shared with MCU) */
695   AM_RANGE(0x400000, 0x40001f) AM_READ(SMH_RAM) AM_WRITE(namconb_cpureg_w) AM_BASE(&namconb_cpureg32)
825   AM_RANGE(0x200000, 0x207fff) AM_READWRITE(namcoc7x_soundram32_r, namcoc7x_soundram32_w)
826   AM_RANGE(0x208000, 0x2fffff) AM_RAM
827   AM_RANGE(0x400000, 0x40001f) AM_READWRITE(namconb_cpureg_r, namconb1_cpureg_w)
696828   AM_RANGE(0x580000, 0x5807ff) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM) AM_BASE(&nvmem32)
697829   AM_RANGE(0x600000, 0x61ffff) AM_READWRITE(namco_obj32_r,namco_obj32_w)
698830   AM_RANGE(0x620000, 0x620007) AM_READWRITE(namco_spritepos32_r,namco_spritepos32_w)
r3115r3116
707839   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM) AM_WRITE(SMH_ROM)
708840   AM_RANGE(0x1c0000, 0x1cffff) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM)
709841   AM_RANGE(0x1e4000, 0x1e4003) AM_READWRITE(randgen_r,srand_w)
710   AM_RANGE(0x200000, 0x2fffff) AM_READ(SMH_RAM) AM_WRITE(sharedram_w) AM_BASE(&namconb1_workram32) /* shared with MCU */
711   AM_RANGE(0x400000, 0x4fffff) AM_ROM AM_REGION("user1", 0)
842   AM_RANGE(0x200000, 0x207fff) AM_READWRITE(namcoc7x_soundram32_r, namcoc7x_soundram32_w)
843   AM_RANGE(0x208000, 0x2fffff) AM_RAM
844   AM_RANGE(0x400000, 0x4fffff) AM_ROM AM_REGION("data", 0)
712845   AM_RANGE(0x600000, 0x61ffff) AM_READWRITE(namco_obj32_r,namco_obj32_w)
713846   AM_RANGE(0x620000, 0x620007) AM_READWRITE(namco_spritepos32_r,namco_spritepos32_w)
714847   AM_RANGE(0x640000, 0x64000f) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM) /* unknown xy offset */
r3115r3116
722855   AM_RANGE(0x980000, 0x98000f) AM_READ(namco_rozbank32_r) AM_WRITE(namco_rozbank32_w)
723856   AM_RANGE(0xa00000, 0xa007ff) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM) AM_BASE(&nvmem32)
724857   AM_RANGE(0xc00000, 0xc0001f) AM_READ(custom_key_r) AM_WRITE(SMH_NOP)
725   AM_RANGE(0xf00000, 0xf0001f) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM) AM_BASE(&namconb_cpureg32)
858   AM_RANGE(0xf00000, 0xf0001f) AM_READWRITE(namconb_cpureg_r, namconb2_cpureg_w)
726859ADDRESS_MAP_END /* namconb2_readmem */
727860
728861#define MASTER_CLOCK_HZ 48384000
r3115r3116
735868   NAMCO_C7X_MCU(MASTER_CLOCK_HZ/3)
736869
737870   MDRV_NVRAM_HANDLER(namconb1)
871   MDRV_MACHINE_START(namconb)
738872   MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
739873
740874   MDRV_SCREEN_ADD("main", RASTER)
r3115r3116
759893   NAMCO_C7X_MCU(MASTER_CLOCK_HZ/3)
760894
761895   MDRV_NVRAM_HANDLER(namconb1)
896   MDRV_MACHINE_START(namconb)
762897   MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
763898
764899   MDRV_SCREEN_ADD("main", RASTER)
r3115r3116
782917   ROM_LOAD32_WORD( "gn2mprlb.15b", 0x00002, 0x80000, CRC(fe2d9425) SHA1(51b166a629cbb522720d63720558816b496b6b76) )
783918   ROM_LOAD32_WORD( "gn2mprub.13b", 0x00000, 0x80000, CRC(3bf4985a) SHA1(f559e0d5f55d23d886fe61bd7d5ca556acc7f87c) )
784919
785   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
920   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
786921   ROM_LOAD( "gn1-spr0.bin", 0, 0x20000, CRC(6836ba38) SHA1(6ea17ea4bbb59be108e8887acd7871409580732f) )
787922   NAMCO_C7X_BIOS
788923
r3115r3116
810945   ROM_LOAD32_WORD( "gn1-mprl.bin", 0x00002, 0x80000, CRC(f99e309e) SHA1(3fe0ddf756e6849f8effc7672456cbe32f65c98a) )
811946   ROM_LOAD32_WORD( "gn1-mpru.bin", 0x00000, 0x80000, CRC(72a4db07) SHA1(8c5e1e51cd961b311d03f7b21f36a5bd5e8e9104) )
812947
813   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
948   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
814949   ROM_LOAD( "gn1-spr0.bin", 0, 0x20000, CRC(6836ba38) SHA1(6ea17ea4bbb59be108e8887acd7871409580732f) )
815950   NAMCO_C7X_BIOS
816951
r3115r3116
838973   ROM_LOAD32_WORD( "nr2-mpru.13b", 0x00000, 0x80000, CRC(049b97cb) SHA1(0e344b29a4d4bdc854fa9849589772df2eeb0a05) )
839974   ROM_LOAD32_WORD( "nr2-mprl.15b", 0x00002, 0x80000, CRC(0431b6d4) SHA1(54c96e8ac9e753956c31bdef79d390f1c20e10ff) )
840975
841   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
976   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
842977   ROM_LOAD( "nr1-spr0", 0, 0x20000, CRC(1cc2b44b) SHA1(161f4ed39fabe89d7ee1d539f8b9f08cd0ff3111) )
843978   NAMCO_C7X_BIOS
844979
r3115r3116
8731008   ROM_LOAD32_WORD( "nr1-mpru", 0x00000, 0x80000, CRC(42ef71f9) SHA1(20e3cb63e1fde293c60c404b378d901d635c4b79) )
8741009   ROM_LOAD32_WORD( "nr1-mprl", 0x00002, 0x80000, CRC(fae5f62c) SHA1(143d716abbc834aac6270db3bbb89ec71ea3804d) )
8751010
876   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1011   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
8771012   ROM_LOAD( "nr1-spr0", 0, 0x20000, CRC(1cc2b44b) SHA1(161f4ed39fabe89d7ee1d539f8b9f08cd0ff3111) )
8781013   NAMCO_C7X_BIOS
8791014
r3115r3116
9081043   ROM_LOAD32_WORD( "gse2mprl.bin", 0x00002, 0x80000, CRC(a514349c) SHA1(1f7ec81cd6193410d2f01e6f0f84878561fc8035) )
9091044   ROM_LOAD32_WORD( "gse2mpru.bin", 0x00000, 0x80000, CRC(b6afd238) SHA1(438a3411ac8ce3d22d5da8c0800738cb8d2994a9) )
9101045
911   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1046   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
9121047   ROM_LOAD( "gse2spr0.bin", 0, 0x20000, CRC(17e87cfc) SHA1(9cbeadb6dfcb736e8c80eab344f70fc2f58469d6) )
9131048   NAMCO_C7X_BIOS
9141049
r3115r3116
10601195   ROM_LOAD32_WORD( "gs1mprl.15b", 0x00002, 0x80000, CRC(1e6c3626) SHA1(56abe21884fd87df10996db19c49ce14214d4b73) )
10611196   ROM_LOAD32_WORD( "gs1mpru.13b", 0x00000, 0x80000, CRC(ef355179) SHA1(0ab0ef4301a318681bb5827d35734a0732b35484) )
10621197
1063   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1198   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
10641199   ROM_LOAD( "gs1spr0.5b", 0, 0x80000, CRC(561ea20f) SHA1(adac6b77effc3a82079a9b228bafca0fcef72ba5) )
10651200   NAMCO_C7X_BIOS
10661201
r3115r3116
10861221   ROM_LOAD32_WORD( "ss51mprl.bin", 0x00002, 0x80000, CRC(c9e0107d) SHA1(0f10582416023a86ea1ef2679f3f06016c086e08) )
10871222   ROM_LOAD32_WORD( "ss51mpru.bin", 0x00000, 0x80000, CRC(0d93d261) SHA1(5edef26e2c86dbc09727d910af92747d022e4fed) )
10881223
1089   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1224   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
10901225   ROM_LOAD( "ss51spr0.bin", 0, 0x80000, CRC(71cb12f5) SHA1(6e13bd16a5ba14d6e47a21875db3663ada3c06a5) )
10911226   NAMCO_C7X_BIOS
10921227
r3115r3116
11131248   ROM_LOAD32_WORD( "ss61mprl.bin", 0x00002, 0x80000, CRC(06f55e73) SHA1(6be26f8a2ef600bf07c580f210d7b265ac464002) )
11141249   ROM_LOAD32_WORD( "ss61mpru.bin", 0x00000, 0x80000, CRC(0abdbb83) SHA1(67e8b712291f9bcf2c3a52fbc451fad54679cab8) )
11151250
1116   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1251   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
11171252   ROM_LOAD( "ss61spr0.bin", 0, 0x80000, CRC(71cb12f5) SHA1(6e13bd16a5ba14d6e47a21875db3663ada3c06a5) )
11181253   NAMCO_C7X_BIOS
11191254
r3115r3116
11391274   ROM_LOAD32_WORD( "ss71mprl.bin", 0x00002, 0x80000, CRC(bd60b50e) SHA1(9e00bacd506182ab2af2c0efdd5cc401b3e46485) )
11401275   ROM_LOAD32_WORD( "ss71mpru.bin", 0x00000, 0x80000, CRC(3444f5a8) SHA1(8d0f35b3ba8f65dbc67c3b2d273833227a8b8b2a) )
11411276
1142   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1277   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
11431278   ROM_LOAD( "ss71spr0.bin", 0, 0x80000, CRC(71cb12f5) SHA1(6e13bd16a5ba14d6e47a21875db3663ada3c06a5) )
11441279   NAMCO_C7X_BIOS
11451280
r3115r3116
11651300   ROM_LOAD32_WORD( "vsj1mprl.15b", 0x00002, 0x80000, CRC(83a60d92) SHA1(c3db0c79f772a79418914353a3d6ecc4883ea54e) )
11661301   ROM_LOAD32_WORD( "vsj1mpru.13b", 0x00000, 0x80000, CRC(c63eb92d) SHA1(f93bd4b91daee645677955020dc8df14dc9bfd27) )
11671302
1168   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1303   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
11691304   ROM_LOAD( "vsj1spr0.5b", 0, 0x80000, CRC(b0c71aa6) SHA1(a94fae02b46a645ff728d2f98827c85ff155892b) )
11701305   NAMCO_C7X_BIOS
11711306
r3115r3116
13511486   ROM_LOAD32_WORD( "ou2mprl.11c", 0x00002, 0x80000, CRC(f414a32e) SHA1(9733ab087cfde1b8fb5b676d8a2eb5325ebdbb56) )
13521487   ROM_LOAD32_WORD( "ou2mpru.11d", 0x00000, 0x80000, CRC(ab5083fb) SHA1(cb2e7a4838c2b80057edb83ea63116bccb1394d3) )
13531488
1354   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1489   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
13551490   ROM_LOAD( "ou1spr0.5b", 0, 0x80000, CRC(60cee566) SHA1(2f3b96793816d90011586e0f9f71c58b636b6d4c) )
13561491   NAMCO_C7X_BIOS
13571492
r3115r3116
13841519   ROM_REGION( 0x200000, NAMCONB1_TILEGFXREGION, ROMREGION_DISPOSE )
13851520   ROM_LOAD( "ou1-scr0", 0x000000, 0x200000, CRC(b3b3f2e9) SHA1(541bd7e9ba12aff4ec4033bd9c6bb19476acb3c4) )
13861521
1387   ROM_REGION32_BE( 0x100000, "user1", 0 )
1522   ROM_REGION32_BE( 0x100000, "data", 0 )
13881523   ROM_LOAD16_WORD_SWAP( "ou1dat0.20a", 0x00000, 0x80000, CRC(1a49aead) SHA1(df243aff1a6fb5bcf4d5d883c5af2374a4aff477) )
13891524   ROM_LOAD16_WORD_SWAP( "ou1dat1.20b", 0x80000, 0x80000, CRC(63bb119d) SHA1(d4c2820243b84c3f5cdf7f9e66bb50f53d0efed2) )
13901525ROM_END
r3115r3116
13941529   ROM_LOAD32_WORD( "ou1-mprl.11c", 0x00002, 0x80000, CRC(d3b9e530) SHA1(3f5fe5eea817a23dfe42e76f32912ce94d4c49c9) )
13951530   ROM_LOAD32_WORD( "ou1-mpru.11d", 0x00000, 0x80000, CRC(d98308fb) SHA1(fdefeebf56464a20e3aaefd88df4eee9f7b5c4f3) )
13961531
1397   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1532   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
13981533   ROM_LOAD( "ou1spr0.5b", 0, 0x80000, CRC(60cee566) SHA1(2f3b96793816d90011586e0f9f71c58b636b6d4c) )
13991534   NAMCO_C7X_BIOS
14001535
r3115r3116
14271562   ROM_REGION( 0x200000, NAMCONB1_TILEGFXREGION, ROMREGION_DISPOSE )
14281563   ROM_LOAD( "ou1-scr0", 0x000000, 0x200000, CRC(b3b3f2e9) SHA1(541bd7e9ba12aff4ec4033bd9c6bb19476acb3c4) )
14291564
1430   ROM_REGION32_BE( 0x100000, "user1", 0 )
1565   ROM_REGION32_BE( 0x100000, "data", 0 )
14311566   ROM_LOAD16_WORD_SWAP( "ou1dat0.20a", 0x00000, 0x80000, CRC(1a49aead) SHA1(df243aff1a6fb5bcf4d5d883c5af2374a4aff477) )
14321567   ROM_LOAD16_WORD_SWAP( "ou1dat1.20b", 0x80000, 0x80000, CRC(63bb119d) SHA1(d4c2820243b84c3f5cdf7f9e66bb50f53d0efed2) )
14331568ROM_END
r3115r3116
14381573   ROM_LOAD32_WORD( "mb1_mprl.11c", 0x00002, 0x80000, CRC(86cf0644) SHA1(07eeadda1d94c9be2f882edb6f2eb0b98292e500) )
14391574   ROM_LOAD32_WORD( "mb1_mpru.11d", 0x00000, 0x80000, CRC(fb1ff916) SHA1(e0ba96c1f26a60f87d8050e582e164d91e132183) )
14401575
1441   ROM_REGION16_LE( 0x100000, "user4", 0 ) /* sound data and MCU BIOS */
1576   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
14421577   ROM_LOAD( "mb1_spr0.5b", 0, 0x80000, CRC(d10f6272) SHA1(cb99e06e050dbf86998ea51ef2ca130b2acfb2f6) )
14431578   NAMCO_C7X_BIOS
14441579
r3115r3116
14751610   ROM_LOAD( "mb1_scr1.1c", 0x200000, 0x200000, CRC(fb2b1939) SHA1(bf9d7b93205e7012aa86693f3d2ba8f4d729bc97) )
14761611   ROM_LOAD( "mb1_scr2.1b", 0x400000, 0x200000, CRC(0e6097a5) SHA1(b6c64b3e34ba913138b6b7c3d99d2be4f3ceda08) )
14771612
1478   ROM_REGION32_BE( 0x100000, "user1", 0 )
1613   ROM_REGION32_BE( 0x100000, "data", 0 )
14791614   ROM_LOAD16_WORD_SWAP( "mb1_dat0.20a", 0x00000, 0x80000, CRC(fb2e3cd1) SHA1(019b1d645a07619036522f42e0b9a537f39b6b93) )
14801615ROM_END
14811616
src/mame/drivers/suprslam.c
r3115r3116
142142   AM_RANGE(0xff0000, 0xff1fff) AM_READ(SMH_RAM)
143143   AM_RANGE(0xff8000, 0xff8fff) AM_READ(SMH_RAM)
144144   AM_RANGE(0xffa000, 0xffafff) AM_READ(SMH_RAM)
145   AM_RANGE(0xfff000, 0xfff001) AM_READ(input_port_0_word_r)
146   AM_RANGE(0xfff002, 0xfff003) AM_READ(input_port_1_word_r)
147   AM_RANGE(0xfff004, 0xfff005) AM_READ(input_port_2_word_r)
148   AM_RANGE(0xfff006, 0xfff007) AM_READ(input_port_3_word_r)
149   AM_RANGE(0xfff008, 0xfff009) AM_READ(input_port_4_word_r)
145   AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("P1")
146   AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("P2")
147   AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("SYSTEM")
148   AM_RANGE(0xfff006, 0xfff007) AM_READ_PORT("DSW1")
149   AM_RANGE(0xfff008, 0xfff009) AM_READ_PORT("DSW2")
150150ADDRESS_MAP_END
151151
152152static ADDRESS_MAP_START( suprslam_writemem, ADDRESS_SPACE_PROGRAM, 16 )
r3115r3116
196196/*** INPUT PORTS *************************************************************/
197197
198198static INPUT_PORTS_START( suprslam )
199
200   PORT_START("P1")      /* IN1 */
199   PORT_START("P1")
201200   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
202201   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
203202   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
207206   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
208207   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
209208
210   PORT_START("P2")      /* IN1 */
209   PORT_START("P2")
211210   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
212211   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
213212   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
217216   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
218217   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
219218
220   PORT_START("SYSTEM")      /* IN0 */
219   PORT_START("SYSTEM")
221220   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
222221   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
223222   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )            // Only in "test mode"
r3115r3116
227226   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_TILT )
228227   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE1 )
229228
230   PORT_START("DSW1")   /* DSW */
229   PORT_START("DSW1")
231230   PORT_DIPNAME( 0x0001, 0x0001, "Coin Slots" )
232231   PORT_DIPSETTING(      0x0001, "Common" )
233232   PORT_DIPSETTING(      0x0000, "Separate" )
r3115r3116
253252   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
254253   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
255254
256   PORT_START("DSW2")   /* DSW */
255   PORT_START("DSW2")
257256   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
258257   PORT_DIPSETTING(      0x0002, DEF_STR( Easy ) )
259258   PORT_DIPSETTING(      0x0003, DEF_STR( Normal ) )
src/mame/drivers/strnskil.c
r3115r3116
9595   AM_RANGE(0xd000, 0xd7ff) AM_READ(SMH_RAM) /* videoram */
9696
9797   AM_RANGE(0xd800, 0xd800) AM_READ(strnskil_d800_r)
98   AM_RANGE(0xd801, 0xd801) AM_READ(input_port_0_r) /* dsw 1 */
99   AM_RANGE(0xd802, 0xd802) AM_READ(input_port_1_r) /* dsw 2 */
100   AM_RANGE(0xd803, 0xd803) AM_READ(input_port_4_r) /* other inputs */
101   AM_RANGE(0xd804, 0xd804) AM_READ(input_port_2_r) /* player1 */
102   AM_RANGE(0xd805, 0xd805) AM_READ(input_port_3_r) /* player2 */
98   AM_RANGE(0xd801, 0xd801) AM_READ_PORT("DSW1")
99   AM_RANGE(0xd802, 0xd802) AM_READ_PORT("DSW2")
100   AM_RANGE(0xd803, 0xd803) AM_READ_PORT("SYSTEM")
101   AM_RANGE(0xd804, 0xd804) AM_READ_PORT("P1")
102   AM_RANGE(0xd805, 0xd805) AM_READ_PORT("P2")
103103ADDRESS_MAP_END
104104
105105static ADDRESS_MAP_START( strnskil_writemem1, ADDRESS_SPACE_PROGRAM, 8 )
r3115r3116
133133/****************************************************************************/
134134
135135static INPUT_PORTS_START( strnskil )
136   PORT_START("DSW1")  /* dsw1 */
136   PORT_START("DSW1")
137137   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
138138   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
139139   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
164164   PORT_DIPSETTING(    0xe0, "1C 2C / 1C 6C" )
165165   PORT_DIPSETTING(    0xf0, DEF_STR( Free_Play ) )
166166
167   PORT_START("DSW2")  /* dsw2 */
167   PORT_START("DSW2")
168168   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Difficulty ) )
169169   PORT_DIPSETTING(    0x00, DEF_STR( Normal ) )
170170   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
r3115r3116
190190   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
191191   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
192192
193   PORT_START("P1") /* d804 */
193   PORT_START("P1")      /* d804 */
194194   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
195195   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
196196   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
r3115r3116
200200   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
201201   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
202202
203   PORT_START("P2") /* d805 */
203   PORT_START("P2")      /* d805 */
204204   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
205205   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
206206   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
r3115r3116
210210   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
211211   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
212212
213   PORT_START("SYSTEM") /* d803 */
213   PORT_START("SYSTEM")   /* d803 */
214214   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
215215   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
216216   PORT_SERVICE( 0x20, IP_ACTIVE_HIGH )
r3115r3116
222222INPUT_PORTS_END
223223
224224static INPUT_PORTS_START( banbam )
225   PORT_START("DSW1")  /* dsw1 */
225   PORT_START("DSW1")
226226   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1")
227227   PORT_DIPSETTING(    0x00, "3" )
228228   PORT_DIPSETTING(    0x01, "5" )
r3115r3116
251251   PORT_DIPSETTING(    0xe0, "1C 2C / 1C 6C" )
252252   PORT_DIPSETTING(    0xf0, DEF_STR( Free_Play ) )
253253
254   PORT_START("DSW2")  /* dsw2 */
254   PORT_START("DSW2")
255255   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
256256   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
257257   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
268268   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" )
269269   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" )
270270
271   PORT_START("P1") /* d804 */
271   PORT_START("P1")      /* d804 */
272272   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
273273   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
274274   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
r3115r3116
278278   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
279279   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
280280
281   PORT_START("P2") /* d805 */
281   PORT_START("P2")      /* d805 */
282282   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
283283   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
284284   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
r3115r3116
288288   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
289289   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
290290
291   PORT_START("SYSTEM") /* d803 */
291   PORT_START("SYSTEM")   /* d803 */
292292   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
293293   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
294294   PORT_SERVICE( 0x20, IP_ACTIVE_HIGH )
src/mame/drivers/sangho.c
r3115r3116
8080   ADDRESS_MAP_GLOBAL_MASK(0xff)
8181   AM_RANGE( 0x98, 0x98) AM_READ( v9938_0_vram_r )
8282   AM_RANGE( 0x99, 0x99) AM_READ( v9938_0_status_r )
83   AM_RANGE( 0xa0, 0xa0) AM_READ( input_port_0_r )
84   AM_RANGE( 0xa1, 0xa1) AM_READ( input_port_1_r )
85   AM_RANGE( 0xf7, 0xf7) AM_READ( input_port_2_r )
83   AM_RANGE( 0xa0, 0xa0) AM_READ_PORT("P1")
84   AM_RANGE( 0xa1, 0xa1) AM_READ_PORT("P2")
85   AM_RANGE( 0xf7, 0xf7) AM_READ_PORT("DSW")
8686ADDRESS_MAP_END
8787
8888static ADDRESS_MAP_START (writeport_pzlestar, ADDRESS_SPACE_IO, 8)
r3115r3116
100100
101101static ADDRESS_MAP_START (readport_sexyboom, ADDRESS_SPACE_IO, 8)
102102   ADDRESS_MAP_GLOBAL_MASK(0xff)
103   AM_RANGE( 0xa0, 0xa0) AM_READ( input_port_0_r )
104   AM_RANGE( 0xa1, 0xa1) AM_READ( input_port_1_r )
105   AM_RANGE( 0xf7, 0xf7) AM_READ( input_port_2_r )
103   AM_RANGE( 0xa0, 0xa0) AM_READ_PORT("P1")
104   AM_RANGE( 0xa1, 0xa1) AM_READ_PORT("P2")
105   AM_RANGE( 0xf7, 0xf7) AM_READ_PORT("DSW")
106106   AM_RANGE( 0xf0, 0xf0) AM_READ( v9938_0_vram_r )
107107   AM_RANGE( 0xf1, 0xf1) AM_READ( v9938_0_status_r )
108108ADDRESS_MAP_END
r3115r3116
123123static INPUT_PORTS_START( sangho )
124124    PORT_START("P1")
125125   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
126    PORT_DIPNAME(   0x02, 0x02, DEF_STR( Unknown ) )
127    PORT_DIPSETTING(      0x02, DEF_STR( Off ) )
128    PORT_DIPSETTING(      0x00, DEF_STR( On ) )
129    PORT_DIPNAME(   0x04, 0x04, DEF_STR( Unknown ) )
130    PORT_DIPSETTING(      0x04, DEF_STR( Off ) )
131    PORT_DIPSETTING(      0x00, DEF_STR( On ) )
132    PORT_DIPNAME(   0x08, 0x08, DEF_STR( Unknown ) )
133    PORT_DIPSETTING(      0x08, DEF_STR( Off ) )
134    PORT_DIPSETTING(      0x00, DEF_STR( On ) )
126    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
127    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
128    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
129    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
130    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
131    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
132    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
133    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
134    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
135135   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
136136   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
137137   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
r3115r3116
139139
140140   PORT_START("P2")
141141   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
142    PORT_DIPNAME(   0x02, 0x02, DEF_STR( Unknown ) )
143    PORT_DIPSETTING(      0x02, DEF_STR( Off ) )
144    PORT_DIPSETTING(      0x00, DEF_STR( On ) )
145    PORT_DIPNAME(   0x04, 0x04, DEF_STR( Unknown ) )
146    PORT_DIPSETTING(      0x04, DEF_STR( Off ) )
147    PORT_DIPSETTING(      0x00, DEF_STR( On ) )
148    PORT_DIPNAME(   0x08, 0x08, DEF_STR( Unknown ) )
149    PORT_DIPSETTING(      0x08, DEF_STR( Off ) )
150    PORT_DIPSETTING(      0x00, DEF_STR( On ) )
142    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
143    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
144    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
145    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
146    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
147    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
148    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
149    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
150    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
151151   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
152152   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
153153   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
154154   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
155155
156156   PORT_START("DSW")
157    PORT_DIPNAME(   0x01, 0x01, "DIPS" ) /* coinage etc. */
158    PORT_DIPSETTING(      0x01, DEF_STR( Off ) )
159    PORT_DIPSETTING(      0x00, DEF_STR( On ) )
160    PORT_DIPNAME(   0x02, 0x02, DEF_STR( Unknown ) )
161    PORT_DIPSETTING(      0x02, DEF_STR( Off ) )
162    PORT_DIPSETTING(      0x00, DEF_STR( On ) )
163    PORT_DIPNAME(   0x04, 0x04, DEF_STR( Unknown ) )
164    PORT_DIPSETTING(      0x04, DEF_STR( Off ) )
165    PORT_DIPSETTING(      0x00, DEF_STR( On ) )
166    PORT_DIPNAME(   0x08, 0x08, DEF_STR( Unknown ) )
167    PORT_DIPSETTING(      0x08, DEF_STR( Off ) )
168    PORT_DIPSETTING(      0x00, DEF_STR( On ) )
169    PORT_DIPNAME(   0x10, 0x10, DEF_STR( Unknown ) )
170    PORT_DIPSETTING(      0x10, DEF_STR( Off ) )
171    PORT_DIPSETTING(      0x00, DEF_STR( On ) )
172    PORT_DIPNAME(   0x20, 0x20, DEF_STR( Unknown ) )
173    PORT_DIPSETTING(      0x20, DEF_STR( Off ) )
174    PORT_DIPSETTING(      0x00, DEF_STR( On ) )
175    PORT_DIPNAME(   0x40, 0x40, "Display Numbers on Tiles" )
176    PORT_DIPSETTING(      0x00, DEF_STR( Off ) )
177    PORT_DIPSETTING(      0x40, DEF_STR( On ) )
157    PORT_DIPNAME( 0x01, 0x01, "DIPS" ) /* coinage etc. */
158    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
159    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
160    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
161    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
162    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
163    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
164    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
165    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
166    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
167    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
168    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
169    PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
170    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
171    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
172    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
173    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
174    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
175    PORT_DIPNAME( 0x40, 0x40, "Display Numbers on Tiles" )
176    PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
177    PORT_DIPSETTING(    0x40, DEF_STR( On ) )
178178   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
179179INPUT_PORTS_END
180180
src/mame/drivers/shaolins.c
r3115r3116
3636
3737
3838static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
39   AM_RANGE(0x0500, 0x0500) AM_READ(input_port_3_r)   /* Dipswitch settings */
40   AM_RANGE(0x0600, 0x0600) AM_READ(input_port_4_r)   /* Dipswitch settings */
41   AM_RANGE(0x0700, 0x0700) AM_READ(input_port_0_r)   /* coins + service */
42   AM_RANGE(0x0701, 0x0701) AM_READ(input_port_1_r)   /* player 1 controls */
43   AM_RANGE(0x0702, 0x0702) AM_READ(input_port_2_r)   /* player 2 controls */
44   AM_RANGE(0x0703, 0x0703) AM_READ(input_port_5_r)   /* selftest */
39   AM_RANGE(0x0500, 0x0500) AM_READ_PORT("DSW1")
40   AM_RANGE(0x0600, 0x0600) AM_READ_PORT("DSW2")
41   AM_RANGE(0x0700, 0x0700) AM_READ_PORT("SYSTEM")
42   AM_RANGE(0x0701, 0x0701) AM_READ_PORT("P1")
43   AM_RANGE(0x0702, 0x0702) AM_READ_PORT("P2")
44   AM_RANGE(0x0703, 0x0703) AM_READ_PORT("DSW3")
4545   AM_RANGE(0x2800, 0x2bff) AM_READ(SMH_RAM)   /* RAM BANK 2 */
4646   AM_RANGE(0x3000, 0x33ff) AM_READ(SMH_RAM)   /* RAM BANK 1 */
4747   AM_RANGE(0x3800, 0x3fff) AM_READ(SMH_RAM)   /* video RAM */
r3115r3116
7171
7272
7373static INPUT_PORTS_START( shaolins )
74   PORT_START("SYSTEM")   /* IN0 */
74   PORT_START("SYSTEM")
7575   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
7676   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
7777   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
8181   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
8282   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
8383
84   PORT_START("P1")   /* IN1 */
84   PORT_START("P1")
8585   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
8686   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
8787   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
r3115r3116
9191   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
9292   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
9393
94   PORT_START("P2")   /* IN2 */
94   PORT_START("P2")
9595   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
9696   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
9797   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
r3115r3116
101101   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
102102   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
103103
104   PORT_START("DSW1")   /* DSW0 */
104   PORT_START("DSW1")
105105   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
106106   PORT_DIPSETTING(    0x03, "2" )
107107   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
124124   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
125125   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
126126
127   PORT_START("DSW2")   /* DSW1 */
127   PORT_START("DSW2")
128128   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
129129   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
130130   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
146146   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
147147   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
148148
149   PORT_START("DSW3")   /* DSW2 */
149   PORT_START("DSW3")
150150   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
151151   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
152152   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
src/mame/drivers/model2.c
r3115r3116
20152015
20162016
20172017
2018ROM_START( zeroguna )
2018ROM_START( zeroguna ) /* Zero Gunner (Export), Model 2A */
20192019   ROM_REGION( 0x200000, "main", 0 ) // i960 program
20202020   ROM_LOAD32_WORD("epr-20437", 0x000000, 0x080000, CRC(fad30cc0) SHA1(5c6222e07594b4be59b5095f7cc0a164d5895306) )
20212021   ROM_LOAD32_WORD("epr-20438", 0x000002, 0x080000, CRC(ca364408) SHA1(4672ebdd7d9ccab5e107fda9d322b70583246c7a) )
r3115r3116
20472047   MODEL2A_VID_BOARD
20482048ROM_END
20492049
2050ROM_START( zerogun )
2050ROM_START( zerogun ) /* Zero Gunner (Export), Model 2B */
20512051   ROM_REGION( 0x200000, "main", 0 ) // i960 program
20522052   ROM_LOAD32_WORD("epr-20439.15", 0x000000, 0x080000, CRC(10125381) SHA1(1e178e6bd2b1312cd6290f1be4b386f520465836) )
20532053   ROM_LOAD32_WORD("epr-20440.16", 0x000002, 0x080000, CRC(ce872747) SHA1(82bf138a42c659b675b14e41d526b1628fb46ae3) )
r3115r3116
20762076   ROM_LOAD("mpr-20304.33", 0x200000, 0x200000, CRC(6decfe83) SHA1(d73adafceff2f1776c93e53bd5677d67f1c2c08f) )
20772077ROM_END
20782078
2079ROM_START( zerogunj )
2079ROM_START( zerogunj ) /* Zero Gunner (Japan), Model 2B */
20802080   ROM_REGION( 0x200000, "main", 0 ) // i960 program
20812081   ROM_LOAD32_WORD("epr-20290.15", 0x000000, 0x080000, CRC(9ce3ad21) SHA1(812ab45cc9e2920e74e58937d1826774f3f54183) )
20822082   ROM_LOAD32_WORD("epr-20291.16", 0x000002, 0x080000, CRC(7267a03d) SHA1(a7216914ee7535fa1856cb19bc05c89948a93c89) )
r3115r3116
21052105   ROM_LOAD("mpr-20304.33", 0x200000, 0x200000, CRC(6decfe83) SHA1(d73adafceff2f1776c93e53bd5677d67f1c2c08f) )
21062106ROM_END
21072107
2108ROM_START( gunblade )
2108ROM_START( gunblade ) /* Gunblade NY Revision A, Model 2A */
21092109   ROM_REGION( 0x200000, "main", 0 ) // i960 program
21102110   ROM_LOAD32_WORD("epr-18988a.15", 0x000000, 0x080000, CRC(f63f1ad2) SHA1(fcfb0a4691cd7d66168c421e4e1694ecaea56ab2) )
21112111   ROM_LOAD32_WORD("epr-18989a.16", 0x000002, 0x080000, CRC(c1c84d65) SHA1(92bffbf1250c53499c37a53f9e2a054fc7bf256f) )
r3115r3116
21382138   ROM_LOAD("mpr-18979.34", 0x400000, 0x400000, CRC(f13ea36f) SHA1(a8165116b5e07e031ff960201dd8c9a441544961) )
21392139ROM_END
21402140
2141ROM_START( vf2 )
2141ROM_START( vf2 ) /* Virtua Fighter 2 Version 2.1, Model 2A */
21422142   ROM_REGION( 0x200000, "main", 0 ) // i960 program
21432143   ROM_LOAD32_WORD( "epr-18385.12",    0x000000, 0x020000, CRC(78ed2d41) SHA1(471c19389ceeec6138107dd81863320bd4825327) )
21442144   ROM_LOAD32_WORD( "epr-18386.13",    0x000002, 0x020000, CRC(3418f428) SHA1(0f51e389e13efc172a26471331a60c459ad43c38) )
r3115r3116
21842184   MODEL2A_VID_BOARD
21852185ROM_END
21862186
2187ROM_START( vf2b )
2187ROM_START( vf2b ) /* Virtua Fighter 2 Revision B, Model 2A */
21882188   ROM_REGION( 0x200000, "main", 0 ) // i960 program
21892189   ROM_LOAD32_WORD( "epr-17568b.12", 0x000000, 0x020000, CRC(5d966bbf) SHA1(01d46313148ce509fa5641fb07a3f840c00886ac) )
21902190   ROM_LOAD32_WORD( "epr-17569b.13", 0x000002, 0x020000, CRC(0b8c1ccc) SHA1(ba2e0ac8b31955fed237ba9a5eda9fa14d1db11f) )
r3115r3116
22302230   MODEL2A_VID_BOARD
22312231ROM_END
22322232
2233ROM_START( vf2a )
2233ROM_START( vf2a ) /* Virtua Fighter 2 Revision A, Model 2A */
22342234   ROM_REGION( 0x200000, "main", 0 ) // i960 program
22352235   ROM_LOAD32_WORD( "epr-17568a.12", 0x000000, 0x020000, CRC(5b10f232) SHA1(04df1eb9cf094d8dc5118b95028b544b47d5d328) )
22362236   ROM_LOAD32_WORD( "epr-17569a.13", 0x000002, 0x020000, CRC(17c208e0) SHA1(260c762d7853fb1d6f894d4dd954d82dfbc92d2d) )
r3115r3116
22762276   MODEL2A_VID_BOARD
22772277ROM_END
22782278
2279ROM_START( vf2o )
2279ROM_START( vf2o ) /* Virtua Fighter 2, Model 2A */
22802280   ROM_REGION( 0x200000, "main", 0 ) // i960 program
22812281   ROM_LOAD32_WORD( "epr-17568.12", 0x000000, 0x020000, CRC(cf5d53d1) SHA1(4ed907bbfc1a47e51c9cc11f55645752574adaef) )
22822282   ROM_LOAD32_WORD( "epr-17569.13", 0x000002, 0x020000, CRC(0fb32808) SHA1(95efb3eeaf95fb5f79ddae4ef20e2211b07f8d30) )
r3115r3116
23222322   MODEL2A_VID_BOARD
23232323ROM_END
23242324
2325ROM_START( srallyc )
2325ROM_START( srallyc ) /* Sega Rally Championship, Model 2A */
23262326   ROM_REGION( 0x200000, "main", 0 ) // i960 program
23272327   ROM_LOAD32_WORD( "epr-17888.12",  0x000000, 0x080000, CRC(3d6808aa) SHA1(33abf9cdcee9583dc600c94e1e29ce260e8c5d32) )
23282328   ROM_LOAD32_WORD( "epr-17889.13",  0x000002, 0x080000, CRC(f43c7802) SHA1(4b1efb3d5644fed1753da1750bf5c300d3a15d2c) )
r3115r3116
23692369   MODEL2A_VID_BOARD
23702370ROM_END
23712371
2372ROM_START( manxtt )
2372ROM_START( manxtt ) /* Manx TT Superbike Revision C, Model 2A */
23732373   ROM_REGION( 0x200000, "main", 0 ) // i960 program
23742374   ROM_LOAD32_WORD( "epr-18822c.12",  0x000000, 0x020000, CRC(c7b3e45a) SHA1(d3a6910bf6efc138e0e40332219b90dea7d6ea56) )
23752375   ROM_LOAD32_WORD( "epr-18823c.13",  0x000002, 0x020000, CRC(6b0c1dfb) SHA1(6da5c071e3ce842a99f928f473d4ccf7165785ac) )
r3115r3116
24202420   MODEL2A_VID_BOARD
24212421ROM_END
24222422
2423ROM_START( motoraid )
2423ROM_START( motoraid ) /* Motoraid, Model 2A */
24242424   ROM_REGION( 0x200000, "main", 0 ) // i960 program
24252425   ROM_LOAD32_WORD( "epr-20007.12",  0x000000, 0x080000, CRC(f040c108) SHA1(a6a0fa8fb9d62d0cc2ac84ea3ad457953952d980) )
24262426   ROM_LOAD32_WORD( "epr-20008.13",  0x000002, 0x080000, CRC(78976e1a) SHA1(fd15e8c81b3b2f3bdf3bb8d9414b9b8a6f1f000f) )
r3115r3116
24712471   MODEL2A_VID_BOARD
24722472ROM_END
24732473
2474ROM_START( skytargt )
2474ROM_START( skytargt ) /* Sky Target, Model 2A */
24752475   ROM_REGION( 0x200000, "main", 0 ) // i960 program
24762476   ROM_LOAD32_WORD( "epr-18406.12", 0x000000, 0x080000, CRC(fde9c00a) SHA1(01cd519daaf6138d9df4940bf8bb5923a1f163df) )
24772477   ROM_LOAD32_WORD( "epr-18407.13", 0x000002, 0x080000, CRC(35f8b529) SHA1(faf6dcf8f345c1e7968823f2dba60afcd88f37c2) )
r3115r3116
25252525   ROM_LOAD( "mpr-18421.37",   0x600000, 0x200000, CRC(00522390) SHA1(5dbbf2ba008adad36929fcecb7c2c1e5ffd12618) )
25262526ROM_END
25272527
2528ROM_START( vcop2 )
2528ROM_START( vcop2 ) /* Virtua Cop 2, Model 2A */
25292529   ROM_REGION( 0x200000, "main", 0 ) // i960 program
25302530   ROM_LOAD32_WORD( "epr-18524.12", 0x000000, 0x080000, CRC(1858988b) SHA1(2979f8470cc31e6c5c32c6fec1a87dbd29b52309) )
25312531   ROM_LOAD32_WORD( "epr-18525.13", 0x000002, 0x080000, CRC(0c13df3f) SHA1(6b4188f04aad80b89f1826e8ca47cff763980410) )
r3115r3116
25952595
25962596*/
25972597
2598ROM_START( dynamcop )
2598ROM_START( dynamcop ) /* Dynamite Cop (Export), Model 2A */
25992599   ROM_REGION( 0x200000, "main", 0 ) // i960 program
2600   ROM_LOAD32_WORD("epr-20930.12", 0x000000, 0x080000, CRC(b8fc8ff7) SHA1(53b0f9dc8494effa077170ddced2d95f43a5f134) ) /* Dynamite Cop MODEL2A (others Export Ver.) */
2600   ROM_LOAD32_WORD("epr-20930.12", 0x000000, 0x080000, CRC(b8fc8ff7) SHA1(53b0f9dc8494effa077170ddced2d95f43a5f134) )
26012601   ROM_LOAD32_WORD("epr-20931.13", 0x000002, 0x080000, CRC(89d13f88) SHA1(5e266b5e153a0d9a57360cfd1af81e3a58a2fb7d) )
26022602   ROM_LOAD32_WORD("epr-20932.14", 0x100000, 0x080000, CRC(618a68bf) SHA1(3022283dded4d08d790d034b6d543c0397b5bf5a) )
26032603   ROM_LOAD32_WORD("epr-20933.15", 0x100002, 0x080000, CRC(13abe49c) SHA1(a741a0205c1b3664ab4d09d6d991a768269a79ea) )
r3115r3116
26432643   MODEL2A_VID_BOARD
26442644ROM_END
26452645
2646ROM_START( dyndeka2 )
2646ROM_START( dyndeka2 ) /* Dynamite Deka 2 (Japan), Model 2A */
26472647   ROM_REGION( 0x200000, "main", 0 ) // i960 program
2648   ROM_LOAD32_WORD("epr-20922.12",  0x000000, 0x080000, CRC(0a8b5604) SHA1(4076998fc600c1df3bb5ef48d42681c01e651495) ) /* Dynamite Deka 2 MODEL2A (Japan Ver.) */
2648   ROM_LOAD32_WORD("epr-20922.12",  0x000000, 0x080000, CRC(0a8b5604) SHA1(4076998fc600c1df3bb5ef48d42681c01e651495) )
26492649   ROM_LOAD32_WORD("epr-20923.13",  0x000002, 0x080000, CRC(83be73d4) SHA1(1404a9c79cd2bae13f60e5e008307417324c3666) )
26502650   ROM_LOAD32_WORD("epr-20924.14",  0x100000, 0x080000, CRC(618a68bf) SHA1(3022283dded4d08d790d034b6d543c0397b5bf5a) ) /* same as epr-20932.14 listed above */
26512651   ROM_LOAD32_WORD("epr-20925.15",  0x100002, 0x080000, CRC(13abe49c) SHA1(a741a0205c1b3664ab4d09d6d991a768269a79ea) ) /* same as epr-20933.15 listed above */
r3115r3116
26912691   MODEL2A_VID_BOARD
26922692ROM_END
26932693
2694ROM_START( dynmcopb )
2694ROM_START( dynmcopb ) /* Dynamite Cop (Export), Model 2B */
26952695   ROM_REGION( 0x200000, "main", 0 ) // i960 program
2696   ROM_LOAD32_WORD("epr-20944.15", 0x000000, 0x080000, CRC(29b142f2) SHA1(b81d1ee7203b2f5fb6db4ff4185f4071e99aaedf) ) /* Dynamite Cop MODEL2B (others Export Ver.) */
2696   ROM_LOAD32_WORD("epr-20944.15", 0x000000, 0x080000, CRC(29b142f2) SHA1(b81d1ee7203b2f5fb6db4ff4185f4071e99aaedf) )
26972697   ROM_LOAD32_WORD("epr-20945.16", 0x000002, 0x080000, CRC(c495912e) SHA1(1a45296a5554923cb52b38586e40ceda2517f1bf) )
26982698   ROM_LOAD32_WORD("epr-20942.13", 0x100000, 0x080000, CRC(618a68bf) SHA1(3022283dded4d08d790d034b6d543c0397b5bf5a) ) /* same as epr-20932.14 listed above */
26992699   ROM_LOAD32_WORD("epr-20943.14", 0x100002, 0x080000, CRC(13abe49c) SHA1(a741a0205c1b3664ab4d09d6d991a768269a79ea) ) /* same as epr-20933.15 listed above */
r3115r3116
27362736   ROM_LOAD("mpr-20815.37", 0x600000, 0x200000, CRC(1b5aaae4) SHA1(32b4bf6c096fdccdd5d8f1ddb6c27d3389a52234) )
27372737ROM_END
27382738
2739ROM_START( dyndek2b )
2739ROM_START( dyndek2b ) /* Dynamite Deka 2 (Japan), Model 2B */
27402740   ROM_REGION( 0x200000, "main", 0 ) // i960 program
2741   ROM_LOAD32_WORD("epr-20936.15", 0x000000, 0x080000, CRC(23ef98f2) SHA1(0a106125ed4a2569b54924130ca2ffa05acf2322) ) /* Dynamite Deka 2 MODEL2B (Japan Ver.) */
2741   ROM_LOAD32_WORD("epr-20936.15", 0x000000, 0x080000, CRC(23ef98f2) SHA1(0a106125ed4a2569b54924130ca2ffa05acf2322) )
27422742   ROM_LOAD32_WORD("epr-20937.16", 0x000002, 0x080000, CRC(25a14e00) SHA1(ebdd21f269fd8a0798306e349d2985eead7e989f) )
27432743   ROM_LOAD32_WORD("epr-20934.13", 0x100000, 0x080000, CRC(618a68bf) SHA1(3022283dded4d08d790d034b6d543c0397b5bf5a) ) /* same as epr-20932.14 listed above */
27442744   ROM_LOAD32_WORD("epr-20935.14", 0x100002, 0x080000, CRC(13abe49c) SHA1(a741a0205c1b3664ab4d09d6d991a768269a79ea) ) /* same as epr-20933.15 listed above */
r3115r3116
27812781   ROM_LOAD("mpr-20815.37", 0x600000, 0x200000, CRC(1b5aaae4) SHA1(32b4bf6c096fdccdd5d8f1ddb6c27d3389a52234) )
27822782ROM_END
27832783
2784ROM_START( dynmcopc )
2784ROM_START( dynmcopc ) /* Dynamite Cop (USA), Model 2C */
27852785   ROM_REGION( 0x200000, "main", 0 ) // i960 program
2786   ROM_LOAD32_WORD("epr-20952.15", 0x000000, 0x080000, CRC(ec8bc896) SHA1(85deb1dc1348730a0c9b6ce3679582e7894ff2ed) ) /* Dynamite Cop MODEL2C (USA Ver.) */
2786   ROM_LOAD32_WORD("epr-20952.15", 0x000000, 0x080000, CRC(ec8bc896) SHA1(85deb1dc1348730a0c9b6ce3679582e7894ff2ed) )
27872787   ROM_LOAD32_WORD("epr-20953.16", 0x000002, 0x080000, CRC(a8276ffd) SHA1(9bea99c043775c00742c20e2f917d211dca09cc5) )
27882788   ROM_LOAD32_WORD("epr-20950.13", 0x100000, 0x080000, CRC(618a68bf) SHA1(3022283dded4d08d790d034b6d543c0397b5bf5a) ) /* same as epr-20932.14 listed above */
27892789   ROM_LOAD32_WORD("epr-20951.14", 0x100002, 0x080000, CRC(13abe49c) SHA1(a741a0205c1b3664ab4d09d6d991a768269a79ea) ) /* same as epr-20933.15 listed above */
r3115r3116
28262826   ROM_LOAD("mpr-20815.37", 0x600000, 0x200000, CRC(1b5aaae4) SHA1(32b4bf6c096fdccdd5d8f1ddb6c27d3389a52234) ) /* Located at position 35 on 2C-CRX rom board */
28272827ROM_END
28282828
2829ROM_START( schamp )
2829ROM_START( schamp ) /* Sonic The Fighters, Model 2B */
28302830   ROM_REGION( 0x200000, "main", 0 ) // i960 program
28312831   ROM_LOAD32_WORD("epr-19001.15", 0x000000, 0x080000, CRC(9b088511) SHA1(20718d985d14f4d2b1b8e982bfbebddd73cdb972) )
28322832   ROM_LOAD32_WORD("epr-19002.16", 0x000002, 0x080000, CRC(46f510da) SHA1(edcbf61122db568ccaa4c3106f507087c1740c9b) )
r3115r3116
28802880   ROM_LOAD("mpr-19025.35", 0x600000, 0x200000, CRC(6ad8fb70) SHA1(b666d31f9be26eb0cdcb71041a3c3c08d5aa41e1) )
28812881ROM_END
28822882
2883ROM_START( stcc )
2883ROM_START( stcc ) /* Sega Touring Car Championship Revision A, Model 2C */
28842884   ROM_REGION( 0x200000, "main", 0 ) // i960 program
28852885   ROM_LOAD32_WORD("epr-19272a.15", 0x000000, 0x080000, CRC(20cedd05) SHA1(e465967c784de18caaaac77e164796e9779f576a) )
28862886   ROM_LOAD32_WORD("epr-19273a.16", 0x000002, 0x080000, CRC(1b0ab4d6) SHA1(142bcd53fa6632fcc866bbda817aa83470111ef1) )
r3115r3116
29362936   ROM_LOAD("mpr-19265.60s", 0x600000, 0x200000, CRC(7d98700a) SHA1(bedd37314ecab424b5b27030e1e7dc1b596303f3))
29372937ROM_END
29382938
2939ROM_START( skisuprg )
2939ROM_START( skisuprg ) /* Sega Ski Super G, Model 2C */
29402940   ROM_REGION( 0x200000, "main", 0 ) // i960 program
29412941   ROM_LOAD32_WORD( "epr-19489.15", 0x000000, 0x080000, CRC(1df948a7) SHA1(a38faeb97c65b379ad05f7311b55217118c8d2be) )
29422942   ROM_LOAD32_WORD( "epr-19490.16", 0x000002, 0x080000, CRC(e6fc24d3) SHA1(1ac9172cf0b4d6a3488483ffa490a4ca5d410927) )
r3115r3116
29712971   ROM_LOAD( "mpr-19505.34", 0x400000, 0x400000, CRC(eba7f41d) SHA1(f6e521bedf298808a768f6fdcb0b60b320a66d04) )
29722972ROM_END
29732973
2974ROM_START( hotd )
2974ROM_START( hotd ) /* House of the Dead, Model 2C */
29752975   ROM_REGION( 0x200000, "main", 0 ) // i960 program
29762976   ROM_LOAD32_WORD("epr-19696.15", 0x000000, 0x080000, CRC(03da5623) SHA1(be0bd34a9216375c7204445f084f6c74c4d3b0c8) )
29772977   ROM_LOAD32_WORD("epr-19697.16", 0x000002, 0x080000, CRC(a9722d87) SHA1(0b14f9a81272f79a5b294bc024711042c5fb2637) )
r3115r3116
30243024   ROM_LOAD("mpr-19722.34", 0x400000, 0x400000, CRC(a56fa539) SHA1(405a892bc368ba862ba71bda7525b421d6973c0e) )
30253025ROM_END
30263026
3027ROM_START( lastbrnj )
3027ROM_START( lastbrnx ) /* Last Bronx Revision A (Export), Model 2B */
30283028   ROM_REGION( 0x200000, "main", 0 ) // i960 program
3029   ROM_LOAD32_WORD("epr-19046a.15", 0x000000, 0x080000, CRC(75be7b7a) SHA1(e57320ac3abac54b7b5278596979746ed1856188) )
3030   ROM_LOAD32_WORD("epr-19047a.16", 0x000002, 0x080000, CRC(1f5541e2) SHA1(87214f285a7bf67fbd824f2190cb9b2daf408193) )
3029   ROM_LOAD32_WORD("epr-19061a.15", 0x000000, 0x080000, CRC(c0aebab2) SHA1(fa63081b0aa6f02c3d197485865ee38e9c78b43d) )
3030   ROM_LOAD32_WORD("epr-19062a.16", 0x000002, 0x080000, CRC(cdf597e8) SHA1(a85ca36a537ba21d11ef3cfdf914c2c93ac5e68f) )
30313031
30323032   ROM_REGION32_LE( 0x2000000, "user1", 0 ) // Data
30333033   ROM_LOAD32_WORD("mpr-19050.11",  0x000000, 0x400000, CRC(e6af2b61) SHA1(abdf7aa4c594f0916d4335c70fdd67dc6b1f4630) )
r3115r3116
30533053   ROM_LOAD("mpr-19058.34", 0x0400000, 0x400000, CRC(e237c11c) SHA1(7c89cba757bd58747ed0d633b2fe7ef559fcd15e) )
30543054ROM_END
30553055
3056ROM_START( lastbrnx )
3056ROM_START( lastbrnj ) /* Last Bronx Revision A (Japan), Model 2B */
30573057   ROM_REGION( 0x200000, "main", 0 ) // i960 program
3058   ROM_LOAD32_WORD("epr-19061a.15", 0x000000, 0x080000, CRC(c0aebab2) SHA1(fa63081b0aa6f02c3d197485865ee38e9c78b43d) )
3059   ROM_LOAD32_WORD("epr-19062a.16", 0x000002, 0x080000, CRC(cdf597e8) SHA1(a85ca36a537ba21d11ef3cfdf914c2c93ac5e68f) )
3058   ROM_LOAD32_WORD("epr-19046a.15", 0x000000, 0x080000, CRC(75be7b7a) SHA1(e57320ac3abac54b7b5278596979746ed1856188) )
3059   ROM_LOAD32_WORD("epr-19047a.16", 0x000002, 0x080000, CRC(1f5541e2) SHA1(87214f285a7bf67fbd824f2190cb9b2daf408193) )
30603060
30613061   ROM_REGION32_LE( 0x2000000, "user1", 0 ) // Data
30623062   ROM_LOAD32_WORD("mpr-19050.11",  0x000000, 0x400000, CRC(e6af2b61) SHA1(abdf7aa4c594f0916d4335c70fdd67dc6b1f4630) )
r3115r3116
30823082   ROM_LOAD("mpr-19058.34", 0x0400000, 0x400000, CRC(e237c11c) SHA1(7c89cba757bd58747ed0d633b2fe7ef559fcd15e) )
30833083ROM_END
30843084
3085ROM_START( pltkidsa )
3085ROM_START( pltkidsa ) /* Pilot Kids, Model 2A */
30863086   ROM_REGION( 0x200000, "main", 0 ) // i960 program
30873087   ROM_LOAD32_WORD("epr-21281.pr0", 0x000000, 0x080000, CRC(293ead5d) SHA1(5a6295e543d7e68387de0ca4d88e930a0d8ed25c) )
30883088   ROM_LOAD32_WORD("epr-21282.pr1", 0x000002, 0x080000, CRC(ed0e7b9e) SHA1(15f3fab6ac2dd40f32bda55503378ab14f998707) )
r3115r3116
31223122   MODEL2A_VID_BOARD
31233123ROM_END
31243124
3125ROM_START( pltkids )
3125ROM_START( pltkids ) /* Pilot Kids Revision A, Model 2B */
31263126   ROM_REGION( 0x200000, "main", 0 ) // i960 program
31273127   ROM_LOAD32_WORD("epr-21285a.15",  0x000000, 0x080000, CRC(bdde5b41) SHA1(14c3f5031f85c6756c00bc67765a967ebaf7eb7f) )
31283128   ROM_LOAD32_WORD("epr-21286a.16",  0x000002, 0x080000, CRC(c8092e0e) SHA1(01030621efa9c97eb43f4a5e3e029ec99a2363c5) )
r3115r3116
32633263   ROM_LOAD("mpr-18244.35", 0x0600000, 0x200000, CRC(bfa75beb) SHA1(fec89260d887e90ee9c2803e2eaf937cf9bfa10b) )
32643264ROM_END
32653265
3266/* Wave Runner */
3267ROM_START( waverunr )
3266ROM_START( waverunr ) /* Wave Runner Revision A (Japan), Model 2C */
32683267   ROM_REGION( 0x200000, "main", 0 ) // i960 program
32693268   ROM_LOAD32_WORD("epr-19282a.15", 0x000000, 0x080000, CRC(5df58604) SHA1(a136bb80746f37450be51f98ca60791b4022035d) )
32703269   ROM_LOAD32_WORD("epr-19283a.16", 0x000002, 0x080000, CRC(bca188e1) SHA1(428f156f60e61ef314b7b50474abddf6d4dc2aca) )
r3115r3116
33393338   ROM_LOAD("mpr-19296.34", 0x0400000, 0x400000, CRC(b4b9faff) SHA1(3a258e0f7c642d043cbab5f94dfe69fac8561e93) )
33403339ROM_END
33413340
3342/* Rail Chase 2 */
3343ROM_START( rchase2 )
3341ROM_START( rchase2 ) /* Rail Chase 2 Revision A, Model 2B */
33443342   ROM_REGION( 0x200000, "main", 0 ) // i960 program
33453343   ROM_LOAD32_WORD("epr-18045a.15", 0x000000, 0x080000, CRC(bfca0314) SHA1(9eb0f2cdab8c10fda9edc0ddc439263af3903cdc) )
33463344   ROM_LOAD32_WORD("epr-18046a.16", 0x000002, 0x080000, CRC(0b8d3074) SHA1(fee8436399fb97ad5b8357b81e69bd5c27af1dde) )
r3115r3116
34393437JP23    2-3
34403438JP24    2-3
34413439*/
3442ROM_START( bel )
3440ROM_START( bel ) /* Behind Enemy Lines, Model 2C */
34433441   ROM_REGION( 0x200000, "main", 0 ) // i960 program
34443442   ROM_LOAD32_WORD("epr-20225.15",   0x000000, 0x020000, CRC(4abc6b59) SHA1(cc6da75aafcbbc86720435182a66e8de065c8e99) )
34453443   ROM_LOAD32_WORD("epr-20226.16",   0x000002, 0x020000, CRC(43e05b3a) SHA1(204b3cc6bbfdc92b4871c45fe4abff4ab4a66317) )
r3115r3116
34863484   ROM_LOAD("mpr-20253.35",  0x0600000, 0x200000, CRC(ca6aa17c) SHA1(f6df2483ca75573449ba36638dbbed4be7843a44) )
34873485ROM_END
34883486
3489ROM_START( overrev )
3487ROM_START( overrev ) /* Over Rev Revision A, Model 2C */
34903488   ROM_REGION( 0x200000, "main", 0 ) // i960 program
34913489   ROM_LOAD32_WORD( "epr-20124a.15", 0x000000, 0x080000, CRC(74beb8d7) SHA1(c65c641138ecd7312c4930702d1498b8a346175a) )
34923490   ROM_LOAD32_WORD( "epr-20125a.16", 0x000002, 0x080000, CRC(def64456) SHA1(cedb64d2d99a73301ef45c2f5f860a9b87faf6a7) )
r3115r3116
35153513   ROM_LOAD( "mpr-20004.34", 0x400000, 0x400000, CRC(0b9c5410) SHA1(e5bb30702fc853ccc03316be07a334269d3ebb4a) )
35163514ROM_END
35173515
3518ROM_START( topskatr )
3516ROM_START( topskatr ) /* Top Skater Revision A (Export), Model 2C */
35193517   ROM_REGION( 0x200000, "main", 0 ) // i960 program
35203518   ROM_LOAD32_WORD("epr-19755a.15", 0x000000, 0x080000, CRC(b80633b9) SHA1(5396da414beeb918e6f38f25a43dd76345a0c8ed) )
35213519   ROM_LOAD32_WORD("epr-19756a.16", 0x000002, 0x080000, CRC(472046a2) SHA1(06d0f609257ba476e6bd3b956e0850e7167429ce) )
r3115r3116
35553553   ROM_LOAD("mpr-19750.24s", 0xc00000, 0x400000, CRC(cd95d0bf) SHA1(40e2a2980c89049c339fefd48bf7aac79962cd2e) )
35563554ROM_END
35573555
3558ROM_START( doaa )
3556ROM_START( topskatu ) /* Top Skater (USA), Model 2C */
35593557   ROM_REGION( 0x200000, "main", 0 ) // i960 program
3558   ROM_LOAD32_WORD( "epr-19753.15", 0x000000, 0x080000, CRC(3b3028de) SHA1(717ebf0ccd87128a24776e618cf15f07aaf48537) )
3559   ROM_LOAD32_WORD( "epr-19754.16", 0x000002, 0x080000, CRC(17535b98) SHA1(a2329d09821900ec4f867caf1a93759085bd0a62) )
3560
3561   ROM_REGION32_LE( 0x2000000, "user1", 0 ) // Data
3562   ROM_LOAD32_WORD("mpr-19735.11",  0x000000, 0x400000, CRC(8e509266) SHA1(49afc91467f08befaf34e743cbe823de3e3c9d85) )
3563   ROM_LOAD32_WORD("mpr-19736.12",  0x000002, 0x400000, CRC(094e0a0d) SHA1(de2c739f71e51166263446b9f6a566866ab8bee8) )
3564   ROM_LOAD32_WORD("mpr-19737.9",   0x800000, 0x400000, CRC(281a7dde) SHA1(71d5ba434328a81969bfdc71ac1160c5ff3ae9d3) )
3565   ROM_LOAD32_WORD("mpr-19738.10",  0x800002, 0x400000, CRC(f688327e) SHA1(68c9db242ef7e8f98979e968a09e4b093bc5d470) )
3566
3567   ROM_REGION( 0x800000, "cpu2", 0 ) // TGPx4 program
3568   ROM_LOAD32_WORD("mpr-19743.29",  0x000000, 0x200000, CRC(d41a41bf) SHA1(a5f6b24e6526d0d2ef9c526c273c018d1e0fed59) )
3569   ROM_LOAD32_WORD("mpr-19744.30",  0x000002, 0x200000, CRC(84f203bf) SHA1(4952b764e6bf6cd735018738c5eff08781ee2315) )
3570
3571   ROM_REGION( 0x400000, "user2", 0 ) // Models
3572   ROM_LOAD32_WORD("mpr-19741.17",  0x000000, 0x200000, CRC(111a6e29) SHA1(8664059f157626e4bbdcf8357e3d30b37d3c25b8) )
3573   ROM_LOAD32_WORD("mpr-19742.21",  0x000002, 0x200000, CRC(28510aff) SHA1(3e68aec090f36a60b3b70bc90f09e2f9ce088718) )
3574
3575   ROM_REGION( 0x800000, "user3", 0 ) // Textures
3576   ROM_LOAD32_WORD("mpr-19740.27",  0x000000, 0x400000, CRC(b20f508b) SHA1(c90fa3b42d87291ea459ccc137f3a2f3eb7efec0) )
3577   ROM_LOAD32_WORD("mpr-19739.25",  0x000002, 0x400000, CRC(8120cfd8) SHA1(a82744bff5dcdfae296c7c3e8c3fbfda26324e85) )
3578
3579   ROM_REGION( 0x100000, "audio", 0 ) // Sound program
3580   ROM_LOAD16_WORD_SWAP("mpr-19759.31", 0x080000,  0x80000, CRC(573530f2) SHA1(7b205085965d6694f8e75e29c4028f7cb6f631ab) )
3581
3582   ROM_REGION( 0x20000, "cpu3", 0) // DSB program
3583   ROM_LOAD16_WORD_SWAP("mpr-19760.2s", 0x000000,  0x20000, CRC(2e41ca15) SHA1(a302209bfe0f1491dff2da64b32cfaa13c3d3304) )
3584
3585   ROM_REGION( 0x800000, "scsp", 0 ) // Samples
3586   ROM_LOAD16_WORD_SWAP("mpr-19745.32", 0x000000, 0x400000, CRC(7082a0af) SHA1(415f9d0793a697cb1719bbd96370f4a741866527) )
3587   ROM_LOAD16_WORD_SWAP("mpr-19746.34", 0x400000, 0x400000, CRC(657b5977) SHA1(ca76f211d68b6b55678a4d7949bfd2ddef1b1710) )
3588
3589   ROM_REGION( 0x1000000, "mpeg", 0 ) // MPEG audio data
3590   ROM_LOAD("mpr-19747.18s", 0x000000, 0x400000, CRC(6e895aaa) SHA1(4c67c1e1d58a3034bbd711252a78689db9f235bb) )
3591   ROM_LOAD("mpr-19748.20s", 0x400000, 0x400000, CRC(fcd74de3) SHA1(fd4da4cf40c4342c6263cf22eee5968292a4d2c0) )
3592   ROM_LOAD("mpr-19749.22s", 0x800000, 0x400000, CRC(842ca1eb) SHA1(6ee6b2eb2ea400bdb9c0a9b4a126b4b86886e813) )
3593   ROM_LOAD("mpr-19750.24s", 0xc00000, 0x400000, CRC(cd95d0bf) SHA1(40e2a2980c89049c339fefd48bf7aac79962cd2e) )
3594ROM_END
3595
3596
3597ROM_START( doaa ) /* Dead or Alive Revision A, Model 2A */
3598   ROM_REGION( 0x200000, "main", 0 ) // i960 program
35603599   ROM_LOAD32_WORD("epr-19310a.12", 0x000000, 0x080000, CRC(06486f7a) SHA1(b3e14103570e5f45aed16e1c158e469bc85002ae) )
35613600   ROM_LOAD32_WORD("epr-19311a.13", 0x000002, 0x080000, CRC(1be62912) SHA1(dcc2df8e28e1a107867f74248e6ffcac83afe7c0) )
35623601
r3115r3116
35993638   MODEL2A_VID_BOARD
36003639ROM_END
36013640
3602ROM_START( doa )
3641ROM_START( doa ) /* Dead or Alive Revision B, Model 2B */
36033642   ROM_REGION( 0x200000, "main", 0 ) // i960 program
36043643   ROM_LOAD32_WORD("epr-19379b.15", 0x000000, 0x080000, CRC(8a10a944) SHA1(c675a344f74d0118907fb5292495883c0c30c719) )
36053644   ROM_LOAD32_WORD("epr-19380b.16", 0x000002, 0x080000, CRC(766c1ec8) SHA1(49250886f66db9fd37d88bc22c8f22046f74f043) )
r3115r3116
36403679   ROM_LOAD("mpr-19332.34", 0x600000, 0x200000, CRC(2877f96f) SHA1(00e5677da30527b862e238f10762a5cbfbabde2b) )
36413680ROM_END
36423681
3643ROM_START( sgt24h )
3682ROM_START( sgt24h ) /* Super GT 24h, Model 2B */
36443683   ROM_REGION( 0x200000, "main", 0 ) // i960 program
36453684   ROM_LOAD32_WORD("epr-19155.15", 0x000000, 0x080000, CRC(593952fd) SHA1(1fc4afc6e3910cc8adb0688542e61a9efb442e56) )
36463685   ROM_LOAD32_WORD("epr-19156.16", 0x000002, 0x080000, CRC(a91fc4ee) SHA1(a37611da0295f7d7e5d2411c3f9b73140d311f74) )
r3115r3116
36713710   ROM_LOAD("mpr-19154.32", 0x000000, 0x400000, CRC(7cd9e679) SHA1(b9812c4f3042f95febc96bcdd46e3b0724ad4b4f) )
36723711ROM_END
36733712
3674ROM_START( von )
3713ROM_START( von ) /* Virtual On Cyber Troopers Revision B (US), Model 2B */
36753714   ROM_REGION( 0x200000, "main", 0 ) // i960 program
3676   ROM_LOAD32_WORD("epr-18664b.15", 0x000000, 0x080000, CRC(27d0172c) SHA1(f3bcae9898c7d656eccb4d2546c9bb93daaefbb7) )
3677   ROM_LOAD32_WORD("epr-18665b.16", 0x000002, 0x080000, CRC(2f0142ee) SHA1(73f2a19a519ced8e0a1ab5cf69a4bf9d9841e288) )
3715   ROM_LOAD32_WORD("epr-18828b.15", 0x000000, 0x080000, CRC(6499cc59) SHA1(8289be295f021acbf0c903513ba97ae7de50dedb) )
3716   ROM_LOAD32_WORD("epr-18829b.16", 0x000002, 0x080000, CRC(0053b10f) SHA1(b89cc814b02b4ab5e37c75ee1a9cf57b88b63053) )
36783717   ROM_LOAD32_WORD("epr-18666.13",  0x100000, 0x080000, CRC(66edb432) SHA1(b67131b0158a58138380734dd5b9394b70010026) )
36793718   ROM_LOAD32_WORD("epr-18667.14",  0x100002, 0x080000, CRC(b593d31f) SHA1(1e9f23f4052ab1b0275307cc80e51352f13bc319) )
36803719
r3115r3116
37113750   ROM_LOAD("mpr-18653.34", 0x400000, 0x400000, CRC(9ec3e7bf) SHA1(197bc8adc823e93128c1cebf69361a7c7297f808))
37123751ROM_END
37133752
3714ROM_START( vonusa )
3753
3754ROM_START( vonj ) /* Virtual On Cyber Troopers Revision B (Japan), Model 2B */
37153755   ROM_REGION( 0x200000, "main", 0 ) // i960 program
3716   ROM_LOAD32_WORD("epr-18828b.15", 0x000000, 0x080000, CRC(6499cc59) SHA1(8289be295f021acbf0c903513ba97ae7de50dedb) )
3717   ROM_LOAD32_WORD("epr-18829b.16", 0x000002, 0x080000, CRC(0053b10f) SHA1(b89cc814b02b4ab5e37c75ee1a9cf57b88b63053) )
3756   ROM_LOAD32_WORD("epr-18664b.15", 0x000000, 0x080000, CRC(27d0172c) SHA1(f3bcae9898c7d656eccb4d2546c9bb93daaefbb7) )
3757   ROM_LOAD32_WORD("epr-18665b.16", 0x000002, 0x080000, CRC(2f0142ee) SHA1(73f2a19a519ced8e0a1ab5cf69a4bf9d9841e288) )
37183758   ROM_LOAD32_WORD("epr-18666.13",  0x100000, 0x080000, CRC(66edb432) SHA1(b67131b0158a58138380734dd5b9394b70010026) )
37193759   ROM_LOAD32_WORD("epr-18667.14",  0x100002, 0x080000, CRC(b593d31f) SHA1(1e9f23f4052ab1b0275307cc80e51352f13bc319) )
37203760
r3115r3116
37513791   ROM_LOAD("mpr-18653.34", 0x400000, 0x400000, CRC(9ec3e7bf) SHA1(197bc8adc823e93128c1cebf69361a7c7297f808) )
37523792ROM_END
37533793
3754ROM_START( vstriker )
3794ROM_START( vstriker ) /* Virtua Striker Revision A, Model 2B */
37553795   ROM_REGION( 0x200000, "main", 0 ) // i960 program
37563796   ROM_LOAD32_WORD("epr-18068a.15",  0x000000, 0x020000, CRC(afc69b54) SHA1(2127bde1de3cd6663c31cf2126847815234e09a4) )
37573797   ROM_LOAD32_WORD("epr-18069a.16",  0x000002, 0x020000, CRC(0243250c) SHA1(3cbeac09d503a19c5950cf70e3b329f791acfa13) )
r3115r3116
37873827   ROM_LOAD("mpr-18065.34", 0x400000, 0x200000, CRC(046b55fe) SHA1(2db7eabf4318881a67b10dba24f6f0cd68940ace) )
37883828ROM_END
37893829
3790ROM_START( vstrikro )
3830ROM_START( vstrikro ) /* Virtua Striker, Model 2B */
37913831   ROM_REGION( 0x200000, "main", 0 ) // i960 program
37923832   ROM_LOAD32_WORD("epr-18068.15", 0x000000, 0x020000, CRC(74a47795) SHA1(3ba34bd467e11e768eda95ff345f5993fb9d6bca) )
37933833   ROM_LOAD32_WORD("epr-18069.16", 0x000002, 0x020000, CRC(f6c3fcbf) SHA1(84bf16fc2a441cb724f4bc635a4c4209c240cfbf) )
r3115r3116
38233863   ROM_LOAD("mpr-18065.34", 0x400000, 0x200000, CRC(046b55fe) SHA1(2db7eabf4318881a67b10dba24f6f0cd68940ace) )
38243864ROM_END
38253865
3826ROM_START( dynabb )
3866ROM_START( dynabb ) /* Dynamite Baseball '97 Revision A, Model 2B */
38273867   ROM_REGION( 0x200000, "main", 0 ) // i960 program
38283868   ROM_LOAD32_WORD("epr-19833a.15", 0x000000, 0x080000, CRC(d99ed1b2) SHA1(b04613d564c04c35feafccad56ed85810d894185) )
38293869   ROM_LOAD32_WORD("epr-19834a.16", 0x000002, 0x080000, CRC(24192bb1) SHA1(c535ab4b38ffd42f03eed6a5a1706e867eaccd67) )
r3115r3116
38623902   ROM_LOAD("mpr-19853.35", 0x600000, 0x200000, CRC(cfc64857) SHA1(cf51fafb3d45bf799b9ccb407bee862e15c95981) )
38633903ROM_END
38643904
3865ROM_START( fvipers )
3905ROM_START( fvipers ) /* Fighting Vipers Revision D, Model 2B */
38663906   ROM_REGION( 0x200000, "main", 0 ) // i960 program
38673907   ROM_LOAD32_WORD("epr-18606d.15", 0x000000, 0x020000, CRC(7334de7d) SHA1(d10355198a3f62b503701f44dc49bfe018c787d1) )
38683908   ROM_LOAD32_WORD("epr-18607d.16", 0x000002, 0x020000, CRC(700d2ade) SHA1(656e25a6389f04f7fb9099f0b41fb03fa645a2f0) )
r3115r3116
39213961   ROM_LOAD("mpr-18632.35", 0x600000, 0x200000, CRC(39da6805) SHA1(9e9523b7c2bc50f869d062f80955da1281951299) )
39223962ROM_END
39233963
3924/* original Model 2 w/Model 1 sound board */
3925
3926ROM_START( daytona )
3964ROM_START( daytona ) /* Daytona USA (Japan, Revision A), Original Model 2 w/Model 1 sound board */
39273965   ROM_REGION( 0x200000, "main", 0 ) // i960 program
39283966   ROM_LOAD32_WORD("epr-16722a.12", 0x000000, 0x020000, CRC(48b94318) SHA1(a476a9a3531beef760c88c9634ed4a7d270e8ee7) )
39293967   ROM_LOAD32_WORD("epr-16723a.13", 0x000002, 0x020000, CRC(8af8b32d) SHA1(2039ec1f8da524176fcf85473c10a8b6e49e139a) )
r3115r3116
39844022   ROM_LOAD("epr-14869c.25", 0x000000, 0x010000, CRC(24b68e64) SHA1(c19d044d4c2fe551474492aa51922587394dd371) )
39854023ROM_END
39864024
3987/* Deluxe '93 version (There is said to be a Deluxe '94 edition) */
3988
3989ROM_START( dayton93 )
4025ROM_START( dayton93 ) /* Daytona USA Deluxe '93 version (There is said to be a Deluxe '94 edition) */
39904026   ROM_REGION( 0x200000, "main", 0 ) // i960 program
39914027   ROM_LOAD32_WORD("epr-16530a.12", 0x000000, 0x020000, CRC(39e962b5) SHA1(b98a1faabb4f1eff707a94c32224c7820f259874) )
39924028   ROM_LOAD32_WORD("epr-16531a.13", 0x000002, 0x020000, CRC(693126eb) SHA1(779734ba536db67e14760d52e8d8d7db07816481) )
r3115r3116
40464082   ROM_LOAD("epr-14869c.25", 0x000000, 0x010000, CRC(24b68e64) SHA1(c19d044d4c2fe551474492aa51922587394dd371) )
40474083ROM_END
40484084
4049/* alt revision with Saturn Adverts */
4050
4051ROM_START( daytonas )
4085ROM_START( daytonas ) /* Daytona USA (With Saturn Adverts) */
40524086   ROM_REGION( 0x200000, "main", 0 ) // i960 program
40534087   ROM_LOAD32_WORD("epr-17965.ic12", 0x000000, 0x020000, CRC(f022b3da) SHA1(3c337d12f4e12141b412a7289df46f44c66964b2) )
40544088   ROM_LOAD32_WORD("epr-17966.ic13", 0x000002, 0x020000, CRC(f9e4ece5) SHA1(2df03455a00ae7066c30bace5c2b81581529e6f4) )
r3115r3116
41094143   ROM_LOAD("epr-14869c.25", 0x000000, 0x010000, CRC(24b68e64) SHA1(c19d044d4c2fe551474492aa51922587394dd371) )
41104144ROM_END
41114145
4112ROM_START( daytonat )
4146ROM_START( daytonat )/* Daytona USA (Japan, Turbo hack) */
41134147   ROM_REGION( 0x200000, "main", 0 ) // i960 program
41144148   ROM_LOAD32_WORD( "turbo1.12", 0x000000, 0x080000, CRC(0b3d5d4e) SHA1(1660959cb383e22f0d6204547c30cf5fe9272b03) )
41154149   ROM_LOAD32_WORD( "turbo2.13", 0x000002, 0x080000, CRC(f7d4e866) SHA1(c8c43904257f718665f9f7a89838eba14bde9465) )
r3115r3116
41814215with a 40 pin socket mounted on it, which plugs into position IC15
41824216*/
41834217
4184ROM_START( daytonam )
4218ROM_START( daytonam ) /* Daytona USA (Japan, To The MAXX) */
41854219   ROM_REGION( 0x200000, "main", 0 ) // i960 program
41864220   ROM_LOAD32_WORD( "maxx.12", 0x000000, 0x020000, CRC(604ef2d9) SHA1(b1d5f0d41bea2e74fb9346da35a5041f4464265e) )
41874221   ROM_LOAD32_WORD( "maxx.13", 0x000002, 0x020000, CRC(7d319970) SHA1(5bc150a77f20a29f54acdf5043fb1e8e55f6b08b) )
r3115r3116
42434277   ROM_LOAD("epr-14869c.25", 0x000000, 0x010000, CRC(24b68e64) SHA1(c19d044d4c2fe551474492aa51922587394dd371) )
42444278ROM_END
42454279
4246ROM_START( vcop )
4280ROM_START( vcop ) /* Virtua Cop Revision B, Model 2 */
42474281   ROM_REGION( 0x200000, "main", 0 ) // i960 program
42484282   ROM_LOAD32_WORD( "epr-17166b.012", 0x000000, 0x020000, CRC(a5647c59) SHA1(0a9e0be447d3591e82efd40ef4acbfe7ae211579) )
42494283   ROM_LOAD32_WORD( "epr-17167b.013", 0x000002, 0x020000, CRC(f5dde26a) SHA1(95db029bc4206a44ea216afbcd1c19689f79115a) )
r3115r3116
42864320   MODEL2_CPU_BOARD
42874321ROM_END
42884322
4289ROM_START( desert )
4323ROM_START( desert ) /* Desert Tank, Model 2 */
42904324   ROM_REGION( 0x200000, "main", 0 ) // i960 program
42914325   ROM_LOAD32_WORD("epr-16976.12", 0x000000, 0x020000, CRC(d036dff0) SHA1(f3e5f22ef1f3ff9c9a1ff7352cdad3e2c2977a51) )
42924326   ROM_LOAD32_WORD("epr-16977.13", 0x000002, 0x020000, CRC(e91194bd) SHA1(cec8eb8d4b52c387d5750ee5a0c6e6ce7c0fe80d) )
r3115r3116
43864420}
43874421
43884422// Model 2 (TGPs, Model 1 sound board)
4389GAME( 1993, daytona,         0, model2o, daytona, 0,        ROT0, "Sega", "Daytona USA (Japan) (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4423GAME( 1993, daytona,         0, model2o, daytona, 0,        ROT0, "Sega", "Daytona USA (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
43904424GAME( 1993, dayton93,  daytona, model2o, daytona, 0,        ROT0, "Sega", "Daytona USA Deluxe '93", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
43914425GAME( 1993, daytonas,  daytona, model2o, daytona, 0,        ROT0, "Sega", "Daytona USA (With Saturn Adverts)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
43924426GAME( 1993, daytonat,  daytona, model2o, daytona, 0,        ROT0, "Sega", "Daytona USA (Japan, Turbo hack)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
43934427GAME( 1993, daytonam,  daytona, model2o, daytona, daytonam, ROT0, "Sega", "Daytona USA (Japan, To The MAXX)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
43944428GAME( 1994, desert,          0, model2o, desert,  0,        ROT0, "Sega/Martin Marietta", "Desert Tank", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4395GAME( 1994, vcop,            0, model2o, daytona, 0,        ROT0, "Sega", "Virtua Cop", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4429GAME( 1994, vcop,            0, model2o, daytona, 0,        ROT0, "Sega", "Virtua Cop (Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
43964430
43974431// Model 2A-CRX (TGPs, SCSP sound board)
43984432GAME( 1995, manxtt,          0, model2a, model2, 0,       ROT0, "Sega", "Manx TT Superbike (Revision C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
43994433GAME( 1995, motoraid,        0, model2a, model2, 0,       ROT0, "Sega", "Motoraid", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44004434GAME( 1995, srallyc,         0, model2a, srallyc,0,       ROT0, "Sega", "Sega Rally Championship", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4401GAME( 1995, vf2,             0, model2a, model2, 0,       ROT0, "Sega", "Virtua Fighter 2 (ver 2.1)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4435GAME( 1995, vf2,             0, model2a, model2, 0,       ROT0, "Sega", "Virtua Fighter 2 (Version 2.1)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44024436GAME( 1995, vf2b,          vf2, model2a, model2, 0,       ROT0, "Sega", "Virtua Fighter 2 (Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44034437GAME( 1995, vf2a,          vf2, model2a, model2, 0,       ROT0, "Sega", "Virtua Fighter 2 (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44044438GAME( 1995, vf2o,          vf2, model2a, model2, 0,       ROT0, "Sega", "Virtua Fighter 2", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44054439GAME( 1995, vcop2,           0, model2a, model2, 0,       ROT0, "Sega", "Virtua Cop 2", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44064440GAME( 1995, skytargt,        0, model2a, model2, 0,       ROT0, "Sega", "Sky Target", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4407GAME( 1996, doaa,          doa, model2a, model2, doa,     ROT0, "Sega", "Dead or Alive (Model 2A) (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4441GAME( 1996, doaa,          doa, model2a, model2, doa,     ROT0, "Sega", "Dead or Alive (Model 2A, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44084442GAME( 1997, zeroguna,  zerogun, model2a, model2, zerogun, ROT0, "Psikyo", "Zero Gunner (Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44094443GAME( 1998, dynamcop,        0, model2a, model2, genprot, ROT0, "Sega", "Dynamite Cop (Export, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44104444GAME( 1998, dyndeka2, dynamcop, model2a, model2, genprot, ROT0, "Sega", "Dynamite Deka 2 (Japan, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44114445GAME( 1998, pltkidsa,  pltkids, model2a, model2, pltkids, ROT0, "Psikyo", "Pilot Kids (Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44124446
44134447// Model 2B-CRX (SHARC, SCSP sound board)
4414GAME( 1994, vstriker,        0, model2b, model2, 0,       ROT0, "Sega", "Virtua Striker (Rev A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4448GAME( 1994, vstriker,        0, model2b, model2, 0,       ROT0, "Sega", "Virtua Striker (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44154449GAME( 1994, vstrikro, vstriker, model2b, model2, 0,       ROT0, "Sega", "Virtua Striker", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4416GAME( 1995, fvipers,         0, model2b, model2, 0,       ROT0, "Sega", "Fighting Vipers", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4417GAME( 1995, gunblade,        0, model2b, model2, 0,       ROT0, "Sega", "Gunblade NY", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4418GAME( 1995, indy500,         0, model2b, model2, 0,       ROT0, "Sega", "INDY 500 Twin", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4419GAME( 1995, indy500d,  indy500, model2b, model2, 0,       ROT0, "Sega", "INDY 500 Deluxe", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4450GAME( 1995, fvipers,         0, model2b, model2, 0,       ROT0, "Sega", "Fighting Vipers (Revision D)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4451GAME( 1995, gunblade,        0, model2b, model2, 0,       ROT0, "Sega", "Gunblade NY (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4452GAME( 1995, indy500,         0, model2b, model2, 0,       ROT0, "Sega", "INDY 500 Twin (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4453GAME( 1995, indy500d,  indy500, model2b, model2, 0,       ROT0, "Sega", "INDY 500 Deluxe (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44204454GAME( 1996, schamp,          0, model2b, model2, 0,       ROT0, "Sega", "Sonic The Fighters", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4421GAME( 1996, lastbrnx,        0, model2b, model2, 0,       ROT0, "Sega", "Last Bronx (Export, Rev A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4422GAME( 1996, lastbrnj, lastbrnx, model2b, model2, 0,       ROT0, "Sega", "Last Bronx (Japan, Rev A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4423GAME( 1996, doa,             0, model2b, model2, doa,     ROT0, "Sega", "Dead or Alive (Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4455GAME( 1996, lastbrnx,        0, model2b, model2, 0,       ROT0, "Sega", "Last Bronx (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4456GAME( 1996, lastbrnj, lastbrnx, model2b, model2, 0,       ROT0, "Sega", "Last Bronx (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4457GAME( 1996, doa,             0, model2b, model2, doa,     ROT0, "Sega", "Dead or Alive (Model 2B, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44244458GAME( 1996, sgt24h,          0, model2b, model2, sgt24h,  ROT0, "Jaleco", "Super GT 24h", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4425GAME( 1996, von,             0, model2b, model2, 0,       ROT0, "Sega", "Virtual On Cyber Troopers (Japan, Rev B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4426GAME( 1996, vonusa,        von, model2b, model2, 0,       ROT0, "Sega", "Virtual On Cyber Troopers (US, Rev B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4427GAME( 1996, dynabb,          0, model2b, model2, 0,       ROT0, "Sega", "Dynamite Baseball '97", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4459GAME( 1996, von,             0, model2b, model2, 0,       ROT0, "Sega", "Virtual On Cyber Troopers (US, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4460GAME( 1996, vonj,          von, model2b, model2, 0,       ROT0, "Sega", "Virtual On Cyber Troopers (Japan, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4461GAME( 1996, dynabb,          0, model2b, model2, 0,       ROT0, "Sega", "Dynamite Baseball '97 (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44284462GAME( 1997, zerogun,         0, model2b, model2, zerogun, ROT0, "Psikyo", "Zero Gunner (Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44294463GAME( 1997, zerogunj,  zerogun, model2b, model2, zerogun, ROT0, "Psikyo", "Zero Gunner (Japan Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44304464GAME( 1998, dynmcopb, dynamcop, model2b, model2, genprot, ROT0, "Sega", "Dynamite Cop (Export, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44314465GAME( 1998, dyndek2b, dynamcop, model2b, model2, genprot, ROT0, "Sega", "Dynamite Deka 2 (Japan, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4432GAME( 1998, pltkids,         0, model2b, model2, pltkids, ROT0, "Psikyo", "Pilot Kids (Model 2B) (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4433GAME( 199?, waverunr,        0, model2b, model2, 0,       ROT0, "Sega", "Wave Runner (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4466GAME( 1998, pltkids,         0, model2b, model2, pltkids, ROT0, "Psikyo", "Pilot Kids (Model 2B, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44344467GAME( 199?, rchase2,         0, model2b, model2, 0,       ROT0, "Sega", "Rail Chase 2 (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44354468
44364469// Model 2C-CRX (TGPx4, SCSP sound board)
44374470GAME( 1996, skisuprg,        0, model2c, model2, 0, ROT0, "Sega", "Sega Ski Super G", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44384471GAME( 1996, stcc,            0, model2c, model2, 0, ROT0, "Sega", "Sega Touring Car Championship (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4472GAME( 1996, waverunr,        0, model2c, model2, 0, ROT0, "Sega", "Wave Runner (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44394473GAME( 1997, hotd,            0, model2c, model2, 0, ROT0, "Sega", "House of the Dead", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44404474GAME( 1997, overrev,         0, model2c, model2, 0, ROT0, "Jaleco", "Over Rev (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4441GAME( 1997, topskatr,        0, model2c, model2, 0, ROT0, "Sega", "Top Skater (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4475GAME( 1997, topskatr,        0, model2c, model2, 0, ROT0, "Sega", "Top Skater (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4476GAME( 1997, topskatu, topskatr, model2c, model2, 0, ROT0, "Sega", "Top Skater (USA)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44424477GAME( 1998, bel,             0, model2c, bel,    0, ROT0, "Sega/EPL Productions", "Behind Enemy Lines", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44434478GAME( 1998, dynmcopc, dynamcop, model2c, model2, 0, ROT0, "Sega", "Dynamite Cop (USA, Model 2C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
44444479
src/mame/drivers/sshangha.c
r3115r3116
9797{
9898   switch (offset)
9999   {
100      case 0x050 >> 1: /* Player 1 & Player 2 joysticks & fire buttons */
101         return (input_port_read(machine, "P1") + (input_port_read(machine, "P2") << 8));
102      case 0x76a >> 1: /* Credits */
100      case 0x050 >> 1:
101         return input_port_read(machine, "INPUTS");
102      case 0x76a >> 1:
103103         return input_port_read(machine, "SYSTEM");
104      case 0x0ac >> 1: /* DIPS */
105         return (input_port_read(machine, "DSW1") + (input_port_read(machine, "DSW2") << 8));
104      case 0x0ac >> 1:
105         return input_port_read(machine, "DSW");
106106
107107      // Protection TODO
108108   }
r3115r3116
115115{
116116   switch (offset)
117117   {
118      case 0x050 >> 1: /* Player 1 & Player 2 joysticks & fire buttons */
119         return (input_port_read(machine, "P1") + (input_port_read(machine, "P2") << 8));
120      case 0x76a >> 1: /* Credits */
118      case 0x050 >> 1:
119         return input_port_read(machine, "INPUTS");
120      case 0x76a >> 1:
121121         return input_port_read(machine, "SYSTEM");
122      case 0x0ac >> 1: /* DIPS */
123         return (input_port_read(machine, "DSW1") + (input_port_read(machine, "DSW2") << 8));
122      case 0x0ac >> 1:
123         return input_port_read(machine, "DSW");
124124   }
125125   return sshangha_prot_data[offset];
126126}
r3115r3116
202202/******************************************************************************/
203203
204204static INPUT_PORTS_START( sshangha )
205   PORT_START("P1")   /* Player 1 controls (0xfec047.b) */
206   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
207   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
208   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
209   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
210   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)   PORT_NAME("P1 Pick Tile")
211   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)   PORT_NAME("P1 Cancel")
212   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)   PORT_NAME("P1 Help")
213   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
205   PORT_START("INPUTS")   /* 0xfec046.b - 0xfec047.b */
206   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
207   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
208   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
209   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
210   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Pick Tile")
211   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Cancel")
212   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 Help")
213   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
214   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
215   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
216   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
217   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
218   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Pick Tile")
219   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Cancel")
220   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 Help")
221   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
214222
215   PORT_START("P2")   /* Player 2 controls (0xfec046.b) */
216   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
217   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
218   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
219   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
220   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)   PORT_NAME("P2 Pick Tile")
221   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)   PORT_NAME("P2 Cancel")
222   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)   PORT_NAME("P2 Help")
223   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
223   PORT_START("SYSTEM")
224   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
225   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
226   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
227   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
228   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
229   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
230   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
231   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
224232
225   PORT_START("SYSTEM")   /* Credits */
226   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
227   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
228   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
229   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
230   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
231   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
232   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
233   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
234
235233   /* Dips seem inverted with respect to other Deco games */
236
237   PORT_START("DSW1")   /* Dip switch bank 1 (0xfec04a.b, inverted bits order) */
238   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )   // To be confirmed
239   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
240   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
241   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
242   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
243   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
244   PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
245   PORT_DIPNAME( 0x10, 0x10, "Coin Mode" )         // Check code at 0x0010f2
246   PORT_DIPSETTING(    0x10, "Mode 1" )
247   PORT_DIPSETTING(    0x00, "Mode 2" )
248   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) )
249   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_EQUALS,0x10)//Mode 1
250   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_EQUALS,0x10)//Mode 1
251   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_EQUALS,0x10)//Mode 1
252   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_EQUALS,0x10)//Mode 1
253   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_NOTEQUALS,0x10)//Mode 2
254   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_NOTEQUALS,0x10)//Mode 2
255   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_NOTEQUALS,0x10)//Mode 2
256   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_NOTEQUALS,0x10)//Mode 2
257   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) )
258   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_EQUALS,0x10)//Mode 1
259   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_EQUALS,0x10)//Mode 1
260   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_EQUALS,0x10)//Mode 1
261   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_EQUALS,0x10)//Mode 1
262   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_NOTEQUALS,0x10)//Mode 2
263   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_NOTEQUALS,0x10)//Mode 2
264   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_NOTEQUALS,0x10)//Mode 2
265   PORT_DIPSETTING(    0x01, DEF_STR( 1C_4C ) )PORT_CONDITION("DSW1",0x10,PORTCOND_NOTEQUALS,0x10)//Mode 2
266
267   PORT_START("DSW2")   /* Dip switch bank 2 (0xfec04b.b, inverted bits order) */
268   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
269   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
270   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
271   PORT_DIPSETTING(    0x80, DEF_STR( Hard ) )
272   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
234   PORT_START("DSW")   /* 0xfec04b.b - 0xfec04a.b, inverted bits order */
235   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Demo_Sounds ) )   // To be confirmed
236   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
237   PORT_DIPSETTING(      0x0080, DEF_STR( On ) )
238   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
239   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
240   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
241   PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
242   PORT_DIPNAME( 0x0010, 0x0010, "Coin Mode" )         // Check code at 0x000010f2
243   PORT_DIPSETTING(      0x0010, "Mode 1" )
244   PORT_DIPSETTING(      0x0000, "Mode 2" )
245   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_A ) )
246   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
247   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
248   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
249   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
250   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
251   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
252   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
253   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
254   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_B ) )
255   PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
256   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
257   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
258   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_EQUALS, 0x0010) //Mode 1
259   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
260   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
261   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
262   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW", 0x0010, PORTCOND_NOTEQUALS, 0x0010) //Mode 2
263   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Difficulty ) )
264   PORT_DIPSETTING(      0x4000, DEF_STR( Easy ) )
265   PORT_DIPSETTING(      0xc000, DEF_STR( Normal ) )
266   PORT_DIPSETTING(      0x8000, DEF_STR( Hard ) )
267   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
273268#if SSHANGHA_HACK
274   PORT_DIPNAME( 0x20, 0x20, "Debug Mode" )
275   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
276   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
269   PORT_DIPNAME( 0x2000, 0x2000, "Debug Mode" )
270   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
271   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
277272#else
278   PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW )                   // See notes
273   PORT_DIPUNUSED( 0x2000, IP_ACTIVE_LOW )                   // See notes
279274#endif
280   PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW )
281   PORT_DIPNAME( 0x08, 0x08, "Tile Animation" )
282   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
283   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
284   PORT_DIPNAME( 0x04, 0x04, "Use Mahjong Tiles" )
285   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
286   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
287   PORT_DIPNAME( 0x02, 0x02, "Adult Mode" )
288   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
289   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
290     PORT_DIPNAME( 0x01, 0x01, "Quest Mode" )
291   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
292   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
275   PORT_DIPUNUSED( 0x1000, IP_ACTIVE_LOW )
276   PORT_DIPNAME( 0x0800, 0x0800, "Tile Animation" )
277   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
278   PORT_DIPSETTING(      0x0800, DEF_STR( Yes ) )
279   PORT_DIPNAME( 0x0400, 0x0400, "Use Mahjong Tiles" )
280   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
281   PORT_DIPSETTING(      0x0400, DEF_STR( Yes ) )
282   PORT_DIPNAME( 0x0200, 0x0200, "Adult Mode" )
283   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
284   PORT_DIPSETTING(      0x0200, DEF_STR( Yes ) )
285     PORT_DIPNAME( 0x0100, 0x0100, "Quest Mode" )
286   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
287   PORT_DIPSETTING(      0x0100, DEF_STR( Yes ) )
293288INPUT_PORTS_END
294289
295290/******************************************************************************/
src/mame/drivers/taxidrvr.c
r3115r3116
6161
6262static READ8_HANDLER( p1c_r )
6363{
64   return (s2 << 7) | (s4 << 6) | ((input_port_read(machine, "IN2") & 1) << 4);
64   return (s2 << 7) | (s4 << 6) | ((input_port_read(machine, "SERVCOIN") & 1) << 4);
6565}
6666
6767static WRITE8_HANDLER( p1a_w )
r3115r3116
167167   AM_RANGE(0x6000, 0x67ff) AM_RAM
168168   AM_RANGE(0x8000, 0x87ff) AM_RAM
169169   AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)
170   AM_RANGE(0xe000, 0xe000) AM_READ(input_port_0_r)
171   AM_RANGE(0xe001, 0xe001) AM_READ(input_port_1_r)
172   AM_RANGE(0xe002, 0xe002) AM_READ(input_port_2_r)
173   AM_RANGE(0xe003, 0xe003) AM_READ(input_port_3_r)
174   AM_RANGE(0xe004, 0xe004) AM_READ(input_port_4_r)
170   AM_RANGE(0xe000, 0xe000) AM_READ_PORT("DSW0")
171   AM_RANGE(0xe001, 0xe001) AM_READ_PORT("DSW1")
172   AM_RANGE(0xe002, 0xe002) AM_READ_PORT("DSW2")
173   AM_RANGE(0xe003, 0xe003) AM_READ_PORT("P1")
174   AM_RANGE(0xe004, 0xe004) AM_READ_PORT("P2")
175175ADDRESS_MAP_END
176176
177177static ADDRESS_MAP_START( cpu3_map, ADDRESS_SPACE_PROGRAM, 8 )
r3115r3116
276276   PORT_DIPSETTING(    0x80, "20/15" )
277277   PORT_DIPSETTING(    0xc0, "10/10" )
278278
279   PORT_START("IN0")
279   PORT_START("P1")
280280   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
281281   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 )
282282   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 )
r3115r3116
286286   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
287287   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
288288
289   PORT_START("IN1")
289   PORT_START("P2")
290290   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )
291291   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
292292   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
r3115r3116
296296   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
297297   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
298298
299   PORT_START("IN2")
299   PORT_START("SERVCOIN")
300300   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )   /* handled by p1c_r() */
301301INPUT_PORTS_END
302302
src/mame/drivers/cps2.c
r3115r3116
640640
641641   /* 2 is vblank, 4 is some sort of scanline interrupt, 6 is both at the same time. */
642642
643   if(scancount >= 261)
643   if(scancount >= 258)
644644   {
645645      scancount = -1;
646646      cps1_scancalls = 0;
r3115r3116
676676//          popmessage("IRQ4 scancounter = %04i",scancount);
677677   }
678678
679   if(scancount == 256)  /* VBlank */
679   if(scancount == 240)  /* VBlank */
680680   {
681681      cps1_cps_b_regs[0x10/2] = cps1_scanline1;
682682      cps1_cps_b_regs[0x12/2] = cps1_scanline2;
r3115r3116
12311231static MACHINE_DRIVER_START( cps2 )
12321232
12331233   /* basic machine hardware */
1234   MDRV_CPU_ADD("main", M68000, 16000000)
1234   MDRV_CPU_ADD("main", M68000, XTAL_16MHz)
12351235   MDRV_CPU_CONFIG(cps2_encryption)
12361236   MDRV_CPU_PROGRAM_MAP(cps2_readmem,cps2_writemem)
1237   MDRV_CPU_VBLANK_INT_HACK(cps2_interrupt,262)   // 262  /* ??? interrupts per frame */
1237   MDRV_CPU_VBLANK_INT_HACK(cps2_interrupt,259)   // 262  /* ??? interrupts per frame */
12381238
12391239   MDRV_CPU_ADD("audio", Z80, 8000000)
12401240   MDRV_CPU_PROGRAM_MAP(qsound_sub_map,0)
12411241   MDRV_CPU_PERIODIC_INT(irq0_line_hold, 251)   /* 251 is good (see 'mercy mercy mercy'section of sgemf attract mode for accurate sound sync */
12421242
1243//  MDRV_INTERLEAVE(262)  /* 262 scanlines, for raster effects */
1244
12451243   MDRV_NVRAM_HANDLER(cps2)
12461244
12471245   /* video hardware */
12481246   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
12491247
12501248   MDRV_SCREEN_ADD("main", RASTER)
1251   MDRV_SCREEN_REFRESH_RATE(59.633333)
1252   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
12531249   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1254   MDRV_SCREEN_SIZE(64*8, 32*8)
1255   MDRV_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
1250   MDRV_SCREEN_RAW_PARAMS(XTAL_8MHz, 518, 64, 448, 259, 16, 240)
1251/*
1252    Measured clocks:
1253        V = 59.6376Hz
1254        H = 15.4445kHz
1255        H/V = 258.973 ~ 259 lines
12561256
1257    Possible video clocks:
1258        60MHz / 15.4445kHz = 3884.878 / 8 = 485.610 -> unlikely
1259         8MHz / 15.4445kHz =  517.983 ~ 518 -> likely
1260        16MHz -> same as 8 but with a /2 divider; also a possibility
1261*/
12571262   MDRV_GFXDECODE(cps2)
12581263   MDRV_PALETTE_LENGTH(0xc00)
12591264
src/mame/drivers/pushman.c
r3115r3116
148148   AM_RANGE(0x000000, 0x01ffff) AM_READ(SMH_ROM)
149149   AM_RANGE(0x060000, 0x060007) AM_READ(pushman_68705_r)
150150   AM_RANGE(0xfe0800, 0xfe17ff) AM_READ(SMH_RAM)
151   AM_RANGE(0xfe4000, 0xfe4001) AM_READ(input_port_0_word_r)
152   AM_RANGE(0xfe4002, 0xfe4003) AM_READ(input_port_1_word_r)
153   AM_RANGE(0xfe4004, 0xfe4005) AM_READ(input_port_2_word_r)
151   AM_RANGE(0xfe4000, 0xfe4001) AM_READ_PORT("INPUTS")
152   AM_RANGE(0xfe4002, 0xfe4003) AM_READ_PORT("SYSTEM")
153   AM_RANGE(0xfe4004, 0xfe4005) AM_READ_PORT("DSW")
154154   AM_RANGE(0xfec000, 0xfec7ff) AM_READ(SMH_RAM)
155155   AM_RANGE(0xff8000, 0xff87ff) AM_READ(SMH_RAM)
156156   AM_RANGE(0xffc000, 0xffffff) AM_READ(SMH_RAM)
r3115r3116
205205   AM_RANGE(0x00000, 0x1ffff) AM_READ(SMH_ROM)
206206   AM_RANGE(0x60000, 0x60007) AM_READ(bballs_68705_r)
207207   AM_RANGE(0xe0800, 0xe17ff) AM_READ(SMH_RAM)
208   AM_RANGE(0xe4000, 0xe4001) AM_READ(input_port_0_word_r)
209   AM_RANGE(0xe4002, 0xe4003) AM_READ(input_port_1_word_r)
210   AM_RANGE(0xe4004, 0xe4005) AM_READ(input_port_2_word_r)
208   AM_RANGE(0xe4000, 0xe4001) AM_READ_PORT("INPUTS")
209   AM_RANGE(0xe4002, 0xe4003) AM_READ_PORT("SYSTEM")
210   AM_RANGE(0xe4004, 0xe4005) AM_READ_PORT("DSW")
211211   AM_RANGE(0xec000, 0xec7ff) AM_READ(SMH_RAM)
212212   AM_RANGE(0xf8000, 0xf87ff) AM_READ(SMH_RAM)
213213   AM_RANGE(0xfc000, 0xfffff) AM_READ(SMH_RAM)
r3115r3116
230230/******************************************************************************/
231231
232232static INPUT_PORTS_START( pushman )
233   PORT_START("IN0")
233   PORT_START("INPUTS")
234234   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
235235   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
236236   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
248248   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
249249   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
250250
251   PORT_START("IN1")
251   PORT_START("SYSTEM")
252252   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
253253   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
254254   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
r3115r3116
259259   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN1 )
260260   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2 )
261261
262   PORT_START("IN2")
262   PORT_START("DSW")
263263   PORT_DIPNAME( 0x0001, 0x0001, "Debug Mode (Cheat)") /* Listed as "Screen Skip" */
264264   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
265265   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r3115r3116
309309INPUT_PORTS_END
310310
311311static INPUT_PORTS_START( bballs )
312   PORT_START("IN0")
312   PORT_START("INPUTS")
313313   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
314314   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
315315   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
327327   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
328328   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // BUTTON3 in "test mode"
329329
330   PORT_START("IN1")
330   PORT_START("SYSTEM")
331331   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
332332   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
333333   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
r3115r3116
338338   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN1 )
339339   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2 )
340340
341   PORT_START("IN2")
341   PORT_START("DSW")
342342   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) )
343343   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
344344   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
src/mame/drivers/tiamc1.c
r3115r3116
77
88  Games supported:
99      * Konek-Gorbunok
10      * S.O.S.
1011
1112  Other games known to exist on this hardware (interchangeable by the ROM swap):
1213      * Avtogonki
r3115r3116
203204
204205static ADDRESS_MAP_START( tiamc1_readport, ADDRESS_SPACE_IO, 8 )
205206   ADDRESS_MAP_GLOBAL_MASK(0xff)
206   AM_RANGE(0xd0, 0xd0) AM_READ(input_port_0_r)
207   AM_RANGE(0xd1, 0xd1) AM_READ(input_port_1_r)
208   AM_RANGE(0xd2, 0xd2) AM_READ(input_port_2_r)
207   AM_RANGE(0xd0, 0xd0) AM_READ_PORT("IN0")
208   AM_RANGE(0xd1, 0xd1) AM_READ_PORT("IN1")
209   AM_RANGE(0xd2, 0xd2) AM_READ_PORT("IN2")
209210ADDRESS_MAP_END
210211
211212static INPUT_PORTS_START( tiamc1 )
212213   PORT_START("IN0")
213   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Player 0 JOYSTICK_RIGHT */
214   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )   /* Player 0 JOYSTICK_RIGHT */
214215   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
215   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Player 2 JOYSTICK_RIGHT */
216   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Player 3 JOYSTICK_RIGHT */
217   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Player 0 JOYSTICK_LEFT */
216   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )   /* Player 2 JOYSTICK_RIGHT */
217   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )   /* Player 3 JOYSTICK_RIGHT */
218   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )   /* Player 0 JOYSTICK_LEFT */
218219   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
219   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Player 2 JOYSTICK_LEFT */
220   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Player 3 JOYSTICK_LEFT */
220   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )   /* Player 2 JOYSTICK_LEFT */
221   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )   /* Player 3 JOYSTICK_LEFT */
221222
222223   PORT_START("IN1")
223   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Player 0 JOYSTICK_UP */
224   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )   /* Player 0 JOYSTICK_UP */
224225   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
225   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Player 2 JOYSTICK_UP */
226   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Player 3 JOYSTICK_UP */
227   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Player 0 JOYSTICK_DOWN */
226   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )   /* Player 2 JOYSTICK_UP */
227   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )   /* Player 3 JOYSTICK_UP */
228   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )   /* Player 0 JOYSTICK_DOWN */
228229   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
229   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) /* Player 2 JOYSTICK_DOWN */
230   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )   /* Player 2 JOYSTICK_DOWN */
230231   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE )
231232
232233   PORT_START("IN2")
233234   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
234   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )  /* OUT:coin lockout */
235   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* OUT:game counter */
236   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )  /* RAZR ??? */
235   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )    /* OUT:coin lockout */
236   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* OUT:game counter */
237   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* RAZR ??? */
237238   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
238   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Player 1 Kick")
239   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Player 1 Jump")
239   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) // Kick
240   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) // Jump
240241   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
241242INPUT_PORTS_END
242243
src/mame/drivers/magic10.c
r3115r3116
1/*
2    Magic's 10                 (c) 1995 AWP Games
1/****************************************************************************
2
3    MAGIC'S 10
4    ----------
5
6    Driver by Pierpaolo Prazzoli.
7    Additional work by Roberto Fresca.
8
9
10    Supported games:
11
12    Magic's 10 (ver. 16.15)    (c) 1995 AWP Games
13    Magic's 10 (ver. 16.45)    (c) 1995 AWP Games
14    Magic's 10 (ver. 16.55)    (c) 1995 AWP Games
315    Magic's 10 2               (c) 1997 ABM Games
4    Super Pool (9743 Rev.01)   (c) 1997 ABM Games
5    Hot Slot (ver 05.01)       (c) 1996 ABM Electronics
6    Magic Colors (ver 1.7a)        1999 Unknown
16    Super Pool (9743 rev.01)   (c) 1997 ABM Games
17    Hot Slot (ver. 05.01)      (c) 1996 ABM Electronics
18    Magic Colors (ver. 1.7a)       1999 Unknown
719
8    Driver by Pierpaolo Prazzoli
9    Aditional work by Roberto Fresca
1020
21*****************************************************************************
22
23
24    Magic's 10 instruction for the 1st boot:
25
26    - Switch "Disable Free Play" to ON
27    - Enter a coin
28    - Press Collect to get the 1st game over
29
30
1131    TODO:
32
1233    - ticket / coin dispenser
1334    - some unknown writes
1435    - finish magic10_2 (association coin - credits handling its inputs
1536      and some reads that drive the note displayed?)
1637    - protection (suprpool, hotslot, mcolors)
1738
18Magic's 10 instruction for the 1st boot:
19- Switch "Disable Free Play" to ON
20- Enter a coin
21- Press Collect to get the 1st game over
2239
23*/
40****************************************************************************/
2441
42
2543#include "driver.h"
2644#include "sound/okim6295.h"
2745
r3115r3116
174192
175193static INPUT_PORTS_START( magic10 )
176194   PORT_START("INPUTS")
177   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 )
178   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 )
179   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 )
180   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 )
181   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 )
195   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hold 1") PORT_CODE(KEYCODE_Z)
196   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Hold 2") PORT_CODE(KEYCODE_X)
197   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Hold 3") PORT_CODE(KEYCODE_C)
198   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold 4") PORT_CODE(KEYCODE_V)
199   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold 5") PORT_CODE(KEYCODE_B)
182200   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 )
183   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Play") PORT_CODE(KEYCODE_X)
184   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
201   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Play") PORT_CODE(KEYCODE_A)
202   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Lots FC") PORT_CODE(KEYCODE_S)
185203   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
186204   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Note A")
187205   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Note B")
188206   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("Note C")
189207   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
190   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Out Hole") PORT_CODE(KEYCODE_V)
191   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN5 ) PORT_NAME("Note D")
192   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Collect") PORT_CODE(KEYCODE_C)
208   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Out Hole") PORT_CODE(KEYCODE_D)
209   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN5 ) PORT_NAME("Note D") PORT_CODE(KEYCODE_9)
210   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Collect") PORT_CODE(KEYCODE_M)
193211
194212   PORT_START("DSW")
195213   PORT_DIPNAME( 0x0001, 0x0001, "Display Logo" )
r3115r3116
250268   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
251269
252270   PORT_START("IN1")
253   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 )
254   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 )
255   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 )
256   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 )
257   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 )
271   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hold 1") PORT_CODE(KEYCODE_Z)
272   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Hold 2") PORT_CODE(KEYCODE_X)
273   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Hold 3") PORT_CODE(KEYCODE_C)
274   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold 4") PORT_CODE(KEYCODE_V)
275   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold 5") PORT_CODE(KEYCODE_B)
258276   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 )
259   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Bet") PORT_CODE(KEYCODE_X)
260   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Collect") PORT_CODE(KEYCODE_C)
277   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Bet") PORT_CODE(KEYCODE_2)
278   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Collect") PORT_CODE(KEYCODE_M)
261279   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
262280
263281/*
r3115r3116
545563
546564/*
547565
566Magic's 10 (ver. 16.15)
567
5681995, A.W.P. Games
569Version: 16.15
570
571CPU:
5721x TS68000P12 (main)(u1)
5732x TPC1020AFN-084C (PLD)(not dumped)(u41,u60)
574
575Sound:
5761x OKI M6295 (u21)
5771x TDA2003 (u24)
5781x LM358N
579
5801x oscillator 20.000000MHz (close to main)(osc1)
5811x oscillator 30.000MHz (close to sound)(osc2)
5821x orange resonator 1000J (close to sound)(xtal1)
583
584ROMs:
5851x M27C2001 (1)
5866x M27C1001 (2,3,5,6,7)
5871x TMS27C010A (4)
5881x PALCE16V8H (read protected)
589
590Note:
5911x 28x2 edge connector
5921x trimmer (volume)
5931x 8x2 switches dip
5941x battery
595
596*/
597
598ROM_START( magic10b )
599   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 Code */
600   ROM_LOAD16_BYTE( "2.u3", 0x000000, 0x20000, CRC(32c12ad6) SHA1(93340df2c0f4c260837bd6649008e26a17a22015) )
601   ROM_LOAD16_BYTE( "3.u2", 0x000001, 0x20000, CRC(a9945aaa) SHA1(97d4f6441b96618f2e3ce14095ffc5628cb14f0e) )
602
603   ROM_REGION( 0x80000, "gfx1", ROMREGION_DISPOSE ) /* Tiles */
604   ROM_LOAD( "6.u25", 0x00000, 0x20000, CRC(7abb8136) SHA1(1d4daf6a4477853d89d08afb524516ef79f60dd6) )
605   ROM_LOAD( "4.u26", 0x20000, 0x20000, CRC(fd0b912d) SHA1(1cd15fa3459e7fece9fc37595f2b6848c00ffa43) )
606   ROM_LOAD( "5.u27", 0x40000, 0x20000, CRC(8178c907) SHA1(8c3440769ed4e113d84d1f8f9079783497791859) )
607   ROM_LOAD( "7.u28", 0x60000, 0x20000, CRC(dfd41aab) SHA1(82248c7fa4febb1c453f35a0e4cfae062c5da2d5) )
608
609   ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
610   ROM_LOAD( "1.u22", 0x00000, 0x40000, CRC(98885246) SHA1(752d549e6248074f2a7f6c5cc4d0bbc44c7fa4c3) )
611ROM_END
612
613/*
614
548615pcb is marked: Copyright ABM - 9605 Rev.02
549616
5506171x 68000
r3115r3116
787854
788855GAME( 1995, magic10,   0,       magic10,   magic10,   magic10,   ROT0, "A.W.P. Games",    "Magic's 10 (ver. 16.55)",  0 )
789856GAME( 1995, magic10a,  magic10, magic10a,  magic10,   magic10,   ROT0, "A.W.P. Games",    "Magic's 10 (ver. 16.45)",  0 )
857GAME( 1995, magic10b,  magic10, magic10a,  magic10,   magic10,   ROT0, "A.W.P. Games",    "Magic's 10 (ver. 16.15)",  0 )
790858GAME( 1997, magic102,  0,       magic102,  magic102,  magic102,  ROT0, "ABM Games",       "Magic's 10 2 (ver 1.1)",   GAME_NOT_WORKING )
791GAME( 1997, suprpool,  0,       magic102,  magic102,  suprpool,  ROT0, "ABM Games",       "Super Pool (9743 Rev.01)", GAME_NOT_WORKING )
792GAME( 1996, hotslot,   0,       hotslot,   hotslot,   hotslot,   ROT0, "ABM Electronics", "Hot Slot (ver 05.01)",     GAME_NOT_WORKING )
793GAME( 1999, mcolors,   0,       magic102,  magic102,  magic102,  ROT0, "unknown",         "Magic Colors (ver 1.7a)",  GAME_NOT_WORKING )
859GAME( 1997, suprpool,  0,       magic102,  magic102,  suprpool,  ROT0, "ABM Games",       "Super Pool (9743 rev.01)", GAME_NOT_WORKING )
860GAME( 1996, hotslot,   0,       hotslot,   hotslot,   hotslot,   ROT0, "ABM Electronics", "Hot Slot (ver. 05.01)",     GAME_NOT_WORKING )
861GAME( 1999, mcolors,   0,       magic102,  magic102,  magic102,  ROT0, "unknown",         "Magic Colors (ver. 1.7a)",  GAME_NOT_WORKING )
src/mame/drivers/tmnt.c
r3115r3116
501501   return res ^ toggle;
502502}
503503
504static READ16_HANDLER( blswhstl_eeprom_r )
505{
506   int res;
507
508   /* bit 0 is EEPROM data */
509   /* bit 1 is EEPROM ready */
510   res = eeprom_read_bit() | input_port_read(machine, "EEPROM");
511   return res;
512}
513
514504static READ16_HANDLER( ssriders_eeprom_r )
515505{
516506   int res;
r3115r3116
520510   /* bit 1 is EEPROM ready */
521511   /* bit 2 is VBLANK (???) */
522512   /* bit 7 is service button */
523   res = eeprom_read_bit() | input_port_read(machine, "EEPROM");
513   res = input_port_read(machine, "EEPROM");
524514   if (init_eeprom_count)
525515   {
526516      init_eeprom_count--;
r3115r3116
539529   /* bit 1 is EEPROM ready */
540530   /* bit 2 is VBLANK (???) */
541531   /* bit 3 is service button */
542   res = eeprom_read_bit() | input_port_read(machine, "EEPROM");
532   res = input_port_read(machine, "EEPROM");
543533   if (init_eeprom_count)
544534   {
545535      init_eeprom_count--;
r3115r3116
616606   /* bit 1 is EEPROM ready */
617607   /* bit 3 is VBLANK (???) */
618608   /* bit 7 is service button */
619   res = (eeprom_read_bit() << 8) | input_port_read(machine, "P2/EEPROM");
609   res = input_port_read(machine, "P2/EEPROM");
620610   toggle ^= 0x0800;
621611   return (res ^ toggle);
622612}
r3115r3116
659649   return res;
660650}
661651
662static READ16_HANDLER( prmrsocr_eeprom_r )
663{
664   /* bit 8 is EEPROM data */
665   /* bit 9 is EEPROM ready */
666   return (eeprom_read_bit() << 8) | input_port_read(machine, "P2/EEPROM");
667}
668
669652static WRITE16_HANDLER( prmrsocr_eeprom_w )
670653{
671654   if (ACCESSING_BITS_0_7)
r3115r3116
838821   AM_RANGE(0x700000, 0x700001) AM_READ_PORT("P1")
839822   AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P2")
840823   AM_RANGE(0x700004, 0x700005) AM_READ(blswhstl_coin_r)
841   AM_RANGE(0x700006, 0x700007) AM_READ(blswhstl_eeprom_r)
824   AM_RANGE(0x700006, 0x700007) AM_READ_PORT("EEPROM")
842825   AM_RANGE(0x700200, 0x700201) AM_WRITE(blswhstl_eeprom_w)
843826   AM_RANGE(0x700300, 0x700301) AM_WRITE(blswhstl_700300_w)
844827   AM_RANGE(0x700400, 0x700401) AM_WRITE(watchdog_reset16_w)
r3115r3116
883866   AM_RANGE(0x118000, 0x11801f) AM_WRITE(SMH_RAM) AM_BASE(&K053936_0_ctrl)
884867   AM_RANGE(0x11c000, 0x11c01f) AM_WRITE(K053251_msb_w)
885868   AM_RANGE(0x120000, 0x120001) AM_READ(prmrsocr_IN0_r)
886   AM_RANGE(0x120002, 0x120003) AM_READ(prmrsocr_eeprom_r)
869   AM_RANGE(0x120002, 0x120003) AM_READ_PORT("P2/EEPROM")
887870   AM_RANGE(0x12100c, 0x12100f) AM_WRITE(prmrsocr_sound_cmd_w)
888871   AM_RANGE(0x121014, 0x121015) AM_READ(prmrsocr_sound_r)
889872   AM_RANGE(0x122000, 0x122001) AM_WRITE(prmrsocr_eeprom_w)   /* EEPROM + video control */
r3115r3116
13371320   PORT_BIT(  0x8000, IP_ACTIVE_LOW, start )
13381321
13391322static INPUT_PORTS_START( cuebrick )
1340   PORT_START("COINS")   /* COINS */
1323   PORT_START("COINS")
13411324   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
13421325   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
13431326   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
13471330   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
13481331   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
13491332
1350   PORT_START("P1")   /* PLAYER 1 */
1333   PORT_START("P1")
13511334   KONAMI_PLAYERS_INPUT_LSB( 1, IPT_BUTTON3, IPT_UNUSED )
13521335
1353   PORT_START("P2")   /* PLAYER 2 */
1336   PORT_START("P2")
13541337   KONAMI_PLAYERS_INPUT_LSB( 2, IPT_BUTTON3, IPT_UNUSED )
13551338
1356   PORT_START("DSW1")   /* DSW1 */
1339   PORT_START("DSW1")
13571340   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
13581341   PORT_DIPSETTING(    0x03, "2" )
13591342   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
13741357   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
13751358   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13761359
1377   PORT_START("DSW2")   /* DSW2 */
1360   PORT_START("DSW2")
13781361   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
13791362   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
13801363   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
14101393   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
14111394//  PORT_DIPSETTING(    0x00, "Invalid" )
14121395
1413   PORT_START("DSW3")   /* DSW3 */
1396   PORT_START("DSW3")
14141397   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
14151398   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
14161399   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
14221405INPUT_PORTS_END
14231406
14241407static INPUT_PORTS_START( mia )
1425   PORT_START("COINS")   /* COINS */
1408   PORT_START("COINS")
14261409   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
14271410   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
14281411   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
14321415   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
14331416   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
14341417
1435   PORT_START("P1")   /* PLAYER 1 */
1418   PORT_START("P1")
14361419   KONAMI_PLAYERS_INPUT_LSB( 1, IPT_BUTTON3, IPT_UNUSED )
14371420
1438   PORT_START("P2")   /* PLAYER 2 */
1421   PORT_START("P2")
14391422   KONAMI_PLAYERS_INPUT_LSB( 2, IPT_BUTTON3, IPT_UNUSED )
14401423
1441   PORT_START("DSW1")   /* DSW1 */
1424   PORT_START("DSW1")
14421425   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
14431426   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
14441427   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
14741457   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
14751458//  PORT_DIPSETTING(    0x00, "Invalid" )
14761459
1477   PORT_START("DSW2")   /* DSW2 */
1460   PORT_START("DSW2")
14781461   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
14791462   PORT_DIPSETTING(    0x03, "2" )
14801463   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
14951478   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
14961479   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14971480
1498   PORT_START("DSW3")   /* DSW3 */
1481   PORT_START("DSW3")
14991482   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
15001483   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
15011484   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
15071490INPUT_PORTS_END
15081491
15091492static INPUT_PORTS_START( tmnt )
1510   PORT_START("COINS")   /* COINS */
1493   PORT_START("COINS")
15111494   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
15121495   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
15131496   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
r3115r3116
15171500   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 )
15181501   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 )
15191502
1520   PORT_START("P1")   /* PLAYER 1 */
1503   PORT_START("P1")
15211504   KONAMI_PLAYERS_INPUT_LSB( 1, IPT_UNKNOWN, IPT_UNKNOWN )
15221505
1523   PORT_START("P2")   /* PLAYER 2 */
1506   PORT_START("P2")
15241507   KONAMI_PLAYERS_INPUT_LSB( 2, IPT_UNKNOWN, IPT_UNKNOWN )
15251508
1526   PORT_START("P3")   /* PLAYER 3 */
1509   PORT_START("P3")
15271510   KONAMI_PLAYERS_INPUT_LSB( 3, IPT_UNKNOWN, IPT_UNKNOWN )
15281511
1529   PORT_START("DSW1")   /* DSW1 */
1512   PORT_START("DSW1")
15301513   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) )
15311514   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
15321515   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
r3115r3116
15451528   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
15461529   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
15471530
1548   PORT_START("DSW2")   /* DSW2 */
1531   PORT_START("DSW2")
15491532   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
15501533   PORT_DIPSETTING(    0x03, "1" )
15511534   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
15691552   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
15701553   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
15711554
1572   PORT_START("P4")   /* PLAYER 4 */
1555   PORT_START("P4")
15731556   KONAMI_PLAYERS_INPUT_LSB( 4, IPT_UNKNOWN, IPT_UNKNOWN )
15741557
1575   PORT_START("DSW3")   /* DSW3 */
1558   PORT_START("DSW3")
15761559   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
15771560   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
15781561   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
15871570INPUT_PORTS_END
15881571
15891572static INPUT_PORTS_START( tmnt2p )
1590   PORT_START("COINS")   /* COINS */
1573   PORT_START("COINS")
15911574   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
15921575   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
15931576   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
15971580   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
15981581   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
15991582
1600   PORT_START("P1")   /* PLAYER 1 */
1583   PORT_START("P1")
16011584   KONAMI_PLAYERS_INPUT_LSB( 1, IPT_UNKNOWN, IPT_START1 )
16021585
1603   PORT_START("P2")   /* PLAYER 2 */
1586   PORT_START("P2")
16041587   KONAMI_PLAYERS_INPUT_LSB( 2, IPT_UNKNOWN, IPT_START2 )
16051588
1606   PORT_START("P3")   /* PLAYER 3 */
1589   PORT_START("P3")
16071590   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
16081591
1609   PORT_START("DSW1")   /* DSW1 */
1592   PORT_START("DSW1")
16101593   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
16111594   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
16121595   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
16421625   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
16431626//  PORT_DIPSETTING(    0x00, "Invalid" )
16441627
1645   PORT_START("DSW2")   /* DSW2 */
1628   PORT_START("DSW2")
16461629   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
16471630   PORT_DIPSETTING(    0x03, "1" )
16481631   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
16661649   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
16671650   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
16681651
1669   PORT_START("P4")   /* PLAYER 4 */
1652   PORT_START("P4")
16701653   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
16711654
1672   PORT_START("DSW3")   /* DSW3 */
1655   PORT_START("DSW3")
16731656   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
16741657   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
16751658   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
16841667INPUT_PORTS_END
16851668
16861669static INPUT_PORTS_START( punkshot )
1687   PORT_START("DSW1/DSW2")   /* DSW1/DSW2 */
1670   PORT_START("DSW1/DSW2")
16881671   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coinage ) )
16891672   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
16901673   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_1C ) )
r3115r3116
17361719   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
17371720   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
17381721
1739   PORT_START("COINS/DSW3")   /* COIN/DSW3 */
1722   PORT_START("COINS/DSW3")
17401723   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
17411724   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
17421725   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
r3115r3116
17601743   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
17611744   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
17621745
1763   PORT_START("P1/P2")   /* IN0/IN1 */
1746   PORT_START("P1/P2")
17641747   KONAMI_PLAYERS_INPUT_LSB( 1, IPT_UNKNOWN, IPT_UNKNOWN )
17651748   KONAMI_PLAYERS_INPUT_MSB( 2, IPT_UNKNOWN, IPT_UNKNOWN )
17661749
1767   PORT_START("P3/P4")   /* IN2/IN3 */
1750   PORT_START("P3/P4")
17681751   KONAMI_PLAYERS_INPUT_LSB( 3, IPT_UNKNOWN, IPT_UNKNOWN )
17691752   KONAMI_PLAYERS_INPUT_MSB( 4, IPT_UNKNOWN, IPT_UNKNOWN )
17701753INPUT_PORTS_END
17711754
17721755static INPUT_PORTS_START( punksht2 )
1773   PORT_START("DSW1/DSW2")   /* DSW1/DSW2 */
1756   PORT_START("DSW1/DSW2")
17741757   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coinage ) )
17751758   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
17761759   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_1C ) )
r3115r3116
18221805   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
18231806   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
18241807
1825   PORT_START("COINS/DSW3")   /* COIN/DSW3 */
1808   PORT_START("COINS/DSW3")
18261809   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
18271810   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
18281811   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
18461829   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
18471830   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
18481831
1849   PORT_START("P1/P2")   /* IN0/IN1 */
1832   PORT_START("P1/P2")
18501833   KONAMI_PLAYERS_INPUT_LSB( 1, IPT_UNKNOWN, IPT_UNKNOWN )
18511834   KONAMI_PLAYERS_INPUT_MSB( 2, IPT_UNKNOWN, IPT_UNKNOWN )
18521835
1853   PORT_START("P3/P4")   /* IN2/IN3 */
1836   PORT_START("P3/P4")
18541837   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
18551838INPUT_PORTS_END
18561839
r3115r3116
18711854   PORT_START("P2")
18721855   KONAMI_PLAYERS_INPUT_LSB( 2, IPT_BUTTON3, IPT_UNKNOWN )
18731856
1874   PORT_START("DSW1")   /* DSW1 */
1857   PORT_START("DSW1")
18751858   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
18761859   PORT_DIPSETTING(    0x03, "2" )
18771860   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
18941877   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
18951878   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
18961879
1897   PORT_START("DSW2")   /* DSW2 */
1880   PORT_START("DSW2")
18981881   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
18991882   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
19001883   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
19301913   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
19311914//  PORT_DIPSETTING(    0x00, "Invalid" )
19321915
1933   PORT_START("DSW3")   /* DSW3 */
1916   PORT_START("DSW3")
19341917   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
19351918   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
19361919   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
19451928INPUT_PORTS_END
19461929
19471930static INPUT_PORTS_START( blswhstl )
1948   PORT_START("P1")   /* IN0 */
1931   PORT_START("P1")
19491932   KONAMI_PLAYERS_INPUT_LSB( 1, IPT_UNKNOWN, IPT_UNKNOWN )
19501933
1951   PORT_START("P2")   /* IN1 */
1934   PORT_START("P2")
19521935   KONAMI_PLAYERS_INPUT_LSB( 2, IPT_UNKNOWN, IPT_UNKNOWN )
19531936
1954   PORT_START("COINS")   /* COIN */
1937   PORT_START("COINS")
19551938   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
19561939   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
19571940   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
19611944   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* VBLANK? OBJMPX? */
19621945   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
19631946
1964   PORT_START("EEPROM")   /* EEPROM */
1965   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
1947   PORT_START("EEPROM")
1948   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
19661949   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM status? - always 1 */
19671950   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
19681951INPUT_PORTS_END
19691952
19701953static INPUT_PORTS_START( glfgreat )
1971   PORT_START("P1/P2")   /* IN0 */
1954   PORT_START("P1/P2")
19721955   KONAMI_PLAYERS_INPUT_LSB( 1, IPT_BUTTON3, IPT_BUTTON4 ) PORT_PLAYER(1)
19731956   KONAMI_PLAYERS_INPUT_MSB( 2, IPT_BUTTON3, IPT_BUTTON4 ) PORT_PLAYER(2)
19741957
1975   PORT_START("P3/P4")   /* IN1 */
1958   PORT_START("P3/P4")
19761959   KONAMI_PLAYERS_INPUT_LSB( 3, IPT_BUTTON3, IPT_BUTTON4 ) PORT_PLAYER(3)
19771960   KONAMI_PLAYERS_INPUT_MSB( 4, IPT_BUTTON3, IPT_BUTTON4 ) PORT_PLAYER(4)
19781961
r3115r3116
20622045INPUT_PORTS_END
20632046
20642047static INPUT_PORTS_START( ssriders )
2065   PORT_START("P1")   /* IN0 */
2048   PORT_START("P1")
20662049   KONAMI_PLAYERS_INPUT_LSB( 1, IPT_UNKNOWN, IPT_START1 )
20672050
2068   PORT_START("P2")   /* IN1 */
2051   PORT_START("P2")
20692052   KONAMI_PLAYERS_INPUT_LSB( 2, IPT_UNKNOWN, IPT_START2 )
20702053
2071   PORT_START("COINS")   /* COIN */
2054   PORT_START("COINS")
20722055   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
20732056   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
20742057   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
20782061   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
20792062   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
20802063
2081   PORT_START("EEPROM")   /* EEPROM and service */
2082   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
2064   PORT_START("EEPROM")
2065   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
20832066   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM status? - always 1 */
20842067   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: OBJMPX */
20852068   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )   /* ?? TMNT2: NVBLK */
r3115r3116
20872070   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
20882071   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
20892072
2090   PORT_START("P3")   /* IN2 */
2073   PORT_START("P3")
20912074   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
20922075
2093   PORT_START("P4")   /* IN3 */
2076   PORT_START("P4")
20942077   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
20952078INPUT_PORTS_END
20962079
20972080static INPUT_PORTS_START( ssridr4p )
2098   PORT_START("P1")   /* IN0 */
2081   PORT_START("P1")
20992082   KONAMI_PLAYERS_INPUT_LSB( 1, IPT_UNKNOWN, IPT_UNKNOWN )
21002083
2101   PORT_START("P2")   /* IN1 */
2084   PORT_START("P2")
21022085   KONAMI_PLAYERS_INPUT_LSB( 2, IPT_UNKNOWN, IPT_UNKNOWN )
21032086
2104   PORT_START("COINS")   /* COIN */
2087   PORT_START("COINS")
21052088   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
21062089   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
21072090   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
r3115r3116
21112094   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 )
21122095   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 )
21132096
2114   PORT_START("EEPROM")   /* EEPROM and service */
2115   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
2097   PORT_START("EEPROM")
2098   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
21162099   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM status? - always 1 */
21172100   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: OBJMPX */
21182101   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )   /* ?? TMNT2: NVBLK */
r3115r3116
21202103   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
21212104   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
21222105
2123   PORT_START("P3")   /* IN2 */
2106   PORT_START("P3")
21242107   KONAMI_PLAYERS_INPUT_LSB( 3, IPT_UNKNOWN, IPT_UNKNOWN )
21252108
2126   PORT_START("P4")   /* IN3 */
2109   PORT_START("P4")
21272110   KONAMI_PLAYERS_INPUT_LSB( 4, IPT_UNKNOWN, IPT_UNKNOWN )
21282111INPUT_PORTS_END
21292112
21302113/* Same as 'ssridr4p', but additional Start button for each player.
21312114   COIN3, COIN4, SERVICE3 and SERVICE4 only have an effect in the "test mode". */
21322115static INPUT_PORTS_START( ssrid4ps )
2133   PORT_START("P1")   /* IN0 */
2116   PORT_START("P1")
21342117   KONAMI_PLAYERS_INPUT_LSB( 1, IPT_UNKNOWN, IPT_START1 )
21352118
2136   PORT_START("P2")   /* IN1 */
2119   PORT_START("P2")
21372120   KONAMI_PLAYERS_INPUT_LSB( 2, IPT_UNKNOWN, IPT_START2 )
21382121
2139   PORT_START("COINS")   /* COIN */
2122   PORT_START("COINS")
21402123   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
21412124   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
21422125   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
r3115r3116
21462129   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 )
21472130   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 )
21482131
2149   PORT_START("EEPROM")   /* EEPROM and service */
2150   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
2132   PORT_START("EEPROM")
2133   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
21512134   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM status? - always 1 */
21522135   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: OBJMPX */
21532136   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )   /* ?? TMNT2: NVBLK */
r3115r3116
21552138   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
21562139   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
21572140
2158   PORT_START("P3")   /* IN2 */
2141   PORT_START("P3")
21592142   KONAMI_PLAYERS_INPUT_LSB( 3, IPT_UNKNOWN, IPT_START3 )
21602143
2161   PORT_START("P4")   /* IN3 */
2144   PORT_START("P4")
21622145   KONAMI_PLAYERS_INPUT_LSB( 4, IPT_UNKNOWN, IPT_START4 )
21632146INPUT_PORTS_END
21642147
21652148/* Version for the bootleg, which has the service switch a little different */
21662149static INPUT_PORTS_START( sunsetbl )
2167   PORT_START("P1")   /* IN0 */
2150   PORT_START("P1")
21682151   KONAMI_PLAYERS_INPUT_LSB( 1, IPT_UNKNOWN, IPT_START1 )
21692152
2170   PORT_START("P2")   /* IN1 */
2153   PORT_START("P2")
21712154   KONAMI_PLAYERS_INPUT_LSB( 2, IPT_UNKNOWN, IPT_START2 )
21722155
2173   PORT_START("COINS")   /* COIN */
2156   PORT_START("COINS")
21742157   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
21752158   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
21762159   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
r3115r3116
21802163   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 )
21812164   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 )
21822165
2183   PORT_START("EEPROM")   /* EEPROM and service */
2184   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
2166   PORT_START("EEPROM")
2167   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
21852168   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM status? - always 1 */
21862169   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
21872170   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
r3115r3116
21892172   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
21902173   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
21912174
2192   PORT_START("P3")   /* IN2 */
2175   PORT_START("P3")
21932176   KONAMI_PLAYERS_INPUT_LSB( 3, IPT_UNKNOWN, IPT_START3 )
21942177
2195   PORT_START("P4")   /* IN3 */
2178   PORT_START("P4")
21962179   KONAMI_PLAYERS_INPUT_LSB( 4, IPT_UNKNOWN, IPT_START4 )
21972180INPUT_PORTS_END
21982181
21992182static INPUT_PORTS_START( qgakumon )
2200   PORT_START("P1")   /* IN0 */
2183   PORT_START("P1")
22012184   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)   // Joystick control : Left
22022185   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)   // Joystick control : Right
22032186   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)   // Joystick control : Up
r3115r3116
22072190   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
22082191   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
22092192
2210   PORT_START("P2")   /* IN1 */
2193   PORT_START("P2")
22112194   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)   // Joystick control : Left
22122195   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)   // Joystick control : Right
22132196   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)   // Joystick control : Up
r3115r3116
22172200   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
22182201   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
22192202
2220   PORT_START("COINS")   /* COIN */
2203   PORT_START("COINS")
22212204   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
22222205   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
22232206   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
22272210   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
22282211   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
22292212
2230   PORT_START("EEPROM")   /* EEPROM and service */
2231   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
2213   PORT_START("EEPROM")
2214   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
22322215   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM status? - always 1 */
22332216   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: OBJMPX */
22342217   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )   /* ?? TMNT2: NVBLK (needs to be ACTIVE_HIGH to avoid problems) */
r3115r3116
22362219   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
22372220   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
22382221
2239   PORT_START("P3")   /* IN2 */
2222   PORT_START("P3")
22402223   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
22412224
2242   PORT_START("P4")   /* IN3 */
2225   PORT_START("P4")
22432226   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
22442227INPUT_PORTS_END
22452228
r3115r3116
22552238   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
22562239   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
22572240
2258   PORT_START("P2/EEPROM")   /* EEPROM and service */
2241   PORT_START("P2/EEPROM")
22592242   KONAMI_PLAYERS_INPUT_LSB( 2, IPT_UNKNOWN, IPT_START2 )
2260   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
2243   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
22612244   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM status? - always 1 */
22622245   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
22632246   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* VBLK?? */
r3115r3116
22892272
22902273   PORT_START("P2/EEPROM")
22912274   KONAMI_PLAYERS_INPUT_LSB( 2, IPT_UNKNOWN, IPT_START2 )
2292   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
2275   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
22932276   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM status? - always 1 */
22942277   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN2 )
22952278   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
42294212
42304213GAME( 1993, prmrsocr, 0,        prmrsocr, prmrsocr, glfgreat, ROT0,  "Konami", "Premier Soccer (ver EAB)", 0 )
42314214GAME( 1993, prmrsocj, prmrsocr, prmrsocr, prmrsocr, glfgreat, ROT0,  "Konami", "Premier Soccer (ver JAB)", 0 )
4232
src/mame/drivers/jpmimpct.c
r3115r3116
156156
157157static void update_irqs(running_machine *machine)
158158{
159   int newstate = 0;
160
161   if (tms_irq)
162      newstate = 2;
163   if (duart_1_irq)
164      newstate = 5;
165
166   if (newstate)
167      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
168   else
169      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
159   cpunum_set_input_line(machine, 0, 2, tms_irq ? ASSERT_LINE : CLEAR_LINE);
160   cpunum_set_input_line(machine, 0, 5, duart_1_irq ? ASSERT_LINE : CLEAR_LINE);
170161}
171162
172163
src/mame/drivers/namcos12.c
r3115r3116
10911091   AM_RANGE(0x00000000, 0x003fffff) AM_RAM   AM_SHARE(1) AM_BASE(&g_p_n_psxram) AM_SIZE(&g_n_psxramsize) /* ram */
10921092   AM_RANGE(0x1f000000, 0x1f000003) AM_READWRITE(SMH_NOP, bankoffset_w)         /* banking */
10931093   AM_RANGE(0x1f080000, 0x1f083fff) AM_READWRITE(sharedram_r, sharedram_w) AM_BASE(&namcos12_sharedram) /* shared ram?? */
1094   AM_RANGE(0x1f140000, 0x1f140fff) AM_READWRITE8(at28c16_0_r, at28c16_0_w, 0x00ff00ff) /* eeprom */
1094   AM_RANGE(0x1f140000, 0x1f140fff) AM_DEVREADWRITE8(AT28C16, "at28c16", at28c16_r, at28c16_w, 0x00ff00ff) /* eeprom */
10951095   AM_RANGE(0x1f1bff08, 0x1f1bff0f) AM_WRITENOP    /* ?? */
10961096   AM_RANGE(0x1f700000, 0x1f70ffff) AM_WRITE(dmaoffset_w)  /* dma */
10971097   AM_RANGE(0x1f800000, 0x1f8003ff) AM_RAM /* scratchpad */
r3115r3116
12531253   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
12541254   AM_RANGE(0x080000, 0x08ffff) AM_READWRITE( sharedram_sub_r, sharedram_sub_w )
12551255   AM_RANGE(0x280000, 0x287fff) AM_READWRITE( c352_0_r, c352_0_w )
1256   AM_RANGE(0x300000, 0x300001) AM_READ( input_port_1_word_r )
1257   AM_RANGE(0x300002, 0x300003) AM_READ( input_port_2_word_r )
1256   AM_RANGE(0x300000, 0x300001) AM_READ_PORT("IN0")
1257   AM_RANGE(0x300002, 0x300003) AM_READ_PORT("IN1")
12581258   AM_RANGE(0x300010, 0x300011) AM_NOP   // golgo13 writes here a lot, possibly also a wait state generator?
12591259   AM_RANGE(0x300030, 0x300031) AM_NOP   // most S12 bioses write here simply to generate a wait state.  there is no deeper meaning.
12601260ADDRESS_MAP_END
r3115r3116
14371437
14381438   psx_dma_install_read_handler( 5, namcos12_rom_read );
14391439
1440   at28c16_init( 0, NULL, NULL );
1441
14421440   memory_configure_bank( 1, 0, memory_region_length( machine, "user2" ) / 0x200000, memory_region( machine, "user2" ), 0x200000 );
14431441   m_n_bankoffset = 0;
14441442   memory_set_bank( 1, 0 );
r3115r3116
14771475   MDRV_CPU_VBLANK_INT("main", irq1_line_pulse)
14781476
14791477   MDRV_MACHINE_RESET( namcos12 )
1480   MDRV_NVRAM_HANDLER( at28c16_0 )
14811478
14821479   /* video hardware */
14831480   MDRV_SCREEN_ADD("main", RASTER)
r3115r3116
15011498   MDRV_SOUND_ROUTE(1, "left", 1.00)
15021499   MDRV_SOUND_ROUTE(2, "right", 1.00)
15031500   MDRV_SOUND_ROUTE(3, "left", 1.00)
1501
1502   MDRV_DEVICE_ADD( "at28c16", AT28C16 )
15041503MACHINE_DRIVER_END
15051504
15061505static INPUT_PORTS_START( namcos12 )
src/mame/drivers/raiden2.c
r3115r3116
791791   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
792792
793793   PORT_START("DSWA")   /* Dip switch A  */
794   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ))
795   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ))
796   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ))
797   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ))
798   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ))
799   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ))
800   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ))
801   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ))
794   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
795   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
796   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
797   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
798   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
799   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
800   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
801   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
802802   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
803   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ))
804   PORT_DIPSETTING(    0x08, DEF_STR( 4C_1C ))
805   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ))
806   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ))
807   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ))
808   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ))
809   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ))
810   PORT_DIPSETTING(    0x18, DEF_STR( 1C_4C ))
803   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )
804   PORT_DIPSETTING(    0x08, DEF_STR( 4C_1C ) )
805   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
806   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
807   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
808   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
809   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
810   PORT_DIPSETTING(    0x18, DEF_STR( 1C_4C ) )
811811   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
812812   PORT_DIPNAME( 0x40, 0x40, "Starting Coin" )
813813   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
r3115r3116
817817   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
818818
819819   PORT_START("DSWB")   /* Dip switch B */
820   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ))
820   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
821821   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
822822   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
823823   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
824824   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
825   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ))
825   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
826826   PORT_DIPSETTING(    0x00, "1" )
827827   PORT_DIPSETTING(    0x04, "4" )
828828   PORT_DIPSETTING(    0x08, "2" )
829829   PORT_DIPSETTING(    0x0c, "3" )
830   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ))
830   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
831831   PORT_DIPSETTING(    0x30, "200000 500000" )
832832   PORT_DIPSETTING(    0x20, "400000 1000000" )
833833   PORT_DIPSETTING(    0x10, "1000000 3000000" )
834834   PORT_DIPSETTING(    0x00, "No Extend" )
835835   PORT_DIPNAME( 0x40, 0x40, "Demo Sound" )
836   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
836   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
837837   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
838838   PORT_DIPNAME( 0x80, 0x80, "Test Mode" )
839   PORT_DIPSETTING(    0x80, DEF_STR( Off ))
839   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
840840   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
841841
842842   PORT_START("SYSTEM")   /* START BUTTONS */
r3115r3116
871871   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
872872
873873   PORT_START("DSWA")   /* Dip switch A  */
874   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ))
875   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ))
876   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ))
877   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ))
878   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ))
879   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ))
880   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ))
881   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ))
874   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
875   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
876   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
877   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
878   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
879   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
880   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
881   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
882882   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
883   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ))
884   PORT_DIPSETTING(    0x08, DEF_STR( 4C_1C ))
885   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ))
886   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ))
887   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ))
888   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ))
889   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ))
890   PORT_DIPSETTING(    0x18, DEF_STR( 1C_4C ))
883   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )
884   PORT_DIPSETTING(    0x08, DEF_STR( 4C_1C ) )
885   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
886   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
887   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
888   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
889   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
890   PORT_DIPSETTING(    0x18, DEF_STR( 1C_4C ) )
891891   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
892892   PORT_DIPNAME( 0x40, 0x40, "Starting Coin" )
893893   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
r3115r3116
897897   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
898898
899899   PORT_START("DSWB")   /* Dip switch B  */
900   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ))
900   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
901901   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
902902   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
903903   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
904904   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
905   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ))
905   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
906906   PORT_DIPSETTING(    0x00, "1" )
907907   PORT_DIPSETTING(    0x04, "4" )
908908   PORT_DIPSETTING(    0x08, "2" )
r3115r3116
914914   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
915915   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
916916   PORT_DIPNAME( 0x40, 0x40, "Demo Sound" )
917   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
917   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
918918   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
919919   PORT_DIPNAME( 0x80, 0x80, "Test Mode" )
920   PORT_DIPSETTING(    0x80, DEF_STR( Off ))
920   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
921921   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
922922
923923   PORT_START("SYSTEM")   /* START BUTTONS */
r3115r3116
19801980
19811981static READ16_HANDLER( rdx_v33_eeprom_r )
19821982{
1983   return input_port_read(machine, "SYSTEM") | (eeprom_read_bit()<<4);
1983   return input_port_read(machine, "SYSTEM");
19841984}
19851985
19861986
r3115r3116
21082108ADDRESS_MAP_END
21092109
21102110
2111
2112
21132111static INPUT_PORTS_START( rdx_v33 )
21142112   PORT_START("SYSTEM")
21152113   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
21162114   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
21172115   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
21182116   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
2119   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )    /* 0x0010 = eeprom */
2117   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
21202118   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
21212119   PORT_DIPNAME( 0x0040, 0x0040, "Test Mode" )
2122   PORT_DIPSETTING(      0x0040, DEF_STR( Off ))
2120   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
21232121   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
21242122   PORT_BIT( 0xff80, IP_ACTIVE_LOW, IPT_UNUSED )
21252123
src/mame/drivers/scramble.c
r3115r3116
7272   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxold_videoram_r)
7373   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
7474
75   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
76   AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r)
77   AM_RANGE(0xa002, 0xa002) AM_READ(input_port_2_r)
75   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
76   AM_RANGE(0xa001, 0xa001) AM_READ_PORT("IN1")
77   AM_RANGE(0xa002, 0xa002) AM_READ_PORT("IN2")
7878
7979   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
8080//  AM_RANGE(0x8100, 0x8103) AM_READ(ppi8255_0_r)
r3115r3116
110110   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
111111   AM_RANGE(0x5100, 0x51ff) AM_READ(SMH_NOP)   /* test mode mirror? */
112112   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
113   AM_RANGE(0x8000, 0x8000) AM_READ(input_port_0_r)
114   AM_RANGE(0x8001, 0x8001) AM_READ(input_port_1_r)
115   AM_RANGE(0x8002, 0x8002) AM_READ(input_port_2_r)
116   AM_RANGE(0x8003, 0x8003) AM_READ(input_port_3_r)
113   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN0")
114   AM_RANGE(0x8001, 0x8001) AM_READ_PORT("IN1")
115   AM_RANGE(0x8002, 0x8002) AM_READ_PORT("IN2")
116   AM_RANGE(0x8003, 0x8003) AM_READ_PORT("IN3")
117117ADDRESS_MAP_END
118118
119119static ADDRESS_MAP_START( explorer_writemem, ADDRESS_SPACE_PROGRAM, 8 )
r3115r3116
262262   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
263263   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxold_videoram_r)
264264   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
265   AM_RANGE(0x8000, 0x8000) AM_READ(input_port_0_r)
266   AM_RANGE(0x8001, 0x8001) AM_READ(input_port_1_r)
267   AM_RANGE(0x8002, 0x8002) AM_READ(input_port_2_r)
268   AM_RANGE(0x8003, 0x8003) AM_READ(input_port_3_r)
265   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN0")
266   AM_RANGE(0x8001, 0x8001) AM_READ_PORT("IN1")
267   AM_RANGE(0x8002, 0x8002) AM_READ_PORT("IN2")
268   AM_RANGE(0x8003, 0x8003) AM_READ_PORT("IN3")
269269ADDRESS_MAP_END
270270
271271static ADDRESS_MAP_START( hotshock_writemem, ADDRESS_SPACE_PROGRAM, 8 )
r3115r3116
400400   AM_RANGE(0x8000, 0x8000) AM_WRITE(soundlatch_w)
401401   AM_RANGE(0x9000, 0x9000) AM_WRITE(hotshock_sh_irqtrigger_w)
402402   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
403   AM_RANGE(0x8000, 0x8000) AM_READ(input_port_0_r)
404   AM_RANGE(0x8001, 0x8001) AM_READ(input_port_1_r)
405   AM_RANGE(0x8002, 0x8002) AM_READ(input_port_2_r)
406   AM_RANGE(0x8003, 0x8003) AM_READ(input_port_3_r)
403   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN0")
404   AM_RANGE(0x8001, 0x8001) AM_READ_PORT("IN1")
405   AM_RANGE(0x8002, 0x8002) AM_READ_PORT("IN2")
406   AM_RANGE(0x8003, 0x8003) AM_READ_PORT("IN3")
407407   AM_RANGE(0xa000, 0xdfff) AM_ROM
408408   AM_RANGE(0xe800, 0xebff) AM_RAM
409409ADDRESS_MAP_END
r3115r3116
471471
472472static ADDRESS_MAP_START( hunchbks_readport, ADDRESS_SPACE_IO, 8 )
473473   AM_RANGE(0x00, 0x00) AM_READ(hncholms_prot_r)
474    AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(input_port_3_r)
474    AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE")
475475ADDRESS_MAP_END
476476
477477static INPUT_PORTS_START( scramble )
r3115r3116
933933   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
934934INPUT_PORTS_END
935935
936
937/* ckongs coinage DIPs are spread accross two input ports */
938static CUSTOM_INPUT( ckongs_coinage_r )
939{
940   int bit_mask = (FPTR)param;
941   return (input_port_read(field->port->machine, "FAKE") & bit_mask) ? 0x01 : 0x00;
942}
943
944
936945static INPUT_PORTS_START( ckongs )
937946   PORT_START("IN0")
938947   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
r3115r3116
945954   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
946955
947956   PORT_START("IN1")
948   /* the coinage dip switch is spread across bits 0/1 of port 1 and bit 3 of port 2. */
949   /* To handle that, we swap bits 0/1 of port 1 and bits 1/2 of port 2 - this is handled */
950   /* by ckongs_input_port_N_r() */
951   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
952   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
953   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
954   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Lives ) )
955   PORT_DIPSETTING(    0x02, "3" )
956   PORT_DIPSETTING(    0x00, "4" )
957   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ckongs_coinage_r, (void *)0x01)
958   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ckongs_coinage_r, (void *)0x02)
957959   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
958960   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
959961   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
r3115r3116
962964   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
963965
964966   PORT_START("IN2")
965   /* the coinage dip switch is spread across bits 0/1 of port 1 and bit 3 of port 2. */
966   /* To handle that, we swap bits 0/1 of port 1 and bits 1/2 of port 2 - this is handled */
967   /* by ckongs_input_port_N_r() */
968967   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
969   PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Coinage ) )
970   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
971   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
972   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
973   PORT_DIPSETTING(    0x0a, DEF_STR( 2C_1C ) )
974   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_1C ) )
975   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_2C ) )
976   PORT_DIPSETTING(    0x06, DEF_STR( 1C_3C ) )
977   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
968   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
969   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
970   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
971   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
972   PORT_DIPSETTING(    0x04, "3" )
973   PORT_DIPSETTING(    0x00, "4" )
974   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ckongs_coinage_r, (void *)0x04)
978975   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
979976   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
980977   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
981978   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
979
980   PORT_START("FAKE")
981   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
982   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
983   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
984   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
985   PORT_DIPSETTING(    0x05, DEF_STR( 2C_1C ) )
986   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
987   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
988   PORT_DIPSETTING(    0x03, DEF_STR( 1C_3C ) )
989   PORT_DIPSETTING(    0x02, DEF_STR( 1C_4C ) )
982990INPUT_PORTS_END
983991
984992static INPUT_PORTS_START( mars )
src/mame/drivers/taitojc.c
r3115r3116
428428      {
429429         if (ACCESSING_BITS_24_31)
430430         {
431            UINT32 data = eeprom_read_bit() & 1;
432            data |= input_port_read(machine, "COINS") & 0xfe;
433            r |= data << 24;
431            r |= input_port_read(machine, "COINS") << 24;
434432         }
435433         return r;
436434      }
r3115r3116
10861084#ifdef UNUSED_DEFINITION
10871085static INPUT_PORTS_START( taitojc )
10881086   PORT_START("COINS")
1089   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_COIN4)
1090   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_COIN3)
1091   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_COIN2)
1092   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_COIN1)
1093   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1087   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN4 )
1088   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
1089   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
1090   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
1091   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
10941092   //PORT_SERVICE(0x02, 0x00)
1093   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
10951094
10961095   PORT_START("START")
1097   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_START4)
1098   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_START3)
1099   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_START2)
1100   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1)
1101   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE3)
1102   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE2)
1103   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
1104   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_TILT)
1096   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
1097   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 )
1098   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1099   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1100   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE3 )
1101   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 )
1102   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1103   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
11051104
11061105   PORT_START("UNUSED")
1107   PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED)
1106   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
11081107
11091108   PORT_START("BUTTONS")
1110   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON1)
1111   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON2)
1112   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON3)
1113   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON4)
1114   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON5)
1115   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON6)
1116   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON7)
1117   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON8)
1109   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
1110   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
1111   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 )
1112   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 )
1113   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 )
1114   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 )
1115   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON7 )
1116   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON8 )
11181117INPUT_PORTS_END
11191118#endif
11201119
11211120static INPUT_PORTS_START( dendeg )
11221121   PORT_START("COINS")
1123   PORT_BIT(0xe0, IP_ACTIVE_LOW, IPT_UNUSED)
1124   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_COIN1)
1125   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1122   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
1123   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
1124   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1125   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
11261126
11271127   PORT_START("START")
1128   PORT_BIT(0xe0, IP_ACTIVE_LOW, IPT_UNUSED)
1129   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1)
1130   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
1131   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_TILT)
1128   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
1129   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1130   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1131   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
11321132
11331133   PORT_START("UNUSED")
1134   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON7)       // Horn
1135   PORT_BIT(0xfe, IP_ACTIVE_LOW, IPT_UNUSED)
1134   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 )       // Horn
1135   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
11361136
11371137   PORT_START("BUTTONS")
1138   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED)
1139   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON6)      // Mascon 5
1140   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON4)      // Mascon 3
1141   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON2)      // Mascon 1
1142   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED)
1143   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON5)      // Mascon 4
1144   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON3)      // Mascon 2
1145   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1)      // Mascon 0
1138   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1139   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 )      // Mascon 5
1140   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 )      // Mascon 3
1141   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )      // Mascon 1
1142   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1143   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 )      // Mascon 4
1144   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 )      // Mascon 2
1145   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )      // Mascon 0
11461146
11471147   PORT_START("ANALOG1")      // Brake
11481148   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(5)
r3115r3116
11501150
11511151static INPUT_PORTS_START( landgear )
11521152   PORT_START("COINS")
1153   PORT_BIT(0xe0, IP_ACTIVE_LOW, IPT_UNUSED)
1154   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_COIN1)
1155   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1153   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
1154   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
1155   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1156   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
11561157
11571158   PORT_START("START")
1158   PORT_BIT(0xe0, IP_ACTIVE_LOW, IPT_UNUSED)
1159   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1)
1160   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
1161   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_TILT)
1159   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
1160   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1161   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1162   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
11621163
11631164   PORT_START("UNUSED")
1164   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1)      // View button
1165   PORT_BIT(0xfe, IP_ACTIVE_LOW, IPT_UNUSED)
1165   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )      // View button
1166   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
11661167
11671168   PORT_START("BUTTONS")
1168   PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED)
1169   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
11691170
11701171   PORT_START("ANALOG1")      // Lever X
11711172   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0xff, 0x00) PORT_SENSITIVITY(35) PORT_KEYDELTA(5)
r3115r3116
11791180
11801181static INPUT_PORTS_START( sidebs )
11811182   PORT_START("COINS")
1182   PORT_BIT(0xe0, IP_ACTIVE_LOW, IPT_UNUSED)
1183   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_COIN1)
1184   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1183   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
1184   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
1185   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1186   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
11851187
11861188   PORT_START("START")
1187   PORT_BIT(0xe0, IP_ACTIVE_LOW, IPT_UNUSED)
1188   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1)
1189   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE3)
1190   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE2)
1191   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
1192   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_TILT)
1189   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
1190   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1191   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE3 )
1192   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 )
1193   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1194   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
11931195
11941196   PORT_START("UNUSED")
1195   PORT_BIT(0xfe, IP_ACTIVE_LOW, IPT_UNUSED)
1196   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1)      // View button
1197   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
1198   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )      // View button
11971199
11981200   PORT_START("BUTTONS")
1199   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON2)      // Shift down
1200   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON3)      // Shift up
1201   PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_UNUSED)
1201   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )      // Shift down
1202   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 )      // Shift up
1203   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
12021204
12031205   PORT_START("ANALOG1")      // Steering
12041206   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(5)
r3115r3116
12131215// TODO
12141216static INPUT_PORTS_START( dangcurv )
12151217   PORT_START("COINS")
1216   PORT_BIT(0xe0, IP_ACTIVE_LOW, IPT_UNUSED)
1217   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_COIN1)
1218   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1218   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
1219   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
1220   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1221   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
12191222
12201223   PORT_START("START")
1221   PORT_BIT(0xe0, IP_ACTIVE_LOW, IPT_UNUSED)
1222   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1)
1223   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE3)
1224   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE2)
1225   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
1226   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_TILT)
1224   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
1225   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1226   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE3 )
1227   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 )
1228   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1229   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
12271230
12281231   PORT_START("UNUSED")
1229   PORT_BIT(0xfe, IP_ACTIVE_LOW, IPT_UNUSED)
1230   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1)      // View button
1232   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
1233   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )      // View button
12311234
12321235   PORT_START("BUTTONS")
1233   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON2)      // Shift down
1234   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON3)      // Shift up
1235   PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_UNUSED)
1236   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )      // Shift down
1237   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 )      // Shift up
1238   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
12361239
12371240   PORT_START("ANALOG1")      // Steering
12381241   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(5)
src/mame/drivers/pitnrun.c
r3115r3116
9696   AM_RANGE(0x8800, 0x8fff) AM_READ(pitnrun_videoram_r)
9797   AM_RANGE(0x9000, 0x9fff) AM_READ(pitnrun_videoram2_r)
9898   AM_RANGE(0xa000, 0xa0ff) AM_READ(SMH_RAM)
99   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_0_r)
100   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_1_r)
101   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_2_r)
99   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("SYSTEM")
100   AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW")
101   AM_RANGE(0xb800, 0xb800) AM_READ_PORT("INPUTS")
102102   AM_RANGE(0xd800, 0xd800) AM_READ(pitnrun_mcu_status_r)
103103   AM_RANGE(0xd000, 0xd000) AM_READ(pitnrun_mcu_data_r)
104104   AM_RANGE(0xf000, 0xf000) AM_READ(watchdog_reset_r)
r3115r3116
174174ADDRESS_MAP_END
175175
176176static INPUT_PORTS_START( pitnrun )
177   PORT_START("IN0")
177   PORT_START("SYSTEM")
178178   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1  )
179179   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
180180   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
r3115r3116
184184   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
185185   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
186186
187   PORT_START("DSW0")
187   PORT_START("INPUTS")
188   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
189   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
190   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
191   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
192   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
193   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
194   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
195   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
196
197   PORT_START("DSW")
188198   PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) )
189199   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
190200   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
r3115r3116
205215   PORT_DIPNAME( 0x80, 0x00, "No Hit (Cheat)")
206216   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
207217   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
208
209   PORT_START("IN1")
210   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
211   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
212   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
213   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
214   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
215   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
216   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
217   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
218218INPUT_PORTS_END
219219
220220
src/mame/drivers/tehkanwc.c
r3115r3116
247247   AM_RANGE(0xec00, 0xec01) AM_RAM_WRITE(tehkanwc_scroll_x_w)
248248   AM_RANGE(0xec02, 0xec02) AM_RAM_WRITE(tehkanwc_scroll_y_w)
249249   AM_RANGE(0xf800, 0xf801) AM_READWRITE(tehkanwc_track_0_r, tehkanwc_track_0_reset_w)   /* track 0 x/y */
250   AM_RANGE(0xf802, 0xf802) AM_READWRITE(input_port_9_r, gridiron_led0_w)   /* Coin & Start */
251   AM_RANGE(0xf803, 0xf803) AM_READ_PORT("P1BUT")                     /* joy0 - button */
252   AM_RANGE(0xf806, 0xf806) AM_READ_PORT("SYSTEM")                     /* Start */
250   AM_RANGE(0xf802, 0xf802) AM_READ_PORT("SYSTEM")   AM_WRITE(gridiron_led0_w)
251   AM_RANGE(0xf803, 0xf803) AM_READ_PORT("P1BUT")
252   AM_RANGE(0xf806, 0xf806) AM_READ_PORT("SYSTEM")
253253   AM_RANGE(0xf810, 0xf811) AM_READWRITE(tehkanwc_track_1_r, tehkanwc_track_1_reset_w)   /* track 1 x/y */
254254   AM_RANGE(0xf812, 0xf812) AM_WRITE(gridiron_led1_w)
255   AM_RANGE(0xf813, 0xf813) AM_READ_PORT("P2BUT")                     /* joy1 - button */
255   AM_RANGE(0xf813, 0xf813) AM_READ_PORT("P2BUT")
256256   AM_RANGE(0xf820, 0xf820) AM_READWRITE(soundlatch2_r, sound_command_w)   /* answer from the sound CPU */
257   AM_RANGE(0xf840, 0xf840) AM_READ_PORT("DSW1") AM_WRITE(sub_cpu_halt_w)   /* DSW1 */
258   AM_RANGE(0xf850, 0xf850) AM_READ_PORT("DSW2") AM_WRITE(SMH_NOP)         /* DSW2, ?? writes 0x00 or 0xff */
257   AM_RANGE(0xf840, 0xf840) AM_READ_PORT("DSW1") AM_WRITE(sub_cpu_halt_w)
258   AM_RANGE(0xf850, 0xf850) AM_READ_PORT("DSW2") AM_WRITE(SMH_NOP)         /* ?? writes 0x00 or 0xff */
259259   AM_RANGE(0xf860, 0xf860) AM_READWRITE(watchdog_reset_r, tehkanwc_flipscreen_x_w)
260   AM_RANGE(0xf870, 0xf870) AM_READ_PORT("DSW3") AM_WRITE(tehkanwc_flipscreen_y_w)   /* DSW3 */
260   AM_RANGE(0xf870, 0xf870) AM_READ_PORT("DSW3") AM_WRITE(tehkanwc_flipscreen_y_w)
261261ADDRESS_MAP_END
262262
263263static ADDRESS_MAP_START( sub_mem, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/suprridr.c
r3115r3116
168168   AM_RANGE(0x9800, 0x983f) AM_RAM
169169   AM_RANGE(0x9840, 0x987f) AM_RAM AM_BASE(&spriteram)
170170   AM_RANGE(0x9880, 0x9bff) AM_RAM
171   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
172   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
173   AM_RANGE(0xb000, 0xb000) AM_READWRITE(input_port_2_r, nmi_enable_w)
171   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("INPUTS")
172   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("SYSTEM")
173   AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW") AM_WRITE(nmi_enable_w)
174174   AM_RANGE(0xb002, 0xb003) AM_WRITE(coin_lock_w)
175175   AM_RANGE(0xb006, 0xb006) AM_WRITE(suprridr_flipx_w)
176176   AM_RANGE(0xb007, 0xb007) AM_WRITE(suprridr_flipy_w)
r3115r3116
237237
238238
239239static INPUT_PORTS_START( suprridr )
240   PORT_START("INPUTS")      /* IN0 */
241   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(suprridr_control_r, 0)
240   PORT_START("INPUTS")
241   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(suprridr_control_r, NULL)
242242
243   PORT_START("SYSTEM")      /* IN1 */
243   PORT_START("SYSTEM")
244244   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
245245   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
246246   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
247247   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
248248   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
249249
250   PORT_START("DSW1")      /* DSW0 */
250   PORT_START("DSW")
251251   PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) )
252252   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
253253   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
src/mame/drivers/spy.c
r3115r3116
353353static ADDRESS_MAP_START( spy_readmem, ADDRESS_SPACE_PROGRAM, 8 )
354354   AM_RANGE(0x0000, 0x07ff) AM_READ(spy_bankedram1_r)
355355   AM_RANGE(0x0800, 0x1aff) AM_READ(SMH_RAM)
356   AM_RANGE(0x3fd0, 0x3fd0) AM_READ(input_port_4_r)
357   AM_RANGE(0x3fd1, 0x3fd1) AM_READ(input_port_0_r)
358   AM_RANGE(0x3fd2, 0x3fd2) AM_READ(input_port_1_r)
359   AM_RANGE(0x3fd3, 0x3fd3) AM_READ(input_port_2_r)
360   AM_RANGE(0x3fe0, 0x3fe0) AM_READ(input_port_3_r)
356   AM_RANGE(0x3fd0, 0x3fd0) AM_READ_PORT("SYSTEM")
357   AM_RANGE(0x3fd1, 0x3fd1) AM_READ_PORT("P1")
358   AM_RANGE(0x3fd2, 0x3fd2) AM_READ_PORT("P2")
359   AM_RANGE(0x3fd3, 0x3fd3) AM_READ_PORT("DSW1")
360   AM_RANGE(0x3fe0, 0x3fe0) AM_READ_PORT("DSW2")
361361   AM_RANGE(0x2000, 0x5fff) AM_READ(K052109_051960_r)
362362   AM_RANGE(0x6000, 0x7fff) AM_READ(SMH_BANK1)
363363   AM_RANGE(0x8000, 0xffff) AM_READ(SMH_ROM)
src/mame/drivers/psikyo.c
r3115r3116
100100
101101***************************************************************************/
102102
103static int psikyo_readcoinport(running_machine *machine, int has_mcu)
103static CUSTOM_INPUT( z80_nmi_r )
104104{
105   int ret = input_port_read(machine, "COIN") & ~0x84;
105   int ret = 0x00;
106106
107   if (has_mcu)
108   {
109      /* Don't know exactly what this bit is, but s1945 and tengai
110           both spin waiting for it to go low during POST.  Also,
111           the following code in tengai (don't know where or if it is
112           reached) waits for it to pulse:
113
114           01A546:  move.b  (A2), D0    ; A2 = $c00003
115           01A548:  andi.b  #$4, D0
116           01A54C:  beq     $1a546
117           01A54E:  move.b  (A2), D0
118           01A550:  andi.b  #$4, D0
119           01A554:  bne     $1a54e
120
121           Interestingly, s1945jn has the code that spins on this bit,
122           but said code is never reached.  Prototype? */
123      if (mcu_status) ret |= 0x04;
124      mcu_status = !mcu_status;   /* hack */
125   }
126
127107   if (z80_nmi)
128108   {
129      ret |= 0x80;
109      ret = 0x01;
130110
131111      /* main CPU might be waiting for sound CPU to finish NMI,
132112           so set a timer to give sound CPU a chance to run */
r3115r3116
137117   return ret;
138118}
139119
120static CUSTOM_INPUT( mcu_status_r )
121{
122   int ret = 0x00;
123
124   /* Don't know exactly what this bit is, but s1945 and tengai
125        both spin waiting for it to go low during POST.  Also,
126        the following code in tengai (don't know where or if it is
127        reached) waits for it to pulse:
128
129        01A546:  move.b  (A2), D0    ; A2 = $c00003
130        01A548:  andi.b  #$4, D0
131        01A54C:  beq     $1a546
132        01A54E:  move.b  (A2), D0
133        01A550:  andi.b  #$4, D0
134        01A554:  bne     $1a54e
135
136        Interestingly, s1945jn has the code that spins on this bit,
137        but said code is never reached.  Prototype? */
138   if (mcu_status)
139      ret = 0x01;
140
141   mcu_status = !mcu_status;   /* hack */
142
143   return ret;
144}
145
140146static READ32_HANDLER( sngkace_input_r )
141147{
142148   switch(offset)
143149   {
144      case 0x0:   return (input_port_read(machine, "IN0") << 16) | 0xffff;
145      case 0x1:   return (input_port_read(machine, "DSW1") << 16) | input_port_read(machine, "DSW3");
146      case 0x2:   return (psikyo_readcoinport(machine, 0) << 16) | input_port_read(machine, "DSW2");
150      case 0x0:   return input_port_read(machine, "P1_P2");
151      case 0x1:   return input_port_read(machine, "DSW");
152      case 0x2:   return input_port_read(machine, "COIN");
147153      default:   logerror("PC %06X - Read input %02X !\n", activecpu_get_pc(), offset * 2);
148154               return 0;
149155   }
r3115r3116
153159{
154160   switch(offset)
155161   {
156      case 0x0:   return (input_port_read(machine, "IN0") << 16) | psikyo_readcoinport(machine, 0);
157      case 0x1:   return (input_port_read(machine, "DSW1") << 16) | input_port_read(machine, "DSW2");
162      case 0x0:   return input_port_read(machine, "P1_P2");
163      case 0x1:   return input_port_read(machine, "DSW");
158164      default:   logerror("PC %06X - Read input %02X !\n", activecpu_get_pc(), offset*2);
159165               return 0;
160166   }
r3115r3116
309315{
310316   switch(offset)
311317   {
312      case 0x0:   return (input_port_read(machine, "IN0") << 16) | psikyo_readcoinport(machine, 1);
313      case 0x1:   return (((input_port_read(machine, "DSW1") << 16) | input_port_read(machine, "DSW2")) & 0xffff000f) | s1945_mcu_r(machine, offset-1, mem_mask);
318      case 0x0:   return input_port_read(machine, "P1_P2");
319      case 0x1:   return (input_port_read(machine, "DSW") & 0xffff000f) | s1945_mcu_r(machine, offset-1, mem_mask);
314320      case 0x2:   return s1945_mcu_r(machine, offset-1, mem_mask);
315321      default:   logerror("PC %06X - Read input %02X !\n", activecpu_get_pc(), offset*2);
316322               return 0;
r3115r3116
506512***************************************************************************/
507513
508514#define PSIKYO_PORT_PLAYER1 \
509   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_START1                       ) \
510   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) \
511   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) \
512   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) \
513   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) \
514   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) \
515   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) \
516   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
515   PORT_BIT(  0x01000000, IP_ACTIVE_LOW, IPT_START1 ) \
516   PORT_BIT(  0x02000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) \
517   PORT_BIT(  0x04000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) \
518   PORT_BIT(  0x08000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) \
519   PORT_BIT(  0x10000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) \
520   PORT_BIT(  0x20000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) \
521   PORT_BIT(  0x40000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) \
522   PORT_BIT(  0x80000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
517523
518524#define PSIKYO_PORT_PLAYER2 \
519   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_START2                       ) \
520   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) \
521   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) \
522   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) \
523   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) \
524   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) \
525   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) \
526   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
525   PORT_BIT(  0x00010000, IP_ACTIVE_LOW, IPT_START2 ) \
526   PORT_BIT(  0x00020000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) \
527   PORT_BIT(  0x00040000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) \
528   PORT_BIT(  0x00080000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) \
529   PORT_BIT(  0x00100000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) \
530   PORT_BIT(  0x00200000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) \
531   PORT_BIT(  0x00400000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) \
532   PORT_BIT(  0x00800000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
527533
528#define PSIKYO_PORT_COIN \
529   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN1    ) \
530   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_COIN2    ) \
531   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_SPECIAL  ) \
532   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN  ) \
533   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_SERVICE1 ) \
534   PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW ) \
535   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_TILT     ) \
536   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL  )   // From Sound CPU
537534
538535
539536/***************************************************************************
r3115r3116
541538***************************************************************************/
542539
543540static INPUT_PORTS_START( samuraia )
544
545   PORT_START("IN0")      // IN0 - c00000&1
541   PORT_START("P1_P2")      /* c00000&1 */
542   PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED )
546543   PSIKYO_PORT_PLAYER2
547
548544   PSIKYO_PORT_PLAYER1
549545
550   PORT_START("COIN")      // IN1 - c00008&9
551   PSIKYO_PORT_COIN
546   PORT_START("COIN")
547   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
548   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
549   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN )
550   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
551   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
552   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
553   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
554   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNKNOWN )
555   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
556   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
557   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
558   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
559   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
560   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
561   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
562   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
552563
553   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
554   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
555   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
556   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
557   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
558   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
559   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
560   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
564   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN1 )
565   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 )
566   PORT_BIT( 0x00040000, IP_ACTIVE_HIGH, IPT_SPECIAL )
567   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_UNKNOWN )
568   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_SERVICE1 )
569   PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW )
570   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_TILT )
571   PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(z80_nmi_r, NULL)   // From Sound CPU
572   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
573   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
574   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
575   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
576   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
577   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
578   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
579   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
561580
562   PORT_START("DSW1")      // IN2 - c00004&5
563   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
564   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
565   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
566   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
567   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
568   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
569   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
570   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
571   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
572   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
573   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
574   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
575   PORT_DIPSETTING(      0x0020, "1" )
576   PORT_DIPSETTING(      0x0010, "2" )
577   PORT_DIPSETTING(      0x0030, "3" )
578   PORT_DIPSETTING(      0x0000, "4" )
579   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Bonus_Life ) )
580   PORT_DIPSETTING(      0x0040, "400K" )
581   PORT_DIPSETTING(      0x0000, "600K" )
582   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
583
584   PORT_DIPNAME( 0x0100, 0x0100, "Credits/Coinage" )   // [Free Play] on all for free play
585   PORT_DIPSETTING(      0x0100, "A+B/A&B" )
586   PORT_DIPSETTING(      0x0000, "A&B/A [Free Play]" )
587   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) )
588   PORT_DIPSETTING(      0x0a00, DEF_STR( 3C_1C ) )
589   PORT_DIPSETTING(      0x0c00, DEF_STR( 2C_1C ) )
590   PORT_DIPSETTING(      0x0e00, DEF_STR( 1C_1C ) )
591   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_2C ) )
592   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_3C ) )
593   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
594   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_5C ) )
595   PORT_DIPSETTING(      0x0000, "1C 6C [Free Play]" )
596   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) )
597   PORT_DIPSETTING(      0x5000, DEF_STR( 3C_1C ) )
598   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
599   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_1C ) )
600   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_2C ) )
601   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_3C ) )
602   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )
603   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_5C ) )
604   PORT_DIPSETTING(      0x0000, "1C 6C [Free Play]" )
605   PORT_DIPNAME( 0x8000, 0x8000, "2C Start, 1C Continue" )
606   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
607   PORT_DIPSETTING(      0x0000, "On [Free Play]" ) // Forces 1C_1C
608
609   PORT_START("DSW2")      // IN3 - c00002&3
610   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
611   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
612   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
613   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
614   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
615   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
616   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
617   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
618
619   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
620   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
621   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
622   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
623   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
624   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
625   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
626   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
627
628   PORT_START("DSW3")      // IN4 - c00006&7
629
581   PORT_START("DSW")      /* c00004 -> c00007 */
630582   /***********************************************
631583
632584    This Dip port is bit based:
r3115r3116
640592        1 1 1 0 Taiwan With FBI logo??
641593
642594    ************************************************/
595   PORT_DIPNAME( 0x000000ff, 0x000000ff, "Country" )
596   PORT_DIPSETTING(          0x000000ff, DEF_STR( World ) )
597   PORT_DIPSETTING(          0x000000ef, "USA & Canada" )
598   PORT_DIPSETTING(          0x000000df, "Korea" )
599   PORT_DIPSETTING(          0x000000bf, "Hong Kong" )
600   PORT_DIPSETTING(          0x0000007f, "Taiwan" )
601   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
602   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
603   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
604   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
605   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
606   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
607   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
608   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
643609
644   PORT_DIPNAME( 0x00ff, 0x00ff, "Country" )
645   PORT_DIPSETTING(      0x00ff, DEF_STR( World ) )
646   PORT_DIPSETTING(      0x00ef, "USA & Canada" )
647   PORT_DIPSETTING(      0x00df, "Korea" )
648   PORT_DIPSETTING(      0x00bf, "Hong Kong" )
649   PORT_DIPSETTING(      0x007f, "Taiwan" )
650
651   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
652   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
653   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
654   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
655   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
656   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
657   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
658   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
659
610   PORT_DIPNAME( 0x00010000, 0x00010000, DEF_STR( Flip_Screen ) )
611   PORT_DIPSETTING(          0x00010000, DEF_STR( Off ) )
612   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
613   PORT_DIPNAME( 0x00020000, 0x00000000, DEF_STR( Demo_Sounds ) )
614   PORT_DIPSETTING(          0x00020000, DEF_STR( Off ) )
615   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
616   PORT_DIPNAME( 0x000c0000, 0x000c0000, DEF_STR( Difficulty ) )
617   PORT_DIPSETTING(          0x00080000, DEF_STR( Easy ) )
618   PORT_DIPSETTING(          0x000c0000, DEF_STR( Normal ) )
619   PORT_DIPSETTING(          0x00040000, DEF_STR( Hard ) )
620   PORT_DIPSETTING(          0x00000000, DEF_STR( Hardest ) )
621   PORT_DIPNAME( 0x00300000, 0x00300000, DEF_STR( Lives ) )
622   PORT_DIPSETTING(          0x00200000, "1" )
623   PORT_DIPSETTING(          0x00100000, "2" )
624   PORT_DIPSETTING(          0x00300000, "3" )
625   PORT_DIPSETTING(          0x00000000, "4" )
626   PORT_DIPNAME( 0x00400000, 0x00400000, DEF_STR( Bonus_Life ) )
627   PORT_DIPSETTING(          0x00400000, "400K" )
628   PORT_DIPSETTING(          0x00000000, "600K" )
629   PORT_SERVICE( 0x00800000, IP_ACTIVE_LOW )
630   PORT_DIPNAME( 0x01000000, 0x01000000, "Credits/Coinage" )   // [Free Play] on all for free play
631   PORT_DIPSETTING(          0x01000000, "A+B/A&B" )
632   PORT_DIPSETTING(          0x00000000, "A&B/A [Free Play]" )
633   PORT_DIPNAME( 0x0e000000, 0x0e000000, DEF_STR( Coin_A ) )
634   PORT_DIPSETTING(          0x0a000000, DEF_STR( 3C_1C ) )
635   PORT_DIPSETTING(          0x0c000000, DEF_STR( 2C_1C ) )
636   PORT_DIPSETTING(          0x0e000000, DEF_STR( 1C_1C ) )
637   PORT_DIPSETTING(          0x08000000, DEF_STR( 1C_2C ) )
638   PORT_DIPSETTING(          0x06000000, DEF_STR( 1C_3C ) )
639   PORT_DIPSETTING(          0x04000000, DEF_STR( 1C_4C ) )
640   PORT_DIPSETTING(          0x02000000, DEF_STR( 1C_5C ) )
641   PORT_DIPSETTING(          0x00000000, "1C 6C [Free Play]" )
642   PORT_DIPNAME( 0x70000000, 0x70000000, DEF_STR( Coin_B ) )
643   PORT_DIPSETTING(          0x50000000, DEF_STR( 3C_1C ) )
644   PORT_DIPSETTING(          0x60000000, DEF_STR( 2C_1C ) )
645   PORT_DIPSETTING(          0x70000000, DEF_STR( 1C_1C ) )
646   PORT_DIPSETTING(          0x40000000, DEF_STR( 1C_2C ) )
647   PORT_DIPSETTING(          0x30000000, DEF_STR( 1C_3C ) )
648   PORT_DIPSETTING(          0x20000000, DEF_STR( 1C_4C ) )
649   PORT_DIPSETTING(          0x10000000, DEF_STR( 1C_5C ) )
650   PORT_DIPSETTING(          0x00000000, "1C 6C [Free Play]" )
651   PORT_DIPNAME( 0x80000000, 0x80000000, "2C Start, 1C Continue" )
652   PORT_DIPSETTING(          0x80000000, DEF_STR( Off ) )
653   PORT_DIPSETTING(          0x00000000, "On [Free Play]" ) // Forces 1C_1C
660654INPUT_PORTS_END
661655
662656static INPUT_PORTS_START( sngkace )
657   PORT_INCLUDE( samuraia )
663658
664   PORT_START("IN0")      // IN0 - c00000&1
665   PSIKYO_PORT_PLAYER2
666
667   PSIKYO_PORT_PLAYER1
668
669   PORT_START("COIN")      // IN1 - c00008&9
670   PSIKYO_PORT_COIN
671
672   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
673   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
674   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
675   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
676   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
677   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
678   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
679   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
680
681   PORT_START("DSW1")      // IN2 - c00004&5
682   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
683   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
684   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
685   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
686   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
687   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
688   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
689   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
690   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
691   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
692   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
693   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
694   PORT_DIPSETTING(      0x0020, "1" )
695   PORT_DIPSETTING(      0x0010, "2" )
696   PORT_DIPSETTING(      0x0030, "3" )
697   PORT_DIPSETTING(      0x0000, "4" )
698   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Bonus_Life ) )
699   PORT_DIPSETTING(      0x0040, "400K" )
700   PORT_DIPSETTING(      0x0000, "600K" )
701   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
702
703   PORT_DIPNAME( 0x0100, 0x0100, "Credits/Coinage" )   // [Free Play] on all for free play
704   PORT_DIPSETTING(      0x0100, "A+B/A&B" )
705   PORT_DIPSETTING(      0x0000, "A&B/A [Free Play]" )
706   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) )
707   PORT_DIPSETTING(      0x0a00, DEF_STR( 3C_1C ) )
708   PORT_DIPSETTING(      0x0c00, DEF_STR( 2C_1C ) )
709   PORT_DIPSETTING(      0x0e00, DEF_STR( 1C_1C ) )
710   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_2C ) )
711   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_3C ) )
712   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
713   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_5C ) )
714   PORT_DIPSETTING(      0x0000, "1C 6C [Free Play]" )
715   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) )
716   PORT_DIPSETTING(      0x5000, DEF_STR( 3C_1C ) )
717   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
718   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_1C ) )
719   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_2C ) )
720   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_3C ) )
721   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )
722   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_5C ) )
723   PORT_DIPSETTING(      0x0000, "1C 6C [Free Play]" )
724   PORT_DIPNAME( 0x8000, 0x8000, "2C Start, 1C Continue" )
725   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
726   PORT_DIPSETTING(      0x0000, "On [Free Play]" ) // Forces 1C_1C
727
728   PORT_START("DSW2")      // IN3 - c00002&3
729   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
730   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
731   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
732   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
733   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
734   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
735   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
736   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
737
738   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
739   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
740   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
741   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
742   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
743   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
744   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
745   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
746
747   PORT_START("DSW3")      // IN4 - c00006&7
748
659   PORT_MODIFY("DSW")      /* c00004 -> c00007 */
749660   /***********************************************
750661
751662    This Dip port is bit based:
r3115r3116
759670        1 1 1 0 Taiwan
760671
761672    ************************************************/
762
763673#if 0 // See Patch in MACHINE_RESET, only text not logo
764   PORT_DIPNAME( 0x00ff, 0x00ff, "Country" )
765   PORT_DIPSETTING(      0x00ff, DEF_STR( Japan ) )
766   PORT_DIPSETTING(      0x00ef, "USA & Canada" )
767   PORT_DIPSETTING(      0x00df, "Korea" )
768   PORT_DIPSETTING(      0x00bf, "Hong Kong" )
769   PORT_DIPSETTING(      0x007f, "Taiwan" )
674   PORT_DIPNAME( 0x000000ff, 0x000000ff, "Country" )
675   PORT_DIPSETTING(          0x000000ff, DEF_STR( Japan ) )
676   PORT_DIPSETTING(          0x000000ef, "USA & Canada" )
677   PORT_DIPSETTING(          0x000000df, "Korea" )
678   PORT_DIPSETTING(          0x000000bf, "Hong Kong" )
679   PORT_DIPSETTING(          0x0000007f, "Taiwan" )
770680#endif
771   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
772   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
773   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
774   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
775   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
776   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
777   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
778   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
779
681   PORT_BIT( 0x000000ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
780682INPUT_PORTS_END
781683
782684
r3115r3116
785687***************************************************************************/
786688
787689static INPUT_PORTS_START( btlkroad )
788
789   PORT_START("IN0")      // IN0 - c00000&1
690   PORT_START("P1_P2")         /* c00000 -> c00003 */
691   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
692   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
693   PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_SPECIAL )
694   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
695   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
696   PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
697   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_TILT )
698   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(z80_nmi_r, NULL)   // From Sound CPU
699   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
700   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
701   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
702   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
703   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
704   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
705   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
706   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
790707   PSIKYO_PORT_PLAYER2
791
792708   PSIKYO_PORT_PLAYER1
793709
794   PORT_START("COIN")      // IN1 - c00002&3
795   PSIKYO_PORT_COIN
796
797   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN               )
798   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
799   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
800   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
801   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN               )
802   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
803   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
804   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
805
806   PORT_START("DSW1")      // IN2 - c00004&5
807   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
808   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
809   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
810   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
811   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
812   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
813   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
814   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
815   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
816   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
817   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
818   PORT_DIPNAME( 0x0010, 0x0010, "Unknown 2-4" )   // used
819   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
820   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
821   PORT_DIPNAME( 0x0020, 0x0020, "Unknown 2-5" )   // used (energy lost?)
822   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
823   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
824   PORT_DIPNAME( 0x0040, 0x0040, "Use DSW 3 (Debug)" )
825   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
826   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
827   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
828
829   PORT_DIPNAME( 0x0100, 0x0100, "Credits/Coinage" )   // [Free Play] on all for free play
830   PORT_DIPSETTING(      0x0100, "A+B/A&B" )
831   PORT_DIPSETTING(      0x0000, "A&B/A [Free Play]" )
832   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) )
833   PORT_DIPSETTING(      0x0a00, DEF_STR( 3C_1C ) )
834   PORT_DIPSETTING(      0x0c00, DEF_STR( 2C_1C ) )
835   PORT_DIPSETTING(      0x0e00, DEF_STR( 1C_1C ) )
836   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_2C ) )
837   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_3C ) )
838   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
839   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_5C ) )
840   PORT_DIPSETTING(      0x0000, "1C 6C [Free Play]" )
841   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) )
842   PORT_DIPSETTING(      0x5000, DEF_STR( 3C_1C ) )
843   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
844   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_1C ) )
845   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_2C ) )
846   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_3C ) )
847   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )
848   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_5C ) )
849   PORT_DIPSETTING(      0x0000, "1C 6C [Free Play]" )
850   PORT_DIPNAME( 0x8000, 0x8000, "2C Start, 1C Continue" )
851   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
852   PORT_DIPSETTING(      0x0000, "On [Free Play]" ) // Forces 1C_1C
853
710   PORT_START("DSW")      /* c00004 -> c00007 */
854711   /***********************************************
855712
856713    Bit 0 1 2 3
r3115r3116
863720        Other   World
864721
865722    ************************************************/
866
867   PORT_START("DSW2")      // IN3 - c00006&7
868   PORT_DIPNAME( 0x000f, 0x0000, "Copyright (Country)" )
869   PORT_DIPSETTING(      0x000f, "Psikyo (Japan)" )
870   PORT_DIPSETTING(      0x000e, "Jaleco+Psikyo (USA & Canada)" )
871   PORT_DIPSETTING(      0x000c, "Psikyo (Korea)" )
872   PORT_DIPSETTING(      0x000a, "Psikyo (Hong Kong)" )
873   PORT_DIPSETTING(      0x0006, "Psikyo (Taiwan)" )
874   PORT_DIPSETTING(      0x0000, "Psikyo (World)" )
875
876   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
877   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
878   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
879   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK  )   // vblank   ACTIVE_HIGH fixes slowdowns, but is it right?
880
723   PORT_DIPNAME( 0x0000000f, 0x00000000, "Copyright (Country)" )
724   PORT_DIPSETTING(          0x0000000f, "Psikyo (Japan)" )
725   PORT_DIPSETTING(          0x0000000e, "Jaleco+Psikyo (USA & Canada)" )
726   PORT_DIPSETTING(          0x0000000c, "Psikyo (Korea)" )
727   PORT_DIPSETTING(          0x0000000a, "Psikyo (Hong Kong)" )
728   PORT_DIPSETTING(          0x00000006, "Psikyo (Taiwan)" )
729   PORT_DIPSETTING(          0x00000000, "Psikyo (World)" )
730   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
731   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
732   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
733   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_VBLANK  )   // vblank   ACTIVE_HIGH fixes slowdowns, but is it right?
881734   // This DSW is used for debugging the game
882   PORT_DIPNAME( 0x0100, 0x0100, "Unknown 3-0" )   // tested!
883   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
884   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
885   PORT_DIPNAME( 0x0200, 0x0200, "Unknown 3-1" )   // tested!
886   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
887   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
888   PORT_DIPNAME( 0x0400, 0x0400, "Unknown 3-2" )
889   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
890   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
891   PORT_DIPNAME( 0x0800, 0x0800, "Unknown 3-3" )
892   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
893   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
894   PORT_DIPNAME( 0x1000, 0x1000, "Unknown 3-4" )   // tested!
895   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
896   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
897   PORT_DIPNAME( 0x2000, 0x2000, "Unknown 3-5" )
898   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
899   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
900   PORT_DIPNAME( 0x4000, 0x4000, "Unknown 3-6" )
901   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
902   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
903   PORT_DIPNAME( 0x8000, 0x8000, "Unknown 3-7" )   // tested!
904   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
905   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
735   PORT_DIPNAME( 0x00000100, 0x00000100, "Unknown 3-0" )   // tested!
736   PORT_DIPSETTING(          0x00000100, DEF_STR( Off ) )
737   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
738   PORT_DIPNAME( 0x00000200, 0x00000200, "Unknown 3-1" )   // tested!
739   PORT_DIPSETTING(          0x00000200, DEF_STR( Off ) )
740   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
741   PORT_DIPNAME( 0x00000400, 0x00000400, "Unknown 3-2" )
742   PORT_DIPSETTING(          0x00000400, DEF_STR( Off ) )
743   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
744   PORT_DIPNAME( 0x00000800, 0x00000800, "Unknown 3-3" )
745   PORT_DIPSETTING(          0x00000800, DEF_STR( Off ) )
746   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
747   PORT_DIPNAME( 0x00001000, 0x00001000, "Unknown 3-4" )   // tested!
748   PORT_DIPSETTING(          0x00001000, DEF_STR( Off ) )
749   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
750   PORT_DIPNAME( 0x00002000, 0x00002000, "Unknown 3-5" )
751   PORT_DIPSETTING(          0x00002000, DEF_STR( Off ) )
752   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
753   PORT_DIPNAME( 0x00004000, 0x00004000, "Unknown 3-6" )
754   PORT_DIPSETTING(          0x00004000, DEF_STR( Off ) )
755   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
756   PORT_DIPNAME( 0x00008000, 0x00008000, "Unknown 3-7" )   // tested!
757   PORT_DIPSETTING(          0x00008000, DEF_STR( Off ) )
758   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
906759
760   PORT_DIPNAME( 0x00010000, 0x00010000, DEF_STR( Flip_Screen ) )
761   PORT_DIPSETTING(          0x00010000, DEF_STR( Off ) )
762   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
763   PORT_DIPNAME( 0x00020000, 0x00000000, DEF_STR( Demo_Sounds ) )
764   PORT_DIPSETTING(          0x00020000, DEF_STR( Off ) )
765   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
766   PORT_DIPNAME( 0x000c0000, 0x000c0000, DEF_STR( Difficulty ) )
767   PORT_DIPSETTING(          0x00080000, DEF_STR( Easy ) )
768   PORT_DIPSETTING(          0x000c0000, DEF_STR( Normal ) )
769   PORT_DIPSETTING(          0x00040000, DEF_STR( Hard ) )
770   PORT_DIPSETTING(          0x00000000, DEF_STR( Hardest ) )
771   PORT_DIPNAME( 0x00100000, 0x00100000, "Unknown 2-4" )   // used
772   PORT_DIPSETTING(          0x00100000, DEF_STR( Off ) )
773   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
774   PORT_DIPNAME( 0x00200000, 0x00200000, "Unknown 2-5" )   // used (energy lost?)
775   PORT_DIPSETTING(          0x00200000, DEF_STR( Off ) )
776   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
777   PORT_DIPNAME( 0x00400000, 0x00400000, "Use DSW 3 (Debug)" )
778   PORT_DIPSETTING(          0x00400000, DEF_STR( Off ) )
779   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
780   PORT_SERVICE( 0x00800000, IP_ACTIVE_LOW )
781   PORT_DIPNAME( 0x01000000, 0x01000000, "Credits/Coinage" )   // [Free Play] on all for free play
782   PORT_DIPSETTING(          0x01000000, "A+B/A&B" )
783   PORT_DIPSETTING(          0x00000000, "A&B/A [Free Play]" )
784   PORT_DIPNAME( 0x0e000000, 0x0e000000, DEF_STR( Coin_A ) )
785   PORT_DIPSETTING(          0x0a000000, DEF_STR( 3C_1C ) )
786   PORT_DIPSETTING(          0x0c000000, DEF_STR( 2C_1C ) )
787   PORT_DIPSETTING(          0x0e000000, DEF_STR( 1C_1C ) )
788   PORT_DIPSETTING(          0x08000000, DEF_STR( 1C_2C ) )
789   PORT_DIPSETTING(          0x06000000, DEF_STR( 1C_3C ) )
790   PORT_DIPSETTING(          0x04000000, DEF_STR( 1C_4C ) )
791   PORT_DIPSETTING(          0x02000000, DEF_STR( 1C_5C ) )
792   PORT_DIPSETTING(          0x00000000, "1C 6C [Free Play]" )
793   PORT_DIPNAME( 0x70000000, 0x70000000, DEF_STR( Coin_B ) )
794   PORT_DIPSETTING(          0x50000000, DEF_STR( 3C_1C ) )
795   PORT_DIPSETTING(          0x60000000, DEF_STR( 2C_1C ) )
796   PORT_DIPSETTING(          0x70000000, DEF_STR( 1C_1C ) )
797   PORT_DIPSETTING(          0x40000000, DEF_STR( 1C_2C ) )
798   PORT_DIPSETTING(          0x30000000, DEF_STR( 1C_3C ) )
799   PORT_DIPSETTING(          0x20000000, DEF_STR( 1C_4C ) )
800   PORT_DIPSETTING(          0x10000000, DEF_STR( 1C_5C ) )
801   PORT_DIPSETTING(          0x00000000, "1C 6C [Free Play]" )
802   PORT_DIPNAME( 0x80000000, 0x80000000, "2C Start, 1C Continue" )
803   PORT_DIPSETTING(          0x80000000, DEF_STR( Off ) )
804   PORT_DIPSETTING(          0x00000000, "On [Free Play]" ) // Forces 1C_1C
907805INPUT_PORTS_END
908806
909807
r3115r3116
912810***************************************************************************/
913811
914812static INPUT_PORTS_START( gunbird )
915
916   PORT_START("IN0")      // IN0 - c00000&1
813   PORT_START("P1_P2")         /* c00000 -> c00003 */
814   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
815   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
816   PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_SPECIAL )
817   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
818   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
819   PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
820   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_TILT )
821   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(z80_nmi_r, NULL)   // From Sound CPU
822   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
823   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
824   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
825   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
826   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
827   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
828   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
829   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
917830   PSIKYO_PORT_PLAYER2
918
919831   PSIKYO_PORT_PLAYER1
920832
921   PORT_START("COIN")      // IN1 - c00002&3
922   PSIKYO_PORT_COIN
923
924   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
925   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
926   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
927   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
928   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
929   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
930   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
931   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
932
933   PORT_START("DSW1")      // IN2 - c00004&5
934   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
935   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
936   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
937   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
938   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
939   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
940   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
941   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
942   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
943   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
944   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
945   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
946   PORT_DIPSETTING(      0x0020, "1" )
947   PORT_DIPSETTING(      0x0010, "2" )
948   PORT_DIPSETTING(      0x0030, "3" )
949   PORT_DIPSETTING(      0x0000, "4" )
950   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Bonus_Life ) )
951   PORT_DIPSETTING(      0x0040, "400K" )
952   PORT_DIPSETTING(      0x0000, "600K" )
953   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
954
955   PORT_DIPNAME( 0x0100, 0x0100, "Credits/Coinage" )   // [Free Play] on all for free play
956   PORT_DIPSETTING(      0x0100, "A+B/A&B" )
957   PORT_DIPSETTING(      0x0000, "A&B/A [Free Play]" )
958   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) )
959   PORT_DIPSETTING(      0x0a00, DEF_STR( 3C_1C ) )
960   PORT_DIPSETTING(      0x0c00, DEF_STR( 2C_1C ) )
961   PORT_DIPSETTING(      0x0e00, DEF_STR( 1C_1C ) )
962   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_2C ) )
963   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_3C ) )
964   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
965   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_5C ) )
966   PORT_DIPSETTING(      0x0000, "1C 6C [Free Play]" )
967   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) )
968   PORT_DIPSETTING(      0x5000, DEF_STR( 3C_1C ) )
969   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
970   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_1C ) )
971   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_2C ) )
972   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_3C ) )
973   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )
974   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_5C ) )
975   PORT_DIPSETTING(      0x0000, "1C 6C [Free Play]" )
976   PORT_DIPNAME( 0x8000, 0x8000, "2C Start, 1C Continue" )
977   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
978   PORT_DIPSETTING(      0x0000, "On [Free Play]" ) // Forces 1C_1C
979
980   PORT_START("DSW2")      // IN3 - c00006&7
981
833   PORT_START("DSW")      /* c00004 -> c00007 */
982834   /***********************************************
983835
984836    This Dip port is bit based:
r3115r3116
998850    Has no effects on Japan or Korea versions.
999851
1000852    ************************************************/
853   PORT_DIPNAME( 0x0000000f, 0x0000000f, "Country" )
854   PORT_DIPSETTING(          0x0000000f, DEF_STR( World ) )
855   PORT_DIPSETTING(          0x0000000e, DEF_STR( USA ) )
856   PORT_DIPSETTING(          0x0000000d, "Korea" )
857   PORT_DIPSETTING(          0x0000000b, "Hong Kong" )
858   PORT_DIPSETTING(          0x00000007, "Taiwan" )
859   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
860   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
861   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
862   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
863   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
864   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
865   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
866   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
867   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
868   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
869   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
870   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1001871
1002   PORT_DIPNAME( 0x000f, 0x000f, "Country" )
1003   PORT_DIPSETTING(      0x000f, DEF_STR( World ) )
1004   PORT_DIPSETTING(      0x000e, DEF_STR( USA ) )
1005   PORT_DIPSETTING(      0x000d, "Korea" )
1006   PORT_DIPSETTING(      0x000b, "Hong Kong" )
1007   PORT_DIPSETTING(      0x0007, "Taiwan" )
1008   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1009   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1010   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1011   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
1012
1013   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1014   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1015   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1016   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1017   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1018   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1019   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1020   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1021
872   PORT_DIPNAME( 0x00010000, 0x00010000, DEF_STR( Flip_Screen ) )
873   PORT_DIPSETTING(          0x00010000, DEF_STR( Off ) )
874   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
875   PORT_DIPNAME( 0x00020000, 0x00000000, DEF_STR( Demo_Sounds ) )
876   PORT_DIPSETTING(          0x00020000, DEF_STR( Off ) )
877   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
878   PORT_DIPNAME( 0x000c0000, 0x000c0000, DEF_STR( Difficulty ) )
879   PORT_DIPSETTING(          0x00080000, DEF_STR( Easy ) )
880   PORT_DIPSETTING(          0x000c0000, DEF_STR( Normal ) )
881   PORT_DIPSETTING(          0x00040000, DEF_STR( Hard ) )
882   PORT_DIPSETTING(          0x00000000, DEF_STR( Hardest ) )
883   PORT_DIPNAME( 0x00300000, 0x00300000, DEF_STR( Lives ) )
884   PORT_DIPSETTING(          0x00200000, "1" )
885   PORT_DIPSETTING(          0x00100000, "2" )
886   PORT_DIPSETTING(          0x00300000, "3" )
887   PORT_DIPSETTING(          0x00000000, "4" )
888   PORT_DIPNAME( 0x00400000, 0x00400000, DEF_STR( Bonus_Life ) )
889   PORT_DIPSETTING(          0x00400000, "400K" )
890   PORT_DIPSETTING(          0x00000000, "600K" )
891   PORT_SERVICE( 0x00800000, IP_ACTIVE_LOW )
892   PORT_DIPNAME( 0x01000000, 0x01000000, "Credits/Coinage" )   // [Free Play] on all for free play
893   PORT_DIPSETTING(          0x01000000, "A+B/A&B" )
894   PORT_DIPSETTING(          0x00000000, "A&B/A [Free Play]" )
895   PORT_DIPNAME( 0x0e000000, 0x0e000000, DEF_STR( Coin_A ) )
896   PORT_DIPSETTING(          0x0a000000, DEF_STR( 3C_1C ) )
897   PORT_DIPSETTING(          0x0c000000, DEF_STR( 2C_1C ) )
898   PORT_DIPSETTING(          0x0e000000, DEF_STR( 1C_1C ) )
899   PORT_DIPSETTING(          0x08000000, DEF_STR( 1C_2C ) )
900   PORT_DIPSETTING(          0x06000000, DEF_STR( 1C_3C ) )
901   PORT_DIPSETTING(          0x04000000, DEF_STR( 1C_4C ) )
902   PORT_DIPSETTING(          0x02000000, DEF_STR( 1C_5C ) )
903   PORT_DIPSETTING(          0x00000000, "1C 6C [Free Play]" )
904   PORT_DIPNAME( 0x70000000, 0x70000000, DEF_STR( Coin_B ) )
905   PORT_DIPSETTING(          0x50000000, DEF_STR( 3C_1C ) )
906   PORT_DIPSETTING(          0x60000000, DEF_STR( 2C_1C ) )
907   PORT_DIPSETTING(          0x70000000, DEF_STR( 1C_1C ) )
908   PORT_DIPSETTING(          0x40000000, DEF_STR( 1C_2C ) )
909   PORT_DIPSETTING(          0x30000000, DEF_STR( 1C_3C ) )
910   PORT_DIPSETTING(          0x20000000, DEF_STR( 1C_4C ) )
911   PORT_DIPSETTING(          0x10000000, DEF_STR( 1C_5C ) )
912   PORT_DIPSETTING(          0x00000000, "1C 6C [Free Play]" )
913   PORT_DIPNAME( 0x80000000, 0x80000000, "2C Start, 1C Continue" )
914   PORT_DIPSETTING(          0x80000000, DEF_STR( Off ) )
915   PORT_DIPSETTING(          0x00000000, "On [Free Play]" ) // Forces 1C_1C
1022916INPUT_PORTS_END
1023917
1024918static INPUT_PORTS_START( gunbirdj )
919   PORT_INCLUDE( gunbird )
1025920
1026   PORT_START("IN0")      // IN0 - c00000&1
1027   PSIKYO_PORT_PLAYER2
1028
1029   PSIKYO_PORT_PLAYER1
1030
1031   PORT_START("COIN")      // IN1 - c00002&3
1032   PSIKYO_PORT_COIN
1033
1034   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1035   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1036   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1037   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1038   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1039   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1040   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1041   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1042
1043   PORT_START("DSW1")      // IN2 - c00004&5
1044   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
1045   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1046   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1047   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
1048   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1049   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1050   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
1051   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
1052   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
1053   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
1054   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1055   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
1056   PORT_DIPSETTING(      0x0020, "1" )
1057   PORT_DIPSETTING(      0x0010, "2" )
1058   PORT_DIPSETTING(      0x0030, "3" )
1059   PORT_DIPSETTING(      0x0000, "4" )
1060   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Bonus_Life ) )
1061   PORT_DIPSETTING(      0x0040, "400K" )
1062   PORT_DIPSETTING(      0x0000, "600K" )
1063   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
1064
1065   PORT_DIPNAME( 0x0100, 0x0100, "Credits/Coinage" )   // [Free Play] on all for free play
1066   PORT_DIPSETTING(      0x0100, "A+B/A&B" )
1067   PORT_DIPSETTING(      0x0000, "A&B/A [Free Play]" )
1068   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) )
1069   PORT_DIPSETTING(      0x0a00, DEF_STR( 3C_1C ) )
1070   PORT_DIPSETTING(      0x0c00, DEF_STR( 2C_1C ) )
1071   PORT_DIPSETTING(      0x0e00, DEF_STR( 1C_1C ) )
1072   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_2C ) )
1073   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_3C ) )
1074   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
1075   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_5C ) )
1076   PORT_DIPSETTING(      0x0000, "1C 6C [Free Play]" )
1077   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) )
1078   PORT_DIPSETTING(      0x5000, DEF_STR( 3C_1C ) )
1079   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
1080   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_1C ) )
1081   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_2C ) )
1082   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_3C ) )
1083   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )
1084   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_5C ) )
1085   PORT_DIPSETTING(      0x0000, "1C 6C [Free Play]" )
1086   PORT_DIPNAME( 0x8000, 0x8000, "2C Start, 1C Continue" )
1087   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1088   PORT_DIPSETTING(      0x0000, "On [Free Play]" ) // Forces 1C_1C
1089
1090   PORT_START("DSW2")      // IN3 - c00006&7
1091
1092   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
1093   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
1094   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1095   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
1096   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1097   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1098   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1099   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
1100
1101   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1102   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1103   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1104   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1105   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1106   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1107   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1108   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1109
921   PORT_MODIFY("DSW")      /* c00004 -> c00007 */
922   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_UNKNOWN )
923   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN )
924   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN )
925   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
926   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
927   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
928   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
929   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
930   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
931   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
932   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
933   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
934   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
935   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
936   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
937   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1110938INPUT_PORTS_END
1111939
1112940
r3115r3116
1115943***************************************************************************/
1116944
1117945static INPUT_PORTS_START( s1945 )
1118
1119   PORT_START("IN0")      // IN0 - c00000&1
946   PORT_START("P1_P2")         /* c00000 -> c00003 */
947   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
948   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
949   PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mcu_status_r, NULL)
950   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
951   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
952   PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
953   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_TILT )
954   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(z80_nmi_r, NULL)   // From Sound CPU
955   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
956   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
957   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
958   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
959   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
960   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
961   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
962   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1120963   PSIKYO_PORT_PLAYER2
1121
1122964   PSIKYO_PORT_PLAYER1
1123965
1124   PORT_START("COIN")      // IN1 - c00002&3
1125   PSIKYO_PORT_COIN
1126
1127   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1128   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1129   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1130   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1131   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1132   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1133   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1134   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1135
1136   PORT_START("DSW1")      // IN2 - c00004&5
1137   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
1138   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1139   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1140   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
1141   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1142   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1143   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
1144   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
1145   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
1146   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
1147   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1148   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
1149   PORT_DIPSETTING(      0x0020, "1" )
1150   PORT_DIPSETTING(      0x0010, "2" )
1151   PORT_DIPSETTING(      0x0030, "3" )
1152   PORT_DIPSETTING(      0x0000, "4" )
1153   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Bonus_Life ) )
1154   PORT_DIPSETTING(      0x0040, "600K" )
1155   PORT_DIPSETTING(      0x0000, "800K" )
1156   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
1157
1158   PORT_DIPNAME( 0x0100, 0x0100, "Credits/Coinage" )   // No freeplay for s1945
1159   PORT_DIPSETTING(      0x0100, "A+B/A&B" )
1160   PORT_DIPSETTING(      0x0000, "A&B/A" )
1161   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) )
1162   PORT_DIPSETTING(      0x0a00, DEF_STR( 3C_1C ) )
1163   PORT_DIPSETTING(      0x0c00, DEF_STR( 2C_1C ) )
1164   PORT_DIPSETTING(      0x0e00, DEF_STR( 1C_1C ) )
1165   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_2C ) )
1166   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_3C ) )
1167   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
1168   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_5C ) )
1169   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
1170   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) )
1171   PORT_DIPSETTING(      0x5000, DEF_STR( 3C_1C ) )
1172   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
1173   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_1C ) )
1174   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_2C ) )
1175   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_3C ) )
1176   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )
1177   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_5C ) )
1178   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
1179   PORT_DIPNAME( 0x8000, 0x8000, "2C Start, 1C Continue" )
1180   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1181   PORT_DIPSETTING(      0x0000, DEF_STR( On ) ) // Forces 1C_1C
1182
1183   PORT_START("DSW2")      // IN3 - c00006&7
1184
966   PORT_START("DSW")      /* c00004 -> c00007 */
1185967   /***********************************************
1186968
1187969    This Dip port is bit based:
r3115r3116
1202984    No effect on set s1945j or s1945k
1203985
1204986    ************************************************/
987   PORT_DIPNAME( 0x0000000f, 0x0000000f, "Country" )
988   PORT_DIPSETTING(          0x0000000f, DEF_STR( World ) )
989   PORT_DIPSETTING(          0x0000000e, "U.S.A & Canada" )
990   PORT_DIPSETTING(          0x0000000d, "Korea" )
991   PORT_DIPSETTING(          0x0000000b, "Hong Kong" )
992   PORT_DIPSETTING(          0x00000007, "Taiwan" )
993   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
994   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
995   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
996   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
997   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
998   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
999   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1000   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1001   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1002   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1003   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1004   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
12051005
1206   PORT_DIPNAME( 0x000f, 0x000f, "Country" )
1207   PORT_DIPSETTING(      0x000f, DEF_STR( World ) )
1208   PORT_DIPSETTING(      0x000e, "U.S.A & Canada" )
1209   PORT_DIPSETTING(      0x000d, "Korea" )
1210   PORT_DIPSETTING(      0x000b, "Hong Kong" )
1211   PORT_DIPSETTING(      0x0007, "Taiwan" )
1212   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1213   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1214   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1215   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
1216
1217   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1218   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1219   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1220   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1221   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1222   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1223   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1224   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1225
1006   PORT_DIPNAME( 0x00010000, 0x00010000, DEF_STR( Flip_Screen ) )
1007   PORT_DIPSETTING(          0x00010000, DEF_STR( Off ) )
1008   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
1009   PORT_DIPNAME( 0x00020000, 0x00000000, DEF_STR( Demo_Sounds ) )
1010   PORT_DIPSETTING(          0x00020000, DEF_STR( Off ) )
1011   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
1012   PORT_DIPNAME( 0x000c0000, 0x000c0000, DEF_STR( Difficulty ) )
1013   PORT_DIPSETTING(          0x00080000, DEF_STR( Easy ) )
1014   PORT_DIPSETTING(          0x000c0000, DEF_STR( Normal ) )
1015   PORT_DIPSETTING(          0x00040000, DEF_STR( Hard ) )
1016   PORT_DIPSETTING(          0x00000000, DEF_STR( Hardest ) )
1017   PORT_DIPNAME( 0x00300000, 0x00300000, DEF_STR( Lives ) )
1018   PORT_DIPSETTING(          0x00200000, "1" )
1019   PORT_DIPSETTING(          0x00100000, "2" )
1020   PORT_DIPSETTING(          0x00300000, "3" )
1021   PORT_DIPSETTING(          0x00000000, "4" )
1022   PORT_DIPNAME( 0x00400000, 0x00400000, DEF_STR( Bonus_Life ) )
1023   PORT_DIPSETTING(          0x00400000, "600K" )
1024   PORT_DIPSETTING(          0x00000000, "800K" )
1025   PORT_SERVICE( 0x00800000, IP_ACTIVE_LOW )
1026   PORT_DIPNAME( 0x01000000, 0x01000000, "Credits/Coinage" )   // No freeplay for s1945
1027   PORT_DIPSETTING(          0x01000000, "A+B/A&B" )
1028   PORT_DIPSETTING(          0x00000000, "A&B/A" )
1029   PORT_DIPNAME( 0x0e000000, 0x0e000000, DEF_STR( Coin_A ) )
1030   PORT_DIPSETTING(          0x0a000000, DEF_STR( 3C_1C ) )
1031   PORT_DIPSETTING(          0x0c000000, DEF_STR( 2C_1C ) )
1032   PORT_DIPSETTING(          0x0e000000, DEF_STR( 1C_1C ) )
1033   PORT_DIPSETTING(          0x08000000, DEF_STR( 1C_2C ) )
1034   PORT_DIPSETTING(          0x06000000, DEF_STR( 1C_3C ) )
1035   PORT_DIPSETTING(          0x04000000, DEF_STR( 1C_4C ) )
1036   PORT_DIPSETTING(          0x02000000, DEF_STR( 1C_5C ) )
1037   PORT_DIPSETTING(          0x00000000, DEF_STR( 1C_6C ) )
1038   PORT_DIPNAME( 0x70000000, 0x70000000, DEF_STR( Coin_B ) )
1039   PORT_DIPSETTING(          0x50000000, DEF_STR( 3C_1C ) )
1040   PORT_DIPSETTING(          0x60000000, DEF_STR( 2C_1C ) )
1041   PORT_DIPSETTING(          0x70000000, DEF_STR( 1C_1C ) )
1042   PORT_DIPSETTING(          0x40000000, DEF_STR( 1C_2C ) )
1043   PORT_DIPSETTING(          0x30000000, DEF_STR( 1C_3C ) )
1044   PORT_DIPSETTING(          0x20000000, DEF_STR( 1C_4C ) )
1045   PORT_DIPSETTING(          0x10000000, DEF_STR( 1C_5C ) )
1046   PORT_DIPSETTING(          0x00000000, DEF_STR( 1C_6C ) )
1047   PORT_DIPNAME( 0x80000000, 0x80000000, "2C Start, 1C Continue" )
1048   PORT_DIPSETTING(          0x80000000, DEF_STR( Off ) )
1049   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) ) // Forces 1C_1C
12261050INPUT_PORTS_END
12271051
12281052static INPUT_PORTS_START( s1945a )
1053   PORT_INCLUDE( s1945 )
12291054
1230   PORT_START("IN0")      // IN0 - c00000&1
1231   PSIKYO_PORT_PLAYER2
1232
1233   PSIKYO_PORT_PLAYER1
1234
1235   PORT_START("COIN")      // IN1 - c00002&3
1236   PSIKYO_PORT_COIN
1237
1238   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1239   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1240   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1241   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1242   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1243   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1244   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1245   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1246
1247   PORT_START("DSW1")      // IN2 - c00004&5
1248   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
1249   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1250   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1251   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
1252   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1253   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1254   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
1255   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
1256   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
1257   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
1258   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1259   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
1260   PORT_DIPSETTING(      0x0020, "1" )
1261   PORT_DIPSETTING(      0x0010, "2" )
1262   PORT_DIPSETTING(      0x0030, "3" )
1263   PORT_DIPSETTING(      0x0000, "4" )
1264   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Bonus_Life ) )
1265   PORT_DIPSETTING(      0x0040, "600K" )
1266   PORT_DIPSETTING(      0x0000, "800K" )
1267   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
1268
1269   PORT_DIPNAME( 0x0100, 0x0100, "Credits/Coinage" )   // No freeplay for s1945
1270   PORT_DIPSETTING(      0x0100, "A+B/A&B" )
1271   PORT_DIPSETTING(      0x0000, "A&B/A" )
1272   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) )
1273   PORT_DIPSETTING(      0x0a00, DEF_STR( 3C_1C ) )
1274   PORT_DIPSETTING(      0x0c00, DEF_STR( 2C_1C ) )
1275   PORT_DIPSETTING(      0x0e00, DEF_STR( 1C_1C ) )
1276   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_2C ) )
1277   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_3C ) )
1278   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
1279   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_5C ) )
1280   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
1281   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) )
1282   PORT_DIPSETTING(      0x5000, DEF_STR( 3C_1C ) )
1283   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
1284   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_1C ) )
1285   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_2C ) )
1286   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_3C ) )
1287   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )
1288   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_5C ) )
1289   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
1290   PORT_DIPNAME( 0x8000, 0x8000, "2C Start, 1C Continue" )
1291   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1292   PORT_DIPSETTING(      0x0000, DEF_STR( On ) ) // Forces 1C_1C
1293
1294   PORT_START("DSW2")      // IN3 - c00006&7
1295
1055   PORT_MODIFY("DSW")
12961056   /***********************************************
12971057
12981058    This Dip port is bit based:
r3115r3116
13001060    Bit 0 1 2 3
13011061        1 1 1 1 Japan, anything but 0x0f = "World"
13021062    ************************************************/
1303
1304   PORT_DIPNAME( 0x000f, 0x000e, "Country" )
1305   PORT_DIPSETTING(      0x000f, DEF_STR( Japan ) )
1306   PORT_DIPSETTING(      0x000e, DEF_STR( World ) )
1307   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1308   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1309   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1310   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
1311
1312   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1313   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1314   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1315   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1316   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1317   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1318   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1319   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1320
1063   PORT_DIPNAME( 0x0000000f, 0x0000000e, "Country" )
1064   PORT_DIPSETTING(          0x0000000f, DEF_STR( Japan ) )
1065   PORT_DIPSETTING(          0x0000000e, DEF_STR( World ) )
1066   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1067   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1068   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1069   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
1070   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1071   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1072   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1073   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1074   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1075   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1076   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1077   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
13211078INPUT_PORTS_END
13221079
13231080static INPUT_PORTS_START( s1945j )
1081   PORT_INCLUDE( s1945 )
13241082
1325   PORT_START("IN0")      // IN0 - c00000&1
1326   PSIKYO_PORT_PLAYER2
1327
1328   PSIKYO_PORT_PLAYER1
1329
1330   PORT_START("COIN")      // IN1 - c00002&3
1331   PSIKYO_PORT_COIN
1332
1333   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1334   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1335   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1336   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1337   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1338   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1339   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1340   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1341
1342   PORT_START("DSW1")      // IN2 - c00004&5
1343   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
1344   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1345   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1346   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
1347   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1348   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1349   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
1350   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
1351   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
1352   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
1353   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1354   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
1355   PORT_DIPSETTING(      0x0020, "1" )
1356   PORT_DIPSETTING(      0x0010, "2" )
1357   PORT_DIPSETTING(      0x0030, "3" )
1358   PORT_DIPSETTING(      0x0000, "4" )
1359   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Bonus_Life ) )
1360   PORT_DIPSETTING(      0x0040, "600K" )
1361   PORT_DIPSETTING(      0x0000, "800K" )
1362   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
1363
1364   PORT_DIPNAME( 0x0100, 0x0100, "Credits/Coinage" )   // No freeplay for s1945?
1365   PORT_DIPSETTING(      0x0100, "A+B/A&B" )
1366   PORT_DIPSETTING(      0x0000, "A&B/A" )
1367   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) )
1368   PORT_DIPSETTING(      0x0a00, DEF_STR( 3C_1C ) )
1369   PORT_DIPSETTING(      0x0c00, DEF_STR( 2C_1C ) )
1370   PORT_DIPSETTING(      0x0e00, DEF_STR( 1C_1C ) )
1371   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_2C ) )
1372   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_3C ) )
1373   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
1374   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_5C ) )
1375   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
1376   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) )
1377   PORT_DIPSETTING(      0x5000, DEF_STR( 3C_1C ) )
1378   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
1379   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_1C ) )
1380   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_2C ) )
1381   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_3C ) )
1382   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )
1383   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_5C ) )
1384   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
1385   PORT_DIPNAME( 0x8000, 0x8000, "2C Start, 1C Continue" )
1386   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1387   PORT_DIPSETTING(      0x0000, DEF_STR( On ) ) // Forces 1C_1C
1388
1389   PORT_START("DSW2")      // IN3 - c00006&7
1390
1391   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
1392   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
1393   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1394   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
1395   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1396   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1397   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1398   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
1399
1400   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1401   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1402   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1403   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1404   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1405   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1406   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1407   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1408
1083   PORT_MODIFY("DSW")
1084   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_UNKNOWN )
1085   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN )
1086   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1087   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
1088   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1089   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1090   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1091   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
1092   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1093   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1094   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1095   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1096   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1097   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1098   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1099   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
14091100INPUT_PORTS_END
14101101
14111102
r3115r3116
14141105***************************************************************************/
14151106
14161107static INPUT_PORTS_START( tengai )
1417
1418   PORT_START("IN0")      // IN0 - c00000&1
1108   PORT_START("P1_P2")         /* c00000 -> c00003 */
1109   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
1110   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
1111   PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mcu_status_r, NULL)
1112   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
1113   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
1114   PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
1115   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_TILT )
1116   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(z80_nmi_r, NULL)   // From Sound CPU
1117   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1118   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1119   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1120   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1121   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1122   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1123   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1124   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
14191125   PSIKYO_PORT_PLAYER2
1420
14211126   PSIKYO_PORT_PLAYER1
14221127
1423   PORT_START("COIN")      // IN1PORT_START_TAG("DSW1")        // IN2 - c00002&3
1424   PSIKYO_PORT_COIN
1425
1426   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1427   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1428   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1429   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1430   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1431   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1432   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1433   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1434
1435   PORT_START("DSW1")      // IN2 - c00004&5
1436   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
1437   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1438   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1439   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
1440   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1441   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1442   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
1443   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
1444   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
1445   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
1446   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1447   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Lives ) )
1448   PORT_DIPSETTING(      0x0020, "1" )
1449   PORT_DIPSETTING(      0x0010, "2" )
1450   PORT_DIPSETTING(      0x0030, "3" )
1451   PORT_DIPSETTING(      0x0000, "4" )
1452   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Bonus_Life ) )
1453   PORT_DIPSETTING(      0x0040, "600K" )
1454   PORT_DIPSETTING(      0x0000, "800K" )
1455   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
1456
1457   PORT_DIPNAME( 0x0100, 0x0100, "Credits/Coinage" )   // [Free Play] on all for free play
1458   PORT_DIPSETTING(      0x0100, "A+B/A&B" )
1459   PORT_DIPSETTING(      0x0000, "A&B/A [Free Play]" )
1460   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coin_A ) )
1461   PORT_DIPSETTING(      0x0a00, DEF_STR( 3C_1C ) )
1462   PORT_DIPSETTING(      0x0c00, DEF_STR( 2C_1C ) )
1463   PORT_DIPSETTING(      0x0e00, DEF_STR( 1C_1C ) )
1464   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_2C ) )
1465   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_3C ) )
1466   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
1467   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_5C ) )
1468   PORT_DIPSETTING(      0x0000, "1C 6C [Free Play]" )
1469   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coin_B ) )
1470   PORT_DIPSETTING(      0x5000, DEF_STR( 3C_1C ) )
1471   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
1472   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_1C ) )
1473   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_2C ) )
1474   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_3C ) )
1475   PORT_DIPSETTING(      0x2000, DEF_STR( 1C_4C ) )
1476   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_5C ) )
1477   PORT_DIPSETTING(      0x0000, "1C 6C [Free Play]" )
1478   PORT_DIPNAME( 0x8000, 0x8000, "2C Start, 1C Continue" )
1479   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1480   PORT_DIPSETTING(      0x0000, "On [Free Play]" ) // Forces 1C_1C
1481
1482   PORT_START("DSW2")      // IN3 - c00006&7
1483
1128   PORT_START("DSW")      /* c00004 -> c00007 */
14841129   /***********************************************
14851130
14861131    This Dip port is bit based:
r3115r3116
14891134    Text for other regions is present though.
14901135
14911136    ************************************************/
1137   PORT_DIPNAME( 0x0000000f, 0x0000000e, "Country" )
1138   PORT_DIPSETTING(          0x0000000f, DEF_STR( Japan ) )
1139   PORT_DIPSETTING(          0x0000000e, DEF_STR( World ) )
1140   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1141   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1142   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1143   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
1144   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1145   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1146   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1147   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1148   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1149   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1150   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1151   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
14921152
1493   PORT_DIPNAME( 0x000f, 0x000e, "Country" )
1494   PORT_DIPSETTING(      0x000f, DEF_STR( Japan ) )
1495   PORT_DIPSETTING(      0x000e, DEF_STR( World ) )
1496
1497   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1498   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1499   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1500   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
1501
1502   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1503   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1504   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1505   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1506   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1507   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1508   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1509   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1510
1153   PORT_DIPNAME( 0x00010000, 0x00010000, DEF_STR( Flip_Screen ) )
1154   PORT_DIPSETTING(          0x00010000, DEF_STR( Off ) )
1155   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
1156   PORT_DIPNAME( 0x00020000, 0x00000000, DEF_STR( Demo_Sounds ) )
1157   PORT_DIPSETTING(          0x00020000, DEF_STR( Off ) )
1158   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
1159   PORT_DIPNAME( 0x000c0000, 0x000c0000, DEF_STR( Difficulty ) )
1160   PORT_DIPSETTING(          0x00080000, DEF_STR( Easy ) )
1161   PORT_DIPSETTING(          0x000c0000, DEF_STR( Normal ) )
1162   PORT_DIPSETTING(          0x00040000, DEF_STR( Hard ) )
1163   PORT_DIPSETTING(          0x00000000, DEF_STR( Hardest ) )
1164   PORT_DIPNAME( 0x00300000, 0x00300000, DEF_STR( Lives ) )
1165   PORT_DIPSETTING(          0x00200000, "1" )
1166   PORT_DIPSETTING(          0x00100000, "2" )
1167   PORT_DIPSETTING(          0x00300000, "3" )
1168   PORT_DIPSETTING(          0x00000000, "4" )
1169   PORT_DIPNAME( 0x00400000, 0x00400000, DEF_STR( Bonus_Life ) )
1170   PORT_DIPSETTING(          0x00400000, "600K" )
1171   PORT_DIPSETTING(          0x00000000, "800K" )
1172   PORT_SERVICE( 0x00800000, IP_ACTIVE_LOW )
1173   PORT_DIPNAME( 0x01000000, 0x01000000, "Credits/Coinage" )   // [Free Play] on all for free play
1174   PORT_DIPSETTING(          0x01000000, "A+B/A&B" )
1175   PORT_DIPSETTING(          0x00000000, "A&B/A [Free Play]" )
1176   PORT_DIPNAME( 0x0e000000, 0x0e000000, DEF_STR( Coin_A ) )
1177   PORT_DIPSETTING(          0x0a000000, DEF_STR( 3C_1C ) )
1178   PORT_DIPSETTING(          0x0c000000, DEF_STR( 2C_1C ) )
1179   PORT_DIPSETTING(          0x0e000000, DEF_STR( 1C_1C ) )
1180   PORT_DIPSETTING(          0x08000000, DEF_STR( 1C_2C ) )
1181   PORT_DIPSETTING(          0x06000000, DEF_STR( 1C_3C ) )
1182   PORT_DIPSETTING(          0x04000000, DEF_STR( 1C_4C ) )
1183   PORT_DIPSETTING(          0x02000000, DEF_STR( 1C_5C ) )
1184   PORT_DIPSETTING(          0x00000000, "1C 6C [Free Play]" )
1185   PORT_DIPNAME( 0x70000000, 0x70000000, DEF_STR( Coin_B ) )
1186   PORT_DIPSETTING(          0x50000000, DEF_STR( 3C_1C ) )
1187   PORT_DIPSETTING(          0x60000000, DEF_STR( 2C_1C ) )
1188   PORT_DIPSETTING(          0x70000000, DEF_STR( 1C_1C ) )
1189   PORT_DIPSETTING(          0x40000000, DEF_STR( 1C_2C ) )
1190   PORT_DIPSETTING(          0x30000000, DEF_STR( 1C_3C ) )
1191   PORT_DIPSETTING(          0x20000000, DEF_STR( 1C_4C ) )
1192   PORT_DIPSETTING(          0x10000000, DEF_STR( 1C_5C ) )
1193   PORT_DIPSETTING(          0x00000000, "1C 6C [Free Play]" )
1194   PORT_DIPNAME( 0x80000000, 0x80000000, "2C Start, 1C Continue" )
1195   PORT_DIPSETTING(          0x80000000, DEF_STR( Off ) )
1196   PORT_DIPSETTING(          0x00000000, "On [Free Play]" ) // Forces 1C_1C
15111197INPUT_PORTS_END
15121198
15131199
src/mame/drivers/playmark.c
r3115r3116
131131   }
132132}
133133
134static READ16_HANDLER( wbeachvl_port0_r )
135{
136   int bit;
137
138   bit = eeprom_read_bit() << 7;
139
140   return (input_port_read(machine, "SYSTEM") & 0x7f) | bit;
141}
142
143static READ16_HANDLER( hotmind_port2_r )
144{
145   int bit;
146
147   bit = eeprom_read_bit() << 7;
148
149   return (input_port_read(machine, "P2") & 0x7f) | bit;
150}
151
152134static WRITE16_HANDLER( wbeachvl_coin_eeprom_w )
153135{
154136   if (ACCESSING_BITS_0_7)
r3115r3116
306288   AM_RANGE(0x510000, 0x51000b) AM_WRITE(wbeachvl_scroll_w)
307289   AM_RANGE(0x51000c, 0x51000d) AM_WRITENOP   /* 2 and 3 */
308290//  AM_RANGE(0x700000, 0x700001) ?? written on startup
309   AM_RANGE(0x710010, 0x710011) AM_READ(wbeachvl_port0_r)
291   AM_RANGE(0x710010, 0x710011) AM_READ_PORT("SYSTEM")
310292   AM_RANGE(0x710012, 0x710013) AM_READ_PORT("P1")
311293   AM_RANGE(0x710014, 0x710015) AM_READ_PORT("P2")
312294   AM_RANGE(0x710016, 0x710017) AM_WRITE(wbeachvl_coin_eeprom_w)
r3115r3116
348330   AM_RANGE(0x280000, 0x2807ff) AM_RAM_WRITE(bigtwin_paletteram_w) AM_BASE(&paletteram16)
349331   AM_RANGE(0x300010, 0x300011) AM_READ_PORT("SYSTEM")
350332   AM_RANGE(0x300012, 0x300013) AM_READ_PORT("P1")
351   AM_RANGE(0x300014, 0x300015) AM_WRITE(hotmind_coin_eeprom_w) AM_READ(hotmind_port2_r)
333   AM_RANGE(0x300014, 0x300015) AM_READ_PORT("P2") AM_WRITE(hotmind_coin_eeprom_w)
352334   AM_RANGE(0x30001a, 0x30001b) AM_READ_PORT("DSW1")
353335   AM_RANGE(0x30001c, 0x30001d) AM_READ_PORT("DSW2")
354336   AM_RANGE(0x30001e, 0x30001f) AM_WRITE(playmark_snd_command_w)
r3115r3116
392374ADDRESS_MAP_END
393375
394376
395
396
397377static INPUT_PORTS_START( bigtwin )
398378   PORT_START("SYSTEM")
399379   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
455435   PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
456436   PORT_DIPSETTING(    0x01, "Mode 1" )
457437   PORT_DIPSETTING(    0x00, "Mode 2" )
458   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
459   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
460   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
461   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
462   PORT_DIPSETTING(    0x1a, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
463   PORT_DIPSETTING(    0x02, DEF_STR( 8C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
464   PORT_DIPSETTING(    0x1c, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
465   PORT_DIPSETTING(    0x04, DEF_STR( 5C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
466   PORT_DIPSETTING(    0x06, DEF_STR( 3C_2C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
467   PORT_DIPSETTING(    0x1e, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
468   PORT_DIPSETTING(    0x08, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
469   PORT_DIPSETTING(    0x12, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
470   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
471   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
472   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
473   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
474   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
475   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
476   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
477   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
478   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
479   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
480   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
481   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
482   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
483   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
484   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
438   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
439   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) )
440   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) )
441   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) )
442   PORT_DIPSETTING(    0x1a, DEF_STR( 3C_1C ) )
443   PORT_DIPSETTING(    0x02, DEF_STR( 8C_3C ) )
444   PORT_DIPSETTING(    0x1c, DEF_STR( 2C_1C ) )
445   PORT_DIPSETTING(    0x04, DEF_STR( 5C_3C ) )
446   PORT_DIPSETTING(    0x06, DEF_STR( 3C_2C ) )
447   PORT_DIPSETTING(    0x1e, DEF_STR( 1C_1C ) )
448   PORT_DIPSETTING(    0x08, DEF_STR( 2C_3C ) )
449   PORT_DIPSETTING(    0x12, DEF_STR( 1C_2C ) )
450   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
451   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_4C ) )
452   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) )
453   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
454   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
455   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
456   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
457   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
458   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
459   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
460   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
461   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
462   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
463   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
464   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
485465   PORT_DIPNAME( 0x20, 0x20, "Minimum Credits to Start" )
486466   PORT_DIPSETTING(    0x20, "1" )
487467   PORT_DIPSETTING(    0x00, "2" )
r3115r3116
502482   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SERVICE1 )
503483   PORT_SERVICE_NO_TOGGLE(0x20, IP_ACTIVE_LOW)
504484   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* ?? see code at 746a. sound status? */
505   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
485   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
506486
507487   PORT_START("P1")
508488   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
603583   PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
604584   PORT_DIPSETTING(    0x01, "Mode 1" )
605585   PORT_DIPSETTING(    0x00, "Mode 2" )
606   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
607   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
608   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
609   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
610   PORT_DIPSETTING(    0x1a, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
611   PORT_DIPSETTING(    0x02, DEF_STR( 8C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
612   PORT_DIPSETTING(    0x1c, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
613   PORT_DIPSETTING(    0x04, DEF_STR( 5C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
614   PORT_DIPSETTING(    0x06, DEF_STR( 3C_2C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
615   PORT_DIPSETTING(    0x1e, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
616   PORT_DIPSETTING(    0x08, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
617   PORT_DIPSETTING(    0x12, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
618   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
619   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
620   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
621   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
622   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
623   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
624   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
625   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
626   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
627   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
628   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
629   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
630   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
631   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
632   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
586   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
587   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) )
588   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) )
589   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) )
590   PORT_DIPSETTING(    0x1a, DEF_STR( 3C_1C ) )
591   PORT_DIPSETTING(    0x02, DEF_STR( 8C_3C ) )
592   PORT_DIPSETTING(    0x1c, DEF_STR( 2C_1C ) )
593   PORT_DIPSETTING(    0x04, DEF_STR( 5C_3C ) )
594   PORT_DIPSETTING(    0x06, DEF_STR( 3C_2C ) )
595   PORT_DIPSETTING(    0x1e, DEF_STR( 1C_1C ) )
596   PORT_DIPSETTING(    0x08, DEF_STR( 2C_3C ) )
597   PORT_DIPSETTING(    0x12, DEF_STR( 1C_2C ) )
598   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
599   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_4C ) )
600   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) )
601   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
602   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
603   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
604   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
605   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
606   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
607   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
608   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
609   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
610   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
611   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
612   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
633613   PORT_DIPNAME( 0x20, 0x20, "Minimum Credits to Start" )
634614   PORT_DIPSETTING(    0x20, "1" )
635615   PORT_DIPSETTING(    0x00, "2" )
r3115r3116
668648   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
669649   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
670650   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
671   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM data */
651   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
672652
673653   PORT_START("DSW1")
674654   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
r3115r3116
698678   PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
699679   PORT_DIPSETTING(    0x01, "Mode 1" )
700680   PORT_DIPSETTING(    0x00, "Mode 2" )
701   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
702   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
703   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
704   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
705   PORT_DIPSETTING(    0x1a, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
706   PORT_DIPSETTING(    0x02, DEF_STR( 8C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
707   PORT_DIPSETTING(    0x1c, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
708   PORT_DIPSETTING(    0x04, DEF_STR( 5C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
709   PORT_DIPSETTING(    0x06, DEF_STR( 3C_2C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
710   PORT_DIPSETTING(    0x1e, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
711   PORT_DIPSETTING(    0x08, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
712   PORT_DIPSETTING(    0x12, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
713   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
714   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
715   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
716   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
717   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
718   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
719   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
720   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
721   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
722   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
723   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
724   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
725   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
726   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
727   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
681   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
682   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) )
683   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) )
684   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) )
685   PORT_DIPSETTING(    0x1a, DEF_STR( 3C_1C ) )
686   PORT_DIPSETTING(    0x02, DEF_STR( 8C_3C ) )
687   PORT_DIPSETTING(    0x1c, DEF_STR( 2C_1C ) )
688   PORT_DIPSETTING(    0x04, DEF_STR( 5C_3C ) )
689   PORT_DIPSETTING(    0x06, DEF_STR( 3C_2C ) )
690   PORT_DIPSETTING(    0x1e, DEF_STR( 1C_1C ) )
691   PORT_DIPSETTING(    0x08, DEF_STR( 2C_3C ) )
692   PORT_DIPSETTING(    0x12, DEF_STR( 1C_2C ) )
693   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
694   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_4C ) )
695   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) )
696   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
697   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
698   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
699   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
700   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
701   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
702   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
703   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
704   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
705   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
706   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
707   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
728708   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
729709   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
730710   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
794774   PORT_DIPNAME( 0x01, 0x01, "Coin Mode" )
795775   PORT_DIPSETTING(    0x01, "Mode 1" )
796776   PORT_DIPSETTING(    0x00, "Mode 2" )
797   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
798   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
799   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
800   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
801   PORT_DIPSETTING(    0x1a, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
802   PORT_DIPSETTING(    0x02, DEF_STR( 8C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
803   PORT_DIPSETTING(    0x1c, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
804   PORT_DIPSETTING(    0x04, DEF_STR( 5C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
805   PORT_DIPSETTING(    0x06, DEF_STR( 3C_2C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
806   PORT_DIPSETTING(    0x1e, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
807   PORT_DIPSETTING(    0x08, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
808   PORT_DIPSETTING(    0x12, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
809   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
810   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
811   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
812   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
813   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_EQUALS,0x01)
814   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
815   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
816   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
817   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
818   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
819   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
820   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
821   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
822   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
823   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2",0x01,PORTCOND_NOTEQUALS,0x01)
777   PORT_DIPNAME( 0x1e, 0x1e, "Coinage Mode 1" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_EQUALS, 0x01)
778   PORT_DIPSETTING(    0x14, DEF_STR( 6C_1C ) )
779   PORT_DIPSETTING(    0x16, DEF_STR( 5C_1C ) )
780   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) )
781   PORT_DIPSETTING(    0x1a, DEF_STR( 3C_1C ) )
782   PORT_DIPSETTING(    0x02, DEF_STR( 8C_3C ) )
783   PORT_DIPSETTING(    0x1c, DEF_STR( 2C_1C ) )
784   PORT_DIPSETTING(    0x04, DEF_STR( 5C_3C ) )
785   PORT_DIPSETTING(    0x06, DEF_STR( 3C_2C ) )
786   PORT_DIPSETTING(    0x1e, DEF_STR( 1C_1C ) )
787   PORT_DIPSETTING(    0x08, DEF_STR( 2C_3C ) )
788   PORT_DIPSETTING(    0x12, DEF_STR( 1C_2C ) )
789   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
790   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_4C ) )
791   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) )
792   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
793   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
794   PORT_DIPNAME( 0x06, 0x06, "Coin A Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
795   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
796   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
797   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
798   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
799   PORT_DIPNAME( 0x18, 0x18, "Coin B Mode 2" ) PORT_CONDITION("DSW2", 0x01, PORTCOND_NOTEQUALS, 0x01)
800   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
801   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
802   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
803   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
824804   PORT_DIPNAME( 0x20, 0x20, "Minimum Credits to Start" )
825805   PORT_DIPSETTING(    0x20, "1" )
826806   PORT_DIPSETTING(    0x00, "2" )
src/mame/drivers/dacholer.c
r3115r3116
393393   }
394394}
395395
396static msm5205_interface msm_interface =
396static const msm5205_interface msm_interface =
397397{
398398   adpcm_int,         /* interrupt function */
399399   MSM5205_S96_4B    /* 1 / 96 = 3906.25Hz playback  - guess */
src/mame/drivers/namcos21.c
r3115r3116
14271427
14281428static ADDRESS_MAP_START( readmem_mcu, ADDRESS_SPACE_PROGRAM, 8 )
14291429   AM_RANGE(0x0000, 0x0000) AM_READ(SMH_NOP)
1430   AM_RANGE(0x0001, 0x0001) AM_READ(input_port_0_r)         /* p1,p2 start */
1431   AM_RANGE(0x0002, 0x0002) AM_READ(input_port_1_r)         /* coins */
1430   AM_RANGE(0x0001, 0x0001) AM_READ_PORT("PORTB")         /* p1,p2 start */
1431   AM_RANGE(0x0002, 0x0002) AM_READ_PORT("PORTC")         /* coins */
14321432   AM_RANGE(0x0003, 0x0003) AM_READ(namcos2_mcu_port_d_r)
1433   AM_RANGE(0x0007, 0x0007) AM_READ(input_port_10_r)      /* fire buttons */
1433   AM_RANGE(0x0007, 0x0007) AM_READ_PORT("PORTH")         /* fire buttons */
14341434   AM_RANGE(0x0010, 0x0010) AM_READ(namcos2_mcu_analog_ctrl_r)
14351435   AM_RANGE(0x0011, 0x0011) AM_READ(namcos2_mcu_analog_port_r)
14361436   AM_RANGE(0x0008, 0x003f) AM_READ(SMH_RAM)
14371437   AM_RANGE(0x0040, 0x01bf) AM_READ(SMH_RAM)
14381438   AM_RANGE(0x01c0, 0x1fff) AM_READ(SMH_ROM)
1439   AM_RANGE(0x2000, 0x2000) AM_READ(input_port_11_r) /* dipswitches */
1440   AM_RANGE(0x3000, 0x3000) AM_READ(input_port_12_r) /* DIAL0 */
1441   AM_RANGE(0x3001, 0x3001) AM_READ(input_port_13_r) /* DIAL1 */
1442   AM_RANGE(0x3002, 0x3002) AM_READ(input_port_14_r) /* DIAL2 */
1443   AM_RANGE(0x3003, 0x3003) AM_READ(input_port_15_r) /* DIAL3 */
1439   AM_RANGE(0x2000, 0x2000) AM_READ_PORT("DSW")
1440   AM_RANGE(0x3000, 0x3000) AM_READ_PORT("DIAL0")
1441   AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DIAL1")
1442   AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DIAL2")
1443   AM_RANGE(0x3003, 0x3003) AM_READ_PORT("DIAL3")
14441444   AM_RANGE(0x5000, 0x57ff) AM_READ(namcos2_dualportram_byte_r)
1445   AM_RANGE(0x6000, 0x6fff) AM_READ(SMH_NOP) /* watchdog */
1445   AM_RANGE(0x6000, 0x6fff) AM_READ(SMH_NOP)            /* watchdog */
14461446   AM_RANGE(0x8000, 0xffff) AM_READ(SMH_ROM)
14471447ADDRESS_MAP_END
14481448
src/mame/drivers/pgm.c
r3115r3116
559559   AM_RANGE(0xc0000a, 0xc0000b) AM_WRITE(z80_ctrl_w)
560560   AM_RANGE(0xc0000c, 0xc0000d) AM_READWRITE(soundlatch3_word_r, soundlatch3_word_w)
561561
562   AM_RANGE(0xc08000, 0xc08001) AM_READ(input_port_0_word_r) // p1+p2 controls
563   AM_RANGE(0xc08002, 0xc08003) AM_READ(input_port_1_word_r) // p3+p4 controls
564   AM_RANGE(0xc08004, 0xc08005) AM_READ(input_port_2_word_r) // extra controls
565   AM_RANGE(0xc08006, 0xc08007) AM_READ(input_port_3_word_r) // dipswitches
562   AM_RANGE(0xc08000, 0xc08001) AM_READ_PORT("P1P2")
563   AM_RANGE(0xc08002, 0xc08003) AM_READ_PORT("P3P4")
564   AM_RANGE(0xc08004, 0xc08005) AM_READ_PORT("Service")
565   AM_RANGE(0xc08006, 0xc08007) AM_READ_PORT("DSW")
566566
567567   AM_RANGE(0xc10000, 0xc1ffff) AM_READWRITE(z80_ram_r, z80_ram_w) /* Z80 Program */
568568ADDRESS_MAP_END
r3115r3116
591591   AM_RANGE(0xc0000a, 0xc0000b) AM_WRITE(z80_ctrl_w)
592592   AM_RANGE(0xc0000c, 0xc0000d) AM_READWRITE(soundlatch3_word_r, soundlatch3_word_w)
593593
594   AM_RANGE(0xc08000, 0xc08001) AM_READ(input_port_0_word_r) // p1+p2 controls
595   AM_RANGE(0xc08002, 0xc08003) AM_READ(input_port_1_word_r) // p3+p4 controls
596   AM_RANGE(0xc08004, 0xc08005) AM_READ(input_port_2_word_r) // extra controls
597   AM_RANGE(0xc08006, 0xc08007) AM_READ(input_port_3_word_r) // dipswitches
594   AM_RANGE(0xc08000, 0xc08001) AM_READ_PORT("P1P2")
595   AM_RANGE(0xc08002, 0xc08003) AM_READ_PORT("P3P4")
596   AM_RANGE(0xc08004, 0xc08005) AM_READ_PORT("Service")
597   AM_RANGE(0xc08006, 0xc08007) AM_READ_PORT("DSW")
598598
599599   AM_RANGE(0xc10000, 0xc1ffff) AM_READWRITE(z80_ram_r, z80_ram_w) /* Z80 Program */
600600ADDRESS_MAP_END
r3115r3116
623623   AM_RANGE(0xc0000a, 0xc0000b) AM_WRITE(z80_ctrl_w)
624624   AM_RANGE(0xc0000c, 0xc0000d) AM_READWRITE(soundlatch3_word_r, soundlatch3_word_w)
625625
626   AM_RANGE(0xc08000, 0xc08001) AM_READ(input_port_0_word_r) // p1+p2 controls
627   AM_RANGE(0xc08002, 0xc08003) AM_READ(input_port_1_word_r) // p3+p4 controls
628   AM_RANGE(0xc08004, 0xc08005) AM_READ(input_port_2_word_r) // extra controls
629   AM_RANGE(0xc08006, 0xc08007) AM_READ(input_port_3_word_r) // dipswitches
626   AM_RANGE(0xc08000, 0xc08001) AM_READ_PORT("P1P2")
627   AM_RANGE(0xc08002, 0xc08003) AM_READ_PORT("P3P4")
628   AM_RANGE(0xc08004, 0xc08005) AM_READ_PORT("Service")
629   AM_RANGE(0xc08006, 0xc08007) AM_READ_PORT("DSW")
630630
631631   AM_RANGE(0xc10000, 0xc1ffff) AM_READWRITE(z80_ram_r, z80_ram_w) /* Z80 Program */
632632ADDRESS_MAP_END
r3115r3116
652652   AM_RANGE(0xc0000a, 0xc0000b) AM_WRITE(z80_ctrl_w)
653653   AM_RANGE(0xc0000c, 0xc0000d) AM_READWRITE(soundlatch3_word_r, soundlatch3_word_w)
654654
655   AM_RANGE(0xc08000, 0xc08001) AM_READ(input_port_0_word_r) // p1+p2 controls
656   AM_RANGE(0xc08002, 0xc08003) AM_READ(input_port_1_word_r) // p3+p4 controls
657   AM_RANGE(0xc08004, 0xc08005) AM_READ(input_port_2_word_r) // extra controls
658   AM_RANGE(0xc08006, 0xc08007) AM_READ(input_port_3_word_r) // dipswitches
655   AM_RANGE(0xc08000, 0xc08001) AM_READ_PORT("P1P2")
656   AM_RANGE(0xc08002, 0xc08003) AM_READ_PORT("P3P4")
657   AM_RANGE(0xc08004, 0xc08005) AM_READ_PORT("Service")
658   AM_RANGE(0xc08006, 0xc08007) AM_READ_PORT("DSW")
659659
660660   AM_RANGE(0xc10000, 0xc1ffff) AM_READWRITE(z80_ram_r, z80_ram_w) /* Z80 Program */
661661   AM_RANGE(0xd00000, 0xd0ffff) AM_READWRITE(arm7_ram_r, arm7_ram_w) /* ARM7 Shared RAM */
r3115r3116
685685   AM_RANGE(0xc0000a, 0xc0000b) AM_WRITE(z80_ctrl_w)
686686   AM_RANGE(0xc0000c, 0xc0000d) AM_READWRITE(soundlatch3_word_r, soundlatch3_word_w)
687687
688   AM_RANGE(0xc08000, 0xc08001) AM_READ(input_port_0_word_r) // p1+p2 controls
689   AM_RANGE(0xc08002, 0xc08003) AM_READ(input_port_1_word_r) // p3+p4 controls
690   AM_RANGE(0xc08004, 0xc08005) AM_READ(input_port_2_word_r) // extra controls
691   AM_RANGE(0xc08006, 0xc08007) AM_READ(input_port_3_word_r) // dipswitches
688   AM_RANGE(0xc08000, 0xc08001) AM_READ_PORT("P1P2")
689   AM_RANGE(0xc08002, 0xc08003) AM_READ_PORT("P3P4")
690   AM_RANGE(0xc08004, 0xc08005) AM_READ_PORT("Service")
691   AM_RANGE(0xc08006, 0xc08007) AM_READ_PORT("DSW")
692692
693693   AM_RANGE(0xc10000, 0xc1ffff) AM_READWRITE(z80_ram_r, z80_ram_w) /* Z80 Program */
694694ADDRESS_MAP_END
r3115r3116
786786   AM_RANGE(0xc0000a, 0xc0000b) AM_WRITE(z80_ctrl_w)
787787   AM_RANGE(0xc0000c, 0xc0000d) AM_READWRITE(soundlatch3_word_r, soundlatch3_word_w)
788788
789   AM_RANGE(0xc08000, 0xc08001) AM_READ(input_port_0_word_r) // p1+p2 controls
790   AM_RANGE(0xc08002, 0xc08003) AM_READ(input_port_1_word_r) // p3+p4 controls
791   AM_RANGE(0xc08004, 0xc08005) AM_READ(input_port_2_word_r) // extra controls
792   AM_RANGE(0xc08006, 0xc08007) AM_READ(input_port_3_word_r) // dipswitches
789   AM_RANGE(0xc08000, 0xc08001) AM_READ_PORT("P1P2")
790   AM_RANGE(0xc08002, 0xc08003) AM_READ_PORT("P3P4")
791   AM_RANGE(0xc08004, 0xc08005) AM_READ_PORT("Service")
792   AM_RANGE(0xc08006, 0xc08007) AM_READ_PORT("DSW")
793793
794794   AM_RANGE(0xc10000, 0xc1ffff) AM_READWRITE(z80_ram_r, z80_ram_w) /* Z80 Program */
795795   AM_RANGE(0x4f0000, 0x4f003f) AM_READWRITE(arm7_ram_r, arm7_ram_w) /* ARM7 Shared RAM */
r3115r3116
818818/* enough for 4 players, the basic dips mapped are listed in the test mode */
819819
820820static INPUT_PORTS_START( pgm )
821   PORT_START("P1P2")   /* P1P2 */
821   PORT_START("P1P2")
822822   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
823823   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
824824   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
r3115r3116
836836   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
837837   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
838838
839   PORT_START("P3P4")   /* P3P4 */
839   PORT_START("P3P4")
840840   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START3 )
841841   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
842842   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
r3115r3116
854854   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
855855   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
856856
857   PORT_START("Service")   /* Service */
857   PORT_START("Service")
858858   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
859859   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
860860   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
861861   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
862//  PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) // test 1p+2p
863   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) //  what should i use?
864   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service 1p+2p
865//  PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 ) // test 3p+4p
866   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) // what should i use?
867   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE2 ) // service 3p+4p
862//  PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 )  // test 1p+2p
863   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )   // what should i use?
864   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 )   // service 1p+2p
865//  PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 )  // test 3p+4p
866   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )   // what should i use?
867   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE2 )   // service 3p+4p
868868   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
869869   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
870870   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3)
871871   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
872   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused?
873   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused?
874   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused?
875   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused?
872   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
873   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
874   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
875   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // unused?
876876
877   PORT_START("DSW")   /* DSW */
877   PORT_START("DSW")
878878   PORT_SERVICE( 0x0001, IP_ACTIVE_LOW )
879879   PORT_DIPNAME( 0x0002, 0x0002, "Music" )
880880   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
r3115r3116
898898   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
899899   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
900900
901   PORT_START("Region")   /* Region */
901   PORT_START("Region")
902902   PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Region ) )
903903   PORT_DIPSETTING(      0x0000, DEF_STR( World ) )
904904//  PORT_DIPSETTING(      0x0001, DEF_STR( World ) ) // again?
r3115r3116
910910   PORT_INCLUDE ( pgm )
911911
912912   PORT_MODIFY("Region")
913   PORT_DIPNAME( 0x0003, 0x0002, DEF_STR( Unused ) ) // region switch
914   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) ) // if enabled, game gives
915   PORT_DIPSETTING(      0x0000, DEF_STR( On ) ) // "incorrect version" error
913   PORT_DIPNAME( 0x0003, 0x0002, DEF_STR( Unused ) )   // region switch
914   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )      // if enabled, game gives
915   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )      // "incorrect version" error
916916INPUT_PORTS_END
917917
918918static INPUT_PORTS_START( sango )
919   PORT_START("P1P2")   /* DSW */
920   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1                       )
921   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
922   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
923   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
924   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
925   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
926   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
927   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
928   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2                       )
929   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
930   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
931   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
932   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
933   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
934   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
935   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
919   PORT_INCLUDE ( pgm )
936920
937   PORT_START("P3P4")   /* DSW */
938   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START3                       )
939   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
940   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
941   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
942   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
943   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
944   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
945   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
946   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START4                       )
947   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
948   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
949   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
950   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
951   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
952   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
953   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
954
955   PORT_START("Service")   /* DSW */
956   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
957   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
958   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
959   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
960//  PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) // test 1p+2p
961   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) //  what should i use?
962   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service 1p+2p
963//  PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 ) // test 3p+4p
964   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) // what should i use?
965   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE2 ) // service 3p+4p
966   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
967   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
968   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3)
969   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
970   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
971   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
972   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
973   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
974
975   PORT_START("DSW")   /* DSW */
976   PORT_SERVICE( 0x0001, IP_ACTIVE_LOW )
977   PORT_DIPNAME( 0x0002, 0x0002, "Music" )
978   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
979   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
980   PORT_DIPNAME( 0x0004, 0x0004, "Voice" )
981   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
982   PORT_DIPSETTING(      0x0004, DEF_STR( On ) )
983   PORT_DIPNAME( 0x0008, 0x0008, "Free" )
984   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
985   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
986   PORT_DIPNAME( 0x0010, 0x0010, "Stop" )
987   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
988   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
989   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
990   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
991   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
992   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
993   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
994   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
995   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )
996   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
997   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
998
999   PORT_START("Region")   /* Region - supplied by protection device */
921   PORT_MODIFY("Region")   /* Region - supplied by protection device */
1000922   PORT_DIPNAME( 0x000f, 0x0005, DEF_STR( Region ) )
1001923   PORT_DIPSETTING(      0x0000, "China" )
1002924   PORT_DIPSETTING(      0x0001, "Taiwan" )
r3115r3116
1007929INPUT_PORTS_END
1008930
1009931static INPUT_PORTS_START( olds )
1010   PORT_START("P1P2")   /* DSW */
1011   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1                       )
1012   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1013   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1014   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1015   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1016   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1017   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1018   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1019   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2                       )
1020   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1021   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1022   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1023   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1024   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1025   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1026   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
932   PORT_INCLUDE ( pgm )
1027933
1028   PORT_START("P3P4")   /* DSW */
1029   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START3                       )
1030   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
1031   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
1032   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
1033   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
1034   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1035   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
1036   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
1037   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START4                       )
1038   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
1039   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
1040   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
1041   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
1042   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
1043   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
1044   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
1045
1046   PORT_START("Service")   /* DSW */
1047   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1048   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1049   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
1050   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
1051//  PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) // test 1p+2p
1052   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) //  what should i use?
1053   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service 1p+2p
1054//  PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 ) // test 3p+4p
1055   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) // what should i use?
1056   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE2 ) // service 3p+4p
1057   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1058   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1059   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3)
1060   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
1061   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1062   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1063   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1064   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1065
1066   PORT_START("DSW")   /* DSW */
1067   PORT_SERVICE( 0x0001, IP_ACTIVE_LOW )
1068   PORT_DIPNAME( 0x0002, 0x0002, "Music" )
1069   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1070   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
1071   PORT_DIPNAME( 0x0004, 0x0004, "Voice" )
1072   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1073   PORT_DIPSETTING(      0x0004, DEF_STR( On ) )
1074   PORT_DIPNAME( 0x0008, 0x0008, "Free" )
1075   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
1076   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1077   PORT_DIPNAME( 0x0010, 0x0010, "Stop" )
1078   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
1079   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1080   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
1081   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
1082   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1083   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
1084   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1085   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1086   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )
1087   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1088   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1089
1090   PORT_START("Region")   /* Region - supplied by protection device */
934   PORT_MODIFY("Region")   /* Region - supplied by protection device */
1091935   PORT_DIPNAME( 0x000f, 0x0006, DEF_STR( Region ) )
1092   // includes region 1 = taiwan , 2 = china, 3 = japan (title = orlegend special), 4 = korea, 5 = hongkong, 6 = world
936   /* includes the following regions:
937    1 = taiwan, 2 = china, 3 = japan (title = orlegend special),
938    4 = korea, 5 = hong kong, 6 = world */
1093939   PORT_DIPSETTING(      0x0001, "Taiwan" )
1094940   PORT_DIPSETTING(      0x0002, "China" )
1095941   PORT_DIPSETTING(      0x0003, DEF_STR( Japan ) )
r3115r3116
1099945INPUT_PORTS_END
1100946
1101947static INPUT_PORTS_START( killbld )
1102   PORT_START("P1P2")   /* DSW */
1103   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1                       )
1104   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1105   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1106   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1107   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1108   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1109   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1110   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1111   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2                       )
1112   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1113   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1114   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1115   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1116   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1117   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1118   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
948   PORT_INCLUDE ( pgm )
1119949
1120   PORT_START("P3P4")   /* DSW */
1121   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START3                       )
1122   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
1123   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
1124   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
1125   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
1126   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1127   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
1128   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
1129   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START4                       )
1130   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
1131   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
1132   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
1133   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
1134   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
1135   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
1136   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
1137
1138   PORT_START("Service")   /* DSW */
1139   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1140   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1141   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
1142   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
1143//  PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) // test 1p+2p
1144   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) //  what should i use?
1145   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service 1p+2p
1146//  PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 ) // test 3p+4p
1147   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) // what should i use?
1148   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE2 ) // service 3p+4p
1149   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1150   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1151   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3)
1152   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
1153   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1154   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1155   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1156   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1157
1158   PORT_START("DSW")   /* DSW */
1159   PORT_SERVICE( 0x0001, IP_ACTIVE_LOW )
1160   PORT_DIPNAME( 0x0002, 0x0002, "Music" )
1161   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1162   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
1163   PORT_DIPNAME( 0x0004, 0x0004, "Voice" )
1164   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1165   PORT_DIPSETTING(      0x0004, DEF_STR( On ) )
1166   PORT_DIPNAME( 0x0008, 0x0008, "Free" )
1167   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
1168   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1169   PORT_DIPNAME( 0x0010, 0x0010, "Stop" )
1170   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
1171   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1172   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
1173   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
1174   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1175   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
1176   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1177   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1178   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )
1179   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1180   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1181
1182   PORT_START("Region")   /* Region - supplied by protection device */
950   PORT_MODIFY("Region")   /* Region - supplied by protection device */
1183951   PORT_DIPNAME( 0x00ff, 0x0021, DEF_STR( Region ) )
1184952   PORT_DIPSETTING(      0x0016, "Taiwan" )
1185953   PORT_DIPSETTING(      0x0017, "China" )
r3115r3116
1196964INPUT_PORTS_END
1197965
1198966static INPUT_PORTS_START( photoy2k )
1199   PORT_START("P1P2")   /* DSW */
1200   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1                       )
1201   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1202   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1203   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1204   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1205   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1206   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1207   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1208   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2                       )
1209   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1210   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1211   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1212   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1213   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1214   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1215   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
967   PORT_INCLUDE ( pgm )
1216968
1217   PORT_START("P3P4")   /* DSW */
1218   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START3                       )
1219   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
1220   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
1221   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
1222   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
1223   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1224   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
1225   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
1226   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START4                       )
1227   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
1228   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
1229   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
1230   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
1231   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
1232   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
1233   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
1234
1235   PORT_START("Service")   /* DSW */
1236   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1237   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1238   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
1239   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
1240//  PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) // test 1p+2p
1241   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) //  what should i use?
1242   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service 1p+2p
1243//  PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 ) // test 3p+4p
1244   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) // what should i use?
1245   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE2 ) // service 3p+4p
1246   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1247   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1248   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3)
1249   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
1250   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1251   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1252   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1253   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1254
1255   PORT_START("DSW")   /* DSW */
1256   PORT_SERVICE( 0x0001, IP_ACTIVE_LOW )
1257   PORT_DIPNAME( 0x0002, 0x0002, "Music" )
1258   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1259   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
1260   PORT_DIPNAME( 0x0004, 0x0004, "Voice" )
1261   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1262   PORT_DIPSETTING(      0x0004, DEF_STR( On ) )
1263   PORT_DIPNAME( 0x0008, 0x0008, "Free" )
1264   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
1265   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1266   PORT_DIPNAME( 0x0010, 0x0010, "Stop" )
1267   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
1268   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1269   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
1270   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
1271   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1272   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
1273   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1274   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1275   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )
1276   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1277   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1278
1279   PORT_START("Region")   /* Region - supplied by protection device */
969   PORT_MODIFY("Region")   /* Region - supplied by protection device */
1280970   PORT_DIPNAME( 0x000f, 0x0003, DEF_STR( Region ) )
1281971   PORT_DIPSETTING(      0x0000, "Taiwan" )
1282972   PORT_DIPSETTING(      0x0001, "China" )
r3115r3116
1287977INPUT_PORTS_END
1288978
1289979static INPUT_PORTS_START( ddp2 )
1290   PORT_START("P1P2")   /* P1 */
1291   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1                       )
1292   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1293   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1294   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1295   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1296   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1297   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1298   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1299   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2                       )
1300   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1301   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1302   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1303   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1304   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1305   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1306   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
980   PORT_INCLUDE ( pgm )
1307981
1308   PORT_START("P3P4")   /* P2 */
1309   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START3                       )
1310   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
1311   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
1312   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
1313   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
1314   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1315   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
1316   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
1317   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START4                       )
1318   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
1319   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
1320   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
1321   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
1322   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
1323   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
1324   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
1325
1326   PORT_START("Service")   /* DSW */
1327   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1328   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1329   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
1330   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
1331//  PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) // test 1p+2p
1332   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) //  what should i use?
1333   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service 1p+2p
1334//  PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 ) // test 3p+4p
1335   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) // what should i use?
1336   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE2 ) // service 3p+4p
1337   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1338   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1339   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3)
1340   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
1341   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1342   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1343   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1344   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // uused?
1345
1346   PORT_START("DSW")   /* DSW */
1347   PORT_SERVICE( 0x0001, IP_ACTIVE_LOW )
1348   PORT_DIPNAME( 0x0002, 0x0002, "Music" )
1349   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1350   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
1351   PORT_DIPNAME( 0x0004, 0x0004, "Voice" )
1352   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1353   PORT_DIPSETTING(      0x0004, DEF_STR( On ) )
1354   PORT_DIPNAME( 0x0008, 0x0008, "Free" )
1355   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
1356   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1357   PORT_DIPNAME( 0x0010, 0x0010, "Stop" )
1358   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
1359   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1360   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
1361   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
1362   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1363   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
1364   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1365   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1366   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )
1367   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1368   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1369
1370/* probably not dsw related anyway
982/*  // probably not dsw related anyway
1371983    PORT_START("UNK0")
1372984    PORT_DIPNAME( 0x0001, 0x0001, "4" )
1373985    PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
r3115r3116
14681080    PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
14691081    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
14701082*/
1471   PORT_START("Region")   /* Region - supplied by protection device */
1083   PORT_MODIFY("Region")   /* Region - supplied by protection device */
14721084   PORT_DIPNAME( 0x000f, 0x0005, DEF_STR( Region ) )
14731085   PORT_DIPSETTING(      0x0000, "China" )
14741086   PORT_DIPSETTING(      0x0001, "Taiwan" )
src/mame/drivers/ssingles.c
r3115r3116
144144   prot_data^=data^0x11;
145145}
146146
147static READ8_HANDLER(controls_r)
147static CUSTOM_INPUT(controls_r)
148148{
149   int data=7;
150   switch(input_port_read(machine, "IN1"))      //multiplexed
149   int data = 7;
150   switch(input_port_read(field->port->machine, "EXTRA"))      //multiplexed
151151   {
152152      case 0x01: data = 1; break;
153153      case 0x02: data = 2; break;
r3115r3116
157157      case 0x20: data = 6; break;
158158      case 0x40: data = 0; break;
159159   }
160   return (input_port_read(machine, "IN0") & (~0x1c)) | (data << 2);
160
161   return data;
161162}
162163
163164static ADDRESS_MAP_START( ssingles_map, ADDRESS_SPACE_PROGRAM, 8 )
r3115r3116
179180   AM_RANGE(0x0a, 0x0a) AM_WRITE(ay8910_write_port_1_w)
180181   AM_RANGE(0x16, 0x16) AM_READ_PORT("DSW0")
181182   AM_RANGE(0x18, 0x18) AM_READ_PORT("DSW1")
182   AM_RANGE(0x1c, 0x1c) AM_READ(controls_r)
183   AM_RANGE(0x1c, 0x1c) AM_READ_PORT("INPUTS")
183184   AM_RANGE(0x1a, 0x1a) AM_WRITENOP //video/crt related
184185   AM_RANGE(0xfe, 0xfe) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
185186   AM_RANGE(0xff, 0xff) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
r3115r3116
187188ADDRESS_MAP_END
188189
189190static INPUT_PORTS_START( ssingles )
190   PORT_START("IN0")
191   PORT_START("INPUTS")
191192   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
192193   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) //must be LOW
194   PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(controls_r, NULL)
193195   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON4 )
194196   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
195197   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 )
196198
197   PORT_START("IN1")
199   PORT_START("EXTRA")
198200   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
199201   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
200202   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
src/mame/drivers/sbasketb.c
r3115r3116
5555static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
5656   AM_RANGE(0x2000, 0x3bff) AM_READ(SMH_RAM)
5757   AM_RANGE(0x3c10, 0x3c10) AM_READ(SMH_NOP)    /* ???? */
58   AM_RANGE(0x3e00, 0x3e00) AM_READ(input_port_0_r)
59   AM_RANGE(0x3e01, 0x3e01) AM_READ(input_port_1_r)
60   AM_RANGE(0x3e02, 0x3e02) AM_READ(input_port_2_r)
58   AM_RANGE(0x3e00, 0x3e00) AM_READ_PORT("SYSTEM")
59   AM_RANGE(0x3e01, 0x3e01) AM_READ_PORT("P1")
60   AM_RANGE(0x3e02, 0x3e02) AM_READ_PORT("P2")
6161   AM_RANGE(0x3e03, 0x3e03) AM_READ(SMH_NOP)
62   AM_RANGE(0x3e80, 0x3e80) AM_READ(input_port_3_r)
63   AM_RANGE(0x3f00, 0x3f00) AM_READ(input_port_4_r)
62   AM_RANGE(0x3e80, 0x3e80) AM_READ_PORT("DSW1")
63   AM_RANGE(0x3f00, 0x3f00) AM_READ_PORT("DSW2")
6464   AM_RANGE(0x6000, 0xffff) AM_READ(SMH_ROM)
6565ADDRESS_MAP_END
6666
r3115r3116
100100
101101
102102static INPUT_PORTS_START( sbasketb )
103   PORT_START("SYSTEM")   /* IN0 */
103   PORT_START("SYSTEM")
104104   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
105105   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
106106   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
110110   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
111111   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
112112
113   PORT_START("P1")   /* IN1 */
113   PORT_START("P1")
114114   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
115115   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
116116   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
r3115r3116
120120   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
121121   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
122122
123   PORT_START("P2")   /* IN2 */
123   PORT_START("P2")
124124   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
125125   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
126126   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
r3115r3116
130130   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3  ) PORT_COCKTAIL
131131   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
132132
133   PORT_START("DSW1")   /* DSW0 */
133   PORT_START("DSW1")
134134   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Game_Time ) )
135135   PORT_DIPSETTING(    0x03, "30" )
136136   PORT_DIPSETTING(    0x01, "40" )
r3115r3116
154154   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
155155   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
156156
157   PORT_START("DSW2")   /* DSW1 */
157   PORT_START("DSW2")
158158   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
159159   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
160160   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
src/mame/drivers/funkyjet.c
r3115r3116
155155/******************************************************************************/
156156
157157static INPUT_PORTS_START( funkyjet )
158   PORT_START("P1")   /* Player 1 controls */
159   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
160   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
161   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
162   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
163   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
164   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
165   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )   /* Button 3 only in "test mode" */
166   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
158   PORT_START("INPUTS")
159   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
160   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
161   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
162   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
163   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
164   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
165   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)   /* Button 3 only in "test mode" */
166   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
167   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
168   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
169   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
170   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
171   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
172   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
173   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)   /* Button 3 only in "test mode" */
174   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
167175
168   PORT_START("P2")   /* Player 2 controls */
169   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
170   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
171   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
172   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
173   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
174   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
175   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )   /* Button 3 only in "test mode" */
176   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
176   PORT_START("SYSTEM")
177   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
178   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
179   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
180   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
177181
178   PORT_START("IN0")   /* System Inputs */
179   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
180   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
181   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
182   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
183
184182   /* Dips seem inverted with respect to other Deco games */
183   PORT_START("DSW")
184   PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) )
185   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
186   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )
187   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_1C ) )
188   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_2C ) )
189   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_3C ) )
190   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
191   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_5C ) )
192   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_6C ) )
193   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) )
194   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
195   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
196   PORT_DIPSETTING(      0x001c, DEF_STR( 1C_1C ) )
197   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_2C ) )
198   PORT_DIPSETTING(      0x0014, DEF_STR( 1C_3C ) )
199   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
200   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_5C ) )
201   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_6C ) )
202   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )
203   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
204   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
205   PORT_SERVICE( 0x0001, IP_ACTIVE_LOW )
185206
186   PORT_START("DSWA")   /* Dip switch bank 1 */
187   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
188   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
189   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
190   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) )
191   PORT_DIPSETTING(    0x60, DEF_STR( 1C_2C ) )
192   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )
193   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
194   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_5C ) )
195   PORT_DIPSETTING(    0x40, DEF_STR( 1C_6C ) )
196   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) )
197   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
198   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
199   PORT_DIPSETTING(    0x1c, DEF_STR( 1C_1C ) )
200   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_2C ) )
201   PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
202   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
203   PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C ) )
204   PORT_DIPSETTING(    0x08, DEF_STR( 1C_6C ) )
205   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
206   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
207   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
208   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
209
210   PORT_START("DSWB")   /* Dip switch bank 2 */
211   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
212   PORT_DIPSETTING(    0x80, "1" )
213   PORT_DIPSETTING(    0xc0, "2" )
214   PORT_DIPSETTING(    0x40, "3" )
215   PORT_DIPSETTING(    0x00, "4" )
216   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
217   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
218   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
219   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
220   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
221   PORT_DIPNAME( 0x08, 0x08, "Freeze" )
222   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
223   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
224   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Free_Play ) )
225   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
226   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
227   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Allow_Continue ) )
228   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
229   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
230     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) )
231   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
232   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
207     PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Demo_Sounds ) )
208   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
209   PORT_DIPSETTING(      0x0100, DEF_STR( On ) )
210   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Allow_Continue ) )
211   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
212   PORT_DIPSETTING(      0x0200, DEF_STR( Yes ) )
213   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Free_Play ) )
214   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
215   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
216   PORT_DIPNAME( 0x0800, 0x0800, "Freeze" )
217   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
218   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
219   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) )
220   PORT_DIPSETTING(      0x1000, DEF_STR( Easy ) )
221   PORT_DIPSETTING(      0x3000, DEF_STR( Normal ) )
222   PORT_DIPSETTING(      0x2000, DEF_STR( Hard ) )
223   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
224   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) )
225   PORT_DIPSETTING(      0x8000, "1" )
226   PORT_DIPSETTING(      0xc000, "2" )
227   PORT_DIPSETTING(      0x4000, "3" )
228   PORT_DIPSETTING(      0x0000, "4" )
233229INPUT_PORTS_END
234230
235231static INPUT_PORTS_START( funkyjej )
236232   PORT_INCLUDE(funkyjet)
237233
238   PORT_MODIFY("DSWB")
239
240     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
241   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
242   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
234   PORT_MODIFY("DSW")
235     PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Demo_Sounds ) )
236   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
237   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
243238INPUT_PORTS_END
244239
245240static INPUT_PORTS_START( sotsugyo )
246   PORT_START("P1")   /* Player 1 controls */
247   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
248   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
249   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
250   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
251   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
252   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
253   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)   /* only in "test mode" */
254   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
241   PORT_INCLUDE(funkyjet)
255242
256   PORT_START("P2")   /* Player 2 controls */
257   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
258   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
259   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
260   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
261   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
262   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
263   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)   /* only in "test mode" */
264   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
265
266   PORT_START("IN0")   /* System Inputs */
267   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
268   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )      // Not working - see notes
269   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )      // See notes
270   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
271
272   /* Dips seem inverted with respect to other Deco games */
273
274   PORT_START("DSWA")   /* Dip switch bank 1 */
275   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
276   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
277   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
278   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) )
279   PORT_DIPSETTING(    0x60, DEF_STR( 1C_2C ) )
280   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )
281   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
282   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_5C ) )
283   PORT_DIPSETTING(    0x40, DEF_STR( 1C_6C ) )
284   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) )
285   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
286   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
287   PORT_DIPSETTING(    0x1c, DEF_STR( 1C_1C ) )
288   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_2C ) )
289   PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
290   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
291   PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C ) )
292   PORT_DIPSETTING(    0x08, DEF_STR( 1C_6C ) )
293   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
294   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
295   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
296   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
297
298   PORT_START("DSWB")   /* Dip switch bank 2 */
299   PORT_DIPNAME( 0x80, 0x80, "Freeze" )
300   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
301   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
302   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
303   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
304   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
305   PORT_DIPNAME( 0x30, 0x20, DEF_STR( Difficulty ) )
306   PORT_DIPSETTING(    0x30, DEF_STR( Easy ) )
307   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
308   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
309   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
310   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
311   PORT_DIPSETTING(    0x04, "1" )
312   PORT_DIPSETTING(    0x08, "2" )
313   PORT_DIPSETTING(    0x0c, "3" )
314   PORT_DIPSETTING(    0x00, "4" )
315   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
316   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
317   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
318   PORT_DIPUNUSED( 0x01, IP_ACTIVE_LOW )                   // See notes
243   PORT_MODIFY("DSW")
244   PORT_DIPUNUSED( 0x0100, IP_ACTIVE_LOW )                   // See notes
245   PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Demo_Sounds ) )
246   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
247   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
248   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Lives ) )
249   PORT_DIPSETTING(      0x0400, "1" )
250   PORT_DIPSETTING(      0x0800, "2" )
251   PORT_DIPSETTING(      0x0c00, "3" )
252   PORT_DIPSETTING(      0x0000, "4" )
253   PORT_DIPNAME( 0x3000, 0x2000, DEF_STR( Difficulty ) )
254   PORT_DIPSETTING(      0x3000, DEF_STR( Easy ) )
255   PORT_DIPSETTING(      0x2000, DEF_STR( Normal ) )
256   PORT_DIPSETTING(      0x1000, DEF_STR( Hard ) )
257   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
258   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Free_Play ) )
259   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
260   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
261   PORT_DIPNAME( 0x8000, 0x8000, "Freeze" )
262   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
263   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
319264INPUT_PORTS_END
320265
321266/******************************************************************************/
src/mame/drivers/skyarmy.c
r3115r3116
159159        AM_RANGE(0x8800, 0x93FF) AM_READ(SMH_RAM) /* Video RAM */
160160        AM_RANGE(0x9800, 0x983F) AM_READ(SMH_RAM) /* Sprites */
161161        AM_RANGE(0x9840, 0x985F) AM_READ(skyarmy_scrollram_r) /* Sroll RAM */
162        AM_RANGE(0xA000, 0xA000) AM_READ(input_port_0_r)
163        AM_RANGE(0xA001, 0xA001) AM_READ(input_port_1_r)
164        AM_RANGE(0xA002, 0xA002) AM_READ(input_port_2_r)
165        AM_RANGE(0xA003, 0xA003) AM_READ(input_port_3_r)
162        AM_RANGE(0xA000, 0xA000) AM_READ_PORT("DSW")
163        AM_RANGE(0xA001, 0xA001) AM_READ_PORT("P1")
164        AM_RANGE(0xA002, 0xA002) AM_READ_PORT("P2")
165        AM_RANGE(0xA003, 0xA003) AM_READ_PORT("SYSTEM")
166166ADDRESS_MAP_END
167167
168168static ADDRESS_MAP_START( skyarmy_writemem, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/suprgolf.c
r3115r3116
9797
9898static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 )
9999   ADDRESS_MAP_GLOBAL_MASK(0xff)
100   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r) // Player 1 controls
101   AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r) // Player 2 controls
102   AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r) // ??
103   AM_RANGE(0x04, 0x04) AM_READ(input_port_3_r) // extra controls + coin + test
104   AM_RANGE(0x05, 0x05) AM_READ(input_port_4_r) AM_WRITE(rom_bank_select_w)
100   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
101   AM_RANGE(0x01, 0x01) AM_READ_PORT("P2")
102   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") // ??
103   AM_RANGE(0x04, 0x04) AM_READ_PORT("SYSTEM")
104   AM_RANGE(0x05, 0x05) AM_READ_PORT("IN4") AM_WRITE(rom_bank_select_w)
105105   AM_RANGE(0x06, 0x06) AM_READ(suprgolf_random) // game locks up or crashes? if this doesn't return right values?
106106
107107   AM_RANGE(0x08, 0x08) AM_READ(ym2203_status_port_0_r) AM_WRITE(ym2203_control_port_0_w)
r3115r3116
109109 ADDRESS_MAP_END
110110
111111static INPUT_PORTS_START( suprgolf )
112   PORT_START("P1")   /* PLAY1 */
112   PORT_START("P1")
113113   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
114114   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
115115   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
119119   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)         /* CNT */
120120   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)         /* SEL */
121121
122   PORT_START("P2")   /* PLAY2 */
122   PORT_START("P2")
123123   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
124124   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
125125   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
129129   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)         /* CNT */
130130   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)         /* SEL */
131131
132   PORT_START("IN2")   /* 8bit */
132   PORT_START("IN2")
133133   PORT_DIPNAME( 0x01, 0x01, "2" )
134134   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
135135   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
155155   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
156156   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
157157
158   PORT_START("SYSTEM")   /* 8bit */
158   PORT_START("SYSTEM")
159159   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )                        /* 1P */
160160   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)         /* POW */
161161   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )                        /* 1P */
r3115r3116
169169   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
170170   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
171171
172   PORT_START("IN4")   /* 8bit */
172   PORT_START("IN4")
173173   PORT_DIPNAME( 0x01, 0x01, "4" )
174174   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
175175   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
195195   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
196196   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
197197
198   PORT_START("DSW0")   /* 8bit */
198   PORT_START("DSW0")
199199   PORT_DIPNAME( 0x01, 0x01, "DSW0" )
200200   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
201201   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
221221   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
222222   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
223223
224   PORT_START("DSW1")   /* 8bit */
224   PORT_START("DSW1")
225225   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
226226   PORT_DIPNAME( 0x02, 0x02, "DSW1" )
227227   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
src/mame/drivers/skullxbo.c
r3115r3116
3232
3333static void update_interrupts(running_machine *machine)
3434{
35   int newstate = 0;
36
37   if (atarigen_scanline_int_state)
38      newstate = 1;
39   if (atarigen_video_int_state)
40      newstate = 2;
41   if (atarigen_sound_int_state)
42      newstate = 4;
43
44   if (newstate)
45      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
46   else
47      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
35   cpunum_set_input_line(machine, 0, 1, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
36   cpunum_set_input_line(machine, 0, 2, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
37   cpunum_set_input_line(machine, 0, 4, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
4838}
4939
5040
r3115r3116
144134   AM_RANGE(0xff4800, 0xff4fff) AM_WRITE(skullxbo_mobwr_w)
145135   AM_RANGE(0xff6000, 0xff6fff) AM_WRITE(atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size)
146136   AM_RANGE(0xff5000, 0xff5001) AM_READ(atarigen_sound_r)
147   AM_RANGE(0xff5800, 0xff5801) AM_READ(input_port_0_word_r)
137   AM_RANGE(0xff5800, 0xff5801) AM_READ_PORT("FF5800")
148138   AM_RANGE(0xff5802, 0xff5803) AM_READ(special_port1_r)
149139   AM_RANGE(0xff6000, 0xff6fff) AM_READ(atarigen_eeprom_r)
150140   AM_RANGE(0xff8000, 0xff9fff) AM_RAM_WRITE(atarigen_playfield_latched_lsb_w) AM_BASE(&atarigen_playfield)
r3115r3116
164154 *************************************/
165155
166156static INPUT_PORTS_START( skullxbo )
167   PORT_START("FF5800")      /* ff5800 */
157   PORT_START("FF5800")
168158   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
169159   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
170160   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
r3115r3116
175165   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
176166   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
177167
178   PORT_START("FF5802")      /* ff5802 */
168   PORT_START("FF5802")
179169   PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
180170   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED )   /* HBLANK */
181171   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_VBLANK )
src/mame/drivers/adp.c
r3115r3116
66
77TODO:
88(almost everything)
9 - add emulation of HD63484 (like shanghai.c but 4bpp mode and much more commands)
109 - add sound and i/o
1110 - protection in Fashion Gambler (NVRam based?)
1211
r3115r3116
141140#include "machine/68681.h"
142141#include "deprecat.h"
143142
143static UINT8 register_active;
144144static struct
145145{
146146   const device_config *duart68681;
r3115r3116
194194   NULL
195195};
196196
197/*
198197static PALETTE_INIT( adp )
199198{
200199    int i;
r3115r3116
206205
207206
208207        // red component
209        bit0 = (i >> 2) & 0x01;
208        bit0 = (i >> 0) & 0x01;
210209        bit1 = (i >> 3) & 0x01;
211        bit2 = (i >> 4) & 0x01;
210        bit2 = (i >> 0) & 0x01;
212211        r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
213212        // green component
214        bit0 = (i >> 5) & 0x01;
215        bit1 = (i >> 6) & 0x01;
216        bit2 = (i >> 7) & 0x01;
213        bit0 = (i >> 1) & 0x01;
214        bit1 = (i >> 3) & 0x01;
215        bit2 = (i >> 1) & 0x01;
217216        g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
218217        // blue component
219        bit0 = 0;
220        bit1 = (i >> 0) & 0x01;
221        bit2 = (i >> 1) & 0x01;
218        bit0 = (i >> 2) & 0x01;
219        bit1 = (i >> 3) & 0x01;
220        bit2 = (i >> 2) & 0x01;
222221        b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
223222
224223        palette_set_color(machine,i,MAKE_RGB(r,g,b));
225224    }
226225}
227*/
228226
229227static VIDEO_START(adp)
230228{
r3115r3116
273271      for (x = 0 ; x < (HD63484_reg[0xca/2] & 0x0fff) * 4 ; x += 4)
274272      {
275273         b &= (HD63484_RAM_SIZE-1);
276         *BITMAP_ADDR16(bitmap, y, x    ) = (HD63484_ram[b] & 0x000f);
277         *BITMAP_ADDR16(bitmap, y, x + 1) = (HD63484_ram[b] & 0x00f0) >> 4;
278         *BITMAP_ADDR16(bitmap, y, x + 2) = (HD63484_ram[b] & 0x0f00) >> 8;
279         *BITMAP_ADDR16(bitmap, y, x + 3) = (HD63484_ram[b] & 0xf000) >> 12;
274         *BITMAP_ADDR16(bitmap, y, x    ) = ((HD63484_ram[b] & 0x000f) >>  0) << 0;
275         *BITMAP_ADDR16(bitmap, y, x + 1) = ((HD63484_ram[b] & 0x00f0) >>  4) << 0;
276         *BITMAP_ADDR16(bitmap, y, x + 2) = ((HD63484_ram[b] & 0x0f00) >>  8) << 0;
277         *BITMAP_ADDR16(bitmap, y, x + 3) = ((HD63484_ram[b] & 0xf000) >> 12) << 0;
280278         b++;
281279      }
282280   }
r3115r3116
298296            b &= (HD63484_RAM_SIZE - 1);
299297            if (x <= w && x + sx >= 0 && x + sx < (HD63484_reg[0xca/2] & 0x0fff) * 4)
300298               {
301                  *BITMAP_ADDR16(bitmap, y, x + sx    ) = (HD63484_ram[b] & 0x000f);
302                  *BITMAP_ADDR16(bitmap, y, x + sx + 1) = (HD63484_ram[b] & 0x00f0) >> 4;
303                  *BITMAP_ADDR16(bitmap, y, x + sx + 2) = (HD63484_ram[b] & 0x0f00) >> 8;
304                  *BITMAP_ADDR16(bitmap, y, x + sx + 3) = (HD63484_ram[b] & 0xf000) >> 12;
299                  *BITMAP_ADDR16(bitmap, y, x + sx    ) = ((HD63484_ram[b] & 0x000f) >>  0) << 0;
300                  *BITMAP_ADDR16(bitmap, y, x + sx + 1) = ((HD63484_ram[b] & 0x00f0) >>  4) << 0;
301                  *BITMAP_ADDR16(bitmap, y, x + sx + 2) = ((HD63484_ram[b] & 0x0f00) >>  8) << 0;
302                  *BITMAP_ADDR16(bitmap, y, x + sx + 3) = ((HD63484_ram[b] & 0xf000) >> 12) << 0;
305303               }
306304            b++;
307305         }
r3115r3116
313311
314312static READ16_HANDLER(test_r)
315313{
314// printf("ra=%04x ",register_active);
315if (register_active == 0x0000) {
316   if (input_code_pressed(KEYCODE_1)) return 0x0001 ^ 0xffff;
317   if (input_code_pressed(KEYCODE_2)) return 0x0002 ^ 0xffff;
318   if (input_code_pressed(KEYCODE_3)) return 0x0004 ^ 0xffff;
319   if (input_code_pressed(KEYCODE_4)) return 0x0008 ^ 0xffff;
320   if (input_code_pressed(KEYCODE_5)) return 0x0010 ^ 0xffff;
321   if (input_code_pressed(KEYCODE_6)) return 0x0020 ^ 0xffff;
322   if (input_code_pressed(KEYCODE_7)) return 0x0040 ^ 0xffff;
323   if (input_code_pressed(KEYCODE_8)) return 0x0080 ^ 0xffff;
324   if (input_code_pressed(KEYCODE_A)) return 0x0100 ^ 0xffff;
325   if (input_code_pressed(KEYCODE_S)) return 0x0200 ^ 0xffff;
326   if (input_code_pressed(KEYCODE_D)) return 0x0400 ^ 0xffff;
327   if (input_code_pressed(KEYCODE_F)) return 0x0800 ^ 0xffff;
328   if (input_code_pressed(KEYCODE_G)) return 0x1000 ^ 0xffff;
329   if (input_code_pressed(KEYCODE_H)) return 0x2000 ^ 0xffff;
330   if (input_code_pressed(KEYCODE_J)) return 0x4000 ^ 0xffff;
331   if (input_code_pressed(KEYCODE_K)) return 0x8000 ^ 0xffff;
332return 0x4;
333}
334   if (input_code_pressed(KEYCODE_1)) return 0x0001 ^ 0xffff;
335   if (input_code_pressed(KEYCODE_2)) return 0x0002 ^ 0xffff;
336   if (input_code_pressed(KEYCODE_3)) return 0x0004 ^ 0xffff;
337   if (input_code_pressed(KEYCODE_4)) return 0x0008 ^ 0xffff;
338   if (input_code_pressed(KEYCODE_5)) return 0x0010 ^ 0xffff;
339   if (input_code_pressed(KEYCODE_6)) return 0x0020 ^ 0xffff;
340   if (input_code_pressed(KEYCODE_7)) return 0x0040 ^ 0xffff;
341   if (input_code_pressed(KEYCODE_8)) return 0x0080 ^ 0xffff;
342
343   // return 0x0004 ^ 0xffff; // 0x0004
316344   switch (mame_rand(machine) & 3)
317345   {
318346      case 0:
r3115r3116
320348      case 1:
321349         return 0xffff;
322350      default:
323         return mame_rand(machine) % 0xffff;
351         return mame_rand(machine) & 0xffff;
324352   }
325353}
326354
355/*
327356static READ16_HANDLER(test1_r)
328357{
329   if (input_code_pressed(KEYCODE_Q)) return 0x0001;
330   if (input_code_pressed(KEYCODE_W)) return 0x0002;
331   if (input_code_pressed(KEYCODE_E)) return 0x0004;
332   if (input_code_pressed(KEYCODE_R)) return 0x0008;
333   if (input_code_pressed(KEYCODE_T)) return 0x0010;
334   if (input_code_pressed(KEYCODE_Y)) return 0x0020;
335   if (input_code_pressed(KEYCODE_U)) return 0x0040;
336   if (input_code_pressed(KEYCODE_I)) return 0x0080;
337   if (input_code_pressed(KEYCODE_A)) return 0x0100;
338   if (input_code_pressed(KEYCODE_S)) return 0x0200;
339   if (input_code_pressed(KEYCODE_D)) return 0x0400;
340   if (input_code_pressed(KEYCODE_F)) return 0x0800;
341   if (input_code_pressed(KEYCODE_G)) return 0x1000;
342   if (input_code_pressed(KEYCODE_H)) return 0x2000;
343   if (input_code_pressed(KEYCODE_J)) return 0x4000;
344   if (input_code_pressed(KEYCODE_K)) return 0x8000;
358    if (input_code_pressed(KEYCODE_Q)) return 0x0001;
359    if (input_code_pressed(KEYCODE_W)) return 0x0002;
360    if (input_code_pressed(KEYCODE_E)) return 0x0004;
361    if (input_code_pressed(KEYCODE_R)) return 0x0008;
362    if (input_code_pressed(KEYCODE_T)) return 0x0010;
363    if (input_code_pressed(KEYCODE_Y)) return 0x0020;
364    if (input_code_pressed(KEYCODE_U)) return 0x0040;
365    if (input_code_pressed(KEYCODE_I)) return 0x0080;
366    if (input_code_pressed(KEYCODE_A)) return 0x0100;
367    if (input_code_pressed(KEYCODE_S)) return 0x0200;
368    if (input_code_pressed(KEYCODE_D)) return 0x0400;
369    if (input_code_pressed(KEYCODE_F)) return 0x0800;
370    if (input_code_pressed(KEYCODE_G)) return 0x1000;
371    if (input_code_pressed(KEYCODE_H)) return 0x2000;
372    if (input_code_pressed(KEYCODE_J)) return 0x4000;
373    if (input_code_pressed(KEYCODE_K)) return 0x8000;
345374
375    switch (mame_rand(machine) & 3)
376    {
377        case 0:
378            return 0;
379        case 1:
380            return 0xffff;
381        default:
382            return mame_rand(machine) % 0xffff;
383    }
384}
385*/
386
387static READ16_HANDLER(rh1_r)
388{
389// printf("ra=%04x ",register_active);
390/*
391    if ((register_active == 0x0e) || (register_active == 0x0e) || (register_active == 0x0e))
392        {
393    if (input_code_pressed(KEYCODE_1)) return 0x0001 ^ 0xffff;
394    if (input_code_pressed(KEYCODE_2)) return 0x0002 ^ 0xffff;
395    if (input_code_pressed(KEYCODE_3)) return 0x0004 ^ 0xffff;
396    if (input_code_pressed(KEYCODE_4)) return 0x0008 ^ 0xffff;
397    if (input_code_pressed(KEYCODE_5)) return 0x0010 ^ 0xffff;
398    if (input_code_pressed(KEYCODE_6)) return 0x0020 ^ 0xffff;
399    if (input_code_pressed(KEYCODE_7)) return 0x0040 ^ 0xffff;
400    if (input_code_pressed(KEYCODE_8)) return 0x0080 ^ 0xffff;
401    if (input_code_pressed(KEYCODE_A)) return 0x0100 ^ 0xffff;
402    if (input_code_pressed(KEYCODE_S)) return 0x0200 ^ 0xffff;
403    if (input_code_pressed(KEYCODE_D)) return 0x0400 ^ 0xffff;
404    if (input_code_pressed(KEYCODE_F)) return 0x0800 ^ 0xffff;
405    if (input_code_pressed(KEYCODE_G)) return 0x1000 ^ 0xffff;
406    if (input_code_pressed(KEYCODE_H)) return 0x2000 ^ 0xffff;
407    if (input_code_pressed(KEYCODE_J)) return 0x4000 ^ 0xffff;
408    if (input_code_pressed(KEYCODE_K)) return 0x8000 ^ 0xffff;
409
410        }
411*/
346412   switch (mame_rand(machine) & 3)
347413   {
348414      case 0:
r3115r3116
354420   }
355421}
356422
423static WRITE16_HANDLER(wh1_w)
424{
425   // register_active = data;
426}
427
428static WRITE16_HANDLER(wh2_w)
429{
430   register_active = data;
431}
432
357433static ADDRESS_MAP_START( skattv_mem, ADDRESS_SPACE_PROGRAM, 16 )
358434   AM_RANGE(0x000000, 0x0fffff) AM_ROM
359   AM_RANGE(0x400000, 0x4000ff) AM_READ(test_r) //18b too
360435   AM_RANGE(0x800080, 0x800081) AM_READWRITE(HD63484_status_r, HD63484_address_w)
361436   AM_RANGE(0x800082, 0x800083) AM_READWRITE(HD63484_data_r, HD63484_data_w)
362//  AM_RANGE(0x8000a0, 0x8000a1) AM_READ(handler2_r)
363//  AM_RANGE(0x8000a2, 0x8000a3) AM_READ(handler2_r)
364//  AM_RANGE(0x800100, 0x80017f) AM_READ(test_r) //18b too
365   AM_RANGE(0x800100, 0x800101) AM_READ(test_r) //18b too
366   AM_RANGE(0x800140, 0x800141) AM_READ(test1_r) //18b too
437   AM_RANGE(0x800100, 0x800101) AM_READWRITE(test_r,wh2_w) //related to input
438   AM_RANGE(0x800140, 0x800141) AM_READWRITE(rh1_r,wh1_w) //18b too
439   AM_RANGE(0x800142, 0x800143) AM_READWRITE(rh1_r,wh1_w) //18b too
367440   AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8( DUART68681, "duart68681", duart68681_r, duart68681_w, 0xff )
368441//  AM_RANGE(0xffd246, 0xffd247) AM_READ(handler3_r)
369442//  AM_RANGE(0xffd248, 0xffd249) AM_READ(handler3_r)
r3115r3116
396469   PORT_INCLUDE(microtouch)
397470
398471   PORT_START("DSW1")
399   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN5    )
472   PORT_BIT( 0x0001, IP_ACTIVE_HIGH,  IPT_COIN5    )
400473   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_COIN6    )
401474   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_BILL1    )
402475   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
r3115r3116
430503   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
431504   MDRV_SCREEN_SIZE(384, 280)
432505   MDRV_SCREEN_VISIBLE_AREA(0, 384-1, 0, 280-1)
433   MDRV_PALETTE_LENGTH(0x100)
506   MDRV_PALETTE_LENGTH(0x10)
434507
435//  MDRV_PALETTE_INIT(adp)
508   MDRV_PALETTE_INIT(adp)
436509   MDRV_VIDEO_START(adp)
437510   MDRV_VIDEO_UPDATE(adp)
438511
r3115r3116
459532   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
460533   MDRV_SCREEN_SIZE(384, 280)
461534   MDRV_SCREEN_VISIBLE_AREA(0, 384-1, 0, 280-1)
462   MDRV_PALETTE_LENGTH(0x100)
535   MDRV_PALETTE_LENGTH(0x10)
463536
464//  MDRV_PALETTE_INIT(adp)
537   MDRV_PALETTE_INIT(adp)
465538   MDRV_VIDEO_START(adp)
466539   MDRV_VIDEO_UPDATE(adp)
467540
r3115r3116
481554   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
482555   MDRV_SCREEN_SIZE(640, 480)
483556   MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
484   MDRV_PALETTE_LENGTH(0x100)
557   MDRV_PALETTE_LENGTH(0x10)
485558
486559//  MDRV_PALETTE_INIT(adp)
487560   MDRV_VIDEO_START(adp)
src/mame/drivers/sliver.c
r3115r3116
406406   AM_RANGE(0x300004, 0x300005) AM_WRITE(io_offset_w) //unknown i/o device
407407   AM_RANGE(0x300006, 0x300007) AM_WRITE(io_data_w)
408408
409   AM_RANGE(0x400000, 0x400001) AM_READ(input_port_0_word_r)
410   AM_RANGE(0x400002, 0x400003) AM_READ(input_port_1_word_r)
411   AM_RANGE(0x400004, 0x400005) AM_READ(input_port_2_word_r)
409   AM_RANGE(0x400000, 0x400001) AM_READ_PORT("P1_P2")
410   AM_RANGE(0x400002, 0x400003) AM_READ_PORT("SYSTEM")
411   AM_RANGE(0x400004, 0x400005) AM_READ_PORT("DSW")
412412   AM_RANGE(0x400006, 0x400007) AM_WRITE(fifo_data_w)
413413   AM_RANGE(0x400008, 0x400009) AM_WRITE(fifo_clear_w)
414414   AM_RANGE(0x40000a, 0x40000b) AM_WRITE(fifo_flush_w)
src/mame/drivers/cps3.c
r3115r3116
26682668
26692669   /* video hardware */
26702670   MDRV_SCREEN_ADD("main", RASTER)
2671   MDRV_SCREEN_REFRESH_RATE(59.633333)   /* just a guess for now, based on previous games */
2672                              /* however Mantis bug 2110 suggests it may be slightly different */
2673   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
26742671   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
2675   MDRV_SCREEN_SIZE(512*2, 224*2)
2676   MDRV_SCREEN_VISIBLE_AREA(0, (384*1)-1, 0, 223/*511*/)
2672   MDRV_SCREEN_RAW_PARAMS(XTAL_60MHz/8, 486, 0, 384, 259, 0, 224)
2673/*
2674    Measured clocks:
2675        V = 59.5992Hz
2676        H = 15.4335kHz
2677        H/V = 258.955 ~ 259 lines
26772678
2679    Possible video clocks:
2680        60MHz       / 15.4335kHz = 3887.647 / 8 = 485.956 ~ 486 -> likely
2681         42.9545MHz / 15.4445kHz = 2781.217 / 6 = 463.536 -> unlikely
2682*/
2683
26782684   MDRV_MACHINE_START(cps3)
26792685   MDRV_MACHINE_RESET(cps3)
26802686   MDRV_NVRAM_HANDLER( cps3 )
src/mame/drivers/toaplan2.c
r3115r3116
744744   }
745745}
746746
747static READ16_HANDLER( c2map_port_6_r )
747static CUSTOM_INPUT( c2map_r )
748748{
749749   /* For Teki Paki hardware */
750750   /* bit 4 high signifies secondary CPU is ready */
r3115r3116
755755      case CPU_2_HD647180:   mcu_data = 0xff; break;                 /* Teki Paki */
756756      default:            mcu_data = 0x00; break;
757757   }
758   if (mcu_data == 0xff) mcu_data = 0x10;
759   else mcu_data = 0x00;
760   return ( mcu_data | input_port_read(machine, "JMPR") );
758
759   return (mcu_data == 0xff) ? 0x01 : 0x00;
761760}
762761
763762static READ16_HANDLER( pipibibi_z80_status_r )
r3115r3116
994993         /* from/to nvram to store the settings (a 93C45 EEPROM) */
995994         memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f002, 0x28fbff, 0, 0, SMH_BANK2, SMH_BANK2);
996995         memory_set_bankptr(2, fixeight_sec_cpu_mem);
997         memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f004, 0x28f005, 0, 0, input_port_5_word_r, SMH_NOP);   /* Dip Switch A - Wrong !!! */
998         memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f006, 0x28f007, 0, 0, input_port_6_word_r, SMH_NOP);   /* Dip Switch B - Wrong !!! */
999         memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f008, 0x28f009, 0, 0, input_port_7_word_r, SMH_NOP);   /* Territory Jumper block - Wrong !!! */
996         memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f004, 0x28f005, 0, 0, input_port_read_handler16(machine->portconfig, "DSWA"), SMH_NOP);   /* Dip Switch A - Wrong !!! */
997         memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f006, 0x28f007, 0, 0, input_port_read_handler16(machine->portconfig, "DSWB"), SMH_NOP);   /* Dip Switch B - Wrong !!! */
998         memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x28f008, 0x28f009, 0, 0, input_port_read_handler16(machine->portconfig, "JMPR"), SMH_NOP);   /* Territory Jumper block - Wrong !!! */
1000999
10011000         mcu_data = data;
10021001      }
r3115r3116
13971396   AM_RANGE(0x180000, 0x180001) AM_READ_PORT("DSWA")
13981397   AM_RANGE(0x180010, 0x180011) AM_READ_PORT("DSWB")
13991398   AM_RANGE(0x180020, 0x180021) AM_READ_PORT("SYS")
1400   AM_RANGE(0x180030, 0x180031) AM_READ(c2map_port_6_r)      /* CPU 2 busy and Territory Jumper block */
1399   AM_RANGE(0x180030, 0x180031) AM_READ_PORT("JMPR")         /* CPU 2 busy and Territory Jumper block */
14011400   AM_RANGE(0x180040, 0x180041) AM_WRITE(toaplan2_coin_word_w)   /* Coin count/lock */
14021401   AM_RANGE(0x180050, 0x180051) AM_READ_PORT("IN1")
14031402   AM_RANGE(0x180060, 0x180061) AM_READ_PORT("IN2")
r3115r3116
21812180
21822181
21832182static INPUT_PORTS_START( tekipaki )
2184   PORT_INCLUDE(toaplan2)
2183   PORT_INCLUDE( toaplan2 )
21852184
21862185   PORT_MODIFY("DSWA")
21872186   /* Various features on bit mask 0x000f - see above */
r3115r3116
22212220   PORT_DIPSETTING(      0x0008, "Hong Kong (Honest Trading Co.)" )
22222221   PORT_DIPSETTING(      0x0005, "Taiwan" )
22232222   PORT_DIPSETTING(      0x0006, "Taiwan (Spacy Co. Ltd)" )
2223   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(c2map_r, NULL)
22242224INPUT_PORTS_END
22252225
22262226
22272227static INPUT_PORTS_START( ghox )
2228   PORT_INCLUDE(toaplan2)
2228   PORT_INCLUDE( toaplan2 )
22292229
22302230   PORT_MODIFY("DSWA")
22312231   /* Various features on bit mask 0x000f - see above */
r3115r3116
22812281
22822282
22832283static INPUT_PORTS_START( dogyuun )
2284   PORT_INCLUDE(toaplan2)
2284   PORT_INCLUDE( toaplan2 )
22852285
22862286   PORT_MODIFY("IN1")
22872287   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1)
r3115r3116
23382338
23392339
23402340static INPUT_PORTS_START( kbash )
2341   PORT_INCLUDE(toaplan2)
2341   PORT_INCLUDE( toaplan2 )
23422342
23432343   PORT_MODIFY("IN1")
23442344   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1)
r3115r3116
24022402
24032403
24042404static INPUT_PORTS_START( truxton2 )
2405   PORT_INCLUDE(toaplan2)
2405   PORT_INCLUDE( toaplan2 )
24062406
24072407   PORT_MODIFY("IN1")
24082408   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1)
r3115r3116
24502450
24512451
24522452static INPUT_PORTS_START( pipibibs )
2453   PORT_INCLUDE(toaplan2)
2453   PORT_INCLUDE( toaplan2 )
24542454
24552455   PORT_MODIFY("DSWA")
24562456   /* Various features on bit mask 0x000f - see above */
r3115r3116
24962496   PORT_INCLUDE(pipibibs)
24972497
24982498   PORT_MODIFY("JMPR")
2499   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* bit 0x10 sound ready */
2499   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(c2map_r, NULL)   /* bit 0x10 sound ready */
25002500INPUT_PORTS_END
25012501
25022502
r3115r3116
25272527
25282528
25292529static INPUT_PORTS_START( fixeight )
2530   PORT_INCLUDE(toaplan2)
2530   PORT_INCLUDE( toaplan2 )
25312531
25322532   PORT_START("IN3")
25332533   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_8WAY
r3115r3116
26152615
26162616
26172617static INPUT_PORTS_START( grindstm )
2618   PORT_INCLUDE(toaplan2)
2618   PORT_INCLUDE( toaplan2 )
26192619
26202620   PORT_MODIFY("DSWA")
26212621   PORT_DIPNAME( 0x0001,   0x0000, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW1:1")
r3115r3116
26772677
26782678
26792679static INPUT_PORTS_START( batsugun )
2680   PORT_INCLUDE(toaplan2)
2680   PORT_INCLUDE( toaplan2 )
26812681
26822682   PORT_MODIFY("DSWA")
26832683   PORT_DIPNAME( 0x0001,   0x0000, "Continue Mode" )         PORT_DIPLOCATION("SW1:1")
r3115r3116
27292729
27302730
27312731static INPUT_PORTS_START( snowbro2 )
2732   PORT_INCLUDE(toaplan2)
2732   PORT_INCLUDE( toaplan2 )
27332733
27342734   PORT_START("IN3")
27352735   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_8WAY
r3115r3116
27972797
27982798
27992799static INPUT_PORTS_START( sstriker )
2800   PORT_INCLUDE(toaplan2)
2800   PORT_INCLUDE( toaplan2 )
28012801
28022802   PORT_MODIFY("DSWA")
28032803   PORT_DIPNAME( 0x0001,   0x0000, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("SW1:1")
r3115r3116
28502850
28512851
28522852static INPUT_PORTS_START( kingdmgp )
2853   PORT_INCLUDE(toaplan2)
2853   PORT_INCLUDE( toaplan2 )
28542854
28552855   PORT_MODIFY("DSWA")
28562856   PORT_DIPNAME( 0x0001,   0x0000, DEF_STR( Free_Play ) )      PORT_DIPLOCATION("SW1:1")
src/mame/drivers/couple.c
r3115r3116
201201
202202static INPUT_PORTS_START( couple )
203203   PORT_START("P1")
204   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) \
205   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) \
206   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) \
207   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) \
208   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_IMPULSE(1) \
209   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_IMPULSE(1) \
210   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_IMPULSE(1) \
211   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_IMPULSE(1) \
204   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
205   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
206   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
207   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
208   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_IMPULSE(1)
209   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_IMPULSE(1)
210   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_IMPULSE(1)
211   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_IMPULSE(1)
212212
213213   PORT_START("DSW")
214   PORT_DIPNAME( 0x01, 0x00, "Number of Attempts" ) \
215   PORT_DIPSETTING(    0x01, "99" ) \
216   PORT_DIPSETTING(    0x00, "9" ) \
217   PORT_DIPNAME( 0x02, 0x02, "Tries Per Coin" ) \
218   PORT_DIPSETTING(    0x02, "3" ) \
219   PORT_DIPSETTING(    0x00, "2" ) \
220   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coinage ) ) \
221   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) ) \
222   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) ) \
223   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) ) \
224/*2 Coins for 2 Credits?I think this is an invalid setting,it doesn't even work correctly*/ \
225/*  PORT_DIPSETTING(    0x00, DEF_STR( 2C_2C ) ) */ \
226   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Difficulty ) ) \
227   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) ) \
228   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) ) \
229   PORT_DIPNAME( 0x20, 0x00, "Sound" ) \
230   PORT_DIPSETTING(    0x20, DEF_STR( Off ) ) \
231   PORT_DIPSETTING(    0x00, DEF_STR( On ) ) \
214   PORT_DIPNAME( 0x01, 0x00, "Number of Attempts" )
215   PORT_DIPSETTING(    0x01, "99" )
216   PORT_DIPSETTING(    0x00, "9" )
217   PORT_DIPNAME( 0x02, 0x02, "Tries Per Coin" )
218   PORT_DIPSETTING(    0x02, "3" )
219   PORT_DIPSETTING(    0x00, "2" )
220   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coinage ) )
221   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
222   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
223   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
224/*2 Coins for 2 Credits?I think this is an invalid setting,it doesn't even work correctly*/
225/*  PORT_DIPSETTING(    0x00, DEF_STR( 2C_2C ) ) */
226   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Difficulty ) )
227   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
228   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
229   PORT_DIPNAME( 0x20, 0x00, "Sound" )
230   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
231   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
232232   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
233233   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
234234   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/mlanding.c
r3115r3116
1717#define ML_CHARS 0x2000
1818static UINT8 dirtychar[ML_CHARS];
1919static int status_bit;
20static int adpcm_pos;
21static int adpcm_data;
2022
2123
24
2225static const gfx_layout tiles8x8_layout =
2326{
2427   8,8,
r3115r3116
8790   memory_set_bankptr( 1, memory_region(machine, "z80") + ((data) & 0x03) * 0x4000 + 0x10000 );
8891}
8992
90static int adpcm_pos;
91
9293static void ml_msm5205_vck(running_machine *machine, int chip)
9394{
94   static int adpcm_data = -1;
95
9695   if (adpcm_data != -1)
9796   {
9897      msm5205_data_w(0, adpcm_data & 0x0f);
r3115r3116
352351   sound_bankswitch_w
353352};
354353
354static MACHINE_RESET( mlanding )
355{
356   status_bit = 0;
357   adpcm_pos = 0;
358   adpcm_data = -1;
359}
355360
356361static MACHINE_DRIVER_START( mlanding )
357362
r3115r3116
385390   MDRV_VIDEO_START(mlanding)
386391   MDRV_VIDEO_UPDATE(mlanding)
387392
393   MDRV_MACHINE_RESET(mlanding)
394
388395   /* sound hardware */
389396   MDRV_SPEAKER_STANDARD_MONO("mono")
390397
src/mame/drivers/tankbust.c
r3115r3116
200200   AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(tankbust_txtram_r, tankbust_txtram_w) AM_BASE(&tankbust_txtram)
201201   AM_RANGE(0xd800, 0xd8ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
202202   AM_RANGE(0xe000, 0xe007) AM_READWRITE(debug_output_area_r, tankbust_e0xx_w)
203   AM_RANGE(0xe800, 0xe800) AM_READWRITE(input_port_0_r, tankbust_yscroll_w)
204   AM_RANGE(0xe801, 0xe801) AM_READ(input_port_1_r)
205   AM_RANGE(0xe802, 0xe802) AM_READ(input_port_2_r)
203   AM_RANGE(0xe800, 0xe800) AM_READ_PORT("INPUTS") AM_WRITE(tankbust_yscroll_w)
204   AM_RANGE(0xe801, 0xe801) AM_READ_PORT("SYSTEM")
205   AM_RANGE(0xe802, 0xe802) AM_READ_PORT("DSW")
206206   AM_RANGE(0xe801, 0xe802) AM_WRITE(tankbust_xscroll_w)
207207   AM_RANGE(0xe803, 0xe803) AM_READWRITE(some_changing_input, tankbust_soundlatch_w)   /*unknown. Game expects this to change so this is not player input */
208208   AM_RANGE(0xe804, 0xe804) AM_WRITE(SMH_NOP)   /* watchdog ? ; written in long-lasting loops */
r3115r3116
233233
234234
235235static INPUT_PORTS_START( tankbust )
236   PORT_START("INPUTS")   /* IN0 */
236   PORT_START("INPUTS")
237237   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
238238   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
239239   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
r3115r3116
243243   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
244244   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
245245
246   PORT_START("SYSTEM")   /* IN1 */
246   PORT_START("SYSTEM")
247247   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
248248   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
249249   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
r3115r3116
253253   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
254254   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
255255
256   PORT_START("DSW")   /* DSW */
256   PORT_START("DSW")
257257   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
258258   PORT_DIPSETTING(   0x03, DEF_STR( Easy ) )
259259   PORT_DIPSETTING(   0x02, DEF_STR( Hard ) )
src/mame/drivers/pastelg.c
r3115r3116
7272   ADDRESS_MAP_GLOBAL_MASK(0xff)
7373   AM_RANGE(0x00, 0x7f) AM_READ(nb1413m3_sndrom_r)
7474   AM_RANGE(0x81, 0x81) AM_READ(ay8910_read_port_0_r)
75   AM_RANGE(0x90, 0x90) AM_READ(nb1413m3_inputport0_r)
75   AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM")
7676   AM_RANGE(0xa0, 0xa0) AM_READ(nb1413m3_inputport1_r)
7777   AM_RANGE(0xb0, 0xb0) AM_READ(nb1413m3_inputport2_r)
7878   AM_RANGE(0xc0, 0xc0) AM_READ(pastelg_sndrom_r)
r3115r3116
9494
9595
9696static INPUT_PORTS_START( pastelg )
97   PORT_START("DSWA")   /* (0) DIPSW-A */
97   PORT_START("DSWA")
9898   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
9999   PORT_DIPSETTING(    0x03, "1 (Easy)" )
100100   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
119119   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
120120   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
121121
122   PORT_START("DSWB")   /* (1) DIPSW-B */
122   PORT_START("DSWB")
123123   PORT_DIPNAME( 0x03, 0x00, "Number of last chance" )
124124   PORT_DIPSETTING(    0x03, "0" )
125125   PORT_DIPSETTING(    0x02, "1" )
r3115r3116
143143   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
144144   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
145145
146   PORT_START("DSWC")   /* (2) DIPSW-C */
146   PORT_START("DSWC")
147147   PORT_DIPNAME( 0x03, 0x03, "Change Rate" )
148148   PORT_DIPSETTING(    0x03, "Type-A" )
149149   PORT_DIPSETTING(    0x02, "Type-B" )
r3115r3116
167167   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
168168   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
169169
170   PORT_START("SYSTEM")   /* (3) PORT 0 */
171   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
170   PORT_START("SYSTEM")
171   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
172172   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
173173   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
174174   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
src/mame/drivers/portrait.c
r3115r3116
8484**************************************************************************/
8585
8686#include "driver.h"
87#include "cpu/i8039/i8039.h"
87#include "cpu/mcs48/mcs48.h"
8888#include "sound/5220intf.h"
8989
9090extern UINT8 *portrait_bgvideoram,*portrait_fgvideoram;
r3115r3116
131131   AM_RANGE(0x9200, 0x97ff) AM_RAM
132132   AM_RANGE(0xa000, 0xa000) AM_WRITE(soundlatch_w)
133133   AM_RANGE(0xa010, 0xa010) AM_WRITENOP // ?
134   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
135   AM_RANGE(0xa004, 0xa004) AM_READ(input_port_1_r)
136   AM_RANGE(0xa008, 0xa008) AM_READWRITE(input_port_2_r, portrait_ctrl_w)
137   AM_RANGE(0xa010, 0xa010) AM_READ(input_port_3_r)
134   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("DSW1")
135   AM_RANGE(0xa004, 0xa004) AM_READ_PORT("DSW2")
136   AM_RANGE(0xa008, 0xa008) AM_READ_PORT("SYSTEM") AM_WRITE(portrait_ctrl_w)
137   AM_RANGE(0xa010, 0xa010) AM_READ_PORT("INPUTS")
138138   AM_RANGE(0xa018, 0xa018) AM_READWRITE(SMH_NOP, portrait_positive_scroll_w)
139139   AM_RANGE(0xa019, 0xa019) AM_WRITE(portrait_negative_scroll_w)
140140   AM_RANGE(0xa800, 0xa83f) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
r3115r3116
148148
149149
150150static INPUT_PORTS_START( portrait )
151   PORT_START("DSW1") /* DSW 1 */
151   PORT_START("DSW1")
152152   PORT_DIPNAME( 0x0f, 0x08, DEF_STR( Coin_A ) )
153153   PORT_DIPSETTING(    0x08, DEF_STR( 1C_1C ) )
154154   PORT_DIPSETTING(    0x09, DEF_STR( 1C_2C ) )
r3115r3116
179179   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
180180   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
181181
182   PORT_START("DSW2") /* DSW 2 */
182   PORT_START("DSW2")
183183   PORT_DIPNAME( 0x01, 0x00, "Game Play" )
184184   PORT_DIPSETTING(    0x00, "Normal Play" )
185185   PORT_DIPSETTING(    0x01, "Freeplay (255 Cameras)" )
r3115r3116
203203   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
204204   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
205205
206   PORT_START("SYSTEM") /* IN 0 */
206   PORT_START("SYSTEM")
207207   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )    PORT_IMPULSE(2)
208208   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )    PORT_IMPULSE(2)
209209   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(2)
r3115r3116
215215   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
216216   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
217217
218   PORT_START("INPUTS") /* IN 1 */
218   PORT_START("INPUTS")
219219   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_JOYSTICK_UP    ) PORT_4WAY
220220   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICK_DOWN  ) PORT_4WAY
221221   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICK_RIGHT ) PORT_4WAY
src/mame/drivers/tetrisp2.c
r3115r3116
337337      rocknms_main2sub = (data ^ 0xffff);
338338}
339339
340static READ16_HANDLER( rocknms_port_0_r )
340static CUSTOM_INPUT( rocknms_main2sub_status_r )
341341{
342   return ((input_port_read(machine, "PLAYERS") & 0xfffc ) | (rocknms_sub2main & 0x0003));
342   return rocknms_sub2main & 0x0003;
343343}
344344
345345static WRITE16_HANDLER( rocknms_sub2main_w )
r3115r3116
601601   AM_RANGE(0xa40002, 0xa40003) AM_READ(tetrisp2_sound_r      )   // Sound
602602   AM_RANGE(0xa44000, 0xa44001) AM_READ(rockn_adpcmbank_r      )   // Sound Bank
603603   AM_RANGE(0xbe0000, 0xbe0001) AM_READ(SMH_NOP            )   // INT-level1 dummy read
604   AM_RANGE(0xbe0002, 0xbe0003) AM_READ(rocknms_port_0_r      )   // Inputs
604   AM_RANGE(0xbe0002, 0xbe0003) AM_READ_PORT("PLAYERS")
605605   AM_RANGE(0xbe0004, 0xbe0005) AM_READ_PORT("SYSTEM")            // Inputs
606606   AM_RANGE(0xbe0008, 0xbe0009) AM_READ_PORT("DSW")            // Inputs
607607   AM_RANGE(0xbe000a, 0xbe000b) AM_READ(watchdog_reset16_r)      // Watchdog
r3115r3116
700700static INPUT_PORTS_START( tetrisp2 )
701701
702702   PORT_START("PLAYERS") /*$be0002.w*/
703   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
704   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
705   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
706   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
707   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
708   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
709   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
710   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
711   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
712   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
713   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
714   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
715   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
716   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
717   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
718   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
703   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
704   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
705   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
706   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
707   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
708   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
709   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
710   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
711   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
712   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
713   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
714   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
715   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
716   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
717   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
718   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
719719
720720   PORT_START("SYSTEM") /*$be0004.w*/
721   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN  )
722   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN  )
723   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_START1   )
724   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_START2   )
725   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN  )
726   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 )
727   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_COIN1    )
728   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_COIN2    )
729   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_SPECIAL  )   /* ?*/
730   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_SPECIAL  )   /* ?*/
731   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN  )
732   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN  )
733   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
734   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
735   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
736   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
721   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
722   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
723   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
724   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2   )
725   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
726   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 )
727   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN1 )
728   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN2 )
729   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_SPECIAL  )   /* ?*/
730   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SPECIAL  )   /* ?*/
731   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
732   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
733   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
734   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
735   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
736   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
737737
738738   PORT_START("DSW") //$be0008.w
739739   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
r3115r3116
835835   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
836836
837837   PORT_START("COINS") // be0004.w
838   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN  )
839   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN  )
840   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN  )
841   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN  )
838   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
839   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
840   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
841   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
842842   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE2 )   // (keep pressed during boot for test mode)
843843   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 )
844   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN1    )
845   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
846   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN  )
847   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN  )
848   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN  )
849   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN  )
850   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
851   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
852   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
853   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
844   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN1 )
845   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
846   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
847   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
848   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
849   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
850   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
851   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
852   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
853   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
854854
855855   PORT_START("DSW") // be0008.w
856856   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
r3115r3116
906906   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
907907
908908   PORT_START("PRINT") // be0006.w
909   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1  ) PORT_NAME("Print 1?")   // Press both to print (and alternate with ok too).
910   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2  ) PORT_NAME("Print 2?")   // Hold them for some seconds to bring up a "caution" message.
909   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Print 1?")   // Press both to print (and alternate with ok too).
910   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Print 2?")   // Hold them for some seconds to bring up a "caution" message.
911911   PORT_BIT( 0x0004, IP_ACTIVE_HIGH,IPT_SPECIAL )   // ?
912912   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
913913   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
933933
934934static INPUT_PORTS_START( rockn )
935935   PORT_START("PLAYERS")   //$be0002.w
936   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN  )
937   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN  )
938   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
939   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
940   PORT_BIT(  0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
941   PORT_BIT(  0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
942   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
943   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
944   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
945   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
946   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
947   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
948   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
949   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
950   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
951   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
936   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
937   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
938   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
939   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
940   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
941   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
942   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
943   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
944   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
945   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
946   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
947   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
948   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
949   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
950   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
951   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
952952
953953   PORT_START("SYSTEM")   //$be0004.w
954   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN  )
955   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN  )
956   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_START1   )
957   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN  )
958   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW)
959   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 )
960   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_COIN1    )
961   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_COIN2    )
962   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN  )
963   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN  )
964   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN  )
965   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN  )
966   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
967   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
968   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
969   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
954   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
955   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
956   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
957   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
958   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
959   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 )
960   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN1 )
961   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN2 )
962   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
963   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
964   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
965   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
966   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
967   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
968   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
969   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
970970
971971   PORT_START("DSW")   //$be0008.w
972972   PORT_DIPNAME( 0x0001, 0x0001, "DIPSW 1-1") // All these used to be marked 'Cheat', can't think why.
r3115r3116
10231023
10241024static INPUT_PORTS_START( rocknms )
10251025   PORT_START("PLAYERS")   // IN0 - $be0002.w
1026   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_SPECIAL )      // MAIN -> SUB Communication
1027   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_SPECIAL )      // MAIN -> SUB Communication
1028   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1029   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1030   PORT_BIT(  0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
1031   PORT_BIT(  0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
1032   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1033   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1034   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1035   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1036   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1037   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1038   PORT_BIT(  0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1039   PORT_BIT(  0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
1040   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1041   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1026   PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(rocknms_main2sub_status_r, NULL)   // MAIN -> SUB Communication
1027   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1028   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1029   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
1030   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
1031   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1032   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1033   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1034   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1035   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1036   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1037   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1038   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
1039   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1040   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
10421041
10431042   PORT_START("SYSTEM")   // IN1 - $be0004.w
1044   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1045   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1046   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_START1   )
1047   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_START2   )
1048   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW)
1049   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 )
1050   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_COIN1    )
1051   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_COIN2    )
1052   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1053   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1054   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1055   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1056   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1057   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1058   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1059   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1043   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
1044   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
1045   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
1046   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 )
1047   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
1048   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 )
1049   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN1 )
1050   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN2 )
1051   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1052   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1053   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1054   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1055   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1056   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1057   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1058   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
10601059
10611060   PORT_START("DSW")   //$be0008.w
10621061   PORT_DIPNAME( 0x0001, 0x0001, "DIPSW 1-1") // All these used to be marked 'Cheat', can't think why.
src/mame/drivers/tmaster.c
r3115r3116
622622   AM_RANGE( 0xc00000, 0xc00001 ) AM_WRITE( galgames_palette_offset_w )
623623   AM_RANGE( 0xc00002, 0xc00003 ) AM_WRITE( galgames_palette_data_w )
624624
625   AM_RANGE( 0xd00000, 0xd00001 ) AM_READ ( input_port_0_word_r )   // trackball p1 x
625   AM_RANGE( 0xd00000, 0xd00001 ) AM_READ_PORT("TRACKBALL_1_X")
626626   AM_RANGE( 0xd00000, 0xd00001 ) AM_WRITE( SMH_NOP )
627   AM_RANGE( 0xd00002, 0xd00003 ) AM_READ ( input_port_1_word_r )   // trackball p1 y
628   AM_RANGE( 0xd00004, 0xd00005 ) AM_READ ( input_port_2_word_r )   // trackball p2 x
629   AM_RANGE( 0xd00006, 0xd00007 ) AM_READ ( input_port_3_word_r )   // trackball p2 y
630   AM_RANGE( 0xd00008, 0xd00009 ) AM_READ ( input_port_4_word_r )
631   AM_RANGE( 0xd0000a, 0xd0000b ) AM_READ ( input_port_5_word_r )
632   AM_RANGE( 0xd0000c, 0xd0000d ) AM_READWRITE( input_port_6_word_r, SMH_NOP )
627   AM_RANGE( 0xd00002, 0xd00003 ) AM_READ_PORT("TRACKBALL_1_Y")
628   AM_RANGE( 0xd00004, 0xd00005 ) AM_READ_PORT("TRACKBALL_2_X")
629   AM_RANGE( 0xd00006, 0xd00007 ) AM_READ_PORT("TRACKBALL_2_Y")
630   AM_RANGE( 0xd00008, 0xd00009 ) AM_READ_PORT("P1")
631   AM_RANGE( 0xd0000a, 0xd0000b ) AM_READ_PORT("P2")
632   AM_RANGE( 0xd0000c, 0xd0000d ) AM_READ_PORT("SYSTEM") AM_WRITENOP
633633
634   AM_RANGE( 0xd0000e, 0xd0000f ) AM_WRITE ( galgames_cart_sel_w )
634   AM_RANGE( 0xd0000e, 0xd0000f ) AM_WRITE( galgames_cart_sel_w )
635635   AM_RANGE( 0xd00010, 0xd00011 ) AM_READWRITE( galgames_eeprom_r, galgames_eeprom_w )
636636   AM_RANGE( 0xd00012, 0xd00013 ) AM_READWRITE( galgames_cart_data_r, galgames_cart_data_w )
637637   AM_RANGE( 0xd00014, 0xd00015 ) AM_READWRITE( galgames_cart_clock_r, galgames_cart_clock_w )
r3115r3116
645645
646646***************************************************************************/
647647static INPUT_PORTS_START( tm )
648   PORT_INCLUDE(microtouch)
648   PORT_INCLUDE( microtouch )
649649
650   PORT_START("COIN") // IN3
651   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN5    )   // "M. Coin 1 Input"
652   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_COIN6    )   // "M. Coin 2 Input"
653   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_BILL1    ) PORT_IMPULSE(2)   // "DBV Input"
654   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
655   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_UNKNOWN  )   // service coin?
656   PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW  )
657   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_SERVICE1 )   // "Calibrate"
658   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
659   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
660   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
661   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
662   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL  )
663   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_COIN1  )   // "E. Coin 1" (ECA?) tmaster defaults to e. coin,
664   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_COIN2  )   // "E. Coin 2" (ECA?) rather than m. coin
665   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_COIN3  )   // "E. Coin 3" (ECA?) so they're coin1-coin4
666   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_COIN4  )   // "E. Coin 4" (ECA?)
650   PORT_START("COIN")
651   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN5 )   // "M. Coin 1 Input"
652   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN6 )   // "M. Coin 2 Input"
653   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BILL1 ) PORT_IMPULSE(2)   // "DBV Input"
654   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
655   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )   // service coin?
656   PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW )
657   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )   // "Calibrate"
658   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
659   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
660   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
661   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
662   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL )
663   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 )   // "E. Coin 1" (ECA?) tmaster defaults to e. coin,
664   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 )   // "E. Coin 2" (ECA?) rather than m. coin
665   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN3 )   // "E. Coin 3" (ECA?) so they're coin1-coin4
666   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN4 )   // "E. Coin 4" (ECA?)
667667INPUT_PORTS_END
668668
669669static INPUT_PORTS_START( tmaster )
670   PORT_INCLUDE(microtouch)
670   PORT_INCLUDE( microtouch )
671671
672   PORT_START("COIN") // IN3
673   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN1      )    // "M. Coin 1 Input"
674   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_COIN2      )    // "M. Coin 2 Input"
675   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_BILL1      ) PORT_IMPULSE(2)   // "DBV Input"
676   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
677   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
678   PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW  )
679   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_SERVICE1 )   // "Calibrate"
680   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
681   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
682   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
683   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
684   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL  )
685   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_COIN3  )   // "E. Coin 1" (ECA mech) The rest of the tm games
686   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_COIN4  )   // "E. Coin 2" (ECA mech) Default to m. coin
687   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_COIN5  )   // "E. Coin 3" (ECA mech) So these are coin3-coin6
688   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_COIN6  )   // "E. Coin 4" (ECA mech)
672   PORT_START("COIN")
673   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )    // "M. Coin 1 Input"
674   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )    // "M. Coin 2 Input"
675   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BILL1 ) PORT_IMPULSE(2)   // "DBV Input"
676   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
677   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
678   PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW )
679   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )   // "Calibrate"
680   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
681   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
682   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
683   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
684   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL )
685   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN3 )   // "E. Coin 1" (ECA mech) The rest of the tm games
686   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN4 )   // "E. Coin 2" (ECA mech) Default to m. coin
687   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN5 )   // "E. Coin 3" (ECA mech) So these are coin3-coin6
688   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN6 )   // "E. Coin 4" (ECA mech)
689689INPUT_PORTS_END
690690
691691static INPUT_PORTS_START( galgames )
692   PORT_START("TRACKBALL_1_X")
693   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_RESET
694
695   PORT_START("TRACKBALL_1_Y")
696   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_RESET
697
698   PORT_START("TRACKBALL_2_X")
699   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_RESET
700
701   PORT_START("TRACKBALL_2_Y")
702   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_RESET
703
704   PORT_START("IN4")
692   PORT_START("P1")
705693   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
706694   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
707695   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
712700   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
713701   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
714702
715   PORT_START("IN5")
703   PORT_START("P2")
716704   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
717705   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
718706   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
723711   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
724712   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
725713
726   PORT_START("IN6")
714   PORT_START("SYSTEM")
727715   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )   // CS 1 (coin)
728716   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )   // CS 2 (coin)
729717   PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_LOW )   // System Check
r3115r3116
733721   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
734722   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
735723   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
724
725   PORT_START("TRACKBALL_1_X")
726   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_RESET
727
728   PORT_START("TRACKBALL_1_Y")
729   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_RESET
730
731   PORT_START("TRACKBALL_2_X")
732   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_RESET
733
734   PORT_START("TRACKBALL_2_Y")
735   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_RESET
736736INPUT_PORTS_END
737737
738738
src/mame/drivers/cischeat.c
r3115r3116
197197WRITE16_HANDLER( f1gpstr2_vregs_w );
198198WRITE16_HANDLER( scudhamm_vregs_w );
199199
200CUSTOM_INPUT( cischeat_shift_r );
201
200202VIDEO_START( bigrun );
201203VIDEO_START( cischeat );
202204VIDEO_START( f1gpstar );
r3115r3116
10061008   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 High Gear")
10071009
10081010   PORT_START("IN1")   // Coins - $80000.w
1009   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1    )
1010   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2    )
1011   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1012   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
10111013   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1012   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW)    // called "Test"
1013   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1   )
1014   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2   )
1015   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1016   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1014   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )    // called "Test"
1015   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1016   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1017   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1018   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
10171019
10181020   PORT_START("IN2")   //Controls - $80002.w
10191021   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Brake")   // Brake
1020//  PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 )   // Shift - We handle it using buttons 3&4
1022   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(cischeat_shift_r, NULL)   // Shift - We handle it using buttons 3&4
10211023   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
10221024   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
10231025   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
10261028   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Horn")   // Horn
10271029
10281030   PORT_START("IN3")   // Motor Control? - $80004.w
1029   PORT_DIPNAME( 0x01, 0x01, "Up Limit SW"     )   // Limit the Cockpit movements?
1031   PORT_DIPNAME( 0x01, 0x01, "Up Limit SW" )   // Limit the Cockpit movements?
10301032   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
10311033   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1032   PORT_DIPNAME( 0x02, 0x02, "Down Limit SW"   )
1034   PORT_DIPNAME( 0x02, 0x02, "Down Limit SW" )
10331035   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
10341036   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10351037   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
10361038   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1037//  PORT_DIPNAME( 0x10, 0x10, "Right Limit SW" )
1039//  PORT_DIPNAME( 0x10, 0x10, "Right Limit SW" )
10381040//  PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
10391041//  PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1040//  PORT_DIPNAME( 0x20, 0x20, "Left Limit SW"   )
1042//  PORT_DIPNAME( 0x20, 0x20, "Left Limit SW" )
10411043//  PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
10421044//  PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10431045   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
11381140   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 High Gear")
11391141
11401142   PORT_START("IN1")   // Coins - $80000.w
1141   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1    )
1142   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2    )
1143   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1144   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
11431145   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
11441146   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW)    // called "Test"
1145   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1   )
1146   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2   )
1147   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1148   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1147   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1148   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1149   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1150   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
11491151
11501152   PORT_START("IN2")   // Controls - $80002.w
11511153   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Brake")   // Brake
1152//  PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 )   // Shift - We handle it using buttons 3&4
1154   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(cischeat_shift_r, NULL)   // Shift - We handle it using buttons 3&4
11531155   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
11541156   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
11551157   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Accelerator")   // Accel
r3115r3116
11581160   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Horn")   // Horn
11591161
11601162   PORT_START("IN3")   // Motor Control? - $80004.w
1161   PORT_DIPNAME( 0x01, 0x01, "Up Limit SW"     )   // Limit the Cockpit movements?
1163   PORT_DIPNAME( 0x01, 0x01, "Up Limit SW" )   // Limit the Cockpit movements?
11621164   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
11631165   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1164   PORT_DIPNAME( 0x02, 0x02, "Down Limit SW"   )
1166   PORT_DIPNAME( 0x02, 0x02, "Down Limit SW" )
11651167   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
11661168   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11671169   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
11681170   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1169   PORT_DIPNAME( 0x10, 0x10, "Right Limit SW"   )
1171   PORT_DIPNAME( 0x10, 0x10, "Right Limit SW" )
11701172   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
11711173   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1172   PORT_DIPNAME( 0x20, 0x20, "Left Limit SW"   )
1174   PORT_DIPNAME( 0x20, 0x20, "Left Limit SW" )
11731175   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
11741176   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11751177   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
13121314   PORT_DIPSETTING(      0x0300, DEF_STR( Japan ) )
13131315   PORT_DIPSETTING(      0x0200, DEF_STR( USA ) )
13141316   PORT_DIPSETTING(      0x0100, DEF_STR( Europe ) )
1315   PORT_DIPSETTING(      0x0000, "France" )
1317   PORT_DIPSETTING(      0x0000, "France" )
13161318   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW02:3,4")   // -> !f9026
13171319   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )         // 58 <- Initial Time (seconds, Germany)
13181320   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )      // 51
r3115r3116
13321334   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
13331335   PORT_DIPNAME( 0x8000, 0x8000, "Vibrations" ) PORT_DIPLOCATION("SW02:8")
13341336   PORT_DIPSETTING(      0x8000, "Torque" )
1335   PORT_DIPSETTING(      0x0000, "Shake" )
1337   PORT_DIPSETTING(      0x0000, "Shake" )
13361338
13371339   PORT_START("IN2")   // Controls - $80004.w -> !f9016
1338   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1    )
1339   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2    )
1340   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1341   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
13401342   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
13411343   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW) // -> f0100 (called "Test")
1342   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1   )
1343//  PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON4  ) // Shift -> !f900e - We handle it with 2 buttons
1344   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2  ) PORT_NAME("P1 Brake")// Brake -> !f9010
1345   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2   ) // "Race Together"
1344   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 )
1345   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(cischeat_shift_r, NULL)   // Shift -> !f900e - We handle it with 2 buttons
1346   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Brake")// Brake -> !f9010
1347   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) // "Race Together"
13461348
13471349   PORT_START("IN3")   // ? Read at boot only - $80006.w
13481350   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
14781480   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
14791481   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN  ) // GAME OVER if pressed on the selection screen
14801482   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1481   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW)    // called "Test"
1482   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1   )
1483   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON4  ) // Select
1484   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1485   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1483   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )    // called "Test"
1484   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 )
1485   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON4 ) // Select
1486   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1487   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
14861488
14871489   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // Gu
14881490   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON2 ) // Choki
r3115r3116
14901492   PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_UNKNOWN )
14911493   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
14921494   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1493   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_TILT    )
1495   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_TILT )
14941496   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
14951497
14961498   PORT_START("IN1")   // A/D
r3115r3116
15391541
15401542static INPUT_PORTS_START( armchmp2 )
15411543   PORT_START("IN0")   // Buttons + Sensors
1542   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL  ) // left   sensor
1543   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL  ) // right  sensor
1544   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SPECIAL  ) // center sensor
1544   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL ) // left   sensor
1545   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL ) // right  sensor
1546   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SPECIAL ) // center sensor
15451547   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 )
15461548   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
1547   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN1    )
1548   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN2    )
1549   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1550   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1   )
1551   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1  ) // hard
1552   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2  ) // easy
1553   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON3  ) // elbow (it always complains though)
1549   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN1 )
1550   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN2 )
1551   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1552   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
1553   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) // hard
1554   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) // easy
1555   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON3 ) // elbow (it always complains though)
15541556
15551557   PORT_START("IN1")   // A/D
15561558   PORT_BIT( 0x00ff, 0x0000, IPT_DIAL ) PORT_MINMAX(0x0000,0x00ff) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
src/mame/drivers/vicdual.c
r3115r3116
313313   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
314314
315315   PORT_START("IN1")
316   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_64v, 0)
316   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_64v, NULL)
317317   PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNUSED )
318   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
318   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
319319
320320   PORT_COIN
321321INPUT_PORTS_END
r3115r3116
395395   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
396396
397397   PORT_START("IN1")
398   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_64v, 0)
398   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_64v, NULL)
399399   PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
400400   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) )
401401   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
r3115r3116
403403   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
404404   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
405405   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
406   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
406   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
407407
408408   PORT_COIN
409409INPUT_PORTS_END
r3115r3116
485485   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
486486
487487   PORT_START("IN1")
488   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_64v, 0)
488   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_64v, NULL)
489489   PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
490   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
490   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
491491
492492   PORT_COIN
493493
r3115r3116
613613   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
614614
615615   PORT_START("IN1")
616   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_64v, 0)
616   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_64v, NULL)
617617   PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
618   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
618   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
619619
620620   PORT_CABINET_COLOR_OR_BW
621621
r3115r3116
641641   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
642642
643643   PORT_START("IN1")
644   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
644   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
645645    PORT_DIPNAME( 0x04, 0x04, "Rom Test" )
646646    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
647647    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
648648    PORT_BIT( 0x7a, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
649   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
649   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
650650
651651   PORT_CABINET_COLOR_OR_BW
652652
r3115r3116
688688   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
689689
690690   PORT_START("IN2")
691   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
691   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
692692   PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNUSED )
693   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
693   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
694694
695695   PORT_CABINET_COLOR_OR_BW
696696
r3115r3116
827827   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
828828
829829   PORT_START("IN2")
830   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
830   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
831831   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
832832   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
833833   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
834834   PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
835   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
835   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
836836
837837   PORT_COIN
838838INPUT_PORTS_END
r3115r3116
860860   PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* probably unused */
861861
862862   PORT_START("IN2")
863   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
863   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
864864   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
865865   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
866866   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
867867   PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
868   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
868   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
869869
870870   PORT_COIN
871871INPUT_PORTS_END
r3115r3116
902902   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
903903
904904   PORT_START("IN2")
905   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
905   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
906906   PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
907   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
907   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
908908
909909   PORT_COIN
910910INPUT_PORTS_END
r3115r3116
10621062static ADDRESS_MAP_START( invho2_io_map, ADDRESS_SPACE_IO, 8 )
10631063   ADDRESS_MAP_GLOBAL_MASK(0x7f)
10641064
1065   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ(input_port_0_r)
1066   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ(input_port_1_r)
1067   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ(input_port_2_r)
1068   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ(input_port_3_r)
1065   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ_PORT("IN0")
1066   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ_PORT("IN1")
1067   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ_PORT("IN2")
1068   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ_PORT("IN3")
10691069
10701070   /* no decoder, just logic gates, so in theory the
10711071       game can write to multiple locations at once */
r3115r3116
10761076static ADDRESS_MAP_START( invds_io_map, ADDRESS_SPACE_IO, 8 )
10771077   ADDRESS_MAP_GLOBAL_MASK(0x7f)
10781078
1079   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ(input_port_0_r)
1080   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ(input_port_1_r)
1081   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ(input_port_2_r)
1082   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ(input_port_3_r)
1079   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ_PORT("IN0")
1080   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ_PORT("IN1")
1081   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ_PORT("IN2")
1082   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ_PORT("IN3")
10831083
10841084   /* no decoder, just logic gates, so in theory the
10851085       game can write to multiple locations at once */
r3115r3116
10901090static ADDRESS_MAP_START( sspacaho_io_map, ADDRESS_SPACE_IO, 8 )
10911091   ADDRESS_MAP_GLOBAL_MASK(0x7f)
10921092
1093   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ(input_port_0_r)
1094   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ(input_port_1_r)
1095   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ(input_port_2_r)
1096   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ(input_port_3_r)
1093   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ_PORT("IN0")
1094   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ_PORT("IN1")
1095   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ_PORT("IN2")
1096   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ_PORT("IN3")
10971097
10981098   /* no decoder, just logic gates, so in theory the
10991099       game can write to multiple locations at once */
r3115r3116
11041104static ADDRESS_MAP_START( tranqgun_io_map, ADDRESS_SPACE_IO, 8 )
11051105   ADDRESS_MAP_GLOBAL_MASK(0xf)
11061106
1107   AM_RANGE(0x00, 0x00) AM_MIRROR(0x0c) AM_READ(input_port_0_r)
1108   AM_RANGE(0x01, 0x01) AM_MIRROR(0x0c) AM_READ(input_port_1_r)
1109   AM_RANGE(0x02, 0x02) AM_MIRROR(0x0c) AM_READ(input_port_2_r)
1110   AM_RANGE(0x03, 0x03) AM_MIRROR(0x0c) AM_READ(input_port_3_r)
1107   AM_RANGE(0x00, 0x00) AM_MIRROR(0x0c) AM_READ_PORT("IN0")
1108   AM_RANGE(0x01, 0x01) AM_MIRROR(0x0c) AM_READ_PORT("IN1")
1109   AM_RANGE(0x02, 0x02) AM_MIRROR(0x0c) AM_READ_PORT("IN2")
1110   AM_RANGE(0x03, 0x03) AM_MIRROR(0x0c) AM_READ_PORT("IN3")
11111111
11121112   /* no decoder, just logic gates, so in theory the
11131113       game can write to multiple locations at once */
r3115r3116
11181118static ADDRESS_MAP_START( spacetrk_io_map, ADDRESS_SPACE_IO, 8 )
11191119   ADDRESS_MAP_GLOBAL_MASK(0x7f)
11201120
1121   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ(input_port_0_r)
1122   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ(input_port_1_r)
1123   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ(input_port_2_r)
1124   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ(input_port_3_r)
1121   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ_PORT("IN0")
1122   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ_PORT("IN1")
1123   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ_PORT("IN2")
1124   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ_PORT("IN3")
11251125
11261126   /* no decoder, just logic gates, so in theory the
11271127       game can write to multiple locations at once */
r3115r3116
11321132static ADDRESS_MAP_START( carnival_io_map, ADDRESS_SPACE_IO, 8 )
11331133   ADDRESS_MAP_GLOBAL_MASK(0x7f)
11341134
1135   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ(input_port_0_r)
1136   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ(input_port_1_r)
1137   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ(input_port_2_r)
1138   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ(input_port_3_r)
1135   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ_PORT("IN0")
1136   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ_PORT("IN1")
1137   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ_PORT("IN2")
1138   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ_PORT("IN3")
11391139
11401140   /* no decoder, just logic gates, so in theory the
11411141       game can write to multiple locations at once */
r3115r3116
11461146static ADDRESS_MAP_START( brdrline_io_map, ADDRESS_SPACE_IO, 8 )
11471147   ADDRESS_MAP_GLOBAL_MASK(0xf)
11481148
1149   AM_RANGE(0x00, 0x00) AM_MIRROR(0x0c) AM_READ(input_port_0_r)
1150   AM_RANGE(0x01, 0x01) AM_MIRROR(0x0c) AM_READ(input_port_1_r)
1151   AM_RANGE(0x02, 0x02) AM_MIRROR(0x0c) AM_READ(input_port_2_r)
1152   AM_RANGE(0x03, 0x03) AM_MIRROR(0x0c) AM_READ(input_port_3_r)
1149   AM_RANGE(0x00, 0x00) AM_MIRROR(0x0c) AM_READ_PORT("IN0")
1150   AM_RANGE(0x01, 0x01) AM_MIRROR(0x0c) AM_READ_PORT("IN1")
1151   AM_RANGE(0x02, 0x02) AM_MIRROR(0x0c) AM_READ_PORT("IN2")
1152   AM_RANGE(0x03, 0x03) AM_MIRROR(0x0c) AM_READ_PORT("IN3")
11531153
11541154   /* no decoder, just logic gates, so in theory the
11551155       game can write to multiple locations at once */
r3115r3116
11601160static ADDRESS_MAP_START( pulsar_io_map, ADDRESS_SPACE_IO, 8 )
11611161   ADDRESS_MAP_GLOBAL_MASK(0x7f)
11621162
1163   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ(input_port_0_r)
1164   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ(input_port_1_r)
1165   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ(input_port_2_r)
1166   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ(input_port_3_r)
1163   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ_PORT("IN0")
1164   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ_PORT("IN1")
1165   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ_PORT("IN2")
1166   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ_PORT("IN3")
11671167
11681168   /* no decoder, just logic gates, so in theory the
11691169       game can write to multiple locations at once */
r3115r3116
11741174static ADDRESS_MAP_START( heiankyo_io_map, ADDRESS_SPACE_IO, 8 )
11751175   ADDRESS_MAP_GLOBAL_MASK(0xf)
11761176
1177   AM_RANGE(0x00, 0x00) AM_MIRROR(0x0c) AM_READ(input_port_0_r)
1178   AM_RANGE(0x01, 0x01) AM_MIRROR(0x0c) AM_READ(input_port_1_r)
1179   AM_RANGE(0x02, 0x02) AM_MIRROR(0x0c) AM_READ(input_port_2_r)
1180   AM_RANGE(0x03, 0x03) AM_MIRROR(0x0c) AM_READ(input_port_3_r)
1177   AM_RANGE(0x00, 0x00) AM_MIRROR(0x0c) AM_READ_PORT("IN0")
1178   AM_RANGE(0x01, 0x01) AM_MIRROR(0x0c) AM_READ_PORT("IN1")
1179   AM_RANGE(0x02, 0x02) AM_MIRROR(0x0c) AM_READ_PORT("IN2")
1180   AM_RANGE(0x03, 0x03) AM_MIRROR(0x0c) AM_READ_PORT("IN3")
11811181
11821182   /* no decoder, just logic gates, so in theory the
11831183       game can write to multiple locations at once */
r3115r3116
11881188static ADDRESS_MAP_START( alphaho_io_map, ADDRESS_SPACE_IO, 8 )
11891189   ADDRESS_MAP_GLOBAL_MASK(0x7f)
11901190
1191   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ(input_port_0_r)
1192   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ(input_port_1_r)
1193   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ(input_port_2_r)
1194   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ(input_port_3_r)
1191   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ_PORT("IN0")
1192   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ_PORT("IN1")
1193   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ_PORT("IN2")
1194   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ_PORT("IN3")
11951195
11961196   /* no decoder, just logic gates, so in theory the
11971197       game can write to multiple locations at once */
r3115r3116
12191219   PORT_DIPNAME( 0x04, 0x00, "Head On Lives (2/2)" )
12201220   PORT_DIPSETTING(    0x04, "+0" )
12211221   PORT_DIPSETTING(    0x00, "+1" )
1222   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, 0)
1222   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, NULL)
12231223   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
12241224   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
12251225   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
12301230   PORT_DIPNAME( 0x04, 0x00, "Invinco Lives" )
12311231   PORT_DIPSETTING(    0x00, "5" )
12321232   PORT_DIPSETTING(    0x04, "6" )
1233   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
1233   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
12341234   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
12351235   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
12361236   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )   /* probably unused */
r3115r3116
12441244   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
12451245   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
12461246   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1247   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
1247   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
12481248   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Game Select") PORT_TOGGLE
12491249   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
12501250   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
12731273   PORT_DIPNAME( 0x04, 0x00, "Invinco Lives (2/2)" )
12741274   PORT_DIPSETTING(    0x00, "+0" )
12751275   PORT_DIPSETTING(    0x04, "+2" )
1276   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, 0)
1276   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, NULL)
12771277   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
12781278   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
12791279   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
12841284   PORT_DIPNAME( 0x04, 0x00, "Deep Scan Lives (1/2)" )
12851285   PORT_DIPSETTING(    0x00, "+0" )
12861286   PORT_DIPSETTING(    0x04, "+1" )
1287   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
1287   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
12881288   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
12891289   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
12901290   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
12961296   PORT_DIPNAME( 0x04, 0x00, "Deep Scan Lives (2/2)" )
12971297   PORT_DIPSETTING(    0x04, "+0" )
12981298   PORT_DIPSETTING(    0x00, "+2" )
1299   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
1299   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
13001300   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Game Select") PORT_TOGGLE
13011301   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
13021302   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
13251325   PORT_DIPNAME( 0x04, 0x00, "S.A. Lives (2/2)" )
13261326   PORT_DIPSETTING(    0x00, "+0" )
13271327   PORT_DIPSETTING(    0x04, "+2" )
1328   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, 0)
1328   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, NULL)
13291329   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
13301330   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
13311331   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
13361336   PORT_DIPNAME( 0x04, 0x00, "S.A. Bonus Life" )
13371337   PORT_DIPSETTING(    0x00, "10000" )
13381338    PORT_DIPSETTING(    0x04, "15000" )
1339   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
1339   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
13401340   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
13411341   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
13421342   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
13471347   PORT_DIPNAME( 0x04, 0x00, "S.A. Bonus Life For Final UFO" )
13481348   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
13491349   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1350   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
1350   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
13511351   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Game Select") PORT_TOGGLE
13521352   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
13531353   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
13761376   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
13771377   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
13781378   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1379   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_vblank_comp, 0)
1379   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_vblank_comp, NULL)
13801380   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
13811381   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
13821382   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
13871387   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
13881388   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
13891389   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1390   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
1390   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
13911391   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
13921392   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
13931393   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
13981398   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
13991399   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
14001400   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1401   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
1401   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
14021402   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
14031403   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
14041404   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
14271427   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) /* unknown, but used */
14281428   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
14291429   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1430   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, 0)
1430   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, NULL)
14311431   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
14321432   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
14331433   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
14381438   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Bonus_Life ) )
14391439   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
14401440   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1441   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
1441   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
14421442   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
14431443   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
14441444   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
14491449   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
14501450   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
14511451   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1452   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
1452   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
14531453   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
14541454   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
14551455   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
14781478   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) /* unknown, but used */
14791479   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
14801480   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1481   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, 0)
1481   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, NULL)
14821482   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
14831483   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
14841484   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
14891489   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Bonus_Life ) )
14901490   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
14911491   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1492   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
1492   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
14931493   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
14941494   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
14951495   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
15001500   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
15011501   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
15021502   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1503   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
1503   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
15041504   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
15051505   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
15061506   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
15311531   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
15321532   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
15331533   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1534   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, 0)
1534   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, NULL)
15351535   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
15361536   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
15371537   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
15421542   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
15431543   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
15441544   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1545   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
1545   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
15461546   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
15471547   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
15481548   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
15531553   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
15541554   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
15551555   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1556   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
1556   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
15571557   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
15581558   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
15591559   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
15841584   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
15851585   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
15861586   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1587   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, 0)
1587   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, NULL)
15881588   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
15891589   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
15901590   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
15951595   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
15961596   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
15971597   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1598   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
1598   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
15991599   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
16001600   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
16011601   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
16061606   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
16071607   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
16081608   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1609   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
1609   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
16101610   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
16111611   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
16121612   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
16401640   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
16411641   PORT_DIPSETTING(    0x04, "3" )
16421642   PORT_DIPSETTING(    0x00, "4" )
1643   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_vblank_comp, 0)
1643   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_vblank_comp, NULL)
16441644   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
16451645   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
16461646   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
16621662   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
16631663   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
16641664   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1665   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
1665   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
16661666   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
16671667   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
16681668   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
16911691   PORT_DIPNAME( 0x04, 0x04, "Lives (2/2)" )
16921692   PORT_DIPSETTING(    0x04, "+0" )
16931693   PORT_DIPSETTING(    0x00, "+1" )
1694   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, 0)
1694   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, NULL)
16951695   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
16961696   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
16971697   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
17021702   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
17031703   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
17041704   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1705   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
1705   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
17061706   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
17071707   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
17081708   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
17131713   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
17141714   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
17151715   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1716   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
1716   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
17171717   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
17181718   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
17191719   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
17421742   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) /* bonus life? */
17431743   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
17441744   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1745   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, 0)
1745   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, NULL)
17461746   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
17471747   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
17481748   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
17531753   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) /* bonus life? */
17541754   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
17551755   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1756   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
1756   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
17571757   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
17581758   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* has to be 0, protection? */
17591759   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )   /* probably unused */
r3115r3116
17641764   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
17651765   PORT_DIPSETTING(    0x00, "3" )
17661766   PORT_DIPSETTING(    0x04, "5" )
1767   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
1767   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
17681768   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
17691769   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
17701770   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
17931793   PORT_DIPNAME( 0x04, 0x00, "Alpha Fighter Lives (2/2)" )
17941794   PORT_DIPSETTING(    0x00, "+0" )
17951795   PORT_DIPSETTING(    0x04, "+2" )
1796   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, 0)
1796   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, NULL)
17971797   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
17981798   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
17991799   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
r3115r3116
18021802   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
18031803   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
18041804   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
1805   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
1805   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
18061806   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
18071807   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
18081808   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
r3115r3116
18131813   PORT_DIPNAME( 0x04, 0x00, "Alpha Fighter Unknown" )   // related to soccer frequency (code at 0x4950)
18141814   PORT_DIPSETTING(    0x00, DEF_STR ( Off ) )
18151815   PORT_DIPSETTING(    0x04, DEF_STR ( On ) )
1816   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
1816   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
18171817   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Game Select") PORT_TOGGLE
18181818   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
18191819   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
r3115r3116
20052005static ADDRESS_MAP_START( samurai_io_map, ADDRESS_SPACE_IO, 8 )
20062006   ADDRESS_MAP_GLOBAL_MASK(0x7f)
20072007
2008   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ(input_port_0_r)
2009   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ(input_port_1_r)
2010   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ(input_port_2_r)
2011   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ(input_port_3_r)
2008   AM_RANGE(0x00, 0x00) AM_MIRROR(0x7c) AM_READ_PORT("IN0")
2009   AM_RANGE(0x01, 0x01) AM_MIRROR(0x7c) AM_READ_PORT("IN1")
2010   AM_RANGE(0x02, 0x02) AM_MIRROR(0x7c) AM_READ_PORT("IN2")
2011   AM_RANGE(0x03, 0x03) AM_MIRROR(0x7c) AM_READ_PORT("IN3")
20122012
20132013   /* no decoder, just logic gates, so in theory the
20142014       game can write to multiple locations at once */
r3115r3116
20362036   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) /* unknown, but used */
20372037   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
20382038   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2039   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, 0)
2039   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, NULL)
20402040   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
20412041   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
20422042   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
20472047   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
20482048   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
20492049   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2050   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, 0)
2050   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_timer_value, NULL)
20512051   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
20522052   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
20532053   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
20582058   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
20592059   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
20602060   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2061   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
2061   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
20622062   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
20632063   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
20642064   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
21412141   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
21422142
21432143   PORT_START("IN1")
2144   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, 0)
2144   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, NULL)
21452145   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
21462146   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
21472147   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
21602160   PORT_DIPNAME(0x40,  0x40, DEF_STR( Unknown ) )
21612161   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
21622162   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2163   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
2163   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
21642164
21652165   PORT_COIN
21662166INPUT_PORTS_END
r3115r3116
22572257   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
22582258
22592259   PORT_START("IN2")
2260   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, 0)
2260   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_composite_blank_comp, NULL)
22612261   PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
2262   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, 0)
2262   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
22632263
22642264   PORT_COIN
22652265INPUT_PORTS_END
src/mame/drivers/xybots.c
r3115r3116
3232
3333static void update_interrupts(running_machine *machine)
3434{
35   int newstate = 0;
36
37   if (atarigen_video_int_state)
38      newstate = 1;
39   if (atarigen_sound_int_state)
40      newstate = 2;
41
42   if (newstate)
43      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
44   else
45      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
35   cpunum_set_input_line(machine, 0, 1, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
36   cpunum_set_input_line(machine, 0, 2, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
4637}
4738
4839
src/mame/drivers/speglsht.c
r3115r3116
209209   AM_RANGE(0x01000000, 0x01007fff) AM_RAM //tested - STATIC RAM
210210   AM_RANGE(0x01600000, 0x0160004f) AM_READWRITE(cop_r, cop_w) AM_BASE(&cop_ram)
211211   AM_RANGE(0x01800200, 0x01800203) AM_WRITE(videoreg_w)
212   AM_RANGE(0x01800300, 0x01800303) AM_READ(input_port_0_dword_r)
213   AM_RANGE(0x01800400, 0x01800403) AM_READ(input_port_1_dword_r)
212   AM_RANGE(0x01800300, 0x01800303) AM_READ_PORT("IN0")
213   AM_RANGE(0x01800400, 0x01800403) AM_READ_PORT("IN1")
214214   AM_RANGE(0x01a00000, 0x01afffff) AM_RAM AM_BASE(&speglsht_framebuffer)
215215   AM_RANGE(0x01b00000, 0x01b07fff) AM_RAM //cleared ...  video related ?
216216   AM_RANGE(0x01c00000, 0x01dfffff) AM_READ(SMH_ROM) AM_WRITE(SMH_ROM) AM_REGION("user2", 0)
r3115r3116
223223
224224static INPUT_PORTS_START( speglsht )
225225   PORT_START("IN0")
226   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
227   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
228   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
229   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
230   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
231   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
232   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
233   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
234   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
226   PORT_BIT( 0x000000ff, IP_ACTIVE_LOW, IPT_UNUSED )
227   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
228   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
229   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
230   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
231   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
232   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
233   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
234   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_START2 )
235235   PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNUSED )
236236
237237   PORT_START("IN1")
238   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
239   PORT_DIPSETTING(    0x0003, DEF_STR( 3C_1C ) )
240   PORT_DIPSETTING(    0x0004, DEF_STR( 2C_1C ) )
241   PORT_DIPSETTING(    0x0007, DEF_STR( 1C_1C ) )
242   PORT_DIPSETTING(    0x0001, "1C/1C or 2C/3C" ) /* 1 coin/1 credit or 2 coins/3 credits */
243   PORT_DIPSETTING(    0x0002, DEF_STR( 2C_3C ) )
244   PORT_DIPSETTING(    0x0006, DEF_STR( 1C_2C ) )
245   PORT_DIPSETTING(    0x0005, DEF_STR( 1C_3C ) )
246   PORT_DIPSETTING(    0x0000, "2C Start/1C Continue" )
247   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
248   PORT_DIPSETTING(    0x0018, DEF_STR( 3C_1C ) )
249   PORT_DIPSETTING(    0x0020, DEF_STR( 2C_1C ) )
250   PORT_DIPSETTING(    0x0038, DEF_STR( 1C_1C ) )
251   PORT_DIPSETTING(    0x0008, "1C/1C or 2C/3C" ) /* 1 coin/1 credit or 2 coins/3 credits */
252   PORT_DIPSETTING(    0x0010, DEF_STR( 2C_3C ) )
253   PORT_DIPSETTING(    0x0030, DEF_STR( 1C_2C ) )
254   PORT_DIPSETTING(    0x0028, DEF_STR( 1C_3C ) )
255   PORT_DIPSETTING(    0x0000, "2C Start/1C Continue" )
256   PORT_DIPNAME( 0x0040, 0x0040, "Unkown / Unused" )
257   PORT_DIPSETTING(    0x0040, DEF_STR( Off ) )
258   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
259   PORT_DIPNAME( 0x0080, 0x0080, "Bonus for PAR Play" )
260   PORT_DIPSETTING(    0x0080, DEF_STR( None ) )
261   PORT_DIPSETTING(    0x0000, "Extra Hole" )
262   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) )
263   PORT_DIPSETTING(    0x0300, DEF_STR( Normal ) )
264   PORT_DIPSETTING(    0x0200, DEF_STR( Easy ) )
265   PORT_DIPSETTING(    0x0100, DEF_STR( Hard ) )
266   PORT_DIPSETTING(    0x0000, DEF_STR( Very_Hard ) )
267   PORT_DIPNAME( 0x0c00, 0x0c00, "Number of Players" )
268   PORT_DIPSETTING(    0x0c00, "3" )
269   PORT_DIPSETTING(    0x0800, "4" )
270   PORT_DIPSETTING(    0x0400, "2" )
271   PORT_DIPSETTING(    0x0000, "1" )
272   PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Demo_Sounds ) )
273   PORT_DIPSETTING(    0x1000, DEF_STR( Off ) )
274   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
275   PORT_DIPNAME( 0x2000, 0x0000, "Control Panel" )
276   PORT_DIPSETTING(    0x2000, "Double" )
277   PORT_DIPSETTING(    0x0000, DEF_STR( Single ) )
278   PORT_DIPNAME( 0x4000, 0x4000, "Country" )
279   PORT_DIPSETTING(    0x4000, DEF_STR( Japan ) )
280   PORT_DIPSETTING(    0x0000, DEF_STR( USA ) )
238   PORT_DIPNAME( 0x00000007, 0x00000007, DEF_STR( Coin_A ) )
239   PORT_DIPSETTING(          0x00000003, DEF_STR( 3C_1C ) )
240   PORT_DIPSETTING(          0x00000004, DEF_STR( 2C_1C ) )
241   PORT_DIPSETTING(          0x00000007, DEF_STR( 1C_1C ) )
242   PORT_DIPSETTING(          0x00000001, "1C/1C or 2C/3C" ) /* 1 coin/1 credit or 2 coins/3 credits */
243   PORT_DIPSETTING(          0x00000002, DEF_STR( 2C_3C ) )
244   PORT_DIPSETTING(          0x00000006, DEF_STR( 1C_2C ) )
245   PORT_DIPSETTING(          0x00000005, DEF_STR( 1C_3C ) )
246   PORT_DIPSETTING(          0x00000000, "2C Start/1C Continue" )
247   PORT_DIPNAME( 0x00000038, 0x00000038, DEF_STR( Coin_B ) )
248   PORT_DIPSETTING(          0x00000018, DEF_STR( 3C_1C ) )
249   PORT_DIPSETTING(          0x00000020, DEF_STR( 2C_1C ) )
250   PORT_DIPSETTING(          0x00000038, DEF_STR( 1C_1C ) )
251   PORT_DIPSETTING(          0x00000008, "1C/1C or 2C/3C" ) /* 1 coin/1 credit or 2 coins/3 credits */
252   PORT_DIPSETTING(          0x00000010, DEF_STR( 2C_3C ) )
253   PORT_DIPSETTING(          0x00000030, DEF_STR( 1C_2C ) )
254   PORT_DIPSETTING(          0x00000028, DEF_STR( 1C_3C ) )
255   PORT_DIPSETTING(          0x00000000, "2C Start/1C Continue" )
256   PORT_DIPNAME( 0x00000040, 0x00000040, "Unkown / Unused" )
257   PORT_DIPSETTING(          0x00000040, DEF_STR( Off ) )
258   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
259   PORT_DIPNAME( 0x00000080, 0x00000080, "Bonus for PAR Play" )
260   PORT_DIPSETTING(          0x00000080, DEF_STR( None ) )
261   PORT_DIPSETTING(          0x00000000, "Extra Hole" )
262   PORT_DIPNAME( 0x00000300, 0x00000300, DEF_STR( Difficulty ) )
263   PORT_DIPSETTING(          0x00000300, DEF_STR( Normal ) )
264   PORT_DIPSETTING(          0x00000200, DEF_STR( Easy ) )
265   PORT_DIPSETTING(          0x00000100, DEF_STR( Hard ) )
266   PORT_DIPSETTING(          0x00000000, DEF_STR( Very_Hard ) )
267   PORT_DIPNAME( 0x00000c00, 0x00000c00, "Number of Players" )
268   PORT_DIPSETTING(          0x00000c00, "3" )
269   PORT_DIPSETTING(          0x00000800, "4" )
270   PORT_DIPSETTING(          0x00000400, "2" )
271   PORT_DIPSETTING(          0x00000000, "1" )
272   PORT_DIPNAME( 0x00001000, 0x00000000, DEF_STR( Demo_Sounds ) )
273   PORT_DIPSETTING(          0x00001000, DEF_STR( Off ) )
274   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
275   PORT_DIPNAME( 0x00002000, 0x00000000, "Control Panel" )
276   PORT_DIPSETTING(          0x00002000, "Double" )
277   PORT_DIPSETTING(          0x00000000, DEF_STR( Single ) )
278   PORT_DIPNAME( 0x00004000, 0x00004000, "Country" )
279   PORT_DIPSETTING(          0x00004000, DEF_STR( Japan ) )
280   PORT_DIPSETTING(          0x00000000, DEF_STR( USA ) )
281281   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED )
282282   PORT_SERVICE_NO_TOGGLE( 0x00010000, IP_ACTIVE_HIGH )
283283   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_TILT )
284284   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_COIN1 )
285285   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_COIN2 )
286286   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_SERVICE1 )
287   PORT_BIT( 0x80A00000, IP_ACTIVE_LOW, IPT_UNUSED )
287   PORT_BIT( 0x80a00000, IP_ACTIVE_LOW, IPT_UNUSED )
288288   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_START1 )
289289   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
290290   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
src/mame/drivers/galaxold.c
r3115r3116
589589   AM_RANGE(0x5400, 0x57ff) AM_READ(galaxold_videoram_r)
590590   AM_RANGE(0x5800, 0x58ff) AM_READ(SMH_RAM)
591591   AM_RANGE(0x6000, 0x6000) AM_READ_PORT("IN0")
592   AM_RANGE(0x6800, 0x6800) AM_READ(_4in1_input_port_1_r)
593   AM_RANGE(0x7000, 0x7000) AM_READ(_4in1_input_port_2_r)
592   AM_RANGE(0x6800, 0x6800) AM_READ_PORT("IN1")
593   AM_RANGE(0x7000, 0x7000) AM_READ_PORT("DSW0")
594594   AM_RANGE(0x7800, 0x78ff) AM_READ(watchdog_reset_r)
595595   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_ROM)   /* fixed menu code */
596596ADDRESS_MAP_END
r3115r3116
10791079   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
10801080   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
10811081   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1082   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL )   // See fake ports
1082   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x40)   // See fake ports
1083   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x80)   // See fake ports
10831084
10841085   PORT_START("DSW0")
1085   PORT_BIT( 0x3b, IP_ACTIVE_HIGH, IPT_SPECIAL )   // See fake ports
1086   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x01)   // See fake ports
1087   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x02)   // See fake ports
10861088   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
10871089   PORT_DIPSETTING(    0x00, "3" )         // 2 when continue (Scramble PT2)
10881090   PORT_DIPSETTING(    0x04, "5" )         // 2 when continue (Scramble PT2)
1091   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x08)   // See fake ports
1092   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x10)   // See fake ports
1093   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x20)   // See fake ports
10891094   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
10901095
10911096   PORT_START("FAKE1")      /* The Ghost Muncher PT3 - FAKE DSW0 (bits 0 to 5) and IN1 (bits 6 and 7) */
r3115r3116
20122017   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
20132018INPUT_PORTS_END
20142019
2020/* ckongg coinage DIPs are spread accross two input ports */
2021static CUSTOM_INPUT( ckongg_coinage_r )
2022{
2023   int bit_mask = (FPTR)param;
2024   return (input_port_read(field->port->machine, "FAKE") & bit_mask) ? 0x01 : 0x00;
2025}
2026
20152027static INPUT_PORTS_START( ckongg )
20162028   PORT_START("IN0")
20172029   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
r3115r3116
20302042   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
20312043   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
20322044   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
2033   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
2034   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
2035   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2036//  PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
2037   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
2045   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) ) PORT_CONDITION("DSW0", 0x04, PORTCOND_EQUALS, 0x00)
2046   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
2047   PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) )
2048   PORT_DIPUNKNOWN( 0x40, 0x40 ) PORT_CONDITION("DSW0", 0x04, PORTCOND_EQUALS, 0x04)
2049   PORT_DIPUNKNOWN( 0x80, 0x80 )
20382050
20392051   PORT_START("DSW0")
20402052   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
r3115r3116
20422054   PORT_DIPSETTING(    0x01, "2" )
20432055   PORT_DIPSETTING(    0x02, "3" )
20442056   PORT_DIPSETTING(    0x03, "4" )
2045   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
2046   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2047   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
2057   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Players ) )
2058   PORT_DIPSETTING(    0x04, "1" )
2059   PORT_DIPSETTING(    0x00, "2" )
20482060   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )
20492061   PORT_DIPSETTING(    0x08, "500000" )
20502062   PORT_DIPSETTING(    0x00, "750000" )
r3115r3116
20702082   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
20712083   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
20722084   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
2073   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
2074   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
2075   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2076//  PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
2077   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
2085   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ckongg_coinage_r, (void *)0x01)
2086   PORT_DIPUNKNOWN( 0x80, 0x80 )
20782087
20792088   PORT_START("DSW0")
20802089   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
r3115r3116
20822091   PORT_DIPSETTING(    0x01, "2" )
20832092   PORT_DIPSETTING(    0x02, "3" )
20842093   PORT_DIPSETTING(    0x03, "4" )
2085   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
2086   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2087   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
2094   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ckongg_coinage_r, (void *)0x02)
20882095   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )
20892096   PORT_DIPSETTING(    0x08, "500000" )
20902097   PORT_DIPSETTING(    0x00, "750000" )
20912098   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2099
2100   PORT_START("FAKE")
2101   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
2102   PORT_DIPSETTING(    0x03, DEF_STR( 5C_1C ) )
2103   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2104   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
2105   PORT_DIPSETTING(    0x01, DEF_STR( 1C_4C ) )
20922106INPUT_PORTS_END
20932107
20942108static INPUT_PORTS_START( porter )
2095   PORT_START("IN0")\
2109   PORT_START("IN0")
20962110   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
20972111   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
20982112   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
src/mame/drivers/centiped.c
r3115r3116
931931   PORT_DIPNAME( 0x10, 0x00, "Left Coin" )   PORT_DIPLOCATION("N8:5")
932932   PORT_DIPSETTING(    0x00, "*1" )
933933   PORT_DIPSETTING(    0x10, "*2" )
934   PORT_DIPNAME( 0xe0, 0x00, "Bonus Coins" ) PORT_DIPLOCATION("N8:6,7,8")      \
934   PORT_DIPNAME( 0xe0, 0x00, "Bonus Coins" ) PORT_DIPLOCATION("N8:6,7,8")
935935   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
936936   PORT_DIPSETTING(    0x20, "3 credits/2 coins" )
937937   PORT_DIPSETTING(    0x40, "5 credits/4 coins" )
r3115r3116
16331633   /* sound hardware */
16341634   MDRV_SOUND_REPLACE("pokey", AY8910, 12096000/8)
16351635   MDRV_SOUND_CONFIG(centipdb_ay8910_interface)
1636   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 10.0)
1636   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
16371637MACHINE_DRIVER_END
16381638
16391639
r3115r3116
16461646   /* sound hardware */
16471647   MDRV_SOUND_REPLACE("pokey", AY8910, 12096000/8)
16481648   MDRV_SOUND_CONFIG(centipdb_ay8910_interface)
1649   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 15.0)
1649   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
16501650MACHINE_DRIVER_END
16511651
16521652
src/mame/drivers/atarisy1.c
r3115r3116
157157
158158static void update_interrupts(running_machine *machine)
159159{
160   int newstate = 0;
161
162   /* all interrupts go through an LS148, which gives priority to the highest */
163   if (joystick_int && joystick_int_enable)
164      newstate = 2;
165   if (atarigen_scanline_int_state)
166      newstate = 3;
167   if (atarigen_video_int_state)
168      newstate = 4;
169   if (atarigen_sound_int_state)
170      newstate = 6;
171
172   /* set the new state of the IRQ lines */
173   if (newstate)
174      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
175   else
176      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
160   cpunum_set_input_line(machine, 0, 2, joystick_int && joystick_int_enable ? ASSERT_LINE : CLEAR_LINE);
161   cpunum_set_input_line(machine, 0, 3, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
162   cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
163   cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
177164}
178165
179166
src/mame/drivers/pturn.c
r3115r3116
287287
288288   AM_RANGE(0xf400, 0xf400) AM_WRITE(bg_scrollx_w)
289289
290   AM_RANGE(0xf800, 0xf800) AM_READ(input_port_0_r) AM_WRITENOP
291   AM_RANGE(0xf801, 0xf801) AM_READ(input_port_1_r) AM_WRITE(bgcolor_w)
292   AM_RANGE(0xf802, 0xf802) AM_READ(input_port_2_r)
290   AM_RANGE(0xf800, 0xf800) AM_READ_PORT("P1") AM_WRITENOP
291   AM_RANGE(0xf801, 0xf801) AM_READ_PORT("P2") AM_WRITE(bgcolor_w)
292   AM_RANGE(0xf802, 0xf802) AM_READ_PORT("SYSTEM")
293293   AM_RANGE(0xf803, 0xf803) AM_WRITE(bg_scrolly_w)
294   AM_RANGE(0xf804, 0xf804) AM_READ(input_port_4_r) /* DSW2 */
295   AM_RANGE(0xf805, 0xf805) AM_READ(input_port_3_r) /* DSW1 */
294   AM_RANGE(0xf804, 0xf804) AM_READ_PORT("DSW2")
295   AM_RANGE(0xf805, 0xf805) AM_READ_PORT("DSW1")
296296   AM_RANGE(0xf806, 0xf806) AM_READNOP /* Protection related, ((val&3)==2) -> jump to 0 */
297297
298298   AM_RANGE(0xfc00, 0xfc00) AM_WRITE (flip_w)
r3115r3116
352352GFXDECODE_END
353353
354354static INPUT_PORTS_START( pturn )
355   PORT_START("IN0")
356   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )    PORT_8WAY PORT_PLAYER(1)
357   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )    PORT_8WAY PORT_PLAYER(1)
358   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )       PORT_8WAY PORT_PLAYER(1)
359   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )    PORT_8WAY PORT_PLAYER(1)
355   PORT_START("P1")
356   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
357   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
358   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
359   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
360360   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
361361   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1)
362362   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
363363   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
364364
365   PORT_START("IN1")
366   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )    PORT_8WAY PORT_PLAYER(2)
367   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )    PORT_8WAY PORT_PLAYER(2)
368   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )       PORT_8WAY PORT_PLAYER(2)
369   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )    PORT_8WAY PORT_PLAYER(2)
365   PORT_START("P2")
366   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
367   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
368   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
369   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
370370   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
371371   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
372372   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
373373   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
374374
375   PORT_START("IN2")
376   PORT_BIT( 0x01, IP_ACTIVE_HIGH,IPT_COIN1 )
377   PORT_BIT( 0x02, IP_ACTIVE_HIGH,IPT_COIN2 )
378   PORT_BIT( 0x04, IP_ACTIVE_HIGH,IPT_SERVICE1 ) /* service coin */
379   PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_START1 )
380   PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_START2 )
375   PORT_START("SYSTEM")
376   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
377   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
378   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service coin */
379   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )
380   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 )
381381   PORT_BIT( 0xc8, IP_ACTIVE_HIGH, IPT_UNUSED )
382382
383383   PORT_START("DSW1")
src/mame/drivers/scregg.c
r3115r3116
7373   AM_RANGE(0x0000, 0x07ff) AM_READ(SMH_RAM)
7474   AM_RANGE(0x2000, 0x27ff) AM_READ(SMH_RAM)
7575   AM_RANGE(0x2800, 0x2bff) AM_READ(btime_mirrorvideoram_r)
76   AM_RANGE(0x4000, 0x4000) AM_READ(input_port_2_r)     /* DSW1 */
77   AM_RANGE(0x4001, 0x4001) AM_READ(input_port_3_r)     /* DSW2 */
76   AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW1")
77   AM_RANGE(0x4001, 0x4001) AM_READ_PORT("DSW2")
7878/*  AM_RANGE(0x4004, 0x4004)  */ /* this is read */
79   AM_RANGE(0x4002, 0x4002) AM_READ(input_port_0_r)     /* IN0 */
80   AM_RANGE(0x4003, 0x4003) AM_READ(input_port_1_r)     /* IN1 */
79   AM_RANGE(0x4002, 0x4002) AM_READ_PORT("P1")
80   AM_RANGE(0x4003, 0x4003) AM_READ_PORT("P2")
8181   AM_RANGE(0xa000, 0xffff) AM_READ(SMH_ROM)
8282ADDRESS_MAP_END
8383
r3115r3116
100100   AM_RANGE(0x1000, 0x17ff) AM_READ(SMH_RAM)
101101   AM_RANGE(0x1800, 0x1bff) AM_READ(btime_mirrorvideoram_r)
102102   AM_RANGE(0x1c00, 0x1fff) AM_READ(btime_mirrorcolorram_r)
103   AM_RANGE(0x2000, 0x2000) AM_READ(input_port_2_r)     /* DSW1 */
104   AM_RANGE(0x2001, 0x2001) AM_READ(input_port_3_r)     /* DSW2 */
105   AM_RANGE(0x2002, 0x2002) AM_READ(input_port_0_r)     /* IN0 */
106   AM_RANGE(0x2003, 0x2003) AM_READ(input_port_1_r)     /* IN1 */
103   AM_RANGE(0x2000, 0x2000) AM_READ_PORT("DSW1")
104   AM_RANGE(0x2001, 0x2001) AM_READ_PORT("DSW2")
105   AM_RANGE(0x2002, 0x2002) AM_READ_PORT("P1")
106   AM_RANGE(0x2003, 0x2003) AM_READ_PORT("P2")
107107   AM_RANGE(0x3000, 0x7fff) AM_READ(SMH_ROM)
108108   AM_RANGE(0xf000, 0xffff) AM_READ(SMH_ROM)    /* reset/interrupt vectors */
109109ADDRESS_MAP_END
r3115r3116
126126
127127
128128static INPUT_PORTS_START( scregg )
129   PORT_START("P1")      /* IN0 */
129   PORT_START("P1")
130130   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
131131   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
132132   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
r3115r3116
136136   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
137137   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
138138
139   PORT_START("P2")      /* IN1 */
139   PORT_START("P2")
140140   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
141141   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
142142   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
r3115r3116
146146   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
147147   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
148148
149   PORT_START("DSW1")      /* DSW1 */
149   PORT_START("DSW1")
150150   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
151151   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
152152   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
r3115r3116
168168   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
169169   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
170170
171   PORT_START("DSW2")      /* DSW2 */
171   PORT_START("DSW2")
172172   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
173173   PORT_DIPSETTING(    0x01, "3" )
174174   PORT_DIPSETTING(    0x00, "5" )
src/mame/drivers/dec0.c
r3115r3116
365365
366366/******************************************************************************/
367367
368#define DEC0_PLAYER1_CONTROL \
369   PORT_START("IN0") /* Player 1 controls */ \
370   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY \
371   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY \
372   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY \
373   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY \
374   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) \
375   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) \
376   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) /* Button 3 - unused */ \
377   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* Button 4 - unused */
368static INPUT_PORTS_START( dec0 )
369   PORT_START("INPUTS")
370   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
371   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
372   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
373   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
374   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
375   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )
376   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* Button 3 - only in Service Mode */
377   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) /* Button 4 - only in Service Mode */
378   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
379   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
380   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
381   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
382   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
383   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
384   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL /* Button 3 - only in Service Mode */
385   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL /* Button 4 - only in Service Mode */
378386
379#define DEC0_PLAYER2_CONTROL \
380   PORT_START("IN1") /* Player 2 controls */ \
381   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL \
382   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL \
383   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL \
384   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL \
385   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL \
386   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL \
387   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) /* Button 3 - unused */ \
388   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* Button 4 - unused */
387   PORT_START("SYSTEM")
388   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON5 ) /* Button 5 - only in Service Mode */
389   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_COCKTAIL /* Button 5 - only in Service Mode */
390   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
391   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 )
392   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN1 )
393   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN2 )
394   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
395   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
396INPUT_PORTS_END
389397
390#define DEC0_MACHINE_CONTROL \
391   PORT_START("IN2") /* Credits, start buttons */ \
392   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) /* PL1 Button 5 - unused */ \
393   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) /* PL2 Button 5 - unused */ \
394   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) \
395   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) \
396   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) \
397   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) \
398   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) \
399   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
398static INPUT_PORTS_START( dec1 )
399   PORT_START("INPUTS")
400   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
401   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
402   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
403   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
404   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
405   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )
406   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* Button 3 - only in Service Mode */
407   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
408   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
409   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
410   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
411   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
412   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
413   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
414   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL /* Button 3 - only in Service Mode */
415   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
400416
417   PORT_START("SYSTEM")
418   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
419   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
420   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
421   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
422   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
423   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
424   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
425   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
426INPUT_PORTS_END
427
401428#define DEC0_COIN_SETTING \
402   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) \
403   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) ) \
404   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) ) \
405   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) ) \
406   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) ) \
407   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) ) \
408   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) ) \
409   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) ) \
410   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) ) \
411   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) ) \
429   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A ) ) \
430   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) ) \
431   PORT_DIPSETTING(      0x0001, DEF_STR( 2C_1C ) ) \
432   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) ) \
433   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_2C ) ) \
434   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B ) ) \
435   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) ) \
436   PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) ) \
437   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_1C ) ) \
438   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_2C ) )
412439
413440static INPUT_PORTS_START( hbarrel )
414   DEC0_PLAYER1_CONTROL
415   DEC0_PLAYER2_CONTROL
416   DEC0_MACHINE_CONTROL
441   PORT_INCLUDE( dec0 )
417442
418   PORT_START("DSW0")
419   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) \
420   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) ) \
421   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) ) \
422   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) ) \
423   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) ) \
424   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) ) \
425   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) ) \
426   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) ) \
427   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) ) \
428   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) ) \
429   PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
430   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
431   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
432   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
433   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
434   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
435   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
436   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )   // Always OFF
437   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
438   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
443   PORT_START("DSW")
444   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A ) )
445   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_1C ) )
446   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) )
447   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_2C ) )
448   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_3C ) )
449   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B ) )
450   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_1C ) )
451   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_1C ) )
452   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_2C ) )
453   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_3C ) )
454   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
455   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
456   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
457   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
458   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
459   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
460   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
461   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )   // Always OFF
462   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
463   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
439464
440   PORT_START("DSW1")
441   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
442   PORT_DIPSETTING(    0x01, "1" )
443   PORT_DIPSETTING(    0x03, "3" )
444   PORT_DIPSETTING(    0x02, "5" )
445   PORT_DIPSETTING(    0x00, "Infinite (Cheat)")
446   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
447   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
448   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
449   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
450   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
451   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
452   PORT_DIPSETTING(    0x30, "30k 80k 160k" )
453   PORT_DIPSETTING(    0x10, "50k 120k 190k" )
454   PORT_DIPSETTING(    0x20, "100k 200k 300k" )
455   PORT_DIPSETTING(    0x00, "150k 300k 450k" )
456   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) )
457   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
458   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
459   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )   // Always OFF
460   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
461   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
465   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
466   PORT_DIPSETTING(      0x0100, "1" )
467   PORT_DIPSETTING(      0x0300, "3" )
468   PORT_DIPSETTING(      0x0200, "5" )
469   PORT_DIPSETTING(      0x0000, "Infinite (Cheat)")
470   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
471   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
472   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
473   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
474   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
475   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Bonus_Life ) )
476   PORT_DIPSETTING(      0x3000, "30k 80k 160k" )
477   PORT_DIPSETTING(      0x1000, "50k 120k 190k" )
478   PORT_DIPSETTING(      0x2000, "100k 200k 300k" )
479   PORT_DIPSETTING(      0x0000, "150k 300k 450k" )
480   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Allow_Continue ) )
481   PORT_DIPSETTING(      0x4000, DEF_STR( No ) )
482   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
483   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )   // Always OFF
484   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
485   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
462486
463487   PORT_START("AN0")   /* player 1 12-way rotary control - converted in controls_r() */
464488   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE
r3115r3116
468492INPUT_PORTS_END
469493
470494static INPUT_PORTS_START( birdtry )
471   DEC0_PLAYER1_CONTROL
472   DEC0_PLAYER2_CONTROL
473   DEC0_MACHINE_CONTROL
495   PORT_INCLUDE( dec0 )
474496
475   PORT_START("DSW0")
497   PORT_START("DSW")
476498   DEC0_COIN_SETTING
477   PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
478   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
479   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
480   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
481   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
482   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
483   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
484   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
485   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
486   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
499   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
500   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
501   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
502   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
503   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
504   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
505   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
506   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
507   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
508   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
487509
488   PORT_START("DSW1")
489   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
490   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
491   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
492   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
493   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
494   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
495   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
496   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
497   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
498   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
499   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
500   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
501   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
502   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
503   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
504   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
505   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
506   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
507   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
508   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
509   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
510   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
511   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
512   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
510   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
511   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
512   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
513   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
514   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
515   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
516   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
517   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
518   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
519   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
520   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
521   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
522   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
523   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
524   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
525   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
526   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
527   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
528   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
529   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
530   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
531   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
532   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
533   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
513534
514535   PORT_START("AN0")   /* player 1 12-way rotary control - converted in controls_r() */
515536   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE
r3115r3116
519540INPUT_PORTS_END
520541
521542static INPUT_PORTS_START( baddudes )
522   DEC0_PLAYER1_CONTROL
523   DEC0_PLAYER2_CONTROL
524   DEC0_MACHINE_CONTROL
543   PORT_INCLUDE( dec0 )
525544
526   PORT_START("DSW0")
545   PORT_START("DSW")
527546   DEC0_COIN_SETTING
528   PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
529   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
530   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
531   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
532   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
533   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
534   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
535   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   // According to some technical sources should be "Cabinet"
536   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
537   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
547   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
548   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
549   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
550   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
551   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
552   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
553   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
554   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )   // According to some technical sources should be "Cabinet"
555   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
556   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
538557
539   PORT_START("DSW1")
540   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
541   PORT_DIPSETTING(    0x01, "1" )
542   PORT_DIPSETTING(    0x03, "2" )
543   PORT_DIPSETTING(    0x02, "3" )
544   PORT_DIPSETTING(    0x00, "Infinite (Cheat)")
545   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
546   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
547   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
548   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
549   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
550   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )
551   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
552   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
553   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )   // Always OFF
554   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
555   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
556   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )   // Always OFF
557   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
558   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
559   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )   // Always OFF
560   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
561   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
558   PORT_DIPNAME( 0x0300, 0x0200, DEF_STR( Lives ) )
559   PORT_DIPSETTING(      0x0100, "1" )
560   PORT_DIPSETTING(      0x0300, "2" )
561   PORT_DIPSETTING(      0x0200, "3" )
562   PORT_DIPSETTING(      0x0000, "Infinite (Cheat)")
563   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
564   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
565   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
566   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
567   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
568   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) )
569   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
570   PORT_DIPSETTING(      0x1000, DEF_STR( Yes ) )
571   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) )   // Always OFF
572   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
573   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
574   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unused ) )   // Always OFF
575   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
576   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
577   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )   // Always OFF
578   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
579   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
562580
563581   PORT_START("AN0")   /* player 1 12-way rotary control - converted in controls_r() */
564582   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused */
r3115r3116
568586INPUT_PORTS_END
569587
570588static INPUT_PORTS_START( robocop )
571   DEC0_PLAYER1_CONTROL
572   DEC0_PLAYER2_CONTROL
573   DEC0_MACHINE_CONTROL
589   PORT_INCLUDE( dec0 )
574590
575   PORT_START("DSW0")
591   PORT_START("DSW")
576592   DEC0_COIN_SETTING
577   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )   // Always OFF
578   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
579   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
580   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
581   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
582   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
583   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
584   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
585   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
586   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
587   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
588   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
593   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )   // Always OFF
594   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
595   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
596   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
597   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
598   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
599   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
600   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
601   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
602   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) )
603   PORT_DIPSETTING(      0x0000, DEF_STR( Upright ) )
604   PORT_DIPSETTING(      0x0080, DEF_STR( Cocktail ) )
589605
590   PORT_START("DSW1")
591   PORT_DIPNAME( 0x03, 0x03, "Player Energy" )
592   PORT_DIPSETTING(    0x01, DEF_STR( Low ) )
593   PORT_DIPSETTING(    0x03, DEF_STR( Medium ) )
594   PORT_DIPSETTING(    0x02, DEF_STR( High ) )
595   PORT_DIPSETTING(    0x00, DEF_STR( Very_High ) )
596   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
597   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
598   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
599   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
600   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
601   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )
602   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
603   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
604   PORT_DIPNAME( 0x20, 0x20, "Bonus Stage Energy" )
605   PORT_DIPSETTING(    0x00, DEF_STR( Low ) )
606   PORT_DIPSETTING(    0x20, DEF_STR( High ) )
607   PORT_DIPNAME( 0x40, 0x40, "Brink Time" )
608   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
609   PORT_DIPSETTING(    0x00, "Less" )
610   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )   // Always OFF
611   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
612   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
606   PORT_DIPNAME( 0x0300, 0x0300, "Player Energy" )
607   PORT_DIPSETTING(      0x0100, DEF_STR( Low ) )
608   PORT_DIPSETTING(      0x0300, DEF_STR( Medium ) )
609   PORT_DIPSETTING(      0x0200, DEF_STR( High ) )
610   PORT_DIPSETTING(      0x0000, DEF_STR( Very_High ) )
611   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
612   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
613   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
614   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
615   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
616   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) )
617   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
618   PORT_DIPSETTING(      0x1000, DEF_STR( Yes ) )
619   PORT_DIPNAME( 0x2000, 0x2000, "Bonus Stage Energy" )
620   PORT_DIPSETTING(      0x0000, DEF_STR( Low ) )
621   PORT_DIPSETTING(      0x2000, DEF_STR( High ) )
622   PORT_DIPNAME( 0x4000, 0x4000, "Brink Time" )
623   PORT_DIPSETTING(      0x4000, DEF_STR( Normal ) )
624   PORT_DIPSETTING(      0x0000, "Less" )
625   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )   // Always OFF
626   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
627   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
613628INPUT_PORTS_END
614629
615630static INPUT_PORTS_START( hippodrm )
616   DEC0_PLAYER1_CONTROL
617   DEC0_PLAYER2_CONTROL
618   DEC0_MACHINE_CONTROL
631   PORT_INCLUDE( dec0 )
619632
620   PORT_START("DSW0")
633   PORT_START("DSW")
621634   DEC0_COIN_SETTING
622   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )   // Always OFF
623   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
624   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
625   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
626   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
627   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
628   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
629   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
630   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
631   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )   // Always OFF
632   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
633   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
635   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )   // Always OFF
636   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
637   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
638   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
639   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
640   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
641   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
642   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
643   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
644   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )   // Always OFF
645   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
646   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
634647
635   PORT_START("DSW1")
636   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
637   PORT_DIPSETTING(    0x01, "1" )
638   PORT_DIPSETTING(    0x03, "2" )
639   PORT_DIPSETTING(    0x02, "3" )
640   PORT_DIPSETTING(    0x00, "5" )
641   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
642   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
643   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
644   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
645   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
646   PORT_DIPNAME( 0x30, 0x30, "Player & Enemy Energy" )
647   PORT_DIPSETTING(    0x10, DEF_STR( Low ) )
648   PORT_DIPSETTING(    0x20, DEF_STR( Medium ) )
649   PORT_DIPSETTING(    0x30, DEF_STR( High ) )
650   PORT_DIPSETTING(    0x00, DEF_STR( Very_High ) )
651   PORT_DIPNAME( 0x40, 0x40, "Enemy Power on Continue" )
652   PORT_DIPSETTING(    0x40, "3 Dots" )   // 3 Dots less
653   PORT_DIPSETTING(    0x00, "2 Dots" )   // 2 Dots less
654   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )   // Always OFF
655   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
656   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
648   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
649   PORT_DIPSETTING(      0x0100, "1" )
650   PORT_DIPSETTING(      0x0300, "2" )
651   PORT_DIPSETTING(      0x0200, "3" )
652   PORT_DIPSETTING(      0x0000, "5" )
653   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
654   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
655   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
656   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
657   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
658   PORT_DIPNAME( 0x3000, 0x3000, "Player & Enemy Energy" )
659   PORT_DIPSETTING(      0x1000, DEF_STR( Low ) )
660   PORT_DIPSETTING(      0x2000, DEF_STR( Medium ) )
661   PORT_DIPSETTING(      0x3000, DEF_STR( High ) )
662   PORT_DIPSETTING(      0x0000, DEF_STR( Very_High ) )
663   PORT_DIPNAME( 0x4000, 0x4000, "Enemy Power on Continue" )
664   PORT_DIPSETTING(      0x4000, "3 Dots" )   // 3 Dots less
665   PORT_DIPSETTING(      0x0000, "2 Dots" )   // 2 Dots less
666   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )   // Always OFF
667   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
668   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
657669
658670   PORT_START("VBLANK")
659671   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
660672INPUT_PORTS_END
661673
662#define DEC1_PLAYER1_CONTROL \
663   PORT_START("IN0") \
664   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY \
665   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY \
666   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY \
667   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY \
668   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) \
669   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) \
670   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) /* button 3 - unused */ \
671   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
672
673#define DEC1_PLAYER2_CONTROL \
674   PORT_START("IN1")\
675   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL \
676   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL \
677   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL \
678   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL \
679   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL \
680   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL \
681   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) /* button 3 - unused */ \
682   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
683
684
685674static INPUT_PORTS_START( slyspy )
686   DEC1_PLAYER1_CONTROL
687   DEC1_PLAYER2_CONTROL
675   PORT_INCLUDE( dec1 )
676   /* if you set VBLANK as ACTIVE_LOW, you obtain screwed up colors */
688677
689   PORT_START("IN2")   /* Credits, start buttons */
690   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
691   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
692   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
693   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )   /* screwed up colors with ACTIVE_LOW */
694   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
695   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
696   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
697   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
698
699   PORT_START("DSW0")
678   PORT_START("DSW")
700679   DEC0_COIN_SETTING
701   PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
702   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
703   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
704   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
705   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
706   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
707   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
708   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
709   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
710   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
680   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
681   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
682   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
683   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
684   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
685   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
686   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
687   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) )
688   PORT_DIPSETTING(      0x0000, DEF_STR( Upright ) )
689   PORT_DIPSETTING(      0x0080, DEF_STR( Cocktail ) )
711690
712   PORT_START("DSW1")
713   PORT_DIPNAME( 0x03, 0x03, "Energy" )
714   PORT_DIPSETTING(    0x02, DEF_STR( Low ) )
715   PORT_DIPSETTING(    0x03, DEF_STR( Medium ) )
716   PORT_DIPSETTING(    0x01, DEF_STR( High ) )
717   PORT_DIPSETTING(    0x00, DEF_STR( Very_High ) )
718   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
719   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
720   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
721   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
722   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
723   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )
724   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
725   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
726   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )   // Always OFF
727   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
728   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
729   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )   // Always OFF
730   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
731   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
732   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )   // Always OFF
733   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
734   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
691   PORT_DIPNAME( 0x0300, 0x0300, "Energy" )
692   PORT_DIPSETTING(      0x0200, DEF_STR( Low ) )
693   PORT_DIPSETTING(      0x0300, DEF_STR( Medium ) )
694   PORT_DIPSETTING(      0x0100, DEF_STR( High ) )
695   PORT_DIPSETTING(      0x0000, DEF_STR( Very_High ) )
696   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
697   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
698   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
699   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
700   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
701   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) )
702   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
703   PORT_DIPSETTING(      0x1000, DEF_STR( Yes ) )
704   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) )   // Always OFF
705   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
706   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
707   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unused ) )   // Always OFF
708   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
709   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
710   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )   // Always OFF
711   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
712   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
735713INPUT_PORTS_END
736714
737715static INPUT_PORTS_START( midres )
738   DEC1_PLAYER1_CONTROL
739   DEC1_PLAYER2_CONTROL
716   PORT_INCLUDE( dec1 )
740717
741   PORT_START("IN2")   /* Credits */
742   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
743   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
744   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
745   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
746   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
747   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
748   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
749   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
750
751   PORT_START("DSW0")
718   PORT_START("DSW")
752719   DEC0_COIN_SETTING
753   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )   // Always OFF
754   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
755   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
756   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
757   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
758   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
759   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
760   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
761   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
762   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )   // Always OFF
763   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
764   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
720   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )   // Always OFF
721   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
722   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
723   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
724   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
725   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
726   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
727   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
728   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
729   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )   // Always OFF
730   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
731   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
765732
766   PORT_START("DSW1")
767   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
768   PORT_DIPSETTING(    0x01, "1" )
769   PORT_DIPSETTING(    0x03, "3" )
770   PORT_DIPSETTING(    0x02, "5" )
771   PORT_DIPSETTING(    0x00, "Infinite (Cheat)")
772   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
773   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
774   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
775   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
776   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
777   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   // Extra Lives?
778   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
779   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
780   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   // Extra Lives?
781   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
782   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
783   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) )
784   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
785   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
786   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )   // Always OFF
787   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
788   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
733   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
734   PORT_DIPSETTING(      0x0100, "1" )
735   PORT_DIPSETTING(      0x0300, "3" )
736   PORT_DIPSETTING(      0x0200, "5" )
737   PORT_DIPSETTING(      0x0000, "Infinite (Cheat)")
738   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
739   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
740   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
741   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
742   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
743   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )   // Extra Lives?
744   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
745   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
746   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )   // Extra Lives?
747   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
748   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
749   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Allow_Continue ) )
750   PORT_DIPSETTING(      0x4000, DEF_STR( No ) )
751   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
752   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )   // Always OFF
753   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
754   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
789755
790756   PORT_START("AN0")   /* player 1 12-way rotary control - converted in controls_r() */
791757   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE
r3115r3116
795761INPUT_PORTS_END
796762
797763static INPUT_PORTS_START( bouldash )
798   DEC1_PLAYER1_CONTROL
799   DEC1_PLAYER2_CONTROL
764   PORT_INCLUDE( dec1 )
800765
801   PORT_START("IN2")   /* Credits, start buttons */
802   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
803   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
804   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
805   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK )      /* extremely slow palette fades with ACTIVE_HIGH */
806   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
807   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
808   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
809   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
766   PORT_MODIFY("SYSTEM")
767   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )      /* extremely slow palette fades with ACTIVE_HIGH */
810768
811   PORT_START("DSW0")
769   PORT_START("DSW")
812770   /* Different Coinage. Just a few combinations from manual, the rest was figured out */
813   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
814   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
815   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
816   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
817   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
818   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
819   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
820   PORT_DIPSETTING(    0x03, DEF_STR( 1C_5C ) )
821   PORT_DIPSETTING(    0x02, DEF_STR( 1C_6C ) )
822   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )
823   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
824   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
825   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
826   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
827   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
828   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
829   PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C ) )
830   PORT_DIPSETTING(    0x10, DEF_STR( 1C_6C ) )
831   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
832   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
833   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
834   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
835   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
836   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
771   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
772   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
773   PORT_DIPSETTING(      0x0001, DEF_STR( 2C_1C ) )
774   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
775   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
776   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
777   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
778   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_5C ) )
779   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_6C ) )
780   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
781   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
782   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_1C ) )
783   PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
784   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
785   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
786   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
787   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_5C ) )
788   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_6C ) )
789   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
790   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
791   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
792   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) )
793   PORT_DIPSETTING(      0x0000, DEF_STR( Upright ) )
794   PORT_DIPSETTING(      0x0080, DEF_STR( Cocktail ) )
837795
838   PORT_START("DSW1")
839   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
840   PORT_DIPSETTING(    0x00, "2" )
841   PORT_DIPSETTING(    0x03, "3" )
842   PORT_DIPSETTING(    0x02, "4" )
843   PORT_DIPSETTING(    0x01, "5" )
844   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
845   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
846   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
847   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
848   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
849   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )   // Always OFF
850   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
851   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
852   PORT_DIPNAME( 0x20, 0x20, "Game Change Mode" )
853   PORT_DIPSETTING(    0x20, "Part 1" )
854   PORT_DIPSETTING(    0x00, "Part 2" )
855   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )
856   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
857   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
858   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
859   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
860   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
796   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
797   PORT_DIPSETTING(      0x0000, "2" )
798   PORT_DIPSETTING(      0x0300, "3" )
799   PORT_DIPSETTING(      0x0200, "4" )
800   PORT_DIPSETTING(      0x0100, "5" )
801   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
802   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
803   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
804   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
805   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
806   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) )   // Always OFF
807   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
808   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
809   PORT_DIPNAME( 0x2000, 0x2000, "Game Change Mode" )
810   PORT_DIPSETTING(      0x2000, "Part 1" )
811   PORT_DIPSETTING(      0x0000, "Part 2" )
812   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) )
813   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
814   PORT_DIPSETTING(      0x4000, DEF_STR( Yes ) )
815   PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Demo_Sounds ) )
816   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
817   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
861818INPUT_PORTS_END
862819
863820/******************************************************************************/
src/mame/drivers/ssv.c
r3115r3116
420420static READ16_HANDLER( fake_r )   {   return ssv_scroll[offset];  }
421421#endif
422422
423#define SSV_READMEM( _ROM  )                              \
423#define SSV_READMEM( _ROM  )                                          \
424424   AM_RANGE(0x000000, 0x00ffff) AM_READ(SMH_RAM            )   /*  RAM     */   \
425425   AM_RANGE(0x100000, 0x13ffff) AM_READ(SMH_RAM            )   /*  Sprites */   \
426426   AM_RANGE(0x140000, 0x15ffff) AM_READ(SMH_RAM            )   /*  Palette */   \
427427   AM_RANGE(0x160000, 0x17ffff) AM_READ(SMH_RAM            )   /*          */   \
428428   AM_RANGE(0x1c0000, 0x1c0001) AM_READ(ssv_vblank_r         )   /*  Vblank? */   \
429429/**/AM_RANGE(0x1c0002, 0x1c007f) AM_READ(SMH_RAM            )   /*  Scroll  */   \
430   AM_RANGE(0x210002, 0x210003) AM_READ(input_port_0_word_r   )   /*  DSW     */   \
431   AM_RANGE(0x210004, 0x210005) AM_READ(input_port_1_word_r   )   /*  DSW     */   \
432   AM_RANGE(0x210008, 0x210009) AM_READ(input_port_2_word_r   )   /*  P1      */   \
433   AM_RANGE(0x21000a, 0x21000b) AM_READ(input_port_3_word_r   )   /*  P2      */   \
434   AM_RANGE(0x21000c, 0x21000d) AM_READ(input_port_4_word_r   )   /*  Coins   */   \
430   AM_RANGE(0x210002, 0x210003) AM_READ_PORT("DSW1")                        \
431   AM_RANGE(0x210004, 0x210005) AM_READ_PORT("DSW2")                        \
432   AM_RANGE(0x210008, 0x210009) AM_READ_PORT("P1")                           \
433   AM_RANGE(0x21000a, 0x21000b) AM_READ_PORT("P2")                           \
434   AM_RANGE(0x21000c, 0x21000d) AM_READ_PORT("SYSTEM")                        \
435435   AM_RANGE(0x21000e, 0x21000f) AM_READ(SMH_NOP            )   /*          */   \
436436   AM_RANGE(0x300000, 0x30007f) AM_READ(es5506_data_0_word_r   )   /*  Sound   */   \
437   AM_RANGE(0x482000, 0x482fff) AM_RAM_WRITE(dsp_w) AM_BASE(&dsp_ram)   \
438   AM_RANGE(_ROM, 0xffffff) AM_READ(SMH_BANK1         )   /*  ROM     */       \
437   AM_RANGE(0x482000, 0x482fff) AM_RAM_WRITE(dsp_w) AM_BASE(&dsp_ram)            \
438   AM_RANGE(_ROM, 0xffffff) AM_READ(SMH_BANK1               )   /*  ROM  */       \
439439//AM_RANGE(0x990000, 0x99007f) AM_READ(fake_r)
440440
441441#define SSV_WRITEMEM                                                                          \
src/mame/drivers/atarig42.c
r3115r3116
5151
5252static void update_interrupts(running_machine *machine)
5353{
54   int newstate = 0;
55
56   if (atarigen_video_int_state)
57      newstate = 4;
58   if (atarigen_sound_int_state)
59      newstate = 5;
60
61   if (newstate)
62      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
63   else
64      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
54   cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
55   cpunum_set_input_line(machine, 0, 5, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
6556}
6657
6758
src/mame/drivers/vindictr.c
r3115r3116
3232
3333static void update_interrupts(running_machine *machine)
3434{
35   int newstate = 0;
36
37   if (atarigen_scanline_int_state)
38      newstate |= 4;
39   if (atarigen_sound_int_state)
40      newstate |= 6;
41
42   if (newstate)
43      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
44   else
45      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
35   cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
36   cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
4637}
4738
4839
src/mame/drivers/mpu4drvr.c
r3115r3116
271271
272272static void update_mpu68_interrupts(running_machine *machine)
273273{
274   int newstate = 0;
275
276   if (m6840_irq_state)
277      newstate = 1;
278   if (m6850_irq_state)
279      newstate = 2;
280   if (scn2674_irq_state)
281      newstate = 3;
282
283   /* set the new state of the IRQ lines */
284   if (newstate)
285   {
286      LOGSTUFF(("68k IRQ, %x\n", newstate));
287      cpunum_set_input_line(machine, 1, newstate, ASSERT_LINE);
288   }
289   else
290   {
291      LOGSTUFF(("68k IRQ Clear, %x\n", newstate));
292      cpunum_set_input_line(machine, 1, 7, CLEAR_LINE);
293   }
274   cpunum_set_input_line(machine, 1, 1, m6840_irq_state ? ASSERT_LINE : CLEAR_LINE);
275   cpunum_set_input_line(machine, 1, 2, m6850_irq_state ? ASSERT_LINE : CLEAR_LINE);
276   cpunum_set_input_line(machine, 1, 3, scn2674_irq_state ? ASSERT_LINE : CLEAR_LINE);
294277}
295278
296279/* Communications with 6809 board */
r3115r3116
13811364
13821365   /* setup 4 reels (for hybrid machines) */
13831366
1384   Stepper_init(0, BARCREST_48STEP_REEL);
1385   Stepper_init(1, BARCREST_48STEP_REEL);
1386   Stepper_init(2, BARCREST_48STEP_REEL);
1387   Stepper_init(3, BARCREST_48STEP_REEL);
1367   stepper_config(0, &barcrest_reel_interface);
1368   stepper_config(1, &barcrest_reel_interface);
1369   stepper_config(2, &barcrest_reel_interface);
1370   stepper_config(3, &barcrest_reel_interface);
13881371
13891372   /* setup the standard oki MSC1937 display */
13901373
src/mame/drivers/namcond1.c
r3115r3116
7878   AM_RANGE(0x000000, 0x0fffff) AM_ROM
7979   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(namcond1_shared_ram_r,namcond1_shared_ram_w) AM_BASE(&namcond1_shared_ram)
8080   AM_RANGE(0x800000, 0x80000f) AM_READWRITE(ygv608_r,ygv608_w)
81   AM_RANGE(0xa00000, 0xa00fff) AM_READWRITE8(at28c16_0_r, at28c16_0_w, 0xff00)
81   AM_RANGE(0xa00000, 0xa00fff) AM_DEVREADWRITE8(AT28C16, "at28c16", at28c16_r, at28c16_w, 0xff00)
8282#ifdef MAME_DEBUG
8383   AM_RANGE(0xb00000, 0xb00001) AM_READ(ygv608_debug_trigger)
8484#endif
r3115r3116
8888/*************************************************************/
8989
9090static INPUT_PORTS_START( namcond1 )
91   PORT_START("P1_P2")      /* player 1 */
91   PORT_START("P1_P2")
9292   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
9393   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
9494   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
r3115r3116
106106   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
107107   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
108108
109   PORT_START("DSW")     /* dipswitches */
109   PORT_START("DSW")
110110   PORT_DIPNAME( 0x0100, 0x0100, "Freeze" )
111   PORT_DIPSETTING(    0x0100, DEF_STR( Off ) )
112   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
111   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
112   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
113113   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Test ) )
114   PORT_DIPSETTING(    0x0200, DEF_STR( Off ) )
115   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
114   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
115   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
116116   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 )
117117   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 )
118118   PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
r3115r3116
251251   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
252252   AM_RANGE(0x200000, 0x20ffff) AM_READWRITE( sharedram_sub_r, sharedram_sub_w )
253253   AM_RANGE(0xa00000, 0xa07fff) AM_READWRITE( c352_0_r, c352_0_w )
254   AM_RANGE(0xc00000, 0xc00001) AM_READ( input_port_1_word_r )
255   AM_RANGE(0xc00002, 0xc00003) AM_READ( input_port_0_word_r )
254   AM_RANGE(0xc00000, 0xc00001) AM_READ_PORT("P1_P2")
255   AM_RANGE(0xc00002, 0xc00003) AM_READ_PORT("DSW")
256256   AM_RANGE(0xc00010, 0xc00011) AM_NOP
257257   AM_RANGE(0xc00030, 0xc00031) AM_NOP
258258   AM_RANGE(0xc00040, 0xc00041) AM_NOP
r3115r3116
272272    }
273273}
274274
275static DRIVER_INIT( namcond1 )
276{
277   at28c16_init( 0, NULL, NULL );
278}
279
280275/******************************************
281276  ND-1 Master clock = 49.152MHz
282277  - 680000  = 12288000 (CLK/4)
r3115r3116
302297
303298   MDRV_MACHINE_START(namcond1)
304299   MDRV_MACHINE_RESET(namcond1)
305   MDRV_NVRAM_HANDLER(at28c16_0)
306300
307301   /* video hardware */
308302   MDRV_SCREEN_ADD("main", RASTER)
r3115r3116
326320   MDRV_SOUND_ROUTE(1, "left", 1.00)
327321   MDRV_SOUND_ROUTE(2, "right", 1.00)
328322   MDRV_SOUND_ROUTE(3, "left", 1.00)
323
324   MDRV_DEVICE_ADD( "at28c16", AT28C16 )
329325MACHINE_DRIVER_END
330326
331327ROM_START( ncv1 )
r3115r3116
405401    ROM_LOAD( "ncs1voic.7c",     0x000000, 0x200000, CRC(ed05fd88) SHA1(ad88632c89a9946708fc6b4c9247e1bae9b2944b) )
406402ROM_END
407403
408GAME( 1995, ncv1,      0, namcond1, namcond1, namcond1, ROT90, "Namco", "Namco Classics Collection Vol.1", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
409GAME( 1995, ncv1j,  ncv1, namcond1, namcond1, namcond1, ROT90, "Namco", "Namco Classics Collection Vol.1 (Japan, v1.00)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
410GAME( 1995, ncv1j2, ncv1, namcond1, namcond1, namcond1, ROT90, "Namco", "Namco Classics Collection Vol.1 (Japan, v1.03)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
411GAME( 1996, ncv2,      0, namcond1, namcond1, namcond1, ROT90, "Namco", "Namco Classics Collection Vol.2", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
412GAME( 1996, ncv2j,  ncv2, namcond1, namcond1, namcond1, ROT90, "Namco", "Namco Classics Collection Vol.2 (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
404GAME( 1995, ncv1,      0, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.1", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
405GAME( 1995, ncv1j,  ncv1, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.1 (Japan, v1.00)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
406GAME( 1995, ncv1j2, ncv1, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.1 (Japan, v1.03)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
407GAME( 1996, ncv2,      0, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.2", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
408GAME( 1996, ncv2j,  ncv2, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.2 (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
src/mame/drivers/usgames.c
r3115r3116
7070
7171static ADDRESS_MAP_START( usgames_map, ADDRESS_SPACE_PROGRAM, 8 )
7272   AM_RANGE(0x0000, 0x1fff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
73   AM_RANGE(0x2000, 0x2000) AM_READ(input_port_1_r)
74   AM_RANGE(0x2010, 0x2010) AM_READ(input_port_0_r)
73   AM_RANGE(0x2000, 0x2000) AM_READ_PORT("DSW")
74   AM_RANGE(0x2010, 0x2010) AM_READ_PORT("INPUTS")
7575   AM_RANGE(0x2020, 0x2020) AM_WRITE(lamps1_w)
7676   AM_RANGE(0x2030, 0x2030) AM_WRITE(lamps2_w)
7777   AM_RANGE(0x2040, 0x2040) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
78   AM_RANGE(0x2041, 0x2041) AM_READ(input_port_2_r)
78   AM_RANGE(0x2041, 0x2041) AM_READ_PORT("UNK1")
7979   AM_RANGE(0x2041, 0x2041) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
8080   AM_RANGE(0x2060, 0x2060) AM_WRITE(usgames_rombank_w)
81   AM_RANGE(0x2070, 0x2070) AM_READ(input_port_3_r)
81   AM_RANGE(0x2070, 0x2070) AM_READ_PORT("UNK2")
8282   AM_RANGE(0x2400, 0x2400) AM_WRITE(ay8910_control_port_0_w)
8383   AM_RANGE(0x2401, 0x2401) AM_WRITE(ay8910_write_port_0_w)
8484   AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(usgames_charram_w) AM_BASE(&usgames_charram)
r3115r3116
9292   AM_RANGE(0x0000, 0x1fff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
9393   AM_RANGE(0x2000, 0x2000) AM_WRITE(ay8910_control_port_0_w)
9494   AM_RANGE(0x2001, 0x2001) AM_WRITE(ay8910_write_port_0_w)
95   AM_RANGE(0x2400, 0x2400) AM_READ(input_port_1_r)
96   AM_RANGE(0x2410, 0x2410) AM_READ(input_port_0_r)
95   AM_RANGE(0x2400, 0x2400) AM_READ_PORT("DSW")
96   AM_RANGE(0x2410, 0x2410) AM_READ_PORT("INPUTS")
9797   AM_RANGE(0x2420, 0x2420) AM_WRITE(lamps1_w)
9898   AM_RANGE(0x2430, 0x2430) AM_WRITE(lamps2_w)
9999   AM_RANGE(0x2440, 0x2440) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
100   AM_RANGE(0x2441, 0x2441) AM_READ(input_port_2_r)
100   AM_RANGE(0x2441, 0x2441) AM_READ_PORT("UNK1")
101101   AM_RANGE(0x2441, 0x2441) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
102102   AM_RANGE(0x2460, 0x2460) AM_WRITE(usgames_rombank_w)
103   AM_RANGE(0x2470, 0x2470) AM_READ(input_port_3_r)
103   AM_RANGE(0x2470, 0x2470) AM_READ_PORT("UNK2")
104104   AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(usgames_charram_w) AM_BASE(&usgames_charram)
105105   AM_RANGE(0x3000, 0x3fff) AM_RAM_WRITE(usgames_videoram_w) AM_BASE(&usgames_videoram)
106106   AM_RANGE(0x4000, 0x7fff) AM_READWRITE(SMH_BANK1, SMH_ROM)
107107   AM_RANGE(0x8000, 0xffff) AM_ROM
108108ADDRESS_MAP_END
109109
110#define USGIN0\
111   PORT_START("IN0")\
112   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Button 1") PORT_CODE(KEYCODE_Z)\
113   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Button 2") PORT_CODE(KEYCODE_X)\
114   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Button 3") PORT_CODE(KEYCODE_C)\
115   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Button 4") PORT_CODE(KEYCODE_V)\
116   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Button 5") PORT_CODE(KEYCODE_B)\
117   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )\
118   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )\
119   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
120   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )\
121   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )\
122   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )\
123   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
124110
125#define USGIN2 \
126   PORT_START("IN2")\
127   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )\
128   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )\
129   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
130   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )\
131   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )\
132   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
133   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )\
134   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )\
135   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
136   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )\
137   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )\
138   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
139   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )\
140   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )\
141   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
142   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )\
143   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )\
144   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
145   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )\
146   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )\
147   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
148   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )\
149   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )\
111static INPUT_PORTS_START( usg32 )
112   PORT_START("INPUTS")
113   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Button 1") PORT_CODE(KEYCODE_Z)
114   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Button 2") PORT_CODE(KEYCODE_X)
115   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Button 3") PORT_CODE(KEYCODE_C)
116   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Button 4") PORT_CODE(KEYCODE_V)
117   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Button 5") PORT_CODE(KEYCODE_B)
118   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
119   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
150120   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
151
152#define USGIN3\
153   PORT_START("IN3")\
154   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )\
155   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )\
156   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
157   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )\
158   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )\
159   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
160   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )\
161   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )\
162   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
163   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )\
164   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )\
165   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
166   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )\
167   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )\
168   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
169   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )\
170   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )\
171   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
172   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )\
173   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )\
174   PORT_DIPSETTING(    0x00, DEF_STR( On ) )\
175   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )\
176   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )\
121   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
122   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
123   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
177124   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
178125
179
180static INPUT_PORTS_START( usg32 )
181
182   USGIN0
183
184126   PORT_START("DSW")
185   PORT_DIPNAME( 0x01, 0x01, "Service Keyboard Attached?" ) //Not actually a DIP, when keyboard is plugged in, this goes low
127   PORT_DIPNAME( 0x01, 0x01, "Service Keyboard Attached?" )   // Not actually a DIP, when keyboard is plugged in, this goes low
186128   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
187129   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
188   PORT_SERVICE_NO_TOGGLE(0x02, IP_ACTIVE_HIGH)
130   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_HIGH )
189131   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
190132   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
191133   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
201143   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) // +12 Volts?
202144   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
203145
146   PORT_START("UNK1")
147   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
148   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
149   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
150   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
151   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
152   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
153   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
154   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
155   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
156   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
157   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
158   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
159   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
160   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
161   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
162   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
163   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
164   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
165   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
166   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
167   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
168   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
169   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
170   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
204171
205   USGIN2
206
207   USGIN3
208INPUT_PORTS_END
209
210
211static INPUT_PORTS_START( usg83 ) //From here, the hardware was slightly upgraded, but not too different.
212
213    USGIN0
214
215   PORT_START("DSW")
216   PORT_DIPNAME( 0x01, 0x01, "Service Keyboard Attached?" ) //Not actually a DIP, when keyboard is plugged in, this goes low
217   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
218   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
219   PORT_SERVICE_NO_TOGGLE(0x02, IP_ACTIVE_HIGH)
220   PORT_DIPNAME( 0x04, 0x04, "Test_Switch" )
172   PORT_START("UNK2")
173   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
174   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
175   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
176   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
177   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
178   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
179   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
221180   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
222181   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
223182   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
224183   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
225184   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
226185   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
227   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
228   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
186   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
187   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
229188   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
230189   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
231190   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
232   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) // +12 Volts?
233   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
191   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
192   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
193   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
194   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
195   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
196   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
197INPUT_PORTS_END
234198
235    USGIN2
199/* From here, the hardware was slightly upgraded, but not too different. */
200static INPUT_PORTS_START( usg83 )
201   PORT_INCLUDE( usg32 )
236202
237   USGIN3
238
203   PORT_MODIFY("DSW")
204   PORT_DIPNAME( 0x04, 0x04, "Test_Switch" )
205   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
206   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
239207INPUT_PORTS_END
240208
241209
src/mame/drivers/opwolf.c
r3115r3116
119119static UINT8 *cchip_ram;
120120static UINT8 adpcm_b[0x08];
121121static UINT8 adpcm_c[0x08];
122static UINT32 adpcm_pos[2],adpcm_end[2];
123static int adpcm_data[2];
124
122125static int opwolf_gun_xoffs, opwolf_gun_yoffs;
123126
124127WRITE16_HANDLER( rainbow_spritectrl_w );
r3115r3116
291294ADDRESS_MAP_END
292295
293296
294static UINT32 adpcm_pos[2],adpcm_end[2];
295
296297//static UINT8 adpcm_d[0x08];
297298//0 - start ROM offset LSB
298299//1 - start ROM offset MSB
r3115r3116
313314
314315static MACHINE_RESET( opwolf )
315316{
317   adpcm_b[0] = adpcm_b[1] = 0;
318   adpcm_c[0] = adpcm_c[1] = 0;
319   adpcm_pos[0] = adpcm_pos[1] = 0;
320   adpcm_end[0] = adpcm_end[1] = 0;
321   adpcm_data[0] = adpcm_data[1] = -1;
322
316323   msm5205_reset_w(0, 1);
317324   msm5205_reset_w(1, 1);
318325}
319326
320327static void opwolf_msm5205_vck(running_machine *machine, int chip)
321328{
322   static int adpcm_data[2] = { -1, -1 };
323
324329   if (adpcm_data[chip] != -1)
325330   {
326331      msm5205_data_w(chip, adpcm_data[chip] & 0x0f);
src/mame/drivers/surpratk.c
r3115r3116
8989   AM_RANGE(0x0000, 0x07ff) AM_READ(bankedram_r)
9090   AM_RANGE(0x0800, 0x1fff) AM_READ(SMH_RAM)
9191   AM_RANGE(0x2000, 0x3fff) AM_READ(SMH_BANK1)         /* banked ROM */
92   AM_RANGE(0x5f8c, 0x5f8c) AM_READ(input_port_0_r)
93   AM_RANGE(0x5f8d, 0x5f8d) AM_READ(input_port_1_r)
94   AM_RANGE(0x5f8e, 0x5f8e) AM_READ(input_port_4_r)
95   AM_RANGE(0x5f8f, 0x5f8f) AM_READ(input_port_2_r)
96   AM_RANGE(0x5f90, 0x5f90) AM_READ(input_port_3_r)
92   AM_RANGE(0x5f8c, 0x5f8c) AM_READ_PORT("P1")
93   AM_RANGE(0x5f8d, 0x5f8d) AM_READ_PORT("P2")
94   AM_RANGE(0x5f8e, 0x5f8e) AM_READ_PORT("DSW3")
95   AM_RANGE(0x5f8f, 0x5f8f) AM_READ_PORT("DSW1")
96   AM_RANGE(0x5f90, 0x5f90) AM_READ_PORT("DSW2")
9797//  AM_RANGE(0x5f91, 0x5f91) AM_READ(ym2151_status_port_0_r)    /* ? */
9898   AM_RANGE(0x5fa0, 0x5faf) AM_READ(K053244_r)
9999   AM_RANGE(0x5fc0, 0x5fc0) AM_READ(watchdog_reset_r)
r3115r3116
123123***************************************************************************/
124124
125125static INPUT_PORTS_START( surpratk )
126   PORT_START("P1")   /* PLAYER 1 INPUTS */
126   PORT_START("P1")
127127   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
128128   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
129129   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
133133   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
134134   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
135135
136   PORT_START("P2")   /* PLAYER 2 INPUTS */
136   PORT_START("P2")
137137   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
138138   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
139139   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
143143   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
144144   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
145145
146   PORT_START("DSW1")   /* DSW #1 */
146   PORT_START("DSW1")
147147   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
148148   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
149149   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
179179   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
180180//  PORT_DIPSETTING(    0x00, "No Use" )
181181
182   PORT_START("DSW2")   /* DSW #2 */
182   PORT_START("DSW2")
183183   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
184184   PORT_DIPSETTING(    0x03, "2" )
185185   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
203203   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
204204   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
205205
206   PORT_START("DSW3")   /* DSW #3 */
206   PORT_START("DSW3")
207207   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
208208   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE )
209209   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
src/mame/drivers/suna16.c
r3115r3116
105105   AM_RANGE(0x400000, 0x4001ff) AM_READ(suna16_paletteram16_r   )   // Banked Palette
106106   AM_RANGE(0x400200, 0x400fff) AM_READ(SMH_RAM             )   //
107107   AM_RANGE(0x600000, 0x61ffff) AM_READ(SMH_RAM             )   // Sprites
108   AM_RANGE(0xa00000, 0xa00001) AM_READ(input_port_0_word_r      )   // P1 (Inputs)
109   AM_RANGE(0xa00002, 0xa00003) AM_READ(input_port_1_word_r      )   // P2
110   AM_RANGE(0xa00004, 0xa00005) AM_READ(input_port_2_word_r      )   // P3
111   AM_RANGE(0xa00006, 0xa00007) AM_READ(input_port_3_word_r      )   // P4
112   AM_RANGE(0xa00008, 0xa00009) AM_READ(input_port_4_word_r      )   // DSWs
113   AM_RANGE(0xa0000a, 0xa0000b) AM_READ(input_port_5_word_r      )   // Coins
108   AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("P1")
109   AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("P2")
110   AM_RANGE(0xa00004, 0xa00005) AM_READ_PORT("P3")
111   AM_RANGE(0xa00006, 0xa00007) AM_READ_PORT("P4")
112   AM_RANGE(0xa00008, 0xa00009) AM_READ_PORT("DSW1")
113   AM_RANGE(0xa0000a, 0xa0000b) AM_READ_PORT("DSW2")
114114ADDRESS_MAP_END
115115
116116static ADDRESS_MAP_START( bssoccer_writemem, ADDRESS_SPACE_PROGRAM, 16 )
r3115r3116
142142   AM_RANGE(0x200000, 0x2001ff) AM_READ(suna16_paletteram16_r   )   // Banked Palette
143143   AM_RANGE(0x200200, 0x200fff) AM_READ(SMH_RAM             )   //
144144   AM_RANGE(0x400000, 0x41ffff) AM_READ(SMH_RAM             )   // Sprites
145   AM_RANGE(0x600000, 0x600001) AM_READ(input_port_0_word_r      )   // P1 + Coins(Inputs)
146   AM_RANGE(0x600002, 0x600003) AM_READ(input_port_1_word_r      )   // P2 + Coins
147   AM_RANGE(0x600004, 0x600005) AM_READ(input_port_2_word_r      )   // DSW 1
148   AM_RANGE(0x600006, 0x600007) AM_READ(input_port_3_word_r      )   // DSW 2
145   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("P1")
146   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("P2")
147   AM_RANGE(0x600004, 0x600005) AM_READ_PORT("DSW1")
148   AM_RANGE(0x600006, 0x600007) AM_READ_PORT("DSW2")
149149   AM_RANGE(0xa00000, 0xa0ffff) AM_READ(SMH_NOP               )   // Protection
150150ADDRESS_MAP_END
151151
r3115r3116
171171
172172static ADDRESS_MAP_START( sunaq_readmem, ADDRESS_SPACE_PROGRAM, 16 )
173173   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM             )   // ROM
174   AM_RANGE(0x500000, 0x500001) AM_READ(input_port_0_word_r      )   // P1 + Coins
175   AM_RANGE(0x500002, 0x500003) AM_READ(input_port_1_word_r      )   // P2 + Coins
176   AM_RANGE(0x500004, 0x500005) AM_READ(input_port_2_word_r      )   // DSW
177   AM_RANGE(0x500006, 0x500007) AM_READ(input_port_3_word_r      )   // (unused?)
174   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1")
175   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2")
176   AM_RANGE(0x500004, 0x500005) AM_READ_PORT("DSW1")
177   AM_RANGE(0x500006, 0x500007) AM_READ_PORT("DSW2")            // (unused?)
178178   AM_RANGE(0x540000, 0x5401ff) AM_READ(suna16_paletteram16_r   )   // Banked Palette
179179   AM_RANGE(0x540200, 0x540fff) AM_READ(SMH_RAM             )   // RAM
180180   AM_RANGE(0x580000, 0x583fff) AM_READ(SMH_RAM             )   // RAM
r3115r3116
219219
220220
221221static ADDRESS_MAP_START( bestbest_map, ADDRESS_SPACE_PROGRAM, 16 )
222   AM_RANGE( 0x000000, 0x03ffff ) AM_ROM AM_MIRROR(0xc0000)         // ROM
223   AM_RANGE( 0x200000, 0x2fffff ) AM_ROM AM_REGION("user1", 0)   // ROM
224   AM_RANGE( 0x500000, 0x500001 ) AM_READWRITE( input_port_0_word_r, suna16_soundlatch_w   )   // P1 + Coins, To Sound CPU
225   AM_RANGE( 0x500002, 0x500003 ) AM_READWRITE( input_port_1_word_r, bestbest_flipscreen_w   )   // P2 + Coins, Flip Screen
226   AM_RANGE( 0x500004, 0x500005 ) AM_READWRITE( input_port_2_word_r, bestbest_coin_w      )   // Coin Counter
227   AM_RANGE( 0x500008, 0x500009 ) AM_WRITE( bestbest_prot_w )   // Protection
228   AM_RANGE( 0x500018, 0x500019 ) AM_READ ( bestbest_prot_r )   //
222   AM_RANGE( 0x000000, 0x03ffff ) AM_ROM AM_MIRROR(0xc0000)      // ROM
223   AM_RANGE( 0x200000, 0x2fffff ) AM_ROM AM_REGION("user1", 0)      // ROM
224   AM_RANGE( 0x500000, 0x500001 ) AM_READ_PORT("P1") AM_WRITE(suna16_soundlatch_w)      // To Sound CPU
225   AM_RANGE( 0x500002, 0x500003 ) AM_READ_PORT("P2") AM_WRITE(bestbest_flipscreen_w)   // P2 + Coins, Flip Screen
226   AM_RANGE( 0x500004, 0x500005 ) AM_READ_PORT("DSW") AM_WRITE(bestbest_coin_w)      // Coin Counter
227   AM_RANGE( 0x500008, 0x500009 ) AM_WRITE( bestbest_prot_w )      // Protection
228   AM_RANGE( 0x500018, 0x500019 ) AM_READ ( bestbest_prot_r )      //
229229   AM_RANGE( 0x540000, 0x540fff ) AM_READWRITE( suna16_paletteram16_r, suna16_paletteram16_w )   // Banked(?) Palette
230230   AM_RANGE( 0x541000, 0x54ffff ) AM_RAM                                          //
231231   AM_RANGE( 0x580000, 0x58ffff ) AM_RAM                     // RAM
r3115r3116
475475***************************************************************************/
476476
477477#define JOY(_n_) \
478   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP     ) PORT_PLAYER(_n_) \
479   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN   ) PORT_PLAYER(_n_) \
480   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT   ) PORT_PLAYER(_n_) \
481   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT  ) PORT_PLAYER(_n_) \
482   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1        ) PORT_PLAYER(_n_) \
483   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2        ) PORT_PLAYER(_n_) \
484   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3        ) PORT_PLAYER(_n_) \
485   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START##_n_                   )
478   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(_n_)    \
479   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(_n_)  \
480   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(_n_)  \
481   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(_n_) \
482   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(_n_)        \
483   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(_n_)        \
484   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(_n_)        \
485   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START##_n_ )
486486
487487
488488/***************************************************************************
r3115r3116
490490***************************************************************************/
491491
492492static INPUT_PORTS_START( bssoccer )
493
494   PORT_START("P1")   // IN0 - $a00001.b - Player 1
493   PORT_START("P1")   /* $a00001.b */
495494   JOY(1)
496495
497   PORT_START("P2")   // IN1 - $a00003.b - Player 2
496   PORT_START("P2")   /* $a00003.b */
498497   JOY(2)
499498
500   PORT_START("P3")   // IN2 - $a00005.b - Player 3
499   PORT_START("P3")   /* $a00005.b */
501500   JOY(3)
502501
503   PORT_START("P4")   // IN3 - $a00007.b - Player 4
502   PORT_START("P4")   /* $a00007.b */
504503   JOY(4)
505504
506   PORT_START("DSW1")   // IN4 - $a00008.w - DSW x 2
505   PORT_START("DSW1")   /* $a00008.w */
507506   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) )
508507   PORT_DIPSETTING(     0x0000, DEF_STR( 4C_1C ) )
509508   PORT_DIPSETTING(     0x0001, DEF_STR( 3C_1C ) )
r3115r3116
514513   PORT_DIPSETTING(     0x0004, DEF_STR( 1C_4C ) )
515514   PORT_DIPSETTING(     0x0003, DEF_STR( 1C_5C ) )
516515   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) )
517   PORT_DIPSETTING(     0x0010, DEF_STR( Easy )     )
518   PORT_DIPSETTING(     0x0018, DEF_STR( Normal )   )
519   PORT_DIPSETTING(     0x0008, DEF_STR( Hard )     )
516   PORT_DIPSETTING(     0x0010, DEF_STR( Easy ) )
517   PORT_DIPSETTING(     0x0018, DEF_STR( Normal ) )
518   PORT_DIPSETTING(     0x0008, DEF_STR( Hard ) )
520519   PORT_DIPSETTING(     0x0000, "Hardest?"  )
521520   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
522521   PORT_DIPSETTING(     0x0000, DEF_STR( Off ) )
r3115r3116
547546   PORT_DIPSETTING(     0x4000, "2:00" )
548547   PORT_DIPSETTING(     0x0000, "2:15" )
549548
550   PORT_START("DSW2")   // IN5 - $a0000b.b - Coins
549   PORT_START("DSW2")   /* $a0000b.b */
551550   PORT_DIPNAME( 0x0001, 0x0001, "Copyright" )         // these 4 are shown in test mode
552551   PORT_DIPSETTING(     0x0001, "Distributer Unico" )
553552   PORT_DIPSETTING(     0x0000, "All Rights Reserved" )
r3115r3116
560559   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
561560   PORT_DIPSETTING(     0x0008, DEF_STR( Off ) )
562561   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
563   PORT_BIT(  0x0010, IP_ACTIVE_LOW,  IPT_COIN1   )
564   PORT_BIT(  0x0020, IP_ACTIVE_LOW,  IPT_COIN2   )
565   PORT_BIT(  0x0040, IP_ACTIVE_LOW,  IPT_COIN3   )
566   PORT_BIT(  0x0080, IP_ACTIVE_LOW,  IPT_COIN4   )
567
562   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN1 )
563   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN2 )
564   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN3 )
565   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN4 )
568566INPUT_PORTS_END
569567
570568
r3115r3116
573571***************************************************************************/
574572
575573static INPUT_PORTS_START( uballoon )
574   PORT_START("P1")   /* $600000.w */
575   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
576   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
577   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
578   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
579   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
580   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
581   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
582   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
583   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
584   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
585   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
586   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
587   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE1 )
588   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
589   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START1 )
590   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 )
576591
577   PORT_START("P1")   // IN0 - $600000.w - Player 1
578   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
579   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
580   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
581   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
582   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
583   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
584   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN  )
585   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
586   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN  )
587   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN  )
588   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN  )
589   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN  )
590   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_SERVICE1 )
591   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
592   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_START1   )
593   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_COIN1    )
594
595   PORT_START("P2")   // IN1 - $600002.w - Player 2
596   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
597   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
598   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
599   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
600   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
601   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
602   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN  )
603   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
604   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN  )
605   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN  )
606   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN  )
607   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN  )
592   PORT_START("P2")   /* $600002.w */
593   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
594   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
595   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
596   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
597   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
598   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
599   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
600   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
601   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
602   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
603   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
604   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
608605   PORT_DIPNAME( 0x3000, 0x3000, "Copyright" )   // Jumpers
609606   PORT_DIPSETTING(     0x3000, "Distributer Unico" )
610607   PORT_DIPSETTING(     0x2000, "All Rights Reserved" )
611608//  PORT_DIPSETTING(      0x1000, "Distributer Unico" )
612609//  PORT_DIPSETTING(      0x0000, "All Rights Reserved" )
613   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_START2   )
614   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_COIN2    )
610   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START2 )
611   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2 )
615612
616   PORT_START("DSW1")   // IN2 - $600005.b - DSW 1
613   PORT_START("DSW1")   /* $600005.b */
617614   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) )
618615   PORT_DIPSETTING(     0x0000, DEF_STR( 5C_1C ) )
619616   PORT_DIPSETTING(     0x0001, DEF_STR( 4C_1C ) )
r3115r3116
629626   PORT_DIPSETTING(     0x0008, "4" )
630627   PORT_DIPSETTING(     0x0000, "5" )
631628   PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )
632   PORT_DIPSETTING(     0x0040, DEF_STR( Easy )    )
629   PORT_DIPSETTING(     0x0040, DEF_STR( Easy ) )
633630   PORT_DIPSETTING(     0x0060, DEF_STR( Normal )  )
634   PORT_DIPSETTING(     0x0020, DEF_STR( Hard )    )
631   PORT_DIPSETTING(     0x0020, DEF_STR( Hard ) )
635632   PORT_DIPSETTING(     0x0000, DEF_STR( Hardest ) )
636633   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
637634
638   PORT_START("DSW2")   // IN3 - $600007.b - DSW 2
635   PORT_START("DSW2")   /* $600007.b */
639636   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
640637   PORT_DIPSETTING(     0x0001, DEF_STR( Off ) )
641638   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
r3115r3116
660657   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Demo_Sounds ) )
661658   PORT_DIPSETTING(     0x0080, DEF_STR( Off ) )
662659   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
663
664660INPUT_PORTS_END
665661
666662/***************************************************************************
r3115r3116
668664***************************************************************************/
669665
670666static INPUT_PORTS_START( sunaq )
671   PORT_START("P1")   // Player 1
672   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
673   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
674   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
675   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
676   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
677   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
678   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_START1   )
679   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_COIN1    )
667   PORT_START("P1")
668   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
669   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
670   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
671   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
672   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
673   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
674   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_START1 )
675   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN1 )
680676
681677
682   PORT_START("P2")   // Player 2
683   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
684   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
685   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
686   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
687   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
688   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
689   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_START2   )
690   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_COIN2    )
678   PORT_START("P2")
679   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
680   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
681   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
682   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
683   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
684   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
685   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_START2 )
686   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN2 )
691687
692   PORT_START("DSW1")   // Single 8 switch DSW
688   PORT_START("DSW1")
693689   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) )
694690   PORT_DIPSETTING(     0x0000, DEF_STR( 5C_1C ) )
695691   PORT_DIPSETTING(     0x0001, DEF_STR( 4C_1C ) )
r3115r3116
713709    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
714710    PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
715711    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
712
713   PORT_START("DSW2") /* Unused? */
716714INPUT_PORTS_END
717715
718716/***************************************************************************
r3115r3116
720718***************************************************************************/
721719
722720static INPUT_PORTS_START( bestbest )
723   PORT_START("P1")   // IN0 - 500000.w - Player 1
724   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP      ) PORT_PLAYER(1)
725   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN      ) PORT_PLAYER(1)
726   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT      ) PORT_PLAYER(1)
727   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_PLAYER(1)
728   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1         ) PORT_PLAYER(1)
729   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2         ) PORT_PLAYER(1)
730   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3         ) PORT_PLAYER(1)
731   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN         )
732   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN         )
733   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_BUTTON4         ) PORT_PLAYER(1)
734   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_BUTTON5         ) PORT_PLAYER(1)
735   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_BUTTON6         ) PORT_PLAYER(1)
736   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN         )
737   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN         )
738   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_START1         )
739   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_COIN1            )
721   PORT_START("P1")   /* 500000.w */
722   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
723   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
724   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
725   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_PLAYER(1)
726   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
727   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
728   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
729   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
730   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
731   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
732   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
733   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
734   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
735   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
736   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START1 )
737   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 )
740738
741   PORT_START("P2")   // IN1 - 500002.w - Player 2
742   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP      ) PORT_PLAYER(2)
743   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN      ) PORT_PLAYER(2)
744   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT      ) PORT_PLAYER(2)
745   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_PLAYER(2)
746   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1         ) PORT_PLAYER(2)
747   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2         ) PORT_PLAYER(2)
748   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3         ) PORT_PLAYER(2)
749   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN         )
750   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN         )
751   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_BUTTON4         ) PORT_PLAYER(2)
752   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_BUTTON5         ) PORT_PLAYER(2)
753   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_BUTTON6         ) PORT_PLAYER(2)
754   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN         )
755   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN         )
756   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_START2         )
757   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_COIN2            )
739   PORT_START("P2")   /* 500002.w */
740   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
741   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
742   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
743   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_PLAYER(2)
744   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
745   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
746   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
747   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
748   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
749   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
750   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
751   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
752   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
753   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
754   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START2 )
755   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2 )
758756
759   PORT_START("DSW1")   // IN2 - 500004.w - DSW x 2
757   PORT_START("DSW")   /* 500004.w */
760758   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) )
761759   PORT_DIPSETTING(     0x0000, DEF_STR( 5C_1C ) )
762760   PORT_DIPSETTING(     0x0001, DEF_STR( 4C_1C ) )
r3115r3116
767765   PORT_DIPSETTING(     0x0005, DEF_STR( 1C_3C ) )
768766   PORT_DIPSETTING(     0x0004, DEF_STR( 1C_4C ) )
769767   PORT_DIPNAME( 0x0018, 0x0010, DEF_STR( Difficulty ) )
770   PORT_DIPSETTING(     0x0018, DEF_STR( Easy )   )
771   PORT_DIPSETTING(     0x0010, DEF_STR( Normal )     )
772   PORT_DIPSETTING(     0x0008, DEF_STR( Hard )     )
773   PORT_DIPSETTING(     0x0000, DEF_STR( Hardest )     )
768   PORT_DIPSETTING(     0x0018, DEF_STR( Easy ) )
769   PORT_DIPSETTING(     0x0010, DEF_STR( Normal ) )
770   PORT_DIPSETTING(     0x0008, DEF_STR( Hard ) )
771   PORT_DIPSETTING(     0x0000, DEF_STR( Hardest ) )
774772   PORT_DIPNAME( 0x0020, 0x0020, "Display Combos" )
775773   PORT_DIPSETTING(     0x0000, DEF_STR( Off ) )
776774   PORT_DIPSETTING(     0x0020, DEF_STR( On ) )
src/mame/drivers/speedbal.c
r3115r3116
8383
8484static ADDRESS_MAP_START( main_cpu_io_map, ADDRESS_SPACE_IO, 8 )
8585   ADDRESS_MAP_GLOBAL_MASK(0xff)
86   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
87   AM_RANGE(0x10, 0x10) AM_READ(input_port_1_r)
88   AM_RANGE(0x20, 0x20) AM_READ(input_port_2_r)
89   AM_RANGE(0x30, 0x30) AM_READ(input_port_3_r)
86   AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW2")
87   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1")
88   AM_RANGE(0x20, 0x20) AM_READ_PORT("P1")
89   AM_RANGE(0x30, 0x30) AM_READ_PORT("P2")
9090   AM_RANGE(0x40, 0x40) AM_WRITE(speedbal_coincounter_w)
9191   AM_RANGE(0x50, 0x50) AM_WRITENOP
9292ADDRESS_MAP_END
r3115r3116
110110
111111
112112static INPUT_PORTS_START( speedbal )
113   PORT_START("DSW2")      /* DSW2 */
113   PORT_START("DSW1")
114   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) )
115   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) )
116   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
117   PORT_DIPSETTING(    0x01, DEF_STR( 1C_4C ) )
118   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
119   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) )
120   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
121   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
122   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
123   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
124   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
125   PORT_DIPSETTING(    0x00, "2" )
126   PORT_DIPSETTING(    0x30, "3" )
127   PORT_DIPSETTING(    0x20, "4" )
128   PORT_DIPSETTING(    0x10, "5" )
129   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
130   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
131   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
132   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
133   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
134   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
135
136   PORT_START("DSW2")
114137   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Bonus_Life ) )
115138   PORT_DIPSETTING(    0x06, "70000 200000 1M" )
116139   PORT_DIPSETTING(    0x07, "70000 200000" )
r3115r3116
134157   PORT_DIPSETTING(    0x40, "Difficult" )
135158   PORT_DIPSETTING(    0x00, "Very Difficult" )
136159
137   PORT_START("DSW1")      /* DSW1 */
138   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) )
139   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) )
140   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
141   PORT_DIPSETTING(    0x01, DEF_STR( 1C_4C ) )
142   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
143   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) )
144   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
145   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
146   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
147   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
148   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
149   PORT_DIPSETTING(    0x00, "2" )
150   PORT_DIPSETTING(    0x30, "3" )
151   PORT_DIPSETTING(    0x20, "4" )
152   PORT_DIPSETTING(    0x10, "5" )
153   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
154   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
155   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
156   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
157   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
158   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
159
160160   PORT_START("P1")
161161   PORT_BIT( 0x01, IP_ACTIVE_LOW , IPT_BUTTON1 )
162162   PORT_BIT( 0x02, IP_ACTIVE_LOW , IPT_BUTTON2 )
src/mame/drivers/tagteam.c
r3115r3116
5353
5454static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
5555   AM_RANGE(0x0000, 0x07ff) AM_RAM
56   AM_RANGE(0x2000, 0x2000) AM_READWRITE(input_port_1_r, tagteam_flipscreen_w)
57   AM_RANGE(0x2001, 0x2001) AM_READWRITE(input_port_0_r, tagteam_control_w)
58   AM_RANGE(0x2002, 0x2002) AM_READWRITE(input_port_2_r, sound_command_w)
59   AM_RANGE(0x2003, 0x2003) AM_READ(input_port_3_r)     /* DSW1 */
56   AM_RANGE(0x2000, 0x2000) AM_READ_PORT("P2") AM_WRITE(tagteam_flipscreen_w)
57   AM_RANGE(0x2001, 0x2001) AM_READ_PORT("P1") AM_WRITE(tagteam_control_w)
58   AM_RANGE(0x2002, 0x2002) AM_READ_PORT("DSW1") AM_WRITE(sound_command_w)
59   AM_RANGE(0x2003, 0x2003) AM_READ_PORT("DSW2")
6060//  AM_RANGE(0x2003, 0x2003) AM_WRITE(SMH_NOP) /* Appears to increment when you're out of the ring */
6161   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(tagteam_mirrorvideoram_r, tagteam_mirrorvideoram_w)
6262   AM_RANGE(0x4400, 0x47ff) AM_READWRITE(tagteam_mirrorcolorram_r, tagteam_mirrorcolorram_w)
r3115r3116
8484   static int coin;
8585   int port;
8686
87   port = input_port_read(machine, "IN0") & 0xc0;
87   port = input_port_read(machine, "P1") & 0xc0;
8888
8989   if (port != 0xc0)    /* Coin */
9090   {
r3115r3116
9797   else coin = 0;
9898}
9999
100#define TAGTEAM_PLAYERS\
101   PORT_START("IN0")\
102   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY\
103   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY\
104   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY\
105   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY\
106   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )\
107   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )\
108   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )\
109   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )\
110   PORT_START("IN1")\
111   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL\
112   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL\
113   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL\
114   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL\
115   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL\
116   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL\
117   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )\
118   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
119
120100static INPUT_PORTS_START( bigprowr )
121   TAGTEAM_PLAYERS
101   PORT_START("P1")
102   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
103   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
104   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
105   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
106   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
107   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
108   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
109   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
122110
111   PORT_START("P2")
112   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
113   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
114   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
115   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
116   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
117   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
118   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
119   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
120
123121   PORT_START("DSW1")
124122   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
125123   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
r3115r3116
170168
171169/* Same as 'bigprowr', but additional "Coin Mode" Dip Switch */
172170static INPUT_PORTS_START( tagteam )
173   TAGTEAM_PLAYERS
174   PORT_START("DSW1")
171   PORT_INCLUDE( bigprowr )
172
173   PORT_MODIFY("DSW1")
175174   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
176175   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
177176   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
178177   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
179   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )PORT_CONDITION("DSW2",0xe0,PORTCOND_NOTEQUALS,0x80) //Mode 1
180   PORT_DIPSETTING(    0x01, DEF_STR( 1C_6C ) )PORT_CONDITION("DSW2",0xe0,PORTCOND_EQUALS,0x80) //Mode 2
178   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2", 0xe0, PORTCOND_NOTEQUALS, 0x80)   //Mode 1
179   PORT_DIPSETTING(    0x01, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2", 0xe0, PORTCOND_EQUALS, 0x80)   //Mode 2
181180   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
182181   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
183182   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
184183   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
185   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )PORT_CONDITION("DSW2",0xe0,PORTCOND_NOTEQUALS,0x80) //Mode 1
186   PORT_DIPSETTING(    0x04, DEF_STR( 1C_6C ) )PORT_CONDITION("DSW2",0xe0,PORTCOND_EQUALS,0x80) //Mode 2
187   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) )
188   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
189   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
190   PORT_DIPNAME( 0x60, 0x00, DEF_STR( Cabinet ) )
191   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )         // "Upright, Single Controls"
192   PORT_DIPSETTING(    0x40, "Upright, Dual Controls" )
193//  PORT_DIPSETTING(    0x20, "Cocktail, Single Controls" ) // IMPOSSIBLE !
194   PORT_DIPSETTING(    0x60, DEF_STR( Cocktail ) )         // "Cocktail, Dual Controls"
195   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
184   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW2", 0xe0, PORTCOND_NOTEQUALS, 0x80)   //Mode 1
185   PORT_DIPSETTING(    0x04, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW2", 0xe0, PORTCOND_EQUALS, 0x80)   //Mode 2
196186
197   PORT_START("DSW2")
198   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Difficulty ) )
199   PORT_DIPSETTING(    0x01, DEF_STR( Normal ) )
200   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
201   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
202   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
203   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
204   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
205   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
206   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
207   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
208   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
209   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
210   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) )
211   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
212   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
187   PORT_MODIFY("DSW2")
213188   PORT_DIPNAME( 0xe0, 0x00, "Coin Mode" )            // Check code at 0xff5c
214189   PORT_DIPSETTING(    0x00, "Mode 1" )
215190   PORT_DIPSETTING(    0x80, "Mode 2" )
src/mame/drivers/hikaru.c
r3115r3116
276276INPUT_PORTS_END
277277
278278static ADDRESS_MAP_START( hikaru_map, ADDRESS_SPACE_PROGRAM, 64 )
279   AM_RANGE(0x00000000, 0x001fffff) AM_ROM
280   AM_RANGE(0x0C000000, 0x0C00ffff) AM_RAM
279   AM_RANGE(0x00000000, 0x001FFFFF) AM_ROM AM_SHARE(1)
280   AM_RANGE(0x00400000, 0x004000FF) AM_NOP // unknown
281   AM_RANGE(0x00800000, 0x008000FF) AM_NOP // unknown
282   AM_RANGE(0x00830000, 0x00831FFF) AM_NOP // unknown
283   AM_RANGE(0x00838000, 0x008380ff) AM_NOP // unknown
284   AM_RANGE(0x0082F000, 0x0082F0ff) AM_NOP // unknown
285   AM_RANGE(0x00C00000, 0x00C002FF) AM_RAM // unknown nvram?
286   AM_RANGE(0x01000000, 0x010001FF) AM_NOP // unknown
287   AM_RANGE(0x02000000, 0x020000FF) AM_NOP // unknown
288   AM_RANGE(0x02710000, 0x027100FF) AM_NOP // unknown
289   AM_RANGE(0x03000000, 0x030000FF) AM_NOP // unknown
290   AM_RANGE(0x04000000, 0x040000FF) AM_NOP // unknown
291   AM_RANGE(0x0C000000, 0x0DFFFFFF) AM_RAM
292   AM_RANGE(0x14000000, 0x140000FF) AM_NOP // unknown
293   AM_RANGE(0x14004000, 0x140041FF) AM_RAM // unknown
294   AM_RANGE(0x15000000, 0x150000FF) AM_NOP // unknown
295   AM_RANGE(0x16001000, 0x160010FF) AM_RAM // unknown
296   AM_RANGE(0x1A000000, 0x1A0000FF) AM_NOP // unknown
281297ADDRESS_MAP_END
282298
299static ADDRESS_MAP_START( hikaru_map_slave, ADDRESS_SPACE_PROGRAM, 64 )
300   ADDRESS_MAP_UNMAP_HIGH
301   AM_RANGE(0x00000000, 0x001FFFFF) AM_ROM AM_SHARE(1)
302   AM_RANGE(0x0C000000, 0x0DFFFFFF) AM_RAM
303   AM_RANGE(0x10000000, 0x100000FF) AM_RAM
304   AM_RANGE(0x1A800000, 0x1A8000FF) AM_RAM
305   AM_RANGE(0x1B000000, 0x1B0001FF) AM_RAM
306ADDRESS_MAP_END
283307
308
284309static MACHINE_DRIVER_START( hikaru )
285310   /* basic machine hardware */
286311   MDRV_CPU_ADD("main", SH4, CPU_CLOCK)
r3115r3116
288313   MDRV_CPU_PROGRAM_MAP(hikaru_map,0)
289314//  MDRV_CPU_IO_MAP(hikaru_port,0)
290315//  MDRV_CPU_VBLANK_INT("main", hikaru,vblank)
316   MDRV_CPU_ADD("slave", SH4, CPU_CLOCK)
317   MDRV_CPU_PROGRAM_MAP(hikaru_map_slave,0)
291318
292319//  MDRV_MACHINE_START( hikaru )
293320//  MDRV_MACHINE_RESET( hikaru )
src/mame/drivers/namcos23.c
r3115r3116
831831   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
832832   AM_RANGE(0x080000, 0x08ffff) AM_READWRITE( sharedram_sub_r, sharedram_sub_w )
833833   AM_RANGE(0x280000, 0x287fff) AM_READWRITE( c352_0_r, c352_0_w )
834   AM_RANGE(0x300000, 0x300001) AM_READNOP //( input_port_1_word_r )
835   AM_RANGE(0x300002, 0x300003) AM_READNOP //( input_port_2_word_r )
834   AM_RANGE(0x300000, 0x300001) AM_READNOP //AM_READ_PORT("IN1")
835   AM_RANGE(0x300002, 0x300003) AM_READNOP //AM_READ_PORT("IN2")
836836   AM_RANGE(0x300010, 0x300011) AM_NOP
837837   AM_RANGE(0x300030, 0x300031) AM_NOP
838838ADDRESS_MAP_END
src/mame/drivers/tattack.c
r3115r3116
5656   AM_RANGE(0x0000, 0x0fff) AM_ROM
5757//  AM_RANGE(0x4000, 0x4000) AM_READNOP $315
5858   AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE(&videoram)
59   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE(&colorram) //color map ? something else .. only bits 1-3 are used
60   AM_RANGE(0x6000, 0x6000) AM_READ(input_port_2_r)
61   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_1_r)  //dsw ? something else ?
62   AM_RANGE(0xc000, 0xc000) AM_READ(input_port_0_r)  AM_WRITENOP
63   AM_RANGE(0xc001, 0xc002) AM_WRITENOP //bit 7 = strobe ($302)
59   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE(&colorram)   // color map ? something else .. only bits 1-3 are used
60   AM_RANGE(0x6000, 0x6000) AM_READ_PORT("DSW2")
61   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("DSW1")      // dsw ? something else ?
62   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("INPUTS") AM_WRITENOP
63   AM_RANGE(0xc001, 0xc002) AM_WRITENOP            // bit 7 = strobe ($302)
6464   AM_RANGE(0xc005, 0xc007) AM_WRITENOP
6565   AM_RANGE(0xe000, 0xe3ff) AM_RAM
6666ADDRESS_MAP_END
r3115r3116
137137   PORT_DIPNAME( 0x80, 0x00, "DSW2 8" )
138138   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
139139   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
140
141140INPUT_PORTS_END
142141
143142
src/mame/drivers/skydiver.c
r3115r3116
199199   AM_RANGE(0x1008, 0x100b) AM_MIRROR(0x47f0) AM_WRITE(skydiver_whistle_w)
200200   AM_RANGE(0x100c, 0x100d) AM_MIRROR(0x47f0) AM_WRITE(skydiver_nmion_w)
201201   AM_RANGE(0x100e, 0x100f) AM_MIRROR(0x47f0) AM_WRITE(skydiver_width_w)
202   AM_RANGE(0x1800, 0x1800) AM_MIRROR(0x47e0) AM_READ(input_port_0_r)
203   AM_RANGE(0x1801, 0x1801) AM_MIRROR(0x47e0) AM_READ(input_port_1_r)
204   AM_RANGE(0x1802, 0x1802) AM_MIRROR(0x47e0) AM_READ(input_port_2_r)
205   AM_RANGE(0x1803, 0x1803) AM_MIRROR(0x47e0) AM_READ(input_port_3_r)
206   AM_RANGE(0x1804, 0x1804) AM_MIRROR(0x47e0) AM_READ(input_port_4_r)
207   AM_RANGE(0x1805, 0x1805) AM_MIRROR(0x47e0) AM_READ(input_port_5_r)
208   AM_RANGE(0x1806, 0x1806) AM_MIRROR(0x47e0) AM_READ(input_port_6_r)
209   AM_RANGE(0x1807, 0x1807) AM_MIRROR(0x47e0) AM_READ(input_port_7_r)
210   AM_RANGE(0x1808, 0x1808) AM_MIRROR(0x47e4) AM_READ(input_port_8_r)
211   AM_RANGE(0x1809, 0x1809) AM_MIRROR(0x47e4) AM_READ(input_port_9_r)
212   AM_RANGE(0x180a, 0x180a) AM_MIRROR(0x47e4) AM_READ(input_port_10_r)
213   AM_RANGE(0x180b, 0x180b) AM_MIRROR(0x47e4) AM_READ(input_port_11_r)
214   AM_RANGE(0x1810, 0x1810) AM_MIRROR(0x47e4) AM_READ(input_port_12_r)
215   AM_RANGE(0x1811, 0x1811) AM_MIRROR(0x47e4) AM_READ(input_port_13_r)
202   AM_RANGE(0x1800, 0x1800) AM_MIRROR(0x47e0) AM_READ_PORT("IN0")
203   AM_RANGE(0x1801, 0x1801) AM_MIRROR(0x47e0) AM_READ_PORT("IN1")
204   AM_RANGE(0x1802, 0x1802) AM_MIRROR(0x47e0) AM_READ_PORT("IN2")
205   AM_RANGE(0x1803, 0x1803) AM_MIRROR(0x47e0) AM_READ_PORT("IN3")
206   AM_RANGE(0x1804, 0x1804) AM_MIRROR(0x47e0) AM_READ_PORT("IN4")
207   AM_RANGE(0x1805, 0x1805) AM_MIRROR(0x47e0) AM_READ_PORT("IN5")
208   AM_RANGE(0x1806, 0x1806) AM_MIRROR(0x47e0) AM_READ_PORT("IN6")
209   AM_RANGE(0x1807, 0x1807) AM_MIRROR(0x47e0) AM_READ_PORT("IN7")
210   AM_RANGE(0x1808, 0x1808) AM_MIRROR(0x47e4) AM_READ_PORT("IN8")
211   AM_RANGE(0x1809, 0x1809) AM_MIRROR(0x47e4) AM_READ_PORT("IN9")
212   AM_RANGE(0x180a, 0x180a) AM_MIRROR(0x47e4) AM_READ_PORT("IN10")
213   AM_RANGE(0x180b, 0x180b) AM_MIRROR(0x47e4) AM_READ_PORT("IN11")
214   AM_RANGE(0x1810, 0x1810) AM_MIRROR(0x47e4) AM_READ_PORT("IN12")
215   AM_RANGE(0x1811, 0x1811) AM_MIRROR(0x47e4) AM_READ_PORT("IN13")
216216   AM_RANGE(0x2000, 0x201f) AM_MIRROR(0x47e0) AM_READWRITE(watchdog_reset_r, skydiver_2000_201F_w)
217217   AM_RANGE(0x2800, 0x2fff) AM_MIRROR(0x4000) AM_READ(SMH_ROM)
218218   AM_RANGE(0x3000, 0x37ff) AM_MIRROR(0x4000) AM_READ(SMH_ROM)
r3115r3116
229229 *************************************/
230230
231231static INPUT_PORTS_START( skydiver )
232   PORT_START("IN0") /* IN0 */
232   PORT_START("IN0")
233233   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
234234   PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
235235   PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
236236
237   PORT_START("IN1") /* IN1 */
237   PORT_START("IN1")
238238   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
239239   PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
240240   PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
241241
242   PORT_START("IN2") /* IN2 */
242   PORT_START("IN2")
243243   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
244244   PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )   /* Jump 1 */
245245   PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )   /* Chute 1 */
246246
247   PORT_START("IN3") /* IN3 */
247   PORT_START("IN3")
248248   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
249249   PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)   /* Jump 2 */
250250   PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)   /* Chute 2 */
251251
252   PORT_START("IN4") /* IN4 */
252   PORT_START("IN4")
253253   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
254254   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("(D) OPT SW NEXT TEST") PORT_CODE(KEYCODE_D)
255255   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("(F) OPT SW") PORT_CODE(KEYCODE_F)
256256
257   PORT_START("IN5") /* IN5 */
257   PORT_START("IN5")
258258   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
259259   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("(E) OPT SW") PORT_CODE(KEYCODE_E)
260260   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("(H) OPT SW DIAGNOSTICS") PORT_CODE(KEYCODE_H)
261261
262   PORT_START("IN6") /* IN6 */
262   PORT_START("IN6")
263263   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
264264   PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_START1 )
265265   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
266266
267   PORT_START("IN7") /* IN7 */
267   PORT_START("IN7")
268268   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
269269   PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_START2 )
270270   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1)
271271
272   PORT_START("IN8") /* IN8 */
272   PORT_START("IN8")
273273   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
274274   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Lives ) )
275275   PORT_DIPSETTING(    0x00, "3" )
r3115r3116
277277   PORT_DIPSETTING(    0x80, "5" )
278278   PORT_DIPSETTING(    0xc0, "6" )
279279
280   PORT_START("IN9") /* IN9 */
280   PORT_START("IN9")
281281   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
282282   PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Coinage ) )
283283   PORT_DIPSETTING(    0xc0, DEF_STR( 2C_1C ) )
r3115r3116
285285   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
286286   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
287287
288   PORT_START("IN10") /* IN10 */
288   PORT_START("IN10")
289289   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
290290   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) )
291291   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
r3115r3116
294294   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
295295   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
296296
297   PORT_START("IN11") /* IN11 */
297   PORT_START("IN11")
298298   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
299299   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Language ) )
300300   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
r3115r3116
302302   PORT_DIPSETTING(    0x80, DEF_STR( Spanish ) )
303303   PORT_DIPSETTING(    0xc0, DEF_STR( German ) )
304304
305   PORT_START("IN12") /* IN12 */
305   PORT_START("IN12")
306306   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
307307   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
308308   PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_VBLANK )
309309
310   PORT_START("IN13") /* IN13 */
310   PORT_START("IN13")
311311   PORT_BIT (0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
312312   PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_TILT )
313313   PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/spacefb.c
r3115r3116
106106
107107#include "driver.h"
108108#include "spacefb.h"
109#include "cpu/i8039/i8039.h"
109#include "cpu/mcs48/mcs48.h"
110110#include "sound/dac.h"
111111
112112
r3115r3116
213213
214214static ADDRESS_MAP_START( spacefb_main_io_map, ADDRESS_SPACE_IO, 8 )
215215   ADDRESS_MAP_GLOBAL_MASK(0x7)
216   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
217   AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r)
218   AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r)
219   AM_RANGE(0x03, 0x03) AM_READ(input_port_3_r)
216   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
217   AM_RANGE(0x01, 0x01) AM_READ_PORT("P2")
218   AM_RANGE(0x02, 0x02) AM_READ_PORT("SYSTEM")
219   AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW")
220220   AM_RANGE(0x04, 0x07) AM_READNOP  /* yes, this is correct (1-of-8 decoder) */
221221
222222   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_WRITE(spacefb_port_0_w)
r3115r3116
227227
228228
229229static ADDRESS_MAP_START( spacefb_audio_io_map, ADDRESS_SPACE_IO, 8 )
230   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(dac_0_data_w)
231   AM_RANGE(I8039_p2, I8039_p2) AM_READ(spacefb_audio_p2_r)
232   AM_RANGE(I8039_t0, I8039_t0) AM_READ(spacefb_audio_t0_r)
233   AM_RANGE(I8039_t1, I8039_t1) AM_READ(spacefb_audio_t1_r)
230   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(dac_0_data_w)
231   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(spacefb_audio_p2_r)
232   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(spacefb_audio_t0_r)
233   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(spacefb_audio_t1_r)
234234ADDRESS_MAP_END
235235
236236
r3115r3116
242242 *************************************/
243243
244244static INPUT_PORTS_START( spacefb )
245   PORT_START("P1")      /* IN0 */
245   PORT_START("P1")
246246   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
247247   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
248248   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
r3115r3116
252252   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
253253   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 )
254254
255   PORT_START("P2")      /* IN1 */
255   PORT_START("P2")
256256   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
257257   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
258258   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
r3115r3116
262262   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
263263   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
264264
265   PORT_START("SYSTEM")      /* Coin - Start */
265   PORT_START("SYSTEM")
266266   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
267267   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
268268   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
r3115r3116
272272   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE ) /* Test ? */
273273   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
274274
275   PORT_START("DSW")      /* DSW0 */
275   PORT_START("DSW")
276276   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW:1,2")
277277   PORT_DIPSETTING(    0x00, "3" )
278278   PORT_DIPSETTING(    0x01, "4" )
r3115r3116
295295
296296/* same as Space Firebird, except for the difficulty switch */
297297static INPUT_PORTS_START( spacedem )
298   PORT_START("P1")      /* IN0 */
299   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
300   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
301   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
302   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
303   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 )
304   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
305   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
306   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 )
298   PORT_INCLUDE( spacefb )
307299
308   PORT_START("P2")      /* IN1 */
309   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
310   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
311   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
312   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
313   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
314   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
315   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
316   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
317
318   PORT_START("SYSTEM")      /* Coin - Start */
319   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
320   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
321   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
322   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
323   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
324   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
325   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE ) /* Test ? */
326   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
327
328   PORT_START("DSW")      /* DSW0 */
300   PORT_MODIFY("DSW")
329301   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )
330302   PORT_DIPSETTING(    0x00, "3" )
331303   PORT_DIPSETTING(    0x01, "4" )
src/mame/drivers/onetwo.c
r3115r3116
116116
117117static ADDRESS_MAP_START( main_cpu_io, ADDRESS_SPACE_IO, 8 )
118118   ADDRESS_MAP_GLOBAL_MASK(0xff)
119   AM_RANGE(0x00, 0x00) AM_READWRITE(input_port_0_r, onetwo_coin_counters_w)
120   AM_RANGE(0x01, 0x01) AM_READWRITE(input_port_1_r, onetwo_soundlatch_w)
121   AM_RANGE(0x02, 0x02) AM_READWRITE(input_port_2_r, onetwo_cpubank_w)
122   AM_RANGE(0x03, 0x03) AM_READ(input_port_3_r)
123   AM_RANGE(0x04, 0x04) AM_READ(input_port_4_r)
119   AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW1") AM_WRITE(onetwo_coin_counters_w)
120   AM_RANGE(0x01, 0x01) AM_READ_PORT("DSW2") AM_WRITE(onetwo_soundlatch_w)
121   AM_RANGE(0x02, 0x02) AM_READ_PORT("P1") AM_WRITE(onetwo_cpubank_w)
122   AM_RANGE(0x03, 0x03) AM_READ_PORT("P2")
123   AM_RANGE(0x04, 0x04) AM_READ_PORT("SYSTEM")
124124ADDRESS_MAP_END
125125
126126/* Sound CPU */
r3115r3116
206206   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
207207   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
208208
209   PORT_START("IN0")
209   PORT_START("P1")
210210   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
211211   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
212212   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
r3115r3116
216216   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
217217   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
218218
219   PORT_START("IN1")
219   PORT_START("P2")
220220   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
221221   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
222222   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
r3115r3116
226226   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
227227   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
228228
229   PORT_START("COIN")
229   PORT_START("SYSTEM")
230230   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
231231   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
232232   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
src/mame/drivers/ojankohs.c
r3115r3116
282282
283283static ADDRESS_MAP_START( readport_ojankohs, ADDRESS_SPACE_IO, 8 )
284284   ADDRESS_MAP_GLOBAL_MASK(0xff)
285   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
285   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
286286   AM_RANGE(0x01, 0x01) AM_READ(ojankohs_keymatrix_r)
287   AM_RANGE(0x02, 0x02) AM_READ(input_port_1_r)
287   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1")
288288   AM_RANGE(0x06, 0x06) AM_READ(ay8910_read_port_0_r)
289289ADDRESS_MAP_END
290290
r3115r3116
315315
316316static ADDRESS_MAP_START( readport_ccasino, ADDRESS_SPACE_IO, 8 )
317317   ADDRESS_MAP_GLOBAL_MASK(0xff)
318   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
318   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
319319   AM_RANGE(0x01, 0x01) AM_READ(ojankohs_keymatrix_r)
320   AM_RANGE(0x02, 0x02) AM_READ(input_port_1_r)
320   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1")
321321   AM_RANGE(0x03, 0x03) AM_READ(ccasino_dipsw3_r)
322322   AM_RANGE(0x04, 0x04) AM_READ(ccasino_dipsw4_r)
323323   AM_RANGE(0x06, 0x06) AM_READ(ay8910_read_port_0_r)
r3115r3116
355355ADDRESS_MAP_END
356356
357357static INPUT_PORTS_START( mahjong_p1 )
358   PORT_START("KEY0")   /* (4) PORT 1-0 */
358   PORT_START("KEY0")   /* PORT 1-0 */
359359   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
360360   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )
361361   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )
r3115r3116
365365   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
366366   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
367367
368   PORT_START("KEY1")   /* (5) PORT 1-1 */
368   PORT_START("KEY1")   /* PORT 1-1 */
369369   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
370370   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
371371   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )
r3115r3116
375375   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
376376   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
377377
378   PORT_START("KEY2")   /* (6) PORT 1-2 */
378   PORT_START("KEY2")   /* PORT 1-2 */
379379   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )
380380   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )
381381   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
r3115r3116
385385   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
386386   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
387387
388   PORT_START("KEY3")   /* (7) PORT 1-3 */
388   PORT_START("KEY3")   /* PORT 1-3 */
389389   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )
390390   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )
391391   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )
r3115r3116
395395   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
396396   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
397397
398   PORT_START("KEY4")   /* (8) PORT 1-4 */
398   PORT_START("KEY4")   /* PORT 1-4 */
399399   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )
400400   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )
401401   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )
r3115r3116
407407INPUT_PORTS_END
408408
409409static INPUT_PORTS_START( ojankohs )
410   PORT_START("IN0")   /* (0) TEST SW */
410   PORT_START("IN0")   /* TEST SW */
411411   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
412412   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
413413   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
414   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW)   // TEST
414   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW)      // TEST
415415   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
416416   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
417417   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
418418   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
419419
420   PORT_START("IN1")   /* (1) COIN SW */
420   PORT_START("IN1")   /* COIN SW */
421421   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
422422   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
423423   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
427427   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
428428   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
429429
430   PORT_START("DSW1")   /* (2) DIPSW-1 */
430   PORT_START("DSW1")
431431   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
432432   PORT_DIPSETTING(    0x07, "1 (Easy)" )
433433   PORT_DIPSETTING(    0x03, "2" )
r3115r3116
452452   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
453453   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
454454
455   PORT_START("DSW2")   /* (3) DIPSW-2 */
455   PORT_START("DSW2")
456456   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
457457   PORT_DIPNAME( 0x02, 0x02, "Opponent's initial score" )
458458   PORT_DIPSETTING (   0x02, "2000" )
r3115r3116
468468INPUT_PORTS_END
469469
470470static INPUT_PORTS_START( ojankoy )
471   PORT_START("IN0")   /* (0) TEST SW */
471   PORT_START("IN0")   /* TEST SW */
472472   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
473473   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
474474   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
475   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW)   // TEST
475   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW)      // TEST
476476   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
477477   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
478478   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
479479   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
480480
481   PORT_START("IN1")   /* (1) COIN SW */
481   PORT_START("IN1")   /* COIN SW */
482482   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
483483   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
484484   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
488488   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
489489   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
490490
491   PORT_START("DSW1")   /* (2) DIPSW-1 */
491   PORT_START("DSW1")
492492   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
493493   PORT_DIPSETTING(    0x07, "1 (Easy)" )
494494   PORT_DIPSETTING(    0x03, "2" )
r3115r3116
512512   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
513513   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
514514
515   PORT_START("DSW2")   /* (3) DIPSW-2 */
515   PORT_START("DSW2")
516516   PORT_DIPNAME( 0x03, 0x02, "Number of ending chance" )
517517   PORT_DIPSETTING(    0x03, "0" )
518518   PORT_DIPSETTING(    0x01, "3" )
r3115r3116
539539INPUT_PORTS_END
540540
541541static INPUT_PORTS_START( ccasino )
542   PORT_START("IN0")   /* (0) TEST SW */
542   PORT_START("IN0")   /* TEST SW */
543543   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
544544   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
545545   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
546   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW)   // TEST
546   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW)      // TEST
547547   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
548548   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
549549   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
550550   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
551551
552   PORT_START("IN1")   /* (1) COIN SW */
552   PORT_START("IN1")   /* COIN SW */
553553   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
554554   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
555555   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
559559   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
560560   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
561561
562   PORT_START("DSW1")   /* (2) DIPSW-1 */
562   PORT_START("DSW1")
563563   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
564564   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
565565   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
585585   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
586586   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
587587
588   PORT_START("DSW2")   /* (3) DIPSW-2 */
588   PORT_START("DSW2")
589589   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
590590   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
591591   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
613613
614614   PORT_INCLUDE( mahjong_p1 )
615615
616   PORT_START("DSW3")   /* (9) DIPSW-3 */
616   PORT_START("DSW3")
617617   PORT_DIPNAME( 0x01, 0x01, "DIPSW 3-1" )
618618   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
619619   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
639639   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
640640   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
641641
642   PORT_START("DSW4")   /* (10) DIPSW-4 */
642   PORT_START("DSW4")
643643   PORT_DIPNAME( 0x01, 0x01, "DIPSW 4-1" )
644644   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
645645   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
667667INPUT_PORTS_END
668668
669669static INPUT_PORTS_START( ojankoc )
670   PORT_START("DSW1")   /* DSW1 (0) */
670   PORT_START("DSW1")
671671   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
672672   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
673673   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
691691   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
692692   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
693693
694   PORT_START("DSW2")   /* DSW2 (1) */
694   PORT_START("DSW2")
695695   PORT_DIPNAME( 0x01, 0x01, "2-1" )
696696   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
697697   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
717717   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
718718   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
719719
720   PORT_START("KEY0")   /* (4) PORT 1-0 */
720   PORT_START("KEY0")   /* PORT 1-0 */
721721   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_A )
722722   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_E )
723723   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_I )
r3115r3116
727727   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
728728   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
729729
730   PORT_START("KEY1")   /* (5) PORT 1-1 */
730   PORT_START("KEY1")   /* PORT 1-1 */
731731   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_B )
732732   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_F )
733733   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_J )
r3115r3116
737737   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
738738   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
739739
740   PORT_START("KEY2")   /* (6) PORT 1-2 */
740   PORT_START("KEY2")   /* PORT 1-2 */
741741   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_C )
742742   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_G )
743743   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_K )
r3115r3116
747747   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
748748   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
749749
750   PORT_START("KEY3")   /* (7) PORT 1-3 */
750   PORT_START("KEY3")   /* PORT 1-3 */
751751   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_D )
752752   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_H )
753753   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_L )
r3115r3116
757757   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
758758   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
759759
760   PORT_START("KEY4")   /* (8) PORT 1-4 */
760   PORT_START("KEY4")   /* PORT 1-4 */
761761   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_LAST_CHANCE )
762762   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_SCORE )
763763   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_DOUBLE_UP )
r3115r3116
767767   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
768768   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
769769
770   PORT_START("KEY5")   /* (7) PORT 2-0 */
771   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_A )PORT_PLAYER(2)
772   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_E )PORT_PLAYER(2)
773   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_I )PORT_PLAYER(2)
774   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_M )PORT_PLAYER(2)
775   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN )PORT_PLAYER(2)
770   PORT_START("KEY5")   /* PORT 2-0 */
771   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) PORT_PLAYER(2)
772   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) PORT_PLAYER(2)
773   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) PORT_PLAYER(2)
774   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_M ) PORT_PLAYER(2)
775   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN ) PORT_PLAYER(2)
776776   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 )
777777   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
778778
779   PORT_START("KEY6")   /* (8) PORT 2-1 */
780   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_B )PORT_PLAYER(2)
781   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_F )PORT_PLAYER(2)
782   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_J )PORT_PLAYER(2)
783   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_N )PORT_PLAYER(2)
784   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH )PORT_PLAYER(2)
785   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_BET )PORT_PLAYER(2)
779   PORT_START("KEY6")   /* PORT 2-1 */
780   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) PORT_PLAYER(2)
781   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) PORT_PLAYER(2)
782   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) PORT_PLAYER(2)
783   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) PORT_PLAYER(2)
784   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) PORT_PLAYER(2)
785   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_BET ) PORT_PLAYER(2)
786786   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
787787
788   PORT_START("KEY7")   /* (9) PORT 2-2 */
789   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_C )PORT_PLAYER(2)
790   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_G )PORT_PLAYER(2)
791   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_K )PORT_PLAYER(2)
792   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI )PORT_PLAYER(2)
793   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_RON )PORT_PLAYER(2)
788   PORT_START("KEY7")   /* PORT 2-2 */
789   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) PORT_PLAYER(2)
790   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) PORT_PLAYER(2)
791   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) PORT_PLAYER(2)
792   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) PORT_PLAYER(2)
793   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) PORT_PLAYER(2)
794794   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
795795   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
796796
797   PORT_START("KEY8")   /* (10) PORT 2-3 */
798   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_D )PORT_PLAYER(2)
799   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_H )PORT_PLAYER(2)
800   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_L )PORT_PLAYER(2)
801   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_PON )PORT_PLAYER(2)
797   PORT_START("KEY8")   /* PORT 2-3 */
798   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) PORT_PLAYER(2)
799   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) PORT_PLAYER(2)
800   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) PORT_PLAYER(2)
801   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_PON ) PORT_PLAYER(2)
802802   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
803803   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
804804   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
805805
806   PORT_START("KEY9")   /* (11) PORT 2-4 */
807   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_LAST_CHANCE )PORT_PLAYER(2)
808   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_SCORE )PORT_PLAYER(2)
809   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_DOUBLE_UP )PORT_PLAYER(2)
810   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_FLIP_FLOP )PORT_PLAYER(2)
811   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_BIG )PORT_PLAYER(2)
812   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_SMALL )PORT_PLAYER(2)
806   PORT_START("KEY9")   /* PORT 2-4 */
807   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2)
808   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_SCORE ) PORT_PLAYER(2)
809   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2)
810   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2)
811   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_BIG ) PORT_PLAYER(2)
812   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_SMALL ) PORT_PLAYER(2)
813813   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
814814
815   PORT_START("IN0")   /* IN1 (12) */
815   PORT_START("IN0")
816816   PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_UNUSED )
817817   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
818818   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
819819
820   PORT_START("IN1")   /* IN2 (13) */
820   PORT_START("IN1")
821821   PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_UNUSED )
822822   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
823823   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
824
825824INPUT_PORTS_END
826825
827826
src/mame/drivers/nbmj8891.c
r3115r3116
689689   AM_RANGE(0x90, 0x90) AM_READ(nb1413m3_inputport0_r)
690690   AM_RANGE(0xa0, 0xa0) AM_READ(nb1413m3_inputport1_r)
691691   AM_RANGE(0xb0, 0xb0) AM_READ(nb1413m3_inputport2_r)
692   AM_RANGE(0xc0, 0xc0) AM_READ(nb1413m3_inputport3_r)
692   AM_RANGE(0xc0, 0xc0) AM_READ_PORT("PORT0-2")
693693   AM_RANGE(0xf0, 0xf0) AM_READ(nb1413m3_dipsw1_r)
694694   AM_RANGE(0xf1, 0xf1) AM_READ(nb1413m3_dipsw2_r)
695695ADDRESS_MAP_END
r3115r3116
717717   AM_RANGE(0x90, 0x90) AM_READ(nb1413m3_inputport0_r)
718718   AM_RANGE(0xa0, 0xa0) AM_READ(nb1413m3_inputport1_r)
719719   AM_RANGE(0xb0, 0xb0) AM_READ(nb1413m3_inputport2_r)
720   AM_RANGE(0xc0, 0xc0) AM_READ(nb1413m3_inputport3_r)
720   AM_RANGE(0xc0, 0xc0) AM_READ_PORT("PORT0-2")
721721   AM_RANGE(0xf0, 0xf0) AM_READ(nb1413m3_dipsw1_r)
722722   AM_RANGE(0xf1, 0xf1) AM_READ(nb1413m3_dipsw2_r)
723723ADDRESS_MAP_END
r3115r3116
768768
769769
770770static INPUT_PORTS_START( hanamomo )
771   PORT_START("DSWA")   /* (0) DIPSW-A */
771   PORT_START("DSWA")
772772   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
773773   PORT_DIPSETTING(    0x07, "1 (Easy)" )
774774   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
794794   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
795795   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
796796
797   PORT_START("DSWB")   /* (1) DIPSW-B */
797   PORT_START("DSWB")
798798   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
799799   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
800800   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
820820   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
821821   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
822822
823   PORT_START("SYSTEM")   /* (2) PORT 0 */
824   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
823   PORT_START("SYSTEM")
824   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
825825   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
826826   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
827827   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
834834INPUT_PORTS_END
835835
836836static INPUT_PORTS_START( mjcamerb )
837   PORT_START("DSWA")   /* (0) DIPSW-A */
837   PORT_START("DSWA")
838838   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
839839   PORT_DIPSETTING(    0x07, "1 (Easy)" )
840840   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
860860   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
861861   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
862862
863   PORT_START("DSWB")   /* (1) DIPSW-B */
863   PORT_START("DSWB")
864864   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
865865   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
866866   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
886886   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
887887   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
888888
889   PORT_START("SYSTEM")   /* (2) PORT 0 */
890   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
889   PORT_START("SYSTEM")
890   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
891891   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
892892   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
893893   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
900900INPUT_PORTS_END
901901
902902static INPUT_PORTS_START( mmcamera )
903   PORT_START("DSWA")   /* (0) DIPSW-A */
903   PORT_START("DSWA")
904904   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
905905   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
906906   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
926926   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
927927   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
928928
929   PORT_START("DSWB")   /* (1) DIPSW-B */
929   PORT_START("DSWB")
930930   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
931931   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
932932   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
952952   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
953953   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
954954
955   PORT_START("SYSTEM")   /* (2) PORT 0 */
956   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
955   PORT_START("SYSTEM")
956   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
957957   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
958958   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
959959   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
966966INPUT_PORTS_END
967967
968968static INPUT_PORTS_START( msjiken )
969   PORT_START("DSWA")   /* (0) DIPSW-A */
969   PORT_START("DSWA")
970970   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
971971   PORT_DIPSETTING(    0x07, "1 (Easy)" )
972972   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
992992   PORT_DIPSETTING(    0x80, "ROYAL" )
993993   PORT_DIPSETTING(    0x00, "JAMMA" )
994994
995   PORT_START("DSWB")   /* (1) DIPSW-B */
995   PORT_START("DSWB")
996996   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
997997   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
998998   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
10181018   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
10191019   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10201020
1021   PORT_START("SYSTEM")   /* (2) PORT 0 */
1022   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1021   PORT_START("SYSTEM")
1022   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
10231023   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
10241024   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
10251025   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
10301030
10311031   PORT_INCLUDE( nbmjcontrols )
10321032
1033   PORT_START("JAMMA1")   /* (13) JAMMA-1 */
1033   PORT_START("JAMMA1")
10341034   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
10351035   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
10361036   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
10401040   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
10411041   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
10421042
1043   PORT_START("JAMMA2")   /* (14) JAMMA-2 */
1043   PORT_START("JAMMA2")
10441044   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
10451045   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
10461046   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_4WAY
r3115r3116
10521052INPUT_PORTS_END
10531053
10541054static INPUT_PORTS_START( telmahjn )
1055   PORT_START("DSWA")   /* (0) DIPSW-A */
1055   PORT_START("DSWA")
10561056   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
10571057   PORT_DIPSETTING(    0x07, "1 (Easy)" )
10581058   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
10781078   PORT_DIPSETTING(    0x80, "ROYAL" )
10791079   PORT_DIPSETTING(    0x00, "JAMMA" )
10801080
1081   PORT_START("DSWB")   /* (1) DIPSW-B */
1081   PORT_START("DSWB")
10821082   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
10831083   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
10841084   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
11041104   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
11051105   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11061106
1107   PORT_START("SYSTEM")   /* (2) PORT 0 */
1108   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1107   PORT_START("SYSTEM")
1108   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
11091109   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
11101110   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
11111111   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
11161116
11171117   PORT_INCLUDE( nbmjcontrols )
11181118
1119   PORT_START("JAMMA1")   /* (13) JAMMA-1 */
1119   PORT_START("JAMMA1")
11201120   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
11211121   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
11221122   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
11261126   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
11271127   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
11281128
1129   PORT_START("JAMMA2")   /* (14) JAMMA-2 */
1129   PORT_START("JAMMA2")
11301130   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
11311131   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
11321132   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_4WAY
r3115r3116
11381138INPUT_PORTS_END
11391139
11401140static INPUT_PORTS_START( gionbana )
1141   PORT_START("DSWA")   /* (0) DIPSW-A */
1141   PORT_START("DSWA")
11421142   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
11431143   PORT_DIPSETTING(    0x07, "1 (Easy)" )
11441144   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
11631163   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
11641164   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11651165
1166   PORT_START("DSWB")   /* (1) DIPSW-B */
1166   PORT_START("DSWB")
11671167   PORT_DIPNAME( 0x01, 0x00, "Oyaken" )
11681168   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
11691169   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
11891189   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
11901190   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11911191
1192   PORT_START("SYSTEM")   /* (2) PORT 0 */
1193   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1192   PORT_START("SYSTEM")
1193   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
11941194   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
11951195   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
11961196   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
12031203INPUT_PORTS_END
12041204
12051205static INPUT_PORTS_START( mgion )
1206   PORT_START("DSWA")   /* (0) DIPSW-A */
1206   PORT_START("DSWA")
12071207   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
12081208   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
12091209   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
12291229   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12301230   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12311231
1232   PORT_START("DSWB")   /* (0) DIPSW-B */
1232   PORT_START("DSWB")
12331233   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
12341234   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
12351235   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
12551255   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12561256   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12571257
1258   PORT_START("SYSTEM")   /* (2) PORT 0 */
1259   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1258   PORT_START("SYSTEM")
1259   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
12601260   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
12611261   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
12621262   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
12691269INPUT_PORTS_END
12701270
12711271static INPUT_PORTS_START( omotesnd )
1272   PORT_START("DSWA")   /* (0) DIPSW-A */
1272   PORT_START("DSWA")
12731273   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
12741274   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
12751275   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
12951295   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12961296   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12971297
1298   PORT_START("DSWB")   /* (0) DIPSW-B */
1298   PORT_START("DSWB")
12991299   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
13001300   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
13011301   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
13211321   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
13221322   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13231323
1324   PORT_START("SYSTEM")   /* (2) PORT 0 */
1325   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1324   PORT_START("SYSTEM")
1325   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
13261326   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
13271327   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
13281328   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
13351335INPUT_PORTS_END
13361336
13371337static INPUT_PORTS_START( abunai )
1338   PORT_START("DSWA")   /* (0) DIPSW-A */
1338   PORT_START("DSWA")
13391339   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
13401340   PORT_DIPSETTING(    0x07, "1 (Easy)" )
13411341   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
13601360   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
13611361   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13621362
1363   PORT_START("DSWB")   /* (1) DIPSW-B */
1363   PORT_START("DSWB")
13641364   PORT_DIPNAME( 0x01, 0x00, "Oyaken" )
13651365   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
13661366   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
13861386   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
13871387   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13881388
1389   PORT_START("SYSTEM")   /* (2) PORT 0 */
1390   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1389   PORT_START("SYSTEM")
1390   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
13911391   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
13921392   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
13931393   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
14001400INPUT_PORTS_END
14011401
14021402static INPUT_PORTS_START( mgmen89 )
1403   PORT_START("DSWA")   /* (0) DIPSW-A */
1403   PORT_START("DSWA")
14041404   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
14051405   PORT_DIPSETTING(    0x07, "1 (Easy)" )
14061406   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
14261426   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
14271427   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14281428
1429   PORT_START("DSWB")   /* (1) DIPSW-B */
1429   PORT_START("DSWB")
14301430   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
14311431   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
14321432   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
14521452   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
14531453   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14541454
1455   PORT_START("SYSTEM")   /* (2) PORT 0 */
1456   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1455   PORT_START("SYSTEM")
1456   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
14571457   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
14581458   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
14591459   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
14691469
14701470   // I don't have manual for this game.
14711471
1472   PORT_START("DSWA")   /* (0) DIPSW-A */
1472   PORT_START("DSWA")
14731473   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
14741474   PORT_DIPSETTING(    0x07, "1 (Easy)" )
14751475   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
14951495   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
14961496   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14971497
1498   PORT_START("DSWB")   /* (1) DIPSW-B */
1498   PORT_START("DSWB")
14991499   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
15001500   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
15011501   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
15211521   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
15221522   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
15231523
1524   PORT_START("SYSTEM")   /* (2) PORT 0 */
1525   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1524   PORT_START("SYSTEM")
1525   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
15261526   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
15271527   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
15281528   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
15351535INPUT_PORTS_END
15361536
15371537static INPUT_PORTS_START( mjfocusm )
1538   PORT_START("DSWA")   /* (0) DIPSW-A */
1538   PORT_START("DSWA")
15391539   PORT_DIPNAME( 0x07, 0x07, "Game Out" )
15401540   PORT_DIPSETTING(    0x07, "95% (Easy)" )
15411541   PORT_DIPSETTING(    0x06, "90%" )
r3115r3116
15611561   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
15621562   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
15631563
1564   PORT_START("DSWB")   /* (1) DIPSW-B */
1564   PORT_START("DSWB")
15651565   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) )
15661566   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
15671567   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
r3115r3116
15851585   PORT_DIPSETTING(    0x80, "A" )
15861586   PORT_DIPSETTING(    0x00, "B" )
15871587
1588   PORT_START("SYSTEM")   /* (2) PORT 0 */
1589   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1588   PORT_START("SYSTEM")
1589   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
15901590   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
15911591   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
15921592   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
15991599INPUT_PORTS_END
16001600
16011601static INPUT_PORTS_START( peepshow )
1602   PORT_START("DSWA")   /* (0) DIPSW-A */
1602   PORT_START("DSWA")
16031603   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
16041604   PORT_DIPSETTING(    0x07, "1 (Easy)" )
16051605   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
16251625   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
16261626   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
16271627
1628   PORT_START("DSWB")   /* (1) DIPSW-B */
1628   PORT_START("DSWB")
16291629   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
16301630   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
16311631   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
16511651   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
16521652   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
16531653
1654   PORT_START("SYSTEM")   /* (2) PORT 0 */
1655   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1654   PORT_START("SYSTEM")
1655   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
16561656   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
16571657   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
16581658   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
16651665INPUT_PORTS_END
16661666
16671667static INPUT_PORTS_START( scandal )
1668   PORT_START("DSWA")   /* (0) DIPSW-A */
1668   PORT_START("DSWA")
16691669   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
16701670   PORT_DIPSETTING(    0x07, "1 (Easy)" )
16711671   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
16911691   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
16921692   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
16931693
1694   PORT_START("DSWB")   /* (1) DIPSW-B */
1694   PORT_START("DSWB")
16951695   PORT_DIPNAME( 0x01, 0x01, "Character Display Test" )
16961696   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
16971697   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
17171717   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
17181718   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
17191719
1720   PORT_START("SYSTEM")   /* (2) PORT 0 */
1721   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1720   PORT_START("SYSTEM")
1721   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
17221722   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
17231723   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
17241724   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
17311731INPUT_PORTS_END
17321732
17331733static INPUT_PORTS_START( scandalm )
1734   PORT_START("DSWA")   /* (0) DIPSW-A */
1734   PORT_START("DSWA")
17351735   PORT_DIPNAME( 0x07, 0x07, "Game Out" )
17361736   PORT_DIPSETTING(    0x07, "90% (Easy)" )
17371737   PORT_DIPSETTING(    0x06, "85%" )
r3115r3116
17571757   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
17581758   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
17591759
1760   PORT_START("DSWB")   /* (1) DIPSW-B */
1760   PORT_START("DSWB")
17611761   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) )
17621762   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
17631763   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
r3115r3116
17811781   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
17821782   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
17831783
1784   PORT_START("SYSTEM")   /* (2) PORT 0 */
1785   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1784   PORT_START("SYSTEM")
1785   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
17861786   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
17871787   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
17881788   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
17951795INPUT_PORTS_END
17961796
17971797static INPUT_PORTS_START( mjnanpas )
1798   PORT_START("DSWA")   /* (0) DIPSW-A */
1798   PORT_START("DSWA")
17991799   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
18001800   PORT_DIPSETTING(    0x07, "1 (Easy)" )
18011801   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
18211821   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
18221822   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
18231823
1824   PORT_START("DSWB")   /* (1) DIPSW-B */
1824   PORT_START("DSWB")
18251825   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
18261826   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
18271827   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
18471847   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
18481848   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
18491849
1850   PORT_START("SYSTEM")   /* (2) PORT 0 */
1851   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1850   PORT_START("SYSTEM")
1851   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
18521852   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
18531853   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
18541854   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
18611861INPUT_PORTS_END
18621862
18631863static INPUT_PORTS_START( mjnanpaa )
1864   PORT_START("DSWA")   /* (0) DIPSW-A */
1864   PORT_START("DSWA")
18651865   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
18661866   PORT_DIPSETTING(    0x07, "1 (Easy)" )
18671867   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
18871887   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
18881888   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
18891889
1890   PORT_START("DSWB")   /* (1) DIPSW-B */
1890   PORT_START("DSWB")
18911891   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
18921892   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
18931893   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
19131913   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
19141914   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
19151915
1916   PORT_START("SYSTEM")   /* (2) PORT 0 */
1917   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1916   PORT_START("SYSTEM")
1917   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
19181918   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
19191919   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
19201920   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
19301930
19311931   // I don't have manual for this game.
19321932
1933   PORT_START("DSWA")   /* (0) DIPSW-A */
1933   PORT_START("DSWA")
19341934   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
19351935   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
19361936   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
19561956   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
19571957   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
19581958
1959   PORT_START("DSWB")   /* (1) DIPSW-B */
1959   PORT_START("DSWB")
19601960   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
19611961   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
19621962   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
19821982   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
19831983   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
19841984
1985   PORT_START("SYSTEM")   /* (2) PORT 0 */
1986   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1985   PORT_START("SYSTEM")
1986   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
19871987   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
19881988   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
19891989   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
19961996INPUT_PORTS_END
19971997
19981998static INPUT_PORTS_START( club90s )
1999   PORT_START("DSWA")   /* (0) DIPSW-A */
1999   PORT_START("DSWA")
20002000   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
20012001   PORT_DIPSETTING(    0x03, "1" )
20022002   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
20212021   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
20222022   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
20232023
2024   PORT_START("DSWB")   /* (1) DIPSW-B */
2024   PORT_START("DSWB")
20252025   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
20262026   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
20272027   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
20472047   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
20482048   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
20492049
2050   PORT_START("SYSTEM")   /* (2) PORT 0 */
2051   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2050   PORT_START("SYSTEM")
2051   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
20522052   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
20532053   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
20542054   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
20642064
20652065   // I don't have manual for this game.
20662066
2067   PORT_START("DSWA")   /* (0) DIPSW-A */
2067   PORT_START("DSWA")
20682068   PORT_DIPNAME( 0x07, 0x07, "Game Out" )
20692069   PORT_DIPSETTING(    0x07, "90% (Easy)" )
20702070   PORT_DIPSETTING(    0x06, "85%" )
r3115r3116
20902090   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
20912091   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
20922092
2093   PORT_START("DSWB")   /* (1) DIPSW-B */
2093   PORT_START("DSWB")
20942094   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
20952095   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
20962096   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
21142114   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
21152115   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21162116
2117   PORT_START("SYSTEM")   /* (2) PORT 0-1 */
2118   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2117   PORT_START("SYSTEM")
2118   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
21192119   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
21202120   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
21212121   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
21262126
21272127   PORT_INCLUDE( nbmjcontrols )
21282128
2129   PORT_START("PORT0-2")   /* (13) PORT 0-2 */
2129   PORT_START("PORT0-2")
21302130   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
2131   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         // OUT COIN
2131   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_outcoin_flag_r, NULL)   // OUT COIN
21322132   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
21332133   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
21342134   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
21382138INPUT_PORTS_END
21392139
21402140static INPUT_PORTS_START( mladyhtr )
2141   PORT_START("DSWA")   /* (0) DIPSW-A */
2141   PORT_START("DSWA")
21422142   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
21432143   PORT_DIPSETTING(    0x03, "1" )
21442144   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
21632163   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
21642164   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21652165
2166   PORT_START("DSWB")   /* (1) DIPSW-B */
2166   PORT_START("DSWB")
21672167   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
21682168   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
21692169   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
21892189   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
21902190   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21912191
2192   PORT_START("SYSTEM")   /* (2) PORT 0 */
2193   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2192   PORT_START("SYSTEM")
2193   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
21942194   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
21952195   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
21962196   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
22032203INPUT_PORTS_END
22042204
22052205static INPUT_PORTS_START( chinmoku )
2206   PORT_START("DSWA")   /* (0) DIPSW-A */
2206   PORT_START("DSWA")
22072207   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
22082208   PORT_DIPSETTING(    0x03, "1" )
22092209   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
22282228   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
22292229   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
22302230
2231   PORT_START("DSWB")   /* (1) DIPSW-B */
2231   PORT_START("DSWB")
22322232   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
22332233   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
22342234   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
22542254   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
22552255   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
22562256
2257   PORT_START("SYSTEM")   /* (2) PORT 0 */
2258   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2257   PORT_START("SYSTEM")
2258   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
22592259   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
22602260   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
22612261   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
22682268INPUT_PORTS_END
22692269
22702270static INPUT_PORTS_START( maiko )
2271   PORT_START("DSWA")   /* (0) DIPSW-A */
2271   PORT_START("DSWA")
22722272   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
22732273   PORT_DIPSETTING(    0x07, "1 (Easy)" )
22742274   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
22942294   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
22952295   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
22962296
2297   PORT_START("DSWB")   /* (1) DIPSW-B */
2297   PORT_START("DSWB")
22982298   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
22992299   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
23002300   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
23202320   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
23212321   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
23222322
2323   PORT_START("SYSTEM")   /* (2) PORT 0-1 */
2324   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2323   PORT_START("SYSTEM")
2324   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
23252325   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
23262326   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )         //
23272327   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )         //
r3115r3116
23322332
23332333   PORT_INCLUDE( nbmjcontrols )
23342334
2335   PORT_START("PORT0-2")   /* (13) PORT 0-2 */
2335   PORT_START("PORT0-2")
23362336   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         //
2337   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         // OUT COIN
2337   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_outcoin_flag_r, NULL)   // OUT COIN
23382338   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
23392339   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
23402340   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )         //
r3115r3116
23472347
23482348   // I don't have manual for this game.
23492349
2350   PORT_START("DSWA")   /* (0) DIPSW-A */
2350   PORT_START("DSWA")
23512351   PORT_DIPNAME( 0x07, 0x07, "Game Out" )
23522352   PORT_DIPSETTING(    0x07, "90% (Easy)" )
23532353   PORT_DIPSETTING(    0x06, "85%" )
r3115r3116
23712371   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
23722372   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
23732373
2374   PORT_START("DSWB")   /* (1) DIPSW-B */
2374   PORT_START("DSWB")
23752375   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
23762376   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
23772377   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
r3115r3116
23962396   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
23972397   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
23982398
2399   PORT_START("SYSTEM")   /* (2) PORT 0-1 */
2400   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2399   PORT_START("SYSTEM")
2400   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
24012401   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
24022402   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
24032403   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
24082408
24092409   PORT_INCLUDE( nbmjcontrols )
24102410
2411   PORT_START("PORT0-2")   /* (13) PORT 0-2 */
2411   PORT_START("PORT0-2")
24122412   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
2413   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         // OUT COIN
2413   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_outcoin_flag_r, NULL)   // OUT COIN
24142414   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
24152415   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
24162416   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
24202420INPUT_PORTS_END
24212421
24222422static INPUT_PORTS_START( hanaoji )
2423   PORT_START("DSWA")   /* (0) DIPSW-A */
2423   PORT_START("DSWA")
24242424   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
24252425   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
24262426   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
24462446   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
24472447   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
24482448
2449   PORT_START("DSWB")   /* (1) DIPSW-B */
2449   PORT_START("DSWB")
24502450   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
24512451   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
24522452   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
24722472   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
24732473   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
24742474
2475   PORT_START("SYSTEM")   /* (2) PORT 0-1 */
2476   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2475   PORT_START("SYSTEM")
2476   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
24772477   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
24782478   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )         //
24792479   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )         //
r3115r3116
24842484
24852485   PORT_INCLUDE( nbmjcontrols )
24862486
2487   PORT_START("PORT0-2")   /* (13) PORT 0-2 */
2487   PORT_START("PORT0-2")
24882488   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         //
2489   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         // OUT COIN
2489   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_outcoin_flag_r, NULL)   // OUT COIN
24902490   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
24912491   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
24922492   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )         //
r3115r3116
24962496INPUT_PORTS_END
24972497
24982498static INPUT_PORTS_START( pairsnb )
2499   PORT_START("DSWA") /* (0) DIPSW-A */
2499   PORT_START("DSWA")
25002500   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
25012501   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )         // Hearts : 10 - Time : 60/60
25022502   PORT_DIPSETTING(    0x02, DEF_STR( Medium ) )       // Hearts :  7 - Time : 44/60
r3115r3116
25212521   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
25222522   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
25232523
2524   PORT_START("DSWB") /* (1) DIPSW-B */
2524   PORT_START("DSWB")
25252525   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )
25262526   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
25272527   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
25472547   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
25482548   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
25492549
2550   PORT_START("SYSTEM") /* (2) PORT 0 */
2551   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2550   PORT_START("SYSTEM")
2551   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
25522552   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
25532553   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
25542554   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
25572557   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
25582558   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )         // not in "test mode"
25592559
2560   PORT_START("P1") /* (3) PORT 1 */
2560   PORT_START("P1")
25612561   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
25622562   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
25632563   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_4WAY
r3115r3116
25672567   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
25682568   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
25692569
2570   PORT_START("P2") /* (4) PORT 2 */
2570   PORT_START("P2")
25712571   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
25722572   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
25732573   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_4WAY
r3115r3116
25792579INPUT_PORTS_END
25802580
25812581static INPUT_PORTS_START( taiwanmb )
2582   PORT_START("DSWA")   /* (0) DIPSW-A */
2582   PORT_START("DSWA")
25832583   PORT_DIPNAME( 0x07, 0x07, "Game Out" )
25842584   PORT_DIPSETTING(    0x07, "95% (Easy)" )
25852585   PORT_DIPSETTING(    0x06, "90%" )
r3115r3116
26032603   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
26042604   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
26052605
2606   PORT_START("DSWB")   /* (1) DIPSW-B */
2606   PORT_START("DSWB")
26072607   PORT_DIPNAME( 0x01, 0x00, "Last Chance" )
26082608   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
26092609   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
26272627   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
26282628   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
26292629
2630   PORT_START("DSWC")   /* (2) DIPSW-C */
2630   PORT_START("DSWC")
26312631   PORT_DIPNAME( 0x03, 0x03, "?? cut" )
26322632   PORT_DIPSETTING(    0x03, DEF_STR( Off ) )
26332633   PORT_DIPSETTING(    0x02, "16 - ?H??" )
r3115r3116
26502650   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
26512651   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
26522652
2653   PORT_START("SYSTEM")   /* (3) PORT 0 */
2654   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2653   PORT_START("SYSTEM")
2654   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
26552655   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         // COIN OUT
26562656   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
26572657   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
src/mame/drivers/spdodgeb.c
r3115r3116
4141/* private globals */
4242static int toggle=0;//, soundcode = 0;
4343static int adpcm_pos[2],adpcm_end[2],adpcm_idle[2];
44static int adpcm_data[2];
45static int mcu63701_command;
46static int inputs[4];
47
48static UINT8 tapc[4] = {0,0,0,0};   // R1, R2, L1, L2
49static UINT8 last_port[2] = {0,0};
50static UINT8 last_dash[2] = {0,0};
4451/* end of private globals */
4552
4653
r3115r3116
7885
7986static void spd_adpcm_int(running_machine *machine, int chip)
8087{
81   static int adpcm_data[2] = { -1, -1 };
82
8388   if (adpcm_pos[chip] >= adpcm_end[chip] || adpcm_pos[chip] >= 0x10000)
8489   {
8590      adpcm_idle[chip] = 1;
r3115r3116
100105}
101106
102107
103static int mcu63701_command;
104static int inputs[4];
105
106108#if 0   // default - more sensitive (state change and timing measured on real board?)
107109static void mcu63705_update_inputs(running_machine *machine)
108110{
r3115r3116
178180#define A 0x10
179181#define D 0x20
180182
181   static UINT8 tapc[4] = {0,0,0,0};   // R1, R2, L1, L2
182   static UINT8 last_port[2] = {0,0};
183   static UINT8 last_dash[2] = {0,0};
184183   UINT8 curr_port[2];
185184   UINT8 curr_dash[2];
186185   int p;
r3115r3116
429428};
430429
431430
431static MACHINE_RESET( spdodgeb )
432{
433   toggle = 0;
434   adpcm_pos[0] = adpcm_pos[1] = 0;
435   adpcm_end[0] = adpcm_end[0] = 0;
436   adpcm_idle[0] = adpcm_data[1] = 0;
437   adpcm_data[0] = adpcm_data[1] = -1;
438   mcu63701_command = 0;
439   memset(inputs, 0, sizeof(inputs));
440   memset(tapc, 0, sizeof(tapc));
441   last_port[0] = last_port[1] = 0;
442   last_dash[0] = last_dash[1] = 0;
443}
432444
433445static MACHINE_DRIVER_START( spdodgeb )
434446
r3115r3116
455467   MDRV_VIDEO_START(spdodgeb)
456468   MDRV_VIDEO_UPDATE(spdodgeb)
457469
470   MDRV_MACHINE_RESET( spdodgeb )
471
458472   /* sound hardware */
459473   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
460474
src/mame/drivers/trvquest.c
r3115r3116
4343{
4444   gameplan_state *state = machine->driver_data;
4545
46   return memory_region(machine, "user1")[*state->trvquest_question * 0x2000 + offset];
46   return memory_region(machine, "questions")[*state->trvquest_question * 0x2000 + offset];
4747}
4848
4949static WRITE8_HANDLER( trvquest_coin_w )
r3115r3116
203203
204204   MDRV_DRIVER_DATA(gameplan_state)
205205
206   MDRV_CPU_ADD("main", M6809,6000000)
206   MDRV_CPU_ADD("main", M6809,XTAL_6MHz/4)
207207   MDRV_CPU_PROGRAM_MAP(cpu_map,0)
208208   MDRV_CPU_VBLANK_INT("main", trvquest_interrupt)
209209
r3115r3116
217217   /* sound hardware */
218218   MDRV_SPEAKER_STANDARD_MONO("mono")
219219
220   MDRV_SOUND_ADD("ay1", AY8910, 1500000)
220   MDRV_SOUND_ADD("ay1", AY8910, XTAL_6MHz/2)
221221   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
222222
223   MDRV_SOUND_ADD("ay2", AY8910, 1500000)
223   MDRV_SOUND_ADD("ay2", AY8910, XTAL_6MHz/2)
224224   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
225225MACHINE_DRIVER_END
226226
r3115r3116
232232   ROM_LOAD( "rom6", 0xe000, 0x1000, CRC(fabf4846) SHA1(862cac32de78f2ff4afef398b864d5533d302a4f) )
233233   ROM_LOAD( "rom7", 0xf000, 0x1000, CRC(a9f56551) SHA1(fb6fc3b17a6e66571a5ba837befbfac1ac26cc39) )
234234
235   ROM_REGION( 0x18000, "user1", ROMREGION_ERASEFF ) /* Question roms */
235   ROM_REGION( 0x18000, "questions", ROMREGION_ERASEFF ) /* Question roms */
236236   /* 0x00000 - 0x07fff empty */
237237   ROM_LOAD( "romi", 0x06000, 0x2000, CRC(c8368f69) SHA1(c1dfb701482c5ae922df0a93665a519995a2f4f1) )
238238   ROM_LOAD( "romh", 0x08000, 0x2000, CRC(f3aa8a08) SHA1(2bf8f878cc1df84806a6fb8e7be2656c422d61b9) )
src/mame/drivers/tnzs.c
r3115r3116
740740   COMMON_COIN1(IP_ACTIVE_HIGH)
741741   COMMON_COIN2(IP_ACTIVE_HIGH)
742742
743   PORT_START("AN1")      /* spinner 1 - read at f000/1 */\
744   PORT_BIT   ( 0x0fff, 0x0000, IPT_DIAL ) PORT_SENSITIVITY(70) PORT_KEYDELTA(15)\
745   PORT_BIT   ( 0x1000, IP_ACTIVE_LOW,  IPT_COIN2 )   /* Mirrored for service mode */\
746   PORT_BIT   ( 0x2000, IP_ACTIVE_HIGH, IPT_SERVICE1 )   /* Mirrored for service mode */\
747   PORT_BIT   ( 0x4000, IP_ACTIVE_LOW,  IPT_COIN1 )   /* Mirrored for service mode */\
748   PORT_BIT   ( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN )\
743   PORT_START("AN1")      /* spinner 1 - read at f000/1 */
744   PORT_BIT   ( 0x0fff, 0x0000, IPT_DIAL ) PORT_SENSITIVITY(70) PORT_KEYDELTA(15)
745   PORT_BIT   ( 0x1000, IP_ACTIVE_LOW,  IPT_COIN2 )   /* Mirrored for service mode */
746   PORT_BIT   ( 0x2000, IP_ACTIVE_HIGH, IPT_SERVICE1 )   /* Mirrored for service mode */
747   PORT_BIT   ( 0x4000, IP_ACTIVE_LOW,  IPT_COIN1 )   /* Mirrored for service mode */
748   PORT_BIT   ( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
749749
750   PORT_START("AN2")      /* spinner 2 - read at f002/3 */\
751   PORT_BIT   ( 0x0fff, 0x0000, IPT_DIAL ) PORT_SENSITIVITY(70) PORT_KEYDELTA(15) PORT_PLAYER(2)\
750   PORT_START("AN2")      /* spinner 2 - read at f002/3 */
751   PORT_BIT   ( 0x0fff, 0x0000, IPT_DIAL ) PORT_SENSITIVITY(70) PORT_KEYDELTA(15) PORT_PLAYER(2)
752752   PORT_BIT   ( 0xf000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
753753INPUT_PORTS_END
754754
src/mame/drivers/tp84.c
r3115r3116
135135
136136static ADDRESS_MAP_START( tp84_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 )
137137   AM_RANGE(0x2000, 0x2000) AM_WRITE(watchdog_reset_w)
138   AM_RANGE(0x2800, 0x2800) AM_READWRITE(input_port_0_r, SMH_RAM) AM_BASE(&tp84_palette_bank)
139   AM_RANGE(0x2820, 0x2820) AM_READ(input_port_1_r)
140   AM_RANGE(0x2840, 0x2840) AM_READ(input_port_2_r)
141   AM_RANGE(0x2860, 0x2860) AM_READ(input_port_3_r)
142   AM_RANGE(0x3000, 0x3000) AM_READWRITE(input_port_4_r, SMH_RAM)
138   AM_RANGE(0x2800, 0x2800) AM_READ_PORT("SYSTEM") AM_WRITEONLY AM_BASE(&tp84_palette_bank)
139   AM_RANGE(0x2820, 0x2820) AM_READ_PORT("P1")
140   AM_RANGE(0x2840, 0x2840) AM_READ_PORT("P2")
141   AM_RANGE(0x2860, 0x2860) AM_READ_PORT("DSW1")
142   AM_RANGE(0x3000, 0x3000) AM_READ_PORT("DSW2") AM_WRITEONLY
143143   AM_RANGE(0x3004, 0x3004) AM_WRITE(SMH_RAM) AM_BASE(&tp84_flipscreen_x)
144144   AM_RANGE(0x3005, 0x3005) AM_WRITE(SMH_RAM) AM_BASE(&tp84_flipscreen_y)
145145   AM_RANGE(0x3800, 0x3800) AM_WRITE(tp84_sh_irqtrigger_w)
r3115r3116
161161   AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_BASE(&tp84_fg_colorram)
162162   AM_RANGE(0x1000, 0x17ff) AM_RAM AM_SHARE(1)
163163   AM_RANGE(0x1800, 0x1800) AM_WRITE(watchdog_reset_w)
164   AM_RANGE(0x1a00, 0x1a00) AM_READWRITE(input_port_0_r, SMH_RAM) AM_BASE(&tp84_palette_bank)
165   AM_RANGE(0x1a20, 0x1a20) AM_READ(input_port_1_r)
166   AM_RANGE(0x1a40, 0x1a40) AM_READ(input_port_2_r)
167   AM_RANGE(0x1a60, 0x1a60) AM_READ(input_port_3_r)
168   AM_RANGE(0x1c00, 0x1c00) AM_READWRITE(input_port_4_r, SMH_NOP)
164   AM_RANGE(0x1a00, 0x1a00) AM_READ_PORT("SYSTEM") AM_WRITEONLY AM_BASE(&tp84_palette_bank)
165   AM_RANGE(0x1a20, 0x1a20) AM_READ_PORT("P1")
166   AM_RANGE(0x1a40, 0x1a40) AM_READ_PORT("P2")
167   AM_RANGE(0x1a60, 0x1a60) AM_READ_PORT("DSW1")
168   AM_RANGE(0x1c00, 0x1c00) AM_READ_PORT("DSW2") AM_WRITENOP
169169   AM_RANGE(0x1c04, 0x1c04) AM_WRITE(SMH_RAM) AM_BASE(&tp84_flipscreen_x)
170170   AM_RANGE(0x1c05, 0x1c05) AM_WRITE(SMH_RAM) AM_BASE(&tp84_flipscreen_y)
171171   AM_RANGE(0x1e00, 0x1e00) AM_WRITE(tp84_sh_irqtrigger_w)
r3115r3116
202202
203203
204204static INPUT_PORTS_START( tp84 )
205   PORT_START("SYSTEM")      /* IN0 */
205   PORT_START("SYSTEM")
206206   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
207207   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
208208   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
r3115r3116
212212   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
213213   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
214214
215   PORT_START("P1")      /* IN1 */
215   PORT_START("P1")
216216   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
217217   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
218218   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
r3115r3116
222222   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
223223   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
224224
225   PORT_START("P2")      /* IN2 */
225   PORT_START("P2")
226226   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
227227   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
228228   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
r3115r3116
232232   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
233233   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
234234
235   PORT_START("DSW1")      /* DSW0 */
235   PORT_START("DSW1")
236236   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
237237   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
238238   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
268268   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
269269   PORT_DIPSETTING(    0x00, "Invalid" )
270270
271   PORT_START("DSW2")      /* DSW1 */
271   PORT_START("DSW2")
272272   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
273273   PORT_DIPSETTING(    0x03, "2" )
274274   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
293293INPUT_PORTS_END
294294
295295static INPUT_PORTS_START( tp84a )
296   PORT_START("SYSTEM")      /* IN0 */
296   PORT_START("SYSTEM")
297297   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
298298   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
299299   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
r3115r3116
303303   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
304304   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
305305
306   PORT_START("P1")      /* IN1 */
306   PORT_START("P1")
307307   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
308308   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
309309   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
r3115r3116
313313   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
314314   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
315315
316   PORT_START("P2")      /* IN2 */
316   PORT_START("P2")
317317   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
318318   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
319319   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
r3115r3116
323323   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
324324   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
325325
326   PORT_START("DSW1")      /* DSW0 */
326   PORT_START("DSW1")
327327   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
328328   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
329329   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
359359   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
360360   PORT_DIPSETTING(    0x00, "Invalid" )
361361
362   PORT_START("DSW2")      /* DSW1 */
362   PORT_START("DSW2")
363363   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
364364   PORT_DIPSETTING(    0x03, "3" )
365365   PORT_DIPSETTING(    0x02, "4" )
src/mame/drivers/rohga.c
r3115r3116
124124VIDEO_UPDATE( nitrobal );
125125WRITE16_HANDLER( rohga_buffer_spriteram16_w );
126126
127static READ16_HANDLER( rohga_dip3_r ) { return input_port_read(machine, "DSW3"); }
128static READ16_HANDLER( nitrobal_control_r ) { return input_port_read(machine, "DSW3"); }
129static READ16_HANDLER( schmeisr_control_r ) { return input_port_read(machine, "IN1"); }
130
131127/**********************************************************************************/
132128
133129static ADDRESS_MAP_START( rohga_readmem, ADDRESS_SPACE_PROGRAM, 16 )
134130   AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM)
135131   AM_RANGE(0x280000, 0x2807ff) AM_MIRROR(0x800) AM_READ(deco16_104_rohga_prot_r) /* Protection device */
136   AM_RANGE(0x2c0000, 0x2c0001) AM_READ(rohga_dip3_r)
132   AM_RANGE(0x2c0000, 0x2c0001) AM_READ_PORT("DSW3")
137133   AM_RANGE(0x321100, 0x321101) AM_READ(SMH_NOP) /* Irq ack?  Value not used */
138134   AM_RANGE(0x3c0000, 0x3c1fff) AM_READ(SMH_RAM)
139135   AM_RANGE(0x3c2000, 0x3c2fff) AM_READ(SMH_RAM)
r3115r3116
234230
235231   AM_RANGE(0x300000, 0x30000f) AM_READ(SMH_RAM)
236232   AM_RANGE(0x310000, 0x31000f) AM_READ(SMH_RAM)
237   AM_RANGE(0x320000, 0x320001) AM_READ(nitrobal_control_r)
233   AM_RANGE(0x320000, 0x320001) AM_READ_PORT("DSW3")
238234
239235   AM_RANGE(0x340000, 0x3407ff) AM_READ(SMH_RAM)
240236   AM_RANGE(0x360000, 0x3607ff) AM_READ(SMH_RAM)
r3115r3116
281277static ADDRESS_MAP_START( schmeisr_readmem, ADDRESS_SPACE_PROGRAM, 16 )
282278   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
283279   AM_RANGE(0x280000, 0x2807ff) AM_READ(deco16_104_rohga_prot_r) /* Protection device */
284   AM_RANGE(0x2c0000, 0x2c0001) AM_READ(rohga_dip3_r)
285   AM_RANGE(0x300000, 0x300001) AM_READ(nitrobal_control_r)
286   AM_RANGE(0x310002, 0x310003) AM_READ(schmeisr_control_r)
280   AM_RANGE(0x2c0000, 0x2c0001) AM_READ_PORT("DSW3")
281   AM_RANGE(0x300000, 0x300001) AM_READ_PORT("DSW3")
282   AM_RANGE(0x310002, 0x310003) AM_READ_PORT("IN1")
287283   AM_RANGE(0x321100, 0x321101) AM_READ(SMH_NOP) /* Irq ack?  Value not used */
288284   AM_RANGE(0x3c0000, 0x3c1fff) AM_READ(SMH_RAM)
289285   AM_RANGE(0x3c2000, 0x3c2fff) AM_READ(SMH_RAM)
r3115r3116
373369   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
374370   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
375371
376   PORT_START("DSW1_2")      /* Dip switch bank 1/2 */
372   PORT_START("DSW1_2")
377373   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
378374   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
379375   PORT_DIPSETTING(      0x0001, DEF_STR( 2C_1C ) )
r3115r3116
471467   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
472468   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
473469
474   PORT_START("DSW1_2")      /* Dip switch bank 1/2 */
470   PORT_START("DSW1_2")
475471   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
476472   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
477473   PORT_DIPSETTING(      0x0001, DEF_STR( 2C_1C ) )
r3115r3116
544540   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
545541   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
546542
547   PORT_START("DSW1_2")      /* Dip switch bank 1/2 */
543   PORT_START("DSW1_2")
548544   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
549545   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
550546   PORT_DIPSETTING(      0x0001, DEF_STR( 2C_1C ) )
r3115r3116
593589   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
594590
595591   PORT_START("DSW3")       /* Not really a DSW, but this way it's easier to read by tag */
596   PORT_BIT( 0x1, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
597   PORT_BIT( 0x2, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
598   PORT_BIT( 0x4, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
599   PORT_BIT( 0x8, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
592   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
593   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
594   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
595   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
600596   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
601597   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
602598   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
628624   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
629625   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
630626
631   PORT_START("DSW1_2")      /* Dip switch bank 1/2 */
627   PORT_START("DSW1_2")
632628   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
633629   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
634630   PORT_DIPSETTING(      0x0001, DEF_STR( 2C_1C ) )
src/mame/drivers/vball.c
r3115r3116
168168
169169static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
170170   AM_RANGE(0x0000, 0x0fff) AM_READ(SMH_RAM)
171   AM_RANGE(0x1000, 0x1000) AM_READ(input_port_0_r)
172   AM_RANGE(0x1001, 0x1001) AM_READ(input_port_1_r)
173   AM_RANGE(0x1002, 0x1002) AM_READ(input_port_2_r)
174   AM_RANGE(0x1003, 0x1003) AM_READ(input_port_3_r)
175   AM_RANGE(0x1004, 0x1004) AM_READ(input_port_4_r)
176   AM_RANGE(0x1005, 0x1005) AM_READ(input_port_5_r)
177   AM_RANGE(0x1006, 0x1006) AM_READ(input_port_6_r)
171   AM_RANGE(0x1000, 0x1000) AM_READ_PORT("P1")
172   AM_RANGE(0x1001, 0x1001) AM_READ_PORT("P2")
173   AM_RANGE(0x1002, 0x1002) AM_READ_PORT("SYSTEM")
174   AM_RANGE(0x1003, 0x1003) AM_READ_PORT("DSW1")
175   AM_RANGE(0x1004, 0x1004) AM_READ_PORT("DSW2")
176   AM_RANGE(0x1005, 0x1005) AM_READ_PORT("P3")
177   AM_RANGE(0x1006, 0x1006) AM_READ_PORT("P4")
178178   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK1)
179179   AM_RANGE(0x8000, 0xffff) AM_READ(SMH_ROM)
180180ADDRESS_MAP_END
181181
182182static ADDRESS_MAP_START( vball2pj_readmem, ADDRESS_SPACE_PROGRAM, 8 )
183183   AM_RANGE(0x0000, 0x0fff) AM_READ(SMH_RAM)
184   AM_RANGE(0x1000, 0x1000) AM_READ(input_port_0_r)
185   AM_RANGE(0x1001, 0x1001) AM_READ(input_port_1_r)
186   AM_RANGE(0x1002, 0x1002) AM_READ(input_port_2_r)
187   AM_RANGE(0x1003, 0x1003) AM_READ(input_port_3_r)
188   AM_RANGE(0x1004, 0x1004) AM_READ(input_port_4_r)
184   AM_RANGE(0x1000, 0x1000) AM_READ_PORT("P1")
185   AM_RANGE(0x1001, 0x1001) AM_READ_PORT("P2")
186   AM_RANGE(0x1002, 0x1002) AM_READ_PORT("SYSTEM")
187   AM_RANGE(0x1003, 0x1003) AM_READ_PORT("DSW1")
188   AM_RANGE(0x1004, 0x1004) AM_READ_PORT("DSW2")
189189   AM_RANGE(0x1005, 0x1005) AM_READ(SMH_RAM)      //Strange, that these are read!
190190   AM_RANGE(0x1006, 0x1006) AM_READ(SMH_RAM)      //Strange, that these are read!
191191   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK1)
r3115r3116
230230   AM_RANGE(0x9800, 0x9803) AM_WRITE(okim6295_data_0_w)
231231ADDRESS_MAP_END
232232
233#define COMMON_PORTS_BEFORE \
234   PORT_START("P1") \
235   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) \
236   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) \
237   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) \
238   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) \
239   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) \
240   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) \
241   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
242   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) \
243   PORT_START("P2") \
244   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) \
245   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) \
246   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) \
247   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) \
248   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) \
249   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) \
250   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
251   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) \
252   PORT_START("SYSTEM") \
253   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) \
254   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) \
255   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) \
256   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) \
257   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) \
258   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) \
259   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) \
260   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) \
261233
262#define COMMON_PORTS_COINS \
263   PORT_START("DSW2") \
264   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A )) \
265   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C )) \
266   PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C )) \
267   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C )) \
268   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C )) \
269   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C )) \
270   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C )) \
271   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C )) \
272   PORT_DIPSETTING(    0x03, DEF_STR( 1C_5C )) \
273   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B )) \
274   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C )) \
275   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C )) \
276   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C )) \
277   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C )) \
278   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C )) \
279   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C )) \
280   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C )) \
281   PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C )) \
282   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Flip_Screen )) \
283   PORT_DIPSETTING(    0x00, DEF_STR( Off )) \
284   PORT_DIPSETTING(    0x40, DEF_STR( On )) \
285   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds )) \
286   PORT_DIPSETTING(    0x00, DEF_STR( Off )) \
287   PORT_DIPSETTING(    0x80, DEF_STR( On )) \
234static INPUT_PORTS_START( common )
235   PORT_START("P1")
236   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
237   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
238   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
239   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
240   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
241   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
242   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
243   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
288244
289static INPUT_PORTS_START (vball)
290   COMMON_PORTS_BEFORE
245   PORT_START("P2")
246   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
247   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
248   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
249   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
250   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
251   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
252   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
253   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
254
255   PORT_START("SYSTEM")
256   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
257   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
258   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
259   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
260   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
261   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
262   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
263   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
264
265   PORT_START("DSW2")
266   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
267   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
268   PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
269   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
270   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
271   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
272   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
273   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
274   PORT_DIPSETTING(    0x03, DEF_STR( 1C_5C ) )
275   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )
276   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
277   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
278   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
279   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
280   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
281   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
282   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
283   PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C ) )
284   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Flip_Screen ) )
285   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
286   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
287   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
288   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
289   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
290INPUT_PORTS_END
291
292static INPUT_PORTS_START( vball )
293   PORT_INCLUDE( common )
294
291295   /* The dipswitch instructions in naz's dump (vball) don't quite sync here) */
292296   /* Looks like the pins from the dips to the board were mixed up a little. */
293297
294298   PORT_START("DSW1")
295   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ))
299   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
296300// I've adjusted these to what I think is correct from gameplay testing - SJE - 03/28/03
297   PORT_DIPSETTING(    0x02, DEF_STR( Easy ))
298   PORT_DIPSETTING(    0x03, DEF_STR( Medium ))
299   PORT_DIPSETTING(    0x01, DEF_STR( Hard ))
300   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ))
301   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
302   PORT_DIPSETTING(    0x03, DEF_STR( Medium ) )
303   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
304   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
301305   PORT_DIPNAME( 0x0c, 0x00, "Single Player Game Time")
302306   PORT_DIPSETTING(    0x00, "1:15")
303307   PORT_DIPSETTING(    0x04, "1:30")
304308   PORT_DIPSETTING(    0x0c, "1:45")
305309   PORT_DIPSETTING(    0x08, "2:00")
306310   PORT_DIPNAME( 0x30, 0x00, "Start Buttons (4-player)")
307   PORT_DIPSETTING(    0x00, DEF_STR( Normal ))
311   PORT_DIPSETTING(    0x00, DEF_STR( Normal ) )
308312   PORT_DIPSETTING(    0x20, "Button A")
309313   PORT_DIPSETTING(    0x10, "Button B")
310   PORT_DIPSETTING(    0x30, DEF_STR( Normal ))
314   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
311315   PORT_DIPNAME( 0x40, 0x40, "PL 1&4 (4-player)")
312   PORT_DIPSETTING(    0x40, DEF_STR( Normal ))
316   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
313317   PORT_DIPSETTING(    0x00, "Rot 90")
314318   PORT_DIPNAME( 0x80, 0x00, "Player Mode")
315319   PORT_DIPSETTING(    0x80, "2")
316320   PORT_DIPSETTING(    0x00, "4")
317321
318   COMMON_PORTS_COINS
319
320322   PORT_START("P3")
321323   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
322324   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
r3115r3116
339341INPUT_PORTS_END
340342
341343static INPUT_PORTS_START (vball2pj)
342   COMMON_PORTS_BEFORE
344   PORT_INCLUDE( common )
343345
344346   /* The 2-player roms have the game-time in the difficulty spot, and
345347       I've assumed vice-versa. (VS the instructions scanned in Naz's dump) */
r3115r3116
350352   PORT_DIPSETTING(    0x01, "1:45")
351353   PORT_DIPSETTING(    0x03, "2:00")
352354   PORT_DIPSETTING(    0x02, "2:15")
353   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ))
355   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
354356   // This ordering is assumed. Someone has to play it a lot and find out.
355   PORT_DIPSETTING(    0x04, DEF_STR( Easy ))
356   PORT_DIPSETTING(    0x00, DEF_STR( Medium ))
357   PORT_DIPSETTING(    0x08, DEF_STR( Hard ))
358   PORT_DIPSETTING(    0x0c, DEF_STR( Very_Hard ))
359
360   COMMON_PORTS_COINS
357   PORT_DIPSETTING(    0x04, DEF_STR( Easy ) )
358   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
359   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
360   PORT_DIPSETTING(    0x0c, DEF_STR( Very_Hard ) )
361361INPUT_PORTS_END
362362
363363
src/mame/drivers/batman.c
r3115r3116
4242
4343static void update_interrupts(running_machine *machine)
4444{
45   int newstate = 0;
46
47   if (atarigen_scanline_int_state)
48      newstate |= 4;
49   if (atarigen_sound_int_state)
50      newstate |= 6;
51
52   if (newstate)
53      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
54   else
55      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
45   cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
46   cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
5647}
5748
5849
src/mame/drivers/nemesis.c
r3115r3116
278278   AM_RANGE(0x056000, 0x056fff) AM_READ(SMH_RAM)
279279   AM_RANGE(0x05a000, 0x05afff) AM_READ(SMH_RAM)
280280
281   AM_RANGE(0x05c400, 0x05c401) AM_READ_PORT("DSW0")   /* DSW0 */
282   AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW1")   /* DSW1 */
281   AM_RANGE(0x05c400, 0x05c401) AM_READ_PORT("DSW0")
282   AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW1")
283283
284   AM_RANGE(0x05cc00, 0x05cc01) AM_READ_PORT("IN0")   /* IN0 */
285   AM_RANGE(0x05cc02, 0x05cc03) AM_READ_PORT("IN1")   /* IN1 */
286   AM_RANGE(0x05cc04, 0x05cc05) AM_READ_PORT("IN2")   /* IN2 */
287   AM_RANGE(0x05cc06, 0x05cc07) AM_READ_PORT("TEST")   /* TEST */
284   AM_RANGE(0x05cc00, 0x05cc01) AM_READ_PORT("IN0")
285   AM_RANGE(0x05cc02, 0x05cc03) AM_READ_PORT("IN1")
286   AM_RANGE(0x05cc04, 0x05cc05) AM_READ_PORT("IN2")
287   AM_RANGE(0x05cc06, 0x05cc07) AM_READ_PORT("TEST")
288288
289289   AM_RANGE(0x060000, 0x067fff) AM_READ(SMH_RAM)
290290ADDRESS_MAP_END
r3115r3116
386386   AM_RANGE(0x056000, 0x056fff) AM_READ(SMH_RAM)
387387   AM_RANGE(0x05a000, 0x05afff) AM_READ(SMH_RAM)
388388
389   AM_RANGE(0x05c400, 0x05c401) AM_READ_PORT("DSW0")   /* DSW0 */
390   AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW1")   /* DSW1 */
389   AM_RANGE(0x05c400, 0x05c401) AM_READ_PORT("DSW0")
390   AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW1")
391391
392   AM_RANGE(0x05cc00, 0x05cc01) AM_READ_PORT("IN0")   /* IN0 */
393   AM_RANGE(0x05cc02, 0x05cc03) AM_READ_PORT("IN1")   /* IN1 */
394   AM_RANGE(0x05cc04, 0x05cc05) AM_READ_PORT("IN2")   /* IN2 */
395   AM_RANGE(0x05cc06, 0x05cc07) AM_READ_PORT("TEST")   /* TEST */
392   AM_RANGE(0x05cc00, 0x05cc01) AM_READ_PORT("IN0")
393   AM_RANGE(0x05cc02, 0x05cc03) AM_READ_PORT("IN1")
394   AM_RANGE(0x05cc04, 0x05cc05) AM_READ_PORT("IN2")
395   AM_RANGE(0x05cc06, 0x05cc07) AM_READ_PORT("TEST")
396396
397397   AM_RANGE(0x060000, 0x067fff) AM_READ(SMH_RAM)
398398   AM_RANGE(0x070000, 0x070001) AM_READ(konamigt_input_word_r)
r3115r3116
443443   AM_RANGE(0x056000, 0x056fff) AM_READ(SMH_RAM)
444444   AM_RANGE(0x057000, 0x057fff) AM_READ(SMH_RAM)
445445   AM_RANGE(0x05a000, 0x05afff) AM_READ(SMH_RAM)
446   AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW0")   /* DSW0 */
447   AM_RANGE(0x05c404, 0x05c405) AM_READ_PORT("DSW1")   /* DSW1 */
448   AM_RANGE(0x05c406, 0x05c407) AM_READ_PORT("TEST")   /* TEST */
449   AM_RANGE(0x05cc00, 0x05cc01) AM_READ_PORT("IN0")   /* IN0 */
450   AM_RANGE(0x05cc02, 0x05cc03) AM_READ_PORT("IN1")   /* IN1 */
451   AM_RANGE(0x05cc04, 0x05cc05) AM_READ_PORT("IN2")   /* IN2 */
446   AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW0")
447   AM_RANGE(0x05c404, 0x05c405) AM_READ_PORT("DSW1")
448   AM_RANGE(0x05c406, 0x05c407) AM_READ_PORT("TEST")
449   AM_RANGE(0x05cc00, 0x05cc01) AM_READ_PORT("IN0")
450   AM_RANGE(0x05cc02, 0x05cc03) AM_READ_PORT("IN1")
451   AM_RANGE(0x05cc04, 0x05cc05) AM_READ_PORT("IN2")
452452   AM_RANGE(0x060000, 0x07ffff) AM_READ(SMH_RAM)
453453   AM_RANGE(0x080000, 0x0bffff) AM_READ(SMH_ROM)
454454ADDRESS_MAP_END
r3115r3116
497497   AM_RANGE(0x055000, 0x055fff) AM_READ(SMH_RAM)
498498   AM_RANGE(0x056000, 0x056fff) AM_READ(SMH_RAM)
499499   AM_RANGE(0x05a000, 0x05afff) AM_READ(SMH_RAM)
500   AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW0")   /* DSW0 */
501   AM_RANGE(0x05c404, 0x05c405) AM_READ_PORT("DSW1")   /* DSW1 */
502   AM_RANGE(0x05c406, 0x05c407) AM_READ_PORT("TEST")   /* TEST */
503   AM_RANGE(0x05cc00, 0x05cc01) AM_READ_PORT("IN0")   /* IN0 */
504   AM_RANGE(0x05cc02, 0x05cc03) AM_READ_PORT("IN1")   /* IN1 */
505   AM_RANGE(0x05cc04, 0x05cc05) AM_READ_PORT("IN2")   /* IN2 */
500   AM_RANGE(0x05c402, 0x05c403) AM_READ_PORT("DSW0")
501   AM_RANGE(0x05c404, 0x05c405) AM_READ_PORT("DSW1")
502   AM_RANGE(0x05c406, 0x05c407) AM_READ_PORT("TEST")
503   AM_RANGE(0x05cc00, 0x05cc01) AM_READ_PORT("IN0")
504   AM_RANGE(0x05cc02, 0x05cc03) AM_READ_PORT("IN1")
505   AM_RANGE(0x05cc04, 0x05cc05) AM_READ_PORT("IN2")
506506   AM_RANGE(0x060000, 0x067fff) AM_READ(SMH_RAM)
507507   AM_RANGE(0x070000, 0x070001) AM_READ(konamigt_input_word_r)
508508   AM_RANGE(0x080000, 0x0bffff) AM_READ(SMH_ROM)
r3115r3116
565565   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)      /* ROM BIOS */
566566   AM_RANGE(0x080000, 0x087fff) AM_READ(SMH_RAM)
567567   AM_RANGE(0x090000, 0x091fff) AM_READ(SMH_RAM)
568   AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0")   /* DSW0 */
568   AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0")
569569   AM_RANGE(0x0c2000, 0x0c2001) AM_READ_PORT("IN0")   /* Coins, start buttons, test mode */
570   AM_RANGE(0x0c2002, 0x0c2003) AM_READ_PORT("IN1")   /* IN1 */
571   AM_RANGE(0x0c2004, 0x0c2005) AM_READ_PORT("IN2")   /* IN2 */
572   AM_RANGE(0x0c2006, 0x0c2007) AM_READ_PORT("DSW1")   /* DSW1 */
570   AM_RANGE(0x0c2002, 0x0c2003) AM_READ_PORT("IN1")
571   AM_RANGE(0x0c2004, 0x0c2005) AM_READ_PORT("IN2")
572   AM_RANGE(0x0c2006, 0x0c2007) AM_READ_PORT("DSW1")
573573   AM_RANGE(0x100000, 0x100fff) AM_READ(SMH_RAM)
574574   AM_RANGE(0x101000, 0x101fff) AM_READ(SMH_RAM)
575575   AM_RANGE(0x102000, 0x102fff) AM_READ(SMH_RAM)
r3115r3116
609609   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)  /* ROM BIOS */
610610   AM_RANGE(0x080000, 0x081fff) AM_READ(SMH_RAM)
611611   AM_RANGE(0x090000, 0x097fff) AM_READ(SMH_RAM)
612   AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0")   /* DSW0 */
612   AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW0")
613613   AM_RANGE(0x0c2000, 0x0c2001) AM_READ_PORT("IN0")   /* Coins, start buttons, test mode */
614   AM_RANGE(0x0c2002, 0x0c2003) AM_READ_PORT("IN1")   /* IN1 */
615   AM_RANGE(0x0c2004, 0x0c2005) AM_READ_PORT("IN2")   /* IN2 */
616   AM_RANGE(0x0c2006, 0x0c2007) AM_READ_PORT("DSW1")   /* DSW1 */
614   AM_RANGE(0x0c2002, 0x0c2003) AM_READ_PORT("IN1")
615   AM_RANGE(0x0c2004, 0x0c2005) AM_READ_PORT("IN2")
616   AM_RANGE(0x0c2006, 0x0c2007) AM_READ_PORT("DSW1")
617617   AM_RANGE(0x100000, 0x100fff) AM_READ(SMH_RAM)
618618   AM_RANGE(0x101000, 0x101fff) AM_READ(SMH_RAM)
619619   AM_RANGE(0x102000, 0x102fff) AM_READ(SMH_RAM)
r3115r3116
653653   AM_RANGE(0x000000, 0x01ffff) AM_READ(SMH_ROM)      /* ROM BIOS */
654654   AM_RANGE(0x080000, 0x087fff) AM_READ(SMH_RAM)
655655   AM_RANGE(0x0e0000, 0x0e1fff) AM_READ(SMH_RAM)
656   AM_RANGE(0x0f0000, 0x0f0001) AM_READ_PORT("DSW1")   /* DSW1 */
657   AM_RANGE(0x0f0002, 0x0f0003) AM_READ_PORT("IN2")   /* IN2 */
658   AM_RANGE(0x0f0004, 0x0f0005) AM_READ_PORT("IN1")   /* IN1 */
656   AM_RANGE(0x0f0000, 0x0f0001) AM_READ_PORT("DSW1")
657   AM_RANGE(0x0f0002, 0x0f0003) AM_READ_PORT("IN2")
658   AM_RANGE(0x0f0004, 0x0f0005) AM_READ_PORT("IN1")
659659   AM_RANGE(0x0f0006, 0x0f0007) AM_READ_PORT("IN0")   /* Coins, start buttons, test mode */
660   AM_RANGE(0x0f0008, 0x0f0009) AM_READ_PORT("DSW0")   /* DSW0 */
660   AM_RANGE(0x0f0008, 0x0f0009) AM_READ_PORT("DSW0")
661661   AM_RANGE(0x0f0020, 0x0f0021) AM_READ(SMH_NOP)      /* Analog device */
662662   AM_RANGE(0x100000, 0x1bffff) AM_READ(SMH_ROM)      /* ROM BIOS */
663663   AM_RANGE(0x200000, 0x20ffff) AM_READ(SMH_RAM)
r3115r3116
702702   AM_RANGE(0x040000, 0x047fff) AM_READ(SMH_RAM)
703703   AM_RANGE(0x060000, 0x061fff) AM_READ(SMH_RAM)
704704   AM_RANGE(0x100000, 0x13ffff) AM_READ(SMH_ROM)      /* ROM BIOS */
705   AM_RANGE(0x070000, 0x070001) AM_READ_PORT("DSW1")   /* DSW1 */
706   AM_RANGE(0x070002, 0x070003) AM_READ_PORT("IN2")   /* IN2 */
707   AM_RANGE(0x070004, 0x070005) AM_READ_PORT("IN1")   /* IN1 */
705   AM_RANGE(0x070000, 0x070001) AM_READ_PORT("DSW1")
706   AM_RANGE(0x070002, 0x070003) AM_READ_PORT("IN2")
707   AM_RANGE(0x070004, 0x070005) AM_READ_PORT("IN1")
708708   AM_RANGE(0x070006, 0x070007) AM_READ_PORT("IN0")   /* Coins, start buttons, test mode */
709   AM_RANGE(0x070008, 0x070009) AM_READ_PORT("DSW0")   /* DSW0 */
709   AM_RANGE(0x070008, 0x070009) AM_READ_PORT("DSW0")
710710   AM_RANGE(0x200000, 0x200fff) AM_READ(SMH_RAM)
711711   AM_RANGE(0x201000, 0x201fff) AM_READ(SMH_RAM)
712712   AM_RANGE(0x202000, 0x202fff) AM_READ(SMH_RAM)
r3115r3116
814814   AM_RANGE(0x0c2800, 0x0c2801) AM_WRITENOP
815815   AM_RANGE(0x0c2802, 0x0c2803) AM_WRITE(gx400_irq2_enable_word_w) // or at 0x0c2804 ?
816816   AM_RANGE(0x0c2804, 0x0c2805) AM_WRITENOP
817   AM_RANGE(0x0c4000, 0x0c4001) AM_WRITE(selected_ip_w) AM_READ(input_port_1_word_r)
817   AM_RANGE(0x0c4000, 0x0c4001) AM_READ_PORT("IN1") AM_WRITE(selected_ip_w)
818818   AM_RANGE(0x0c4002, 0x0c4003) AM_READ(selected_ip_r)   /* WEC Le Mans 24 control */ AM_WRITENOP /* latches the value read previously */
819819   AM_RANGE(0x100000, 0x100fff) AM_READ(SMH_RAM) AM_WRITE(nemesis_videoram1b_word_w) AM_BASE(&nemesis_videoram1b)   /* VRAM 1 */
820820   AM_RANGE(0x101000, 0x101fff) AM_READ(SMH_RAM) AM_WRITE(nemesis_videoram1f_word_w) AM_BASE(&nemesis_videoram1f)   /* VRAM 1 */
r3115r3116
870870
871871
872872static INPUT_PORTS_START( nemesis )
873   PORT_START("IN0")   /* IN0 */
873   PORT_START("IN0")
874874   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
875875   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
876876   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
r3115r3116
880880   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
881881   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
882882
883   PORT_START("IN1")   /* IN1 */
883   PORT_START("IN1")
884884   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
885885   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
886886   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
890890   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)   // missile
891891   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
892892
893   PORT_START("IN2")   /* IN2 */
893   PORT_START("IN2")
894894   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
895895   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
896896   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
900900   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
901901   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
902902
903   PORT_START("TEST")   /* TEST */
903   PORT_START("TEST")
904904   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWT:1")
905905   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
906906   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
914914   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
915915   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
916916
917   PORT_START("DSW0")   /* DSW0 */
917   PORT_START("DSW0")
918918   GX400_COINAGE_DIP
919919
920   PORT_START("DSW1")   /* DSW1 */
920   PORT_START("DSW1")
921921   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
922922   PORT_DIPSETTING(    0x03, "3" )
923923   PORT_DIPSETTING(    0x02, "4" )
r3115r3116
943943
944944
945945static INPUT_PORTS_START( nemesuk )
946   PORT_START("IN0")   /* IN0 */
946   PORT_START("IN0")
947947   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
948948   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
949949   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
r3115r3116
953953   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
954954   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
955955
956   PORT_START("IN1")   /* IN1 */
956   PORT_START("IN1")
957957   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
958958   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
959959   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
963963   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)   // missile
964964   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
965965
966   PORT_START("IN2")   /* IN2 */
966   PORT_START("IN2")
967967   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
968968   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
969969   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
973973   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
974974   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
975975
976   PORT_START("TEST")   /* TEST */
976   PORT_START("TEST")
977977   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWT:1")
978978   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
979979   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
987987   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
988988   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
989989
990   PORT_START("DSW0")   /* DSW0 */
990   PORT_START("DSW0")
991991   GX400_COINAGE_DIP
992992
993   PORT_START("DSW1")   /* DSW1 */
993   PORT_START("DSW1")
994994   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
995995   PORT_DIPSETTING(    0x03, "2" )
996996   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
10171017
10181018/* This needs to be sorted */
10191019static INPUT_PORTS_START( konamigt )
1020   PORT_START("IN0")   /* IN0 */
1020   PORT_START("IN0")
10211021   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
10221022   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
10231023   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
r3115r3116
10271027   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
10281028   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
10291029
1030   PORT_START("IN1")   /* IN1 */
1030   PORT_START("IN1")
10311031   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 ) /* gear */
10321032   PORT_BIT( 0xef, IP_ACTIVE_HIGH, IPT_UNKNOWN )
10331033
1034   PORT_START("IN2")   /* IN2 */
1034   PORT_START("IN2")
10351035   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
10361036
1037   PORT_START("TEST")   /* TEST */
1037   PORT_START("TEST")
10381038   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWT:1")
10391039   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
10401040   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
10481048   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
10491049   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
10501050
1051   PORT_START("DSW0")   /* DSW0 */
1051   PORT_START("DSW0")
10521052   GX400_COINAGE_DIP
10531053
1054   PORT_START("DSW1")   /* DSW1 */
1054   PORT_START("DSW1")
10551055   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1")
10561056   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
10571057   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
10761076   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
10771077   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10781078
1079   PORT_START("PADDLE")   /* IN6 */
1079   PORT_START("PADDLE")
10801080   PORT_BIT( 0x7f, 0x40, IPT_PADDLE ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10)
10811081
1082   PORT_START("IN3")   /* IN7 */
1082   PORT_START("IN3")
10831083   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
10841084   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
10851085//  PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 )
r3115r3116
10881088
10891089/* This needs to be sorted */
10901090static INPUT_PORTS_START( rf2 )
1091   PORT_START("IN0")   /* IN0 */
1091   PORT_START("IN0")
10921092   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
10931093   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
10941094   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
10981098   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
10991099   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
11001100
1101   PORT_START("IN1")   /* IN1 */
1101   PORT_START("IN1")
11021102   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* gear (0-7) */
11031103   PORT_BIT( 0x8f, IP_ACTIVE_LOW, IPT_UNKNOWN )
11041104
1105   PORT_START("IN2")   /* IN2 */
1105   PORT_START("IN2")
11061106   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
11071107
1108   PORT_START("TEST")   /* TEST */
1108   PORT_START("TEST")
11091109   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWT:1")
11101110   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
11111111   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
11191119   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
11201120   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
11211121
1122   PORT_START("DSW0")   /* DSW0 */
1122   PORT_START("DSW0")
11231123   GX400_COINAGE_DIP
11241124
1125   PORT_START("DSW1")   /* DSW1 */
1125   PORT_START("DSW1")
11261126   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1")
11271127   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
11281128   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
11471147   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
11481148   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11491149
1150   PORT_START("PADDLE")   /* IN6 */
1150   PORT_START("PADDLE")
11511151   PORT_BIT( 0x7f, 0x40, IPT_PADDLE ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10)
11521152
1153   PORT_START("IN3")   /* IN7 */
1153   PORT_START("IN3")
11541154   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
11551155   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
11561156//  PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 )
1157
11581157INPUT_PORTS_END
11591158
11601159
11611160static INPUT_PORTS_START( gwarrior )
1162   PORT_START("IN0")   /* IN0 */
1161   PORT_START("IN0")
11631162   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
11641163   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
11651164   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
11691168   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
11701169   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
11711170
1172   PORT_START("IN1")   /* IN1 */
1171   PORT_START("IN1")
11731172   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
11741173   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
11751174   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
11791178   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
11801179   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
11811180
1182   PORT_START("IN2")   /* IN2 */
1181   PORT_START("IN2")
11831182   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
11841183   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
11851184   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
11891188   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
11901189   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
11911190
1192   PORT_START("TEST")   /* TEST */
1191   PORT_START("TEST")
11931192   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWT:1")
11941193   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
11951194   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
12031202   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
12041203   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
12051204
1206   PORT_START("DSW0")   /* DSW0 */
1205   PORT_START("DSW0")
12071206   GX400_COINAGE_DIP
12081207
1209   PORT_START("DSW1")   /* DSW1 */
1208   PORT_START("DSW1")
12101209   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
12111210   PORT_DIPSETTING(    0x03, "1" )
12121211   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
12321231
12331232
12341233static INPUT_PORTS_START( twinbee )
1235   PORT_START("IN0")   /* IN0 */
1234   PORT_START("IN0")
12361235   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
12371236   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
12381237   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
12421241   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
12431242   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
12441243
1245   PORT_START("IN1")   /* IN1 */
1244   PORT_START("IN1")
12461245   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
12471246   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
12481247   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
12521251   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
12531252   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
12541253
1255   PORT_START("IN2")   /* IN2 */
1254   PORT_START("IN2")
12561255   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
12571256   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
12581257   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
12621261   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
12631262   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
12641263
1265   PORT_START("TEST")   /* TEST */
1264   PORT_START("TEST")
12661265   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWT:1")
12671266   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
12681267   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
12761275   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
12771276   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
12781277
1279   PORT_START("DSW0")   /* DSW0 */
1278   PORT_START("DSW0")
12801279   GX400_COINAGE_DIP
12811280
1282   PORT_START("DSW1")   /* DSW1 */
1281   PORT_START("DSW1")
12831282   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
12841283   PORT_DIPSETTING(    0x03, "2" )
12851284   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
13051304
13061305
13071306static INPUT_PORTS_START( gradius )
1308   PORT_START("IN0")   /* IN0 */
1307   PORT_START("IN0")
13091308   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
13101309   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
13111310   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
13151314   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
13161315   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
13171316
1318   PORT_START("IN1")   /* IN1 */
1317   PORT_START("IN1")
13191318   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
13201319   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
13211320   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
13251324   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)      // missile
13261325   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
13271326
1328   PORT_START("IN2")   /* IN2 */
1327   PORT_START("IN2")
13291328   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
13301329   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
13311330   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
13351334   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
13361335   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
13371336
1338   PORT_START("TEST")   /* TEST */
1337   PORT_START("TEST")
13391338   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWT:1")
13401339   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
13411340   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
13491348   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
13501349   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
13511350
1352   PORT_START("DSW0")   /* DSW0 */
1351   PORT_START("DSW0")
13531352   GX400_COINAGE_DIP
13541353
1355   PORT_START("DSW1")   /* DSW1 */
1354   PORT_START("DSW1")
13561355   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
13571356   PORT_DIPSETTING(    0x03, "3" )
13581357   PORT_DIPSETTING(    0x02, "4" )
r3115r3116
13781377
13791378
13801379static INPUT_PORTS_START( salamand )
1381   PORT_START("IN0")   /* IN0 */
1380   PORT_START("IN0")
13821381   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
13831382   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
13841383   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
r3115r3116
13921391   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13931392   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWT:3" )
13941393
1395   PORT_START("IN1")   /* IN1 */
1394   PORT_START("IN1")
13961395   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
13971396   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
13981397   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
14041403   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
14051404   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
14061405
1407   PORT_START("IN2")   /* IN2 */
1406   PORT_START("IN2")
14081407   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
14091408   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
14101409   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
14141413   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
14151414   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
14161415
1417   PORT_START("DSW0")   /* DSW0 */
1416   PORT_START("DSW0")
14181417   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW0:1,2,3,4")
14191418   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
14201419   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
14451444   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
14461445   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14471446
1448   PORT_START("DSW1")   /* DSW1 */
1447   PORT_START("DSW1")
14491448   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
14501449   PORT_DIPSETTING(    0x03, "2" )
14511450   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
14711470
14721471
14731472static INPUT_PORTS_START( lifefrcj )
1474   PORT_START("IN0")   /* IN0 */
1473   PORT_START("IN0")
14751474   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
14761475   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
14771476   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
r3115r3116
14851484   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14861485   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWT:3" )
14871486
1488   PORT_START("IN1")   /* IN1 */
1487   PORT_START("IN1")
14891488   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
14901489   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
14911490   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
14971496   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
14981497   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
14991498
1500   PORT_START("IN2")   /* IN2 */
1499   PORT_START("IN2")
15011500   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
15021501   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
15031502   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
15071506   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
15081507   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
15091508
1510   PORT_START("DSW0")   /* DSW0 */
1509   PORT_START("DSW0")
15111510   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW0:1,2,3,4")
15121511   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
15131512   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
15431542   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
15441543   PORT_DIPSETTING(    0x00, "Disabled" )
15451544
1546   PORT_START("DSW1")   /* DSW1 */
1545   PORT_START("DSW1")
15471546   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
15481547   PORT_DIPSETTING(    0x03, "3" )
15491548   PORT_DIPSETTING(    0x02, "4" )
r3115r3116
15681567INPUT_PORTS_END
15691568
15701569static INPUT_PORTS_START( blkpnthr )
1571   PORT_START("IN0")   /* IN0 */
1570   PORT_START("IN0")
15721571   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
15731572   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
15741573   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
r3115r3116
15831582   PORT_DIPSETTING(    0x40, "3 Areas" )
15841583   PORT_DIPSETTING(    0x00, "4 Areas" )
15851584
1586   PORT_START("IN1")   /* IN1 */
1585   PORT_START("IN1")
15871586   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
15881587   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
15891588   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
15931592   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
15941593   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWT:3" )
15951594
1596   PORT_START("IN2")   /* IN2 */
1595   PORT_START("IN2")
15971596   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
15981597   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
15991598   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
16031602   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
16041603   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
16051604
1606   PORT_START("DSW0")   /* DSW0 */
1605   PORT_START("DSW0")
16071606   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW0:1,2,3,4")
16081607   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
16091608   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
16391638   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
16401639   PORT_DIPSETTING(    0x00, "Disabled" )
16411640
1642   PORT_START("DSW1")   /* DSW1 */
1641   PORT_START("DSW1")
16431642   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
16441643   PORT_DIPSETTING(    0x03, "3" )
16451644   PORT_DIPSETTING(    0x02, "4" )
r3115r3116
16641663INPUT_PORTS_END
16651664
16661665static INPUT_PORTS_START( citybomb )
1667   PORT_START("IN0")   /* IN0 */
1666   PORT_START("IN0")
16681667   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
16691668   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
16701669   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
16781677   PORT_DIPSETTING(    0x00, DEF_STR( Dual ) )
16791678   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWT:3" )
16801679
1681   PORT_START("IN1")   /* IN1 */
1680   PORT_START("IN1")
16821681   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
16831682   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
16841683   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
16901689   PORT_DIPSETTING(    0x00, "Handle" )
16911690   PORT_DIPSETTING(    0x80, DEF_STR( Joystick ) )
16921691
1693   PORT_START("IN2")   /* IN2 */
1692   PORT_START("IN2")
16941693   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
16951694   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
16961695   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
17001699   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
17011700   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
17021701
1703   PORT_START("DSW0")   /* DSW0 */
1702   PORT_START("DSW0")
17041703   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW0:1,2,3,4")
17051704   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
17061705   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
17361735   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
17371736   PORT_DIPSETTING(    0x00, "Disabled" )
17381737
1739   PORT_START("DSW1")   /* DSW1 */
1738   PORT_START("DSW1")
17401739   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1")
17411740   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
17421741   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
r3115r3116
17561755INPUT_PORTS_END
17571756
17581757static INPUT_PORTS_START( nyanpani )
1759   PORT_START("IN0")   /* IN0 */
1758   PORT_START("IN0")
17601759   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
17611760   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
17621761   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
17681767   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
17691768   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWT:2" )
17701769
1771   PORT_START("IN1")   /* IN1 */
1770   PORT_START("IN1")
17721771   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
17731772   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
17741773   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
17781777   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
17791778   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
17801779
1781   PORT_START("IN2")   /* IN2 */
1780   PORT_START("IN2")
17821781   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
17831782   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
17841783   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
17881787   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
17891788   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
17901789
1791   PORT_START("DSW0")   /* DSW0 */
1790   PORT_START("DSW0")
17921791   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW0:1,2,3,4")
17931792   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
17941793   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
18241823   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
18251824   PORT_DIPSETTING(    0x00, "Disabled" )
18261825
1827   PORT_START("DSW1")   /* DSW1 */
1826   PORT_START("DSW1")
18281827   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
18291828   PORT_DIPSETTING(    0x03, "2" )
18301829   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
18411840INPUT_PORTS_END
18421841
18431842static INPUT_PORTS_START( hcrash )
1844   PORT_START("IN0") /* IN0 */
1843   PORT_START("IN0")
18451844   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
18461845   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
18471846   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
r3115r3116
18511850   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
18521851   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
18531852
1854   PORT_START("IN1")   /* IN1 */
1853   PORT_START("IN1")
18551854   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
18561855   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
18571856   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
r3115r3116
18611860   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
18621861   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
18631862
1864   PORT_START("IN2")   /* IN2 */
1863   PORT_START("IN2")
18651864   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
18661865
1867   PORT_START("TEST")   /* TEST */
1866   PORT_START("TEST")
18681867   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWT:1")
18691868   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
18701869   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
18881887   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
18891888   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
18901889
1891   PORT_START("DSW0")   /* DSW0 */
1890   PORT_START("DSW0")
18921891   GX400_COINAGE_DIP
18931892
1894   PORT_START("DSW1")   /* DSW1 */
1893   PORT_START("DSW1")
18951894   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1,2")
18961895   PORT_DIPSETTING(    0x03, "Konami GT without brake" )
18971896   PORT_DIPSETTING(    0x02, "WEC Le Mans 24 Upright" )
r3115r3116
19161915   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
19171916
19181917   /* Konami GT specific control */
1919   PORT_START("PADDLE")   /* IN6 */
1918   PORT_START("PADDLE")
19201919   PORT_BIT( 0x7f, 0x40, IPT_PADDLE ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10)
19211920
1922   PORT_START("IN3")   /* IN7 */
1921   PORT_START("IN3")
19231922   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Brake (Konami GT cabinet)")
19241923   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
19251924//  PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 )
19261925
19271926   /* WEC Le Mans 24 specific control */
1928   PORT_START("ACCEL")   /* IN8 - Accelerator */
1927   PORT_START("ACCEL")      /* Accelerator */
19291928   PORT_BIT( 0xff, 0, IPT_PEDAL ) PORT_MINMAX(0,0x80) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
19301929
1931   PORT_START("WHEEL")   /* IN9 - Steering Wheel */
1930   PORT_START("WHEEL")      /* Steering Wheel */
19321931   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5)
19331932INPUT_PORTS_END
19341933
src/mame/drivers/asteroid.c
r3115r3116
265265static ADDRESS_MAP_START( llander_map, ADDRESS_SPACE_PROGRAM, 8 )
266266   ADDRESS_MAP_GLOBAL_MASK(0x7fff)
267267   AM_RANGE(0x0000, 0x00ff) AM_RAM AM_MIRROR(0x1f00)
268   AM_RANGE(0x2000, 0x2000) AM_READ(llander_IN0_r)      /* IN0 */
268   AM_RANGE(0x2000, 0x2000) AM_READ_PORT("IN0")
269269   AM_RANGE(0x2400, 0x2407) AM_READ(asteroid_IN1_r)   /* IN1 */
270270   AM_RANGE(0x2800, 0x2803) AM_READ(asteroid_DSW1_r)   /* DSW1 */
271271   AM_RANGE(0x2c00, 0x2c00) AM_READ_PORT("PADDLE")
r3115r3116
287287 *
288288 *************************************/
289289
290static CUSTOM_INPUT( clock_r )
291{
292   return (cpunum_gettotalcycles(0) & 0x100) ? 1 : 0;
293}
294
290295static INPUT_PORTS_START( asteroid )
291296   PORT_START("IN0")
292297   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
293   /* Bit 2 and 3 are handled in the machine dependent part. */
294298   /* Bit 2 is the 3 KHz source and Bit 3 the VG_HALT bit    */
295   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
296   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
299   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(clock_r, NULL)
300   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
297301   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_CODE(KEYCODE_SPACE) PORT_CODE(JOYCODE_BUTTON3)      /* hyperspace */
298302   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1)   /* fire */
299303   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Diagnostic Step") PORT_CODE(KEYCODE_F1)
r3115r3116
346350   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
347351   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
348352   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
349   /* Bit 7 is VG_HALT, handled in the machine dependent part */
350   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
353   /* Bit 7 is VG_HALT */
354   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
351355
352356   PORT_MODIFY("IN1")
353357   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
r3115r3116
371375   PORT_INCLUDE( asteroid )
372376
373377   PORT_MODIFY("IN0")
374   /* Bit 0 is VG_HALT, handled in the machine dependent part */
375   /* Bit 2 is the 3 KHz source */
378   /* Bit 0 is VG_HALT and Bit 2 is the 3 KHz source */
379   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
380   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
381   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(clock_r, NULL)
376382   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_SPACE) PORT_CODE(JOYCODE_BUTTON3)      /* hyperspace */
377383   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1)      /* fire */
378384   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Diagnostic Step") PORT_CODE(KEYCODE_F1)
r3115r3116
411417static INPUT_PORTS_START( astdelux )
412418   PORT_START("IN0")
413419   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* According to schematics */
414   /* Bit 2 and 3 are handled in the machine dependent part. */
415420   /* Bit 2 is the 3 KHz source and Bit 3 the VG_HALT bit    */
416   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
417   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
421   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(clock_r, NULL)
422   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
418423   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_CODE(KEYCODE_SPACE) PORT_CODE(JOYCODE_BUTTON3)      /* hyperspace */
419424   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1)   /* fire */
420425   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Diagnostic Step") PORT_CODE(KEYCODE_F1)
r3115r3116
494499
495500static INPUT_PORTS_START( llander )
496501   PORT_START("IN0")
497   /* Bit 0 is VG_HALT, handled in the machine dependent part */
498   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
502   /* Bit 0 is VG_HALT */
503   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
499504   PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
500505   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
501506   /* Of the rest, Bit 6 is the 3KHz source. 3,4 and 5 are unknown */
502   PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNKNOWN )
507   PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNKNOWN )
508   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(clock_r, NULL)
503509   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Diagnostic Step") PORT_CODE(KEYCODE_F1)
504510
505511   PORT_START("IN1")
r3115r3116
873879
874880static DRIVER_INIT( asteroib )
875881{
876   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2000, 0, 0, asteroib_IN0_r);
882   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2000, 0, 0, input_port_read_handler8(machine->portconfig, "IN0"));
877883   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2003, 0x2003, 0, 0, input_port_read_handler8(machine->portconfig, "HS"));
878884}
879885
src/mame/drivers/powerbal.c
r3115r3116
6161   }
6262}
6363
64static READ16_HANDLER( magicstk_port2_r )
65{
66   return (input_port_read(machine, "IN2") & 0xfe) | eeprom_read_bit();
67}
68
6964static WRITE16_HANDLER( magicstk_coin_eeprom_w )
7065{
7166   if (ACCESSING_BITS_0_7)
r3115r3116
113108   AM_RANGE(0x098180, 0x09917f) AM_RAM_WRITE(magicstk_bgvideoram_w) AM_BASE(&magicstk_videoram)
114109   AM_RANGE(0x0c2010, 0x0c2011) AM_READ_PORT("IN0")
115110   AM_RANGE(0x0c2012, 0x0c2013) AM_READ_PORT("IN1")
116   AM_RANGE(0x0c2014, 0x0c2015) AM_READWRITE(magicstk_port2_r, magicstk_coin_eeprom_w)
111   AM_RANGE(0x0c2014, 0x0c2015) AM_READ_PORT("IN2") AM_WRITE(magicstk_coin_eeprom_w)
117112   AM_RANGE(0x0c2016, 0x0c2017) AM_READ_PORT("DSW1")
118113   AM_RANGE(0x0c2018, 0x0c2019) AM_READ_PORT("DSW2")
119114   AM_RANGE(0x0c201c, 0x0c201d) AM_WRITE(oki_banking)
r3115r3116
250245   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
251246
252247   PORT_START("IN2")
253   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM data */
248   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
254249   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
255250   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
256251   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/stv.c
r3115r3116
20562056   AM_RANGE(0x100000, 0x100fff) AM_READWRITE(scsp_0_r, scsp_0_w)
20572057ADDRESS_MAP_END
20582058
2059#define STV_PLAYER_INPUTS(_n_, _b1_, _b2_, _b3_, _b4_) \
2060   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_##_b1_         ) PORT_PLAYER(_n_) \
2061   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_##_b2_         ) PORT_PLAYER(_n_) \
2062   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_##_b3_         ) PORT_PLAYER(_n_) \
2063   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_##_b4_         ) PORT_PLAYER(_n_) \
2064   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_PLAYER(_n_) \
2065   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_PLAYER(_n_) \
2066   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(_n_) \
2067   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_PLAYER(_n_)
2059#define STV_PLAYER_INPUTS(_n_, _b1_, _b2_, _b3_)                     \
2060   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_##_b1_ ) PORT_PLAYER(_n_)         \
2061   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_##_b2_ ) PORT_PLAYER(_n_)         \
2062   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_##_b3_ ) PORT_PLAYER(_n_)         \
2063   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )                     \
2064   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(_n_)      \
2065   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(_n_)      \
2066   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(_n_)   \
2067   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(_n_)
20682068
20692069static INPUT_PORTS_START( stv )
20702070   PORT_START("DSW1")
r3115r3116
21202120   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21212121
21222122   PORT_START("P1")
2123   STV_PLAYER_INPUTS(1, BUTTON1, BUTTON2, BUTTON3, BUTTON4)
2123   STV_PLAYER_INPUTS(1, BUTTON1, BUTTON2, BUTTON3)
21242124
21252125   PORT_START("P2")
2126   STV_PLAYER_INPUTS(2, BUTTON1, BUTTON2, BUTTON3, BUTTON4)
2126   STV_PLAYER_INPUTS(2, BUTTON1, BUTTON2, BUTTON3)
21272127/*
21282128    PORT_START("P3")
2129    STV_PLAYER_INPUTS(3, BUTTON1, BUTTON2, BUTTON3, BUTTON4)
2129    STV_PLAYER_INPUTS(3, BUTTON1, BUTTON2, BUTTON3)
21302130
21312131    PORT_START("P4")
2132    STV_PLAYER_INPUTS(4, BUTTON1, BUTTON2, BUTTON3, BUTTON4)
2132    STV_PLAYER_INPUTS(4, BUTTON1, BUTTON2, BUTTON3)
21332133*/
21342134
21352135   PORT_START("SYSTEM")
r3115r3116
21462146   PORT_START("UNUSED")
21472147   PORT_BIT ( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
21482148
2149   /* Extra button layout,used by Power Instinct 3 & Suikoenbu */
2149   /* Extra button layout, used by Power Instinct 3, Suikoenbu, Elan Doree, Golden Axe Duel & Astra SuperStar */
21502150   PORT_START("EXTRA")
21512151   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
21522152   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
r3115r3116
21992199   /* IN 8 */
22002200   PORT_START("LIGHTY")
22012201   PORT_BIT( 0x3f, 0x00, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0x0,0x3f) PORT_SENSITIVITY(50) PORT_KEYDELTA(1) PORT_PLAYER(1)
2202INPUT_PORTS_END
22022203
2204static INPUT_PORTS_START( batmanfr )
2205   PORT_INCLUDE( stv )
2206
2207   PORT_MODIFY("P1")
2208   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
2209
2210   PORT_MODIFY("P2")
2211   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
2212
2213   PORT_MODIFY("EXTRA")
2214   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
22032215INPUT_PORTS_END
22042216
2205/* Same as the regular one,but with an additional & optional mahjong panel */
2217/* Same as the regular one, but with an additional & optional mahjong panel */
22062218static INPUT_PORTS_START( stvmp )
22072219   PORT_INCLUDE( stv )
22082220
r3115r3116
37033715
37043716GAME( 1996, stvbios,   0, stv, stv,  stv,       ROT0,   "Sega",                      "ST-V Bios", GAME_IS_BIOS_ROOT )
37053717
3706//GBX   YEAR, NAME,      PARENT,  BIOS,    MACH,INP, INIT,      MONITOR
3718//GAME YEAR, NAME,     PARENT,  MACH, INP, INIT,      MONITOR
37073719/* Playable */
37083720GAME( 1998, astrass,   stvbios, stv, stv,  astrass,   ROT0,   "Sunsoft",               "Astra SuperStars (J 980514 V1.002)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
37093721GAME( 1995, bakubaku,  stvbios, stv, stv,  bakubaku,  ROT0,   "Sega",                   "Baku Baku Animal (J 950407 V1.000)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
3710GAME( 1996, batmanfr,  stvbios, stv, stv,  batmanfr, ROT0,  "Acclaim",               "Batman Forever (JUE 960507 V1.000)", GAME_NO_SOUND )
3722GAME( 1996, batmanfr,  stvbios, stv, batmanfr,batmanfr, ROT0, "Acclaim",               "Batman Forever (JUE 960507 V1.000)", GAME_NO_SOUND )
37113723GAME( 1996, colmns97,  stvbios, stv, stv,  colmns97,  ROT0,   "Sega",                   "Columns '97 (JET 961209 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37123724GAME( 1997, cotton2,   stvbios, stv, stv,  cotton2,   ROT0,   "Success",                "Cotton 2 (JUET 970902 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37133725GAME( 1998, cottonbm,  stvbios, stv, stv,  cottonbm,  ROT0,   "Success",                "Cotton Boomerang (JUET 980709 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3714GAME( 1995, critcrsh,  stvbios, stv, critcrsh, ic13,  ROT0, "Sega",                    "Critter Crusher (EA 951204 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3726GAME( 1995, critcrsh,  stvbios, stv, critcrsh, ic13,  ROT0,   "Sega",                    "Critter Crusher (EA 951204 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37153727GAME( 1999, danchih,   stvbios, stv, stvmp,danchih,   ROT0,   "Altron (Tecmo license)",   "Danchi de Hanafuda (J 990607 V1.400)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37163728GAME( 1996, diehard,   stvbios, stv, stv,  diehard,   ROT0,   "Sega",                   "Die Hard Arcade (UET 960515 V1.000)", GAME_IMPERFECT_SOUND  )
37173729GAME( 1996, dnmtdeka,  diehard, stv, stv,  dnmtdeka,  ROT0,   "Sega",                   "Dynamite Deka (J 960515 V1.000)", GAME_IMPERFECT_SOUND  )
src/mame/drivers/timelimt.c
r3115r3116
5959   AM_RANGE(0x8800, 0x8bff) AM_READ(SMH_RAM)      /* video ram */
6060   AM_RANGE(0x9000, 0x97ff) AM_READ(SMH_RAM)      /* background ram */
6161   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)      /* sprite ram */
62   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)/* input port */
63   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)/* input port */
64   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)/* DSW */
62   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("INPUTS")
63   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("SYSTEM")
64   AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW")
6565   AM_RANGE(0xb800, 0xb800) AM_READ(SMH_NOP)      /* NMI ack? */
6666ADDRESS_MAP_END
6767
r3115r3116
114114/***************************************************************************/
115115
116116static INPUT_PORTS_START( timelimt )
117   PORT_START("IN0")
117   PORT_START("INPUTS")
118118   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
119119   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
120120   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
r3115r3116
124124   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* probably unused */
125125   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* probably unused */
126126
127   PORT_START("IN1")
127   PORT_START("SYSTEM")
128128   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
129129   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
130130   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
r3115r3116
134134   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* probably unused */
135135   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* probably unused */
136136
137   PORT_START("DSW1")
137   PORT_START("DSW")
138138   PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) )
139139   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
140140   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
r3115r3116
159159INPUT_PORTS_END
160160
161161static INPUT_PORTS_START( progress )
162   PORT_START("IN0")
162   PORT_START("INPUTS")
163163   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
164164   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
165165   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
r3115r3116
169169   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* probably unused */
170170   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 )
171171
172   PORT_START("IN1")
172   PORT_START("SYSTEM")
173173   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
174174   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
175175   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
r3115r3116
179179   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* probably unused */
180180   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* probably unused */
181181
182   PORT_START("DSW1")
182   PORT_START("DSW")
183183   PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) )
184184   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
185185   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
src/mame/drivers/igs_blit.c
r3115r3116
426426      UINT16 x = src[i];
427427
428428      if ((i & 0x1100) != 0x0100)
429         x ^= 0x0002;
429         x ^= 0x0200;
430430
431431      if ((i & 0x0150) != 0x0000 && (i & 0x0152) != 0x0010)
432         x ^= 0x0400;
432         x ^= 0x0004;
433433
434434      if ((i & 0x2084) != 0x2084 && (i & 0x2094) != 0x2014)
435         x ^= 0x2000;
435         x ^= 0x0020;
436436
437      src[i] = (x >> 8) | (x <<8);
437      src[i] = x;
438438   }
439439}
440440
r3115r3116
509509      UINT16 x = src[i];
510510
511511      if ((i & 0x0054) != 0x0000 && (i & 0x0056) != 0x0010)
512         x ^= 0x0400;
512         x ^= 0x0004;
513513
514514      if ((i & 0x0204) == 0x0000)
515          x ^= 0x0800;
515          x ^= 0x0008;
516516
517517      if ((i & 0x3080) != 0x3080 && (i & 0x3090) != 0x3010)
518         x ^= 0x2000;
518         x ^= 0x0020;
519519
520520      j = BITSWAP24(i, 23,22,21,20,19,18,17,16,15,14,13, 8, 11,10, 9, 2, 7,6,5,4,3, 12, 1,0);
521521
522      result_data[j] = (x >> 8) | (x << 8);
522      result_data[j] = x;
523523   }
524524
525525   memcpy(src,result_data,rom_size);
r3115r3116
540540      UINT16 x = src[i];
541541
542542      if((i & 0x4100) == 0x0100)
543         x ^= 0x0002;
543         x ^= 0x0200;
544544
545545      if((i & 0x4000) == 0x4000 && (i & 0x0300) != 0x0100)
546         x ^= 0x0002;
546         x ^= 0x0200;
547547
548548      if((i & 0x5700) == 0x5100)
549         x ^= 0x0002;
549         x ^= 0x0200;
550550
551551      if((i & 0x5500) == 0x1000)
552         x ^= 0x0002;
552         x ^= 0x0200;
553553
554554      if((i & 0x0140) != 0x0000 || (i & 0x0012) == 0x0012)
555         x ^= 0x0400;
555         x ^= 0x0004;
556556
557557      if((i & 0x2004) != 0x2004 || (i & 0x0090) == 0x0000)
558         x ^= 0x2000;
558         x ^= 0x0020;
559559
560       src[i] = (x << 8) | (x >> 8);
560       src[i] = x;
561561     }
562562}
563563
r3115r3116
576576      if( i & 0x1000/2 )
577577      {
578578         if( ~i & 0x400/2 )
579            x ^= 0x0002;
579            x ^= 0x0200;
580580      }
581581
582582      if( i & 0x4000/2 )
r3115r3116
584584         if( i & 0x100/2 )
585585         {
586586            if( ~i & 0x08/2 )
587               x ^= 0x2000;
587               x ^= 0x0020;
588588         }
589589         else
590590         {
591591            if( ~i & 0x28/2 )
592               x ^= 0x2000;
592               x ^= 0x0020;
593593         }
594594      }
595595      else
596596      {
597         x ^= 0x2000;
597         x ^= 0x0020;
598598      }
599599
600600      if( i & 0x200/2 )
601601      {
602         x ^= 0x0400;
602         x ^= 0x0004;
603603      }
604604      else
605605      {
606606         if( (i & 0x80/2) == 0x80/2 || (i & 0x24/2) == 0x24/2 )
607            x ^= 0x0400;
607            x ^= 0x0004;
608608      }
609609
610      src[i] = (x << 8) | (x >> 8);
610      src[i] = x;
611611   }
612612}
613613
r3115r3116
28962896
28972897ROM_START( chmplst2 )
28982898   ROM_REGION( 0x80000, "main", 0 )
2899   ROM_LOAD( "maj2v185h.u29", 0x00000, 0x80000, CRC(2572d59a) SHA1(1d5362e209dadf8b21c10d1351d4bb038bfcaaef) )
2899   ROM_LOAD16_WORD_SWAP( "maj2v185h.u29", 0x00000, 0x80000, CRC(2572d59a) SHA1(1d5362e209dadf8b21c10d1351d4bb038bfcaaef) )
29002900
29012901   ROM_REGION( 0x200000, "gfx1", 0 )
29022902   ROM_LOAD( "igsm0501.u7", 0x00000, 0x200000, CRC(1c952bd6) SHA1(a6b6f1cdfb29647e81c032ffe59c94f1a10ceaf8) )
r3115r3116
31353135ROM_START( lhb )
31363136   ROM_REGION( 0x80000, "main", 0 )
31373137   // identical to LHB-4096
3138   ROM_LOAD( "v305j-409", 0x00000, 0x80000, CRC(701de8ef) SHA1(4a77160f642f4de02fa6fbacf595b75c0d4a505d) )
3138   ROM_LOAD16_WORD_SWAP( "v305j-409", 0x00000, 0x80000, CRC(701de8ef) SHA1(4a77160f642f4de02fa6fbacf595b75c0d4a505d) )
31393139
31403140   ROM_REGION( 0x200000, "gfx1", 0 )
31413141   ROM_LOAD( "m0201-ig.160", 0x000000, 0x200000, CRC(ec54452c) SHA1(0ee7ffa3d4845af083944e64faf5a1c78247aaa2) )
r3115r3116
31973197
31983198ROM_START( lhba )
31993199   ROM_REGION( 0x80000, "main", 0 )
3200   ROM_LOAD( "maj_v-033c.u30", 0x00000, 0x80000, CRC(02a0b716) SHA1(cd0ee32ea69f66768196b0e9b4df0fae3af84ed3) )
3200   ROM_LOAD16_WORD_SWAP( "maj_v-033c.u30", 0x00000, 0x80000, CRC(02a0b716) SHA1(cd0ee32ea69f66768196b0e9b4df0fae3af84ed3) )
32013201
32023202   ROM_REGION( 0x200000, "gfx1", 0 )
32033203   ROM_LOAD( "igs_m0201.u15", 0x000000, 0x200000, CRC(ec54452c) SHA1(0ee7ffa3d4845af083944e64faf5a1c78247aaa2) )
r3115r3116
32593259
32603260ROM_START( dbc )
32613261   ROM_REGION( 0x80000, "main", 0 )
3262   ROM_LOAD( "maj-h_v027h.u30", 0x00000, 0x80000, CRC(5d5ccd5b) SHA1(7a1223923f9a5825fd919ae9a36912284e705382) )
3262   ROM_LOAD16_WORD_SWAP( "maj-h_v027h.u30", 0x00000, 0x80000, CRC(5d5ccd5b) SHA1(7a1223923f9a5825fd919ae9a36912284e705382) )
32633263
32643264   ROM_REGION( 0x280000, "gfx1", 0 )
32653265   ROM_LOAD( "igs_m0201.u15", 0x000000, 0x200000, CRC(ec54452c) SHA1(0ee7ffa3d4845af083944e64faf5a1c78247aaa2) )
r3115r3116
32953295
32963296ROM_START( vbowl )
32973297   ROM_REGION( 0x80000, "main", 0 )
3298   ROM_LOAD( "bowlingv101xcm.u45", 0x00000, 0x80000, BAD_DUMP CRC(ab8e3f1f) SHA1(69159e22559d6a26fe2afafd770aa640c192ba4b) )
3298   ROM_LOAD16_WORD_SWAP( "bowlingv101xcm.u45", 0x00000, 0x80000, BAD_DUMP CRC(ab8e3f1f) SHA1(69159e22559d6a26fe2afafd770aa640c192ba4b) )
32993299
33003300   ROM_REGION( 0x400000 * 2, "gfx1", 0)
33013301   ROM_LOAD( "vrbowlng.u69", 0x000000, 0x400000, CRC(b0d339e8) SHA1(a26a5e0202a78e8cdc562b10d64e14eadfa4e115) )
r3115r3116
33143314
33153315ROM_START( vbowlj )
33163316   ROM_REGION( 0x80000, "main", 0 )
3317   ROM_LOAD( "vrbowlng.u45", 0x00000, 0x80000, CRC(091c19c1) SHA1(5a7bfbee357122e9061b38dfe988c3853b0984b0) ) // second half all 00
3317   ROM_LOAD16_WORD_SWAP( "vrbowlng.u45", 0x00000, 0x80000, CRC(091c19c1) SHA1(5a7bfbee357122e9061b38dfe988c3853b0984b0) ) // second half all 00
33183318
33193319   ROM_REGION( 0x400000 * 2, "gfx1", 0)
33203320   ROM_LOAD( "vrbowlng.u69", 0x000000, 0x400000, CRC(b0d339e8) SHA1(a26a5e0202a78e8cdc562b10d64e14eadfa4e115) )
r3115r3116
33463346
33473347ROM_START( xymg )
33483348   ROM_REGION( 0x80000, "main", 0 )
3349   ROM_LOAD( "u30-ebac.rom", 0x00000, 0x80000, CRC(7d272b6f) SHA1(15fd1be23cabdc77b747541f5cd9fed6b08be4ad) )
3349   ROM_LOAD16_WORD_SWAP( "u30-ebac.rom", 0x00000, 0x80000, CRC(7d272b6f) SHA1(15fd1be23cabdc77b747541f5cd9fed6b08be4ad) )
33503350
33513351   ROM_REGION( 0x280000, "gfx1", 0 )
33523352   ROM_LOAD( "m0201-ig.160", 0x000000, 0x200000, CRC(ec54452c) SHA1(0ee7ffa3d4845af083944e64faf5a1c78247aaa2) )
r3115r3116
33653365
33663366***************************************************************************/
33673367
3368GAME( 1995, lhb,      0,        lhb,      lhb,      lhb,      ROT0, "IGS",        "Long Hu Bang (V035C)",               0 )
3369GAME( 1995, lhba,     lhb,      lhb,      lhb,      lhba,     ROT0, "IGS",        "Long Hu Bang (V033C)",               0 )
3370GAME( 1995, dbc,      0,        lhb,      lhb,      dbc,      ROT0, "IGS",        "Da Ban Cheng (V027H)",               0 )
3371GAME( 1996, chmplst2, 0,        chmplst2, chmplst2, chmplst2, ROT0, "IGS",        "Long Hu Bang II (V185H)",            0 )
3372GAME( 1996, xymg,     0,        xymg,     xymg,     xymg,     ROT0, "IGS",        "PinYin: Xing Yun Man Guan (V651C)",          0 )
3373GAME( 1996, grtwall,  xymg,     grtwall,  grtwall,  grtwall,  ROT0, "IGS",        "Wan Li Chang Cheng (V638C)",         0 )
3374GAME( 1996, vbowl,    0,        vbowl,    vbowl,    vbowl,    ROT0, "IGS",        "Virtua Bowling (World, V101XCM)",    GAME_IMPERFECT_SOUND )
3375GAME( 1996, vbowlj,   vbowl,    vbowl,    vbowlj,   vbowlj,   ROT0, "IGS / Alta", "Virtua Bowling (Japan, V100JCM)",    GAME_IMPERFECT_SOUND )
3376GAME( 1997, drgnwrld, 0,        chindrag, drgnwrld, drgnwrld, ROT0, "IGS",        "Dragon World (World, V0400)",        0 )
3377GAME( 1995, drgwrld3, drgnwrld, chindrag, drgnwrld, drgwrld3, ROT0, "IGS",        "Dragon World (World, V0300)",        0 )
3378GAME( 1995, chindrag, drgnwrld, chindrag, chindrag, chindrag, ROT0, "IGS / Alta", "Zhong Guo Long (Japan, V021J)",      0 )
3379GAME( 1995, chugokur, drgnwrld, chindrag, chindrag, chugokur, ROT0, "IGS / Alta", "Zhong Guo Long (Japan, V020J)",      0 )
3380GAME( 1995, chindrac, drgnwrld, chindrag, chindrac, chindrac, ROT0, "IGS",        "Zhong Guo Long (China, V010C)",      0 )
3381GAME( 1995, chindrah, drgnwrld, chindrag, chindrac, chindrah, ROT0, "IGS",        "Zhong Guo Long? (Hong Kong, V011H)", 0 )
3368GAME( 1995, lhb,      0,        lhb,      lhb,      lhb,      ROT0, "IGS",        "Long Hu Bang (V035C)",                 0 )
3369GAME( 1995, lhba,     lhb,      lhb,      lhb,      lhba,     ROT0, "IGS",        "Long Hu Bang (V033C)",                 0 )
3370GAME( 1995, dbc,      0,        lhb,      lhb,      dbc,      ROT0, "IGS",        "Da Ban Cheng (V027H)",                 0 )
3371GAME( 1996, chmplst2, 0,        chmplst2, chmplst2, chmplst2, ROT0, "IGS",        "Long Hu Bang II (V185H)",              0 )
3372GAME( 1996, xymg,     0,        xymg,     xymg,     xymg,     ROT0, "IGS",        "Xing Yun Man Guan (V651C)",            0 )
3373GAME( 1996, grtwall,  xymg,     grtwall,  grtwall,  grtwall,  ROT0, "IGS",        "Wan Li Chang Cheng (V638C)",           0 )
3374GAME( 1996, vbowl,    0,        vbowl,    vbowl,    vbowl,    ROT0, "IGS",        "Virtua Bowling (World, V101XCM)",      GAME_IMPERFECT_SOUND )
3375GAME( 1996, vbowlj,   vbowl,    vbowl,    vbowlj,   vbowlj,   ROT0, "IGS / Alta", "Virtua Bowling (Japan, V100JCM)",      GAME_IMPERFECT_SOUND )
3376GAME( 1997, drgnwrld, 0,        chindrag, drgnwrld, drgnwrld, ROT0, "IGS",        "Dragon World (World, V0400)",          0 )
3377GAME( 1995, drgwrld3, drgnwrld, chindrag, drgnwrld, drgwrld3, ROT0, "IGS",        "Dragon World (World, V0300)",          0 )
3378GAME( 1995, chindrag, drgnwrld, chindrag, chindrag, chindrag, ROT0, "IGS / Alta", "Zhong Guo Long (Japan, V021J)",        0 )
3379GAME( 1995, chugokur, drgnwrld, chindrag, chindrag, chugokur, ROT0, "IGS / Alta", "Zhong Guo Long (Japan, V020J)",        0 )
3380GAME( 1995, chindrac, drgnwrld, chindrag, chindrac, chindrac, ROT0, "IGS",        "Zhong Guo Long (China, V010C)",        0 )
3381GAME( 1995, chindrah, drgnwrld, chindrag, chindrac, chindrah, ROT0, "IGS",        "Dong Fang Zhi Zhu (Hong Kong, V011H)", 0 )
src/mame/drivers/vamphalf.c
r3115r3116
200200   semicom_prot_idx = 8;
201201}
202202
203static READ32_HANDLER( finalgdr_input0_r )
204{
205   return input_port_read(machine, "P1_P2") << 16;
206}
207
208static READ32_HANDLER( finalgdr_input1_r )
209{
210   return input_port_read(machine, "SYSTEM") << 16;
211}
212
213203static WRITE32_HANDLER( finalgdr_oki_bank_w )
214204{
215205   okim6295_set_bank_base(0, 0x40000 * ((data & 0x300) >> 8));
r3115r3116
318308   AM_RANGE(0x2c00, 0x2dff) AM_READWRITE(finalgdr_backupram_r, finalgdr_backupram_w)
319309   AM_RANGE(0x3000, 0x3003) AM_WRITE(ym2151_register32_w)
320310   AM_RANGE(0x3004, 0x3007) AM_READWRITE(ym2151_status32_r, ym2151_data32_w)
321   AM_RANGE(0x3800, 0x3803) AM_READ(finalgdr_input0_r)
311   AM_RANGE(0x3800, 0x3803) AM_READ_PORT("P1_P2")
322312   AM_RANGE(0x3400, 0x3403) AM_READWRITE(oki32_r, oki32_w)
323   AM_RANGE(0x3c00, 0x3c03) AM_READ(finalgdr_input1_r)
313   AM_RANGE(0x3c00, 0x3c03) AM_READ_PORT("SYSTEM")
324314   AM_RANGE(0x4400, 0x4403) AM_READ(eeprom32_r)
325315   AM_RANGE(0x6000, 0x6003) AM_READNOP //?
326316   AM_RANGE(0x6000, 0x6003) AM_WRITE(finalgdr_eeprom_w)
r3115r3116
436426
437427static INPUT_PORTS_START( common )
438428   PORT_START("P1_P2")
439   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_PLAYER(1)
440   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_PLAYER(1)
441   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_PLAYER(1)
429   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
430   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
431   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
442432   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
443433   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
444434   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
445435   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
446436   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
447   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_PLAYER(2)
448   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_PLAYER(2)
449   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_PLAYER(2)
437   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
438   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
439   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
450440   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
451441   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
452442   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
r3115r3116
466456INPUT_PORTS_END
467457
468458static INPUT_PORTS_START( finalgdr )
469   PORT_INCLUDE( common )
459   PORT_START("P1_P2")
460   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
461   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
462   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
463   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
464   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
465   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
466   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
467   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_START1 )
468   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
469   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
470   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
471   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
472   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
473   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
474   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
475   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_START2 )
470476
471   PORT_MODIFY("P1_P2")
472   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
473   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
474
475   PORT_MODIFY("SYSTEM")
476   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
477   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
478   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
479   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
480   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
481   PORT_SERVICE_NO_TOGGLE( 0x0080, IP_ACTIVE_LOW )
477   PORT_START("SYSTEM")
478   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN1 )
479   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 )
480   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_UNKNOWN )
481   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_UNKNOWN )
482   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNKNOWN )
483   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNKNOWN )
484   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_SERVICE1 )
485   PORT_SERVICE_NO_TOGGLE( 0x00800000, IP_ACTIVE_LOW )
482486INPUT_PORTS_END
483487
484488
src/mame/drivers/mayumi.c
r3115r3116
197197   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNKNOWN )
198198   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
199199
200   PORT_START("KEY5")   /* P2 IN0 (7) */ \
200   PORT_START("KEY5")   /* P2 IN0 (7) */
201201   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2)
202202   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2)
203203   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2)
src/mame/drivers/raiden.c
r3115r3116
3131        There are also strings for Spanish, Greece, Mexico, Middle &
3232        South America though it's not clear if they are used.
3333
34    Todo: add support for Coin Mode B
35
3634    One of the boards is SEI8904 with SEI9008 subboard.
3735
3836***************************************************************************/
r3115r3116
6159   AM_RANGE(0x00000, 0x06fff) AM_RAM
6260   AM_RANGE(0x07000, 0x07fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
6361   AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE(1) AM_BASE(&raiden_shared_ram)
64   AM_RANGE(0x0b000, 0x0b001) AM_READ(input_port_1_word_r)
65   AM_RANGE(0x0b002, 0x0b003) AM_READ(input_port_2_word_r)
62   AM_RANGE(0x0b000, 0x0b001) AM_READ_PORT("P1_P2")
63   AM_RANGE(0x0b002, 0x0b003) AM_READ_PORT("DSW")
6664   AM_RANGE(0x0b000, 0x0b007) AM_WRITE(raiden_control_w)
6765   AM_RANGE(0x0c000, 0x0c7ff) AM_WRITE(raiden_text_w) AM_BASE(&videoram16)
6866   AM_RANGE(0x0d000, 0x0d00d) AM_READWRITE(seibu_main_word_r, seibu_main_word_w)
r3115r3116
8886   AM_RANGE(0x08000, 0x08fff) AM_RAM AM_SHARE(1) AM_BASE(&raiden_shared_ram)
8987   AM_RANGE(0x0a000, 0x0a00d) AM_READWRITE(seibu_main_word_r, seibu_main_word_w)
9088   AM_RANGE(0x0c000, 0x0c7ff) AM_WRITE(raiden_text_w) AM_BASE(&videoram16)
91   AM_RANGE(0x0e000, 0x0e001) AM_READ(input_port_1_word_r)
89   AM_RANGE(0x0e000, 0x0e001) AM_READ_PORT("P1_P2")
9290   AM_RANGE(0x0e000, 0x0e007) AM_WRITE(raidena_control_w)
93   AM_RANGE(0x0e002, 0x0e003) AM_READ(input_port_2_word_r)
91   AM_RANGE(0x0e002, 0x0e003) AM_READ_PORT("DSW")
9492   AM_RANGE(0x0f000, 0x0f035) AM_WRITE(SMH_RAM) AM_BASE(&raiden_scroll_ram)
9593   AM_RANGE(0xa0000, 0xfffff) AM_ROM
9694ADDRESS_MAP_END
r3115r3116
10098static INPUT_PORTS_START( raiden )
10199   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
102100
103   PORT_START("P1_P2")   /* IN0 */
101   PORT_START("P1_P2")
104102   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
105103   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
106104   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
118116   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
119117   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
120118
121   PORT_START("DSW")   /* Dip switch A */
122   PORT_DIPNAME( 0x0001, 0x0001, "Coin Mode" )
119   PORT_START("DSW")
120   PORT_DIPNAME( 0x0001, 0x0001, "Coin Mode" ) PORT_DIPLOCATION("SW1:1")
123121   PORT_DIPSETTING(      0x0001, "A" )
124122   PORT_DIPSETTING(      0x0000, "B" )
125123   /* Coin Mode A */
126   PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) )
124   PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_CONDITION("DSW", 0x0001, PORTCOND_EQUALS, 0x0001) PORT_DIPLOCATION("SW1:2,3,4,5")
127125   PORT_DIPSETTING(      0x0014, DEF_STR( 6C_1C ) )
128126   PORT_DIPSETTING(      0x0016, DEF_STR( 5C_1C ) )
129127   PORT_DIPSETTING(      0x0018, DEF_STR( 4C_1C ) )
r3115r3116
140138   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_5C ) )
141139   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
142140   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
143/*  PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) )
141   /* Coin Mode B */
142   PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_CONDITION("DSW", 0x0001, PORTCOND_NOTEQUALS, 0x0001) PORT_DIPLOCATION("SW1:2,3")
144143    PORT_DIPSETTING(      0x0000, "5C/1C or Free if Coin B too" )
145144    PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
146145    PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) )
147146    PORT_DIPSETTING(      0x0006, DEF_STR( 1C_1C ) )
148    PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) )
147    PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Coin_B ) ) PORT_CONDITION("DSW", 0x0001, PORTCOND_NOTEQUALS, 0x0001) PORT_DIPLOCATION("SW1:4,5")
149148    PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) )
150149    PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
151150    PORT_DIPSETTING(      0x0008, DEF_STR( 1C_5C ) )
152    PORT_DIPSETTING(      0x0000, "1C/6C or Free if Coin A too" ) */
153   PORT_DIPNAME( 0x0020, 0x0020, "Credits to Start" )
151    PORT_DIPSETTING(      0x0000, "1C/6C or Free if Coin A too" )
152
153   PORT_DIPNAME( 0x0020, 0x0020, "Credits to Start" ) PORT_DIPLOCATION("SW1:6")
154154   PORT_DIPSETTING(      0x0020, "1" )
155155   PORT_DIPSETTING(      0x0000, "2" )
156   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
157   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
158   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
159   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
156   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW1:7")
157   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8")
160158   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
161159   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
162   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
160   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
163161   PORT_DIPSETTING(      0x0200, "1" )
164162   PORT_DIPSETTING(      0x0100, "2" )
165163   PORT_DIPSETTING(      0x0300, "3" )
166164   PORT_DIPSETTING(      0x0000, "5" )
167   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Bonus_Life ) )
165   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3,4")
168166   PORT_DIPSETTING(      0x0800, "80000 300000" )
169167   PORT_DIPSETTING(      0x0c00, "150000 400000" )
170168   PORT_DIPSETTING(      0x0400, "300000 1000000" )
171169   PORT_DIPSETTING(      0x0000, "1000000 5000000" )
172   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) )
170   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
173171   PORT_DIPSETTING(      0x2000, DEF_STR( Easy ) )
174172   PORT_DIPSETTING(      0x3000, DEF_STR( Normal ) )
175173   PORT_DIPSETTING(      0x1000, DEF_STR( Hard ) )
176174   PORT_DIPSETTING(      0x0000, DEF_STR( Very_Hard ) )
177   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) )
175   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:7")
178176   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
179177   PORT_DIPSETTING(      0x4000, DEF_STR( Yes ) )
180   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Demo_Sounds ) )
178   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8")
181179   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
182180   PORT_DIPSETTING(      0x8000, DEF_STR( On ) )
183181INPUT_PORTS_END
src/mame/drivers/vegaeo.c
r3115r3116
8383static ADDRESS_MAP_START( vega_map, ADDRESS_SPACE_PROGRAM, 32 )
8484   AM_RANGE(0x00000000, 0x001fffff) AM_RAM
8585   AM_RANGE(0x80000000, 0x80013fff) AM_READWRITE(vega_vram_r, vega_vram_w)
86   AM_RANGE(0xfc000000, 0xfc0000ff) AM_READWRITE8(at28c16_0_r, at28c16_0_w, 0xffffffff)
86   AM_RANGE(0xfc000000, 0xfc0000ff) AM_DEVREADWRITE8(AT28C16, "at28c16", at28c16_r, at28c16_w, 0xffffffff)
8787   AM_RANGE(0xfc200000, 0xfc2003ff) AM_RAM_WRITE(vega_palette_w) AM_BASE(&paletteram32)
8888   AM_RANGE(0xfc400000, 0xfc40005b) AM_WRITENOP // crt registers ?
8989   AM_RANGE(0xfc600000, 0xfc600003) AM_WRITENOP // soundlatch
r3115r3116
102102   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_START2 )
103103   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
104104   PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
105   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(eolith_speedup_getvblank, 0)
105   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(eolith_speedup_getvblank, NULL)
106106   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED )
107107   PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED )
108108
r3115r3116
168168
169169   /* sound cpu */
170170
171   MDRV_NVRAM_HANDLER(at28c16_0)
172
173171   /* video hardware */
174172   MDRV_SCREEN_ADD("main", RASTER)
175173   MDRV_SCREEN_REFRESH_RATE(60)
r3115r3116
184182   MDRV_VIDEO_UPDATE(vega)
185183
186184   /* sound hardware */
185   MDRV_DEVICE_ADD( "at28c16", AT28C16 )
187186MACHINE_DRIVER_END
188187
189188/*
r3115r3116
267266static DRIVER_INIT( vegaeo )
268267{
269268   init_eolith_speedup(machine);
270
271   at28c16_init( 0, NULL, NULL );
272269}
273270
274271GAME( 2002, crazywar, 0, vega, crazywar, vegaeo, ROT0, "Eolith", "Crazy War",  GAME_NO_SOUND )
src/mame/drivers/rallyx.c
r3115r3116
318318   AM_RANGE(0x0000, 0x3fff) AM_ROM
319319   AM_RANGE(0x8000, 0x8fff) AM_RAM_WRITE(rallyx_videoram_w) AM_BASE(&rallyx_videoram)
320320   AM_RANGE(0x9800, 0x9fff) AM_RAM
321   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
322   AM_RANGE(0xa080, 0xa080) AM_READ(input_port_1_r)
323   AM_RANGE(0xa100, 0xa100) AM_READ(input_port_2_r)
321   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("P1")
322   AM_RANGE(0xa080, 0xa080) AM_READ_PORT("P2")
323   AM_RANGE(0xa100, 0xa100) AM_READ_PORT("DSW")
324324   AM_RANGE(0xa000, 0xa00f) AM_WRITE(SMH_RAM) AM_BASE(&rallyx_radarattr)
325325   AM_RANGE(0xa080, 0xa080) AM_WRITE(watchdog_reset_w)
326326   AM_RANGE(0xa100, 0xa11f) AM_WRITE(pacman_sound_w) AM_BASE(&namco_soundregs)
r3115r3116
340340   AM_RANGE(0x0000, 0x7fff) AM_ROM
341341   AM_RANGE(0x8000, 0x8fff) AM_RAM_WRITE(rallyx_videoram_w) AM_BASE(&rallyx_videoram)
342342   AM_RANGE(0x9800, 0x9fff) AM_RAM
343   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
344   AM_RANGE(0xa080, 0xa080) AM_READ(input_port_1_r)
345   AM_RANGE(0xa100, 0xa100) AM_READ(input_port_2_r)
346   AM_RANGE(0xa180, 0xa180) AM_READ(input_port_3_r)
343   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("P1")
344   AM_RANGE(0xa080, 0xa080) AM_READ_PORT("P2")
345   AM_RANGE(0xa100, 0xa100) AM_READ_PORT("DSW1")
346   AM_RANGE(0xa180, 0xa180) AM_READ_PORT("DSW2")
347347   AM_RANGE(0xa000, 0xa00f) AM_MIRROR(0x00f0) AM_WRITE(SMH_RAM) AM_BASE(&rallyx_radarattr)   // jungler writes to a03x
348348   AM_RANGE(0xa080, 0xa080) AM_WRITE(watchdog_reset_w)
349349   AM_RANGE(0xa100, 0xa100) AM_WRITE(soundlatch_w)
r3115r3116
355355
356356
357357static INPUT_PORTS_START( rallyx )
358   PORT_START("IN0")
358   PORT_START("P1")
359359   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
360360   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
361361   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
r3115r3116
365365   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
366366   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
367367
368   PORT_START("IN1")
368   PORT_START("P2")
369369   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
370370   PORT_DIPSETTING(   0x01, DEF_STR( Upright ) )
371371   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
r3115r3116
377377   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
378378   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
379379
380   PORT_START("DSW0")
380   PORT_START("DSW")
381381   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coinage ) )
382382   PORT_DIPSETTING(   0x40, DEF_STR( 2C_1C ) )
383383   PORT_DIPSETTING(   0xc0, DEF_STR( 1C_1C ) )
r3115r3116
393393   PORT_DIPSETTING(   0x20, "3 Cars, Medium" )
394394   PORT_DIPSETTING(   0x38, "3 Cars, Hard" )
395395   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Bonus_Life ) )
396   PORT_DIPSETTING(   0x02, "10000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x10)
397   PORT_DIPSETTING(   0x02, "10000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x28)
398   PORT_DIPSETTING(   0x02, "15000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x00)
399   PORT_DIPSETTING(   0x02, "15000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x18)
400   PORT_DIPSETTING(   0x02, "15000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x30)
401   PORT_DIPSETTING(   0x02, "20000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x08)
402   PORT_DIPSETTING(   0x02, "20000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x20)
403   PORT_DIPSETTING(   0x02, "20000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x38)
404   PORT_DIPSETTING(   0x04, "20000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x10)
405   PORT_DIPSETTING(   0x04, "20000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x28)
406   PORT_DIPSETTING(   0x04, "30000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x00)
407   PORT_DIPSETTING(   0x04, "30000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x18)
408   PORT_DIPSETTING(   0x04, "30000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x30)
409   PORT_DIPSETTING(   0x04, "40000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x08)
410   PORT_DIPSETTING(   0x04, "40000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x20)
411   PORT_DIPSETTING(   0x04, "40000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x38)
412   PORT_DIPSETTING(   0x06, "30000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x10)
413   PORT_DIPSETTING(   0x06, "30000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x28)
414   PORT_DIPSETTING(   0x06, "40000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x00)
415   PORT_DIPSETTING(   0x06, "40000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x18)
416   PORT_DIPSETTING(   0x06, "40000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x30)
417   PORT_DIPSETTING(   0x06, "60000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x08)
418   PORT_DIPSETTING(   0x06, "60000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x20)
419   PORT_DIPSETTING(   0x06, "60000" )      PORT_CONDITION("DSW0",0x38,PORTCOND_EQUALS,0x38)
396   PORT_DIPSETTING(   0x02, "15000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x00)
397   PORT_DIPSETTING(   0x04, "30000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x00)
398   PORT_DIPSETTING(   0x06, "40000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x00)
399
400   PORT_DIPSETTING(   0x02, "20000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x08)
401   PORT_DIPSETTING(   0x04, "40000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x08)
402   PORT_DIPSETTING(   0x06, "60000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x08)
403
404   PORT_DIPSETTING(   0x02, "10000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x10)
405   PORT_DIPSETTING(   0x04, "20000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x10)
406   PORT_DIPSETTING(   0x06, "30000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x10)
407
408   PORT_DIPSETTING(   0x02, "15000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x18)
409   PORT_DIPSETTING(   0x04, "30000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x18)
410   PORT_DIPSETTING(   0x06, "40000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x18)
411
412   PORT_DIPSETTING(   0x02, "20000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x20)
413   PORT_DIPSETTING(   0x04, "40000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x20)
414   PORT_DIPSETTING(   0x06, "60000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x20)
415
416   PORT_DIPSETTING(   0x02, "10000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x28)
417   PORT_DIPSETTING(   0x04, "20000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x28)
418   PORT_DIPSETTING(   0x06, "30000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x28)
419
420   PORT_DIPSETTING(   0x02, "15000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x30)
421   PORT_DIPSETTING(   0x04, "30000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x30)
422   PORT_DIPSETTING(   0x06, "40000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x30)
423
424   PORT_DIPSETTING(   0x02, "20000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x38)
425   PORT_DIPSETTING(   0x04, "40000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x38)
426   PORT_DIPSETTING(   0x06, "60000" )      PORT_CONDITION("DSW", 0x38, PORTCOND_EQUALS, 0x38)
420427   PORT_DIPSETTING(   0x00, DEF_STR( None ) )
421428   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
422429INPUT_PORTS_END
423430
424431static INPUT_PORTS_START( nrallyx )
425   PORT_START("IN0")
432   PORT_START("P1")
426433   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
427434   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
428435   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
r3115r3116
432439   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
433440   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
434441
435   PORT_START("IN1")
442   PORT_START("P2")
436443   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
437444   PORT_DIPSETTING(   0x01, DEF_STR( Upright ) )
438445   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
r3115r3116
470477
471478
472479static INPUT_PORTS_START( jungler )
473   PORT_START("IN0")
480   PORT_START("P1")
474481   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
475482   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
476483   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
480487   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
481488   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
482489
483   PORT_START("IN1")
490   PORT_START("P2")
484491   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
485492   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
486493   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
490497   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
491498   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
492499
493   PORT_START("DSW0")      /* Sound board */
500   PORT_START("DSW1")      /* Sound board */
494501   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
495502   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
496503
497   PORT_START("DSW1")      /* CPU board */
504   PORT_START("DSW2")      /* CPU board */
498505   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
499506   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
500507   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
r3115r3116
523530
524531
525532static INPUT_PORTS_START( locomotn )
526   PORT_START("IN0")
533   PORT_START("P1")
527534   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
528535   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
529536   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
533540   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
534541   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
535542
536   PORT_START("IN1")
543   PORT_START("P2")
537544   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
538545   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
539546   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
543550   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
544551   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
545552
546   PORT_START("DSW0")      /* Sound board */
553   PORT_START("DSW1")      /* Sound board */
547554   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
548555   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
549556   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
r3115r3116
564571   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
565572   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
566573
567   PORT_START("DSW1")      /* CPU board */
574   PORT_START("DSW2")      /* CPU board */
568575   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
569576   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
570577   PORT_DIPSETTING(    0x0a, DEF_STR( 3C_1C ) )
r3115r3116
603610
604611
605612static INPUT_PORTS_START( tactcian )
606   PORT_START("IN0")
613   PORT_START("P1")
607614   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
608615   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
609616   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
613620   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
614621   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
615622
616   PORT_START("IN1")
623   PORT_START("P2")
617624   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
618625   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
619626   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
r3115r3116
623630   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
624631   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
625632
626   PORT_START("DSW0")      /* Sound board */
633   PORT_START("DSW1")      /* Sound board */
627634   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
628635   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
629636   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
r3115r3116
650657   PORT_DIPSETTING(    0x00, "10k, 80k then every 100k" )
651658   PORT_DIPSETTING(    0x01, "20k, 80k then every 100k" )
652659
653   PORT_START("DSW1")      /* CPU board */
660   PORT_START("DSW2")      /* CPU board */
654661   PORT_DIPNAME( 0x01, 0x00, "Coin Mode" )
655662   PORT_DIPSETTING(    0x00, "Mode 1" )
656663   PORT_DIPSETTING(    0x01, "Mode 2" )
r3115r3116
679686
680687
681688static INPUT_PORTS_START( commsega )
682   PORT_START("IN0")
689   PORT_START("P1")
683690   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
684691   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
685692   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
689696   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
690697   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
691698
692   PORT_START("IN1")
699   PORT_START("P2")
693700   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
694701   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
695702   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
r3115r3116
699706   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
700707   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
701708
702   PORT_START("DSW0")      /* (sound board) */
709   PORT_START("DSW1")      /* (sound board) */
703710   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
704711   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
705712   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
r3115r3116
721728   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
722729   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
723730
724   PORT_START("DSW1")      /* (CPU board) */
731   PORT_START("DSW2")      /* (CPU board) */
725732   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
726733   PORT_DIPSETTING(    0x03, "3" )
727734   PORT_DIPSETTING(    0x02, "4" )
src/mame/drivers/trucocl.c
r3115r3116
9191   AM_RANGE(0x4400, 0x47ff) AM_RAM_WRITE(trucocl_colorram_w) AM_BASE(&colorram)
9292   AM_RANGE(0x4c00, 0x4fff) AM_RAM
9393   AM_RANGE(0x5000, 0x5000) AM_WRITE(irq_enable_w)
94   AM_RANGE(0x5000, 0x503f) AM_READ(input_port_0_r)   /* IN0 */
94   AM_RANGE(0x5000, 0x503f) AM_READ_PORT("IN0")
9595   AM_RANGE(0x5080, 0x5080) AM_WRITE(audio_dac_w)
9696   AM_RANGE(0x50c0, 0x50c0) AM_WRITE(watchdog_reset_w)
9797   AM_RANGE(0x8000, 0xffff) AM_ROM
src/mame/drivers/igs_m68.c
r3115r3116
1111IGS017
1212IGS029
1313
14All of these have encrypted program roms, which will need decrypting
15
1614*/
1715
1816#include "driver.h"
r3115r3116
3028
3129static ADDRESS_MAP_START( igs_m68_map, ADDRESS_SPACE_PROGRAM, 16 )
3230   AM_RANGE(0x000000, 0x07ffff) AM_ROM
31   AM_RANGE(0x100000, 0x103fff) AM_RAM //to test the decryption
32   AM_RANGE(0x300000, 0x303fff) AM_RAM //to test the decryption
33   AM_RANGE(0x500000, 0x503fff) AM_RAM //to test the decryption
3334ADDRESS_MAP_END
3435
3536static INPUT_PORTS_START( igs_m68 )
r3115r3116
112113
113114ROM_START( lhzb2 )
114115   ROM_REGION( 0x80000, "main", 0 ) /* 68000 Code */
115   ROM_LOAD( "p1100.u30", 0x00000, 0x80000, CRC(68102b25) SHA1(6c1e8d204be0efda0e9b6c2f49b5c6760712475f) )
116   ROM_LOAD16_WORD_SWAP( "p1100.u30", 0x00000, 0x80000, CRC(68102b25) SHA1(6c1e8d204be0efda0e9b6c2f49b5c6760712475f) )
116117
117118   ROM_REGION( 0x80000, "oki", 0 ) /* Samples */
118119   ROM_LOAD( "s1102.u23", 0x00000, 0x80000, CRC(51ffe245) SHA1(849011b186096add657ab20d49d260ec23363ef3) )
r3115r3116
127128
128129ROM_START( lhzb2a )
129130   ROM_REGION( 0x80000, "main", 0 ) /* 68000 Code */
130   ROM_LOAD( "p-4096", 0x00000, 0x80000, CRC(41293f32) SHA1(df4e993f4a458729ade13981e58f32d8116c0082) )
131   ROM_LOAD16_WORD_SWAP( "p-4096", 0x00000, 0x80000, CRC(41293f32) SHA1(df4e993f4a458729ade13981e58f32d8116c0082) )
131132
132133   ROM_REGION( 0x80000, "oki", 0 ) /* Samples */
133134   ROM_LOAD( "s1102.u23", 0x00000, 0x80000, CRC(51ffe245) SHA1(849011b186096add657ab20d49d260ec23363ef3) )
r3115r3116
184185
185186ROM_START( mgcs )
186187   ROM_REGION( 0x80000, "main", 0 ) /* 68000 Code */
187   ROM_LOAD( "p1500.u8", 0x00000, 0x80000, CRC(a8cb5905) SHA1(37be7d926a1352869632d43943763accd4dec4b7) )
188   ROM_LOAD16_WORD_SWAP( "p1500.u8", 0x00000, 0x80000, CRC(a8cb5905) SHA1(37be7d926a1352869632d43943763accd4dec4b7) )
188189
189190   ROM_REGION( 0x80000, "oki", 0 ) /* Samples */
190191   ROM_LOAD( "s1502.u10", 0x00000, 0x80000, CRC(a8a6ba58) SHA1(59276a8ab4a31812600816c2a43b74bd71394419) )
r3115r3116
239240
240241ROM_START( slqz2 )
241242   ROM_REGION( 0x80000, "main", 0 ) /* 68000 Code */
242   ROM_LOAD( "p1100.u28", 0x00000, 0x80000, CRC(0b8e5c9e) SHA1(16572bd1163bba4da8a76b10649d2f71e50ad369) )
243   ROM_LOAD16_WORD_SWAP( "p1100.u28", 0x00000, 0x80000, CRC(0b8e5c9e) SHA1(16572bd1163bba4da8a76b10649d2f71e50ad369) )
243244
244245   ROM_REGION( 0x80000, "oki", 0 ) /* Samples */
245246   ROM_LOAD( "s1102.u20", 0x00000, 0x80000, CRC(51ffe245) SHA1(849011b186096add657ab20d49d260ec23363ef3) ) // = s1102.u23 Mahjong Long Hu Zheng Ba 2
r3115r3116
261262
262263IGS PCB NO-0147-6
263264|---------------------------------------|
264| UPC1242H          S0903.U15   BATTERY|
265| UPC1242H          S0903.U15   BATTERY |
265266|          VOL               SPDT_SW    |
266267|                                       |
267268|        K668                    6264   |
r3115r3116
297298
298299ROM_START( sdmg2 )
299300   ROM_REGION( 0x80000, "main", 0 ) /* 68000 Code */
300   ROM_LOAD( "p0900.u25", 0x00000, 0x80000,CRC(43366f51) SHA1(48dd965dceff7de15b43c2140226a8b17a792dbc) )
301   ROM_LOAD16_WORD_SWAP( "p0900.u25", 0x00000, 0x80000,CRC(43366f51) SHA1(48dd965dceff7de15b43c2140226a8b17a792dbc) )
301302
302303   ROM_REGION( 0x80000, "oki", 0 ) /* Samples */
303304   ROM_LOAD( "s0903.u15", 0x00000, 0x80000, CRC(ae5a441c) SHA1(923774ef73ab0f70e0db1738a4292dcbd70d2384) )
r3115r3116
309310ROM_END
310311
311312
312GAME( 1998, lhzb2,    0,        igs_m68,    igs_m68,    0, ROT0,  "IGS", "Mahjong Long Hu Zheng Ba 2 (set 1)", GAME_NOT_WORKING )
313GAME( 1998, lhzb2a,   lhzb2,    igs_m68,    igs_m68,    0, ROT0,  "IGS", "Mahjong Long Hu Zheng Ba 2 (set 2)", GAME_NOT_WORKING )
314GAME( 1998, mgcs,     0,        igs_m68,    igs_m68,    0, ROT0,  "IGS", "Mahjong Man Guan Cai Shen", GAME_NOT_WORKING )
315GAME( 1998, slqz2,    0,        igs_m68,    igs_m68,    0, ROT0,  "IGS", "Mahjong Shuang Long Qiang Zhu 2", GAME_NOT_WORKING )
316GAME( 1997, sdmg2,    0,        igs_m68,    igs_m68,    0, ROT0,  "IGS", "Mahjong Super Da Man Guan 2", GAME_NOT_WORKING )
313static DRIVER_INIT( lhzb2 )
314{
315   int i;
316   UINT16 *src = (UINT16 *) (memory_region(machine, "main"));
317317
318   int rom_size = 0x80000;
319
320   for (i=0; i<rom_size/2; i++)
321   {
322      UINT16 x = src[i];
323
324      /* bit 0 xor layer */
325
326      if( i & 0x20/2 )
327      {
328         if( i & 0x02/2 )
329         {
330            x ^= 0x0001;
331         }
332      }
333
334      if( !(i & 0x4000/2) )
335      {
336         if( !(i & 0x300/2) )
337         {
338            x ^= 0x0001;
339         }
340      }
341
342      /* bit 13 xor layer */
343
344      if( !(i & 0x1000/2) )
345      {
346         if( i & 0x2000/2 )
347         {
348            if( i & 0x8000/2 )
349            {
350               if( !(i & 0x100/2) )
351               {
352                  if( i & 0x200/2 )
353                  {
354                     if( !(i & 0x40/2) )
355                     {
356                        x ^= 0x2000;
357                     }
358                  }
359                  else
360                  {
361                     x ^= 0x2000;
362                  }
363               }
364            }
365            else
366            {
367               if( !(i & 0x100/2) )
368               {
369                  x ^= 0x2000;
370               }
371            }
372         }
373         else
374         {
375            if( i & 0x8000/2 )
376            {
377               if( i & 0x200/2 )
378               {
379                  if( !(i & 0x40/2) )
380                  {
381                     x ^= 0x2000;
382                  }
383               }
384               else
385               {
386                  x ^= 0x2000;
387               }
388            }
389            else
390            {
391               x ^= 0x2000;
392            }
393         }
394      }
395
396      src[i] = x;
397   }
398
399
400}
401
402static DRIVER_INIT( lhzb2a )
403{
404   int i;
405   UINT16 *src = (UINT16 *) (memory_region(machine, "main"));
406
407   int rom_size = 0x80000;
408
409   for (i=0; i<rom_size/2; i++)
410   {
411      UINT16 x = src[i];
412
413      /* bit 0 xor layer */
414
415      if( i & 0x20/2 )
416      {
417         if( i & 0x02/2 )
418         {
419            x ^= 0x0001;
420         }
421      }
422
423      if( !(i & 0x4000/2) )
424      {
425         if( !(i & 0x300/2) )
426         {
427            x ^= 0x0001;
428         }
429      }
430
431      /* bit 5 xor layer */
432
433      if( i & 0x4000/2 )
434      {
435         if( i & 0x8000/2 )
436         {
437            if( i & 0x2000/2 )
438            {
439               if( i & 0x200/2 )
440               {
441                  if( !(i & 0x40/2) || (i & 0x800/2) )
442                  {
443                     x ^= 0x0020;
444                  }
445               }
446            }
447         }
448         else
449         {
450            if( !(i & 0x40/2) || (i & 0x800/2) )
451            {
452               x ^= 0x0020;
453            }
454         }
455      }
456
457      src[i] = x;
458   }
459
460}
461
462static DRIVER_INIT( mgcs )
463{
464   int i;
465   UINT16 *src = (UINT16 *) (memory_region(machine, "main"));
466
467   int rom_size = 0x80000;
468
469   for (i=0; i<rom_size/2; i++)
470   {
471      UINT16 x = src[i];
472
473      /* bit 0 xor layer */
474
475      if( i & 0x20/2 )
476      {
477         if( i & 0x02/2 )
478         {
479            x ^= 0x0001;
480         }
481      }
482
483      if( !(i & 0x4000/2) )
484      {
485         if( !(i & 0x300/2) )
486         {
487            x ^= 0x0001;
488         }
489      }
490
491      /* bit 8 xor layer */
492
493      if( (i & 0x2000/2) || !(i & 0x80/2) )
494      {
495         if( i & 0x100/2 )
496         {
497            if( !(i & 0x20/2) || (i & 0x400/2) )
498            {
499               x ^= 0x0100;
500            }
501         }
502      }
503      else
504      {
505         x ^= 0x0100;
506      }
507
508      src[i] = x;
509   }
510}
511
512static DRIVER_INIT( slqz2 )
513{
514   int i;
515   UINT16 *src = (UINT16 *) (memory_region(machine, "main"));
516
517   int rom_size = 0x80000;
518
519   for (i=0; i<rom_size/2; i++)
520   {
521      UINT16 x = src[i];
522
523      /* bit 0 xor layer */
524
525      if( i & 0x20/2 )
526      {
527         if( i & 0x02/2 )
528         {
529            x ^= 0x0001;
530         }
531      }
532
533      if( !(i & 0x4000/2) )
534      {
535         if( !(i & 0x300/2) )
536         {
537            x ^= 0x0001;
538         }
539      }
540
541      /* bit 14 xor layer */
542
543      if( i & 0x1000/2 )
544      {
545         if( i & 0x800/2 )
546         {
547            x ^= 0x4000;
548         }
549         else
550         {
551            if( i & 0x200/2 )
552            {
553               if( !(i & 0x100/2) )
554               {
555                  if( i & 0x40/2 )
556                  {
557                     x ^= 0x4000;
558                  }
559               }
560            }
561            else
562            {
563               x ^= 0x4000;
564            }
565         }
566      }
567      else
568      {
569         if( i & 0x800/2 )
570         {
571            x ^= 0x4000;
572         }
573         else
574         {
575            if( !(i & 0x100/2) )
576            {
577               if( i & 0x40/2 )
578               {
579                  x ^= 0x4000;
580               }
581            }
582         }
583      }
584
585      src[i] = x;
586   }
587}
588
589static DRIVER_INIT( sdmg2 )
590{
591   int i;
592   UINT16 *src = (UINT16 *) (memory_region(machine, "main"));
593
594   int rom_size = 0x80000;
595
596   for (i=0; i<rom_size/2; i++)
597   {
598      UINT16 x = src[i];
599
600      /* bit 0 xor layer */
601
602      if( i & 0x20/2 )
603      {
604         if( i & 0x02/2 )
605         {
606            x ^= 0x0001;
607         }
608      }
609
610      if( !(i & 0x4000/2) )
611      {
612         if( !(i & 0x300/2) )
613         {
614            x ^= 0x0001;
615         }
616      }
617
618      /* bit 9 xor layer */
619
620      if( i & 0x20000/2 )
621      {
622         x ^= 0x0200;
623      }
624      else
625      {
626         if( !(i & 0x400/2) )
627         {
628            x ^= 0x0200;
629         }
630      }
631
632      /* bit 12 xor layer */
633
634      if( i & 0x20000/2 )
635      {
636         x ^= 0x1000;
637      }
638
639      src[i] = x;
640   }
641}
642
643GAME( 1998, lhzb2,    0,        igs_m68,    igs_m68,    lhzb2,  ROT0,  "IGS", "Mahjong Long Hu Zheng Ba 2 (set 1)", GAME_NOT_WORKING )
644GAME( 1998, lhzb2a,   lhzb2,    igs_m68,    igs_m68,    lhzb2a, ROT0,  "IGS", "Mahjong Long Hu Zheng Ba 2 (set 2)", GAME_NOT_WORKING )
645GAME( 1998, mgcs,     0,        igs_m68,    igs_m68,    mgcs,   ROT0,  "IGS", "Mahjong Man Guan Cai Shen", GAME_NOT_WORKING )
646GAME( 1998, slqz2,    0,        igs_m68,    igs_m68,    slqz2,  ROT0,  "IGS", "Mahjong Shuang Long Qiang Zhu 2", GAME_NOT_WORKING )
647GAME( 1997, sdmg2,    0,        igs_m68,    igs_m68,    sdmg2,  ROT0,  "IGS", "Mahjong Super Da Man Guan 2", GAME_NOT_WORKING )
648
src/mame/drivers/unico.c
r3115r3116
6464static ADDRESS_MAP_START( readmem_burglarx, ADDRESS_SPACE_PROGRAM, 16 )
6565   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM                  )   // ROM
6666   AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM                  )   // RAM
67   AM_RANGE(0x800000, 0x800001) AM_READ(input_port_0_word_r         )   // P1 + P2
68   AM_RANGE(0x800018, 0x800019) AM_READ(input_port_1_word_r         )   // Buttons
69   AM_RANGE(0x80001a, 0x80001b) AM_READ(input_port_2_word_r         )   // DSW
70   AM_RANGE(0x80001c, 0x80001d) AM_READ(input_port_3_word_r         )   // DSW
67   AM_RANGE(0x800000, 0x800001) AM_READ_PORT("INPUTS")
68   AM_RANGE(0x800018, 0x800019) AM_READ_PORT("SYSTEM")
69   AM_RANGE(0x80001a, 0x80001b) AM_READ_PORT("DSW1")
70   AM_RANGE(0x80001c, 0x80001d) AM_READ_PORT("DSW2")
7171   AM_RANGE(0x800188, 0x800189) AM_READ(okim6295_status_0_lsb_r      )   // Sound
7272   AM_RANGE(0x80018c, 0x80018d) AM_READ(YM3812_status_port_0_msb_r   )   //
7373/**/AM_RANGE(0x904000, 0x907fff) AM_READ(SMH_RAM                  )   // Layers
r3115r3116
169169static ADDRESS_MAP_START( readmem_zeropnt, ADDRESS_SPACE_PROGRAM, 16 )
170170   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM                  )   // ROM
171171   AM_RANGE(0xef0000, 0xefffff) AM_READ(SMH_RAM                  )   // RAM
172   AM_RANGE(0x800018, 0x800019) AM_READ(input_port_0_word_r         )   // Buttons
173   AM_RANGE(0x80001a, 0x80001b) AM_READ(input_port_1_word_r         )   // DSW
174   AM_RANGE(0x80001c, 0x80001d) AM_READ(input_port_2_word_r         )   // DSW
172   AM_RANGE(0x800018, 0x800019) AM_READ_PORT("INPUTS")
173   AM_RANGE(0x80001a, 0x80001b) AM_READ_PORT("DSW1")
174   AM_RANGE(0x80001c, 0x80001d) AM_READ_PORT("DSW2")
175175   AM_RANGE(0x800170, 0x800171) AM_READ(unico_guny_0_msb_r         )   // Light Guns
176176   AM_RANGE(0x800174, 0x800175) AM_READ(unico_gunx_0_msb_r         )   //
177177   AM_RANGE(0x800178, 0x800179) AM_READ(unico_guny_1_msb_r         )   //
r3115r3116
214214                                Zero Point 2
215215***************************************************************************/
216216
217static READ32_HANDLER( zeropnt2_coins_r )         { return (input_port_read(machine, "IN0") << 16) | 0xffff; }
218static READ32_HANDLER( zeropnt2_dsw1_r )         { return (input_port_read(machine, "DSW1") << 16) | 0xffff; }
219static READ32_HANDLER( zeropnt2_dsw2_r )         { return (input_port_read(machine, "DSW2") << 16) | 0xffff; }
220static READ32_HANDLER( zeropnt2_buttons_r )         { return ((input_port_read(machine, "IN7") | ((eeprom_read_bit() & 0x01) << 7)) << 16) | 0xffff; }
221
222217static READ32_HANDLER( zeropnt2_gunx_0_msb_r )      { return (unico_gunx_0_msb_r(machine,0,0xffff)-0x0800) << 16; }
223218static READ32_HANDLER( zeropnt2_guny_0_msb_r )      { return (unico_guny_0_msb_r(machine,0,0xffff)+0x0800) << 16; }
224219static READ32_HANDLER( zeropnt2_gunx_1_msb_r )      { return (unico_gunx_1_msb_r(machine,0,0xffff)-0x0800) << 16; }
r3115r3116
274269
275270static ADDRESS_MAP_START( readmem_zeropnt2, ADDRESS_SPACE_PROGRAM, 32 )
276271   AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM                  )   // ROM
277   AM_RANGE(0x800018, 0x80001b) AM_READ(zeropnt2_coins_r            )   // Coins
272   AM_RANGE(0x800018, 0x80001b) AM_READ_PORT("SYSTEM")
278273   AM_RANGE(0x800024, 0x800027) AM_READ(zeropnt2_oki0_r            )   // Sound
279274   AM_RANGE(0x80002c, 0x80002f) AM_READ(zeropnt2_ym2151_status_r      )   //
280275   AM_RANGE(0x800030, 0x800033) AM_READ(zeropnt2_oki1_r            )   //
r3115r3116
282277   AM_RANGE(0x800144, 0x800147) AM_READ(zeropnt2_gunx_0_msb_r         )   //
283278   AM_RANGE(0x800148, 0x80014b) AM_READ(zeropnt2_guny_1_msb_r         )   //
284279   AM_RANGE(0x80014c, 0x80014f) AM_READ(zeropnt2_gunx_1_msb_r         )   //
285   AM_RANGE(0x800150, 0x800153) AM_READ(zeropnt2_dsw1_r            )   // DSW
286   AM_RANGE(0x800154, 0x800157) AM_READ(zeropnt2_dsw2_r            )   // DSW
287   AM_RANGE(0x80015c, 0x80015f) AM_READ(zeropnt2_buttons_r         )   // Buttons
280   AM_RANGE(0x800150, 0x800153) AM_READ_PORT("DSW1")
281   AM_RANGE(0x800154, 0x800157) AM_READ_PORT("DSW2")
282   AM_RANGE(0x80015c, 0x80015f) AM_READ_PORT("BUTTONS")
288283/**/AM_RANGE(0x904000, 0x907fff) AM_READ(SMH_RAM                  )   // Layers
289284/**/AM_RANGE(0x908000, 0x90bfff) AM_READ(SMH_RAM                  )   //
290285/**/AM_RANGE(0x90c000, 0x90ffff) AM_READ(SMH_RAM                  )   //
r3115r3116
328323***************************************************************************/
329324
330325static INPUT_PORTS_START( burglarx )
326   PORT_START("INPUTS")   /* $800000.w */
327   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
328   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
329   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
330   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
331   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
332   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
333   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
334   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
331335
332   PORT_START("IN0")   //$800000.w
333   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
334   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
335   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
336   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
337   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
338   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
339   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
340   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
336   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
337   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
338   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
339   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
340   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
341   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
342   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
343   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
341344
342   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
343   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
344   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
345   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
346   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
347   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
348   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
349   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
345   PORT_START("SYSTEM")   /* $800019.b */
346   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
347   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
348   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
349   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE2 )
350   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 )
351   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
352   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
353   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
354   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
350355
351   PORT_START("IN1")   //$800019.b
352   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_COIN1    )
353   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_COIN2    )
354   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
355   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_SERVICE2 )
356   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_START1   )
357   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_START2   )
358   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN  )
359   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
360   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN  )
361
362   PORT_START("DSW1")   //$80001a.b
363   PORT_BIT(     0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
356   PORT_START("DSW1")   /* $80001a.b */
357   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
364358   PORT_SERVICE( 0x0100, IP_ACTIVE_LOW )
365359   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Free_Play ) )
366360   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
r3115r3116
384378   PORT_DIPSETTING(      0xa000, DEF_STR( 1C_3C ) )
385379   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_4C ) )
386380
387   PORT_START("DSW2")   //$80001c.b
388   PORT_BIT(     0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
381   PORT_START("DSW2")   /* $80001c.b */
382   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
389383   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Bonus_Life ) )
390384   PORT_DIPSETTING(      0x0200, DEF_STR( None ) )
391385   PORT_DIPSETTING(      0x0300, "A" )
r3115r3116
407401   PORT_DIPSETTING(      0xc000, "3" )
408402   PORT_DIPSETTING(      0x4000, "4" )
409403   PORT_DIPSETTING(      0x0000, "5" )
410
411404INPUT_PORTS_END
412405
413406
r3115r3116
417410***************************************************************************/
418411
419412static INPUT_PORTS_START( zeropnt )
413   PORT_START("INPUTS")   /* $800018.w */
414   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_COIN1 )
415   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_COIN2 )
416   PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_HIGH )
417   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN )
418   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_START1 )
419   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START2 )
420   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN )
421   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SERVICE1 )
420422
421   PORT_START("IN0")   //$800018.w
422   PORT_BIT(  0x0001, IP_ACTIVE_HIGH, IPT_COIN1    )
423   PORT_BIT(  0x0002, IP_ACTIVE_HIGH, IPT_COIN2    )
424   PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_HIGH)
425   PORT_BIT(  0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
426   PORT_BIT(  0x0010, IP_ACTIVE_HIGH, IPT_START1   )
427   PORT_BIT(  0x0020, IP_ACTIVE_HIGH, IPT_START2   )
428   PORT_BIT(  0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
429   PORT_BIT(  0x0080, IP_ACTIVE_HIGH, IPT_SERVICE1 )
423   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
424   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
425   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
426   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
427   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
428   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
429   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
430   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
430431
431   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
432   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
433   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN  )
434   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN  )
435   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
436   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
437   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
438   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
439432
440
441   PORT_START("DSW1")   //$80001a.b
442   PORT_BIT(     0x00ff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
433   PORT_START("DSW1")   /* $80001a.b */
434   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
443435   PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unused ) )
444436   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
445437   PORT_DIPSETTING(      0x0100, DEF_STR( On ) )
r3115r3116
465457   PORT_DIPSETTING(      0x4000, DEF_STR( 1C_3C ) )
466458   PORT_DIPSETTING(      0x6000, DEF_STR( 1C_4C ) )
467459
468   PORT_START("DSW2")   //$80001c.b
469   PORT_BIT(     0x00ff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
460   PORT_START("DSW2")   /* $80001c.b */
461   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
470462   PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unused ) )
471463   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
472464   PORT_DIPSETTING(      0x0100, DEF_STR( On ) )
r3115r3116
489481   PORT_DIPSETTING(      0x8000, "4" )
490482   PORT_DIPSETTING(      0xc000, "5" )
491483
492   PORT_START("Y0")   //$800170.b
484   PORT_START("Y0")   /* $800170.b */
493485   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2)
494486
495   PORT_START("X0")   //$800174.b
487   PORT_START("X0")   /* $800174.b */
496488   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2)
497489
498   PORT_START("Y1")   //$800178.b
490   PORT_START("Y1")   /* $800178.b */
499491   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(1)
500492
501   PORT_START("X1")   //$80017c.b
493   PORT_START("X1")   /* $80017c.b */
502494   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(1)
503
504495INPUT_PORTS_END
505496
506497
r3115r3116
510501***************************************************************************/
511502
512503static INPUT_PORTS_START( zeropnt2 )
513   PORT_START("IN0")   //$800019.b
514   PORT_BIT(  0x0001, IP_ACTIVE_HIGH, IPT_COIN1    )
515   PORT_BIT(  0x0002, IP_ACTIVE_HIGH, IPT_COIN2    )
516   PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_HIGH)
517   PORT_BIT(  0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
518   PORT_BIT(  0x0010, IP_ACTIVE_HIGH, IPT_START1   )
519   PORT_BIT(  0x0020, IP_ACTIVE_HIGH, IPT_START2   )
520   PORT_BIT(  0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
521   PORT_BIT(  0x0080, IP_ACTIVE_HIGH, IPT_SERVICE1 )
522   PORT_BIT(  0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
504   PORT_START("SYSTEM")   /* $800019.b */
505   PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED )
506   PORT_BIT( 0x00010000, IP_ACTIVE_HIGH, IPT_COIN1 )
507   PORT_BIT( 0x00020000, IP_ACTIVE_HIGH, IPT_COIN2 )
508   PORT_SERVICE_NO_TOGGLE( 0x00040000, IP_ACTIVE_HIGH )
509   PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
510   PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_START1 )
511   PORT_BIT( 0x00200000, IP_ACTIVE_HIGH, IPT_START2 )
512   PORT_BIT( 0x00400000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
513   PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SERVICE1 )
514   PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
523515
524   PORT_START("DSW1")   //$80001a.b
525   PORT_BIT(     0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
526   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Free_Play ) )
527   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
528   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
529   PORT_DIPNAME( 0x0200, 0x0200, "? Coins To Continue ?" )
530   PORT_DIPSETTING(      0x0000, "1" )
531   PORT_DIPSETTING(      0x0200, "2" )
532   PORT_DIPNAME( 0x0c00, 0x0c00, "Gun Reloading" )
533   PORT_DIPSETTING(      0x0800, DEF_STR(No) )
534   PORT_DIPSETTING(      0x0400, DEF_STR(Yes) )
535   PORT_DIPSETTING(      0x0c00, "Factory Setting" )
536//  PORT_DIPSETTING(      0x0000, "unused?" )
537   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Language ) )
538   PORT_DIPSETTING(      0x1000, DEF_STR( English ) )
539   PORT_DIPSETTING(      0x0000, DEF_STR( Japanese ) )
540   PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coinage ) )
541   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
542   PORT_DIPSETTING(      0x2000, DEF_STR( 4C_1C ) )
543   PORT_DIPSETTING(      0x4000, DEF_STR( 3C_1C ) )
544   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
545   PORT_DIPSETTING(      0xe000, DEF_STR( 1C_1C ) )
546   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_2C ) )
547   PORT_DIPSETTING(      0xa000, DEF_STR( 1C_3C ) )
548   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_4C ) )
516   PORT_START("DSW1")   /* $80001a.b */
517   PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED )
518   PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
519   PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Free_Play ) )
520   PORT_DIPSETTING(          0x01000000, DEF_STR( Off ) )
521   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
522   PORT_DIPNAME( 0x02000000, 0x02000000, "? Coins To Continue ?" )
523   PORT_DIPSETTING(          0x00000000, "1" )
524   PORT_DIPSETTING(          0x02000000, "2" )
525   PORT_DIPNAME( 0x0c000000, 0x0c000000, "Gun Reloading" )
526   PORT_DIPSETTING(          0x08000000, DEF_STR(No) )
527   PORT_DIPSETTING(          0x04000000, DEF_STR(Yes) )
528   PORT_DIPSETTING(          0x0c000000, "Factory Setting" )
529//  PORT_DIPSETTING(          0x00000000, "unused?" )
530   PORT_DIPNAME( 0x10000000, 0x10000000, DEF_STR( Language ) )
531   PORT_DIPSETTING(          0x10000000, DEF_STR( English ) )
532   PORT_DIPSETTING(          0x00000000, DEF_STR( Japanese ) )
533   PORT_DIPNAME( 0xe0000000, 0xe0000000, DEF_STR( Coinage ) )
534   PORT_DIPSETTING(          0x00000000, DEF_STR( 5C_1C ) )
535   PORT_DIPSETTING(          0x20000000, DEF_STR( 4C_1C ) )
536   PORT_DIPSETTING(          0x40000000, DEF_STR( 3C_1C ) )
537   PORT_DIPSETTING(          0x60000000, DEF_STR( 2C_1C ) )
538   PORT_DIPSETTING(          0xe0000000, DEF_STR( 1C_1C ) )
539   PORT_DIPSETTING(          0xc0000000, DEF_STR( 1C_2C ) )
540   PORT_DIPSETTING(          0xa0000000, DEF_STR( 1C_3C ) )
541   PORT_DIPSETTING(          0x80000000, DEF_STR( 1C_4C ) )
549542
550   PORT_START("DSW2")   //$80001c.b
551   PORT_BIT(     0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
552   PORT_DIPNAME( 0x0100, 0x0100, "Korean Language" )
553   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
554   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
555   PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Demo_Sounds ) )
556   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
557   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
558   PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Lives ) )
559   PORT_DIPSETTING(      0x1000, "2" )
560   PORT_DIPSETTING(      0x0c00, "3" )
561   PORT_DIPSETTING(      0x1c00, "4" )
562   PORT_DIPSETTING(      0x1800, "5" )
563   PORT_DIPSETTING(      0x1400, "6" )
564//  PORT_DIPSETTING(      0x0800, "4" )
565//  PORT_DIPSETTING(      0x0400, "4" )
566//  PORT_DIPSETTING(      0x0000, "4" )
567   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
568   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
569   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
570   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Difficulty ) )
571   PORT_DIPSETTING(      0x8000, DEF_STR( Easy ) )
572   PORT_DIPSETTING(      0xc000, DEF_STR( Normal ) )
573   PORT_DIPSETTING(      0x4000, DEF_STR( Harder ) )
574   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
543   PORT_START("DSW2")   /* $80001c.b */
544   PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED )
545   PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
546   PORT_DIPNAME( 0x01000000, 0x01000000, "Korean Language" )
547   PORT_DIPSETTING(          0x01000000, DEF_STR( Off ) )
548   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
549   PORT_DIPNAME( 0x02000000, 0x00000000, DEF_STR( Demo_Sounds ) )
550   PORT_DIPSETTING(          0x02000000, DEF_STR( Off ) )
551   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
552   PORT_DIPNAME( 0x1c000000, 0x1c000000, DEF_STR( Lives ) )
553   PORT_DIPSETTING(          0x10000000, "2" )
554   PORT_DIPSETTING(          0x0c000000, "3" )
555   PORT_DIPSETTING(          0x1c000000, "4" )
556   PORT_DIPSETTING(          0x18000000, "5" )
557   PORT_DIPSETTING(          0x14000000, "6" )
558//  PORT_DIPSETTING(          0x08000000, "4" )
559//  PORT_DIPSETTING(          0x04000000, "4" )
560//  PORT_DIPSETTING(          0x00000000, "4" )
561   PORT_DIPNAME( 0x20000000, 0x20000000, DEF_STR( Unknown ) )
562   PORT_DIPSETTING(          0x20000000, DEF_STR( Off ) )
563   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
564   PORT_DIPNAME( 0xc0000000, 0xc0000000, DEF_STR( Difficulty ) )
565   PORT_DIPSETTING(          0x80000000, DEF_STR( Easy ) )
566   PORT_DIPSETTING(          0xc0000000, DEF_STR( Normal ) )
567   PORT_DIPSETTING(          0x40000000, DEF_STR( Harder ) )
568   PORT_DIPSETTING(          0x00000000, DEF_STR( Hardest ) )
575569
576   PORT_START("Y0")   //$800140.b
570   PORT_START("BUTTONS")   /* $80015c.b */
571   PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED )
572   PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
573   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
574   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
575   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
576   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
577   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
578   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
579   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNKNOWN )
580   PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   // EEPROM
581
582   PORT_START("Y0")   /* $800140.b */
577583   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2)
578584
579   PORT_START("X0")   //$800144.b
585   PORT_START("X0")   /* $800144.b */
580586   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2)
581587
582   PORT_START("Y1")   //$800148.b
588   PORT_START("Y1")   /* $800148.b */
583589   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(1)
584590
585   PORT_START("X1")   //$80014c.b
591   PORT_START("X1")   /* $80014c.b */
586592   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(1)
587
588   PORT_START("IN7")   //$80015c.b
589   PORT_BIT(  0x00ff, IP_ACTIVE_LOW,  IPT_UNKNOWN )
590   PORT_BIT(  0x0100, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(1)
591   PORT_BIT(  0x0200, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(2)
592   PORT_BIT(  0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN )
593   PORT_BIT(  0x0800, IP_ACTIVE_LOW,  IPT_UNKNOWN )
594   PORT_BIT(  0x1000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
595   PORT_BIT(  0x2000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
596   PORT_BIT(  0x4000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
597   PORT_BIT(  0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL )   // EEPROM
598593INPUT_PORTS_END
599594
600595
r3115r3116
11351130GAME( 1998, zeropnt,  0,       zeropnt,  zeropnt,  0, ROT0, "Unico", "Zero Point (set 1)", 0 )
11361131GAME( 1998, zeropnta, zeropnt, zeropnt,  zeropnt,  0, ROT0, "Unico", "Zero Point (set 2)", 0 )
11371132GAME( 1999, zeropnt2, 0,       zeropnt2, zeropnt2, 0, ROT0, "Unico", "Zero Point 2", 0 )
1138
src/mame/drivers/segag80v.c
r3115r3116
579579   PORT_INCLUDE( g80v_generic )
580580
581581   PORT_MODIFY("D7D6")
582   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(elim4_joint_coin_r, 0)   /* combination of all four coin inputs */
582   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(elim4_joint_coin_r, NULL)   /* combination of all four coin inputs */
583583   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
584584   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
585585
src/mame/drivers/gatron.c
r3115r3116
11/******************************************************************************
22
3    GAME-A-TRON gaming hardware
4    ---------------------------
3    GAME-A-TRON gambling hardware
4    -----------------------------
55
66    Driver by Roberto Fresca.
77
r3115r3116
1212    * Pull Tabs,  1983, Game-A-Tron.
1313
1414
15    The names of both games are not confirmed. We are calling them "Poker 4-1"
16    and "Pull Tabs" till we can find some evidence of the real names.
17
18
1915*******************************************************************************
2016
2117
r3115r3116
7369    U30    VRAM       HM6116LP-3 (2Kx8)
7470
7571    1x 16MHz Crystal
76
7772    1x Duracell PX-2 I, 4.5V battery.
7873
7974
75    Identified the unknown writes as a init sequence for 1x PSG sound device.
76    The type/class is unknown due to almost all devices are plastic covered.
77
78
8079*******************************************************************************
8180
8281
r3115r3116
8887    The first time the machine is turned on, will show the legend "DATA ERROR".
8988    You must to RESET (F3) the machine to initialize the NVRAM properly.
9089
90    NOTE: These games are intended to be for amusement only.
91    There is not such a payout system, so...Dont ask about it!
9192
93
9294    * Poker 4-1:
9395
9496    Pressing SERVICE 1 (key 9) you enter the Test/Setting Mode. You can test
r3115r3116
143145
144146*******************************************************************************
145147
148
146149    --------------------
147150    ***  Memory Map  ***
148151    --------------------
r3115r3116
150153    0x0000 - 0x5FFF    ; ROM space.
151154    0x6000 - 0x67FF    ; Video RAM (only the first 0x300 bytes are used).
152155    0x8000 - 0x87FF    ; Main RAM.
153    0xA000 - 0xA000    ; Unknown Writes.
154    0xE000 - 0xE000    ; Unknown Writes (watchdog?).
156    0xA000 - 0xA000    ; Sound (PSG).
157    0xE000 - 0xE000    ; Output Port 0 (lamps).
155158
156159
160    * Z80 I/O ports *
161
162      0x00 - 0x03      ; PPI 8255 (ports A & B as input, port C as output).
163
164
165    * 8255 I/O ports *
166
167      Port A (input)   ; Input Port 0 (player buttons).
168      Port B (input)   ; Input Port 1 (player & service buttons).
169      Port C (output)  ; Output Port 1 (lamps & counters).
170
171
157172*******************************************************************************
158173
159174
160175    DRIVER UPDATES:
161176
162177
178    [2008-08-21]
179
180    After an exhaustive analysis to the unknown writes, finally figured out the missing sound device.
181
182    - Added sound support to "Poker 4-1" and "Pull Tabs".
183    - Figured out the output ports. Documented each bit accessed.
184    - Added button lamps support. Created layouts for both games.
185    - Switched the 8255 port C to be used as output port.
186    - Adjusted the coin pulse timing.
187    - Updated technical notes.
188    - Splitted the driver to driver + video.
189    - Final clean-up.
190
191
163192    [2008-05-31]
164193
165    - Renamed the games to "Poker 4-1" and "Pull Tabs"
194    - Renamed the games to "Poker 4-1" and "Pull Tabs".
166195      as shown in the ROMs stickers.
167196    - Renamed the ROMs in each set according to their own stickers.
168197    - Moved the driver into gametron.a group.
r3115r3116
170199      Poker41 and pulltabs don't make use of it, but is present in the Test/Setting Mode.
171200    - Updated technical notes.
172201
202
173203    [2008-05-10]
174204
175205    - Initial release.
r3115r3116
183213
184214    TODO:
185215
186    - Outputs.
187    - Sound.
216    - Nothing... :)
188217
189218
190219*******************************************************************************/
r3115r3116
193222#define MASTER_CLOCK   XTAL_16MHz
194223
195224#include "driver.h"
225#include "sound/sn76496.h"
196226#include "machine/8255ppi.h"
197227
228#include "poker41.lh"
229#include "pulltabs.lh"
198230
199/*************************
200*     Video Hardware     *
201*************************/
231/* from video */
232WRITE8_HANDLER( gat_videoram_w );
233PALETTE_INIT( gat );
234VIDEO_START( gat );
235VIDEO_UPDATE( gat );
202236
203static tilemap *bg_tilemap;
204237
238/****************************
239*    Read/Write Handlers    *
240****************************/
205241
206static WRITE8_HANDLER( gat_videoram_w )
242static WRITE8_HANDLER( output_port_0_w )
207243{
208   videoram[offset] = data;
209   tilemap_mark_tile_dirty(bg_tilemap, offset);
210}
244/*  ---------------
245    Pull Tabs lamps
246    ---------------
211247
248    0x00 - Default State.
249    0x01 - Hold3.
250    0x04 - Hold5.
251    0x08 - Ante/Bet.
212252
213static TILE_GET_INFO( get_bg_tile_info )
214{
215/*  - bits -
253    - bits -
216254    7654 3210
217    xxxx xxxx   tiles code.
255    ---------
256    .... ...x ---> Hold3.
257    .... .x.. ---> Hold5.
258    .... x... ---> Ante/Bet.
218259
219    only one color code
220*/
260    Tab1 = Hold1
261    Tab2 = Hold3
262    Tab3 = Hold5
221263
222   int code = videoram[tile_index];
223264
224   SET_TILE_INFO(0, code, 0, 0);
225}
265    ---------------
266    Poker 4-1 lamps
267    ---------------
226268
269    0x00 - Default State.
270    0x01 - Hold3.
271    0x02 - Hold4.
272    0x04 - Hold5/DDown.
273    0x08 - Ante/Bet.
274    0x10 - Start.
275    0x20 - Deal/Hit.
276    0x40 - Stand/FreeBonusDraw.
227277
228static VIDEO_START( gat )
229{
230   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, 8, 16, 48, 16);
278    - bits -
279    7654 3210
280    ---------
281    .... ...x --> Hold3.
282    .... ..x. --> Hold4.
283    .... .x.. --> Hold5/DDown.
284    .... x... --> Ante/Bet.
285    ...x .... --> Start.
286    ..x. .... --> Deal/Hit.
287    .x.. .... --> Stand/FreeBonusDraw.
288
289*/
290   output_set_lamp_value(0, (data) & 1);      /* hold3 lamp */
291   output_set_lamp_value(1, (data >> 1) & 1);   /* hold4 lamp */
292   output_set_lamp_value(2, (data >> 2) & 1);   /* hold5 lamp */
293   output_set_lamp_value(3, (data >> 3) & 1);   /* ante/bet lamp */
294   output_set_lamp_value(4, (data >> 4) & 1);   /* start lamp */
295   output_set_lamp_value(5, (data >> 5) & 1);   /* deal/hit lamp */
296   output_set_lamp_value(6, (data >> 6) & 1);   /* stand/fbdraw lamp */
231297}
232298
233299
234static VIDEO_UPDATE( gat )
300static WRITE8_HANDLER( output_port_1_w )
235301{
236   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
237   return 0;
238}
302/*  ----------------
303    Lamps & Counters
304    ----------------
239305
306    - bits -
307    7654 3210
308    ---------
309    .... ...x --> Hold2 lamp.
310    .... ..x. --> Hold1 lamp.
311    .x.. .... --> Coin counter (inverted).
312    x... .... --> Inverted pulse. Related to counters.
240313
241static PALETTE_INIT( gat )
242{
243
314*/
315   output_set_lamp_value(7, (data) & 1);      /* hold2 lamp */
316   output_set_lamp_value(8, (data >> 1) & 1);   /* hold1 lamp */
244317}
245318
246319
r3115r3116
250323
251324static const ppi8255_interface ppi8255_intf =
252325{
253   input_port_0_r,   /* Port A read */
254   input_port_1_r,   /* Port B read */
255   input_port_2_r,   /* Port C read */
256   NULL,         /* Port A write */
257   NULL,         /* Port B write */
258   NULL,         /* Port C write */
326   input_port_0_r,      /* Port A read */
327   input_port_1_r,      /* Port B read */
328   NULL,            /* Port C read */
329   NULL,            /* Port A write */
330   NULL,            /* Port B write */
331   output_port_1_w,   /* Port C write */
259332};
260333
261334
r3115r3116
267340   AM_RANGE(0x0000, 0x5fff) AM_ROM
268341   AM_RANGE(0x6000, 0x63ff) AM_RAM_WRITE(gat_videoram_w) AM_BASE(&videoram)
269342   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)   /* battery backed RAM */
270   AM_RANGE(0xa000, 0xa000) AM_NOP   /* unknown writes */
271   AM_RANGE(0xe000, 0xe000) AM_NOP /* watchdog? */
343   AM_RANGE(0xa000, 0xa000) AM_WRITE(sn76496_0_w)                                 /* PSG */
344   AM_RANGE(0xe000, 0xe000) AM_WRITE(output_port_0_w)                              /* lamps */
272345ADDRESS_MAP_END
273346
274347static ADDRESS_MAP_START( gat_portmap, ADDRESS_SPACE_IO, 8 )
r3115r3116
276349   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
277350ADDRESS_MAP_END
278351
279/* I/O byte R/W
280352
281   0x0200 ;R   ???!
282
283   0x9200 ;R
284   0x9201 ;R
285   0x9203 ;W   (0x92)
286
287   0xC002 ;W   (0xC0)
288   0xC202 ;W   (0xC2)
289
290   0xFF01 ;R
291
292   -----------------
293
294   unknown writes:
295
296   0xA000 ;W   (3 consecutive writes: 8x - Cx - 93)
297   0xE000 ;W   (0x04)
298
299*/
300
301353/*************************
302354*      Input Ports       *
303355*************************/
r3115r3116
305357static INPUT_PORTS_START( poker41 )
306358   PORT_START("IN0")
307359   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Discard 4") PORT_CODE(KEYCODE_V)
308   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet/Ante") PORT_CODE(KEYCODE_N)
309   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Deal/Hit") PORT_CODE(KEYCODE_2)
310   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
311   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Stand") PORT_CODE(KEYCODE_A)
360   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet / Ante") PORT_CODE(KEYCODE_N)
361   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Deal / Hit") PORT_CODE(KEYCODE_2)
362   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_IMPULSE(2)   /* Coin A */
363   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Free Bonus Draw / Stand") PORT_CODE(KEYCODE_3)
312364   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Start") PORT_CODE(KEYCODE_1)
313   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Discard 5") PORT_CODE(KEYCODE_B)
365   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Discard 5 / High / Double Down") PORT_CODE(KEYCODE_B)
314366   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Discard 3") PORT_CODE(KEYCODE_C)
315367
316368   PORT_START("IN1")
r3115r3116
321373   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
322374   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service 1 (Test/Settings)") PORT_CODE(KEYCODE_9)
323375   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
324   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 )  PORT_NAME("Discard 1") PORT_CODE(KEYCODE_Z)
325
326   PORT_START("IN2")   /* disabled */
327   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
328   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
329   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
330   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
331   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
332   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
333   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
334   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
376   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 )  PORT_NAME("Discard 1 / Low") PORT_CODE(KEYCODE_Z)
335377INPUT_PORTS_END
336378
337379static INPUT_PORTS_START( pulltabs )
r3115r3116
339381   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
340382   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Ante") PORT_CODE(KEYCODE_1)
341383   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
342   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
384   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_IMPULSE(2)   /* Coin A */
343385   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
344386   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
345387   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Big Bar Ticket") PORT_CODE(KEYCODE_C)
r3115r3116
349391   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
350392   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
351393   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Service 2 (Test Mode Out / Coin Stuck)") PORT_CODE(KEYCODE_0)
352   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Payout? */
394   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
353395   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
354396   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service 1 (Test/Settings)") PORT_CODE(KEYCODE_9)
355397   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
356398   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )  PORT_NAME("Super Star Ticket") PORT_CODE(KEYCODE_Z)
357
358   PORT_START("IN2")   /* disabled */
359   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
360   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
361   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
362   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
363   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
364   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
365   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
366   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
367399INPUT_PORTS_END
368400
369401
r3115r3116
402434static MACHINE_DRIVER_START( gat )
403435
404436   /* basic machine hardware */
405   MDRV_CPU_ADD("main", Z80, MASTER_CLOCK/24)   /* guess */
437   MDRV_CPU_ADD("main", Z80, MASTER_CLOCK/24)   /* 666.66 kHz, guess */
406438   MDRV_CPU_PROGRAM_MAP(gat_map, 0)
407439   MDRV_CPU_IO_MAP(gat_portmap,0)
408440   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
r3115r3116
421453   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 0*8, 16*16-1)
422454
423455   MDRV_GFXDECODE(gat)
424
425456   MDRV_PALETTE_INIT(gat)
426457   MDRV_PALETTE_LENGTH(8)
427
428458   MDRV_VIDEO_START(gat)
429459   MDRV_VIDEO_UPDATE(gat)
430460
461   /* sound hardware */
462   MDRV_SPEAKER_STANDARD_MONO("mono")
463   MDRV_SOUND_ADD("sn1", SN76496, MASTER_CLOCK/8 )   /* 2 MHz, guess */
464   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.00)
431465MACHINE_DRIVER_END
432466
433467
r3115r3116
461495*      Game Drivers      *
462496*************************/
463497
464/*    YEAR  NAME      PARENT  MACHINE  INPUT     INIT  ROT    COMPANY        FULLNAME      FLAGS */
465GAME( 1983, poker41,  0,      gat,     poker41,  0,    ROT0, "Game-A-Tron", "Poker 4-1",   GAME_NO_SOUND )
466GAME( 1983, pulltabs, 0,      gat,     pulltabs, 0,    ROT0, "Game-A-Tron", "Pull Tabs",   GAME_NO_SOUND )
498/*     YEAR  NAME      PARENT  MACHINE  INPUT      INIT  ROT    COMPANY        FULLNAME     FLAGS  LAYOUT   */
499GAMEL( 1983, poker41,  0,      gat,     poker41,   0,    ROT0, "Game-A-Tron", "Poker 4-1",  0,     layout_poker41  )
500GAMEL( 1983, pulltabs, 0,      gat,     pulltabs,  0,    ROT0, "Game-A-Tron", "Pull Tabs",  0,     layout_pulltabs )
src/mame/drivers/superchs.c
r3115r3116
115115   switch (offset)
116116   {
117117      case 0x00:
118         return (input_port_read(machine, "SYSTEM") << 16) | input_port_read(machine, "INPUT") |
119              (eeprom_read_bit() << 7);
118         return input_port_read(machine, "INPUTS");
120119
121120      case 0x01:
122121         return coin_word<<16;
r3115r3116
273272/***********************************************************/
274273
275274static INPUT_PORTS_START( superchs )
276   PORT_START("SYSTEM")   /* IN0 */
277   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_UNKNOWN )
278   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
279   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
280   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1)   /* Freeze input */
281   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
282   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_SERVICE1 )
283   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_COIN2 )
284   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_COIN1 )
285   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_UNKNOWN )
286   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN )
287   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN )
288   PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_UNKNOWN )
289   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
290   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
291   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
292   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
275   PORT_START("INPUTS")
276   PORT_BIT( 0x00000001, IP_ACTIVE_LOW,  IPT_UNKNOWN )
277   PORT_BIT( 0x00000002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
278   PORT_BIT( 0x00000004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
279   PORT_BIT( 0x00000008, IP_ACTIVE_LOW,  IPT_UNKNOWN )
280   PORT_BIT( 0x00000010, IP_ACTIVE_LOW,  IPT_UNKNOWN )
281   PORT_BIT( 0x00000020, IP_ACTIVE_LOW,  IPT_UNKNOWN )
282   PORT_BIT( 0x00000040, IP_ACTIVE_LOW,  IPT_UNKNOWN )
283   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL )   PORT_CUSTOM(eeprom_bit_r, NULL)   /* reserved for EEROM */
284   PORT_BIT( 0x00000100, IP_ACTIVE_LOW,  IPT_BUTTON5 ) PORT_PLAYER(1)   /* seat center (cockpit only) */
285   PORT_BIT( 0x00000200, IP_ACTIVE_LOW,  IPT_UNKNOWN )
286   PORT_BIT( 0x00000400, IP_ACTIVE_LOW,  IPT_UNKNOWN )
287   PORT_BIT( 0x00000800, IP_ACTIVE_LOW,  IPT_UNKNOWN )
288   PORT_BIT( 0x00001000, IP_ACTIVE_LOW,  IPT_BUTTON3 ) PORT_NAME("Nitro")
289   PORT_BIT( 0x00002000, IP_ACTIVE_LOW,  IPT_BUTTON4 ) PORT_NAME("Gear Shift")
290   PORT_BIT( 0x00004000, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_NAME("Brake")
291   PORT_BIT( 0x00008000, IP_ACTIVE_LOW,  IPT_START1 )
293292
294   PORT_START("INPUT")      /* IN1 */
295   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_UNKNOWN )
296   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
297   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
298   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN )
299   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_UNKNOWN )
300   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_UNKNOWN )
301   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_UNKNOWN )
302   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* reserved for EEROM */
303   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_BUTTON5 ) PORT_PLAYER(1)   /* seat center (cockpit only) */
304   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN )
305   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN )
306   PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_UNKNOWN )
307   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_BUTTON3 ) PORT_NAME("Nitro")
308   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_BUTTON4 ) PORT_NAME("Gear Shift")
309   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_NAME("Brake")
310   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_START1 )
293   PORT_BIT( 0x00010000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
294   PORT_BIT( 0x00020000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
295   PORT_BIT( 0x00040000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
296   PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1)   /* Freeze input */
297   PORT_SERVICE_NO_TOGGLE( 0x00100000, IP_ACTIVE_LOW )
298   PORT_BIT( 0x00200000, IP_ACTIVE_LOW,  IPT_SERVICE1 )
299   PORT_BIT( 0x00400000, IP_ACTIVE_LOW,  IPT_COIN2 )
300   PORT_BIT( 0x00800000, IP_ACTIVE_LOW,  IPT_COIN1 )
301   PORT_BIT( 0x01000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
302   PORT_BIT( 0x02000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
303   PORT_BIT( 0x04000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
304   PORT_BIT( 0x08000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
305   PORT_BIT( 0x10000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
306   PORT_BIT( 0x20000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
307   PORT_BIT( 0x40000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
308   PORT_BIT( 0x80000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
311309
312   PORT_START("WHEEL")      /* IN 2, steering wheel */
310   PORT_START("WHEEL")      /* steering wheel */
313311   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_REVERSE PORT_PLAYER(1)
314312
315   PORT_START("ACCEL")      /* IN 3, accel [effectively also brake for the upright] */
313   PORT_START("ACCEL")      /* accel [effectively also brake for the upright] */
316314   PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(1)
317315
318   PORT_START("SOUND")      /* IN 4, sound volume */
316   PORT_START("SOUND")      /* sound volume */
319317   PORT_BIT( 0xff, 0x00, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2)
320318
321   PORT_START("UNKNOWN")   /* IN 5, unknown */
319   PORT_START("UNKNOWN")   /* unknown */
322320   PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(2)
323321
324   PORT_START("FAKE")      /* IN 6, inputs and DSW all fake */
322   PORT_START("FAKE")      /* inputs and DSW all fake */
325323   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
326324   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
327325   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
src/mame/drivers/megazone.c
r3115r3116
99#include "driver.h"
1010#include "machine/konami1.h"
1111#include "cpu/m6809/m6809.h"
12#include "cpu/i8039/i8039.h"
12#include "cpu/mcs48/mcs48.h"
1313#include "cpu/z80/z80.h"
1414#include "sound/ay8910.h"
1515#include "sound/dac.h"
r3115r3116
156156ADDRESS_MAP_END
157157
158158static ADDRESS_MAP_START( i8039_writeport, ADDRESS_SPACE_IO, 8 )
159   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(dac_0_data_w)
160   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(i8039_irqen_and_status_w)
159   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(dac_0_data_w)
160   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(i8039_irqen_and_status_w)
161161ADDRESS_MAP_END
162162
163163static INPUT_PORTS_START( megazone )
src/mame/drivers/pass.c
r3115r3116
127127   AM_RANGE(0x200000, 0x200fff) AM_READ(SMH_RAM)
128128   AM_RANGE(0x210000, 0x213fff) AM_READ(SMH_RAM)
129129   AM_RANGE(0x220000, 0x2203ff) AM_READ(SMH_RAM)
130   AM_RANGE(0x230100, 0x230101) AM_READ(input_port_0_word_r)
131   AM_RANGE(0x230200, 0x230201) AM_READ(input_port_1_word_r)
130   AM_RANGE(0x230100, 0x230101) AM_READ_PORT("DSW")
131   AM_RANGE(0x230200, 0x230201) AM_READ_PORT("INPUTS")
132132ADDRESS_MAP_END
133133
134134static ADDRESS_MAP_START( pass_writemem, ADDRESS_SPACE_PROGRAM, 16 )
r3115r3116
170170
171171/* todo : work out function of unknown but used dsw */
172172static INPUT_PORTS_START( pass )
173   PORT_START("DSW")   /* DSW */
173   PORT_START("DSW")
174174   PORT_DIPNAME( 0x0001, 0x0001, "Unknown SW 0-0" )   // USED ! Check code at 0x0046ea
175175   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
176176   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
src/mame/drivers/toki.c
r3115r3116
115115   AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(toki_foreground_videoram16_w) AM_BASE(&videoram16)
116116   AM_RANGE(0x080000, 0x08000d) AM_READWRITE(seibu_main_word_r, seibu_main_word_w)
117117   AM_RANGE(0x0a0000, 0x0a005f) AM_WRITE(toki_control_w) AM_BASE(&toki_scrollram16)
118   AM_RANGE(0x0c0000, 0x0c0001) AM_READ(input_port_1_word_r)
119   AM_RANGE(0x0c0002, 0x0c0003) AM_READ(input_port_2_word_r)
120   AM_RANGE(0x0c0004, 0x0c0005) AM_READ(input_port_3_word_r)
118   AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("DSW")
119   AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("INPUTS")
120   AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("SYSTEM")
121121ADDRESS_MAP_END
122122
123123/* In the bootleg, sound and sprites are remapped to 0x70000 */
r3115r3116
135135   AM_RANGE(0x072000, 0x072001) AM_READ(watchdog_reset16_r)   /* probably */
136136   AM_RANGE(0x075000, 0x075001) AM_WRITE(tokib_soundcommand16_w)
137137   AM_RANGE(0x075004, 0x07500b) AM_WRITE(SMH_RAM) AM_BASE(&toki_scrollram16)
138   AM_RANGE(0x0c0000, 0x0c0001) AM_READ(input_port_0_word_r)
139   AM_RANGE(0x0c0002, 0x0c0003) AM_READ(input_port_1_word_r)
140   AM_RANGE(0x0c0004, 0x0c0005) AM_READ(input_port_2_word_r)
138   AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("DSW")
139   AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("INPUTS")
140   AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("SYSTEM")
141141   AM_RANGE(0x0c000e, 0x0c000f) AM_READ(pip16_r)  /* sound related, if we return 0 the code writes */
142142            /* the sound command quickly followed by 0 and the */
143143            /* sound CPU often misses the command. */
r3115r3116
164164static INPUT_PORTS_START( toki )
165165   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
166166
167   PORT_START("DSW0")
167   PORT_START("DSW")
168168   PORT_DIPNAME( 0x001f, 0x001f, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3,4,5")
169169   PORT_DIPSETTING(      0x0015, DEF_STR( 6C_1C ) )
170170   PORT_DIPSETTING(      0x0017, DEF_STR( 5C_1C ) )
r3115r3116
217217   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
218218   PORT_DIPSETTING(      0x8000, DEF_STR( On ) )
219219
220   PORT_START("IN1")
220   PORT_START("INPUTS")
221221   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_JOYSTICK_UP ) PORT_8WAY
222222   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_JOYSTICK_DOWN ) PORT_8WAY
223223   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_JOYSTICK_LEFT ) PORT_8WAY
r3115r3116
235235   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
236236   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
237237
238   PORT_START("IN2")
238   PORT_START("SYSTEM")
239239   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
240240   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
241241   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
247247INPUT_PORTS_END
248248
249249static INPUT_PORTS_START( tokib )
250   PORT_START("DSW0")
250   PORT_START("DSW")
251251   PORT_DIPNAME( 0x001f, 0x001f, DEF_STR( Coinage ) )
252252   PORT_DIPSETTING(      0x0015, DEF_STR( 6C_1C ) )
253253   PORT_DIPSETTING(      0x0017, DEF_STR( 5C_1C ) )
r3115r3116
300300   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
301301   PORT_DIPSETTING(      0x8000, DEF_STR( On ) )
302302
303   PORT_START("IN0")
303   PORT_START("INPUTS")
304304   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_JOYSTICK_UP ) PORT_8WAY
305305   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_JOYSTICK_DOWN ) PORT_8WAY
306306   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_JOYSTICK_LEFT ) PORT_8WAY
r3115r3116
318318   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
319319   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
320320
321   PORT_START("IN1")
321   PORT_START("SYSTEM")
322322   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
323323   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2 )
324324   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_SERVICE1 )
src/mame/drivers/junofrst.c
r3115r3116
8181#include "tutankhm.h"
8282#include "machine/konami1.h"
8383#include "cpu/m6809/m6809.h"
84#include "cpu/i8039/i8039.h"
84#include "cpu/mcs48/mcs48.h"
8585#include "cpu/z80/z80.h"
8686#include "sound/ay8910.h"
8787#include "sound/dac.h"
r3115r3116
220220
221221static ADDRESS_MAP_START( mcu_io_map, ADDRESS_SPACE_IO, 8 )
222222   AM_RANGE(0x00, 0xff) AM_READ(soundlatch2_r)
223   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(dac_0_data_w)
224   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(i8039_irqen_and_status_w)
223   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(dac_0_data_w)
224   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(i8039_irqen_and_status_w)
225225ADDRESS_MAP_END
226226
227227
src/mame/drivers/sg1000a.c
r3115r3116
139139   ADDRESS_MAP_GLOBAL_MASK(0xff)
140140   AM_RANGE(0xBE, 0xBE) AM_READ(TMS9928A_vram_r)
141141   AM_RANGE(0xBF, 0xBF) AM_READ(TMS9928A_register_r)
142   AM_RANGE(0xDC, 0xDC) AM_READ(input_port_0_r)
143   AM_RANGE(0xDD, 0xDD) AM_READ(input_port_1_r)
144   AM_RANGE(0xDE, 0xDE) AM_READ(input_port_2_r)
142   AM_RANGE(0xDC, 0xDC) AM_READ_PORT("P1")
143   AM_RANGE(0xDD, 0xDD) AM_READ_PORT("P2")
144   AM_RANGE(0xDE, 0xDE) AM_READ_PORT("DSW")
145145ADDRESS_MAP_END
146146
147147static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
r3115r3116
159159 *************************************/
160160
161161static INPUT_PORTS_START( sg1000 )
162   PORT_START("IN0")
162   PORT_START("P1")
163163   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
164164   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
165165   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
r3115r3116
169169   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_START1 )
170170   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_START2 )
171171
172   PORT_START("IN1")
172   PORT_START("P2")
173173   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
174174   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
175175   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
r3115r3116
203203static INPUT_PORTS_START( chwrestl )
204204   PORT_INCLUDE( sg1000 )
205205
206   PORT_MODIFY("IN0")
206   PORT_MODIFY("P1")
207207   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
208208   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
209209   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
r3115r3116
211211   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
212212   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
213213
214   PORT_MODIFY("IN1")
214   PORT_MODIFY("P2")
215215   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
216216   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
217217   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
src/mame/drivers/panicr.c
r3115r3116
177177   AM_RANGE(0x0d004, 0x0d004) AM_WRITE(t5182_sharedram_semaphore_main_acquire_w)
178178   AM_RANGE(0x0d006, 0x0d006) AM_WRITE(t5182_sharedram_semaphore_main_release_w)
179179   AM_RANGE(0x0d200, 0x0d2ff) AM_READWRITE(t5182shared_r, t5182shared_w)
180   AM_RANGE(0x0d400, 0x0d400) AM_READ(input_port_0_r)
181   AM_RANGE(0x0d402, 0x0d402) AM_READ(input_port_1_r)
182   AM_RANGE(0x0d404, 0x0d404) AM_READ(input_port_2_r)
183   AM_RANGE(0x0d406, 0x0d406) AM_READ(input_port_3_r)
184   AM_RANGE(0x0d407, 0x0d407) AM_READ(input_port_4_r)
180   AM_RANGE(0x0d400, 0x0d400) AM_READ_PORT("P1")
181   AM_RANGE(0x0d402, 0x0d402) AM_READ_PORT("P2")
182   AM_RANGE(0x0d404, 0x0d404) AM_READ_PORT("START")
183   AM_RANGE(0x0d406, 0x0d406) AM_READ_PORT("DSW1")
184   AM_RANGE(0x0d407, 0x0d407) AM_READ_PORT("DSW2")
185185   AM_RANGE(0x0d800, 0x0d81f) AM_RAM AM_BASE (&scrollram)
186186   AM_RANGE(0xf0000, 0xfffff) AM_ROM
187187ADDRESS_MAP_END
r3115r3116
239239}
240240
241241static INPUT_PORTS_START( panicr )
242   PORT_START("IN0")
242   PORT_START("P1")
243243   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) //left
244244   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) //right
245245   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) //shake 1
246246   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) //shake 2
247247   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
248248
249   PORT_START("IN1")
249   PORT_START("P2")
250250   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) //left
251251   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) //right
252252   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) //shake 1
253253   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) //shake 2
254254   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
255255
256   PORT_START("IN2")
256   PORT_START("START")
257257   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
258258   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
259259   PORT_BIT( 0xe7, IP_ACTIVE_LOW, IPT_UNKNOWN )
260260
261261   PORT_START("DSW1")
262262   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:8,7,6")
263   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ))
264   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ))
265   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ))
266   PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ))
267   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ))
268   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ))
269   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ))
270   PORT_DIPSETTING(    0x01, DEF_STR( 1C_5C ))
263   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
264   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
265   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
266   PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
267   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
268   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) )
269   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
270   PORT_DIPSETTING(    0x01, DEF_STR( 1C_5C ) )
271271   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:5,4")
272   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ))
273   PORT_DIPSETTING(    0x18, DEF_STR( 1C_1C ))
274   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ))
275   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ))
272   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
273   PORT_DIPSETTING(    0x18, DEF_STR( 1C_1C ) )
274   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
275   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
276276   PORT_SERVICE_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:3" )
277277   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:2")
278278   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
src/mame/drivers/nbmj8688.c
r3115r3116
551551
552552
553553static INPUT_PORTS_START( mjsikaku )
554   PORT_START("DSWA")   /* (0) DIPSW-A */
554   PORT_START("DSWA")
555555   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
556556   PORT_DIPSETTING(    0x07, "1 (Easy)" )
557557   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
577577   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
578578   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
579579
580   PORT_START("DSWB")   /* (1) DIPSW-B */
580   PORT_START("DSWB")
581581   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
582582   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
583583   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
603603   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
604604   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
605605
606   PORT_START("SYSTEM")   /* (2) PORT 0 */
607   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
606   PORT_START("SYSTEM")
607   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
608608   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
609609   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
610610   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
618618
619619static INPUT_PORTS_START( mmsikaku )
620620#if 1
621   PORT_START("DSWA")   /* (0) DIPSW-A */
621   PORT_START("DSWA")
622622   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
623623   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
624624   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
644644   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
645645   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
646646
647   PORT_START("DSWB")   /* (1) DIPSW-B */
647   PORT_START("DSWB")
648648   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
649649   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
650650   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
671671   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
672672#else
673673
674   PORT_START("DSWA")   /* (0) DIPSW-A */
674   PORT_START("DSWA")
675675   PORT_DIPNAME( 0x07, 0x00, "Game Out" )
676676   PORT_DIPSETTING(    0x07, "60% (Hard)" )
677677   PORT_DIPSETTING(    0x06, "65%" )
r3115r3116
695695   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
696696   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
697697
698   PORT_START("DSWB")   /* (1) DIPSW-B */
698   PORT_START("DSWB")
699699   PORT_DIPNAME( 0x01, 0x00, "Rate Up" )
700700   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
701701   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
708708   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
709709#endif
710710
711   PORT_START("SYSTEM")   /* (2) PORT 0 */
712   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
711   PORT_START("SYSTEM")
712   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
713713   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
714714   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
715715   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
722722INPUT_PORTS_END
723723
724724static INPUT_PORTS_START( otonano )
725   PORT_START("DSWA")   /* (0) DIPSW-A */
725   PORT_START("DSWA")
726726   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
727727   PORT_DIPSETTING(    0x07, "1 (Easy)" )
728728   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
748748   PORT_DIPSETTING(    0x80, "100 Yen" )
749749   PORT_DIPSETTING(    0x00, "50 Yen" )
750750
751   PORT_START("DSWB")   /* (1) DIPSW-B */
751   PORT_START("DSWB")
752752   PORT_DIPNAME( 0x01, 0x01, "Character Display Test" )
753753   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
754754   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
774774   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
775775   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
776776
777   PORT_START("SYSTEM")   /* (2) PORT 0 */
778   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
777   PORT_START("SYSTEM")
778   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
779779   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
780780   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
781781   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
788788INPUT_PORTS_END
789789
790790static INPUT_PORTS_START( mjcamera )
791   PORT_START("DSWA")   /* (0) DIPSW-A */
791   PORT_START("DSWA")
792792   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
793793   PORT_DIPSETTING(    0x07, "1 (Easy)" )
794794   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
814814   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
815815   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
816816
817   PORT_START("DSWB")   /* (1) DIPSW-B */
817   PORT_START("DSWB")
818818   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
819819   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
820820   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
840840   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
841841   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
842842
843   PORT_START("SYSTEM")   /* (2) PORT 0 */
844   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
843   PORT_START("SYSTEM")
844   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
845845   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
846846   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
847847   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
854854INPUT_PORTS_END
855855
856856static INPUT_PORTS_START( kaguya )
857   PORT_START("DSWA")   /* (0) DIPSW-A */
857   PORT_START("DSWA")
858858   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
859859   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
860860   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
r3115r3116
879879   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
880880   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
881881
882   PORT_START("DSWB")   /* (1) DIPSW-B */
882   PORT_START("DSWB")
883883   PORT_DIPNAME( 0x01, 0x00, "Nudity graphic on bet" )
884884   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
885885   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
903903   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
904904   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
905905
906   PORT_START("SYSTEM")   /* (2) PORT 0 */
907   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
906   PORT_START("SYSTEM")
907   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
908908//  PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
909909   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )      //
910910   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
r3115r3116
918918INPUT_PORTS_END
919919
920920static INPUT_PORTS_START( kaguya2 )
921   PORT_START("DSWA")   /* (0) DIPSW-A */
921   PORT_START("DSWA")
922922   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
923923   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
924924   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
944944   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
945945   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
946946
947   PORT_START("DSWB")   /* (1) DIPSW-B */
947   PORT_START("DSWB")
948948   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
949949   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
950950   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
970970   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
971971   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
972972
973   PORT_START("SYSTEM")   /* (2) PORT 0 */
974   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
973   PORT_START("SYSTEM")
974   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
975975//  PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
976976   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
977977   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
r3115r3116
985985INPUT_PORTS_END
986986
987987static INPUT_PORTS_START( kanatuen )
988   PORT_START("DSWA")   /* (0) DIPSW-A */
988   PORT_START("DSWA")
989989   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
990990   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
991991   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
10111011   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
10121012   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10131013
1014   PORT_START("DSWB")   /* (1) DIPSW-B */
1014   PORT_START("DSWB")
10151015   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
10161016   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
10171017   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
10371037   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
10381038   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10391039
1040   PORT_START("SYSTEM")   /* (2) PORT 0 */
1041   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1040   PORT_START("SYSTEM")
1041   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
10421042//  PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
10431043   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )      //
10441044   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
r3115r3116
10521052INPUT_PORTS_END
10531053
10541054static INPUT_PORTS_START( kyuhito )
1055   PORT_START("DSWA")   /* (0) DIPSW-A */
1055   PORT_START("DSWA")
10561056   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
10571057   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
10581058   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
10781078   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
10791079   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10801080
1081   PORT_START("DSWB")   /* (1) DIPSW-B */
1081   PORT_START("DSWB")
10821082   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
10831083   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
10841084   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
11041104   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
11051105   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11061106
1107   PORT_START("SYSTEM")   /* (2) PORT 0 */
1108   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1107   PORT_START("SYSTEM")
1108   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
11091109//  PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
11101110   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )      //
11111111   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
r3115r3116
11191119INPUT_PORTS_END
11201120
11211121static INPUT_PORTS_START( idhimitu )
1122   PORT_START("DSWA")   /* (0) DIPSW-A */
1122   PORT_START("DSWA")
11231123   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
11241124   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
11251125   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
11451145   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
11461146   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11471147
1148   PORT_START("DSWB")   /* (1) DIPSW-B */
1148   PORT_START("DSWB")
11491149   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
11501150   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
11511151   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
11711171   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
11721172   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11731173
1174   PORT_START("SYSTEM")   /* (2) PORT 0 */
1175   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1174   PORT_START("SYSTEM")
1175   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
11761176//  PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
11771177   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )      //
11781178   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
r3115r3116
11861186INPUT_PORTS_END
11871187
11881188static INPUT_PORTS_START( secolove )
1189   PORT_START("DSWA")   /* (0) DIPSW-A */
1189   PORT_START("DSWA")
11901190   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
11911191   PORT_DIPSETTING(    0x07, "1 (Easy)" )
11921192   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
12121212   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12131213   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12141214
1215   PORT_START("DSWB")   /* (1) DIPSW-B */
1215   PORT_START("DSWB")
12161216   PORT_DIPNAME( 0x03, 0x00, "Number of last chance" )
12171217   PORT_DIPSETTING(    0x03, "0" )
12181218   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
12371237   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12381238   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12391239
1240   PORT_START("SYSTEM")   /* (2) PORT 0 */
1241   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1240   PORT_START("SYSTEM")
1241   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
12421242   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
12431243   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
12441244   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
12511251INPUT_PORTS_END
12521252
12531253static INPUT_PORTS_START( citylove )
1254   PORT_START("DSWA")   /* (0) DIPSW-A */
1254   PORT_START("DSWA")
12551255   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Difficulty ) )
12561256   PORT_DIPSETTING(    0x0f, "1 (Easy)" )
12571257   PORT_DIPSETTING(    0x0e, "2" )
r3115r3116
12811281   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12821282   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12831283
1284   PORT_START("DSWB")   /* (1) DIPSW-B */
1284   PORT_START("DSWB")
12851285   PORT_DIPNAME( 0x03, 0x00, "Number of last chance" )
12861286   PORT_DIPSETTING(    0x03, "0" )
12871287   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
13051305   PORT_DIPSETTING(    0x40, "TSUMO 7" )
13061306   PORT_DIPSETTING(    0x00, "HAIPAI" )
13071307
1308   PORT_START("SYSTEM")   /* (2) PORT 0 */
1309   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1308   PORT_START("SYSTEM")
1309   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
13101310   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
13111311   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
13121312   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
13201320
13211321static INPUT_PORTS_START( mcitylov )
13221322#if 1
1323   PORT_START("DSWA")   /* (0) DIPSW-A */
1323   PORT_START("DSWA")
13241324   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
13251325   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
13261326   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
13461346   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
13471347   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13481348
1349   PORT_START("DSWB")   /* (1) DIPSW-B */
1349   PORT_START("DSWB")
13501350   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
13511351   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
13521352   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
13731373   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13741374#else
13751375
1376   PORT_START("DSWA")   /* (0) DIPSW-A */
1376   PORT_START("DSWA")
13771377   PORT_DIPNAME( 0x07, 0x00, "Game Out" )
13781378   PORT_DIPSETTING(    0x07, "60% (Hard)" )
13791379   PORT_DIPSETTING(    0x06, "65%" )
r3115r3116
13971397   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
13981398   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13991399
1400   PORT_START("DSWB")   /* (1) DIPSW-B */
1400   PORT_START("DSWB")
14011401   PORT_DIPNAME( 0x01, 0x00, "Rate Up" )
14021402   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
14031403   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
14101410   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
14111411#endif
14121412
1413   PORT_START("SYSTEM")   /* (2) PORT 0 */
1414   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1413   PORT_START("SYSTEM")
1414   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
14151415   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
14161416   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
14171417   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
14241424INPUT_PORTS_END
14251425
14261426static INPUT_PORTS_START( seiha )
1427   PORT_START("DSWA")   /* (0) DIPSW-A */
1427   PORT_START("DSWA")
14281428   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Difficulty ) )
14291429   PORT_DIPSETTING(    0x07, "1 (Hard)" )
14301430   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
14501450   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
14511451   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14521452
1453   PORT_START("DSWB")   /* (1) DIPSW-B */
1453   PORT_START("DSWB")
14541454   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
14551455   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
14561456   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
14761476   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
14771477   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14781478
1479   PORT_START("SYSTEM")   /* (2) PORT 0 */
1480   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1479   PORT_START("SYSTEM")
1480   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
14811481   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
14821482   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
14831483   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
14901490INPUT_PORTS_END
14911491
14921492static INPUT_PORTS_START( seiham )
1493   PORT_START("DSWA")   /* (0) DIPSW-A */
1493   PORT_START("DSWA")
14941494   PORT_DIPNAME( 0x07, 0x00, "Game Out" )
14951495   PORT_DIPSETTING(    0x07, "60% (Hard)" )
14961496   PORT_DIPSETTING(    0x06, "65%" )
r3115r3116
15141514   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
15151515   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
15161516
1517   PORT_START("DSWB")   /* (1) DIPSW-B */
1517   PORT_START("DSWB")
15181518   PORT_DIPNAME( 0x01, 0x00, "Rate Up" )
15191519   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
15201520   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
15401540   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
15411541   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
15421542
1543   PORT_START("SYSTEM")   /* (2) PORT 0 */
1544   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1543   PORT_START("SYSTEM")
1544   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
15451545   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
15461546   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
15471547   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
15541554INPUT_PORTS_END
15551555
15561556static INPUT_PORTS_START( iemoto )
1557   PORT_START("DSWA")   /* (0) DIPSW-A */
1557   PORT_START("DSWA")
15581558   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Difficulty ) )
15591559   PORT_DIPSETTING(    0x07, "1 (Hard)" )
15601560   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
15801580   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
15811581   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
15821582
1583   PORT_START("DSWB")   /* (1) DIPSW-B */
1583   PORT_START("DSWB")
15841584   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
15851585   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
15861586   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
16061606   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
16071607   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
16081608
1609   PORT_START("SYSTEM")   /* (2) PORT 0 */
1610   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1609   PORT_START("SYSTEM")
1610   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
16111611   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
16121612   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
16131613   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
16201620INPUT_PORTS_END
16211621
16221622static INPUT_PORTS_START( iemotom )
1623   PORT_START("DSWA")   /* (0) DIPSW-A */
1623   PORT_START("DSWA")
16241624   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
16251625   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
16261626   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
16461646   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
16471647   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
16481648
1649   PORT_START("DSWB")   /* (1) DIPSW-B */
1649   PORT_START("DSWB")
16501650   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
16511651   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
16521652   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
16721672   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
16731673   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
16741674
1675   PORT_START("SYSTEM")   /* (2) PORT 0 */
1676   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1675   PORT_START("SYSTEM")
1676   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
16771677   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
16781678   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
16791679   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
16861686INPUT_PORTS_END
16871687
16881688static INPUT_PORTS_START( ryuuha )
1689   PORT_START("DSWA")   /* (0) DIPSW-A */
1689   PORT_START("DSWA")
16901690   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
16911691   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
16921692   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
17121712   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
17131713   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
17141714
1715   PORT_START("DSWB")   /* (1) DIPSW-B */
1715   PORT_START("DSWB")
17161716   PORT_DIPNAME( 0x01, 0x01, "Character Display Test" )
17171717   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
17181718   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
17381738   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
17391739   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
17401740
1741   PORT_START("SYSTEM")   /* (2) PORT 0 */
1742   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1741   PORT_START("SYSTEM")
1742   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
17431743   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
17441744   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
17451745   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
17521752INPUT_PORTS_END
17531753
17541754static INPUT_PORTS_START( bijokkoy )
1755   PORT_START("DSWA")   /* (0) DIPSW-A */
1755   PORT_START("DSWA")
17561756   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
17571757   PORT_DIPSETTING(    0x07, "1 (Easy)" )
17581758   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
17781778   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
17791779   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
17801780
1781   PORT_START("DSWB")   /* (1) DIPSW-B */
1781   PORT_START("DSWB")
17821782   PORT_DIPNAME( 0x03, 0x00, "Number of last chance" )
17831783   PORT_DIPSETTING(    0x03, "0" )
17841784   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
18031803   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
18041804   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
18051805
1806   PORT_START("SYSTEM")   /* (2) PORT 0 */
1807   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1806   PORT_START("SYSTEM")
1807   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
18081808   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
18091809   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
18101810   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
18171817INPUT_PORTS_END
18181818
18191819static INPUT_PORTS_START( bijokkog )
1820   PORT_START("DSWA")   /* (0) DIPSW-A */
1820   PORT_START("DSWA")
18211821   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
18221822   PORT_DIPSETTING(    0x07, "1 (Easy)" )
18231823   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
18431843   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
18441844   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
18451845
1846   PORT_START("DSWB")   /* (1) DIPSW-B */
1846   PORT_START("DSWB")
18471847   PORT_DIPNAME( 0x03, 0x00, "Number of last chance" )
18481848   PORT_DIPSETTING(    0x03, "0" )
18491849   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
18671867   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
18681868   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
18691869
1870   PORT_START("SYSTEM")   /* (2) PORT 0 */
1871   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1870   PORT_START("SYSTEM")
1871   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
18721872   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
18731873   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
18741874   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
18811881INPUT_PORTS_END
18821882
18831883static INPUT_PORTS_START( housemnq )
1884   PORT_START("DSWA")   /* (0) DIPSW-A */
1884   PORT_START("DSWA")
18851885   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
18861886   PORT_DIPSETTING(    0x07, "1 (Easy)" )
18871887   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
19071907   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
19081908   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
19091909
1910   PORT_START("DSWB")   /* (1) DIPSW-B */
1910   PORT_START("DSWB")
19111911   PORT_DIPNAME( 0x03, 0x03, "Time" )
19121912   PORT_DIPSETTING(    0x03, "120" )
19131913   PORT_DIPSETTING(    0x02, "100" )
r3115r3116
19311931   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
19321932   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
19331933
1934   PORT_START("SYSTEM")   /* (2) PORT 0 */
1935   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1934   PORT_START("SYSTEM")
1935   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
19361936   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
19371937   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
19381938   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
19451945INPUT_PORTS_END
19461946
19471947static INPUT_PORTS_START( housemn2 )
1948   PORT_START("DSWA")   /* (0) DIPSW-A */
1948   PORT_START("DSWA")
19491949   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
19501950   PORT_DIPSETTING(    0x07, "1 (Easy)" )
19511951   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
19711971   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
19721972   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
19731973
1974   PORT_START("DSWB")   /* (1) DIPSW-B */
1974   PORT_START("DSWB")
19751975   PORT_DIPNAME( 0x03, 0x03, "Time" )
19761976   PORT_DIPSETTING(    0x03, "120" )
19771977   PORT_DIPSETTING(    0x02, "100" )
r3115r3116
19941994//  PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
19951995   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
19961996
1997   PORT_START("SYSTEM")   /* (2) PORT 0 */
1998   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1997   PORT_START("SYSTEM")
1998   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
19991999   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
20002000   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
20012001   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
20082008INPUT_PORTS_END
20092009
20102010static INPUT_PORTS_START( orangec )
2011   PORT_START("DSWA")   /* (0) DIPSW-A */
2011   PORT_START("DSWA")
20122012   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
20132013   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
20142014   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
20342034   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
20352035   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
20362036
2037   PORT_START("DSWB")   /* (1) DIPSW-B */
2037   PORT_START("DSWB")
20382038   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
20392039   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
20402040   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
20602060   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
20612061   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
20622062
2063   PORT_START("SYSTEM")   /* (2) PORT 0 */
2064   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2063   PORT_START("SYSTEM")
2064   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
20652065   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
20662066   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
20672067   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
20742074INPUT_PORTS_END
20752075
20762076static INPUT_PORTS_START( orangeci )
2077   PORT_START("DSWA")   /* (0) DIPSW-A */
2077   PORT_START("DSWA")
20782078   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
20792079   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
20802080   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
21002100   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
21012101   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21022102
2103   PORT_START("DSWB")   /* (1) DIPSW-B */
2103   PORT_START("DSWB")
21042104   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
21052105   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
21062106   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
21262126   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
21272127   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21282128
2129   PORT_START("SYSTEM")   /* (2) PORT 0 */
2130   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2129   PORT_START("SYSTEM")
2130   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
21312131   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
21322132   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
21332133   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
21402140INPUT_PORTS_END
21412141
21422142static INPUT_PORTS_START( vipclub )
2143   PORT_START("DSWA")   /* (0) DIPSW-A */
2143   PORT_START("DSWA")
21442144   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
21452145   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
21462146   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
21662166   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
21672167   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21682168
2169   PORT_START("DSWB")   /* (1) DIPSW-B */
2169   PORT_START("DSWB")
21702170   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
21712171   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
21722172   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
21922192   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
21932193   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21942194
2195   PORT_START("SYSTEM")   /* (2) PORT 0 */
2196   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2195   PORT_START("SYSTEM")
2196   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
21972197   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
21982198   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
21992199   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
22062206INPUT_PORTS_END
22072207
22082208static INPUT_PORTS_START( livegal )
2209   PORT_START("DSWA")   /* (0) DIPSW-A */
2209   PORT_START("DSWA")
22102210   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
22112211   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
22122212   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
22322232   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
22332233   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
22342234
2235   PORT_START("DSWB")   /* (1) DIPSW-B */
2235   PORT_START("DSWB")
22362236   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
22372237   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
22382238   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
22582258   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
22592259   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
22602260
2261   PORT_START("SYSTEM")   /* (2) PORT 0 */
2262   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2261   PORT_START("SYSTEM")
2262   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
22632263   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
22642264   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
22652265   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
22842284INPUT_PORTS_END
22852285
22862286static INPUT_PORTS_START( ojousan )
2287   PORT_START("DSWA")   /* (0) DIPSW-A */
2287   PORT_START("DSWA")
22882288   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
22892289   PORT_DIPSETTING(    0x07, "1 (Easy)" )
22902290   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
23102310   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
23112311   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
23122312
2313   PORT_START("DSWB")   /* (1) DIPSW-B */
2313   PORT_START("DSWB")
23142314   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
23152315   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
23162316   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
23362336   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
23372337   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
23382338
2339   PORT_START("SYSTEM")   /* (2) PORT 0 */
2340   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2339   PORT_START("SYSTEM")
2340   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
23412341   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
23422342   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
23432343   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
23502350INPUT_PORTS_END
23512351
23522352static INPUT_PORTS_START( ojousanm )
2353   PORT_START("DSWA")   /* (0) DIPSW-A */
2353   PORT_START("DSWA")
23542354   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
23552355   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
23562356   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
23762376   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
23772377   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
23782378
2379   PORT_START("DSWB")   /* (1) DIPSW-B */
2379   PORT_START("DSWB")
23802380   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
23812381   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
23822382   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
24022402   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
24032403   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
24042404
2405   PORT_START("SYSTEM")   /* (2) PORT 0 */
2406   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2405   PORT_START("SYSTEM")
2406   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
24072407   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
24082408   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
24092409   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
24162416INPUT_PORTS_END
24172417
24182418static INPUT_PORTS_START( korinai )
2419   PORT_START("DSWA")   /* (0) DIPSW-A */
2419   PORT_START("DSWA")
24202420   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
24212421   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
24222422   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
24422442   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
24432443   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
24442444
2445   PORT_START("DSWB")   /* (1) DIPSW-B */
2445   PORT_START("DSWB")
24462446   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
24472447   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
24482448   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
24682468   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
24692469   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
24702470
2471   PORT_START("SYSTEM")   /* (2) PORT 0 */
2472   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2471   PORT_START("SYSTEM")
2472   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
24732473   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
24742474   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
24752475   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
24822482INPUT_PORTS_END
24832483
24842484static INPUT_PORTS_START( korinaim )
2485   PORT_START("DSWA")   /* (0) DIPSW-A */
2485   PORT_START("DSWA")
24862486   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
24872487   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
24882488   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
25082508   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
25092509   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
25102510
2511   PORT_START("DSWB")   /* (1) DIPSW-B */
2511   PORT_START("DSWB")
25122512   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
25132513   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
25142514   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
25342534   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
25352535   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
25362536
2537   PORT_START("SYSTEM")   /* (2) PORT 0 */
2538   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2537   PORT_START("SYSTEM")
2538   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
25392539   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
25402540   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
25412541   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
25482548INPUT_PORTS_END
25492549
25502550static INPUT_PORTS_START( crystalg )
2551   PORT_START("DSWA")   /* (0) DIPSW-A */
2551   PORT_START("DSWA")
25522552   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
25532553   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
25542554   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
25742574   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
25752575   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
25762576
2577   PORT_START("DSWB")   /* (1) DIPSW-B */
2577   PORT_START("DSWB")
25782578   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
25792579   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
25802580   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
26002600   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
26012601   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
26022602
2603   PORT_START("SYSTEM")   /* (2) PORT 0 */
2604   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2603   PORT_START("SYSTEM")
2604   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
26052605   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
26062606   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
26072607   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
26142614INPUT_PORTS_END
26152615
26162616static INPUT_PORTS_START( crystal2 )
2617   PORT_START("DSWA")   /* (0) DIPSW-A */
2617   PORT_START("DSWA")
26182618   PORT_DIPNAME( 0x0f, 0x0d, DEF_STR( Difficulty ) )
26192619   PORT_DIPSETTING(    0x0d, "1 (Easy)" )
26202620   PORT_DIPSETTING(    0x0a, "2" )
r3115r3116
26382638   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
26392639   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
26402640
2641   PORT_START("DSWB")   /* (1) DIPSW-B */
2641   PORT_START("DSWB")
26422642   PORT_DIPNAME( 0x03, 0x00, "Number of last chance" )
26432643   PORT_DIPSETTING(    0x03, "0" )
26442644   PORT_DIPSETTING(    0x02, "1" )
r3115r3116
26622662   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
26632663   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
26642664
2665   PORT_START("SYSTEM")   /* (2) PORT 0 */
2666   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2665   PORT_START("SYSTEM")
2666   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
26672667   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
26682668   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
26692669   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
26762676INPUT_PORTS_END
26772677
26782678static INPUT_PORTS_START( apparel )
2679   PORT_START("DSWA")   /* (0) DIPSW-A */
2679   PORT_START("DSWA")
26802680   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
26812681   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
26822682   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
27022702   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
27032703   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
27042704
2705   PORT_START("DSWB")   /* (1) DIPSW-B */
2705   PORT_START("DSWB")
27062706   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
27072707   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
27082708   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
27282728   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
27292729   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
27302730
2731   PORT_START("SYSTEM")   /* (2) PORT 0 */
2732   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2731   PORT_START("SYSTEM")
2732   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
27332733   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
27342734   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
27352735   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
27422742INPUT_PORTS_END
27432743
27442744static INPUT_PORTS_START( nightlov )
2745   PORT_START("DSWA")   /* (0) DIPSW-A */
2745   PORT_START("DSWA")
27462746   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
27472747   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
27482748   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
27682768   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
27692769   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
27702770
2771   PORT_START("DSWB")   /* (1) DIPSW-B */
2771   PORT_START("DSWB")
27722772   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
27732773   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
27742774   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
27942794   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
27952795   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
27962796
2797   PORT_START("SYSTEM")   /* (2) PORT 0 */
2798   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
2797   PORT_START("SYSTEM")
2798   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
27992799   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
28002800   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
28012801   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
src/mame/drivers/sbowling.c
r3115r3116
3939
4040#include "driver.h"
4141#include "deprecat.h"
42#include "cpu/i8039/i8039.h"
42#include "cpu/mcs48/mcs48.h"
4343#include "video/resnet.h"
4444#include "sound/ay8910.h"
4545
src/mame/drivers/8080bw.c
r3115r3116
120120   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in1_control_r, NULL)
121121   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
122122
123   PORT_START("IN2")   /* referenced by invaders_io_map, used in several drivers; this is fairly hacky */
124   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
125
126   PORT_START("DSW0")
123   PORT_START("IN2")
127124   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1,2")
128125   PORT_DIPSETTING(    0x00, "3" )
129126   PORT_DIPSETTING(    0x01, "4" )
r3115r3116
177174static INPUT_PORTS_START( invadrmr )
178175   PORT_INCLUDE( sicv )
179176
180   PORT_MODIFY("DSW0")
177   PORT_MODIFY("IN2")
181178   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4")
182179   PORT_DIPSETTING(    0x00, "1500" )
183180   PORT_DIPSETTING(    0x08, "3000" ) /* This is different to invaders */
r3115r3116
192189static ADDRESS_MAP_START( invadpt2_io_map, ADDRESS_SPACE_IO, 8 )
193190    AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
194191    AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
195    AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW0") AM_WRITE(mb14241_0_shift_count_w)
192    AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mb14241_0_shift_count_w)
196193    AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, invadpt2_sh_port_1_w)
197194    AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w)
198195    AM_RANGE(0x05, 0x05) AM_WRITE(invadpt2_sh_port_2_w)
r3115r3116
209206   PORT_MODIFY("IN1")
210207   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
211208
212   PORT_MODIFY("DSW0")
209   PORT_MODIFY("IN2")
213210   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1")
214211   PORT_DIPSETTING(    0x00, "3" )
215212   PORT_DIPSETTING(    0x01, "4" )
r3115r3116
249246static ADDRESS_MAP_START( spcewars_io_map, ADDRESS_SPACE_IO, 8 )
250247   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
251248   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
252   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW0") AM_WRITE(mb14241_0_shift_count_w)
249   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mb14241_0_shift_count_w)
253250   AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, spcewars_sh_port_w)
254251   AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w)
255252   AM_RANGE(0x05, 0x05) AM_WRITE(invadpt2_sh_port_2_w)
r3115r3116
262259   PORT_MODIFY("IN1")
263260   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
264261
265   PORT_MODIFY("DSW0")
262   PORT_MODIFY("IN2")
266263   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1")
267264   PORT_DIPSETTING(    0x00, "3" )
268265   PORT_DIPSETTING(    0x01, "4" )
r3115r3116
309306static ADDRESS_MAP_START( cosmo_io_map, ADDRESS_SPACE_IO, 8 )
310307   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITENOP
311308   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_WRITENOP
312   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW0") AM_WRITENOP
309   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITENOP
313310    AM_RANGE(0x03, 0x03) AM_WRITE(invadpt2_sh_port_1_w)
314311    AM_RANGE(0x05, 0x05) AM_WRITE(cosmo_sh_port_2_w)
315312   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
r3115r3116
323320   PORT_MODIFY("IN1")
324321   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
325322
326   PORT_MODIFY("DSW0")
323   PORT_MODIFY("IN2")
327324   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )   PORT_DIPLOCATION("SW1:1")
328325   PORT_DIPSETTING(    0x00, "3" )
329326   PORT_DIPSETTING(    0x01, "5" )
r3115r3116
361358   PORT_MODIFY("IN1")
362359   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
363360
364   PORT_MODIFY("DSW0")
361   PORT_MODIFY("IN2")
365362   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )   PORT_DIPLOCATION("SW1:1")
366363   PORT_DIPSETTING(    0x00, "2" )
367364   PORT_DIPSETTING(    0x01, "3" )
r3115r3116
385382static INPUT_PORTS_START( spaceatt )
386383   PORT_INCLUDE( sicv )
387384
388   PORT_MODIFY("DSW0")
385   PORT_MODIFY("IN2")
389386   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:5" )
390387   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:6" )
391388   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW1:7" )
r3115r3116
408405static ADDRESS_MAP_START( invrvnge_io_map, ADDRESS_SPACE_IO, 8 )
409406   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
410407   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
411   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW0") AM_WRITE(mb14241_0_shift_count_w)
408   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mb14241_0_shift_count_w)
412409   AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, invrvnge_sh_port_w)
413410   AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w)
414411ADDRESS_MAP_END
r3115r3116
435432   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
436433   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
437434
438   PORT_START("DSW0")
435   PORT_START("IN2")
439436   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )                           PORT_DIPLOCATION("SW1:1,2")
440437   PORT_DIPSETTING(    0x00, "3" )
441438   PORT_DIPSETTING(    0x01, "4" )
r3115r3116
482479   //PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2) /* This is not 2 Player ??? */
483480   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
484481
485   PORT_START("IN2")   /* referenced by invaders_io_map, used in several drivers; this is fairly hacky */
486   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
482//  PORT_START("IN2")   /* referenced by invaders_io_map, used in several drivers; this is fairly hacky */
483//  PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
487484
488   PORT_MODIFY("DSW0")
485   PORT_MODIFY("IN2")
489486   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "SW1:1" )
490487   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW1:2" )
491488   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
r3115r3116
514511   PORT_MODIFY("IN1")
515512   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
516513
517   PORT_MODIFY("DSW0")
514   PORT_MODIFY("IN2")
518515   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1,2")
519516   PORT_DIPSETTING(    0x00, "2" )
520517   PORT_DIPSETTING(    0x01, "3" )
r3115r3116
539536static ADDRESS_MAP_START( lrescue_io_map, ADDRESS_SPACE_IO, 8 )
540537   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
541538   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
542   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW0") AM_WRITE(mb14241_0_shift_count_w)
539   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mb14241_0_shift_count_w)
543540   AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, lrescue_sh_port_1_w)
544541   AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w)
545542   AM_RANGE(0x05, 0x05) AM_WRITE(lrescue_sh_port_2_w)
r3115r3116
552549   PORT_MODIFY("IN1")
553550   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
554551
555   PORT_MODIFY("DSW0")
552   PORT_MODIFY("IN2")
556553   /* SW1:3-8 Unused according to manual: "Factory Adjustments". Default is ON. */
557554   PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "SW1:4" )
558555   PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW1:8" )
r3115r3116
594591   PORT_MODIFY("IN1")
595592   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
596593
597   PORT_MODIFY("DSW0")
594   PORT_MODIFY("IN2")
598595   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1,2")
599596   PORT_DIPSETTING(    0x00, "2" )
600597   PORT_DIPSETTING(    0x01, "3" )
r3115r3116
620617   PORT_MODIFY("IN1")
621618   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN2 )
622619
623   PORT_MODIFY("DSW0")
620   PORT_MODIFY("IN2")
624621   /* SW1:5-8 Unused according to manual. */
625622   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:4,3") /* Default is OFF, OFF (6) */
626623   PORT_DIPSETTING(    0x00, "3" )
r3115r3116
651648   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
652649   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN2 )
653650
654   PORT_MODIFY("DSW0")
651   PORT_MODIFY("IN2")
655652   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
656653   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:4")
657654   PORT_DIPSETTING(    0x08, "1500" )
r3115r3116
678675static ADDRESS_MAP_START( rollingc_io_map, ADDRESS_SPACE_IO, 8 )
679676   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(rollingc_sh_port_w)
680677   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
681   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW0") AM_WRITE(mb14241_0_shift_count_w)
678   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mb14241_0_shift_count_w)
682679   AM_RANGE(0x03, 0x03) AM_READ(mb14241_0_shift_result_r)
683680   AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w)
684681ADDRESS_MAP_END
r3115r3116
694691   PORT_MODIFY("IN1")
695692   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
696693
697   PORT_MODIFY("DSW0")
694   PORT_MODIFY("IN2")
698695   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:4" )
699696
700697   /* Dummy port for cocktail mode (not used) */
r3115r3116
737734static ADDRESS_MAP_START( schaser_io_map, ADDRESS_SPACE_IO, 8 )
738735   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
739736   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
740   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW0") AM_WRITE(mb14241_0_shift_count_w)
737   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mb14241_0_shift_count_w)
741738   AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, schaser_sh_port_1_w)
742739   AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w)
743740   AM_RANGE(0x05, 0x05) AM_WRITE(schaser_sh_port_2_w)
r3115r3116
766763   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START1 )
767764   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
768765
769   PORT_START("DSW0")   // port 2
766   PORT_START("IN2")   // port 2
770767   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:1,2")
771768   PORT_DIPSETTING(    0x00, "3" )
772769   PORT_DIPSETTING(    0x01, "4" )
r3115r3116
838835static ADDRESS_MAP_START( schasrcv_io_map, ADDRESS_SPACE_IO, 8 )
839836   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
840837   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
841   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW0") AM_WRITE(mb14241_0_shift_count_w)
838   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mb14241_0_shift_count_w)
842839   AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, schasrcv_sh_port_1_w)
843840   AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w)
844841   AM_RANGE(0x05, 0x05) AM_WRITE(schasrcv_sh_port_2_w)
r3115r3116
854851   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
855852   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
856853
857   PORT_MODIFY("DSW0")
854   PORT_MODIFY("IN2")
858855   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )                           PORT_DIPLOCATION("SW1:1")
859856   PORT_DIPSETTING(    0x00, "3" )
860857   PORT_DIPSETTING(    0x01, "4" )
r3115r3116
909906   AM_RANGE(0x4000, 0x5fff) AM_RAM AM_BASE(&mw8080bw_ram) AM_SIZE(&mw8080bw_ram_size)
910907   AM_RANGE(0x8008, 0x8008) AM_READ_PORT("PADDLE")
911908   AM_RANGE(0x8009, 0x8009) AM_READ(mb14241_0_shift_result_r)
912   AM_RANGE(0x800a, 0x800a) AM_READ_PORT("DSW0")
909   AM_RANGE(0x800a, 0x800a) AM_READ_PORT("IN2")
913910   AM_RANGE(0x800b, 0x800b) AM_READ_PORT("IN0")
914911   AM_RANGE(0x8018, 0x8018) AM_WRITE(mb14241_0_shift_data_w)
915912   AM_RANGE(0x8019, 0x8019) AM_WRITE(mb14241_0_shift_count_w)
r3115r3116
943940   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
944941   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
945942
946   PORT_START("DSW0")
943   PORT_START("IN2")
947944   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
948945   PORT_DIPSETTING(    0x00, "3" )
949946   PORT_DIPSETTING(    0x01, "4" )
r3115r3116
972969static ADDRESS_MAP_START( lupin3_io_map, ADDRESS_SPACE_IO, 8 )
973970   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
974971   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
975   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW0") AM_WRITE(mb14241_0_shift_count_w)
972   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mb14241_0_shift_count_w)
976973   AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, lupin3_sh_port_1_w)
977974   AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w)
978975   AM_RANGE(0x05, 0x05) AM_WRITE(lupin3_sh_port_2_w)
r3115r3116
1000997   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
1001998   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
1002999
1003   PORT_MODIFY("DSW0")
1000   PORT_MODIFY("IN2")
10041001   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW1:3")
10051002   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
10061003   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
r3115r3116
10761073static ADDRESS_MAP_START( polaris_io_map, ADDRESS_SPACE_IO, 8 )
10771074   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(mb14241_0_shift_count_w)
10781075   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
1079   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW0") AM_WRITE(polaris_sh_port_1_w)
1076   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(polaris_sh_port_1_w)
10801077   AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, mb14241_0_shift_data_w)
10811078   AM_RANGE(0x04, 0x04) AM_WRITE(polaris_sh_port_2_w)
10821079   AM_RANGE(0x05, 0x05) AM_WRITE(watchdog_reset_w)
r3115r3116
11071104   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
11081105   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
11091106
1110   PORT_MODIFY("DSW0")
1107   PORT_MODIFY("IN2")
11111108   /* 0x04 should be Cabinet - Upright/Cocktail,
11121109       but until the cocktail hack is changed,
11131110       this will have to do. */
r3115r3116
11731170   PORT_MODIFY("IN1")
11741171   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
11751172
1176   PORT_MODIFY("DSW0")
1173   PORT_MODIFY("IN2")
11771174   PORT_DIPNAME( 0x03, 0x00, "Energy" )         PORT_DIPLOCATION("SW1:1,2")
11781175   PORT_DIPSETTING(    0x00, "15000" )
11791176   PORT_DIPSETTING(    0x01, "20000" )
r3115r3116
12101207   PORT_MODIFY("IN1")
12111208   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
12121209
1213   PORT_MODIFY("DSW0")
1210   PORT_MODIFY("IN2")
12141211   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
12151212   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:4")
12161213   PORT_DIPSETTING(    0x08, "2000" )
r3115r3116
12311228   PORT_MODIFY("IN1")
12321229   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY //typo? declared twice
12331230
1234   PORT_MODIFY("DSW0")
1231   PORT_MODIFY("IN2")
12351232   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
12361233INPUT_PORTS_END
12371234
r3115r3116
12451242static ADDRESS_MAP_START( ballbomb_io_map, ADDRESS_SPACE_IO, 8 )
12461243   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
12471244   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
1248   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW0") AM_WRITE(mb14241_0_shift_count_w)
1245   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mb14241_0_shift_count_w)
12491246   AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, ballbomb_sh_port_1_w)
12501247   AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w)
12511248   AM_RANGE(0x05, 0x05) AM_WRITE(ballbomb_sh_port_2_w)
r3115r3116
12581255   PORT_MODIFY("IN1")
12591256   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
12601257
1261   PORT_MODIFY("DSW0")
1258   PORT_MODIFY("IN2")
12621259   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:4" )
12631260   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:8" )
12641261INPUT_PORTS_END
r3115r3116
13671364   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
13681365   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
13691366
1370   PORT_START("DSW0")
1367   PORT_START("IN2")
13711368   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
13721369   PORT_DIPSETTING(    0x00, "3" )
13731370   PORT_DIPSETTING(    0x01, "4" )
r3115r3116
14241421static ADDRESS_MAP_START( indianbt_io_map, ADDRESS_SPACE_IO, 8 )
14251422   AM_RANGE(0x00, 0x00) AM_READ(indianbt_r)
14261423   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN0")
1427   AM_RANGE(0x02, 0x02) AM_READ_PORT("DSW0") AM_WRITE(mb14241_0_shift_count_w)
1424   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mb14241_0_shift_count_w)
14281425   AM_RANGE(0x03, 0x03) AM_READWRITE(mb14241_0_shift_result_r, indianbt_sh_port_1_w)
14291426   AM_RANGE(0x04, 0x04) AM_WRITE(mb14241_0_shift_data_w)
14301427   AM_RANGE(0x05, 0x05) AM_WRITE(indianbt_sh_port_2_w)
src/mame/drivers/tail2nos.c
r3115r3116
7979   AM_RANGE(0xffc300, 0xffcfff) AM_RAM
8080   AM_RANGE(0xffd000, 0xffdfff) AM_RAM_WRITE(tail2nos_bgvideoram_w) AM_BASE(&tail2nos_bgvideoram)
8181   AM_RANGE(0xffe000, 0xffefff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
82   AM_RANGE(0xfff000, 0xfff001) AM_READWRITE(input_port_0_word_r, tail2nos_gfxbank_w)
83   AM_RANGE(0xfff004, 0xfff005) AM_READ(input_port_1_word_r)
82   AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("INPUTS") AM_WRITE(tail2nos_gfxbank_w)
83   AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW")
8484   AM_RANGE(0xfff008, 0xfff009) AM_WRITE(sound_command_w)
8585ADDRESS_MAP_END
8686
src/mame/drivers/quasar.c
r3115r3116
6060#include "driver.h"
6161#include "cvs.h"
6262#include "cpu/s2650/s2650.h"
63#include "cpu/i8039/i8039.h"
63#include "cpu/mcs48/mcs48.h"
6464#include "sound/dac.h"
6565#include "video/s2636.h"
6666
r3115r3116
125125   cvs_bullet_ram[offset] = (data ^ 0xff);
126126}
127127
128static int Quasar_T1=0;
129static int Quasar_Command=0;
130128//static int sh_page=0;
131129
132130static WRITE8_HANDLER( quasar_sh_command_w )
r3115r3116
137135   // lower nibble = command to I8035
138136   // not necessarily like this, but it seems to work better than direct mapping
139137   // (although schematics has it as direct - but then the schematics are wrong elsewhere to!)
140   Quasar_Command = (data & 8) + ((data >> 1) & 3) + ((data << 2) & 4);
141   Quasar_T1      = (Quasar_Command != 15);
138   soundlatch_w(machine, 0, (data & 8) + ((data >> 1) & 3) + ((data << 2) & 4));
142139}
143140
144141static READ8_HANDLER( quasar_sh_command_r )
145142{
146   // Clear T1 signal
147   Quasar_T1 = 0;
148
149   // Testing ...
150   // return input_port_read(machine, "DSW2");
151
152   // Add in sound DIP switch
153   return (Quasar_Command) + (input_port_read(machine, "DSW2") & 0x30);
143   return soundlatch_r(machine, 0) + (input_port_read(machine, "DSW2") & 0x30);
154144}
155145
156static READ8_HANDLER( Quasar_T1_r )
146static READ8_HANDLER( audio_t1_r )
157147{
158   return Quasar_T1;
148   return (soundlatch_r(machine, 0) == 0);
159149}
160150
161static WRITE8_HANDLER( Quasar_DAC_w )
151static WRITE8_HANDLER( audio_dac_w )
162152{
163   dac_0_signed_data_w(machine,0,data);
153   dac_0_signed_data_w(machine, 0, data);
164154}
165155
166156// memory map taken from the manual
r3115r3116
192182 *
193183 *************************************/
194184
195static ADDRESS_MAP_START( readmem_sound, ADDRESS_SPACE_PROGRAM, 8 )
196   AM_RANGE(0x0000, 0x07ff) AM_READ(SMH_ROM)
185static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
186   AM_RANGE(0x0000, 0x07ff) AM_ROM
197187ADDRESS_MAP_END
198188
199static ADDRESS_MAP_START( writemem_sound, ADDRESS_SPACE_PROGRAM, 8 )
200   AM_RANGE(0x0000, 0x07ff) AM_WRITE(SMH_ROM)
189static ADDRESS_MAP_START( sound_portmap, ADDRESS_SPACE_IO, 8 )
190   AM_RANGE(0x00, 0x7f) AM_RAM
191   AM_RANGE(0x80, 0x80) AM_READ(quasar_sh_command_r)
192   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(audio_t1_r)
193     AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(audio_dac_w)
201194ADDRESS_MAP_END
202195
203static ADDRESS_MAP_START( readport_sound, ADDRESS_SPACE_IO, 8 )
204   AM_RANGE(0x00    , 0x7F    ) AM_READ(SMH_RAM)
205   AM_RANGE(0x80    , 0x80    ) AM_READ(quasar_sh_command_r)
206   AM_RANGE(I8039_t1, I8039_t1) AM_READ(Quasar_T1_r)
207ADDRESS_MAP_END
208
209static ADDRESS_MAP_START( writeport_sound, ADDRESS_SPACE_IO, 8 )
210   AM_RANGE(0x00    , 0x7F    ) AM_WRITE(SMH_RAM)
211     AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(Quasar_DAC_w)
212ADDRESS_MAP_END
213
214196/************************************************************************
215197
216198  Inputs
r3115r3116
348330   MDRV_CPU_VBLANK_INT("main", quasar_interrupt)
349331
350332   MDRV_CPU_ADD("sound",I8035,6000000)         /* 6MHz crystal divide by 15 in CPU */
351   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
352   MDRV_CPU_IO_MAP(readport_sound,writeport_sound)
333   MDRV_CPU_PROGRAM_MAP(sound_map,0)
334   MDRV_CPU_IO_MAP(sound_portmap,0)
353335
354336   MDRV_MACHINE_START( cvs )
355337
src/mame/drivers/victory.c
r3115r3116
138138
139139static ADDRESS_MAP_START( main_io_map, ADDRESS_SPACE_IO, 8 )
140140   ADDRESS_MAP_GLOBAL_MASK(0xff)
141   AM_RANGE(0x00, 0x00) AM_MIRROR(0x03) AM_READ(input_port_0_r)
142   AM_RANGE(0x04, 0x04) AM_MIRROR(0x03) AM_READ(input_port_1_r)
143   AM_RANGE(0x08, 0x08) AM_READ(input_port_2_r)
144   AM_RANGE(0x0a, 0x0a) AM_READ(input_port_3_r)
145   AM_RANGE(0x0c, 0x0c) AM_READ(input_port_4_r)
146   AM_RANGE(0x0e, 0x0e) AM_READ(input_port_5_r)
141   AM_RANGE(0x00, 0x00) AM_MIRROR(0x03) AM_READ_PORT("SW2")
142   AM_RANGE(0x04, 0x04) AM_MIRROR(0x03) AM_READ_PORT("SW1")
143   AM_RANGE(0x08, 0x08) AM_READ_PORT("DIAL")
144   AM_RANGE(0x0a, 0x0a) AM_READ_PORT("COIN")
145   AM_RANGE(0x0c, 0x0c) AM_READ_PORT("BUTTONS")
146   AM_RANGE(0x0e, 0x0e) AM_READ_PORT("UNUSED")
147147   AM_RANGE(0x10, 0x10) AM_MIRROR(0x03) AM_WRITE(lamp_control_w)
148148   AM_RANGE(0x14, 0xff) AM_NOP
149149ADDRESS_MAP_END
src/mame/drivers/psikyo4.c
r3115r3116
215215{
216216   if (ACCESSING_BITS_16_31)
217217   {
218      return ((input_port_read(machine, "JP4")&0x3)<<16) | ((eeprom_read_bit() << 20)); /* EEPROM */
218      return input_port_read(machine, "JP4");
219219   }
220220
221221//  logerror("Unk EEPROM read mask %x\n", mem_mask);
r3115r3116
228228   cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
229229}
230230
231static READ32_HANDLER(hotgmck_io32_r) /* used by hotgmck/hgkairak */
231static CUSTOM_INPUT( system_port_r )
232232{
233   return input_port_read(field->port->machine, "SYSTEM");
234}
235
236static CUSTOM_INPUT( mahjong_ctrl_r ) /* used by hotgmck/hgkairak */
237{
238   int player = (FPTR)param;
239   int sel = (ps4_io_select[0] & 0x0000ff00) >> 8;
233240   int ret = 0xff;
234   int sel = (ps4_io_select[0] & 0x0000ff00) >> 8;
235241
236   if (sel & 1) ret &= input_port_read(machine, offset ? "KEY4" : "KEY0" );
237   if (sel & 2) ret &= input_port_read(machine, offset ? "KEY5" : "KEY1" );
238   if (sel & 4) ret &= input_port_read(machine, offset ? "KEY6" : "KEY2" );
239   if (sel & 8) ret &= input_port_read(machine, offset ? "KEY7" : "KEY3" );
242   if (sel & 1) ret &= input_port_read(field->port->machine, player ? "KEY4" : "KEY0" );
243   if (sel & 2) ret &= input_port_read(field->port->machine, player ? "KEY5" : "KEY1" );
244   if (sel & 4) ret &= input_port_read(field->port->machine, player ? "KEY6" : "KEY2" );
245   if (sel & 8) ret &= input_port_read(field->port->machine, player ? "KEY7" : "KEY3" );
240246
241   return ret<<24 | input_port_read(machine, "SYSTEM");
247   return ret;
242248}
243249
244static READ32_HANDLER(ps4_io32_r) /* used by loderndf/hotdebut */
245{
246   return ((input_port_read(machine, offset ? "P3" : "P1" ) << 24) | (input_port_read(machine, offset ? "P4" : "P2" ) << 16) | (input_port_read(machine, offset ? "UNUSED1" : "UNUSED0" ) << 8) | (input_port_read(machine, offset ? "UNUSED2" : "SYSTEM" ) << 0));
247}
248
249250static WRITE32_HANDLER( ps4_paletteram32_RRRRRRRRGGGGGGGGBBBBBBBBxxxxxxxx_dword_w )
250251{
251252   int r,g,b;
r3115r3116
447448//  AM_RANGE(0x03003fe8, 0x03003fef) AM_READ(SMH_RAM) // vid regs?
448449   AM_RANGE(0x03004000, 0x03005fff) AM_READ(SMH_RAM)
449450   AM_RANGE(0x05000000, 0x05000003) AM_READ(psh_ymf_fm_r) // read YMF status
450   AM_RANGE(0x05800000, 0x05800007) AM_READ(ps4_io32_r) // Screen 1+2's Controls
451   AM_RANGE(0x05800000, 0x05800003) AM_READ_PORT("P1_P2")
452   AM_RANGE(0x05800004, 0x05800007) AM_READ_PORT("P3_P4")
451453   AM_RANGE(0x06000000, 0x060fffff) AM_READ(SMH_RAM)   // main RAM (1 meg)
452454
453455#if ROMTEST
r3115r3116
537539MACHINE_DRIVER_END
538540
539541
542static INPUT_PORTS_START( hotgmck )
543   PORT_START("P1_P2")
544   PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CUSTOM(system_port_r, NULL)
545   PORT_BIT( 0x00ffff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
546   PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CUSTOM(mahjong_ctrl_r, (void *)0)
540547
541#define UNUSED_PORT \
542   /* not read? */ \
543   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
544   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
545   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
546   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
547   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
548   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
549   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
550   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
548   PORT_START("P3_P4")
549   PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CUSTOM(system_port_r, NULL)
550   PORT_BIT( 0x00ffff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
551   PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_CUSTOM(mahjong_ctrl_r, (void *)1)
551552
552static INPUT_PORTS_START( hotgmck )
553   PORT_START("JP4")/* jumper pads 'JP4' on the PCB */
554   /* EEPROM is read here */
555   PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
556
557   PORT_START("SYSTEM")   /* system inputs */
558   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )   // Screen 1
559   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
560   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )   // Screen 2
561   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
562   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )   // Screen 1
563   PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW)
564#if ROMTEST
565   PORT_DIPNAME( 0x40, 0x40, "Debug" ) /* Unknown effects */
566   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
567   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
568#else
569   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
570#endif
571   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE2 )   // Screen 2
572
553573   PORT_START("KEY0")   /* fake player 1 controls 1st bank */
554574   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
555575   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )
r3115r3116
629649   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
630650   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
631651   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
632
633   PORT_START("SYSTEM")   /* system inputs */
634   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1    ) // Screen 1
635   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
636   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_COIN2    ) // Screen 2
637   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
638   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_SERVICE1 ) // Screen 1
639   PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW)
640#if ROMTEST
641   PORT_DIPNAME( 0x40, 0x40, "Debug" ) /* Unknown effects */
642   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
643   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
644#else
645   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
646#endif
647   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_SERVICE2 ) // Screen 2
648
649   PORT_START("JP4")/* jumper pads 'JP4' on the PCB */
650   UNUSED_PORT
651652INPUT_PORTS_END
652653
653654static INPUT_PORTS_START( loderndf )
654   PORT_START("P1")   /* player 1 controls */
655   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
656   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
657   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
658   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
659   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
660   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
661   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) // Can be used as Retry button
662   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
663
664   PORT_START("P2")   /* player 2 controls */
665   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
666   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
667   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
668   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
669   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
670   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
671   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) // Can be used as Retry button
672   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
673
674   PORT_START("UNUSED0")
675   UNUSED_PORT /* unused? */
676
677   PORT_START("SYSTEM")   /* system inputs */
678   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1    ) // Screen 1
679   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2    ) // Screen 1 - 2nd slot
680   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_COIN3    ) // Screen 2
681   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_COIN4    ) // Screen 2 - 2nd slot
682   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_SERVICE1 ) // Screen 1
683   PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW)
655   PORT_START("P1_P2")
656   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )   // Screen 1
657   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )   // Screen 1 - 2nd slot
658   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_COIN3 )   // Screen 2
659   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_COIN4 )   // Screen 2 - 2nd slot
660   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )   // Screen 1
661   PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW)
684662#if ROMTEST
685   PORT_DIPNAME( 0x40, 0x40, "Debug" ) /* Must be high for rom test, unknown other side-effects */
686   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
687   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
663   PORT_DIPNAME( 0x00000040, 0x00000040, "Debug" ) /* Must be high for rom test, unknown other side-effects */
664   PORT_DIPSETTING(         0x00000040, DEF_STR( Off ) )
665   PORT_DIPSETTING(         0x00000000, DEF_STR( On ) )
688666#else
689   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
667   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
690668#endif
691   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_SERVICE2 ) // Screen 2
669   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_SERVICE2 )   // Screen 2
670   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
671   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
672   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
673   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
674   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
675   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
676   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
677   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
692678
693   PORT_START("P3")   /* player 1 controls on second screen */
694   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
695   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
696   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
697   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
698   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
699   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
700   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) // Can be used as Retry button
701   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
679   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
680   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
681   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
682   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
683   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
684   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
685   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) // Can be used as Retry button
686   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_START2 )
687   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
688   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
689   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
690   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
691   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
692   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
693   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) // Can be used as Retry button
694   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_START1 )
702695
703   PORT_START("P4")   /* player 2 controls on second screen */
704   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
705   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
706   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
707   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
708   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
709   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
710   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) // Can be used as Retry button
711   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
696   PORT_START("P3_P4")   /* player 1/2 controls on second screen */
697   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_UNKNOWN )
698   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN )
699   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN )
700   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
701   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
702   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
703   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
704   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNKNOWN )
705   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
706   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
707   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
708   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
709   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
710   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
711   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
712   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
712713
713   PORT_START("UNUSED1")
714   UNUSED_PORT
714   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
715   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
716   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
717   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
718   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
719   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
720   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) // Can be used as Retry button
721   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_START4 )
722   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
723   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
724   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
725   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
726   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
727   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
728   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) // Can be used as Retry button
729   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_START3 )
715730
716   PORT_START("UNUSED2")
717   UNUSED_PORT
718
719731   PORT_START("JP4")/* jumper pads 'JP4' on the PCB */
720732//  1-ON,2-ON,3-ON,4-ON  --> Japanese
721733//  1-ON,2-ON,3-ON,4-OFF --> English
722   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Region ) )
723   PORT_DIPSETTING(   0x00, "Japan (Shows Version Number)" )
724   PORT_DIPSETTING(   0x01, "World (Does Not Show Version Number)" )
734   PORT_DIPNAME( 0x00030000, 0x00010000, DEF_STR( Region ) )
735   PORT_DIPSETTING(         0x00000000, "Japan (Shows Version Number)" )
736   PORT_DIPSETTING(         0x00010000, "World (Does Not Show Version Number)" )
737   /* EEPROM is read here */
738   PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
725739INPUT_PORTS_END
726740
727741/* unused inputs also act as duplicate buttons */
728742static INPUT_PORTS_START( hotdebut )
729   PORT_START("P1")   /* player 1 controls */
730   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
731   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
732   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
733   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
734   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
735   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
736   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
737   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
738
739   PORT_START("P2")   /* player 2 controls */
740   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
741   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
742   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
743   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
744   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
745   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
746   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
747   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
748
749   PORT_START("UNUSED0")
750   UNUSED_PORT
751
752   PORT_START("SYSTEM")   /* system inputs */
753   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1    ) // Screen 1
754   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2    ) // Screen 1 - 2nd slot
755   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_COIN3    ) // Screen 2
756   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_COIN4    ) // Screen 2 - 2nd slot
757   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_SERVICE1 ) // Screen 1
758   PORT_SERVICE_NO_TOGGLE(0x20, IP_ACTIVE_LOW)
743   PORT_START("P1_P2")
744   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )   // Screen 1
745   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )   // Screen 1 - 2nd slot
746   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_COIN3 )   // Screen 2
747   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_COIN4 )   // Screen 2 - 2nd slot
748   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )   // Screen 1
749   PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW)
759750#if ROMTEST
760   PORT_DIPNAME( 0x40, 0x40, "Debug" ) /* Must be high for rom test, unknown other side-effects */
761   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
762   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
751   PORT_DIPNAME( 0x00000040, 0x00000040, "Debug" ) /* Must be high for rom test, unknown other side-effects */
752   PORT_DIPSETTING(         0x00000040, DEF_STR( Off ) )
753   PORT_DIPSETTING(         0x00000000, DEF_STR( On ) )
763754#else
764   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
755   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
765756#endif
766   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_SERVICE2 ) // Screen 2
757   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_SERVICE2 )   // Screen 2
758   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
759   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
760   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
761   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
762   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
763   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
764   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
765   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
767766
768   PORT_START("P3")   /* player 1 controls on second screen */
769   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
770   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
771   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
772   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3)
773   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
774   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
775   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
776   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
767   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
768   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
769   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
770   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
771   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNUSED )
772   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED )
773   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED )
774   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_START2 )
775   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
776   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
777   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
778   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
779   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNUSED )
780   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_UNUSED )
781   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNUSED )
782   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_START1 )
777783
778   PORT_START("P4")   /* player 2 controls on second screen */
779   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
780   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
781   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
782   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
783   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
784   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
785   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
786   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
784   PORT_START("P3_P4")   /* player 1/2 controls on second screen */
785   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_UNKNOWN )
786   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN )
787   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN )
788   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
789   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
790   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
791   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
792   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNKNOWN )
793   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
794   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
795   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
796   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
797   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
798   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
799   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
800   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
787801
788   PORT_START("UNUSED1")
789   UNUSED_PORT
802   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
803   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
804   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
805   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
806   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_UNUSED )
807   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED )
808   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED )
809   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_START4 )
810   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
811   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
812   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
813   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3)
814   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNUSED )
815   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_UNUSED )
816   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNUSED )
817   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_START3 )
790818
791   PORT_START("UNUSED2")
792   UNUSED_PORT
793
794819   PORT_START("JP4")/* jumper pads 'JP4' on the PCB */
795   UNUSED_PORT
820   /* EEPROM is read here */
821   PORT_BIT( 0x00100000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
796822INPUT_PORTS_END
797823
798824#if ROMTEST
r3115r3116
10911117{
10921118   UINT8 *RAM = memory_region(machine, "main");
10931119   memory_set_bankptr(1,&RAM[0x100000]);
1094   memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5800000, 0x5800007, 0, 0, hotgmck_io32_r ); // Different Inputs
10951120   install_hotgmck_pcm_bank(machine);   // Banked PCM ROM
10961121}
10971122
src/mame/drivers/rollrace.c
r3115r3116
4343   AM_RANGE(0xe400, 0xe47f) AM_READ(SMH_RAM)
4444   AM_RANGE(0xec00, 0xec0f) AM_READ(SMH_NOP) /* Analog sound effects ??*/
4545   AM_RANGE(0xf000, 0xf0ff) AM_READ(SMH_RAM)
46   AM_RANGE(0xf800, 0xf800) AM_READ(input_port_0_r)      /* player1*/
47   AM_RANGE(0xf801, 0xf801) AM_READ(input_port_1_r)      /* player2*/
48   AM_RANGE(0xf804, 0xf804) AM_READ(input_port_3_r)
49   AM_RANGE(0xf802, 0xf802) AM_READ(input_port_2_r)
50   AM_RANGE(0xf805, 0xf805) AM_READ(input_port_4_r)
46   AM_RANGE(0xf800, 0xf800) AM_READ_PORT("P1")
47   AM_RANGE(0xf801, 0xf801) AM_READ_PORT("P2")
48   AM_RANGE(0xf804, 0xf804) AM_READ_PORT("DSW1")
49   AM_RANGE(0xf802, 0xf802) AM_READ_PORT("SYSTEM")
50   AM_RANGE(0xf805, 0xf805) AM_READ_PORT("DSW2")
5151   AM_RANGE(0xd806, 0xd806) AM_READ(SMH_NOP) /* looks like a watchdog, bit4 checked*/
5252ADDRESS_MAP_END
5353
r3115r3116
117117   PORT_BIT( 0x02, IP_ACTIVE_HIGH,IPT_COIN2 )
118118   PORT_BIT( 0x04, IP_ACTIVE_HIGH,IPT_SERVICE1 )
119119   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
120   PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
121   PORT_DIPSETTING( 0x08, DEF_STR( On ) )
120   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
121   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
122122   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )
123123   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 )
124124   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
125125   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
126   PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
127   PORT_DIPSETTING( 0x80, DEF_STR( On ) )
126   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
127   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
128128
129129   PORT_START("DSW1")
130130   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_A ) )
r3115r3116
153153   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
154154/*  PORT_DIPNAME( 0x80, 0x00, "Free Run" ) */
155155   PORT_DIPNAME( 0x80, 0x00, "Invulnerability (Cheat)" )
156   PORT_DIPSETTING(    0x00, DEF_STR( Off ) ) /* test mode, you are invulnerable */
156   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )   /* test mode, you are invulnerable */
157157   PORT_DIPSETTING(    0x80, DEF_STR( On ) )   /* to 'static' objects */
158158
159159   PORT_START("DSW2")
src/mame/drivers/tumblep.c
r3115r3116
8989{
9090    switch (offset<<1)
9191   {
92      case 0: /* Player 1 & Player 2 joysticks & fire buttons */
93         return (input_port_read(machine, "P1") + (input_port_read(machine, "P2") << 8));
94      case 2: /* Dips */
95         return (input_port_read(machine, "DSW1") + (input_port_read(machine, "DSW2") << 8));
96      case 8: /* Credits */
92      case 0:
93         return input_port_read(machine, "PLAYERS");
94      case 2:
95         return input_port_read(machine, "DSW");
96      case 8:
9797         return input_port_read(machine, "SYSTEM");
9898      case 10: /* ? */
9999      case 12:
r3115r3116
155155/******************************************************************************/
156156
157157static INPUT_PORTS_START( tumblep )
158   PORT_START("P1")   /* Player 1 controls */
159   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
160   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
161   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
162   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
163   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
164   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
165   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
166   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
158   PORT_START("PLAYERS")
159   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
160   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
161   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
162   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
163   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
164   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
165   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
166   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
167   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
168   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
169   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
170   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
171   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
172   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
173   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
174   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
167175
168   PORT_START("P2")   /* Player 2 controls */
169   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
170   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
171   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
172   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
173   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
174   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
175   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
176   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
176   PORT_START("SYSTEM")
177   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
178   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
179   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
180   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
181   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
182   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
183   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
184   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
177185
178   PORT_START("SYSTEM")   /* Credits */
179   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
180   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
181   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
182   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
183   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
184   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
185   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
186   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
186   PORT_START("DSW")
187   PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) )
188   PORT_DIPSETTING(    0x0000, DEF_STR( 3C_1C ) )
189   PORT_DIPSETTING(    0x0080, DEF_STR( 2C_1C ) )
190   PORT_DIPSETTING(    0x00e0, DEF_STR( 1C_1C ) )
191   PORT_DIPSETTING(    0x0060, DEF_STR( 1C_2C ) )
192   PORT_DIPSETTING(    0x00a0, DEF_STR( 1C_3C ) )
193   PORT_DIPSETTING(    0x0020, DEF_STR( 1C_4C ) )
194   PORT_DIPSETTING(    0x00c0, DEF_STR( 1C_5C ) )
195   PORT_DIPSETTING(    0x0040, DEF_STR( 1C_6C ) )
196   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) )
197   PORT_DIPSETTING(    0x0000, DEF_STR( 3C_1C ) )
198   PORT_DIPSETTING(    0x0010, DEF_STR( 2C_1C ) )
199   PORT_DIPSETTING(    0x001c, DEF_STR( 1C_1C ) )
200   PORT_DIPSETTING(    0x000c, DEF_STR( 1C_2C ) )
201   PORT_DIPSETTING(    0x0014, DEF_STR( 1C_3C ) )
202   PORT_DIPSETTING(    0x0004, DEF_STR( 1C_4C ) )
203   PORT_DIPSETTING(    0x0018, DEF_STR( 1C_5C ) )
204   PORT_DIPSETTING(    0x0008, DEF_STR( 1C_6C ) )
205   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )
206   PORT_DIPSETTING(    0x0002, DEF_STR( Off ) )
207   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
208   PORT_DIPNAME( 0x0001, 0x0001, "2 Coins to Start, 1 to Continue" )
209   PORT_DIPSETTING(    0x0001, DEF_STR( Off ) )
210   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
187211
188   PORT_START("DSW1")   /* Dip switch bank 1 */
189   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
190   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
191   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
192   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) )
193   PORT_DIPSETTING(    0x60, DEF_STR( 1C_2C ) )
194   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )
195   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
196   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_5C ) )
197   PORT_DIPSETTING(    0x40, DEF_STR( 1C_6C ) )
198   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) )
199   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
200   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
201   PORT_DIPSETTING(    0x1c, DEF_STR( 1C_1C ) )
202   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_2C ) )
203   PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
204   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
205   PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C ) )
206   PORT_DIPSETTING(    0x08, DEF_STR( 1C_6C ) )
207   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
208   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
209   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
210   PORT_DIPNAME( 0x01, 0x01, "2 Coins to Start, 1 to Continue" )
211   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
212   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
213
214   PORT_START("DSW2")   /* Dip switch bank 2 */
215   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
216   PORT_DIPSETTING(    0x80, "1" )
217   PORT_DIPSETTING(    0x00, "2" )
218   PORT_DIPSETTING(    0xc0, "3" )
219   PORT_DIPSETTING(    0x40, "4" )
220   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
221   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
222   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
223   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
224   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
212   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) )
213   PORT_DIPSETTING(    0x8000, "1" )
214   PORT_DIPSETTING(    0x0000, "2" )
215   PORT_DIPSETTING(    0xc000, "3" )
216   PORT_DIPSETTING(    0x4000, "4" )
217   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) )
218   PORT_DIPSETTING(    0x1000, DEF_STR( Easy ) )
219   PORT_DIPSETTING(    0x3000, DEF_STR( Normal ) )
220   PORT_DIPSETTING(    0x2000, DEF_STR( Hard ) )
221   PORT_DIPSETTING(    0x0000, DEF_STR( Hardest ) )
225222#if TUMBLEP_HACK
226   PORT_DIPNAME( 0x08, 0x08, "Remove Monsters" )
223   PORT_DIPNAME( 0x0800, 0x0800, "Remove Monsters" )
227224#else
228   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )      // See notes
225   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unused ) )      // See notes
229226#endif
230   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
231   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
227   PORT_DIPSETTING(    0x0800, DEF_STR( Off ) )
228   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
232229#if TUMBLEP_HACK
233   PORT_DIPNAME( 0x04, 0x04, "Edit Levels" )
230   PORT_DIPNAME( 0x0400, 0x0400, "Edit Levels" )
234231#else
235   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )      // See notes
232   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unused ) )      // See notes
236233#endif
237   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
238   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
239   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Allow_Continue ) )
240   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
241   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
242   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
243   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
244   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
234   PORT_DIPSETTING(    0x0400, DEF_STR( Off ) )
235   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
236   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Allow_Continue ) )
237   PORT_DIPSETTING(    0x0000, DEF_STR( No ) )
238   PORT_DIPSETTING(    0x0200, DEF_STR( Yes ) )
239   PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Demo_Sounds ) )
240   PORT_DIPSETTING(    0x0100, DEF_STR( Off ) )
241   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
245242INPUT_PORTS_END
246243
247244/******************************************************************************/
src/mame/drivers/taitosj.c
r3115r3116
171171#include "includes/taitosj.h"
172172
173173
174static UINT8 sndnmi_disable = 1;
174static UINT8 sndnmi_disable;
175175
176176static WRITE8_HANDLER( taitosj_sndnmi_msk_w )
177177{
r3115r3116
491491
492492   PORT_START("IN4")
493493   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
494   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, 0)   // from sound CPU
494   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, NULL)   // from sound CPU
495495
496496   PORT_START("DSW1")
497497   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
r3115r3116
573573
574574   PORT_START("IN4")
575575   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
576   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, 0)   // from sound CPU
576   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, NULL)   // from sound CPU
577577
578578   PORT_START("DSW1")
579579   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
r3115r3116
657657
658658   PORT_START("IN4")
659659   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
660   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, 0)   // from sound CPU
660   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, NULL)   // from sound CPU
661661
662662   PORT_START("DSW1")
663663   PORT_DIPNAME( 0x03, 0x03, "Finish Bonus" )
r3115r3116
721721
722722   PORT_START("IN4")
723723   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
724   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, 0)   // from sound CPU
724   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, NULL)   // from sound CPU
725725
726726   PORT_START("DSW1")
727727   PORT_DIPNAME( 0x03, 0x03, "Finish Bonus" )
r3115r3116
806806
807807   PORT_START("IN4")
808808   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
809   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, 0)   // from sound CPU
809   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, NULL)   // from sound CPU
810810
811811   PORT_START("DSW1")
812812   PORT_DIPNAME( 0x03, 0x03, "Jump Bonus" )
r3115r3116
891891
892892   PORT_START("IN4")
893893   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
894   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, 0)   // from sound CPU
894   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, NULL)   // from sound CPU
895895
896896   PORT_START("DSW1")
897897   PORT_DIPNAME( 0x03, 0x03, "Jump Bonus" )
r3115r3116
969969
970970   PORT_START("IN4")
971971   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
972   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, 0)   // from sound CPU
972   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, NULL)   // from sound CPU
973973
974974   PORT_START("DSW1")
975975   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
r3115r3116
11691169
11701170   PORT_START("IN4")
11711171   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
1172   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, 0)   // from sound CPU
1172   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, NULL)   // from sound CPU
11731173
11741174   PORT_START("DSW1")
11751175   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) )
r3115r3116
12521252   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_8WAY PORT_COCKTAIL
12531253   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_8WAY PORT_COCKTAIL
12541254   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_8WAY PORT_COCKTAIL
1255   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, 0)   // from sound CPU
1255   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, NULL)   // from sound CPU
12561256
12571257   PORT_START("DSW1")
12581258   PORT_DIPNAME( 0x03, 0x03, "Bonus Life?" )
r3115r3116
13351335
13361336   PORT_START("IN4")
13371337   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
1338   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, 0)   // from sound CPU
1338   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, NULL)   // from sound CPU
13391339
13401340   PORT_START("DSW1")
13411341   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
r3115r3116
14241424
14251425   PORT_START("IN4")
14261426   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
1427   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, 0)   // from sound CPU
1427   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, NULL)   // from sound CPU
14281428
14291429   PORT_START("DSW1")      /* d50a */
14301430   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) )
r3115r3116
14911491
14921492   PORT_START("IN4")
14931493   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
1494   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, 0)   // from sound CPU
1494   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, NULL)   // from sound CPU
14951495
14961496   PORT_START("DSW1")
14971497   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
r3115r3116
15591559
15601560   PORT_START("IN4")
15611561   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
1562   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, 0)   // from sound CPU
1562   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(input_port_4_f0_r, NULL)   // from sound CPU
15631563
15641564   PORT_START("DSW1")
15651565   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
r3115r3116
26972697   ROM_LOAD( "pal16l8.28",   0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */
26982698ROM_END
26992699
2700static void reset_common(running_machine *machine)
2701{
2702   sndnmi_disable = 1;
2703   input_port_4_f0 = 0;
2704   /* start in 1st gear */
2705   kikstart_gears[0] = 0x02;
2706   kikstart_gears[1] = 0x02;
2707   dac_out = 0;
2708   dac_vol = 0;
2709}
2710
2711static void init_common(running_machine *machine)
2712{
2713   state_save_register_global(sndnmi_disable);
2714   state_save_register_global(input_port_4_f0);
2715   state_save_register_global_array(kikstart_gears);
2716   state_save_register_global(dac_out);
2717   state_save_register_global(dac_vol);
2718
2719   add_reset_callback(machine, reset_common);
2720}
2721
2722static DRIVER_INIT( taitosj )
2723{
2724   init_common(machine);
2725}
2726
27002727static DRIVER_INIT( spacecr )
27012728{
2729   init_common(machine);
2730
27022731   /* install protection handler */
27032732   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd48b, 0xd48b, 0, 0, spacecr_prot_r);
27042733}
27052734
27062735static DRIVER_INIT( alpine )
27072736{
2737   init_common(machine);
2738
27082739   /* install protection handlers */
27092740   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd40b, 0xd40b, 0, 0, alpine_port_2_r);
27102741   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd50f, 0xd50f, 0, 0, alpine_protection_w);
r3115r3116
27122743
27132744static DRIVER_INIT( alpinea )
27142745{
2746   init_common(machine);
2747
27152748   /* install protection handlers */
27162749   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd40b, 0xd40b, 0, 0, alpine_port_2_r);
27172750   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd50e, 0xd50e, 0, 0, alpinea_bankswitch_w);
r3115r3116
27192752
27202753static DRIVER_INIT( junglhbr )
27212754{
2755   init_common(machine);
2756
27222757   /* inverter on bits 0 and 1 */
27232758   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0xbfff, 0, 0, junglhbr_characterram_w);
27242759}
27252760
2726static DRIVER_INIT( kikstart )
2727{
2728   /* start in 1st gear */
2729   kikstart_gears[0] = 0x02;
2730   kikstart_gears[1] = 0x02;
2731}
2732
2733void taitosj_register_main_savestate(void)
2734{
2735   state_save_register_global(sndnmi_disable);
2736   state_save_register_global(input_port_4_f0);
2737   state_save_register_global_array(kikstart_gears);
2738   state_save_register_global(dac_out);
2739   state_save_register_global(dac_vol);
2740}
2741
2742GAME( 1981, spaceskr, 0,        nomcu,    spaceskr,   0,       ROT0,   "Taito Corporation", "Space Seeker", GAME_SUPPORTS_SAVE )
2761GAME( 1981, spaceskr, 0,        nomcu,    spaceskr,   taitosj, ROT0,   "Taito Corporation", "Space Seeker", GAME_SUPPORTS_SAVE )
27432762GAME( 1981, spacecr,  0,        nomcu,    spacecr,    spacecr, ROT90,  "Taito Corporation", "Space Cruiser", GAME_SUPPORTS_SAVE )
2744GAME( 1982, junglek,  0,        nomcu,    junglek,    0,       ROT180, "Taito Corporation", "Jungle King (Japan)", GAME_SUPPORTS_SAVE )
2745GAME( 1982, junglkj2, junglek,  nomcu,    junglek,    0,       ROT180, "Taito Corporation", "Jungle King (Japan, earlier)", GAME_SUPPORTS_SAVE )
2746GAME( 1982, jungleh,  junglek,  nomcu,    junglek,    0,       ROT180, "Taito America Corporation", "Jungle Hunt (US)", GAME_SUPPORTS_SAVE )
2763GAME( 1982, junglek,  0,        nomcu,    junglek,    taitosj, ROT180, "Taito Corporation", "Jungle King (Japan)", GAME_SUPPORTS_SAVE )
2764GAME( 1982, junglkj2, junglek,  nomcu,    junglek,    taitosj, ROT180, "Taito Corporation", "Jungle King (Japan, earlier)", GAME_SUPPORTS_SAVE )
2765GAME( 1982, jungleh,  junglek,  nomcu,    junglek,    taitosj, ROT180, "Taito America Corporation", "Jungle Hunt (US)", GAME_SUPPORTS_SAVE )
27472766GAME( 1983, junglhbr, junglek,  nomcu,    junglek,    junglhbr,ROT180, "Taito do Brasil",   "Jungle Hunt (Brazil)", GAME_SUPPORTS_SAVE )
2748GAME( 1982, piratpet, junglek,  nomcu,    piratpet,   0,      ROT180, "Taito America Corporation", "Pirate Pete", GAME_SUPPORTS_SAVE )
2767GAME( 1982, piratpet, junglek,  nomcu,    piratpet,   taitosj, ROT180, "Taito America Corporation", "Pirate Pete", GAME_SUPPORTS_SAVE )
27492768GAME( 1982, alpine,   0,        nomcu,    alpine,     alpine,  ROT270, "Taito Corporation", "Alpine Ski (set 1)", GAME_SUPPORTS_SAVE )
27502769GAME( 1982, alpinea,  alpine,   nomcu,    alpinea,    alpinea, ROT270, "Taito Corporation", "Alpine Ski (set 2)", GAME_SUPPORTS_SAVE )
2751GAME( 1982, timetunl, 0,        nomcu,    timetunl,   0,       ROT0,   "Taito Corporation", "Time Tunnel", GAME_SUPPORTS_SAVE )
2752GAME( 1982, wwestern, 0,        nomcu,    wwestern,   0,       ROT270, "Taito Corporation", "Wild Western (set 1)", GAME_SUPPORTS_SAVE )
2753GAME( 1982, wwester1, wwestern, nomcu,    wwestern,   0,       ROT270, "Taito Corporation", "Wild Western (set 2)", GAME_SUPPORTS_SAVE )
2754GAME( 1982, frontlin, 0,        mcu,      frontlin,   0,       ROT270, "Taito Corporation", "Front Line", GAME_SUPPORTS_SAVE )
2755GAME( 1983, elevator, 0,        mcu,      elevator,   0,       ROT0,   "Taito Corporation", "Elevator Action", GAME_SUPPORTS_SAVE )
2756GAME( 1983, elevatob, elevator, nomcu,    elevator,   0,       ROT0,   "bootleg", "Elevator Action (bootleg)", GAME_SUPPORTS_SAVE )
2757GAME( 1983, tinstar,  0,        mcu,      tinstar,    0,       ROT0,   "Taito Corporation", "The Tin Star (set 1)", GAME_SUPPORTS_SAVE )
2758GAME( 1983, tinstar2, tinstar,  mcu,      tinstar,    0,       ROT0,   "Taito Corporation", "The Tin Star (set 2)", GAME_SUPPORTS_SAVE )
2759GAME( 1983, waterski, 0,        nomcu,    waterski,   0,       ROT270, "Taito Corporation", "Water Ski", GAME_SUPPORTS_SAVE )
2760GAME( 1983, bioatack, 0,        nomcu,    bioatack,   0,       ROT270, "Taito Corporation (Fox Video Games license)", "Bio Attack", GAME_SUPPORTS_SAVE )
2761GAME( 1984, sfposeid, 0,        mcu,      sfposeid,   0,       ROT0,   "Taito Corporation", "Sea Fighter Poseidon", GAME_SUPPORTS_SAVE )
2762GAME( 1983, hwrace,   0,        nomcu,    hwrace,     0,       ROT270, "Taito Corporation", "High Way Race", GAME_SUPPORTS_SAVE )
2763GAME( 1984, kikstart, 0,        kikstart, kikstart,   kikstart,ROT0,   "Taito Corporation", "Kick Start Wheelie King", GAME_SUPPORTS_SAVE )
2770GAME( 1982, timetunl, 0,        nomcu,    timetunl,   taitosj, ROT0,   "Taito Corporation", "Time Tunnel", GAME_SUPPORTS_SAVE )
2771GAME( 1982, wwestern, 0,        nomcu,    wwestern,   taitosj, ROT270, "Taito Corporation", "Wild Western (set 1)", GAME_SUPPORTS_SAVE )
2772GAME( 1982, wwester1, wwestern, nomcu,    wwestern,   taitosj, ROT270, "Taito Corporation", "Wild Western (set 2)", GAME_SUPPORTS_SAVE )
2773GAME( 1982, frontlin, 0,        mcu,      frontlin,   taitosj, ROT270, "Taito Corporation", "Front Line", GAME_SUPPORTS_SAVE )
2774GAME( 1983, elevator, 0,        mcu,      elevator,   taitosj, ROT0,   "Taito Corporation", "Elevator Action", GAME_SUPPORTS_SAVE )
2775GAME( 1983, elevatob, elevator, nomcu,    elevator,   taitosj, ROT0,   "bootleg", "Elevator Action (bootleg)", GAME_SUPPORTS_SAVE )
2776GAME( 1983, tinstar,  0,        mcu,      tinstar,    taitosj, ROT0,   "Taito Corporation", "The Tin Star (set 1)", GAME_SUPPORTS_SAVE )
2777GAME( 1983, tinstar2, tinstar,  mcu,      tinstar,    taitosj, ROT0,   "Taito Corporation", "The Tin Star (set 2)", GAME_SUPPORTS_SAVE )
2778GAME( 1983, waterski, 0,        nomcu,    waterski,   taitosj, ROT270, "Taito Corporation", "Water Ski", GAME_SUPPORTS_SAVE )
2779GAME( 1983, bioatack, 0,        nomcu,    bioatack,   taitosj, ROT270, "Taito Corporation (Fox Video Games license)", "Bio Attack", GAME_SUPPORTS_SAVE )
2780GAME( 1984, sfposeid, 0,        mcu,      sfposeid,   taitosj, ROT0,   "Taito Corporation", "Sea Fighter Poseidon", GAME_SUPPORTS_SAVE )
2781GAME( 1983, hwrace,   0,        nomcu,    hwrace,     taitosj, ROT270, "Taito Corporation", "High Way Race", GAME_SUPPORTS_SAVE )
2782GAME( 1984, kikstart, 0,        kikstart, kikstart,   taitosj, ROT0,   "Taito Corporation", "Kick Start Wheelie King", GAME_SUPPORTS_SAVE )
src/mame/drivers/vigilant.c
r3115r3116
8282
8383static ADDRESS_MAP_START( vigilant_io_map, ADDRESS_SPACE_IO, 8 )
8484   ADDRESS_MAP_GLOBAL_MASK(0xff)
85   AM_RANGE(0x00, 0x00) AM_READWRITE(input_port_0_r, m72_sound_command_byte_w)   /* SD */
86   AM_RANGE(0x01, 0x01) AM_READWRITE(input_port_1_r, vigilant_out2_w)          /* OUT2 */
87   AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r)
88   AM_RANGE(0x03, 0x03) AM_READ(input_port_3_r)
89   AM_RANGE(0x04, 0x04) AM_READWRITE(input_port_4_r, vigilant_bank_select_w)   /* PBANK */
85   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(m72_sound_command_byte_w)   /* SD */
86   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_WRITE(vigilant_out2_w)          /* OUT2 */
87   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2")
88   AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1")
89   AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW2") AM_WRITE(vigilant_bank_select_w)   /* PBANK */
9090   AM_RANGE(0x80, 0x81) AM_WRITE(vigilant_horiz_scroll_w)       /* HSPL, HSPH */
9191   AM_RANGE(0x82, 0x83) AM_WRITE(vigilant_rear_horiz_scroll_w) /* RHSPL, RHSPH */
9292   AM_RANGE(0x84, 0x84) AM_WRITE(vigilant_rear_color_w)       /* RCOD */
r3115r3116
103103
104104static ADDRESS_MAP_START( kikcubic_io_map, ADDRESS_SPACE_IO, 8 )
105105   ADDRESS_MAP_GLOBAL_MASK(0xff)
106   AM_RANGE(0x00, 0x00) AM_READWRITE(input_port_3_r, kikcubic_coin_w)   /* also flip screen, and...? */
107   AM_RANGE(0x01, 0x01) AM_READ(input_port_4_r)
108   AM_RANGE(0x02, 0x02) AM_READ(input_port_0_r)
109   AM_RANGE(0x03, 0x03) AM_READ(input_port_1_r)
110   AM_RANGE(0x04, 0x04) AM_READWRITE(input_port_2_r, vigilant_bank_select_w)
106   AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW1") AM_WRITE(kikcubic_coin_w)   /* also flip screen, and...? */
107   AM_RANGE(0x01, 0x01) AM_READ_PORT("DSW2")
108   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN0")
109   AM_RANGE(0x03, 0x03) AM_READ_PORT("IN1")
110   AM_RANGE(0x04, 0x04) AM_READ_PORT("IN2") AM_WRITE(vigilant_bank_select_w)
111111   AM_RANGE(0x06, 0x06) AM_WRITE(m72_sound_command_byte_w)
112112//  AM_RANGE(0x07, 0x07) AM_WRITE(SMH_NOP) /* ?? */
113113ADDRESS_MAP_END
r3115r3116
169169   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
170170   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
171171
172   PORT_START("DSW0")
172   PORT_START("DSW1")
173173   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
174174   PORT_DIPSETTING(   0x02, "2" )
175175   PORT_DIPSETTING(   0x03, "3" )
r3115r3116
200200   PORT_DIPSETTING(   0x50, DEF_STR( 1C_6C ) )
201201   PORT_DIPSETTING(   0x00, DEF_STR( Free_Play ) )
202202
203   PORT_START("DSW1")
203   PORT_START("DSW2")
204204   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
205205   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
206206   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
r3115r3116
260260   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
261261   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
262262
263   PORT_START("DSW0")
263   PORT_START("DSW1")
264264   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
265265   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
266266   PORT_DIPSETTING(    0x03, DEF_STR( Medium ) )
r3115r3116
290290//  PORT_DIPSETTING(    0x80, "Undefined" )
291291//  PORT_DIPSETTING(    0x90, "Undefined" )
292292
293   PORT_START("DSW1")
293   PORT_START("DSW2")
294294   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
295295   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
296296   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
r3115r3116
343343   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
344344   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
345345
346   PORT_START("DSW0")
346   PORT_START("DSW1")
347347   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
348348   PORT_DIPSETTING(   0x04, DEF_STR( 4C_1C ) )
349349   PORT_DIPSETTING(   0x07, DEF_STR( 3C_1C ) )
r3115r3116
371371   PORT_DIPSETTING(   0xc0, DEF_STR( 1C_4C ) )
372372   PORT_DIPSETTING(   0xb0, DEF_STR( 1C_5C ) )
373373
374   PORT_START("DSW1")
374   PORT_START("DSW2")
375375   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
376376   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
377377   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/nbmj8991.c
r3115r3116
440440
441441
442442static INPUT_PORTS_START( pstadium )
443   PORT_START("DSWA")   /* (0) DIPSW-A */
443   PORT_START("DSWA")
444444   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
445445   PORT_DIPSETTING(    0x03, "1 (Easy)" )
446446   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
465465   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
466466   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
467467
468   PORT_START("DSWB")   /* (1) DIPSW-B */
468   PORT_START("DSWB")
469469   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
470470   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
471471   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
491491   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
492492   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
493493
494   PORT_START("SYSTEM")   /* (2) PORT 0 */
495   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
494   PORT_START("SYSTEM")
495   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
496496   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
497497   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
498498   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
505505INPUT_PORTS_END
506506
507507static INPUT_PORTS_START( triplew1 )
508   PORT_START("DSWA")   /* (0) DIPSW-A */
508   PORT_START("DSWA")
509509   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
510510   PORT_DIPSETTING(    0x03, "1 (Easy)" )
511511   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
530530   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
531531   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
532532
533   PORT_START("DSWB")   /* (1) DIPSW-B */
533   PORT_START("DSWB")
534534   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
535535   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
536536   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
556556   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
557557   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
558558
559   PORT_START("SYSTEM")   /* (2) PORT 0 */
560   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
559   PORT_START("SYSTEM")
560   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
561561   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
562562   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
563563   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
570570INPUT_PORTS_END
571571
572572static INPUT_PORTS_START( ntopstar )
573   PORT_START("DSWA")   /* (0) DIPSW-A */
573   PORT_START("DSWA")
574574   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
575575   PORT_DIPSETTING(    0x03, "1 (Easy)" )
576576   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
595595   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
596596   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
597597
598   PORT_START("DSWB")   /* (1) DIPSW-B */
598   PORT_START("DSWB")
599599   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
600600   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
601601   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
621621   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
622622   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
623623
624   PORT_START("SYSTEM")   /* (2) PORT 0 */
625   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
624   PORT_START("SYSTEM")
625   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
626626   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
627627   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
628628   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
635635INPUT_PORTS_END
636636
637637static INPUT_PORTS_START( mjlstory )
638   PORT_START("DSWA")   /* (0) DIPSW-A */
638   PORT_START("DSWA")
639639   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
640640   PORT_DIPSETTING(    0x03, "1 (Easy)" )
641641   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
660660   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
661661   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
662662
663   PORT_START("DSWB")   /* (1) DIPSW-B */
663   PORT_START("DSWB")
664664   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
665665   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
666666   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
686686   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
687687   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
688688
689   PORT_START("SYSTEM")   /* (2) PORT 0 */
690   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
689   PORT_START("SYSTEM")
690   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
691691   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
692692   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
693693   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
700700INPUT_PORTS_END
701701
702702static INPUT_PORTS_START( vanilla )
703   PORT_START("DSWA")   /* (0) DIPSW-A */
703   PORT_START("DSWA")
704704   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
705705   PORT_DIPSETTING(    0x03, "1 (Easy)" )
706706   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
725725   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
726726   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
727727
728   PORT_START("DSWB")   /* (1) DIPSW-B */
728   PORT_START("DSWB")
729729   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
730730   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
731731   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
751751   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
752752   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
753753
754   PORT_START("SYSTEM")   /* (2) PORT 0 */
755   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
754   PORT_START("SYSTEM")
755   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
756756   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
757757   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
758758   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
768768
769769   // I don't have manual for this game.
770770
771   PORT_START("DSWA")   /* (0) DIPSW-A */
771   PORT_START("DSWA")
772772   PORT_DIPNAME( 0x07, 0x07, "Game Out" )
773773   PORT_DIPSETTING(    0x07, "90% (Easy)" )
774774   PORT_DIPSETTING(    0x06, "85%" )
r3115r3116
794794   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
795795   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
796796
797   PORT_START("DSWB")   /* (1) DIPSW-B */
797   PORT_START("DSWB")
798798   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
799799   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
800800   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
818818   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
819819   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
820820
821   PORT_START("SYSTEM")   /* (2) PORT 0 */
822   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
821   PORT_START("SYSTEM")
822   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
823823   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
824824   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
825825   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
832832INPUT_PORTS_END
833833
834834static INPUT_PORTS_START( qmhayaku )
835   PORT_START("DSWA")   /* (0) DIPSW-A */
835   PORT_START("DSWA")
836836   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
837837   PORT_DIPSETTING(    0x03, "1 (Easy)" )
838838   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
857857   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
858858   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
859859
860   PORT_START("DSWB")   /* (1) DIPSW-B */
860   PORT_START("DSWB")
861861   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
862862   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
863863   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
883883   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
884884   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
885885
886   PORT_START("SYSTEM")   /* (2) PORT 0 */
887   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
886   PORT_START("SYSTEM")
887   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
888888   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
889889   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
890890   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
897897INPUT_PORTS_END
898898
899899static INPUT_PORTS_START( galkoku )
900   PORT_START("DSWA")   /* (0) DIPSW-A */
900   PORT_START("DSWA")
901901   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
902902   PORT_DIPSETTING(    0x07, "1 (Easy)" )
903903   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
923923   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
924924   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
925925
926   PORT_START("DSWB")   /* (1) DIPSW-B */
926   PORT_START("DSWB")
927927   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
928928   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
929929   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
949949   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
950950   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
951951
952   PORT_START("SYSTEM")   /* (2) PORT 0 */
953   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
952   PORT_START("SYSTEM")
953   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
954954   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
955955   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
956956   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
966966
967967   // I don't have manual for this game.
968968
969   PORT_START("DSWA")   /* (0) DIPSW-A */
969   PORT_START("DSWA")
970970   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
971971   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
972972   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
992992   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
993993   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
994994
995   PORT_START("DSWB")   /* (1) DIPSW-B */
995   PORT_START("DSWB")
996996   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
997997   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
998998   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
10181018   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
10191019   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10201020
1021   PORT_START("SYSTEM")   /* (2) PORT 0 */
1022   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1021   PORT_START("SYSTEM")
1022   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
10231023   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
10241024   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
10251025   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
10351035
10361036   // I don't have manual for this game.
10371037
1038   PORT_START("DSWA")   /* (0) DIPSW-A */
1038   PORT_START("DSWA")
10391039   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
10401040   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
10411041   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
10611061   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
10621062   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10631063
1064   PORT_START("DSWB")   /* (1) DIPSW-B */
1064   PORT_START("DSWB")
10651065   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
10661066   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
10671067   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
10871087   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
10881088   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10891089
1090   PORT_START("SYSTEM")   /* (2) PORT 0 */
1091   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1090   PORT_START("SYSTEM")
1091   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
10921092   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
10931093   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
10941094   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
11041104
11051105   // I don't have manual for this game.
11061106
1107   PORT_START("DSWA")   /* (0) DIPSW-A */
1107   PORT_START("DSWA")
11081108   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
11091109   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
11101110   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
11301130   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
11311131   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11321132
1133   PORT_START("DSWB")   /* (1) DIPSW-B */
1133   PORT_START("DSWB")
11341134   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
11351135   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
11361136   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
11561156   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
11571157   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11581158
1159   PORT_START("SYSTEM")   /* (2) PORT 0 */
1160   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1159   PORT_START("SYSTEM")
1160   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
11611161   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
11621162   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
11631163   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
11731173
11741174   // I don't have manual for this game.
11751175
1176   PORT_START("DSWA")   /* (0) DIPSW-A */
1176   PORT_START("DSWA")
11771177   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
11781178   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
11791179   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
11991199   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12001200   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12011201
1202   PORT_START("DSWB")   /* (1) DIPSW-B */
1202   PORT_START("DSWB")
12031203   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
12041204   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
12051205   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
12251225   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12261226   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12271227
1228   PORT_START("SYSTEM")   /* (2) PORT 0 */
1229   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1228   PORT_START("SYSTEM")
1229   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
12301230   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
12311231   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
12321232   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
12421242
12431243   // I don't have manual for this game.
12441244
1245   PORT_START("DSWA")   /* (0) DIPSW-A */
1245   PORT_START("DSWA")
12461246   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
12471247   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
12481248   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
12681268   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12691269   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12701270
1271   PORT_START("DSWB")   /* (1) DIPSW-B */
1271   PORT_START("DSWB")
12721272   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
12731273   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
12741274   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
12941294   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12951295   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12961296
1297   PORT_START("SYSTEM")   /* (2) PORT 0 */
1298   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1297   PORT_START("SYSTEM")
1298   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
12991299   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
13001300   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
13011301   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
13111311
13121312   // I don't have manual for this game.
13131313
1314   PORT_START("DSWA")   /* (0) DIPSW-A */
1314   PORT_START("DSWA")
13151315   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
13161316   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
13171317   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
13371337   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
13381338   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13391339
1340   PORT_START("DSWB")   /* (1) DIPSW-B */
1340   PORT_START("DSWB")
13411341   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
13421342   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
13431343   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
13631363   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
13641364   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
13651365
1366   PORT_START("SYSTEM")   /* (2) PORT 0 */
1367   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1366   PORT_START("SYSTEM")
1367   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
13681368   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
13691369   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
13701370   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
13801380
13811381   // I don't have manual for this game.
13821382
1383   PORT_START("DSWA")   /* (0) DIPSW-A */
1383   PORT_START("DSWA")
13841384   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
13851385   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
13861386   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
14061406   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
14071407   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14081408
1409   PORT_START("DSWB")   /* (1) DIPSW-B */
1409   PORT_START("DSWB")
14101410   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
14111411   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
14121412   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
14321432   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
14331433   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14341434
1435   PORT_START("SYSTEM")   /* (2) PORT 0 */
1436   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1435   PORT_START("SYSTEM")
1436   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
14371437   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
14381438   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
14391439   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
14461446INPUT_PORTS_END
14471447
14481448static INPUT_PORTS_START( av2mj1bb )
1449   PORT_START("DSWA")   /* (0) DIPSW-A */
1449   PORT_START("DSWA")
14501450   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
14511451   PORT_DIPSETTING(    0x07, "1 (Easy)" )
14521452   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
14711471   PORT_DIPSETTING(    0x40, "Type-C" )
14721472   PORT_DIPSETTING(    0x00, "Type-D" )
14731473
1474   PORT_START("DSWB")   /* (1) DIPSW-B */
1474   PORT_START("DSWB")
14751475   PORT_DIPNAME( 0x03, 0x03, "Attract mode" )
14761476   PORT_DIPSETTING(    0x03, "No attract mode" )
14771477   PORT_DIPSETTING(    0x02, "Once per 10min." )
r3115r3116
14961496   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
14971497   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14981498
1499   PORT_START("SYSTEM")   /* (2) PORT 0 */
1500   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1499   PORT_START("SYSTEM")
1500   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
15011501   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
15021502   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
15031503   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
r3115r3116
15131513
15141514   // I don't have manual for this game.
15151515
1516   PORT_START("DSWA")   /* (0) DIPSW-A */
1516   PORT_START("DSWA")
15171517   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
15181518   PORT_DIPSETTING(    0x07, "1 (Easy)" )
15191519   PORT_DIPSETTING(    0x06, "2" )
r3115r3116
15381538   PORT_DIPSETTING(    0x40, "Type-C" )
15391539   PORT_DIPSETTING(    0x00, "Type-D" )
15401540
1541   PORT_START("DSWB")   /* (1) DIPSW-B */
1541   PORT_START("DSWB")
15421542   PORT_DIPNAME( 0x03, 0x03, "Attract mode" )
15431543   PORT_DIPSETTING(    0x03, "No attract mode" )
15441544   PORT_DIPSETTING(    0x02, "Once per 10min." )
r3115r3116
15631563   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
15641564   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
15651565
1566   PORT_START("SYSTEM")   /* (2) PORT 0 */
1567   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
1566   PORT_START("SYSTEM")
1567   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
15681568   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
15691569   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
15701570   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
src/mame/drivers/tsamurai.c
r3115r3116
145145   AM_RANGE(0xe800, 0xefff) AM_READ(SMH_RAM)
146146   AM_RANGE(0xf000, 0xf3ff) AM_READ(SMH_RAM)
147147
148   AM_RANGE(0xf800, 0xf800) AM_READ(input_port_0_r)
149   AM_RANGE(0xf801, 0xf801) AM_READ(input_port_1_r)
150   AM_RANGE(0xf802, 0xf802) AM_READ(input_port_2_r)
151   AM_RANGE(0xf804, 0xf804) AM_READ(input_port_3_r)
152   AM_RANGE(0xf805, 0xf805) AM_READ(input_port_4_r)
148   AM_RANGE(0xf800, 0xf800) AM_READ_PORT("P1")
149   AM_RANGE(0xf801, 0xf801) AM_READ_PORT("P2")
150   AM_RANGE(0xf802, 0xf802) AM_READ_PORT("SYSTEM")
151   AM_RANGE(0xf804, 0xf804) AM_READ_PORT("DSW1")
152   AM_RANGE(0xf805, 0xf805) AM_READ_PORT("DSW2")
153153ADDRESS_MAP_END
154154
155155static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
r3115r3116
191191   AM_RANGE(0xe800, 0xefff) AM_READ(SMH_RAM)
192192   AM_RANGE(0xf000, 0xf3ff) AM_READ(SMH_RAM)
193193
194   AM_RANGE(0xf800, 0xf800) AM_READ(input_port_0_r)
195   AM_RANGE(0xf801, 0xf801) AM_READ(input_port_1_r)
196   AM_RANGE(0xf802, 0xf802) AM_READ(input_port_2_r)
197   AM_RANGE(0xf804, 0xf804) AM_READ(input_port_3_r)
198   AM_RANGE(0xf805, 0xf805) AM_READ(input_port_4_r)
194   AM_RANGE(0xf800, 0xf800) AM_READ_PORT("P1")
195   AM_RANGE(0xf801, 0xf801) AM_READ_PORT("P2")
196   AM_RANGE(0xf802, 0xf802) AM_READ_PORT("SYSTEM")
197   AM_RANGE(0xf804, 0xf804) AM_READ_PORT("DSW1")
198   AM_RANGE(0xf805, 0xf805) AM_READ_PORT("DSW2")
199199ADDRESS_MAP_END
200200
201201static ADDRESS_MAP_START( writemem_m660, ADDRESS_SPACE_PROGRAM, 8 )
r3115r3116
395395   AM_RANGE(0xa100, 0xa100) AM_READ(vsgongf_a100_r) /* protection */
396396   AM_RANGE(0xc000, 0xc7ff) AM_READ(SMH_RAM) /* work ram */
397397   AM_RANGE(0xe000, 0xe7ff) AM_READ(SMH_RAM)
398   AM_RANGE(0xf800, 0xf800) AM_READ(input_port_0_r) /* joy1 */
399   AM_RANGE(0xf801, 0xf801) AM_READ(input_port_1_r) /* joy2 */
400   AM_RANGE(0xf802, 0xf802) AM_READ(input_port_2_r) /* coin */
401   AM_RANGE(0xf804, 0xf804) AM_READ(input_port_3_r) /* dsw1 */
402   AM_RANGE(0xf805, 0xf805) AM_READ(input_port_4_r) /* dsw2 */
398   AM_RANGE(0xf800, 0xf800) AM_READ_PORT("P1")
399   AM_RANGE(0xf801, 0xf801) AM_READ_PORT("P2")
400   AM_RANGE(0xf802, 0xf802) AM_READ_PORT("SYSTEM")
401   AM_RANGE(0xf804, 0xf804) AM_READ_PORT("DSW1")
402   AM_RANGE(0xf805, 0xf805) AM_READ_PORT("DSW2")
403403   AM_RANGE(0xfc00, 0xffff) AM_READ(SMH_RAM)
404404ADDRESS_MAP_END
405405
r3115r3116
437437
438438/*******************************************************************************/
439439
440#define TS_IN0\
441   PORT_START("IN0")\
442   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY\
443   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY\
444   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY\
445   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY\
446   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )\
447   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )\
448   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )\
440static INPUT_PORTS_START( tsamurai )
441   PORT_START("P1")
442   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
443   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
444   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
445   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
446   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
447   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
448   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
449449   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
450450
451#define TS_IN1\
452   PORT_START("IN1")\
453   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL\
454   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL\
455   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL\
456   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL\
457   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL\
458   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL\
459   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )\
451   PORT_START("P2")
452   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
453   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
454   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
455   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
456   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
457   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
458   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
460459   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
461460
462#define TS_IN2\
463   PORT_START("IN2")\
464   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )\
465   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )\
466   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )\
467   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )\
468   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )\
469   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 )\
470   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )\
461   PORT_START("SYSTEM")
462   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
463   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
464   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
465   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
466   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )
467   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 )
468   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
471469   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
472470
473#define TS_DSW1\
474   PORT_START("DSW1")\
475   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_A ) )\
476   PORT_DIPSETTING(    0x07, DEF_STR( 6C_1C ) )\
477   PORT_DIPSETTING(    0x06, DEF_STR( 3C_1C ) )\
478   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )\
479   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )\
480   PORT_DIPSETTING(    0x05, DEF_STR( 2C_3C ) )\
481   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )\
482   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )\
483   PORT_DIPSETTING(    0x03, DEF_STR( 1C_6C ) )\
484   PORT_DIPNAME( 0x38, 0x00, DEF_STR( Coin_B ) )\
485   PORT_DIPSETTING(    0x38, DEF_STR( 6C_1C ) )\
486   PORT_DIPSETTING(    0x30, DEF_STR( 3C_1C ) )\
487   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )\
488   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )\
489   PORT_DIPSETTING(    0x28, DEF_STR( 2C_3C ) )\
490   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )\
491   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )\
492   PORT_DIPSETTING(    0x18, DEF_STR( 1C_6C ) )\
493   PORT_DIPNAME( 0x40, 0x00, "Freeze" )\
494   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )\
495   PORT_DIPSETTING(    0x40, DEF_STR( On ) )\
496   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )\
497   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )\
471   PORT_START("DSW1")
472   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_A ) )
473   PORT_DIPSETTING(    0x07, DEF_STR( 6C_1C ) )
474   PORT_DIPSETTING(    0x06, DEF_STR( 3C_1C ) )
475   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
476   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
477   PORT_DIPSETTING(    0x05, DEF_STR( 2C_3C ) )
478   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
479   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
480   PORT_DIPSETTING(    0x03, DEF_STR( 1C_6C ) )
481   PORT_DIPNAME( 0x38, 0x00, DEF_STR( Coin_B ) )
482   PORT_DIPSETTING(    0x38, DEF_STR( 6C_1C ) )
483   PORT_DIPSETTING(    0x30, DEF_STR( 3C_1C ) )
484   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
485   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
486   PORT_DIPSETTING(    0x28, DEF_STR( 2C_3C ) )
487   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
488   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
489   PORT_DIPSETTING(    0x18, DEF_STR( 1C_6C ) )
490   PORT_DIPNAME( 0x40, 0x00, "Freeze" )
491   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
492   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
493   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
494   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
498495   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
499496
500static INPUT_PORTS_START( tsamurai )
501TS_IN0
502TS_IN1
503TS_IN2
504TS_DSW1
505
506497   PORT_START("DSW2")
507498   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
508499   PORT_DIPSETTING(    0x00, "3" )
r3115r3116
528519INPUT_PORTS_END
529520
530521static INPUT_PORTS_START( nunchaku )
531TS_IN0
532TS_IN1
533TS_IN2
534TS_DSW1
522   PORT_INCLUDE( tsamurai )
535523
536   PORT_START("DSW2")
524   PORT_MODIFY("DSW2")
537525   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
538526   PORT_DIPSETTING(    0x00, "3" )
539527   PORT_DIPSETTING(    0x01, "5" )
r3115r3116
558546INPUT_PORTS_END
559547
560548static INPUT_PORTS_START( vsgongf )
561TS_IN0
562TS_IN1
563TS_IN2
564TS_DSW1
549   PORT_INCLUDE( tsamurai )
565550
566   PORT_START("DSW2")
551   PORT_MODIFY("DSW2")
567552   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
568553   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
569554   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r3115r3116
590575   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
591576INPUT_PORTS_END
592577
593#define YAMINS\
594   PORT_START("IN0")\
595   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY\
596   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY\
597   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY\
598   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY\
599   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 )\
600   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )\
601   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )\
602   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )\
603   PORT_START("IN1")\
604   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL\
605   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL\
606   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL\
607   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL\
608   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL\
609   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL\
610   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )\
578static INPUT_PORTS_START( yamagchi )
579   PORT_INCLUDE( tsamurai )
580
581   PORT_MODIFY("P1")
582   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
583   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
584   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
585   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
586   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 )
587   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )
588   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
611589   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
612590
613static INPUT_PORTS_START( yamagchi )
614   YAMINS
615   TS_IN2
616   TS_DSW1
591   PORT_MODIFY("P2")
592   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
593   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
594   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
595   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
596   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
597   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
598   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
599   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
617600
618   PORT_START("DSW2")
601   PORT_MODIFY("DSW2")
619602   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
620603   PORT_DIPSETTING(    0x00, "3" )
621604   PORT_DIPSETTING(    0x01, "5" )
r3115r3116
641624INPUT_PORTS_END
642625
643626static INPUT_PORTS_START( m660 )
644   YAMINS
645   TS_IN2
627   PORT_INCLUDE( yamagchi )
646628
647   PORT_START("DSW1")
629   PORT_MODIFY("DSW1")
648630   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_A ) )
649631   PORT_DIPSETTING(    0x04, DEF_STR( 5C_1C ) )
650632   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
r3115r3116
670652   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
671653   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
672654
673   PORT_START("DSW2")
655   PORT_MODIFY("DSW2")
674656   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
675657   PORT_DIPSETTING(    0x00, "3" )
676658   PORT_DIPSETTING(    0x01, "4" )
src/mame/drivers/splash.c
r3115r3116
5656extern UINT16 *splash_pixelram;
5757extern UINT16 *roldfrog_bitmap_mode;
5858static UINT16 *roldfrog_protdata;
59static int adpcm_data;
60static int ret;
5961
6062extern int splash_bitmap_type;
6163extern int splash_sprite_attr2_shift;
r3115r3116
8890static ADDRESS_MAP_START( splash_readmem, ADDRESS_SPACE_PROGRAM, 16 )
8991   AM_RANGE(0x000000, 0x3fffff) AM_READ(SMH_ROM)         /* ROM */
9092   AM_RANGE(0x800000, 0x83ffff) AM_READ(SMH_RAM)         /* Pixel Layer */
91   AM_RANGE(0x840000, 0x840001) AM_READ(input_port_0_word_r)/* DIPSW #1 */
92   AM_RANGE(0x840002, 0x840003) AM_READ(input_port_1_word_r)/* DIPSW #2 */
93   AM_RANGE(0x840004, 0x840005) AM_READ(input_port_2_word_r)/* INPUT #1 */
94   AM_RANGE(0x840006, 0x840007) AM_READ(input_port_3_word_r)/* INPUT #2 */
93   AM_RANGE(0x840000, 0x840001) AM_READ_PORT("DSW1")
94   AM_RANGE(0x840002, 0x840003) AM_READ_PORT("DSW2")
95   AM_RANGE(0x840004, 0x840005) AM_READ_PORT("P1")
96   AM_RANGE(0x840006, 0x840007) AM_READ_PORT("P2")
9597   AM_RANGE(0x880000, 0x8817ff) AM_READ(splash_vram_r)      /* Video RAM */
9698   AM_RANGE(0x881800, 0x881803) AM_READ(SMH_RAM)         /* Scroll registers */
9799   AM_RANGE(0x881804, 0x881fff) AM_READ(SMH_RAM)         /* Work RAM */
r3115r3116
137139   AM_RANGE(0xf800, 0xffff) AM_READ(SMH_RAM)               /* RAM */
138140ADDRESS_MAP_END
139141
140static int adpcm_data;
141
142142static WRITE8_HANDLER( splash_adpcm_data_w ){
143143   adpcm_data = data;
144144}
r3115r3116
165165
166166static READ16_HANDLER( roldfrog_bombs_r )
167167{
168   static int ret = 0x100;
169168   ret ^= 0x100;
170169   return ret;
171170}
r3115r3116
175174   AM_RANGE(0x400000, 0x407fff) AM_ROM   AM_BASE(&roldfrog_protdata)               /* Protection Data */
176175   AM_RANGE(0x408000, 0x4087ff) AM_READ(SMH_RAM)         /* Extra Ram */
177176   AM_RANGE(0x800000, 0x83ffff) AM_READ(SMH_RAM)         /* Pixel Layer */
178   AM_RANGE(0x840000, 0x840001) AM_READ(input_port_0_word_r)/* DIPSW #1 */
179   AM_RANGE(0x840002, 0x840003) AM_READ(input_port_1_word_r)/* DIPSW #2 */
180   AM_RANGE(0x840004, 0x840005) AM_READ(input_port_2_word_r)/* INPUT #1 */
181   AM_RANGE(0x840006, 0x840007) AM_READ(input_port_3_word_r)/* INPUT #2 */
177   AM_RANGE(0x840000, 0x840001) AM_READ_PORT("DSW1")
178   AM_RANGE(0x840002, 0x840003) AM_READ_PORT("DSW2")
179   AM_RANGE(0x840004, 0x840005) AM_READ_PORT("P1")
180   AM_RANGE(0x840006, 0x840007) AM_READ_PORT("P2")
182181   AM_RANGE(0x880000, 0x8817ff) AM_READ(splash_vram_r)      /* Video RAM */
183182   AM_RANGE(0x881800, 0x881803) AM_READ(SMH_RAM)         /* Scroll registers */
184183   AM_RANGE(0x881804, 0x881fff) AM_READ(SMH_RAM)         /* Work RAM */
r3115r3116
224223   AM_RANGE(0x000000, 0x01ffff) AM_READ(SMH_ROM)         /* ROM */
225224   AM_RANGE(0x100000, 0x100fff) AM_READ(SMH_ROM)         /* protection? RAM */
226225   AM_RANGE(0x800000, 0x83ffff) AM_READ(SMH_RAM)         /* Pixel Layer */
227   AM_RANGE(0x840000, 0x840001) AM_READ(input_port_0_word_r)/* DIPSW #1 */
228   AM_RANGE(0x840002, 0x840003) AM_READ(input_port_1_word_r)/* DIPSW #2 */
229   AM_RANGE(0x840004, 0x840005) AM_READ(input_port_2_word_r)/* INPUT #1 */
230   AM_RANGE(0x840006, 0x840007) AM_READ(input_port_3_word_r)/* INPUT #2 */
226   AM_RANGE(0x840000, 0x840001) AM_READ_PORT("DSW1")
227   AM_RANGE(0x840002, 0x840003) AM_READ_PORT("DSW2")
228   AM_RANGE(0x840004, 0x840005) AM_READ_PORT("P1")
229   AM_RANGE(0x840006, 0x840007) AM_READ_PORT("P2")
231230   AM_RANGE(0x880000, 0x8817ff) AM_READ(splash_vram_r)      /* Video RAM */
232231   AM_RANGE(0x881800, 0x881803) AM_READ(SMH_RAM)         /* Scroll registers */
233232   AM_RANGE(0x881804, 0x881fff) AM_READ(SMH_RAM)         /* Work RAM */
r3115r3116
251250ADDRESS_MAP_END
252251
253252static INPUT_PORTS_START( splash )
254   PORT_START("DSW1")   /* DSW #1 */
253   PORT_START("DSW1")
255254   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
256255   PORT_DIPSETTING(    0x06, DEF_STR( 5C_1C ) )
257256   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
r3115r3116
279278   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
280279   PORT_DIPSETTING(    0x00, "1C/1C or Free Play (if Coin A too)" )
281280
282   PORT_START("DSW2")   /* DSW #2 */
281   PORT_START("DSW2")
283282   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
284283   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
285284   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
r3115r3116
301300   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
302301   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
303302
304   PORT_START("P1")   /* 1P INPUTS & COINSW */
303   PORT_START("P1")
305304   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
306305   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
307306   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
311310   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
312311   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
313312
314   PORT_START("P2")   /* 2P INPUTS & STARTSW */
313   PORT_START("P2")
315314   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
316315   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
317316   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
323322INPUT_PORTS_END
324323
325324static INPUT_PORTS_START( funystrp )
326   PORT_START("DSW1")   /* DSW #1 */
325   PORT_START("DSW1")
327326   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
328327   PORT_DIPSETTING(    0x06, DEF_STR( 5C_1C ) )
329328   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
r3115r3116
351350   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
352351   PORT_DIPSETTING(    0x00, "1C/1C or Free Play (if Coin A too)" )
353352
354   PORT_START("DSW2")   /* DSW #2 */
353   PORT_START("DSW2")
355354   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
356355   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
357356   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
r3115r3116
375374   PORT_DIPSETTING(    0x80, "Soft" )
376375   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
377376
378   PORT_START("P1")   /* 1P INPUTS & COINSW */
377   PORT_START("P1")
379378   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
380379   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
381380   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
385384   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
386385   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
387386
388   PORT_START("P2")   /* 2P INPUTS & STARTSW */
387   PORT_START("P2")
389388   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
390389   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
391390   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
429428   MSM5205_S48_4B      /* 8KHz */
430429};
431430
431static MACHINE_RESET( splash )
432{
433   adpcm_data = 0;
434   ret = 0x100;
435}
432436
433437static MACHINE_DRIVER_START( splash )
434438
r3115r3116
455459   MDRV_VIDEO_START(splash)
456460   MDRV_VIDEO_UPDATE(splash)
457461
462   MDRV_MACHINE_RESET( splash )
463
458464   /* sound hardware */
459465   MDRV_SPEAKER_STANDARD_MONO("mono")
460466
r3115r3116
508514   MDRV_VIDEO_START(splash)
509515   MDRV_VIDEO_UPDATE(splash)
510516
517   MDRV_MACHINE_RESET( splash )
518
511519   MDRV_SPEAKER_STANDARD_MONO("mono")
512520
513521   MDRV_SOUND_ADD("ym", YM2203, 3000000)
r3115r3116
544552   MDRV_VIDEO_START(splash)
545553   MDRV_VIDEO_UPDATE(funystrp)
546554
555   MDRV_MACHINE_RESET( splash )
556
547557   /* sound hardware */
548558//  MDRV_SPEAKER_STANDARD_MONO("mono")
549559
src/mame/drivers/supdrapo.c
r3115r3116
4848   AM_RANGE(0x5800, 0x5817) AM_READ(SMH_RAM)
4949   AM_RANGE(0x6000, 0x67ff) AM_READ(SMH_RAM)
5050   AM_RANGE(0x6c00, 0x6fff) AM_READ(SMH_RAM)
51   AM_RANGE(0x8000, 0x8000) AM_READ(input_port_4_r) //?
52   AM_RANGE(0x8001, 0x8001) AM_READ(input_port_0_r) //input
53   AM_RANGE(0x8002, 0x8002) AM_READ(input_port_1_r) //input
54   AM_RANGE(0x8003, 0x8003) AM_READ(input_port_2_r) //input
55   AM_RANGE(0x8004, 0x8004) AM_READ(input_port_3_r) //input
56   AM_RANGE(0x8005, 0x8005) AM_READ(input_port_6_r) //?
57   AM_RANGE(0x8006, 0x8006) AM_READ(input_port_5_r) //dip?
51   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN4") //?
52   AM_RANGE(0x8001, 0x8001) AM_READ_PORT("IN0")
53   AM_RANGE(0x8002, 0x8002) AM_READ_PORT("IN1")
54   AM_RANGE(0x8003, 0x8003) AM_READ_PORT("IN2")
55   AM_RANGE(0x8004, 0x8004) AM_READ_PORT("IN3")
56   AM_RANGE(0x8005, 0x8005) AM_READ_PORT("IN6") //?
57   AM_RANGE(0x8006, 0x8006) AM_READ_PORT("IN5") //dips?
5858   AM_RANGE(0x9000, 0x9097) AM_READ(SMH_RAM)
5959   AM_RANGE(0x909d, 0x909d) AM_READ(SMH_RAM)
60   AM_RANGE(0x9400, 0x9400) AM_READ(input_port_7_r) //need check
60   AM_RANGE(0x9400, 0x9400) AM_READ_PORT("IN7") //need check
6161ADDRESS_MAP_END
6262
6363
src/mame/drivers/namcos2.c
r3115r3116
917917   PORT_START("AN7")
918918   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
919919
920   PORT_START("MCUH")      /* 63B05Z0 - PORT H */ \
920   PORT_START("MCUH")      /* 63B05Z0 - PORT H */
921921   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
922922
923923   NAMCOS2_MCU_DIPSW_DEFAULT
r3115r3116
954954   PORT_START("AN7")
955955   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
956956
957   PORT_START("MCUH")      /* 63B05Z0 - PORT H */ \
957   PORT_START("MCUH")      /* 63B05Z0 - PORT H */
958958   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
959959
960960   NAMCOS2_MCU_DIPSW_DEFAULT
r3115r3116
12491249   PORT_START("AN7")      /* Accelerator pedal */
12501250   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_PLAYER(1)
12511251
1252   PORT_START("MCUH")      /* 63B05Z0 - PORT H */ \
1252   PORT_START("MCUH")      /* 63B05Z0 - PORT H */
12531253   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
12541254
1255   PORT_START("DSW")      /* 63B05Z0 - $2000 DIP SW */ \
1256   PORT_DIPNAME( 0x01, 0x01, "Video Display") \
1257   PORT_DIPSETTING(   0x01, DEF_STR( Normal ) ) \
1258   PORT_DIPSETTING(   0x00, "Frozen" ) \
1259   PORT_DIPNAME( 0x02, 0x02, "$2000-1") \
1260   PORT_DIPSETTING(   0x02, "H" ) \
1261   PORT_DIPSETTING(   0x00, "L" ) \
1262   PORT_DIPNAME( 0x04, 0x04, "$2000-2") \
1263   PORT_DIPSETTING(   0x04, "H" ) \
1264   PORT_DIPSETTING(   0x00, "L" ) \
1265   PORT_DIPNAME( 0x08, 0x08, "$2000-3") \
1266   PORT_DIPSETTING(   0x08, "H" ) \
1267   PORT_DIPSETTING(   0x00, "L" ) \
1268   PORT_DIPNAME( 0x10, 0x10, "$2000-4") \
1269   PORT_DIPSETTING(   0x10, "H" ) \
1270   PORT_DIPSETTING(   0x00, "L" ) \
1271   PORT_DIPNAME( 0x20, 0x20, "$2000-5") \
1272   PORT_DIPSETTING(   0x20, "H" ) \
1273   PORT_DIPSETTING(   0x00, "L" ) \
1274   PORT_DIPNAME( 0x40, 0x40, "System is Status Monitor") \
1275   PORT_DIPSETTING(   0x40, DEF_STR( No ) ) \
1276   PORT_DIPSETTING(   0x00, DEF_STR( Yes ) ) \
1255   PORT_START("DSW")      /* 63B05Z0 - $2000 DIP SW */
1256   PORT_DIPNAME( 0x01, 0x01, "Video Display")
1257   PORT_DIPSETTING(   0x01, DEF_STR( Normal ) )
1258   PORT_DIPSETTING(   0x00, "Frozen" )
1259   PORT_DIPNAME( 0x02, 0x02, "$2000-1")
1260   PORT_DIPSETTING(   0x02, "H" )
1261   PORT_DIPSETTING(   0x00, "L" )
1262   PORT_DIPNAME( 0x04, 0x04, "$2000-2")
1263   PORT_DIPSETTING(   0x04, "H" )
1264   PORT_DIPSETTING(   0x00, "L" )
1265   PORT_DIPNAME( 0x08, 0x08, "$2000-3")
1266   PORT_DIPSETTING(   0x08, "H" )
1267   PORT_DIPSETTING(   0x00, "L" )
1268   PORT_DIPNAME( 0x10, 0x10, "$2000-4")
1269   PORT_DIPSETTING(   0x10, "H" )
1270   PORT_DIPSETTING(   0x00, "L" )
1271   PORT_DIPNAME( 0x20, 0x20, "$2000-5")
1272   PORT_DIPSETTING(   0x20, "H" )
1273   PORT_DIPSETTING(   0x00, "L" )
1274   PORT_DIPNAME( 0x40, 0x40, "System is Status Monitor")
1275   PORT_DIPSETTING(   0x40, DEF_STR( No ) )
1276   PORT_DIPSETTING(   0x00, DEF_STR( Yes ) )
12771277   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
12781278
12791279   NAMCOS2_MCU_DIAL_DEFAULT
r3115r3116
13521352INPUT_PORTS_END
13531353
13541354static INPUT_PORTS_START( dirtfox )
1355   PORT_START("MCUB")      /* 63B05Z0 - PORT B */ \
1355   PORT_START("MCUB")      /* 63B05Z0 - PORT B */
13561356   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("Gear Shift Up")   /* Gear shift up */
13571357   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )   PORT_NAME("Gear Shift Down")/* Gear shift down */
13581358
src/mame/drivers/m63.c
r3115r3116
116116***************************************************************************/
117117
118118#include "driver.h"
119#include "cpu/i8039/i8039.h"
119#include "cpu/mcs48/mcs48.h"
120120#include "sound/ay8910.h"
121121#include "sound/samples.h"
122122
r3115r3116
435435
436436static ADDRESS_MAP_START( i8039_port_map, ADDRESS_SPACE_IO, 8 )
437437   AM_RANGE(0x00, 0xff) AM_READWRITE(snddata_r, snddata_w)
438   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(p1_w)
439   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(p2_w)
440   AM_RANGE(I8039_t1, I8039_t1) AM_READ(irq_r)
438   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(p1_w)
439   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(p2_w)
440   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(irq_r)
441441ADDRESS_MAP_END
442442
443443
src/mame/drivers/tecmosys.c
r3115r3116
380380   AM_RANGE(0x980000, 0x9807ff) AM_READ(SMH_RAM) // bg pal
381381   AM_RANGE(0x980800, 0x980fff) AM_READ(SMH_RAM) // fix pal
382382   AM_RANGE(0xb80000, 0xb80001) AM_READ(prot_status_r)
383   AM_RANGE(0xd00000, 0xd00001) AM_READ(input_port_0_word_r)
384   AM_RANGE(0xd00002, 0xd00003) AM_READ(input_port_1_word_r)
383   AM_RANGE(0xd00000, 0xd00001) AM_READ_PORT("P1")
384   AM_RANGE(0xd00002, 0xd00003) AM_READ_PORT("P2")
385385   AM_RANGE(0xd80000, 0xd80001) AM_READ(eeprom_r)
386   AM_RANGE(0xf00000, 0xf00001) AM_READ( sound_r )
386   AM_RANGE(0xf00000, 0xf00001) AM_READ(sound_r)
387387   AM_RANGE(0xf80000, 0xf80001) AM_READ(prot_data_r)
388388ADDRESS_MAP_END
389389
r3115r3116
464464
465465static INPUT_PORTS_START( deroon )
466466   PORT_START("P1")
467   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )      PORT_8WAY PORT_PLAYER(1)
468   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )   PORT_8WAY PORT_PLAYER(1)
469   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )   PORT_8WAY PORT_PLAYER(1)
470   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )   PORT_8WAY PORT_PLAYER(1)
471   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )         PORT_PLAYER(1)
472   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )         PORT_PLAYER(1)
473   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 )         PORT_PLAYER(1)
474   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START1 )
467   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )      PORT_8WAY PORT_PLAYER(1)
468   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )   PORT_8WAY PORT_PLAYER(1)
469   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )   PORT_8WAY PORT_PLAYER(1)
470   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )   PORT_8WAY PORT_PLAYER(1)
471   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )         PORT_PLAYER(1)
472   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )         PORT_PLAYER(1)
473   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 )         PORT_PLAYER(1)
474   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
475475
476   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
477   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_SERVICE )
478   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 )       PORT_PLAYER(1)
479   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
480   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
481   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
482   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
483   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
476   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
477   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SERVICE )
478   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 )         PORT_PLAYER(1)
479   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
480   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
481   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
482   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
483   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
484484
485485   PORT_START("P2")
486   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )      PORT_8WAY PORT_PLAYER(2)
487   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )   PORT_8WAY PORT_PLAYER(2)
488   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )   PORT_8WAY PORT_PLAYER(2)
489   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )   PORT_8WAY PORT_PLAYER(2)
490   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )         PORT_PLAYER(2)
491   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )         PORT_PLAYER(2)
492   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 )         PORT_PLAYER(2)
493   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START2 )
486   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )      PORT_8WAY PORT_PLAYER(2)
487   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )   PORT_8WAY PORT_PLAYER(2)
488   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )   PORT_8WAY PORT_PLAYER(2)
489   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )   PORT_8WAY PORT_PLAYER(2)
490   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )         PORT_PLAYER(2)
491   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )         PORT_PLAYER(2)
492   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 )         PORT_PLAYER(2)
493   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 )
494494
495   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNUSED )
496   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_SERVICE1 )
497   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 )         PORT_PLAYER(2)
498   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
499   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
500   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
501   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
502   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
495   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED )
496   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SERVICE1 )
497   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 )         PORT_PLAYER(2)
498   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
499   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
500   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
501   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
502   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
503503INPUT_PORTS_END
504504
505505static const gfx_layout gfxlayout =
r3115r3116
11401140GAME( 1995, deroon,      0, deroon, deroon, deroon,     ROT0, "Tecmo", "Deroon DeroDero", 0 )
11411141GAME( 1996, tkdensho,    0, deroon, deroon, tkdensho,   ROT0, "Tecmo", "Touki Denshou -Angel Eyes- (VER. 960614)", 0 )
11421142GAME( 1996, tkdensha,    tkdensho, deroon, deroon, tkdensha,   ROT0, "Tecmo", "Touki Denshou -Angel Eyes- (VER. 960427)", 0 )
1143
src/mame/drivers/thayers.c
r3115r3116
2929static UINT8 cop_l;
3030static UINT8 cop_cmd_latch;
3131
32static int timer_int = 1;
33static int data_rdy_int = 1;
34static int ssi_data_request = 1;
32static int timer_int;
33static int data_rdy_int;
34static int ssi_data_request;
3535
3636static int cart_present;
3737static int pr7820_enter;
r3115r3116
650650   PORT_START("COIN")
651651   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
652652   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
653   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(laserdisc_enter_r, 0 )
654   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(laserdisc_ready_r, 0 )
653   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(laserdisc_enter_r, NULL)
654   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(laserdisc_ready_r, NULL)
655655
656656   PORT_START("R0")
657657   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "2" ) PORT_CODE( KEYCODE_F2 )
r3115r3116
724724
725725static MACHINE_RESET( thayers )
726726{
727   int newtype = (input_port_read(machine, "DSWB") & 0x18) ? LASERDISC_TYPE_PIONEER_LDV1000 : LASERDISC_TYPE_PIONEER_PR7820;
727   int newtype;
728
729   laserdisc_data = 0;
730
731   rx_bit = 0;
732   keylatch = 0;
733
734   cop_data_latch = 0;
735   cop_data_latch_enable = 0;
736   cop_l = 0;
737   cop_cmd_latch = 0;
738
739   timer_int = 1;
740   data_rdy_int = 1;
741   ssi_data_request = 1;
742
743   cart_present = 0;
744   pr7820_enter = 0;
745
746   newtype = (input_port_read(machine, "DSWB") & 0x18) ? LASERDISC_TYPE_PIONEER_LDV1000 : LASERDISC_TYPE_PIONEER_PR7820;
728747   device_set_info_int(laserdisc, LDINFO_INT_TYPE, newtype);
729748}
730749
src/mame/drivers/topshoot.c
r3115r3116
192192static ADDRESS_MAP_START( topshoot_readmem, ADDRESS_SPACE_PROGRAM, 16 )
193193   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)               /* Cartridge Program Rom */
194194//  AM_RANGE(0x200000, 0x20007f) AM_READ(SMH_RAM)
195//  AM_RANGE(0x200040, 0x200041) AM_READ(input_port_0_word_r)       // ??
196//  AM_RANGE(0x200050, 0x200051) AM_READ(input_port_0_word_r)       // ??
195//  AM_RANGE(0x200040, 0x200041) AM_READ_PORT("IN0")        // ??
196//  AM_RANGE(0x200050, 0x200051) AM_READ_PORT("IN0")        // ??
197197   AM_RANGE(0x202000, 0x2023ff) AM_READ(SMH_RAM)
198   AM_RANGE(0x400004, 0x400005) AM_READ(input_port_0_word_r)       // ??
199   AM_RANGE(0xa10000, 0xa1001f) AM_READ(input_port_0_word_r)
200   AM_RANGE(0xa11100, 0xa11101) AM_READ(input_port_0_word_r)      // ??
198   AM_RANGE(0x400004, 0x400005) AM_READ_PORT("IN0")      // ??
199   AM_RANGE(0xa10000, 0xa1001f) AM_READ_PORT("IN0")
200   AM_RANGE(0xa11100, 0xa11101) AM_READ_PORT("IN0")      // ??
201201
202202
203203   AM_RANGE(0xa00000, 0xa0ffff) AM_READ(genesis_68k_to_z80_r)
src/mame/drivers/pingpong.c
r3115r3116
8888   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
8989   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
9090   AM_RANGE(0x9000, 0x97ff) AM_READ(SMH_RAM)
91   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_0_r)
92   AM_RANGE(0xa880, 0xa880) AM_READ(input_port_1_r)
93   AM_RANGE(0xa900, 0xa900) AM_READ(input_port_2_r)
94   AM_RANGE(0xa980, 0xa980) AM_READ(input_port_3_r)
91   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("SYSTEM")
92   AM_RANGE(0xa880, 0xa880) AM_READ_PORT("INPUTS")
93   AM_RANGE(0xa900, 0xa900) AM_READ_PORT("DSW1")
94   AM_RANGE(0xa980, 0xa980) AM_READ_PORT("DSW2")
9595ADDRESS_MAP_END
9696
9797static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
r3115r3116
112112   AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
113113   AM_RANGE(0x5400, 0x57ff) AM_RAM
114114   AM_RANGE(0x6000, 0x6007) AM_WRITENOP /* solenoid writes */
115   AM_RANGE(0x7000, 0x7000) AM_READ(input_port_4_r)
115   AM_RANGE(0x7000, 0x7000) AM_READ_PORT("IN4")
116116   AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(pingpong_colorram_w) AM_BASE(&colorram)
117117   AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(pingpong_videoram_w) AM_BASE(&videoram)
118118   AM_RANGE(0x9000, 0x9002) AM_RAM
119119   AM_RANGE(0x9003, 0x9052) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
120120   AM_RANGE(0x9053, 0x97ff) AM_RAM
121121   AM_RANGE(0xa000, 0xa000) AM_WRITE(coin_w)   /* irq enables */
122   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
123   AM_RANGE(0xa080, 0xa080) AM_READ(input_port_1_r)
124   AM_RANGE(0xa100, 0xa100) AM_READ(input_port_2_r)
125   AM_RANGE(0xa180, 0xa180) AM_READ(input_port_3_r)
122   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
123   AM_RANGE(0xa080, 0xa080) AM_READ_PORT("IN1")
124   AM_RANGE(0xa100, 0xa100) AM_READ_PORT("IN2")
125   AM_RANGE(0xa180, 0xa180) AM_READ_PORT("IN3")
126126   AM_RANGE(0xa200, 0xa200) AM_WRITE(SMH_NOP)      /* SN76496 data latch */
127127   AM_RANGE(0xa400, 0xa400) AM_WRITE(sn76496_0_w)   /* trigger read */
128128   AM_RANGE(0xa600, 0xa600) AM_WRITE(watchdog_reset_w)
r3115r3116
131131
132132
133133static INPUT_PORTS_START( pingpong )
134   PORT_START("SYSTEM")   /* IN0 */
134   PORT_START("SYSTEM")
135135   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
136136   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
137137   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
r3115r3116
141141   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
142142   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
143143
144   PORT_START("INPUTS")   /* IN1 */
144   PORT_START("INPUTS")
145145   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
146146   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
147147   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
r3115r3116
151151   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
152152   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
153153
154   PORT_START("DSW1")   /* DSW1 */
154   PORT_START("DSW1")
155155   PORT_DIPNAME( 0x0F, 0x0F, DEF_STR( Coin_B ) )
156156   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
157157   PORT_DIPSETTING(    0x0A, DEF_STR( 3C_1C ) )
r3115r3116
187187   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
188188   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
189189
190   PORT_START("DSW2")   /* DSW2 */
190   PORT_START("DSW2")
191191   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
192192   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
193193   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
220220   PORT_DIPNAME( 0x10, 0x10, "Door Close")
221221   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
222222   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
223   PORT_DIPNAME( 0x20, 0x20, "Door Open")      //Seems strange, one input to register an open door
224   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )   //And a different one for closing it!
223   PORT_DIPNAME( 0x20, 0x20, "Door Open")      // Seems strange, one input to register an open door
224   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )   // And a different one for closing it!
225225   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
226226   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
227227   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
r3115r3116
297297   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
298298
299299   PORT_START("IN4")
300   PORT_DIPNAME( 0x01, 0x01, "10P Level" )//Most likely to be optos, rather than DIPs.
300   PORT_DIPNAME( 0x01, 0x01, "10P Level" )      // Most likely to be optos, rather than DIPs.
301301   PORT_DIPSETTING(    0x01, DEF_STR( Low ) )
302302   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
303303   PORT_DIPNAME( 0x02, 0x02, "20P Level" )
r3115r3116
328328   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
329329   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
330330   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
331   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) // 0x20 and 0x40 if both ON enable a test menu
331   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   // 0x20 and 0x40 if both ON enable a test menu
332332   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
333333   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
334334   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
src/mame/drivers/blstroid.c
r3115r3116
3232
3333static void update_interrupts(running_machine *machine)
3434{
35   int newstate = 0;
36
37   if (atarigen_scanline_int_state)
38      newstate = 1;
39   if (atarigen_video_int_state)
40      newstate = 2;
41   if (atarigen_sound_int_state)
42      newstate = 4;
43
44   if (newstate)
45      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
46   else
47      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
35   cpunum_set_input_line(machine, 0, 1, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
36   cpunum_set_input_line(machine, 0, 2, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
37   cpunum_set_input_line(machine, 0, 4, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
4838}
4939
5040
src/mame/drivers/supbtime.c
r3115r3116
3535{
3636    switch (offset<<1)
3737   {
38      case 0: /* Player 1 & Player 2 joysticks & fire buttons */
39         return (input_port_read(machine, "P1") + (input_port_read(machine, "P2") << 8));
40      case 2: /* Dips */
41         return (input_port_read(machine, "DSW1") + (input_port_read(machine, "DSW2") << 8));
42      case 8: /* Credits */
38      case 0:
39         return input_port_read(machine, "INPUTS");
40      case 2:
41         return input_port_read(machine, "DSW");
42      case 8:
4343         return input_port_read(machine, "COIN");
4444      case 10: /* ?  Not used for anything */
4545      case 12:
r3115r3116
153153/******************************************************************************/
154154
155155static INPUT_PORTS_START( supbtime )
156   PORT_START("P1")   /* Player 1 controls */
157   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
158   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
159   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
160   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
161   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
162   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
163   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
164   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
156   PORT_START("INPUTS")
157   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
158   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
159   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
160   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
161   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
162   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )
163   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
164   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
165   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
166   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
167   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
168   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
169   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
170   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
171   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
172   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
165173
166   PORT_START("P2")   /* Player 2 controls */
167   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
168   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
169   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
170   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
171   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
172   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
173   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
174   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
174   PORT_START("COIN")
175   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
176   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
177   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
178   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
179   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
180   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
181   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
182   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
175183
176   PORT_START("COIN")   /* Credits */
177   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
178   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
179   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
180   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
181   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
182   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
183   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
184   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
185
186   PORT_START("DSW1")   /* Dip switch bank 1 - inverted with respect to other Deco games */
187   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
188   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
189   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
190   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) )
191   PORT_DIPSETTING(    0x60, DEF_STR( 1C_2C ) )
192   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )
193   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
194   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_5C ) )
195   PORT_DIPSETTING(    0x40, DEF_STR( 1C_6C ) )
196   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) )
197   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
198   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
199   PORT_DIPSETTING(    0x1c, DEF_STR( 1C_1C ) )
200   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_2C ) )
201   PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
202   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
203   PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C ) )
204   PORT_DIPSETTING(    0x08, DEF_STR( 1C_6C ) )
205   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
206   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
207   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
208   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )
209   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
210   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
211
212   PORT_START("DSW2")   /* Dip switch bank 2 */
213   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
214   PORT_DIPSETTING(    0x80, "1" )
215   PORT_DIPSETTING(    0x00, "2" )
216   PORT_DIPSETTING(    0xc0, "3" )
217   PORT_DIPSETTING(    0x40, "4" )
218   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
219   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
220   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
221   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
222   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
223   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
224   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
225   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
226   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )
227   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
228   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
229   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Allow_Continue ) )
230   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
231   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
232     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
233   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
234   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
184   PORT_START("DSW")   /* inverted with respect to other Deco games */
185   PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) )
186   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
187   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )
188   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_1C ) )
189   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_2C ) )
190   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_3C ) )
191   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
192   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_5C ) )
193   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_6C ) )
194   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) )
195   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
196   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
197   PORT_DIPSETTING(      0x001c, DEF_STR( 1C_1C ) )
198   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_2C ) )
199   PORT_DIPSETTING(      0x0014, DEF_STR( 1C_3C ) )
200   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
201   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_5C ) )
202   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_6C ) )
203   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )
204   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
205   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
206   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) )
207   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
208   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
209   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) )
210   PORT_DIPSETTING(      0x8000, "1" )
211   PORT_DIPSETTING(      0x0000, "2" )
212   PORT_DIPSETTING(      0xc000, "3" )
213   PORT_DIPSETTING(      0x4000, "4" )
214   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) )
215   PORT_DIPSETTING(      0x1000, DEF_STR( Easy ) )
216   PORT_DIPSETTING(      0x3000, DEF_STR( Normal ) )
217   PORT_DIPSETTING(      0x2000, DEF_STR( Hard ) )
218   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
219   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unused ) )
220   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
221   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
222   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unused ) )
223   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
224   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
225   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Allow_Continue ) )
226   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
227   PORT_DIPSETTING(      0x0200, DEF_STR( Yes ) )
228     PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Demo_Sounds ) )
229   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
230   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
235231INPUT_PORTS_END
236232
237233static INPUT_PORTS_START( chinatwn )
238   PORT_START("P1")   /* Player 1 controls */
239   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
240   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
241   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
242   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
243   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
244   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* Used? */
245   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )   /* button 3 - unused */
246   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
234   PORT_START("INPUTS")
235   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
236   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
237   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
238   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
239   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
240   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* Used? */
241   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )   /* button 3 - unused */
242   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
243   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
244   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
245   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
246   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
247   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
248   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)  /* Used? */
249   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
250   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
247251
248   PORT_START("P2")   /* Player 2 controls */
249   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
250   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
251   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
252   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
253   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
254   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)  /* Used? */
255   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
256   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
252   PORT_START("COIN")
253   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
254   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
255   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
256   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
257   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
258   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
259   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
260   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
257261
258   PORT_START("COIN")   /* Credits */
259   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
260   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
261   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
262   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
263   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
264   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
265   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
266   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
267
268   PORT_START("DSW1")   /* Dip switch bank 1 - inverted with respect to other Deco games */
269   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
270   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
271   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
272   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) )
273   PORT_DIPSETTING(    0x60, DEF_STR( 1C_2C ) )
274   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )
275   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
276   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_5C ) )
277   PORT_DIPSETTING(    0x40, DEF_STR( 1C_6C ) )
278   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) )
279   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
280   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
281   PORT_DIPSETTING(    0x1c, DEF_STR( 1C_1C ) )
282   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_2C ) )
283   PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
284   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
285   PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C ) )
286   PORT_DIPSETTING(    0x08, DEF_STR( 1C_6C ) )
287   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
288   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
289   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
290   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
291   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
292   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
293
294   PORT_START("DSW2")   /* Dip switch bank 2 */
295   PORT_DIPNAME( 0xc0, 0xc0, "Time" )
296   PORT_DIPSETTING(    0x00, "1500" )
297   PORT_DIPSETTING(    0x80, "2000" )
298   PORT_DIPSETTING(    0xc0, "2500" )
299   PORT_DIPSETTING(    0x40, "3000" )
300   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
301   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
302   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
303   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
304   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
305   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
306   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
307   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
308   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
309   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
310   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
311   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
312   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
313   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
314     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
315   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
316   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
262   PORT_START("DSW")   /* inverted with respect to other Deco games */
263   PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) )
264   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
265   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )
266   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_1C ) )
267   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_2C ) )
268   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_3C ) )
269   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
270   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_5C ) )
271   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_6C ) )
272   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) )
273   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
274   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
275   PORT_DIPSETTING(      0x001c, DEF_STR( 1C_1C ) )
276   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_2C ) )
277   PORT_DIPSETTING(      0x0014, DEF_STR( 1C_3C ) )
278   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
279   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_5C ) )
280   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_6C ) )
281   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )
282   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
283   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
284   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
285   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
286   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
287   PORT_DIPNAME( 0xc000, 0xc000, "Time" )
288   PORT_DIPSETTING(      0x0000, "1500" )
289   PORT_DIPSETTING(      0x8000, "2000" )
290   PORT_DIPSETTING(      0xc000, "2500" )
291   PORT_DIPSETTING(      0x4000, "3000" )
292   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) )
293   PORT_DIPSETTING(      0x1000, DEF_STR( Easy ) )
294   PORT_DIPSETTING(      0x3000, DEF_STR( Normal ) )
295   PORT_DIPSETTING(      0x2000, DEF_STR( Hard ) )
296   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
297   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
298   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
299   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
300   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
301   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
302   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
303   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
304   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
305   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
306     PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Demo_Sounds ) )
307   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
308   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
317309INPUT_PORTS_END
318310
319311/******************************************************************************/
src/mame/drivers/retofinv.c
r3115r3116
108108   AM_RANGE(0x8800, 0x9fff) AM_RAM AM_SHARE(1) AM_BASE(&retofinv_sharedram)
109109   AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(retofinv_bg_videoram_w) AM_SHARE(3) AM_BASE(&retofinv_bg_videoram)
110110   AM_RANGE(0xb800, 0xb802) AM_WRITE(retofinv_gfx_ctrl_w)
111   AM_RANGE(0xc000, 0xc000) AM_READ(input_port_1_r)
112   AM_RANGE(0xc001, 0xc001) AM_READ(input_port_2_r)
111   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("P1")
112   AM_RANGE(0xc001, 0xc001) AM_READ_PORT("P2")
113113   AM_RANGE(0xc002, 0xc002) AM_READ(SMH_NOP)   /* bit 7 must be 0, otherwise game resets */
114114   AM_RANGE(0xc003, 0xc003) AM_READ(retofinv_mcu_status_r)
115   AM_RANGE(0xc004, 0xc004) AM_READ(input_port_0_r)
116   AM_RANGE(0xc005, 0xc005) AM_READ(input_port_3_r)
117   AM_RANGE(0xc006, 0xc006) AM_READ(input_port_4_r)
118   AM_RANGE(0xc007, 0xc007) AM_READ(input_port_5_r)
115   AM_RANGE(0xc004, 0xc004) AM_READ_PORT("SYSTEM")
116   AM_RANGE(0xc005, 0xc005) AM_READ_PORT("DSW1")
117   AM_RANGE(0xc006, 0xc006) AM_READ_PORT("DSW2")
118   AM_RANGE(0xc007, 0xc007) AM_READ_PORT("DSW3")
119119   AM_RANGE(0xc800, 0xc800) AM_WRITE(irq0_ack_w)
120120   AM_RANGE(0xc801, 0xc801) AM_WRITE(coinlockout_w)
121121   AM_RANGE(0xc802, 0xc802) AM_WRITE(cpu2_reset_w)
r3115r3116
162162
163163
164164static INPUT_PORTS_START( retofinv )
165   PORT_START("IN0")
165   PORT_START("SYSTEM")
166166   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
167167   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
168168   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
r3115r3116
172172   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
173173   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
174174
175   PORT_START("IN1")
175   PORT_START("P1")
176176   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
177177   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
178178   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
182182   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
183183   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
184184
185   PORT_START("IN2")
185   PORT_START("P2")
186186   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
187187   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
188188   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/megaplay.c
r3115r3116
202202    PORT_DIPSETTING( 0x01, "1 coin/1 credit - 2 coins/3 credits" )
203203    PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
204204
205   PORT_DIPNAME( 0xf0, 0xf0, "Coin slot 2" ) PORT_DIPLOCATION("SW2:1,2,3,4")\
205   PORT_DIPNAME( 0xf0, 0xf0, "Coin slot 2" ) PORT_DIPLOCATION("SW2:1,2,3,4")
206206    PORT_DIPSETTING( 0x70, DEF_STR( 4C_1C ) )
207207    PORT_DIPSETTING( 0x80, DEF_STR( 3C_1C ) )
208208    PORT_DIPSETTING( 0x90, DEF_STR( 2C_1C ) )
src/mame/drivers/m72.c
r3115r3116
32363236
32373237
32383238GAME( 1987, rtype,    0,        rtype,    rtype,    0,        ROT0,   "Irem", "R-Type (World)", GAME_NO_COCKTAIL )
3239GAME( 1987, rtypej,   rtype,    rtype,    rtypep,   0,        ROT0,   "Irem", "R-Type (Japan)", GAME_NO_COCKTAIL )
3239GAME( 1987, rtypej,   rtype,    rtype,    rtype,    0,        ROT0,   "Irem", "R-Type (Japan)", GAME_NO_COCKTAIL )
32403240GAME( 1987, rtypejp,  rtype,    rtype,    rtypep,   0,        ROT0,   "Irem", "R-Type (Japan prototype)", GAME_NO_COCKTAIL )
32413241GAME( 1987, rtypeu,   rtype,    rtype,    rtype,    0,        ROT0,   "Irem (Nintendo of America license)", "R-Type (US)", GAME_NO_COCKTAIL )
32423242GAME( 1987, bchopper, 0,        m72,      bchopper, bchopper, ROT0,   "Irem", "Battle Chopper", GAME_NO_COCKTAIL )
src/mame/drivers/r2dtank.c
r3115r3116
462462   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
463463   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
464464   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
465   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_ttl74123_output, 0)
465   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_ttl74123_output, NULL)
466466
467467   PORT_START("IN1")
468468   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
src/mame/drivers/ohmygod.c
r3115r3116
6868   AM_RANGE(0x700000, 0x703fff) AM_READ(SMH_RAM)
6969   AM_RANGE(0x704000, 0x707fff) AM_READ(SMH_RAM)
7070   AM_RANGE(0x708000, 0x70ffff) AM_READ(SMH_RAM)
71   AM_RANGE(0x800000, 0x800001) AM_READ(input_port_0_word_r)
72   AM_RANGE(0x800002, 0x800003) AM_READ(input_port_1_word_r)
73   AM_RANGE(0xa00000, 0xa00001) AM_READ(input_port_2_word_r)
74   AM_RANGE(0xa00002, 0xa00003) AM_READ(input_port_3_word_r)
71   AM_RANGE(0x800000, 0x800001) AM_READ_PORT("P1")
72   AM_RANGE(0x800002, 0x800003) AM_READ_PORT("P2")
73   AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("DSW1")
74   AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("DSW2")
7575   AM_RANGE(0xb00000, 0xb00001) AM_READ(okim6295_status_0_lsb_r)
7676   AM_RANGE(0xc00000, 0xc00001) AM_READ(watchdog_reset16_r)
7777ADDRESS_MAP_END
src/mame/drivers/pokechmp.c
r3115r3116
113113
114114static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
115115   AM_RANGE(0x0000, 0x07ff) AM_READ(SMH_RAM)
116   AM_RANGE(0x1800, 0x1800) AM_READ(input_port_0_r)
117   AM_RANGE(0x1a00, 0x1a00) AM_READ(input_port_1_r)
118   AM_RANGE(0x1c00, 0x1c00) AM_READ(input_port_2_r)
116   AM_RANGE(0x1800, 0x1800) AM_READ_PORT("P1")
117   AM_RANGE(0x1a00, 0x1a00) AM_READ_PORT("P2")
118   AM_RANGE(0x1c00, 0x1c00) AM_READ_PORT("DSW")
119119
120120   /* Extra on Poke Champ (not on Pocket Gal) */
121121   AM_RANGE(0x2000, 0x27ff) AM_READ(SMH_RAM)
src/mame/drivers/stlforce.c
r3115r3116
8484WRITE16_HANDLER( stlforce_mlow_videoram_w );
8585WRITE16_HANDLER( stlforce_bg_videoram_w );
8686
87static READ16_HANDLER( stlforce_input_port_1_r )
88{
89   return (input_port_read(machine, "SYSTEM") & ~0x40) | (eeprom_read_bit() << 6);
90}
91
9287static WRITE16_HANDLER( eeprom_w )
9388{
9489   if( ACCESSING_BITS_0_7 )
r3115r3116
120115   AM_RANGE(0x108000, 0x108fff) AM_RAM AM_BASE(&stlforce_spriteram)
121116   AM_RANGE(0x109000, 0x11ffff) AM_RAM
122117   AM_RANGE(0x400000, 0x400001) AM_READ_PORT("INPUT")
123   AM_RANGE(0x400002, 0x400003) AM_READ(stlforce_input_port_1_r)
118   AM_RANGE(0x400002, 0x400003) AM_READ_PORT("SYSTEM")
124119   AM_RANGE(0x400010, 0x400011) AM_WRITE(eeprom_w)
125120   AM_RANGE(0x400012, 0x400013) AM_WRITE(oki_bank_w)
126121   AM_RANGE(0x40001e, 0x40001f) AM_WRITENOP // sprites buffer commands
r3115r3116
153148   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
154149   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
155150   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
156   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SPECIAL ) /* eeprom */
151   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL) /* eeprom */
157152   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
158153   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
159154INPUT_PORTS_END
src/mame/drivers/topspeed.c
r3115r3116
243243VIDEO_START( topspeed );
244244VIDEO_UPDATE( topspeed );
245245
246static UINT16 cpua_ctrl = 0xff;
246static UINT16 cpua_ctrl;
247247static INT32 ioc220_port = 0;
248static INT32 banknum;
249static int adpcm_pos;
250static int adpcm_data;
248251
249252extern UINT16 *topspeed_spritemap;
250253
r3115r3116
400403                        SOUND
401404*****************************************************/
402405
403static INT32 banknum = -1;
404
405406static void reset_sound_region(running_machine *machine)
406407{
407408   memory_set_bankptr( 10, memory_region(machine, "audio") + (banknum * 0x4000) + 0x10000 );
r3115r3116
413414   reset_sound_region(machine);
414415}
415416
416static int adpcm_pos;
417
418417static void topspeed_msm5205_vck(running_machine *machine, int chip)
419418{
420   static int adpcm_data = -1;
421
422419   if (adpcm_data != -1)
423420   {
424421      msm5205_data_w(0, adpcm_data & 0x0f);
r3115r3116
692689   state_save_register_postload(machine, topspeed_postload, NULL);
693690}
694691
692static MACHINE_RESET( topspeed )
693{
694   cpua_ctrl = 0xff;
695   ioc220_port = 0;
696   banknum = -1;
697   adpcm_pos = 0;
698   adpcm_data = -1;
699}
700
695701static MACHINE_DRIVER_START( topspeed )
696702
697703   /* basic machine hardware */
r3115r3116
707713   MDRV_CPU_VBLANK_INT("main", topspeed_cpub_interrupt)
708714
709715   MDRV_MACHINE_START(topspeed)
716   MDRV_MACHINE_RESET(topspeed)
710717
711718   /* video hardware */
712719   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/zr107.c
r3115r3116
598598
599599   PORT_START("IN2")
600600   PORT_BIT( 0x7f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
601   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(adcdo_r, 0)
601   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(adcdo_r, NULL)
602602
603603   PORT_START("IN3")
604604   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
r3115r3116
642642
643643   PORT_START("IN2")
644644   PORT_BIT( 0x7f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
645   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(adcdo_r, 0)
645   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(adcdo_r, NULL)
646646
647647   PORT_START("IN3")
648648   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
r3115r3116
686686
687687   PORT_START("IN2")
688688   PORT_BIT( 0x7f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
689   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(adcdo_r, 0)
689   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(adcdo_r, NULL)
690690
691691   PORT_START("IN3")
692692   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
src/mame/drivers/segae.c
r3115r3116
15351535
15361536
15371537static INPUT_PORTS_START( transfrm ) /* Used By Transformer */
1538   PORT_START("DSW0")   /* Read from Port 0xf2 */
1538   PORT_START("f2")   /* Read from Port 0xf2 */
15391539   SEGA_COIN_A
15401540   SEGA_COIN_B
15411541
1542   PORT_START("DSW1")   /* Read from Port 0xf3 */
1542   PORT_START("f3")   /* Read from Port 0xf3 */
15431543   PORT_DIPNAME( 0x01, 0x00, "1 Player Only" ) PORT_DIPLOCATION("SW2:1")
15441544   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
15451545   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r3115r3116
15621562   PORT_DIPSETTING(    0x80, DEF_STR( Hard ) )
15631563   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
15641564
1565   PORT_START("IN0")   /* Read from Port 0xe0 */
1565   PORT_START("e0")   /* Read from Port 0xe0 */
15661566   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
15671567   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2 )
15681568   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
r3115r3116
15721572   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START1 )
15731573   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START2 )
15741574
1575   PORT_START("IN1")   /* Read from Port 0xe1 */
1575   PORT_START("e1")   /* Read from Port 0xe1 */
15761576   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_JOYSTICK_UP  ) PORT_8WAY
15771577   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICK_DOWN ) PORT_8WAY
15781578   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICK_LEFT ) PORT_8WAY
r3115r3116
15811581   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_BUTTON2 )
15821582   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
15831583   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNUSED )
1584
1585   PORT_START("e2")   /* Read from Port 0xe2 */
15841586INPUT_PORTS_END
15851587
15861588static INPUT_PORTS_START( fantzn2 ) /* Used By Fantasy Zone 2 */
1587   PORT_START("DSW0")   /* Read from Port 0xf2 */
1589   PORT_START("f2")   /* Read from Port 0xf2 */
15881590   SEGA_COIN_A
15891591   SEGA_COIN_B
15901592
1591   PORT_START("DSW1")   /* Read from Port 0xf3 */
1593   PORT_START("f3")   /* Read from Port 0xf3 */
15921594   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" )
15931595   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
15941596   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
r3115r3116
16091611   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
16101612   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
16111613
1612   PORT_START("IN0")   /* Read from Port 0xe0 */
1614   PORT_START("e0")   /* Read from Port 0xe0 */
16131615   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
16141616   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2 )
16151617   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
r3115r3116
16191621   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START1 )
16201622   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START2 )
16211623
1622   PORT_START("IN1")   /* Read from Port 0xe1 */
1624   PORT_START("e1")   /* Read from Port 0xe1 */
16231625   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_JOYSTICK_UP  ) PORT_8WAY
16241626   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICK_DOWN ) PORT_8WAY
16251627   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICK_LEFT ) PORT_8WAY
r3115r3116
16281630   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_BUTTON2 )
16291631   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
16301632   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNUSED )
1633
1634   PORT_START("e2")   /* Read from Port 0xe2 */
16311635INPUT_PORTS_END
16321636
16331637static INPUT_PORTS_START( opaopa ) /* Used By Opa Opa */
1634   PORT_START("DSW0")   /* Read from Port 0xf2 */
1638   PORT_START("f2")   /* Read from Port 0xf2 */
16351639   SEGA_COIN_A
16361640   SEGA_COIN_B
16371641
1638   PORT_START("DSW1")   /* Read from Port 0xf3 */
1642   PORT_START("f3")   /* Read from Port 0xf3 */
16391643   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1")
16401644   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
16411645   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
16581662   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
16591663   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
16601664
1661   PORT_START("IN0")   /* Read from Port 0xe0 */
1665   PORT_START("e0")   /* Read from Port 0xe0 */
16621666   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
16631667   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2 )
16641668   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
r3115r3116
16681672   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START1 )
16691673   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START2 )
16701674
1671   PORT_START("IN1")   /* Read from Port 0xe1 */
1675   PORT_START("e1")   /* Read from Port 0xe1 */
16721676   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_JOYSTICK_UP  ) PORT_8WAY PORT_PLAYER(1)
16731677   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
16741678   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
16781682   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
16791683   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNUSED )
16801684
1681   PORT_START("IN2")   /* Read from Port 0xe2 */
1685   PORT_START("e2")   /* Read from Port 0xe2 */
16821686   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_JOYSTICK_UP  ) PORT_8WAY PORT_PLAYER(2)
16831687   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
16841688   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
16911695
16921696
16931697static INPUT_PORTS_START( tetrisse ) /* Used By Tetris */
1694   PORT_START("DSW0")   /* Read from Port 0xf2 */
1698   PORT_START("f2")   /* Read from Port 0xf2 */
16951699   SEGA_COIN_A
16961700   SEGA_COIN_B
16971701
1698   PORT_START("DSW1")   /* Read from Port 0xf3 */
1702   PORT_START("f3")   /* Read from Port 0xf3 */
16991703   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" )
17001704   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
17011705   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
r3115r3116
17101714   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" )
17111715   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" )
17121716
1713   PORT_START("IN0")   /* Read from Port 0xe0 */
1717   PORT_START("e0")   /* Read from Port 0xe0 */
17141718   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
17151719   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2 )
17161720   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
r3115r3116
17201724   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START1 )
17211725   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START2 )
17221726
1723   PORT_START("IN1")   /* Read from Port 0xe1 */
1727   PORT_START("e1")   /* Read from Port 0xe1 */
17241728   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_JOYSTICK_UP  ) PORT_8WAY
17251729   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_JOYSTICK_DOWN ) PORT_8WAY
17261730   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_JOYSTICK_LEFT ) PORT_8WAY
r3115r3116
17291733   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_BUTTON2 )
17301734   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNUSED )
17311735   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNUSED )
1736
1737   PORT_START("e2")   /* Read from Port 0xe2 */
17321738INPUT_PORTS_END
17331739
17341740
17351741static INPUT_PORTS_START( hangonjr ) /* Used By Hang On Jr */
1736   PORT_START("DSW0")   /* Read from Port 0xf2 */
1742   PORT_START("f2")   /* Read from Port 0xf2 */
17371743   SEGA_COIN_A
17381744   SEGA_COIN_B
17391745
1740   PORT_START("DSW1")   /* Read from Port 0xf3 */
1746   PORT_START("f3")   /* Read from Port 0xf3 */
17411747   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1") /* Supose to be demo sound but has no effect */
17421748   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
17431749   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
17551761   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" )
17561762   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" )
17571763
1758   PORT_START("IN0")   /* Read from Port 0xe0 */
1764   PORT_START("e0")   /* Read from Port 0xe0 */
17591765   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
17601766   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2 )
17611767   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
r3115r3116
17651771   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
17661772   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
17671773
1768   PORT_START("IN1")   /* Read from Port 0xe1 */
1774   PORT_START("e1")   /* Read from Port 0xe1 */
17691775   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
17701776   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
17711777   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
r3115r3116
17751781   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
17761782   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
17771783
1784   PORT_START("e2")   /* Read from Port 0xe2 */
1785
17781786   PORT_START("IN2")   /* Read from Port 0xf8 */
17791787   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
17801788
r3115r3116
17831791INPUT_PORTS_END
17841792
17851793static INPUT_PORTS_START( ridleofp ) /* Used By Riddle Of Pythagoras */
1786   PORT_START("DSW0")   /* Read from Port 0xf2 */
1794   PORT_START("f2")   /* Read from Port 0xf2 */
17871795   SEGA_COIN_A
17881796   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
17891797   SEGA_COIN_B
17901798   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
17911799
1792   PORT_START("DSW1")   /* Read from Port 0xf3 */
1800   PORT_START("f3")   /* Read from Port 0xf3 */
17931801   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
17941802   PORT_DIPSETTING(    0x03, "3" )
17951803   PORT_DIPSETTING(    0x02, "4" )
r3115r3116
18071815   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
18081816   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" )
18091817
1810   PORT_START("IN0")   /* Read from Port 0xe0 */
1818   PORT_START("e0")   /* Read from Port 0xe0 */
18111819   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
18121820   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2 )
18131821   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
r3115r3116
18171825   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START1 )
18181826   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN ) // Would Be IPT_START2 but the code doesn't use it
18191827
1820   PORT_START("IN1")   /* Port 0xe1 */
1828   PORT_START("e1")   /* Port 0xe1 */
18211829   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
18221830   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
18231831   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
r3115r3116
18271835   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
18281836   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
18291837
1838   PORT_START("e2")   /* Read from Port 0xe2 */
1839
18301840   PORT_START("IN2")   /* Read from Port 0xf8 */
18311841   PORT_BIT( 0x0fff, 0x0000, IPT_DIAL ) PORT_SENSITIVITY(60) PORT_KEYDELTA(125)
18321842   PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_BUTTON2 )   /* is this used in the game? */
r3115r3116
21702180   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xbe, 0xbe, 0, 0, sms_vdp_2_data_r, sms_vdp_2_data_w);
21712181   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xbf, 0xbf, 0, 0, sms_vdp_2_ctrl_r, sms_vdp_2_ctrl_w);
21722182
2173   memory_install_read8_handler     (machine, 0, ADDRESS_SPACE_IO, 0xe0, 0xe0, 0, 0, input_port_2_r);
2174   memory_install_read8_handler     (machine, 0, ADDRESS_SPACE_IO, 0xe1, 0xe1, 0, 0, input_port_3_r);
2175   memory_install_read8_handler     (machine, 0, ADDRESS_SPACE_IO, 0xe2, 0xe2, 0, 0, input_port_4_r);
2176   memory_install_read8_handler     (machine, 0, ADDRESS_SPACE_IO, 0xf2, 0xf2, 0, 0, input_port_0_r);
2177   memory_install_read8_handler     (machine, 0, ADDRESS_SPACE_IO, 0xf3, 0xf3, 0, 0, input_port_1_r);
2183   memory_install_read8_handler     (machine, 0, ADDRESS_SPACE_IO, 0xe0, 0xe0, 0, 0, input_port_read_handler8(machine->portconfig, "e0"));
2184   memory_install_read8_handler     (machine, 0, ADDRESS_SPACE_IO, 0xe1, 0xe1, 0, 0, input_port_read_handler8(machine->portconfig, "e1"));
2185   memory_install_read8_handler     (machine, 0, ADDRESS_SPACE_IO, 0xe2, 0xe2, 0, 0, input_port_read_handler8(machine->portconfig, "e2"));
2186   memory_install_read8_handler     (machine, 0, ADDRESS_SPACE_IO, 0xf2, 0xf2, 0, 0, input_port_read_handler8(machine->portconfig, "f2"));
2187   memory_install_read8_handler     (machine, 0, ADDRESS_SPACE_IO, 0xf3, 0xf3, 0, 0, input_port_read_handler8(machine->portconfig, "f3"));
21782188
21792189   memory_install_write8_handler    (machine, 0, ADDRESS_SPACE_IO, 0xf7, 0xf7, 0, 0, systeme_bank_w );
21802190}
src/mame/drivers/atarig1.c
r3115r3116
5050
5151static void update_interrupts(running_machine *machine)
5252{
53   int newstate = 0;
54
55   if (atarigen_video_int_state)
56      newstate = 1;
57   if (atarigen_sound_int_state)
58      newstate = 2;
59
60   if (newstate)
61      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
62   else
63      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
53   cpunum_set_input_line(machine, 0, 1, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
54   cpunum_set_input_line(machine, 0, 2, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
6455}
6556
6657
src/mame/drivers/toobin.c
r3115r3116
4242
4343static void update_interrupts(running_machine *machine)
4444{
45   int newstate = 0;
46
47   if (atarigen_scanline_int_state)
48      newstate |= 1;
49   if (atarigen_sound_int_state)
50      newstate |= 2;
51
52   if (newstate)
53      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
54   else
55      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
45   cpunum_set_input_line(machine, 0, 1, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
46   cpunum_set_input_line(machine, 0, 2, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
47   cpunum_set_input_line(machine, 0, 3, atarigen_scanline_int_state && atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
5648}
5749
5850
r3115r3116
127119   AM_RANGE(0xff8500, 0xff8501) AM_WRITE(atarigen_eeprom_enable_w)
128120   AM_RANGE(0xff8600, 0xff8601) AM_WRITE(toobin_xscroll_w) AM_BASE(&atarigen_xscroll)
129121   AM_RANGE(0xff8700, 0xff8701) AM_WRITE(toobin_yscroll_w) AM_BASE(&atarigen_yscroll)
130   AM_RANGE(0xff8800, 0xff8801) AM_READ(input_port_0_word_r)
122   AM_RANGE(0xff8800, 0xff8801) AM_READ_PORT("FF8800")
131123   AM_RANGE(0xff9000, 0xff9001) AM_READ(special_port1_r)
132124   AM_RANGE(0xff9800, 0xff9801) AM_READ(atarigen_sound_r)
133125   AM_RANGE(0xffa000, 0xffafff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size)
r3115r3116
143135 *************************************/
144136
145137static INPUT_PORTS_START( toobin )
146   PORT_START("FF8800")   /* ff8800 */
138   PORT_START("FF8800")
147139   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 R Paddle Forward") PORT_CODE(KEYCODE_L) PORT_PLAYER(2)
148140   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 L Paddle Forward") PORT_CODE(KEYCODE_J) PORT_PLAYER(2)
149141   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 L Paddle Backward") PORT_CODE(KEYCODE_U) PORT_PLAYER(2)
r3115r3116
156148   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Throw") PORT_CODE(KEYCODE_RCONTROL) PORT_PLAYER(2)
157149   PORT_BIT( 0xfc00, IP_ACTIVE_LOW, IPT_UNUSED )
158150
159   PORT_START("FF9000")   /* ff9000 */
151   PORT_START("FF9000")
160152   PORT_BIT( 0x03ff, IP_ACTIVE_LOW, IPT_UNUSED )
161153   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
162154   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/srumbler.c
r3115r3116
6868
6969static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
7070   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_RAM)   /* RAM (of 1 sort or another) */
71   AM_RANGE(0x4008, 0x4008) AM_READ(input_port_0_r)
72   AM_RANGE(0x4009, 0x4009) AM_READ(input_port_1_r)
73   AM_RANGE(0x400a, 0x400a) AM_READ(input_port_2_r)
74   AM_RANGE(0x400b, 0x400b) AM_READ(input_port_3_r)
75   AM_RANGE(0x400c, 0x400c) AM_READ(input_port_4_r)
71   AM_RANGE(0x4008, 0x4008) AM_READ_PORT("SYSTEM")
72   AM_RANGE(0x4009, 0x4009) AM_READ_PORT("P1")
73   AM_RANGE(0x400a, 0x400a) AM_READ_PORT("P2")
74   AM_RANGE(0x400b, 0x400b) AM_READ_PORT("DSW1")
75   AM_RANGE(0x400c, 0x400c) AM_READ_PORT("DSW2")
7676   AM_RANGE(0x5000, 0x5fff) AM_READ(SMH_BANK6)   /* Banked ROM */
7777   AM_RANGE(0x6000, 0x6fff) AM_READ(SMH_BANK7)   /* Banked ROM */
7878   AM_RANGE(0x7000, 0x7fff) AM_READ(SMH_BANK8)   /* Banked ROM */
r3115r3116
127127
128128
129129static INPUT_PORTS_START( srumbler )
130   PORT_START("SYSTEM")      /* IN0 */
130   PORT_START("SYSTEM")
131131   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
132132   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
133133   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
137137   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
138138   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
139139
140   PORT_START("P1")      /* IN1 */
140   PORT_START("P1")
141141   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
142142   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
143143   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
r3115r3116
147147   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
148148   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
149149
150   PORT_START("P2")      /* IN2 */
150   PORT_START("P2")
151151   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
152152   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
153153   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
r3115r3116
157157   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
158158   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
159159
160   PORT_START("DSW1")      /* DSW0 */
160   PORT_START("DSW1")
161161   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_B ) )
162162   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
163163   PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
r3115r3116
181181   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
182182   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
183183
184   PORT_START("DSW2")      /* DSW1 */
184   PORT_START("DSW2")
185185   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
186186   PORT_DIPSETTING(    0x03, "3" )
187187   PORT_DIPSETTING(    0x02, "4" )
src/mame/drivers/pbaction.c
r3115r3116
6868   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_RAM)
6969   AM_RANGE(0xe000, 0xe07f) AM_READ(SMH_RAM)
7070   AM_RANGE(0xe400, 0xe5ff) AM_READ(SMH_RAM)
71   AM_RANGE(0xe600, 0xe600) AM_READ(input_port_0_r)   /* IN0 */
72   AM_RANGE(0xe601, 0xe601) AM_READ(input_port_1_r)   /* IN1 */
73   AM_RANGE(0xe602, 0xe602) AM_READ(input_port_2_r)   /* IN2 */
74   AM_RANGE(0xe604, 0xe604) AM_READ(input_port_3_r)   /* DSW1 */
75   AM_RANGE(0xe605, 0xe605) AM_READ(input_port_4_r)   /* DSW2 */
71   AM_RANGE(0xe600, 0xe600) AM_READ_PORT("P1")
72   AM_RANGE(0xe601, 0xe601) AM_READ_PORT("P2")
73   AM_RANGE(0xe602, 0xe602) AM_READ_PORT("SYSTEM")
74   AM_RANGE(0xe604, 0xe604) AM_READ_PORT("DSW1")
75   AM_RANGE(0xe605, 0xe605) AM_READ_PORT("DSW2")
7676   AM_RANGE(0xe606, 0xe606) AM_READ(SMH_NOP)   /* ??? */
7777ADDRESS_MAP_END
7878
r3115r3116
117117
118118
119119static INPUT_PORTS_START( pbaction )
120   PORT_START("P1")   /* IN0 */
120   PORT_START("P1")
121121   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 )
122122   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
123123   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 )
r3115r3116
127127   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
128128   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
129129
130   PORT_START("P2")   /* IN1 */
130   PORT_START("P2")
131131   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_COCKTAIL
132132   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
133133   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_COCKTAIL
r3115r3116
137137   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
138138   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
139139
140   PORT_START("SYSTEM")   /* IN2 */
140   PORT_START("SYSTEM")
141141   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
142142   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
143143   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
r3115r3116
147147   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
148148   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
149149
150   PORT_START("DSW1")   /* DSW0 */
150   PORT_START("DSW1")
151151   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_B ) )
152152   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
153153   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
r3115r3116
170170   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
171171   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
172172
173   PORT_START("DSW2")   /* DSW1 */
173   PORT_START("DSW2")
174174   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Bonus_Life ) )
175175   PORT_DIPSETTING(    0x01, "70K 200K 1000K" )
176176   PORT_DIPSETTING(    0x00, "70K 200K" )
src/mame/drivers/overdriv.c
r3115r3116
123123   }
124124}
125125
126static READ16_HANDLER( eeprom_r )
127{
128   int res;
129
130//logerror("%06x eeprom_r\n",activecpu_get_pc());
131   /* bit 6 is EEPROM data */
132   res = (eeprom_read_bit() << 6) | input_port_read(machine,"INPUT");
133
134   return res;
135}
136
137126static WRITE16_HANDLER( eeprom_w )
138127{
139128//logerror("%06x: write %04x to eeprom_w\n",activecpu_get_pc(),data);
r3115r3116
257246   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
258247   AM_RANGE(0x040000, 0x043fff) AM_READ(SMH_RAM)
259248   AM_RANGE(0x080000, 0x080fff) AM_READ(SMH_RAM)
260   AM_RANGE(0x0c0000, 0x0c0001) AM_READ(eeprom_r)
249   AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("INPUTS")
261250   AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("SYSTEM")
262251   AM_RANGE(0x180000, 0x180001) AM_READ_PORT("PADDLE")
263252   AM_RANGE(0x1d8000, 0x1d8003) AM_READ(overdriv_sound_0_r)   /* K053260 */
r3115r3116
344333/* is missing.                                                        */
345334
346335static INPUT_PORTS_START( overdriv )
347   PORT_START("INPUT")
336   PORT_START("INPUTS")
348337   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_TOGGLE
349338   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
350339   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
351340   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
352341   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
353342   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
354   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
343   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
355344   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
356345
357346   PORT_START("SYSTEM")
src/mame/drivers/thunderx.c
r3115r3116
371371/***************************************************************************/
372372
373373static ADDRESS_MAP_START( scontra_readmem, ADDRESS_SPACE_PROGRAM, 8 )
374   AM_RANGE(0x1f90, 0x1f90) AM_READ(input_port_0_r) /* coin */
375   AM_RANGE(0x1f91, 0x1f91) AM_READ(input_port_1_r) /* p1 */
376   AM_RANGE(0x1f92, 0x1f92) AM_READ(input_port_2_r) /* p2 */
377   AM_RANGE(0x1f93, 0x1f93) AM_READ(input_port_5_r) /* Dip 3 */
378   AM_RANGE(0x1f94, 0x1f94) AM_READ(input_port_3_r) /* Dip 1 */
379   AM_RANGE(0x1f95, 0x1f95) AM_READ(input_port_4_r) /* Dip 2 */
374   AM_RANGE(0x1f90, 0x1f90) AM_READ_PORT("SYSTEM")
375   AM_RANGE(0x1f91, 0x1f91) AM_READ_PORT("P1")
376   AM_RANGE(0x1f92, 0x1f92) AM_READ_PORT("P2")
377   AM_RANGE(0x1f93, 0x1f93) AM_READ_PORT("DSW3")
378   AM_RANGE(0x1f94, 0x1f94) AM_READ_PORT("DSW1")
379   AM_RANGE(0x1f95, 0x1f95) AM_READ_PORT("DSW2")
380380
381381   AM_RANGE(0x0000, 0x3fff) AM_READ(K052109_051960_r)
382382   AM_RANGE(0x4000, 0x57ff) AM_READ(SMH_RAM)
r3115r3116
386386ADDRESS_MAP_END
387387
388388static ADDRESS_MAP_START( thunderx_readmem, ADDRESS_SPACE_PROGRAM, 8 )
389   AM_RANGE(0x1f90, 0x1f90) AM_READ(input_port_0_r) /* coin */
390   AM_RANGE(0x1f91, 0x1f91) AM_READ(input_port_1_r) /* p1 */
391   AM_RANGE(0x1f92, 0x1f92) AM_READ(input_port_2_r) /* p2 */
392   AM_RANGE(0x1f93, 0x1f93) AM_READ(input_port_5_r) /* Dip 3 */
393   AM_RANGE(0x1f94, 0x1f94) AM_READ(input_port_3_r) /* Dip 1 */
394   AM_RANGE(0x1f95, 0x1f95) AM_READ(input_port_4_r) /* Dip 2 */
389   AM_RANGE(0x1f90, 0x1f90) AM_READ_PORT("SYSTEM")
390   AM_RANGE(0x1f91, 0x1f91) AM_READ_PORT("P1")
391   AM_RANGE(0x1f92, 0x1f92) AM_READ_PORT("P2")
392   AM_RANGE(0x1f93, 0x1f93) AM_READ_PORT("DSW3")
393   AM_RANGE(0x1f94, 0x1f94) AM_READ_PORT("DSW1")
394   AM_RANGE(0x1f95, 0x1f95) AM_READ_PORT("DSW2")
395395   AM_RANGE(0x1f98, 0x1f98) AM_READ(thunderx_1f98_r) /* registers */
396396
397397   AM_RANGE(0x0000, 0x3fff) AM_READ(K052109_051960_r)
r3115r3116
465465***************************************************************************/
466466
467467static INPUT_PORTS_START( scontra )
468   PORT_START("SYSTEM")   /* COINSW */
468   PORT_START("SYSTEM")
469469   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
470470   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
471471   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
475475   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
476476   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
477477
478   PORT_START("P1")   /* PLAYER 1 INPUTS */
478   PORT_START("P1")
479479   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
480480   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
481481   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
485485   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
486486   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
487487
488   PORT_START("P2")   /* PLAYER 2 INPUTS */
488   PORT_START("P2")
489489   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
490490   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
491491   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
495495   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
496496   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
497497
498   PORT_START("DSW1")   /* DSW #1 */
498   PORT_START("DSW1")
499499   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
500500   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
501501   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
531531   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
532532//  PORT_DIPSETTING(    0x00, "Invalid" )
533533
534   PORT_START("DSW2")   /* DSW #2 */
534   PORT_START("DSW2")
535535   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
536536   PORT_DIPSETTING(   0x03, "2" )
537537   PORT_DIPSETTING(   0x02, "3" )
r3115r3116
554554   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
555555   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
556556
557   PORT_START("DSW3")   /* DSW #3 */
557   PORT_START("DSW3")
558558   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
559559   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
560560   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
r3115r3116
569569INPUT_PORTS_END
570570
571571static INPUT_PORTS_START( thunderx )
572   PORT_START("SYSTEM")   /* IN0 */
572   PORT_START("SYSTEM")
573573   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
574574   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
575575   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
579579   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
580580   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
581581
582   PORT_START("P1")   /* PLAYER 1 INPUTS */
582   PORT_START("P1")
583583   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
584584   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
585585   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
589589   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
590590   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
591591
592   PORT_START("P2")   /* PLAYER 2 INPUTS */
592   PORT_START("P2")
593593   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
594594   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
595595   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
src/mame/drivers/spcforce.c
r3115r3116
3333
3434#include "driver.h"
3535#include "cpu/i8085/i8085.h"
36#include "cpu/i8039/i8039.h"
36#include "cpu/mcs48/mcs48.h"
3737#include "sound/sn76496.h"
3838
3939
r3115r3116
8181static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
8282   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
8383   AM_RANGE(0x4000, 0x43ff) AM_READ(SMH_RAM)
84   AM_RANGE(0x7000, 0x7000) AM_READ(input_port_0_r)
85   AM_RANGE(0x7001, 0x7001) AM_READ(input_port_1_r)
86   AM_RANGE(0x7002, 0x7002) AM_READ(input_port_2_r)
84   AM_RANGE(0x7000, 0x7000) AM_READ_PORT("DSW")
85   AM_RANGE(0x7001, 0x7001) AM_READ_PORT("P1")
86   AM_RANGE(0x7002, 0x7002) AM_READ_PORT("P2")
8787   AM_RANGE(0x8000, 0x83ff) AM_READ(SMH_RAM)
8888   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
8989   AM_RANGE(0xa000, 0xa3ff) AM_READ(SMH_RAM)
r3115r3116
111111ADDRESS_MAP_END
112112
113113static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
114   AM_RANGE(I8039_bus, I8039_bus) AM_READ(soundlatch_r)
115   AM_RANGE(I8039_p2, I8039_p2) AM_READ(spcforce_SN76496_select_r)
116   AM_RANGE(I8039_t0, I8039_t0) AM_READ(spcforce_t0_r)
114   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(soundlatch_r)
115   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(spcforce_SN76496_select_r)
116   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(spcforce_t0_r)
117117ADDRESS_MAP_END
118118
119119static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
120   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(spcforce_SN76496_latch_w)
121   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(spcforce_SN76496_select_w)
120   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(spcforce_SN76496_latch_w)
121   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(spcforce_SN76496_select_w)
122122ADDRESS_MAP_END
123123
124124
125125static INPUT_PORTS_START( spcforce )
126   PORT_START("DSW")      /* DSW */
126   PORT_START("DSW")
127127   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coin_A ) )
128128   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
129129   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
r3115r3116
147147   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
148148   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
149149
150   PORT_START("P1")      /* IN0 */
150   PORT_START("P1")
151151   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
152152   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
153153   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
r3115r3116
157157   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_START1 )
158158   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
159159
160   PORT_START("P2")      /* IN1 */
160   PORT_START("P2")
161161   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
162162   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
163163   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
170170
171171/* same as spcforce, but no cocktail mode */
172172static INPUT_PORTS_START( spcforc2 )
173   PORT_START("DSW")      /* DSW */
173   PORT_START("DSW")
174174   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coin_A ) )
175175   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
176176   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
r3115r3116
194194   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
195195   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
196196
197   PORT_START("P1")      /* IN0 */
197   PORT_START("P1")
198198   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
199199   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
200200   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
r3115r3116
204204   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_START1 )
205205   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
206206
207   PORT_START("P2")      /* IN1 */
207   PORT_START("P2")
208208   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
209209   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
210210INPUT_PORTS_END
src/mame/drivers/nmg5.c
r3115r3116
296296   AM_RANGE(0x180002, 0x180003) AM_WRITENOP
297297   AM_RANGE(0x180004, 0x180005) AM_READWRITE(prot_r, prot_w)
298298   AM_RANGE(0x180006, 0x180007) AM_WRITE(gfx_bank_w)
299   AM_RANGE(0x180008, 0x180009) AM_READ(input_port_0_word_r)
300   AM_RANGE(0x18000a, 0x18000b) AM_READ(input_port_1_word_r)
301   AM_RANGE(0x18000c, 0x18000d) AM_READ(input_port_2_word_r)
299   AM_RANGE(0x180008, 0x180009) AM_READ_PORT("DSW")
300   AM_RANGE(0x18000a, 0x18000b) AM_READ_PORT("SYSTEM")
301   AM_RANGE(0x18000c, 0x18000d) AM_READ_PORT("INPUTS")
302302   AM_RANGE(0x18000e, 0x18000f) AM_WRITE(priority_reg_w)
303303   AM_RANGE(0x300002, 0x300009) AM_WRITE(SMH_RAM) AM_BASE(&scroll_ram)
304304   AM_RANGE(0x30000a, 0x30000f) AM_WRITENOP
r3115r3116
316316   AM_RANGE(0x480002, 0x480003) AM_WRITENOP
317317   AM_RANGE(0x480004, 0x480005) AM_READWRITE(prot_r, prot_w)
318318   AM_RANGE(0x480006, 0x480007) AM_WRITE(gfx_bank_w)
319   AM_RANGE(0x480008, 0x480009) AM_READ(input_port_0_word_r)
320   AM_RANGE(0x48000a, 0x48000b) AM_READ(input_port_1_word_r)
321   AM_RANGE(0x48000c, 0x48000d) AM_READ(input_port_2_word_r)
319   AM_RANGE(0x480008, 0x480009) AM_READ_PORT("DSW")
320   AM_RANGE(0x48000a, 0x48000b) AM_READ_PORT("SYSTEM")
321   AM_RANGE(0x48000c, 0x48000d) AM_READ_PORT("INPUTS")
322322   AM_RANGE(0x48000e, 0x48000f) AM_WRITE(priority_reg_w)
323323   AM_RANGE(0x500002, 0x500009) AM_WRITE(SMH_RAM) AM_BASE(&scroll_ram)
324324   AM_RANGE(0x520000, 0x521fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram)
src/mame/drivers/silkroad.c
r3115r3116
144144   palette_set_color_rgb(machine,offset,pal5bit(paletteram32[offset] >> (10+16)),pal5bit(paletteram32[offset] >> (5+16)),pal5bit(paletteram32[offset] >> (0+16)));
145145}
146146
147/* player inputs */
148static READ32_HANDLER(io32_r)
149{
150   return ((input_port_read(machine, "PLAYERS") << 16) |  (input_port_read(machine, "SYSTEM") << 0));
151}
152
153/* dipswitches */
154static READ32_HANDLER(io32_1_r)
155{
156   return input_port_read(machine, "DSW")<<16;
157}
158
159147/* sound I/O */
160148
161149static READ32_HANDLER(silk_6295_0_r)
r3115r3116
216204   AM_RANGE(0x804000, 0x807fff) AM_READ(SMH_RAM)
217205   AM_RANGE(0x808000, 0x80bfff) AM_READ(SMH_RAM)
218206
219   AM_RANGE(0xC00000, 0xC00003) AM_READ(io32_r)   // player inputs
220   AM_RANGE(0xC00004, 0xC00007) AM_READ(io32_1_r)   // dip switches
207   AM_RANGE(0xC00000, 0xC00003) AM_READ_PORT("INPUTS")
208   AM_RANGE(0xC00004, 0xC00007) AM_READ_PORT("DSW")
221209   AM_RANGE(0xC00024, 0xC00027) AM_READ(silk_6295_0_r)
222210   AM_RANGE(0xC0002C, 0xC0002f) AM_READ(silk_ym_r)
223211   AM_RANGE(0xC00030, 0xC00033) AM_READ(silk_6295_1_r)
r3115r3116
259247
260248
261249static INPUT_PORTS_START( silkroad )
262   PORT_START("PLAYERS")   /* Players inputs */
263   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
264   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
265   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
266   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
267   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
268   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
269   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
270   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
271   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED )
272   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
273   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
274   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
275   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
276   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
277   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
278   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
250   PORT_START("INPUTS")
251   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
252   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
253   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_START1 )
254   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_START2 )
255   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
256   PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
257   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SERVICE2 )   /* Not mentioned in the "test mode" */
258   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_SPECIAL )   /* See notes - Stephh*/
259   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )   // this input makes the 020 lock up...- RB
260   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
261   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
262   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
263   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
264   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
265   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
266   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
267   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_UNUSED )
268   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
269   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
270   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
271   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
272   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
273   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
274   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
275   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_UNUSED )
276   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
277   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
278   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
279   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
280   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
281   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
282   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
279283
280   PORT_START("SYSTEM")   /* System inputs */
281   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
282   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
283   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
284   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 )
285   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
286   PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW )
287   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE2 )   /* Not mentioned in the "test mode" */
288   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL )   /* See notes - Stephh*/
289   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )   // this input makes the 020 lock up...- RB
290   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
291   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
292   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
293   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
294   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
295   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
296   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
284   PORT_START("DSW")
285   PORT_DIPNAME( 0x00010000, 0x00000000, DEF_STR( Lives ) )
286   PORT_DIPSETTING(          0x00010000, "1" )
287   PORT_DIPSETTING(          0x00000000, "2" )
288   PORT_DIPNAME( 0x00020000, 0x00000000, "Special Effect" )
289   PORT_DIPSETTING(          0x00020000, DEF_STR( Off ) )
290   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
291   PORT_DIPNAME( 0x00040000, 0x00040000, "Unused DIP A-2" )
292   PORT_DIPSETTING(          0x00040000, DEF_STR( Off ) )
293   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
294   PORT_DIPNAME( 0x00080000, 0x00080000, "Unused DIP A-3" )
295   PORT_DIPSETTING(          0x00080000, DEF_STR( Off ) )
296   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
297   PORT_DIPNAME( 0x00100000, 0x00100000, "Unused DIP A-4" )
298   PORT_DIPSETTING(          0x00100000, DEF_STR( Off ) )
299   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
300   PORT_DIPNAME( 0x00e00000, 0x00000000, DEF_STR( Difficulty ) )
301   PORT_DIPSETTING(          0x00600000, DEF_STR( Easiest ) )         // "1"
302   PORT_DIPSETTING(          0x00400000, DEF_STR( Easier ) )         // "2"
303   PORT_DIPSETTING(          0x00200000, DEF_STR( Easy ) )            // "3"
304   PORT_DIPSETTING(          0x00000000, DEF_STR( Normal ) )         // "4"
305   PORT_DIPSETTING(          0x00e00000, DEF_STR( Medium ) )         // "5"
306   PORT_DIPSETTING(          0x00c00000, DEF_STR( Hard ) )            // "6"
307   PORT_DIPSETTING(          0x00a00000, DEF_STR( Harder ) )         // "7"
308   PORT_DIPSETTING(          0x00800000, DEF_STR( Hardest ) )         // "8"
309   PORT_DIPNAME( 0x01000000, 0x01000000, "Unused DIP B-0" )
310   PORT_DIPSETTING(          0x01000000, DEF_STR( Off ) )
311   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
312   PORT_DIPNAME( 0x02000000, 0x02000000, DEF_STR( Free_Play ) )
313   PORT_DIPSETTING(          0x02000000, DEF_STR( Off ) )
314   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
315   PORT_DIPNAME( 0x04000000, 0x04000000, "Unused DIP B-2" )
316   PORT_DIPSETTING(          0x04000000, DEF_STR( Off ) )
317   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
318   PORT_DIPNAME( 0x08000000, 0x00000000, DEF_STR( Demo_Sounds ) )
319   PORT_DIPSETTING(          0x08000000, DEF_STR( Off ) )
320   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
321   PORT_DIPNAME( 0x10000000, 0x10000000, "Chute Type" )             // "Coin Box"
322   PORT_DIPSETTING(          0x10000000, DEF_STR( Single ) )         // "1"
323   PORT_DIPSETTING(          0x00000000, "Multi" )                     // "2"
324   PORT_DIPNAME( 0xe0000000, 0xe0000000, DEF_STR( Coin_A ) )
325   PORT_DIPSETTING(          0x00000000, DEF_STR(5C_1C))
326   PORT_DIPSETTING(          0x20000000, DEF_STR(4C_1C))
327   PORT_DIPSETTING(          0x40000000, DEF_STR(3C_1C))
328   PORT_DIPSETTING(          0x60000000, DEF_STR(2C_1C))
329   PORT_DIPSETTING(          0xe0000000, DEF_STR(1C_1C))
330   PORT_DIPSETTING(          0xc0000000, DEF_STR(1C_2C))
331   PORT_DIPSETTING(          0xa0000000, DEF_STR(1C_3C))
332   PORT_DIPSETTING(          0x80000000, DEF_STR(1C_4C))
297333
298   PORT_START("DSW")   /* DSW */
299   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Lives ) )
300   PORT_DIPSETTING(      0x0001, "1" )
301   PORT_DIPSETTING(      0x0000, "2" )
302   PORT_DIPNAME( 0x0002, 0x0000, "Special Effect" )
303   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
304   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
305   PORT_DIPNAME( 0x0004, 0x0004, "Unused DIP A-2" )
306   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
307   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
308   PORT_DIPNAME( 0x0008, 0x0008, "Unused DIP A-3" )
309   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
310   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
311   PORT_DIPNAME( 0x0010, 0x0010, "Unused DIP A-4" )
312   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
313   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
314   PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Difficulty ) )
315   PORT_DIPSETTING(      0x0060, DEF_STR( Easiest ) )         // "1"
316   PORT_DIPSETTING(      0x0040, DEF_STR( Easier ) )         // "2"
317   PORT_DIPSETTING(      0x0020, DEF_STR( Easy ) )            // "3"
318   PORT_DIPSETTING(      0x0000, DEF_STR( Normal ) )         // "4"
319   PORT_DIPSETTING(      0x00e0, DEF_STR( Medium ) )         // "5"
320   PORT_DIPSETTING(      0x00c0, DEF_STR( Hard ) )            // "6"
321   PORT_DIPSETTING(      0x00a0, DEF_STR( Harder ) )         // "7"
322   PORT_DIPSETTING(      0x0080, DEF_STR( Hardest ) )         // "8"
323   PORT_DIPNAME( 0x0100, 0x0100, "Unused DIP B-0" )
324   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
325   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
326   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Free_Play ) )
327   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
328   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
329   PORT_DIPNAME( 0x0400, 0x0400, "Unused DIP B-2" )
330   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
331   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
332   PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Demo_Sounds ) )
333   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
334   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
335   PORT_DIPNAME( 0x1000, 0x1000, "Chute Type" )             // "Coin Box"
336   PORT_DIPSETTING(      0x1000, DEF_STR( Single ) )         // "1"
337   PORT_DIPSETTING(      0x0000, "Multi" )                     // "2"
338   PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coin_A ) )
339   PORT_DIPSETTING( 0x0000, DEF_STR(5C_1C))
340   PORT_DIPSETTING( 0x2000, DEF_STR(4C_1C))
341   PORT_DIPSETTING( 0x4000, DEF_STR(3C_1C))
342   PORT_DIPSETTING( 0x6000, DEF_STR(2C_1C))
343   PORT_DIPSETTING( 0xe000, DEF_STR(1C_1C))
344   PORT_DIPSETTING( 0xc000, DEF_STR(1C_2C))
345   PORT_DIPSETTING( 0xa000, DEF_STR(1C_3C))
346   PORT_DIPSETTING( 0x8000, DEF_STR(1C_4C))
347
348334//  PORT_START("MISC")  /* Misc inputs */
349335//  PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* VBLANK ? */
350336//  PORT_BIT( 0xff7f, IP_ACTIVE_LOW, IPT_UNUSED ) /* unknown / unused */
src/mame/drivers/tecmo16.c
r3115r3116
7979   AM_RANGE(0x122000, 0x127fff) AM_READ(SMH_RAM)
8080   AM_RANGE(0x130000, 0x130fff) AM_READ(SMH_RAM)
8181   AM_RANGE(0x140000, 0x141fff) AM_READ(SMH_RAM)
82   AM_RANGE(0x150030, 0x150031) AM_READ(input_port_1_word_r)
83   AM_RANGE(0x150040, 0x150041) AM_READ(input_port_0_word_r)
84   AM_RANGE(0x150050, 0x150051) AM_READ(input_port_2_word_r)
82   AM_RANGE(0x150030, 0x150031) AM_READ_PORT("DSW2")
83   AM_RANGE(0x150040, 0x150041) AM_READ_PORT("DSW1")
84   AM_RANGE(0x150050, 0x150051) AM_READ_PORT("P1_P2")
8585ADDRESS_MAP_END
8686
8787static ADDRESS_MAP_START( fstarfrc_writemem, ADDRESS_SPACE_PROGRAM, 16 )
r3115r3116
116116   AM_RANGE(0x124000, 0x124fff) AM_READ(SMH_RAM)
117117   AM_RANGE(0x130000, 0x130fff) AM_READ(SMH_RAM)
118118   AM_RANGE(0x140000, 0x141fff) AM_READ(SMH_RAM)
119   AM_RANGE(0x150020, 0x150021) AM_READ(input_port_3_word_r)
120   AM_RANGE(0x150030, 0x150031) AM_READ(input_port_1_word_r)
121   AM_RANGE(0x150040, 0x150041) AM_READ(input_port_0_word_r)
122   AM_RANGE(0x150050, 0x150051) AM_READ(input_port_2_word_r)
119   AM_RANGE(0x150020, 0x150021) AM_READ_PORT("EXTRA")
120   AM_RANGE(0x150030, 0x150031) AM_READ_PORT("DSW2")
121   AM_RANGE(0x150040, 0x150041) AM_READ_PORT("DSW1")
122   AM_RANGE(0x150050, 0x150051) AM_READ_PORT("P1_P2")
123123ADDRESS_MAP_END
124124
125125static ADDRESS_MAP_START( ginkun_writemem, ADDRESS_SPACE_PROGRAM, 16 )
r3115r3116
168168/******************************************************************************/
169169
170170static INPUT_PORTS_START( fstarfrc )
171   PORT_START("DSW1")         /* DIP SW 1 */
171   PORT_START("DSW1")
172172   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:1,2")
173173   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
174174   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
r3115r3116
192192   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
193193   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
194194
195   PORT_START("DSW2")         /* DIP SW 2 */
195   PORT_START("DSW2")
196196   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )       PORT_DIPLOCATION("SW2:1,2")
197197   PORT_DIPSETTING(    0x00, "2" )
198198   PORT_DIPSETTING(    0x03, "3" )
r3115r3116
234234INPUT_PORTS_END
235235
236236static INPUT_PORTS_START( ginkun )
237   PORT_START("DSW1")         /* DIP SW 1 */
237   PORT_START("DSW1")
238238   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:8,7")
239239   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
240240   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
r3115r3116
258258   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
259259   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
260260
261   PORT_START("DSW2")         /* DIP SW 2 */
261   PORT_START("DSW2")
262262   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )       PORT_DIPLOCATION("SW2:8,7")
263263   PORT_DIPSETTING(    0x00, "2" )
264264   PORT_DIPSETTING(    0x03, "3" )
r3115r3116
305305INPUT_PORTS_END
306306
307307static INPUT_PORTS_START( riot )
308   PORT_START("DSW1")         /* DIP SW 1 */
308   PORT_START("DSW1")
309309   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:1,2,3")
310310   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
311311   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
r3115r3116
331331   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
332332   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
333333
334   PORT_START("DSW2")         /* DIP SW 2 */
334   PORT_START("DSW2")
335335   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW2:1,2")
336336   PORT_DIPSETTING(    0x03, "1" )
337337   PORT_DIPSETTING(    0x02, "2" )
src/mame/drivers/tumbleb.c
r3115r3116
400400{
401401    switch (offset<<1)
402402   {
403      case 0: /* Player 1 & Player 2 joysticks & fire buttons */
404         return (input_port_read(machine, "P1") | (input_port_read(machine, "P2") << 8));
405      case 2: /* Dips */
406         return (input_port_read(machine, "DSW1") | (input_port_read(machine, "DSW2") << 8));
407      case 8: /* Credits */
403      case 0:
404         return input_port_read(machine, "PLAYERS");
405      case 2:
406         return input_port_read(machine, "DSW");
407      case 8:
408408         return input_port_read(machine, "SYSTEM");
409409      case 10: /* ? */
410410      case 12:
r3115r3116
930930/******************************************************************************/
931931
932932static INPUT_PORTS_START( tumblepb )
933   PORT_START("P1")   /* Player 1 controls */
934   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
935   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
936   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
937   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
938   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
939   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
940   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
941   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
933   PORT_START("PLAYERS")
934   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
935   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
936   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
937   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
938   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
939   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
940   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
941   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
942   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
943   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
944   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
945   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
946   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
947   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
948   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
949   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
942950
943   PORT_START("P2")   /* Player 2 controls */
944   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
945   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
946   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
947   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
948   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
949   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
950   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
951   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
951   PORT_START("SYSTEM")
952   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
953   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
954   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
955   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
956   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
957   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
958   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
959   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
952960
953   PORT_START("SYSTEM")   /* Credits */
954   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
955   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
956   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
957   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
958   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
959   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
960   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
961   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
961   PORT_START("DSW")
962   PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) )
963   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
964   PORT_DIPSETTING(      0x0080, DEF_STR( 2C_1C ) )
965   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_1C ) )
966   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_2C ) )
967   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_3C ) )
968   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
969   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_5C ) )
970   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_6C ) )
971   PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) )
972   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
973   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
974   PORT_DIPSETTING(      0x001c, DEF_STR( 1C_1C ) )
975   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_2C ) )
976   PORT_DIPSETTING(      0x0014, DEF_STR( 1C_3C ) )
977   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
978   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_5C ) )
979   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_6C ) )
980   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )
981   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
982   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
983   PORT_DIPNAME( 0x0001, 0x0001, "2 Coins to Start, 1 to Continue" )
984   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
985   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
962986
963   PORT_START("DSW1")   /* Dip switch bank 1 */
964   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
965   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
966   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
967   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) )
968   PORT_DIPSETTING(    0x60, DEF_STR( 1C_2C ) )
969   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )
970   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
971   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_5C ) )
972   PORT_DIPSETTING(    0x40, DEF_STR( 1C_6C ) )
973   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) )
974   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
975   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
976   PORT_DIPSETTING(    0x1c, DEF_STR( 1C_1C ) )
977   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_2C ) )
978   PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
979   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
980   PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C ) )
981   PORT_DIPSETTING(    0x08, DEF_STR( 1C_6C ) )
982   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
983   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
984   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
985   PORT_DIPNAME( 0x01, 0x01, "2 Coins to Start, 1 to Continue" )
986   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
987   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
988
989   PORT_START("DSW2")   /* Dip switch bank 2 */
990   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
991   PORT_DIPSETTING(    0x80, "1" )
992   PORT_DIPSETTING(    0x00, "2" )
993   PORT_DIPSETTING(    0xc0, "3" )
994   PORT_DIPSETTING(    0x40, "4" )
995   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
996   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
997   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
998   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
999   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
987   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) )
988   PORT_DIPSETTING(      0x8000, "1" )
989   PORT_DIPSETTING(      0x0000, "2" )
990   PORT_DIPSETTING(      0xc000, "3" )
991   PORT_DIPSETTING(      0x4000, "4" )
992   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) )
993   PORT_DIPSETTING(      0x1000, DEF_STR( Easy ) )
994   PORT_DIPSETTING(      0x3000, DEF_STR( Normal ) )
995   PORT_DIPSETTING(      0x2000, DEF_STR( Hard ) )
996   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1000997#if TUMBLEP_HACK
1001   PORT_DIPNAME( 0x08, 0x08, "Remove Monsters" )
998   PORT_DIPNAME( 0x0800, 0x0800, "Remove Monsters" )
1002999#else
1003   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )      // See notes
1000   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unused ) )      // See notes
10041001#endif
1005   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1006   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1002   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
1003   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
10071004#if TUMBLEP_HACK
1008   PORT_DIPNAME( 0x04, 0x04, "Edit Levels" )
1005   PORT_DIPNAME( 0x0400, 0x0400, "Edit Levels" )
10091006#else
1010   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )      // See notes
1007   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unused ) )      // See notes
10111008#endif
1012   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1013   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1014   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Allow_Continue ) )
1015   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1016   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
1017   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
1018   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1019   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1009   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
1010   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1011   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Allow_Continue ) )
1012   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
1013   PORT_DIPSETTING(      0x0200, DEF_STR( Yes ) )
1014   PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Demo_Sounds ) )
1015   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
1016   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
10201017INPUT_PORTS_END
10211018
10221019static INPUT_PORTS_START( metlsavr )
1023   PORT_START("P1")   /* Player 1 controls */
1024   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1025   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1026   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1027   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1028   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1029   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1030   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1031   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1020   PORT_START("PLAYERS")
1021   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1022   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1023   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1024   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1025   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1026   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1027   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1028   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
1029   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1030   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1031   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1032   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1033   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1034   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1035   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1036   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
10321037
1033   PORT_START("P2")   /* Player 2 controls */
1034   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1035   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1036   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1037   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1038   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1039   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1040   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1041   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
1038   PORT_START("SYSTEM")
1039   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1040   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1041   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1042   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1043   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1044   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1045   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1046   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
10421047
1043   PORT_START("SYSTEM")   /* Credits */
1044   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1045   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1046   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1047   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1048   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1049   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1050   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1051   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1048   PORT_START("DSW")
1049   PORT_DIPUNUSED_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:8" )
1050   PORT_DIPUNUSED_DIPLOC( 0x0002, IP_ACTIVE_LOW, "SW1:7" )
1051   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) )            PORT_DIPLOCATION("SW1:6,5")
1052   PORT_DIPSETTING(      0x0000, "2" )
1053   PORT_DIPSETTING(      0x000c, "3" )
1054   PORT_DIPSETTING(      0x0008, "4" )
1055   PORT_DIPSETTING(      0x0004, "5" )
1056   PORT_DIPNAME( 0x0070, 0x0070, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW1:4,3,2")
1057   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
1058   PORT_DIPSETTING(      0x0010, DEF_STR( 4C_1C ) )
1059   PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ) )
1060   PORT_DIPSETTING(      0x0030, DEF_STR( 2C_1C ) )
1061   PORT_DIPSETTING(      0x0070, DEF_STR( 1C_1C ) )
1062   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_2C ) )
1063   PORT_DIPSETTING(      0x0050, DEF_STR( 1C_3C ) )
1064   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_5C ) )
1065   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW1:1")
1066   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1067   PORT_DIPSETTING(      0x0080, DEF_STR( On ) )
10521068
1053   PORT_START("DSW1")   /* Dip switch bank 1 */
1054   PORT_DIPUNUSED_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" )
1055   PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW1:7" )
1056   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )            PORT_DIPLOCATION("SW1:6,5")
1057   PORT_DIPSETTING(    0x00, "2" )
1058   PORT_DIPSETTING(    0x0c, "3" )
1059   PORT_DIPSETTING(    0x08, "4" )
1060   PORT_DIPSETTING(    0x04, "5" )
1061   PORT_DIPNAME( 0x70, 0x70, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW1:4,3,2")
1062   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
1063   PORT_DIPSETTING(    0x10, DEF_STR( 4C_1C ) )
1064   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1065   PORT_DIPSETTING(    0x30, DEF_STR( 2C_1C ) )
1066   PORT_DIPSETTING(    0x70, DEF_STR( 1C_1C ) )
1067   PORT_DIPSETTING(    0x60, DEF_STR( 1C_2C ) )
1068   PORT_DIPSETTING(    0x50, DEF_STR( 1C_3C ) )
1069   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
1070   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW1:1")
1071   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1072   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1073
1074   PORT_START("DSW2")   /* Dip switch bank 2 */
1075   PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:8" )
1076   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:7")     // See notes
1077   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1078   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1079   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:6")     // See notes
1080   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1081   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1082   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Language ) )         PORT_DIPLOCATION("SW2:5")
1083   PORT_DIPSETTING(    0x08, DEF_STR( English ) )
1084   PORT_DIPSETTING(    0x00, "Korean" )
1085   PORT_DIPNAME( 0x30, 0x30, "Life Meter" )                PORT_DIPLOCATION("SW2:4,3")
1086   PORT_DIPSETTING(    0x00, "66%" )
1087   PORT_DIPSETTING(    0x30, "100%" )
1088   PORT_DIPSETTING(    0x20, "133%" )
1089   PORT_DIPSETTING(    0x10, "166%" )
1090   PORT_DIPNAME( 0xc0, 0xc0, "Time" )                      PORT_DIPLOCATION("SW2:2,1")
1091   PORT_DIPSETTING(    0x40, "30 Seconds" )
1092   PORT_DIPSETTING(    0x80, "40 Seconds" )
1093   PORT_DIPSETTING(    0xc0, "60 Seconds" )
1094   PORT_DIPSETTING(    0x00, "80 Seconds" )
1069   PORT_SERVICE_DIPLOC( 0x0100, IP_ACTIVE_LOW, "SW2:8" )
1070   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:7")     // See notes
1071   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
1072   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1073   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:6")     // See notes
1074   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
1075   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1076   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Language ) )         PORT_DIPLOCATION("SW2:5")
1077   PORT_DIPSETTING(      0x0800, DEF_STR( English ) )
1078   PORT_DIPSETTING(      0x0000, "Korean" )
1079   PORT_DIPNAME( 0x3000, 0x3000, "Life Meter" )                PORT_DIPLOCATION("SW2:4,3")
1080   PORT_DIPSETTING(      0x0000, "66%" )
1081   PORT_DIPSETTING(      0x3000, "100%" )
1082   PORT_DIPSETTING(      0x2000, "133%" )
1083   PORT_DIPSETTING(      0x1000, "166%" )
1084   PORT_DIPNAME( 0xc000, 0xc000, "Time" )                      PORT_DIPLOCATION("SW2:2,1")
1085   PORT_DIPSETTING(      0x4000, "30 Seconds" )
1086   PORT_DIPSETTING(      0x8000, "40 Seconds" )
1087   PORT_DIPSETTING(      0xc000, "60 Seconds" )
1088   PORT_DIPSETTING(      0x0000, "80 Seconds" )
10951089INPUT_PORTS_END
10961090
10971091static INPUT_PORTS_START( suprtrio )
r3115r3116
11431137INPUT_PORTS_END
11441138
11451139static INPUT_PORTS_START( fncywld )
1146   PORT_START("P1")   /* Player 1 controls */
1147   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1148   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1149   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1150   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1151   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1152   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1153   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1154   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1140   PORT_START("PLAYERS")
1141   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1142   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1143   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1144   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1145   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1146   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1147   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1148   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
1149   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1150   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1151   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1152   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1153   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1154   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1155   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1156   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
11551157
1156   PORT_START("P2")   /* Player 2 controls */
1157   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1158   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1159   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1160   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1161   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1162   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1163   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1164   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
1158   PORT_START("SYSTEM")
1159   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1160   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1161   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1162   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
1163   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1164   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1165   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1166   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
11651167
1166   PORT_START("SYSTEM")   /* Credits */
1167   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1168   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1169   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1170   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
1171   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1172   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1173   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1174   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1168   PORT_START("DSW")
1169   PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coinage ) )
1170   PORT_DIPSETTING(      0x0020, DEF_STR( 4C_1C ) )
1171   PORT_DIPSETTING(      0x0040, DEF_STR( 3C_1C ) )
1172   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_1C ) )
1173//  PORT_DIPSETTING(      0x0000, DEF_STR( 2C_1C ) )        // duplicated setting
1174   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_1C ) )
1175   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )
1176   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_3C ) )
1177   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_4C ) )
1178   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Allow_Continue ) )
1179   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
1180   PORT_DIPSETTING(      0x0010, DEF_STR( Yes ) )
1181   PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Demo_Sounds ) )
1182   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
1183   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1184   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Language ) )      // only seems to the title screen
1185   PORT_DIPSETTING(      0x0004, DEF_STR( English ) )
1186   PORT_DIPSETTING(      0x0000, "Korean" )
1187   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )
1188   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1189   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1190   PORT_DIPNAME( 0x0001, 0x0001, "2 Coins to Start, 1 to Continue" )
1191   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1192   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
11751193
1176   PORT_START("DSW1")   /* Dip switch bank 1 */
1177   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coinage ) )
1178   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
1179   PORT_DIPSETTING(    0x40, DEF_STR( 3C_1C ) )
1180   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
1181//  PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )        // duplicated setting
1182   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) )
1183   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )
1184   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )
1185   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
1186   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )
1187   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1188   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
1189   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
1190   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1191   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1192   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Language ) )      // only seems to the title screen
1193   PORT_DIPSETTING(    0x04, DEF_STR( English ) )
1194   PORT_DIPSETTING(    0x00, "Korean" )
1195   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
1196   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1197   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1198   PORT_DIPNAME( 0x01, 0x01, "2 Coins to Start, 1 to Continue" )
1199   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1200   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1194   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) )
1195   PORT_DIPSETTING(      0x8000, "1" )
1196   PORT_DIPSETTING(      0x0000, "2" )
1197   PORT_DIPSETTING(      0xc000, "3" )
1198   PORT_DIPSETTING(      0x4000, "4" )
1199   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Difficulty ) )   // to be confirmed
1200   PORT_DIPSETTING(      0x3000, DEF_STR( Easy ) )
1201   PORT_DIPSETTING(      0x2000, DEF_STR( Normal ) )
1202   PORT_DIPSETTING(      0x1000, DEF_STR( Hard ) )
1203   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
12011204
1202   PORT_START("DSW2")   /* Dip switch bank 2 */
1203   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
1204   PORT_DIPSETTING(    0x80, "1" )
1205   PORT_DIPSETTING(    0x00, "2" )
1206   PORT_DIPSETTING(    0xc0, "3" )
1207   PORT_DIPSETTING(    0x40, "4" )
1208   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )   // to be confirmed
1209   PORT_DIPSETTING(    0x30, DEF_STR( Easy ) )
1210   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
1211   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1212   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1213
12141205#if FNCYWLD_HACK
1215   PORT_DIPNAME( 0x08, 0x08, "Remove Monsters" )
1206   PORT_DIPNAME( 0x0800, 0x0800, "Remove Monsters" )
12161207#else
1217   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )      // See notes
1208   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unused ) )      // See notes
12181209#endif
1219   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1220   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1210   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
1211   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
12211212#if FNCYWLD_HACK
1222   PORT_DIPNAME( 0x04, 0x04, "Edit Levels" )
1213   PORT_DIPNAME( 0x0400, 0x0400, "Edit Levels" )
12231214#else
1224   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )      // See notes
1215   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unused ) )      // See notes
12251216#endif
1226   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1227   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1228   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) )
1229   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1230   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1231   PORT_DIPNAME( 0x01, 0x01, "Freeze" )
1232   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1233   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1217   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
1218   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1219   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unused ) )
1220   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
1221   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1222   PORT_DIPNAME( 0x0100, 0x0100, "Freeze" )
1223   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
1224   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
12341225INPUT_PORTS_END
12351226
12361227static INPUT_PORTS_START( htchctch )
1237   PORT_START("P1")   /* Player 1 controls */
1238   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1239   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1240   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1241   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1242   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1243   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1244   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
1245   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1228   PORT_START("PLAYERS")
1229   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1230   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1231   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1232   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1233   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1234   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1235   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
1236   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
1237   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1238   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1239   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1240   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1241   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1242   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1243   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
1244   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
12461245
1247   PORT_START("P2")   /* Player 2 controls */
1248   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1249   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1250   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1251   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1252   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1253   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1254   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
1255   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
1246   PORT_START("SYSTEM")
1247   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1248   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1249   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1250   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1251   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1252   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1253   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1254   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
12561255
1257   PORT_START("SYSTEM")   /* Credits */
1258   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1259   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1260   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1261   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1262   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1263   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1264   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1265   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1256   PORT_START("DSW")
1257   PORT_DIPUNUSED_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:8" )
1258   PORT_DIPUNUSED_DIPLOC( 0x0002, IP_ACTIVE_LOW, "SW1:7" )
1259   PORT_DIPUNUSED_DIPLOC( 0x0004, IP_ACTIVE_LOW, "SW1:6" )
1260   PORT_DIPUNUSED_DIPLOC( 0x0008, IP_ACTIVE_LOW, "SW1:5" )
1261   PORT_DIPUNUSED_DIPLOC( 0x0010, IP_ACTIVE_LOW, "SW1:4" )
1262   PORT_DIPUNUSED_DIPLOC( 0x0020, IP_ACTIVE_LOW, "SW1:3" )
1263   PORT_DIPUNUSED_DIPLOC( 0x0040, IP_ACTIVE_LOW, "SW1:2" )
1264   PORT_DIPUNUSED_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:1" )
12661265
1267   PORT_START("DSW1")   /* Dip switch bank 1 */
1268   PORT_DIPUNUSED_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" )
1269   PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW1:7" )
1270   PORT_DIPUNUSED_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW1:6" )
1271   PORT_DIPUNUSED_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW1:5" )
1272   PORT_DIPUNUSED_DIPLOC( 0x10, IP_ACTIVE_LOW, "SW1:4" )
1273   PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:3" )
1274   PORT_DIPUNUSED_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW1:2" )
1275   PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:1" )
1276
1277   PORT_START("DSW2")   /* Dip switch bank 2 */
1278   PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:8" )
1279   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW2:7,6")
1280   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
1281   PORT_DIPSETTING(    0x06, DEF_STR( Normal ) )
1282   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1283   PORT_DIPSETTING(    0x04, DEF_STR( Very_Hard ) )
1284   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW2:5,4,3")
1285   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
1286   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
1287   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
1288   PORT_DIPSETTING(    0x30, DEF_STR( 2C_1C ) )
1289   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
1290   PORT_DIPSETTING(    0x28, DEF_STR( 2C_3C ) )
1291   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
1292   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
1293   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:2")     // See notes
1294   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1295   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1296   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW2:1")
1297   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1298   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1266   PORT_SERVICE_DIPLOC( 0x0100, IP_ACTIVE_LOW, "SW2:8" )
1267   PORT_DIPNAME( 0x0600, 0x0600, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW2:7,6")
1268   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
1269   PORT_DIPSETTING(      0x0600, DEF_STR( Normal ) )
1270   PORT_DIPSETTING(      0x0200, DEF_STR( Hard ) )
1271   PORT_DIPSETTING(      0x0400, DEF_STR( Very_Hard ) )
1272   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW2:5,4,3")
1273   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
1274   PORT_DIPSETTING(      0x2000, DEF_STR( 4C_1C ) )
1275   PORT_DIPSETTING(      0x1000, DEF_STR( 3C_1C ) )
1276   PORT_DIPSETTING(      0x3000, DEF_STR( 2C_1C ) )
1277   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )
1278   PORT_DIPSETTING(      0x2800, DEF_STR( 2C_3C ) )
1279   PORT_DIPSETTING(      0x1800, DEF_STR( 1C_2C ) )
1280   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_3C ) )
1281   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:2")     // See notes
1282   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
1283   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1284   PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW2:1")
1285   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1286   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
12991287INPUT_PORTS_END
13001288
13011289static INPUT_PORTS_START( cookbib )
1302   PORT_START("P1")   /* Player 1 controls */
1303   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1304   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1305   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1306   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1307   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1308   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1309   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
1310   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1290   PORT_START("PLAYERS")
1291   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1292   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1293   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1294   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1295   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1296   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1297   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
1298   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
1299   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1300   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1301   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1302   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1303   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1304   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1305   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
1306   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
13111307
1312   PORT_START("P2")   /* Player 2 controls */
1313   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1314   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1315   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1316   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1317   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1318   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1319   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
1320   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
1308   PORT_START("SYSTEM")
1309   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1310   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1311   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1312   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1313   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1314   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1315   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1316   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
13211317
1322   PORT_START("SYSTEM")   /* Credits */
1323   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1324   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1325   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1326   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1327   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1328   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1329   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1330   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1318   PORT_START("DSW")
1319   PORT_DIPUNUSED_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:8" )
1320   PORT_DIPUNUSED_DIPLOC( 0x0002, IP_ACTIVE_LOW, "SW1:7" )
1321   PORT_DIPUNUSED_DIPLOC( 0x0004, IP_ACTIVE_LOW, "SW1:6" )
1322   PORT_DIPUNUSED_DIPLOC( 0x0008, IP_ACTIVE_LOW, "SW1:5" )
1323   PORT_DIPUNUSED_DIPLOC( 0x0010, IP_ACTIVE_LOW, "SW1:4" )
1324   PORT_DIPUNUSED_DIPLOC( 0x0020, IP_ACTIVE_LOW, "SW1:3" )
1325   PORT_DIPUNUSED_DIPLOC( 0x0040, IP_ACTIVE_LOW, "SW1:2" )
1326   PORT_DIPUNUSED_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:1" )
13311327
1332   PORT_START("DSW1")   /* Dip switch bank 1 */
1333   PORT_DIPUNUSED_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" )
1334   PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW1:7" )
1335   PORT_DIPUNUSED_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW1:6" )
1336   PORT_DIPUNUSED_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW1:5" )
1337   PORT_DIPUNUSED_DIPLOC( 0x10, IP_ACTIVE_LOW, "SW1:4" )
1338   PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:3" )
1339   PORT_DIPUNUSED_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW1:2" )
1340   PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:1" )
1341
1342   PORT_START("DSW2")   /* Dip switch bank 2 */
1343   PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:8" )
1344   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW2:7,6")
1345   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
1346   PORT_DIPSETTING(    0x06, DEF_STR( Normal ) )
1347   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1348   PORT_DIPSETTING(    0x04, DEF_STR( Very_Hard ) )
1349   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW2:5,4,3")
1350   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
1351   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
1352   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
1353   PORT_DIPSETTING(    0x30, DEF_STR( 2C_1C ) )
1354   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
1355   PORT_DIPSETTING(    0x28, DEF_STR( 2C_3C ) )
1356   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
1357   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
1358   PORT_DIPNAME( 0x40, 0x40, "Winning Rounds (VS Mode)" )  PORT_DIPLOCATION("SW2:2")
1359   PORT_DIPSETTING(    0x00, "1" )
1360   PORT_DIPSETTING(    0x40, "2" )
1361   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW2:1")
1362   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1363   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1328   PORT_SERVICE_DIPLOC( 0x0100, IP_ACTIVE_LOW, "SW2:8" )
1329   PORT_DIPNAME( 0x0600, 0x0600, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW2:7,6")
1330   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
1331   PORT_DIPSETTING(      0x0600, DEF_STR( Normal ) )
1332   PORT_DIPSETTING(      0x0200, DEF_STR( Hard ) )
1333   PORT_DIPSETTING(      0x0400, DEF_STR( Very_Hard ) )
1334   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW2:5,4,3")
1335   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
1336   PORT_DIPSETTING(      0x2000, DEF_STR( 4C_1C ) )
1337   PORT_DIPSETTING(      0x1000, DEF_STR( 3C_1C ) )
1338   PORT_DIPSETTING(      0x3000, DEF_STR( 2C_1C ) )
1339   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )
1340   PORT_DIPSETTING(      0x2800, DEF_STR( 2C_3C ) )
1341   PORT_DIPSETTING(      0x1800, DEF_STR( 1C_2C ) )
1342   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_3C ) )
1343   PORT_DIPNAME( 0x4000, 0x4000, "Winning Rounds (VS Mode)" )  PORT_DIPLOCATION("SW2:2")
1344   PORT_DIPSETTING(      0x0000, "1" )
1345   PORT_DIPSETTING(      0x4000, "2" )
1346   PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW2:1")
1347   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1348   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
13641349INPUT_PORTS_END
13651350
13661351static INPUT_PORTS_START( chokchok )
1367   PORT_START("P1")   /* Player 1 controls */
1368   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1369   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1370   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1371   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1372   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1373   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1374   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
1375   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1352   PORT_START("PLAYERS")
1353   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1354   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1355   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1356   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1357   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1358   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1359   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
1360   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
1361   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1362   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1363   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1364   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1365   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1366   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1367   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
1368   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
13761369
1377   PORT_START("P2")   /* Player 2 controls */
1378   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1379   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1380   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1381   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1382   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1383   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1384   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* button 3 - unused */
1385   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
1370   PORT_START("SYSTEM")
1371   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1372   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1373   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1374   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1375   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1376   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1377   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1378   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
13861379
1387   PORT_START("SYSTEM")   /* Credits */
1388   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1389   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1390   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1391   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1392   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1393   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1394   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1395   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1380   PORT_START("DSW")
1381   PORT_DIPNAME( 0x0001, 0x0001, "Winning Rounds" )            PORT_DIPLOCATION("SW1:8")
1382   PORT_DIPSETTING(      0x0000, "2" )
1383   PORT_DIPSETTING(      0x0001, "3" )
1384   PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW1:7,6")
1385   PORT_DIPSETTING(      0x0006, "0" )
1386   PORT_DIPSETTING(      0x0002, "1" )
1387   PORT_DIPSETTING(      0x0004, "2" )
1388   PORT_DIPSETTING(      0x0000, "3" )
1389   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW1:5,4")
1390   PORT_DIPSETTING(      0x0018, "0" )
1391   PORT_DIPSETTING(      0x0008, "1" )
1392   PORT_DIPSETTING(      0x0010, "2" )
1393   PORT_DIPSETTING(      0x0000, "3" )
1394   PORT_DIPNAME( 0x0020, 0x0020, "Time" )                      PORT_DIPLOCATION("SW1:3")
1395   PORT_DIPSETTING(      0x0020, "60 Seconds" )
1396   PORT_DIPSETTING(      0x0000, "90 Seconds" )
1397   PORT_DIPNAME( 0x00c0, 0x00c0, "Starting Balls" )            PORT_DIPLOCATION("SW1:1,2")
1398   PORT_DIPSETTING(      0x0000, "3" )
1399   PORT_DIPSETTING(      0x00c0, "4" )
1400   PORT_DIPSETTING(      0x0040, "5" )
1401   PORT_DIPSETTING(      0x0080, "6" )
13961402
1397   PORT_START("DSW1")   /* Dip switch bank 1 */
1398   PORT_DIPNAME( 0x01, 0x01, "Winning Rounds" )            PORT_DIPLOCATION("SW1:8")
1399   PORT_DIPSETTING(    0x00, "2" )
1400   PORT_DIPSETTING(    0x01, "3" )
1401   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW1:7,6")
1402   PORT_DIPSETTING(    0x06, "0" )
1403   PORT_DIPSETTING(    0x02, "1" )
1404   PORT_DIPSETTING(    0x04, "2" )
1405   PORT_DIPSETTING(    0x00, "3" )
1406   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW1:5,4")
1407   PORT_DIPSETTING(    0x18, "0" )
1408   PORT_DIPSETTING(    0x08, "1" )
1409   PORT_DIPSETTING(    0x10, "2" )
1410   PORT_DIPSETTING(    0x00, "3" )
1411   PORT_DIPNAME( 0x20, 0x20, "Time" )                      PORT_DIPLOCATION("SW1:3")
1412   PORT_DIPSETTING(    0x20, "60 Seconds" )
1413   PORT_DIPSETTING(    0x00, "90 Seconds" )
1414   PORT_DIPNAME( 0xc0, 0xc0, "Starting Balls" )            PORT_DIPLOCATION("SW1:1,2")
1415   PORT_DIPSETTING(    0x00, "3" )
1416   PORT_DIPSETTING(    0xc0, "4" )
1417   PORT_DIPSETTING(    0x40, "5" )
1418   PORT_DIPSETTING(    0x80, "6" )
1419
1420   PORT_START("DSW2")   /* Dip switch bank 2 */
1421   PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:8" )
1422   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW2:7,6")
1423   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
1424   PORT_DIPSETTING(    0x06, DEF_STR( Normal ) )
1425   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1426   PORT_DIPSETTING(    0x04, DEF_STR( Very_Hard ) )
1427   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW2:5,4,3")
1428   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
1429   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
1430   PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) )
1431   PORT_DIPSETTING(    0x30, DEF_STR( 2C_1C ) )
1432   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
1433   PORT_DIPSETTING(    0x28, DEF_STR( 2C_3C ) )
1434   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
1435   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
1436   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:2")
1437   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1438   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1439   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW2:1")
1440   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1441   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1403   PORT_SERVICE_DIPLOC( 0x0100, IP_ACTIVE_LOW, "SW2:8" )
1404   PORT_DIPNAME( 0x0600, 0x0600, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW2:7,6")
1405   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
1406   PORT_DIPSETTING(      0x0600, DEF_STR( Normal ) )
1407   PORT_DIPSETTING(      0x0200, DEF_STR( Hard ) )
1408   PORT_DIPSETTING(      0x0400, DEF_STR( Very_Hard ) )
1409   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW2:5,4,3")
1410   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
1411   PORT_DIPSETTING(      0x2000, DEF_STR( 4C_1C ) )
1412   PORT_DIPSETTING(      0x1000, DEF_STR( 3C_1C ) )
1413   PORT_DIPSETTING(      0x3000, DEF_STR( 2C_1C ) )
1414   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )
1415   PORT_DIPSETTING(      0x2800, DEF_STR( 2C_3C ) )
1416   PORT_DIPSETTING(      0x1800, DEF_STR( 1C_2C ) )
1417   PORT_DIPSETTING(      0x0800, DEF_STR( 1C_3C ) )
1418   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:2")
1419   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
1420   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1421   PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW2:1")
1422   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1423   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
14421424INPUT_PORTS_END
14431425
14441426static INPUT_PORTS_START( wlstar )
1445   PORT_START("P1")   /* Player 1 controls */
1446   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1447   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1448   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1449   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1450   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1451   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1452   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1453   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1427   PORT_START("PLAYERS")
1428   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1429   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1430   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1431   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1432   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1433   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1434   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1435   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
1436   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1437   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1438   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1439   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1440   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1441   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1442   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1443   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
14541444
1455   PORT_START("P2")   /* Player 2 controls */
1456   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1457   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1458   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1459   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1460   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1461   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1462   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1463   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
1445   PORT_START("SYSTEM")
1446   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1447   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1448   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1449   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1450   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1451   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1452   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1453   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
14641454
1465   PORT_START("SYSTEM")   /* Credits */
1466   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1467   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1468   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1469   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1470   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1471   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1472   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1473   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1455   PORT_START("DSW")
1456   PORT_DIPUNUSED_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:8" )
1457   PORT_DIPUNUSED_DIPLOC( 0x0002, IP_ACTIVE_LOW, "SW1:7" )
1458   PORT_DIPUNUSED_DIPLOC( 0x0004, IP_ACTIVE_LOW, "SW1:6" )
1459   PORT_DIPUNUSED_DIPLOC( 0x0008, IP_ACTIVE_LOW, "SW1:5" )
1460   PORT_DIPNAME( 0x0010, 0x0010, "2 Players Game" )            PORT_DIPLOCATION("SW1:4")
1461   PORT_DIPSETTING(      0x0000, "1 Credit" )
1462   PORT_DIPSETTING(      0x0010, "2 Credits" )
1463   PORT_DIPUNUSED_DIPLOC( 0x0020, IP_ACTIVE_LOW, "SW1:3" )                                 // See notes
1464   PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW1:2,1")
1465   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
1466   PORT_DIPSETTING(      0x00c0, DEF_STR( Normal ) )
1467   PORT_DIPSETTING(      0x0040, DEF_STR( Hard ) )
1468   PORT_DIPSETTING(      0x0080, DEF_STR( Hardest ) )
14741469
1475   PORT_START("DSW1")   /* Dip switch bank 1 */
1476   PORT_DIPUNUSED_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" )
1477   PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW1:7" )
1478   PORT_DIPUNUSED_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW1:6" )
1479   PORT_DIPUNUSED_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW1:5" )
1480   PORT_DIPNAME( 0x10, 0x10, "2 Players Game" )            PORT_DIPLOCATION("SW1:4")
1481   PORT_DIPSETTING(    0x00, "1 Credit" )
1482   PORT_DIPSETTING(    0x10, "2 Credits" )
1483   PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:3" )                                 // See notes
1484   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW1:2,1")
1485   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
1486   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
1487   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
1488   PORT_DIPSETTING(    0x80, DEF_STR( Hardest ) )
1489
1490   PORT_START("DSW2")   /* Dip switch bank 2 */
1491   PORT_DIPNAME( 0x01, 0x01, "Last Inning" )               PORT_DIPLOCATION("SW2:8")     // See notes
1492   PORT_DIPSETTING(    0x00, "9" )
1493   PORT_DIPSETTING(    0x01, "12" )
1494   PORT_DIPNAME( 0x02, 0x02, "VS CPU Game Ends" )          PORT_DIPLOCATION("SW2:7")     // See notes
1495   PORT_DIPSETTING(    0x02, "+10" )
1496   PORT_DIPSETTING(    0x00, "+7" )
1497   PORT_DIPNAME( 0x04, 0x04, "VS Game" )                   PORT_DIPLOCATION("SW2:6")
1498   PORT_DIPSETTING(    0x00, "1 Credit / 2 Innings" )
1499   PORT_DIPSETTING(    0x04, "1 Credit / 3 Innings" )
1500   PORT_DIPNAME( 0x08, 0x08, "Full 2 Players Game" )       PORT_DIPLOCATION("SW2:5")
1501   PORT_DIPSETTING(    0x00, "4 Credits" )
1502   PORT_DIPSETTING(    0x08, "6 Credits" )
1503   PORT_DIPNAME( 0x70, 0x70, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW2:4,3,2")
1504   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
1505   PORT_DIPSETTING(    0x40, DEF_STR( 4C_1C ) )
1506   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1507   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
1508   PORT_DIPSETTING(    0x70, DEF_STR( 1C_1C ) )
1509   PORT_DIPSETTING(    0x50, DEF_STR( 2C_3C ) )
1510   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
1511   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
1512   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW2:1")
1513   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1514   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1470   PORT_DIPNAME( 0x0100, 0x0100, "Last Inning" )               PORT_DIPLOCATION("SW2:8")     // See notes
1471   PORT_DIPSETTING(      0x0000, "9" )
1472   PORT_DIPSETTING(      0x0100, "12" )
1473   PORT_DIPNAME( 0x0200, 0x0200, "VS CPU Game Ends" )          PORT_DIPLOCATION("SW2:7")     // See notes
1474   PORT_DIPSETTING(      0x0200, "+10" )
1475   PORT_DIPSETTING(      0x0000, "+7" )
1476   PORT_DIPNAME( 0x0400, 0x0400, "VS Game" )                   PORT_DIPLOCATION("SW2:6")
1477   PORT_DIPSETTING(      0x0000, "1 Credit / 2 Innings" )
1478   PORT_DIPSETTING(      0x0400, "1 Credit / 3 Innings" )
1479   PORT_DIPNAME( 0x0800, 0x0800, "Full 2 Players Game" )       PORT_DIPLOCATION("SW2:5")
1480   PORT_DIPSETTING(      0x0000, "4 Credits" )
1481   PORT_DIPSETTING(      0x0800, "6 Credits" )
1482   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW2:4,3,2")
1483   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
1484   PORT_DIPSETTING(      0x4000, DEF_STR( 4C_1C ) )
1485   PORT_DIPSETTING(      0x2000, DEF_STR( 3C_1C ) )
1486   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
1487   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_1C ) )
1488   PORT_DIPSETTING(      0x5000, DEF_STR( 2C_3C ) )
1489   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_2C ) )
1490   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_3C ) )
1491   PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW2:1")
1492   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1493   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
15151494INPUT_PORTS_END
15161495
15171496static INPUT_PORTS_START( wondl96 )
1518   PORT_START("P1")   /* Player 1 controls */
1519   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1520   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1521   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1522   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1523   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1524   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1525   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1526   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1497   PORT_START("PLAYERS")
1498   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1499   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1500   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1501   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1502   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1503   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1504   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1505   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
1506   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1507   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1508   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1509   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1510   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1511   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1512   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1513   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
15271514
1528   PORT_START("P2")   /* Player 2 controls */
1529   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1530   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1531   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1532   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1533   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1534   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1535   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1536   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
1515   PORT_START("SYSTEM")
1516   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1517   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1518   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN )      // must be high to avoid endless loops
1519   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1520   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1521   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1522   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1523   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
15371524
1538   PORT_START("SYSTEM")   /* Credits */
1539   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1540   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1541   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )      // must be high to avoid endless loops
1542   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1543   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1544   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1545   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1546   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1525   PORT_START("DSW")
1526   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Free_Play ) )        PORT_DIPLOCATION("SW2:8")
1527   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1528   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1529   PORT_DIPNAME( 0x000e, 0x000e, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW1:7,6,5")  // See notes
1530   PORT_DIPSETTING(      0x000e, "0" )
1531   PORT_DIPSETTING(      0x0006, "1" )
1532   PORT_DIPSETTING(      0x000a, "2" )
1533   PORT_DIPSETTING(      0x0002, "3" )
1534   PORT_DIPSETTING(      0x000c, "4" )
1535   PORT_DIPSETTING(      0x0004, "5" )
1536   PORT_DIPSETTING(      0x0008, "6" )
1537   PORT_DIPSETTING(      0x0000, "7" )
1538   PORT_DIPNAME( 0x0010, 0x0010, "Field Color" )               PORT_DIPLOCATION("SW1:4")     // See notes
1539   PORT_DIPSETTING(      0x0010, "Blue" )
1540   PORT_DIPSETTING(      0x0000, "Green" )
1541   PORT_DIPNAME( 0x0020, 0x0020, "VS CPU Game Ends" )          PORT_DIPLOCATION("SW1:3")     // See notes
1542   PORT_DIPSETTING(      0x0020, "+10" )
1543   PORT_DIPSETTING(      0x0000, "+7" )
1544   PORT_DIPNAME( 0x0040, 0x0040, "VS Game" )                   PORT_DIPLOCATION("SW1:2")
1545   PORT_DIPSETTING(      0x0000, "1 Credit / 2 Innings" )
1546   PORT_DIPSETTING(      0x0040, "1 Credit / 3 Innings" )
1547   PORT_DIPNAME( 0x0080, 0x0000, "Full 2 Players Game" )       PORT_DIPLOCATION("SW1:1")
1548   PORT_DIPSETTING(      0x0080, "4 Credits" )
1549   PORT_DIPSETTING(      0x0000, "6 Credits" )
15471550
1548   PORT_START("DSW1")   /* Dip switch bank 1 */
1549   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Free_Play ) )        PORT_DIPLOCATION("SW2:8")
1550   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1551   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1552   PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW1:7,6,5")  // See notes
1553   PORT_DIPSETTING(    0x0e, "0" )
1554   PORT_DIPSETTING(    0x06, "1" )
1555   PORT_DIPSETTING(    0x0a, "2" )
1556   PORT_DIPSETTING(    0x02, "3" )
1557   PORT_DIPSETTING(    0x0c, "4" )
1558   PORT_DIPSETTING(    0x04, "5" )
1559   PORT_DIPSETTING(    0x08, "6" )
1560   PORT_DIPSETTING(    0x00, "7" )
1561   PORT_DIPNAME( 0x10, 0x10, "Field Color" )               PORT_DIPLOCATION("SW1:4")     // See notes
1562   PORT_DIPSETTING(    0x10, "Blue" )
1563   PORT_DIPSETTING(    0x00, "Green" )
1564   PORT_DIPNAME( 0x20, 0x20, "VS CPU Game Ends" )          PORT_DIPLOCATION("SW1:3")     // See notes
1565   PORT_DIPSETTING(    0x20, "+10" )
1566   PORT_DIPSETTING(    0x00, "+7" )
1567   PORT_DIPNAME( 0x40, 0x40, "VS Game" )                   PORT_DIPLOCATION("SW1:2")
1568   PORT_DIPSETTING(    0x00, "1 Credit / 2 Innings" )
1569   PORT_DIPSETTING(    0x40, "1 Credit / 3 Innings" )
1570   PORT_DIPNAME( 0x80, 0x00, "Full 2 Players Game" )       PORT_DIPLOCATION("SW1:1")
1571   PORT_DIPSETTING(    0x80, "4 Credits" )
1572   PORT_DIPSETTING(    0x00, "6 Credits" )
1573
1574   PORT_START("DSW2")   /* Dip switch bank 2 */
1575   PORT_DIPUNUSED_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:8" )
1576   PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW2:7,6,5")
1577   PORT_DIPSETTING(    0x04, "Level 1" )
1578   PORT_DIPSETTING(    0x08, "Level 2" )
1579   PORT_DIPSETTING(    0x00, "Level 3" )
1580   PORT_DIPSETTING(    0x0e, "Level 4" )
1581   PORT_DIPSETTING(    0x06, "Level 5" )
1582   PORT_DIPSETTING(    0x0a, "Level 6" )
1583   PORT_DIPSETTING(    0x02, "Level 7" )
1584   PORT_DIPSETTING(    0x0c, "Level 8" )
1585   PORT_DIPNAME( 0x70, 0x70, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW2:4,3,2")
1586   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
1587   PORT_DIPSETTING(    0x40, DEF_STR( 4C_1C ) )
1588   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1589   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
1590   PORT_DIPSETTING(    0x70, DEF_STR( 1C_1C ) )
1591   PORT_DIPSETTING(    0x50, DEF_STR( 2C_3C ) )
1592   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
1593   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
1594   PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW2:1" )                                 // See notes
1551   PORT_DIPUNUSED_DIPLOC( 0x0100, IP_ACTIVE_LOW, "SW2:8" )
1552   PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW2:7,6,5")
1553   PORT_DIPSETTING(      0x0400, "Level 1" )
1554   PORT_DIPSETTING(      0x0800, "Level 2" )
1555   PORT_DIPSETTING(      0x0000, "Level 3" )
1556   PORT_DIPSETTING(      0x0e00, "Level 4" )
1557   PORT_DIPSETTING(      0x0600, "Level 5" )
1558   PORT_DIPSETTING(      0x0a00, "Level 6" )
1559   PORT_DIPSETTING(      0x0200, "Level 7" )
1560   PORT_DIPSETTING(      0x0c00, "Level 8" )
1561   PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW2:4,3,2")
1562   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
1563   PORT_DIPSETTING(      0x4000, DEF_STR( 4C_1C ) )
1564   PORT_DIPSETTING(      0x2000, DEF_STR( 3C_1C ) )
1565   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_1C ) )
1566   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_1C ) )
1567   PORT_DIPSETTING(      0x5000, DEF_STR( 2C_3C ) )
1568   PORT_DIPSETTING(      0x3000, DEF_STR( 1C_2C ) )
1569   PORT_DIPSETTING(      0x1000, DEF_STR( 1C_3C ) )
1570   PORT_DIPUNUSED_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW2:1" )                                 // See notes
15951571INPUT_PORTS_END
15961572
15971573static INPUT_PORTS_START( sdfight )
1598   PORT_START("P1")   /* Player 1 controls */
1599   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1600   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1601   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1602   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1603   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1604   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1605   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1606   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1574   PORT_START("PLAYERS")
1575   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1576   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1577   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1578   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1579   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1580   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1581   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1582   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
1583   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1584   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1585   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1586   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1587   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1588   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1589   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1590   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
16071591
1608   PORT_START("P2")   /* Player 2 controls */
1609   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1610   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1611   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1612   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1613   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1614   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1615   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1616   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
1592   PORT_START("SYSTEM")
1593   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1594   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1595   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1596   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1597   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1598   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1599   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1600   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
16171601
1618   PORT_START("SYSTEM")   /* Credits */
1619   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1620   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1621   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1622   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1623   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1624   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1625   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1626   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1602   PORT_START("DSW")
1603   PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:8" ) /* These dips were done from the Test mode screens */
1604   PORT_DIPNAME( 0x000e, 0x000e, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW1:7,6,5")
1605   PORT_DIPSETTING(      0x0004, "Level 1" )
1606   PORT_DIPSETTING(      0x0008, "Level 2" )
1607   PORT_DIPSETTING(      0x0000, "Level 3" )
1608   PORT_DIPSETTING(      0x000e, "Level 4" )
1609   PORT_DIPSETTING(      0x0006, "Level 5" )
1610   PORT_DIPSETTING(      0x000a, "Level 6" )
1611   PORT_DIPSETTING(      0x0002, "Level 7" )
1612   PORT_DIPSETTING(      0x000c, "Level 8" )
1613   PORT_DIPNAME( 0x0070, 0x0070, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW1:4,3,2")
1614   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
1615   PORT_DIPSETTING(      0x0040, DEF_STR( 4C_1C ) )
1616   PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ) )
1617   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_1C ) )
1618   PORT_DIPSETTING(      0x0070, DEF_STR( 1C_1C ) )
1619   PORT_DIPSETTING(      0x0050, DEF_STR( 2C_3C ) )
1620   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
1621   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
1622   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW1:1")
1623   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1624   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
16271625
1628   PORT_START("DSW1")   /* Dip switch bank 1 */
1629   PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" ) /* These dips were done from the Test mode screens */
1630   PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW1:7,6,5")
1631   PORT_DIPSETTING(    0x04, "Level 1" )
1632   PORT_DIPSETTING(    0x08, "Level 2" )
1633   PORT_DIPSETTING(    0x00, "Level 3" )
1634   PORT_DIPSETTING(    0x0e, "Level 4" )
1635   PORT_DIPSETTING(    0x06, "Level 5" )
1636   PORT_DIPSETTING(    0x0a, "Level 6" )
1637   PORT_DIPSETTING(    0x02, "Level 7" )
1638   PORT_DIPSETTING(    0x0c, "Level 8" )
1639   PORT_DIPNAME( 0x70, 0x70, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW1:4,3,2")
1640   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
1641   PORT_DIPSETTING(    0x40, DEF_STR( 4C_1C ) )
1642   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1643   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
1644   PORT_DIPSETTING(    0x70, DEF_STR( 1C_1C ) )
1645   PORT_DIPSETTING(    0x50, DEF_STR( 2C_3C ) )
1646   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
1647   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
1648   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW1:1")
1649   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1650   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1651
1652   PORT_START("DSW2")   /* Dip switch bank 2 */
1653   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Free_Play ) )        PORT_DIPLOCATION("SW2:8") /* Only Free Play shows in Test Mode */
1654   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1655   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1656   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:7")
1657   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1658   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1659   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:6")
1660   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1661   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1662   PORT_DIPNAME( 0x08, 0x08, "Rounds to Win" )             PORT_DIPLOCATION("SW2:5") /* Does not show up in Test Mode screen */
1663   PORT_DIPSETTING(    0x08, "2 Rounds" )
1664   PORT_DIPSETTING(    0x00, "3 Rounds" )
1665   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:4")
1666   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1667   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1668   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:3")
1669   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1670   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1671   PORT_DIPNAME( 0xc0, 0xc0, "Time" )                      PORT_DIPLOCATION("SW2:2,1") /* Does not show up in Test Mode screen */
1672   PORT_DIPSETTING(    0x40, "30" )
1673   PORT_DIPSETTING(    0x80, "50" )
1674   PORT_DIPSETTING(    0xc0, "70" )
1675   PORT_DIPSETTING(    0x00, "90" )
1626   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Free_Play ) )        PORT_DIPLOCATION("SW2:8") /* Only Free Play shows in Test Mode */
1627   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
1628   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1629   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:7")
1630   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
1631   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1632   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:6")
1633   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
1634   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1635   PORT_DIPNAME( 0x0800, 0x0800, "Rounds to Win" )             PORT_DIPLOCATION("SW2:5") /* Does not show up in Test Mode screen */
1636   PORT_DIPSETTING(      0x0800, "2 Rounds" )
1637   PORT_DIPSETTING(      0x0000, "3 Rounds" )
1638   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:4")
1639   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
1640   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1641   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW2:3")
1642   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
1643   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1644   PORT_DIPNAME( 0xc000, 0xc000, "Time" )                      PORT_DIPLOCATION("SW2:2,1") /* Does not show up in Test Mode screen */
1645   PORT_DIPSETTING(      0x4000, "30" )
1646   PORT_DIPSETTING(      0x8000, "50" )
1647   PORT_DIPSETTING(      0xc000, "70" )
1648   PORT_DIPSETTING(      0x0000, "90" )
16761649INPUT_PORTS_END
16771650
16781651static INPUT_PORTS_START( bcstory )
1679   PORT_START("P1")   /* Player 1 controls */
1680   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1681   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1682   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1683   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1684   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1685   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1686   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1687   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1652   PORT_START("PLAYERS")
1653   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1654   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1655   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1656   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1657   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1658   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1659   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1660   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
1661   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1662   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1663   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1664   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1665   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1666   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1667   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1668   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
16881669
1689   PORT_START("P2")   /* Player 2 controls */
1690   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1691   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1692   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1693   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1694   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1695   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1696   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1697   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
1670   PORT_START("SYSTEM")
1671   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1672   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1673   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1674   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1675   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1676   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1677   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1678   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
16981679
1699   PORT_START("SYSTEM")   /* Credits */
1700   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1701   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1702   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1703   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1704   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1705   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1706   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1707   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1680   PORT_START("DSW")
1681   PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:8" )
1682   PORT_DIPNAME( 0x000e, 0x000e, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW1:7,6,5")
1683   PORT_DIPSETTING(      0x0004, "Level 1" )
1684   PORT_DIPSETTING(      0x0008, "Level 2" )
1685   PORT_DIPSETTING(      0x0000, "Level 3" )
1686   PORT_DIPSETTING(      0x000e, "Level 4" )
1687   PORT_DIPSETTING(      0x0006, "Level 5" )
1688   PORT_DIPSETTING(      0x000a, "Level 6" )
1689   PORT_DIPSETTING(      0x0002, "Level 7" )
1690   PORT_DIPSETTING(      0x000c, "Level 8" )
1691   PORT_DIPNAME( 0x0070, 0x0070, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW1:4,3,2")
1692   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
1693   PORT_DIPSETTING(      0x0040, DEF_STR( 4C_1C ) )
1694   PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ) )
1695   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_1C ) )
1696   PORT_DIPSETTING(      0x0070, DEF_STR( 1C_1C ) )
1697   PORT_DIPSETTING(      0x0050, DEF_STR( 2C_3C ) )
1698   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
1699   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
1700   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW1:1")
1701   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1702   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
17081703
1709   PORT_START("DSW1")   /* Dip switch bank 1 */
1710   PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" )
1711   PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW1:7,6,5")
1712   PORT_DIPSETTING(    0x04, "Level 1" )
1713   PORT_DIPSETTING(    0x08, "Level 2" )
1714   PORT_DIPSETTING(    0x00, "Level 3" )
1715   PORT_DIPSETTING(    0x0e, "Level 4" )
1716   PORT_DIPSETTING(    0x06, "Level 5" )
1717   PORT_DIPSETTING(    0x0a, "Level 6" )
1718   PORT_DIPSETTING(    0x02, "Level 7" )
1719   PORT_DIPSETTING(    0x0c, "Level 8" )
1720   PORT_DIPNAME( 0x70, 0x70, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW1:4,3,2")
1721   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
1722   PORT_DIPSETTING(    0x40, DEF_STR( 4C_1C ) )
1723   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1724   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
1725   PORT_DIPSETTING(    0x70, DEF_STR( 1C_1C ) )
1726   PORT_DIPSETTING(    0x50, DEF_STR( 2C_3C ) )
1727   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
1728   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
1729   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW1:1")
1730   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1731   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1732
1733   PORT_START("DSW2")   /* Dip switch bank 2 */
1734   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Free_Play ) )       PORT_DIPLOCATION("SW2:8")
1735   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1736   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1737   PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW2:7" )                                 // See notes
1738   PORT_DIPUNUSED_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW2:6" )                                 // See notes
1739   PORT_DIPUNUSED_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW2:5" )
1740   PORT_DIPUNUSED_DIPLOC( 0x10, IP_ACTIVE_LOW, "SW2:4" )
1741   PORT_DIPNAME( 0x20, 0x00, "Event Selection" )           PORT_DIPLOCATION("SW2:3")     // See notes
1742   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1743   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1744   PORT_DIPNAME( 0x40, 0x40, "Control Type" )              PORT_DIPLOCATION("SW2:2")     // See notes
1745   PORT_DIPSETTING(    0x40, "Joystick + Buttons" )
1746   PORT_DIPSETTING(    0x00, "Buttons Only" )
1747   PORT_DIPNAME( 0x80, 0x80, "Debug Mode" )                PORT_DIPLOCATION("SW2:1")     // See notes
1748   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1749   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1704   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Free_Play ) )       PORT_DIPLOCATION("SW2:8")
1705   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
1706   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1707   PORT_DIPUNUSED_DIPLOC( 0x0200, IP_ACTIVE_LOW, "SW2:7" )                                 // See notes
1708   PORT_DIPUNUSED_DIPLOC( 0x0400, IP_ACTIVE_LOW, "SW2:6" )                                 // See notes
1709   PORT_DIPUNUSED_DIPLOC( 0x0800, IP_ACTIVE_LOW, "SW2:5" )
1710   PORT_DIPUNUSED_DIPLOC( 0x1000, IP_ACTIVE_LOW, "SW2:4" )
1711   PORT_DIPNAME( 0x2000, 0x0000, "Event Selection" )           PORT_DIPLOCATION("SW2:3")     // See notes
1712   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
1713   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1714   PORT_DIPNAME( 0x4000, 0x4000, "Control Type" )              PORT_DIPLOCATION("SW2:2")     // See notes
1715   PORT_DIPSETTING(      0x4000, "Joystick + Buttons" )
1716   PORT_DIPSETTING(      0x0000, "Buttons Only" )
1717   PORT_DIPNAME( 0x8000, 0x8000, "Debug Mode" )                PORT_DIPLOCATION("SW2:1")     // See notes
1718   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1719   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
17501720INPUT_PORTS_END
17511721
17521722static INPUT_PORTS_START( semibase )
1753   PORT_START("P1")   /* Player 1 controls */
1754   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1755   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1756   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1757   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1758   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1759   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1760   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1761   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1723   PORT_START("PLAYERS")
1724   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1725   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1726   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1727   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1728   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1729   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1730   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1731   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
1732   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1733   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1734   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1735   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1736   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1737   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1738   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1739   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
17621740
1763   PORT_START("P2")   /* Player 2 controls */
1764   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1765   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1766   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1767   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1768   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1769   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1770   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1771   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
1741   PORT_START("SYSTEM")
1742   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1743   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1744   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )                                            // See notes
1745   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )                                            // See notes
1746   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1747   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1748   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1749   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
17721750
1773   PORT_START("SYSTEM")   /* Credits */
1774   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1775   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1776   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )                                            // See notes
1777   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 )                                            // See notes
1778   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1779   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1780   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1781   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1751   PORT_START("DSW")
1752   PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:8" )
1753   PORT_DIPNAME( 0x000e, 0x000e, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW1:7,6,5")
1754   PORT_DIPSETTING(      0x0004, "Level 1" )
1755   PORT_DIPSETTING(      0x0008, "Level 2" )
1756   PORT_DIPSETTING(      0x0000, "Level 3" )
1757   PORT_DIPSETTING(      0x000e, "Level 4" )
1758   PORT_DIPSETTING(      0x0006, "Level 5" )
1759   PORT_DIPSETTING(      0x000a, "Level 6" )
1760   PORT_DIPSETTING(      0x0002, "Level 7" )
1761   PORT_DIPSETTING(      0x000c, "Level 8" )
1762   PORT_DIPNAME( 0x0070, 0x0070, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW1:4,3,2")
1763   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
1764   PORT_DIPSETTING(      0x0040, DEF_STR( 4C_1C ) )
1765   PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ) )
1766   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_1C ) )
1767   PORT_DIPSETTING(      0x0070, DEF_STR( 1C_1C ) )
1768   PORT_DIPSETTING(      0x0050, DEF_STR( 2C_3C ) )
1769   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
1770   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
1771   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW1:1")
1772   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1773   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
17821774
1783   PORT_START("DSW1")   /* Dip switch bank 1 */
1784   PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" )
1785   PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW1:7,6,5")
1786   PORT_DIPSETTING(    0x04, "Level 1" )
1787   PORT_DIPSETTING(    0x08, "Level 2" )
1788   PORT_DIPSETTING(    0x00, "Level 3" )
1789   PORT_DIPSETTING(    0x0e, "Level 4" )
1790   PORT_DIPSETTING(    0x06, "Level 5" )
1791   PORT_DIPSETTING(    0x0a, "Level 6" )
1792   PORT_DIPSETTING(    0x02, "Level 7" )
1793   PORT_DIPSETTING(    0x0c, "Level 8" )
1794   PORT_DIPNAME( 0x70, 0x70, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW1:4,3,2")
1795   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
1796   PORT_DIPSETTING(    0x40, DEF_STR( 4C_1C ) )
1797   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1798   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
1799   PORT_DIPSETTING(    0x70, DEF_STR( 1C_1C ) )
1800   PORT_DIPSETTING(    0x50, DEF_STR( 2C_3C ) )
1801   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
1802   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
1803   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW1:1")
1804   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1805   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1806
1807   PORT_START("DSW2")   /* Dip switch bank 2 */
1808   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Free_Play ) )       PORT_DIPLOCATION("SW2:8")
1809   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1810   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1811   PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW2:7" )                                 // See notes
1812   PORT_DIPUNUSED_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW2:6" )                                 // See notes
1813   PORT_DIPUNUSED_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW2:5" )
1814   PORT_DIPUNUSED_DIPLOC( 0x10, IP_ACTIVE_LOW, "SW2:4" )                                 // See notes
1815   PORT_DIPNAME( 0x20, 0x20, "VS CPU Game Ends" )          PORT_DIPLOCATION("SW2:3")     // See notes
1816   PORT_DIPSETTING(    0x20, "+10" )
1817   PORT_DIPSETTING(    0x00, "+7" )
1818   PORT_DIPNAME( 0x40, 0x40, "VS Game" )                   PORT_DIPLOCATION("SW2:2")     // See notes
1819   PORT_DIPSETTING(    0x40, "1 Credit / 2 Innings" )
1820   PORT_DIPSETTING(    0x00, "1 Credit / 3 Innings" )
1821   PORT_DIPNAME( 0x80, 0x80, "Full 2 Players Game" )       PORT_DIPLOCATION("SW2:1")     // See notes
1822   PORT_DIPSETTING(    0x00, "4 Credits" )
1823   PORT_DIPSETTING(    0x80, "6 Credits" )
1775   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Free_Play ) )       PORT_DIPLOCATION("SW2:8")
1776   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
1777   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1778   PORT_DIPUNUSED_DIPLOC( 0x0200, IP_ACTIVE_LOW, "SW2:7" )                                 // See notes
1779   PORT_DIPUNUSED_DIPLOC( 0x0400, IP_ACTIVE_LOW, "SW2:6" )                                 // See notes
1780   PORT_DIPUNUSED_DIPLOC( 0x0800, IP_ACTIVE_LOW, "SW2:5" )
1781   PORT_DIPUNUSED_DIPLOC( 0x1000, IP_ACTIVE_LOW, "SW2:4" )                                 // See notes
1782   PORT_DIPNAME( 0x2000, 0x2000, "VS CPU Game Ends" )          PORT_DIPLOCATION("SW2:3")     // See notes
1783   PORT_DIPSETTING(      0x2000, "+10" )
1784   PORT_DIPSETTING(      0x0000, "+7" )
1785   PORT_DIPNAME( 0x4000, 0x4000, "VS Game" )                   PORT_DIPLOCATION("SW2:2")     // See notes
1786   PORT_DIPSETTING(      0x4000, "1 Credit / 2 Innings" )
1787   PORT_DIPSETTING(      0x0000, "1 Credit / 3 Innings" )
1788   PORT_DIPNAME( 0x8000, 0x8000, "Full 2 Players Game" )       PORT_DIPLOCATION("SW2:1")     // See notes
1789   PORT_DIPSETTING(      0x0000, "4 Credits" )
1790   PORT_DIPSETTING(      0x8000, "6 Credits" )
18241791INPUT_PORTS_END
18251792
18261793static INPUT_PORTS_START( dquizgo )
1827   PORT_START("P1")   /* Player 1 controls */
1828   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1829   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1830   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1831   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1832   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1833   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1834   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1835   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1794   PORT_START("PLAYERS")
1795   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1796   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1797   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1798   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1799   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1800   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1801   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1802   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
18361803
1837   PORT_START("P2")   /* Player 2 controls */
1838   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1839   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1840   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1841   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1842   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1843   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1844   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1845   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
1804   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1805   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1806   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1807   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1808   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1809   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1810   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1811   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
18461812
1847   PORT_START("SYSTEM")   /* Credits */
1848   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1849   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1850   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1851   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1852   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1853   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1854   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1855   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1813   PORT_START("SYSTEM")
1814   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1815   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1816   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1817   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )       // to be confirmed
1818   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1819   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1820   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1821   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
18561822
1857   PORT_START("DSW1")   /* Dip switch bank 1 */
1858   PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" )
1859   PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW1:7,6,5")
1860   PORT_DIPSETTING(    0x04, "Level 1" )
1861   PORT_DIPSETTING(    0x08, "Level 2" )
1862   PORT_DIPSETTING(    0x00, "Level 3" )
1863   PORT_DIPSETTING(    0x0e, "Level 4" )
1864   PORT_DIPSETTING(    0x06, "Level 5" )
1865   PORT_DIPSETTING(    0x0a, "Level 6" )
1866   PORT_DIPSETTING(    0x02, "Level 7" )
1867   PORT_DIPSETTING(    0x0c, "Level 8" )
1868   PORT_DIPNAME( 0x70, 0x70, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW1:4,3,2")
1869//  PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
1870//  PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1871   PORT_DIPSETTING(    0x40, DEF_STR( 3C_1C ) )
1872   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
1873   PORT_DIPSETTING(    0x70, DEF_STR( 1C_1C ) )
1874   PORT_DIPSETTING(    0x50, DEF_STR( 2C_3C ) )
1875   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
1876   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
1877   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW1:1")
1878   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1879   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1823   PORT_START("DSW")
1824   PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:8" )
1825   PORT_DIPNAME( 0x000e, 0x000e, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SW1:7,6,5")
1826   PORT_DIPSETTING(      0x0004, "Level 1" )
1827   PORT_DIPSETTING(      0x0008, "Level 2" )
1828   PORT_DIPSETTING(      0x0000, "Level 3" )
1829   PORT_DIPSETTING(      0x000e, "Level 4" )
1830   PORT_DIPSETTING(      0x0006, "Level 5" )
1831   PORT_DIPSETTING(      0x000a, "Level 6" )
1832   PORT_DIPSETTING(      0x0002, "Level 7" )
1833   PORT_DIPSETTING(      0x000c, "Level 8" )
1834   PORT_DIPNAME( 0x0070, 0x0070, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SW1:4,3,2")
1835//  PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
1836//  PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ) )
1837   PORT_DIPSETTING(      0x0040, DEF_STR( 3C_1C ) )
1838   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_1C ) )
1839   PORT_DIPSETTING(      0x0070, DEF_STR( 1C_1C ) )
1840   PORT_DIPSETTING(      0x0050, DEF_STR( 2C_3C ) )
1841   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
1842   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_3C ) )
1843   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW1:1")
1844   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1845   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
18801846
1881   PORT_START("DSW2")   /* Dip switch bank 2 */
1882   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Free_Play ) )       PORT_DIPLOCATION("SW2:8")     // See notes
1883   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1884   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1885   PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW2:7" )
1886   PORT_DIPUNUSED_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW2:6" )
1887   PORT_DIPUNUSED_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW2:5" )
1888   PORT_DIPUNUSED_DIPLOC( 0x10, IP_ACTIVE_LOW, "SW2:4" )
1889   PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW2:3" )
1890   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )            PORT_DIPLOCATION("SW2:2,1")   // See notes
1891   PORT_DIPSETTING(    0x00, "2" )
1892   PORT_DIPSETTING(    0xc0, "3" )
1893   PORT_DIPSETTING(    0x40, "4" )
1894   PORT_DIPSETTING(    0x80, "5" )
1847   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Free_Play ) )       PORT_DIPLOCATION("SW2:8")     // See notes
1848   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
1849   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1850   PORT_DIPUNUSED_DIPLOC( 0x0200, IP_ACTIVE_LOW, "SW2:7" )
1851   PORT_DIPUNUSED_DIPLOC( 0x0400, IP_ACTIVE_LOW, "SW2:6" )
1852   PORT_DIPUNUSED_DIPLOC( 0x0800, IP_ACTIVE_LOW, "SW2:5" )
1853   PORT_DIPUNUSED_DIPLOC( 0x1000, IP_ACTIVE_LOW, "SW2:4" )
1854   PORT_DIPUNUSED_DIPLOC( 0x2000, IP_ACTIVE_LOW, "SW2:3" )
1855   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) )            PORT_DIPLOCATION("SW2:2,1")   // See notes
1856   PORT_DIPSETTING(      0x0000, "2" )
1857   PORT_DIPSETTING(      0xc000, "3" )
1858   PORT_DIPSETTING(      0x4000, "4" )
1859   PORT_DIPSETTING(      0x8000, "5" )
18951860INPUT_PORTS_END
18961861
18971862static INPUT_PORTS_START( jumppop )
1898   PORT_START("PLAYERS")   /* Controls */
1863   PORT_START("PLAYERS")
18991864   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
19001865   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
19011866   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
19131878   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
19141879   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
19151880
1916   PORT_START("SYSTEM")   /* Coins / Start Buttons */
1881   PORT_START("SYSTEM")
19171882   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
19181883   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
19191884   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
19201885   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 )
19211886   PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN )
19221887
1923   PORT_START("DSW")   /* Dip switches */
1888   PORT_START("DSW")
19241889   PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SWA:1" )
19251890   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) )  PORT_DIPLOCATION("SWA:2")
19261891   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
src/mame/drivers/olibochu.c
r3115r3116
180180static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
181181   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
182182   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
183   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
184   AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r)
185   AM_RANGE(0xa002, 0xa002) AM_READ(input_port_2_r)
186   AM_RANGE(0xa003, 0xa003) AM_READ(input_port_3_r)
187   AM_RANGE(0xa004, 0xa004) AM_READ(input_port_4_r)
188   AM_RANGE(0xa005, 0xa005) AM_READ(input_port_5_r)
183   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
184   AM_RANGE(0xa001, 0xa001) AM_READ_PORT("IN1")
185   AM_RANGE(0xa002, 0xa002) AM_READ_PORT("IN2")
186   AM_RANGE(0xa003, 0xa003) AM_READ_PORT("DSW0")
187   AM_RANGE(0xa004, 0xa004) AM_READ_PORT("DSW1")
188   AM_RANGE(0xa005, 0xa005) AM_READ_PORT("DSW2")
189189   AM_RANGE(0xf000, 0xffff) AM_READ(SMH_RAM)
190190ADDRESS_MAP_END
191191
src/mame/drivers/scotrsht.c
r3115r3116
5454   AM_RANGE(0x3000, 0x3000) AM_WRITE(scotrsht_palettebank_w)
5555   AM_RANGE(0x3100, 0x3100) AM_WRITE(scotrsht_soundlatch_w)
5656   AM_RANGE(0x3200, 0x3200) AM_WRITE(SMH_NOP) /* it writes 0, 1 */
57   AM_RANGE(0x3100, 0x3100) AM_READ(input_port_4_r) /* DSW1 */
58   AM_RANGE(0x3200, 0x3200) AM_READ(input_port_5_r) /* DSW2 */
59   AM_RANGE(0x3300, 0x3300) AM_READ(input_port_0_r) /* coins, start */
60   AM_RANGE(0x3301, 0x3301) AM_READ(input_port_1_r) /* joy1 */
61   AM_RANGE(0x3302, 0x3302) AM_READ(input_port_2_r) /* joy2 */
62   AM_RANGE(0x3303, 0x3303) AM_READ(input_port_3_r) /* DSW0 */
57   AM_RANGE(0x3100, 0x3100) AM_READ_PORT("DSW2")
58   AM_RANGE(0x3200, 0x3200) AM_READ_PORT("DSW3")
59   AM_RANGE(0x3300, 0x3300) AM_READ_PORT("SYSTEM")
60   AM_RANGE(0x3301, 0x3301) AM_READ_PORT("P1")
61   AM_RANGE(0x3302, 0x3302) AM_READ_PORT("P2")
62   AM_RANGE(0x3303, 0x3303) AM_READ_PORT("DSW1")
6363   AM_RANGE(0x3300, 0x3300) AM_WRITE(watchdog_reset_w) /* watchdog */
6464    AM_RANGE(0x4000, 0xffff) AM_ROM
6565ADDRESS_MAP_END
r3115r3116
7777ADDRESS_MAP_END
7878
7979static INPUT_PORTS_START( scotrsht )
80   PORT_START("SYSTEM")   /* IN0 - $3300 */
80   PORT_START("SYSTEM")   /* $3300 */
8181   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
8282   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
8383   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
8585   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
8686   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
8787
88   PORT_START("P1")   /* IN1 - $3301 */
88   PORT_START("P1")      /* $3301 */
8989   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
9090   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
9191   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
r3115r3116
9494   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
9595   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
9696
97   PORT_START("P2")   /* IN2 - $3302 */
97   PORT_START("P2")      /* $3302 */
9898   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
9999   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
100100   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
103103   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
104104   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
105105
106   PORT_START("DSW1")   /* DSW0  - $3303 */
106   PORT_START("DSW1")      /* $3303 */
107107   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
108108   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
109109   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
139139   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
140140   PORT_DIPSETTING(    0x00, "Invalid" )
141141
142   PORT_START("DSW2")   /* DSW1  - $3100 */
142   PORT_START("DSW2")      /* $3100 */
143143   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
144144   PORT_DIPSETTING(    0x03, "2" )
145145   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
163163   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
164164   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
165165
166   PORT_START("DSW3")   /* DSW2  - $3200 */
166   PORT_START("DSW3")      /* $3200 */
167167   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
168168   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
169169   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
src/mame/drivers/taito_z.c
r3115r3116
28772877   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
28782878
28792879   PORT_START("STICKX1")
2880   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(22) PORT_REVERSE PORT_PLAYER(1)
2880   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(13) PORT_CENTERDELTA(0) PORT_REVERSE PORT_PLAYER(1)
28812881
28822882   PORT_START("STICKY1")
2883   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(22) PORT_PLAYER(1)
2883   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(13) PORT_CENTERDELTA(0) PORT_PLAYER(1)
28842884
28852885   PORT_START("STICKX2")
2886   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(22) PORT_REVERSE PORT_PLAYER(2)
2886   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(13) PORT_CENTERDELTA(0) PORT_REVERSE PORT_PLAYER(2)
28872887
28882888   PORT_START("STICKY2")
2889   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(22) PORT_PLAYER(2)
2889   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(13) PORT_CENTERDELTA(0) PORT_PLAYER(2)
28902890INPUT_PORTS_END
28912891
28922892static INPUT_PORTS_START( dblaxle )
src/mame/drivers/phoenix.c
r3115r3116
7878   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
7979   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
8080   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
81   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(player_input_r, 0)
81   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(player_input_r, NULL)
8282
8383   PORT_START("DSW0")
8484   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )            PORT_DIPLOCATION( "SW1:1,2" )
r3115r3116
161161   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
162162   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 )
163163   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
164   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(player_input_r, 0)
164   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(player_input_r, NULL)
165165
166166   PORT_START("DSW0")
167167   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )            PORT_DIPLOCATION( "SW1:1,2" )
r3115r3116
291291   PORT_INCLUDE( phoenix )
292292
293293   PORT_MODIFY("IN0")
294   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(pleiads_protection_r, 0)     /* Protection. See 0x0552 */
294   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(pleiads_protection_r, NULL)     /* Protection. See 0x0552 */
295295
296296   PORT_MODIFY("DSW0")
297297   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION( "SW1:7" )
src/mame/drivers/playch10.c
r3115r3116
389389
390390static ADDRESS_MAP_START( bios_io_map, ADDRESS_SPACE_IO, 8 )
391391   ADDRESS_MAP_GLOBAL_MASK(0xff)
392   AM_RANGE(0x00, 0x00) AM_READWRITE(pc10_port_0_r, pc10_SDCS_w)
392   AM_RANGE(0x00, 0x00) AM_READ_PORT("BIOS") AM_WRITE(pc10_SDCS_w)
393393   AM_RANGE(0x01, 0x01) AM_READ_PORT("SW1") AM_WRITE(pc10_CNTRLMASK_w)
394394   AM_RANGE(0x02, 0x02) AM_READ_PORT("SW2") AM_WRITE(pc10_DISPMASK_w)
395395   AM_RANGE(0x03, 0x03) AM_READWRITE(pc10_detectclr_r, pc10_SOUNDMASK_w)
r3115r3116
423423    PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Channel Select") PORT_CODE(KEYCODE_0)
424424    PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Enter") PORT_CODE(KEYCODE_MINUS)
425425    PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Reset") PORT_CODE(KEYCODE_EQUALS)
426    PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) // INT Detect
426    PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(pc10_int_detect_r, NULL)   // INT Detect
427427    PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
428428    PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
429429    PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE1 )
src/mame/drivers/cyberbal.c
r3115r3116
3636
3737static void update_interrupts(running_machine *machine)
3838{
39   int newstate1 = 0;
40   int newstate2 = 0;
41
42   if (atarigen_sound_int_state)
43      newstate1 |= 1;
44   if (atarigen_video_int_state)
45      newstate2 |= 1;
46
47   if (newstate1)
48      cpunum_set_input_line(machine, 0, newstate1, ASSERT_LINE);
49   else
50      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
51
52   if (newstate2)
53      cpunum_set_input_line(machine, 2, newstate2, ASSERT_LINE);
54   else
55      cpunum_set_input_line(machine, 2, 7, CLEAR_LINE);
39   cpunum_set_input_line(machine, 0, 1, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
40   cpunum_set_input_line(machine, 2, 1, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
5641}
5742
5843
r3115r3116
7358
7459static void cyberb2p_update_interrupts(running_machine *machine)
7560{
76   int newstate = 0;
77
78   if (atarigen_video_int_state)
79      newstate |= 1;
80   if (atarigen_sound_int_state)
81      newstate |= 3;
82
83   if (newstate)
84      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
85   else
86      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
61   cpunum_set_input_line(machine, 0, 1, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
62   cpunum_set_input_line(machine, 0, 3, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
8763}
8864
8965
src/mame/drivers/safarir.c
r3115r3116
206206   AM_RANGE(0x2c00, 0x2cff) AM_MIRROR(0x03ff) AM_READWRITE(SMH_NOP, SMH_RAM) AM_BASE(&bg_scroll)
207207   AM_RANGE(0x3000, 0x30ff) AM_MIRROR(0x03ff) AM_WRITENOP   /* goes to SN76477 */
208208   AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_WRITENOP    /* cleared at the beginning */
209   AM_RANGE(0x3800, 0x38ff) AM_MIRROR(0x03ff) AM_READWRITE(input_port_0_r, SMH_NOP)
210   AM_RANGE(0x3c00, 0x3cff) AM_MIRROR(0x03ff) AM_READWRITE(input_port_1_r, SMH_NOP)
209   AM_RANGE(0x3800, 0x38ff) AM_MIRROR(0x03ff) AM_READ_PORT("INPUTS") AM_WRITENOP
210   AM_RANGE(0x3c00, 0x3cff) AM_MIRROR(0x03ff) AM_READ_PORT("DSW") AM_WRITENOP
211211ADDRESS_MAP_END
212212
213213
r3115r3116
219219 *************************************/
220220
221221static INPUT_PORTS_START( safarir )
222   PORT_START("INPUTS")   /* IN0 */
222   PORT_START("INPUTS")
223223   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
224224   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
225225   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
r3115r3116
229229   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
230230   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
231231
232   PORT_START("DSW")   /* DSW0 */
232   PORT_START("DSW")
233233   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
234234   PORT_DIPSETTING(    0x00, "3" )
235235   PORT_DIPSETTING(    0x01, "4" )
src/mame/drivers/rastan.c
r3115r3116
170170VIDEO_UPDATE( rastan );
171171
172172
173static int adpcm_pos;
174static int adpcm_data;
175
176
173177static WRITE8_HANDLER( rastan_bankswitch_w )
174178{
175179   int offs;
r3115r3116
182186}
183187
184188
185static int adpcm_pos;
186
187189static void rastan_msm5205_vck(running_machine *machine, int chip)
188190{
189   static int adpcm_data = -1;
190
191191   if (adpcm_data != -1)
192192   {
193193      msm5205_data_w(0, adpcm_data & 0x0f);
r3115r3116
225225   AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
226226   AM_RANGE(0x350008, 0x350009) AM_WRITE(SMH_NOP)   /* 0 only (often) ? */
227227   AM_RANGE(0x380000, 0x380001) AM_WRITE(rastan_spritectrl_w)   /* sprite palette bank, coin counters & lockout */
228   AM_RANGE(0x390000, 0x390001) AM_READ(input_port_0_word_r)
229   AM_RANGE(0x390002, 0x390003) AM_READ(input_port_1_word_r)
230   AM_RANGE(0x390004, 0x390005) AM_READ(input_port_2_word_r)
231   AM_RANGE(0x390006, 0x390007) AM_READ(input_port_3_word_r)
232   AM_RANGE(0x390008, 0x390009) AM_READ(input_port_4_word_r)
233   AM_RANGE(0x39000a, 0x39000b) AM_READ(input_port_5_word_r)
228   AM_RANGE(0x390000, 0x390001) AM_READ_PORT("P1")
229   AM_RANGE(0x390002, 0x390003) AM_READ_PORT("P2")
230   AM_RANGE(0x390004, 0x390005) AM_READ_PORT("SPECIAL")
231   AM_RANGE(0x390006, 0x390007) AM_READ_PORT("SYSTEM")
232   AM_RANGE(0x390008, 0x390009) AM_READ_PORT("DSWA")
233   AM_RANGE(0x39000a, 0x39000b) AM_READ_PORT("DSWB")
234234   AM_RANGE(0x3c0000, 0x3c0001) AM_WRITE(watchdog_reset16_w)
235235   AM_RANGE(0x3e0000, 0x3e0001) AM_READWRITE(SMH_NOP, taitosound_port16_lsb_w)
236236   AM_RANGE(0x3e0002, 0x3e0003) AM_READWRITE(taitosound_comm16_lsb_r, taitosound_comm16_lsb_w)
r3115r3116
258258
259259
260260static INPUT_PORTS_START( rastan )
261   PORT_START("IN0")
261   PORT_START("P1")
262262   TAITO_JOY_UDLR_2_BUTTONS( 1 )
263263
264   PORT_START("IN1")
264   PORT_START("P2")
265265   TAITO_JOY_UDLR_2_BUTTONS( 2 )
266266
267   PORT_START("IN2")
268   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
269   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
270   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
271   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
267   PORT_START("SYSTEM")
268   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
269   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
270   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
271   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
272   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
273   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
274   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
275   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
276
277   PORT_START("SPECIAL")
278   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
279   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
280   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
281   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
272282   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL )                // from PC050 (coin A gets locked if 0)
273283   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL )                // from PC050 (coin B gets locked if 0)
274284   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )                // from PC050 (above 2 bits not checked when 0)
275   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
285   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
276286
277   PORT_START("IN3")
278   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_SERVICE1 )
279   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
280   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )
281   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
282   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
283   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
284   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
285   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
286
287287   /* 0x390008 -> 0x10c018 ($18,A5) */
288288   PORT_START("DSWA")
289289   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
r3115r3116
373373   MSM5205_S48_4B      /* 8 kHz */
374374};
375375
376static MACHINE_RESET( rastan )
377{
378   adpcm_pos = 0;
379   adpcm_data = -1;
380}
376381
377382
378383static MACHINE_DRIVER_START( rastan )
r3115r3116
401406   MDRV_VIDEO_START(rastan)
402407   MDRV_VIDEO_UPDATE(rastan)
403408
409   MDRV_MACHINE_RESET(rastan)
410
404411   /* sound hardware */
405412   MDRV_SPEAKER_STANDARD_MONO("mono")
406413
src/mame/drivers/gijoe.c
r3115r3116
9696   /* bit 8  is EEPROM data */
9797   /* bit 9  is EEPROM ready */
9898   /* bit 11 is service button */
99   res = (eeprom_read_bit()<<8) | input_port_read(machine, "START");
99   res = input_port_read(machine, "START");
100100
101101   if (init_eeprom_count)
102102   {
r3115r3116
274274   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_START2 )
275275   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_START3 )
276276   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_START4 )
277   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL )  // EEPROM data
278   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_SPECIAL )  // EEPROM ready (always 1)
277   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   // EEPROM data
278   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_SPECIAL )   // EEPROM ready (always 1)
279279   PORT_SERVICE_NO_TOGGLE( 0x0800, IP_ACTIVE_LOW )
280280
281281   PORT_START("SYSTEM")
src/mame/drivers/tigeroad.c
r3115r3116
176176   AM_RANGE(0x000000, 0x03ffff) AM_ROM
177177   AM_RANGE(0xfe0800, 0xfe0cff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
178178   AM_RANGE(0xfe0d00, 0xfe1807) AM_RAM      /* still part of OBJ RAM */
179   AM_RANGE(0xfe4000, 0xfe4001) AM_READWRITE(input_port_0_word_r, tigeroad_videoctrl_w)   /* char bank, coin counters, + ? */
180   AM_RANGE(0xfe4002, 0xfe4003) AM_READ(input_port_1_word_r)
179   AM_RANGE(0xfe4000, 0xfe4001) AM_READ_PORT("P1_P2") AM_WRITE(tigeroad_videoctrl_w)   /* char bank, coin counters, + ? */
180   AM_RANGE(0xfe4002, 0xfe4003) AM_READ_PORT("SYSTEM")
181181/*  AM_RANGE(0xfe4002, 0xfe4003) AM_WRITE(tigeroad_soundcmd_w) added by init_tigeroad() */
182   AM_RANGE(0xfe4004, 0xfe4005) AM_READ(input_port_2_word_r)
182   AM_RANGE(0xfe4004, 0xfe4005) AM_READ_PORT("DSW")
183183   AM_RANGE(0xfec000, 0xfec7ff) AM_RAM_WRITE(tigeroad_videoram_w) AM_BASE(&videoram16)
184184   AM_RANGE(0xfe8000, 0xfe8003) AM_WRITE(tigeroad_scroll_w)
185185   AM_RANGE(0xfe800e, 0xfe800f) AM_WRITE(SMH_RAM)    /* fe800e = watchdog or IRQ acknowledge */
r3115r3116
215215
216216
217217static INPUT_PORTS_START( tigeroad )
218   PORT_START("P1_P2")  /* IN0 */
218   PORT_START("P1_P2")
219219   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
220220   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
221221   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
r3115r3116
244244   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN1 )
245245   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2 )
246246
247   PORT_START("DSW")  /* dipswitch */
247   PORT_START("DSW")
248248   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_B ) )
249249   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
250250   PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
r3115r3116
291291INPUT_PORTS_END
292292
293293static INPUT_PORTS_START( toramich )
294   PORT_START("P1_P2")  /* IN0 */
294   PORT_START("P1_P2")
295295   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
296296   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
297297   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
r3115r3116
320320   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN1 )
321321   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2 )
322322
323   PORT_START("DSW")  /* dipswitch */
323   PORT_START("DSW")
324324   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_B ) )
325325   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
326326   PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
r3115r3116
368368INPUT_PORTS_END
369369
370370static INPUT_PORTS_START( f1dream )
371   PORT_START("P1_P2")  /* IN0 */
371   PORT_START("P1_P2")
372372   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
373373   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
374374   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
r3115r3116
397397   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN1 )
398398   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2 )
399399
400   PORT_START("DSW")  /* dipswitch */
400   PORT_START("DSW")
401401   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_B ) )
402402   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
403403   PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
src/mame/drivers/badlands.c
r3115r3116
120120
121121static void update_interrupts(running_machine *machine)
122122{
123   int newstate = 0;
124
125   if (atarigen_video_int_state)
126      newstate = 1;
127   if (atarigen_sound_int_state)
128      newstate = 2;
129
130   if (newstate)
131      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
132   else
133      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
123   cpunum_set_input_line(machine, 0, 1, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
124   cpunum_set_input_line(machine, 0, 2, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
134125}
135126
136127
r3115r3116
612603
613604static void update_interrupts_bootleg(running_machine *machine)
614605{
615   int newstate = 0;
616
617   if (atarigen_video_int_state)
618      newstate = 1;
619//  if (atarigen_sound_int_state)
620//      newstate = 2;
621
622   if (newstate)
623      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
624   else
625      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
606   cpunum_set_input_line(machine, 0, 1, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
626607}
627608
628609
src/mame/drivers/psikyosh.c
r3115r3116
403403{
404404   if (ACCESSING_BITS_24_31)
405405   {
406      return ((eeprom_read_bit() << 28) | (input_port_read(machine, "IN4") << 24)); /* EEPROM | Region */
406      return input_port_read(machine, "JP4");
407407   }
408408
409409   logerror("Unk EEPROM read mask %x\n", mem_mask);
r3115r3116
416416   cpunum_set_input_line(machine, 0, 4, HOLD_LINE);
417417}
418418
419static READ32_HANDLER(io32_r)
420{
421   return ((input_port_read(machine, "IN0") << 24) | (input_port_read(machine, "IN1") << 16) | (input_port_read(machine, "IN2") << 8) | (input_port_read(machine, "IN3") << 0));
422}
423
424419static WRITE32_HANDLER( paletteram32_RRRRRRRRGGGGGGGGBBBBBBBBxxxxxxxx_dword_w )
425420{
426421   int r,g,b;
r3115r3116
518513   AM_RANGE(0x0305ffdc, 0x0305ffdf) AM_READ(SMH_NOP) // also writes to this address - might be vblank reads?
519514   AM_RANGE(0x0305ffe0, 0x0305ffff) AM_READ(SMH_RAM) //  video registers
520515   AM_RANGE(0x05000000, 0x05000003) AM_READ(psh_ymf_fm_r) // read YMF status
521   AM_RANGE(0x05800000, 0x05800003) AM_READ(io32_r)
516   AM_RANGE(0x05800000, 0x05800003) AM_READ_PORT("INPUTS")
522517   AM_RANGE(0x05800004, 0x05800007) AM_READ(psh_eeprom_r)
523518   AM_RANGE(0x06000000, 0x060fffff) AM_READ(SMH_RAM) // main RAM (1 meg)
524519
r3115r3116
546541
547542static ADDRESS_MAP_START( ps5_readmem, ADDRESS_SPACE_PROGRAM, 32 )
548543   AM_RANGE(0x00000000, 0x000fffff) AM_READ(SMH_ROM) // program ROM (1 meg)
549   AM_RANGE(0x03000000, 0x03000003) AM_READ(io32_r)
550   AM_RANGE(0x03000004, 0x03000007) AM_READ(psh_eeprom_r)
544   AM_RANGE(0x03000000, 0x03000003) AM_READ_PORT("INPUTS")
545   AM_RANGE(0x03000004, 0x03000007) AM_READ_PORT("JP4")
551546   AM_RANGE(0x03100000, 0x03100003) AM_READ(psh_ymf_fm_r)
552547   AM_RANGE(0x04000000, 0x04003fff) AM_READ(SMH_RAM)   // sprites
553548   AM_RANGE(0x04004000, 0x0400ffff) AM_READ(SMH_RAM)
r3115r3116
648643MACHINE_DRIVER_END
649644#endif
650645
646static INPUT_PORTS_START( common )
647   PORT_START("INPUTS")
648   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
649   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
650   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN )
651   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
652   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
653   PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
654   PORT_DIPNAME( 0x00000040, 0x00000040, "Debug" )      /* Debug stuff. Resets EEPROM? */
655   PORT_DIPSETTING(          0x00000040, DEF_STR( Off ) )
656   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
657   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNKNOWN )
658   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
659   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
660   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
661   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
662   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
663   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
664   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
665   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
651666
652#define UNUSED_PORT \
653   PORT_START("IN2")/* not read? */ \
654   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
655   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
656   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
657   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
658   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
659   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
660   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
661   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
667   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_START2 )
668   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
669   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
670   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
671   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
672   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
673   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
674   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
675   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START1 )
676   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
677   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
678   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
679   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
680   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
681   PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
682   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
683INPUT_PORTS_END
662684
663#define PORT_COIN( debug ) \
664   PORT_START("IN3") /* System inputs */ \
665   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1    ) \
666   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2    ) \
667   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN  ) \
668   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN  ) \
669   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) \
670   PORT_SERVICE_NO_TOGGLE(0x20, IP_ACTIVE_LOW) \
671   PORT_DIPNAME( 0x40, debug, "Debug" ) /* Must be high for dragnblz, low for others (Resets EEPROM?). Debug stuff */ \
672   PORT_DIPSETTING(    0x40, DEF_STR( Off ) ) \
673   PORT_DIPSETTING(    0x00, DEF_STR( On ) ) \
674   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN  )
675685
676#define PSIKYOSH_PORT_PLAYER( player, start, button1, button2, button3 ) \
677   PORT_BIT(  0x01, IP_ACTIVE_LOW, start ) \
678   PORT_BIT(  0x02, IP_ACTIVE_LOW, button3 ) PORT_PLAYER(player) \
679   PORT_BIT(  0x04, IP_ACTIVE_LOW, button2 ) PORT_PLAYER(player) \
680   PORT_BIT(  0x08, IP_ACTIVE_LOW, button1 ) PORT_PLAYER(player) \
681   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_PLAYER(player) \
682   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(player) \
683   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_PLAYER(player) \
684   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_PLAYER(player)
685
686686static INPUT_PORTS_START( s1945ii )
687   PORT_START("IN0")
688   PSIKYOSH_PORT_PLAYER( 1, IPT_START1, IPT_BUTTON1, IPT_BUTTON2, IPT_UNKNOWN )
689   PORT_START("IN1")
690   PSIKYOSH_PORT_PLAYER( 2, IPT_START2, IPT_BUTTON1, IPT_BUTTON2, IPT_UNKNOWN )
687   PORT_INCLUDE( common )
691688
692   UNUSED_PORT
693   PORT_COIN( 0x40 )
689   PORT_MODIFY("INPUTS")
690   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* No button 3 */
691   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* No button 3 */
694692
695   PORT_START("IN4")   /* jumper pads on the PCB */
696   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Region ) )
697   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )
698   PORT_DIPSETTING(    0x01, DEF_STR( World ) )
693   PORT_START("JP4")   /* jumper pads on the PCB */
694   PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Region ) )
695   PORT_DIPSETTING(          0x00000000, DEF_STR( Japan ) )
696   PORT_DIPSETTING(          0x01000000, DEF_STR( World ) )
697   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
699698INPUT_PORTS_END
700699
701700static INPUT_PORTS_START( soldivid )
702   PORT_START("IN0")
703   PSIKYOSH_PORT_PLAYER( 1, IPT_START1, IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3 )
704   PORT_START("IN1")
705   PSIKYOSH_PORT_PLAYER( 2, IPT_START2, IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3 )
701   PORT_INCLUDE( common )
706702
707   UNUSED_PORT
708   PORT_COIN( 0x40 )
709
710   PORT_START("IN4")   /* jumper pads on the PCB */
711   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Region ) )
712   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )
713   PORT_DIPSETTING(    0x01, DEF_STR( World ) )
703   PORT_START("JP4")   /* jumper pads on the PCB */
704   PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Region ) )
705   PORT_DIPSETTING(          0x00000000, DEF_STR( Japan ) )
706   PORT_DIPSETTING(          0x01000000, DEF_STR( World ) )
707   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
714708INPUT_PORTS_END
715709
716710static INPUT_PORTS_START( daraku )
717   PORT_START("IN0")
718   PSIKYOSH_PORT_PLAYER( 1, IPT_START1, IPT_BUTTON1, IPT_BUTTON2, IPT_UNKNOWN )
719   PORT_START("IN1")
720   PSIKYOSH_PORT_PLAYER( 2, IPT_START2, IPT_BUTTON1, IPT_BUTTON2, IPT_UNKNOWN )
711   PORT_INCLUDE( common )
721712
722   PORT_START("IN2")  /* more controls */
723   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_UNKNOWN                      )
724   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_UNKNOWN                      )
725   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
726   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
727   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_UNKNOWN                      )
728   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_UNKNOWN                      )
729   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
730   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
713   PORT_MODIFY("INPUTS")
714   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
715   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
716   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
717   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
718   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* No button 3 here */
719   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* No button 3 here */
731720
732   PORT_COIN( 0x40 )
733
734   PORT_START("IN4")   /* jumper pads on the PCB */
735   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Region ) )
736   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )
737   PORT_DIPSETTING(    0x01, DEF_STR( World ) ) /* Title screen is different, English is default now */
721   PORT_START("JP4")   /* jumper pads on the PCB */
722   PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Region ) )
723   PORT_DIPSETTING(          0x00000000, DEF_STR( Japan ) )
724   PORT_DIPSETTING(          0x01000000, DEF_STR( World ) ) /* Title screen is different, English is default now */
725   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
738726INPUT_PORTS_END
739727
740728static INPUT_PORTS_START( sbomberb )
741   PORT_START("IN0")
742   PSIKYOSH_PORT_PLAYER( 1, IPT_START1, IPT_BUTTON1, IPT_BUTTON2, IPT_UNKNOWN )
743   PORT_START("IN1")
744   PSIKYOSH_PORT_PLAYER( 2, IPT_START2, IPT_BUTTON1, IPT_BUTTON2, IPT_UNKNOWN )
729   PORT_INCLUDE( common )
730   /* If Debug is HIGH then you can perform rom test, but EEPROM resets? */
745731
746   UNUSED_PORT
747   PORT_COIN( 0x40 ) /* If HIGH then you can perform rom test, but EEPROM resets? */
732   PORT_MODIFY("INPUTS")
733   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* No button 3 */
734   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* No button 3 */
748735
749   PORT_START("IN4")   /* jumper pads on the PCB */
750   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Region ) )
751   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )
752   PORT_DIPSETTING(    0x01, DEF_STR( World ) )
736   PORT_START("JP4")   /* jumper pads on the PCB */
737   PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Region ) )
738   PORT_DIPSETTING(          0x00000000, DEF_STR( Japan ) )
739   PORT_DIPSETTING(          0x01000000, DEF_STR( World ) )
740   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
753741INPUT_PORTS_END
754742
755743static INPUT_PORTS_START( gunbird2 ) /* Different Region */
756   PORT_START("IN0")
757   PSIKYOSH_PORT_PLAYER( 1, IPT_START1, IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3 )
758   PORT_START("IN1")
759   PSIKYOSH_PORT_PLAYER( 2, IPT_START2, IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3 )
744   PORT_INCLUDE( common )
745   /* If Debug is HIGH then you can perform rom test, but EEPROM resets */
760746
761   UNUSED_PORT
762   PORT_COIN( 0x40 ) /* If HIGH then you can perform rom test, but EEPROM resets */
763
764   PORT_START("IN4")   /* jumper pads on the PCB */
765   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Region ) )
766   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )
767   PORT_DIPSETTING(    0x01, "International Ver A." )
768   PORT_DIPSETTING(    0x02, "International Ver B." )
747   PORT_START("JP4")   /* jumper pads on the PCB */
748   PORT_DIPNAME( 0x03000000, 0x02000000, DEF_STR( Region ) )
749   PORT_DIPSETTING(          0x00000000, DEF_STR( Japan ) )
750   PORT_DIPSETTING(          0x01000000, "International Ver A." )
751   PORT_DIPSETTING(          0x02000000, "International Ver B." )
752   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
769753INPUT_PORTS_END
770754
771755static INPUT_PORTS_START( s1945iii ) /* Different Region again */
772   PORT_START("IN0")
773   PSIKYOSH_PORT_PLAYER( 1, IPT_START1, IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3 )
774   PORT_START("IN1")
775   PSIKYOSH_PORT_PLAYER( 2, IPT_START2, IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3 )
756   PORT_INCLUDE( common )
757   /* If Debug is HIGH then you can perform rom test, EEPROM doesn't reset */
776758
777   UNUSED_PORT
778   PORT_COIN( 0x40 ) /* If HIGH then you can perform rom test, EEPROM doesn't reset */
779
780   PORT_START("IN4")   /* IN4 jumper pads on the PCB */
781   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Region ) )
782   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )
783   PORT_DIPSETTING(    0x02, "International Ver A." )
784   PORT_DIPSETTING(    0x01, "International Ver B." )
759   PORT_START("JP4")   /* jumper pads on the PCB */
760   PORT_DIPNAME( 0x03000000, 0x01000000, DEF_STR( Region ) )
761   PORT_DIPSETTING(          0x00000000, DEF_STR( Japan ) )
762   PORT_DIPSETTING(          0x02000000, "International Ver A." )
763   PORT_DIPSETTING(          0x01000000, "International Ver B." )
764   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
785765INPUT_PORTS_END
786766
787767static INPUT_PORTS_START( dragnblz ) /* Security requires bit high */
788   PORT_START("IN0")
789   PSIKYOSH_PORT_PLAYER( 1, IPT_START1, IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3 )
790   PORT_START("IN1")
791   PSIKYOSH_PORT_PLAYER( 2, IPT_START2, IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3 )
768   PORT_INCLUDE( common )
792769
793   UNUSED_PORT
770   PORT_MODIFY("INPUTS")
771   PORT_DIPNAME( 0x00000040, 0x00000000, "Debug" )      /* Must be HIGH (Or Security Error), so can perform test */
772   PORT_DIPSETTING(          0x00000040, DEF_STR( Off ) )
773   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
794774
795   PORT_COIN( 0 ) /* Must be HIGH (Or Security Error), so can perform test */
796
797   PORT_START("IN4")   /* jumper pads on the PCB */
798   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Region ) )
799   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )
800   PORT_DIPSETTING(    0x02, "International Ver A." )
801   PORT_DIPSETTING(    0x01, "International Ver B." )
775   PORT_START("JP4")   /* jumper pads on the PCB */
776   PORT_DIPNAME( 0x03000000, 0x01000000, DEF_STR( Region ) )
777   PORT_DIPSETTING(          0x00000000, DEF_STR( Japan ) )
778   PORT_DIPSETTING(          0x02000000, "International Ver A." )
779   PORT_DIPSETTING(          0x01000000, "International Ver B." )
780   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
802781INPUT_PORTS_END
803782
804783static INPUT_PORTS_START( gnbarich ) /* Same as S1945iii except only one button */
805   PORT_START("IN0")
806   PSIKYOSH_PORT_PLAYER( 1, IPT_START1, IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3 )
807   PORT_START("IN1")
808   PSIKYOSH_PORT_PLAYER( 2, IPT_START2, IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3 )
784   PORT_INCLUDE( common )
785   /* If Debug is HIGH then you can perform rom test, but EEPROM resets? */
809786
810   UNUSED_PORT
811   PORT_COIN( 0x40 ) /* If HIGH then you can perform rom test, but EEPROM resets? */
812
813   PORT_START("IN4")/* jumper pads on the PCB */
814   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Region ) )
815   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )
816   PORT_DIPSETTING(    0x02, "International Ver A." )
817   PORT_DIPSETTING(    0x01, "International Ver B." )
787   PORT_START("JP4")   /* jumper pads on the PCB */
788   PORT_DIPNAME( 0x03000000, 0x01000000, DEF_STR( Region ) )
789   PORT_DIPSETTING(          0x00000000, DEF_STR( Japan ) )
790   PORT_DIPSETTING(          0x02000000, "International Ver A." )
791   PORT_DIPSETTING(          0x01000000, "International Ver B." )
792   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
818793INPUT_PORTS_END
819794
820795static INPUT_PORTS_START( mjgtaste ) /* This will need the Mahjong inputs */
821   PORT_START("IN0")
822   PSIKYOSH_PORT_PLAYER( 1, IPT_START1, IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3 )
823   PORT_START("IN1")
824   PSIKYOSH_PORT_PLAYER( 2, IPT_START2, IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3 )
796   PORT_INCLUDE( common )
825797
826   UNUSED_PORT
827   PORT_COIN( 0x40 )
828
829   PORT_START("IN4")   /* jumper pads on the PCB */
830//  PORT_DIPNAME( 0x03, 0x01, DEF_STR( Region ) )
831//  PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )
832//  PORT_DIPSETTING(    0x02, "International Ver A." )
833//  PORT_DIPSETTING(    0x01, "International Ver B." )
798   PORT_START("JP4")   /* jumper pads on the PCB */
799//  PORT_DIPNAME( 0x03000000, 0x01000000, DEF_STR( Region ) )
800//  PORT_DIPSETTING(          0x00000000, DEF_STR( Japan ) )
801//  PORT_DIPSETTING(          0x02000000, "International Ver A." )
802//  PORT_DIPSETTING(          0x01000000, "International Ver B." )
803   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
834804INPUT_PORTS_END
835805
836806
src/mame/drivers/quizdna.c
r3115r3116
6868
6969static ADDRESS_MAP_START( quizdna_readport, ADDRESS_SPACE_IO, 8 )
7070   ADDRESS_MAP_GLOBAL_MASK(0xff)
71   AM_RANGE(0x80, 0x80) AM_READ(input_port_2_r)
72   AM_RANGE(0x81, 0x81) AM_READ(input_port_3_r)
73   AM_RANGE(0x90, 0x90) AM_READ(input_port_4_r)
74   AM_RANGE(0x91, 0x91) AM_READ(input_port_5_r)
71   AM_RANGE(0x80, 0x80) AM_READ_PORT("P1")
72   AM_RANGE(0x81, 0x81) AM_READ_PORT("P2")
73   AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM")
74   AM_RANGE(0x91, 0x91) AM_READ_PORT("SERVICE")
7575   AM_RANGE(0xe0, 0xe0) AM_READ(ym2203_status_port_0_r)
7676   AM_RANGE(0xe1, 0xe1) AM_READ(ym2203_read_port_0_r)
7777   AM_RANGE(0xf0, 0xf0) AM_READ(okim6295_status_0_r)
r3115r3116
117117/****************************************************************************/
118118
119119static INPUT_PORTS_START( quizdna )
120   PORT_START("DSW2")  /* sw2 */
120   PORT_START("DSW2")
121121   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) )
122122   PORT_DIPSETTING(    0x01, DEF_STR( 9C_1C ) )
123123   PORT_DIPSETTING(    0x02, DEF_STR( 8C_1C ) )
r3115r3116
146146   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
147147   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
148148
149   PORT_START("DSW3")  /* sw3 */
149   PORT_START("DSW3")
150150   PORT_DIPNAME( 0x03, 0x02, "Timer" )
151151   PORT_DIPSETTING(    0x03, "Slow" )
152152   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
r3115r3116
211211INPUT_PORTS_END
212212
213213static INPUT_PORTS_START( gakupara )
214    PORT_START("DSW2")  /* sw2 */
214    PORT_START("DSW2")
215215   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) )
216216   PORT_DIPSETTING(    0x00, "10 Coins/1 Credit" )
217217   PORT_DIPSETTING(    0x01, DEF_STR( 9C_1C ) )
r3115r3116
241241   PORT_DIPSETTING(    0x40, "Fast" )
242242   PORT_DIPSETTING(    0x00, "Very Fast" )
243243
244   PORT_START("DSW3")  /* sw3 */
244   PORT_START("DSW3")
245245   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
246246   PORT_DIPNAME( 0x02, 0x02, "Unknown 3-2" )
247247   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
r3115r3116
307307INPUT_PORTS_END
308308
309309static INPUT_PORTS_START( gekiretu )
310   PORT_START("DSW2")  /* dsw2 */
310   PORT_START("DSW2")
311311   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) )
312312   PORT_DIPSETTING(    0x01, DEF_STR( 9C_1C ) )
313313   PORT_DIPSETTING(    0x02, DEF_STR( 8C_1C ) )
r3115r3116
336336   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
337337   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
338338
339   PORT_START("DSW3")  /* dsw3 */
339   PORT_START("DSW3")
340340   PORT_DIPNAME( 0x03, 0x03, "Timer" )
341341   PORT_DIPSETTING(    0x03, "Slow" )
342342   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
src/mame/drivers/supertnk.c
r3115r3116
292292   AM_RANGE(0x0000, 0x07ff) AM_ROM
293293   AM_RANGE(0x0800, 0x17ff) AM_ROMBANK(1)
294294   AM_RANGE(0x1800, 0x1bff) AM_RAM
295   AM_RANGE(0x1efc, 0x1efc) AM_READ(input_port_0_r)
296   AM_RANGE(0x1efd, 0x1efd) AM_READ(input_port_1_r)
297   AM_RANGE(0x1efe, 0x1efe) AM_READWRITE(input_port_2_r, ay8910_control_port_0_w)
298   AM_RANGE(0x1eff, 0x1eff) AM_READWRITE(input_port_3_r, ay8910_write_port_0_w)
295   AM_RANGE(0x1efc, 0x1efc) AM_READ_PORT("JOYS")
296   AM_RANGE(0x1efd, 0x1efd) AM_READ_PORT("INPUTS")
297   AM_RANGE(0x1efe, 0x1efe) AM_READ_PORT("DSW") AM_WRITE(ay8910_control_port_0_w)
298   AM_RANGE(0x1eff, 0x1eff) AM_READ_PORT("UNK") AM_WRITE(ay8910_write_port_0_w)
299299   AM_RANGE(0x2000, 0x3fff) AM_READWRITE(supertnk_videoram_r, supertnk_videoram_w) AM_SIZE(&supertnk_videoram_size)
300300ADDRESS_MAP_END
301301
src/mame/drivers/offtwall.c
r3115r3116
3232
3333static void update_interrupts(running_machine *machine)
3434{
35   int newstate = 0;
36
37   if (atarigen_scanline_int_state)
38      newstate = 4;
39   if (atarigen_sound_int_state)
40      newstate = 6;
41
42   if (newstate)
43      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
44   else
45      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
35   cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
36   cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
4637}
4738
4839
r3115r3116
278269   AM_RANGE(0x000000, 0x037fff) AM_ROM
279270   AM_RANGE(0x038000, 0x03ffff) AM_READ(bankrom_r) AM_REGION("main", 0x38000) AM_BASE(&bankrom_base)
280271   AM_RANGE(0x120000, 0x120fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size)
281   AM_RANGE(0x260000, 0x260001) AM_READ(input_port_0_word_r)
282   AM_RANGE(0x260002, 0x260003) AM_READ(input_port_1_word_r)
272   AM_RANGE(0x260000, 0x260001) AM_READ_PORT("260000")
273   AM_RANGE(0x260002, 0x260003) AM_READ_PORT("260002")
283274   AM_RANGE(0x260010, 0x260011) AM_READ(special_port3_r)
284   AM_RANGE(0x260012, 0x260013) AM_READ(input_port_4_word_r)
285   AM_RANGE(0x260020, 0x260021) AM_READ(input_port_5_word_r)
286   AM_RANGE(0x260022, 0x260023) AM_READ(input_port_6_word_r)
287   AM_RANGE(0x260024, 0x260025) AM_READ(input_port_7_word_r)
275   AM_RANGE(0x260012, 0x260013) AM_READ_PORT("260012")
276   AM_RANGE(0x260020, 0x260021) AM_READ_PORT("260020")
277   AM_RANGE(0x260022, 0x260023) AM_READ_PORT("260022")
278   AM_RANGE(0x260024, 0x260025) AM_READ_PORT("260024")
288279   AM_RANGE(0x260030, 0x260031) AM_READ(atarigen_sound_r)
289280   AM_RANGE(0x260040, 0x260041) AM_WRITE(atarigen_sound_w)
290281   AM_RANGE(0x260050, 0x260051) AM_WRITE(io_latch_w)
r3115r3116
310301 *************************************/
311302
312303static INPUT_PORTS_START( offtwall )
313   PORT_START("260000")   /* 260000 */
314   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
315   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
316   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
317   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
318   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
319   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
320   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
321   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
322   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
323   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
324   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
325   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
326   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
327   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
328   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
329   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
304   PORT_START("260000")
305   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
306   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
307   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
308   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
309   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
310   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
311   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
312   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
313   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
314   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
315   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
316   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
317   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
318   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
319   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
320   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
330321
331   PORT_START("260002")   /* 260002 */
332   PORT_BIT(  0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
333   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3)
334   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
335   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
336   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
337   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
338   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
339   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
340   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
322   PORT_START("260002")
323   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
324   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3)
325   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
326   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
327   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
328   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
329   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
330   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
331   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
341332
342   PORT_INCLUDE( atarijsa_iii )      /* audio board port */
343
344   PORT_START("260010")   /* 260010 */
345   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
333   PORT_START("260010")
334   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
346335   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Controls ) )
347336   PORT_DIPSETTING(      0x0000, "Whirly-gigs" )   /* this is official Atari terminology! */
348337   PORT_DIPSETTING(      0x0002, "Joysticks" )
349   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_UNUSED )   /* tested at a454 */
350   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_UNUSED )   /* tested at a466 */
351   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
352   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_UNUSED )   /* tested before writing to 260040 */
338   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )   /* tested at a454 */
339   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )   /* tested at a466 */
340   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
341   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )   /* tested before writing to 260040 */
353342   PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
354   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
355   PORT_BIT(  0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
343   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
344   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
356345
357   PORT_START("260012")   /* 260012 */
358   PORT_BIT(  0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
346   PORT_START("260012")
347   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
359348
360   PORT_START("260020")   /* 260020 */
349   PORT_START("260020")
361350    PORT_BIT( 0xff, 0, IPT_DIAL_V ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1)
362351   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
363352
364   PORT_START("260022")   /* 260022 */
353   PORT_START("260022")
365354    PORT_BIT( 0xff, 0, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(2)
366355   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
367356
368   PORT_START("260024")   /* 260024 */
357   PORT_START("260024")
369358    PORT_BIT( 0xff, 0, IPT_DIAL_V ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(3)
370359   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
360
361   PORT_INCLUDE( atarijsa_iii )      /* audio board port */
371362INPUT_PORTS_END
372363
373364
src/mame/drivers/equites.c
r3115r3116
12951295   ROM_LOAD( "ev3.1k", 0x04000, 0x2000, CRC(10ff140b) SHA1(7c28f988a9c8b2a702d007096199e67b447a183c) )
12961296   ROM_LOAD( "ev4.1h", 0x06000, 0x2000, CRC(b7917264) SHA1(e58345fda088b171fd348959de15082f3cb42514) )
12971297
1298   ROM_REGION( 0x2000, "MCU", 0 )
1299   ROM_LOAD( "8303.bin", 0x0000, 0x2000, CRC(66adcb37) SHA1(e1c72ecb161129dcbddc0b16dd90e716d0c79311) )
1300
12981301   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE ) // chars
12991302   ROM_LOAD( "ep9",  0x00000, 0x1000, CRC(0325be11) SHA1(d95667b439e3d97b08efeaf08022348546a4f385) )
13001303
r3115r3116
13561359   ROM_LOAD( "ev3.1k", 0x04000, 0x2000, CRC(10ff140b) SHA1(7c28f988a9c8b2a702d007096199e67b447a183c) )
13571360   ROM_LOAD( "ev4.1h", 0x06000, 0x2000, CRC(b7917264) SHA1(e58345fda088b171fd348959de15082f3cb42514) )
13581361
1362   ROM_REGION( 0x2000, "MCU", 0 )
1363   ROM_LOAD( "8303.bin", 0x0000, 0x2000, CRC(66adcb37) SHA1(e1c72ecb161129dcbddc0b16dd90e716d0c79311) )
1364
13591365   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE ) // chars
13601366   ROM_LOAD( "epr-ep0.3e",  0x00000, 0x1000, CRC(3f5a81c3) SHA1(8fd5bc621f483bfa46be7e40e6480b25243bdf70) )
13611367
r3115r3116
13921398   ROM_LOAD( "bprom.3h",  0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
13931399ROM_END
13941400
1395/*
1396Gekisou (JPN Ver.)
1397(c)1985 Eastern
1398
139968K55-2
1400CPU:MC68000P8
1401OSC:12.000MHz
1402
1403SOUND BOARD NO.59 MC 07
1404CPU  :TMP8085AP
1405Sound:AY-3-8910A,OKI M5232,D8155HC
1406OSC  :6.144MHz
1407*/
1408ROM_START( gekisou )
1409   ROM_REGION( 0x10000, "main", 0 ) // 68000 ROMs
1410   ROM_LOAD16_BYTE( "1.15b", 0x00001, 0x4000, CRC(945fd546) SHA1(6045dbf11272fcec8320aacb2852d4223d0943a0) )
1411   ROM_LOAD16_BYTE( "2.15d", 0x00000, 0x4000, CRC(3c057150) SHA1(2b1ad7993addfd1c0eee99dfe5bb3476cd387f6a) )
1412   ROM_LOAD16_BYTE( "3.14b", 0x08001, 0x4000, CRC(7c1cf4d0) SHA1(a122d3a51d205123e04c694912809e0bb31155d5) )
1413   ROM_LOAD16_BYTE( "4.14d", 0x08000, 0x4000, CRC(c7282391) SHA1(144a34d74bb1e71e2f799913ab04927d00faec87) )
1414
1415   ROM_REGION( 0x10000, "audio", 0 ) // 8085A ROMs
1416   ROM_LOAD( "v1.1l", 0x00000, 0x4000, CRC(dc6af437) SHA1(77112fec51343d8e73765b2a342a888612813c3b) )
1417   ROM_LOAD( "v2.1h", 0x04000, 0x4000, CRC(cb12582e) SHA1(ef378232e2744540cc4c9187cfb36d780dadc962) )
1418   ROM_LOAD( "v3.1e", 0x08000, 0x4000, CRC(0ab5e777) SHA1(9177c42418f022a65d73c3302873b894c5a137a4) )
1419
1420   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE ) // chars
1421   ROM_LOAD( "0.5c",  0x00000, 0x1000, CRC(7e8bf4d1) SHA1(8abb82be006e8d1df449a5f83d59637314405119) )
1422
1423   ROM_REGION( 0x10000, "gfx2", ROMREGION_DISPOSE ) // tiles
1424   ROM_LOAD( "7.18r",   0x00000, 0x2000, CRC(a1918b6c) SHA1(6ffa4c845d23d311b59cc19411a68a782618b3fd) )
1425   // empty space to unpack previous ROM
1426   ROM_CONTINUE(        0x04000, 0x2000)
1427   // empty space to unpack previous ROM
1428   ROM_LOAD( "5.16r",   0x08000, 0x2000, CRC(88ef550a) SHA1(b50e7b8257d1bb6923d289e7af885c14d089b394) )
1429   ROM_CONTINUE(        0x0c000, 0x2000)
1430   ROM_LOAD( "6.15r",   0x0a000, 0x2000, CRC(473e3fbf) SHA1(5039387b3627c19f592d630ba7bd010a3881adc5) )
1431   ROM_CONTINUE(        0x0e000, 0x2000)
1432
1433   ROM_REGION( 0x10000, "gfx3", ROMREGION_DISPOSE ) // sprites
1434   ROM_LOAD( "10.9r",   0x00000, 0x2000, CRC(11d89c73) SHA1(8753f635d321c8e9b93b0ab767cf44aca1db7a0a) )
1435   // empty space to unpack previous ROM
1436   ROM_CONTINUE(        0x04000, 0x2000)
1437   // empty space to unpack previous ROM
1438   ROM_LOAD( "8.8r",    0x08000, 0x2000, CRC(2e0c392c) SHA1(48542a24a34e3d5d00af418b29a2ee15557efc99) )
1439   ROM_CONTINUE(        0x0c000, 0x2000)
1440   ROM_LOAD( "9.6r",    0x0a000, 0x2000, CRC(56a03b08) SHA1(d90b246890fedfc437de85be8bcc6b60ff068be1) )
1441   ROM_CONTINUE(        0x0e000, 0x2000)
1442
1443   ROM_REGION( 0x0700, "proms", 0 )
1444   ROM_LOAD( "1b.bpr",  0x0000, 0x100, CRC(11a1c0aa) SHA1(d007d31f68bf802c89422ea2393747ac8de94d70) ) // R
1445   ROM_LOAD( "4b.bpr",  0x0100, 0x100, CRC(c7ebe52c) SHA1(19d2ee70d67fd5e1c57f66d030ec9a5b6af5a49e) ) // G
1446   ROM_LOAD( "2b.bpr",  0x0200, 0x100, CRC(4f5d4141) SHA1(965221c6af4a868760e6d168b55e037fc5f9fa52) ) // B
1447   ROM_LOAD( "2n.bpr",  0x0300, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) ) // CLUT(same PROM x 4)
1448   ROM_LOAD( "3n.bpr",  0x0400, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) )
1449   ROM_LOAD( "4n.bpr",  0x0500, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) )
1450   ROM_LOAD( "5n.bpr",  0x0600, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) )
1451
1452   ROM_REGION( 0x0020, "prom", 0 )
1453   ROM_LOAD( "3h.bpr",  0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
1454ROM_END
1455
14561401/******************************************************************************/
1457// Koukouyakyuh ROM Map
1458
1459/*
1460The Koukouyakyuh (JPN Ver.)
1461
1462(c)1985 Alpha denshi
1463
1464CPU   :MAIN  68000
1465       SOUND 8085
1466Sound :AY-3-8910 M3M5232RS
1467OSC   :12.000MHz 6.??MHz 14.31818MHz
1468*/
1469ROM_START( kouyakyu )
1470   ROM_REGION( 0x10000, "main", 0 )  // 68000 ROMs
1471   ROM_LOAD16_BYTE( "epr-6704.bin", 0x00001, 0x2000, CRC(c7ac2292) SHA1(614bfb0949620d4c260768f14a116b076dd38438) )
1472   ROM_LOAD16_BYTE( "epr-6707.bin", 0x00000, 0x2000, CRC(9cb2962e) SHA1(bd1bcbc53a3346e22789f24a35ab3aa681317d02) )
1473   ROM_LOAD16_BYTE( "epr-6705.bin", 0x04001, 0x2000, CRC(985327cb) SHA1(86969fe763cbaa527d64de35844773b5ab1d7f83) )
1474   ROM_LOAD16_BYTE( "epr-6708.bin", 0x04000, 0x2000, CRC(f8863dc5) SHA1(bfdd294d51420dd70aa97942909a9b8a95ffc05c) )
1475   ROM_LOAD16_BYTE( "epr-6706.bin", 0x08001, 0x2000, BAD_DUMP CRC(79e94cd2) SHA1(f44c2292614b46116818fad9a7eb48cceeb3b819)  )   // was bad, manually patched
1476   ROM_LOAD16_BYTE( "epr-6709.bin", 0x08000, 0x2000, CRC(f41cb58c) SHA1(f0d1048e949d51432739755f985e4df65b8e918b) )
1477   ROM_FILL(                        0x0c000, 0x4000, 0 )
1478
1479   ROM_REGION( 0x10000, "audio", 0 ) // 8085A ROMs
1480   ROM_LOAD( "epr-6703.bin", 0x00000, 0x2000, CRC(fbff3a86) SHA1(4ed2887b1e4509ded853a230f735d4d2aa475886) )
1481   ROM_LOAD( "epr-6702.bin", 0x02000, 0x2000, CRC(27ddf031) SHA1(2f11d3b693e46852762669ed1e35a667990edec7) )
1482   ROM_LOAD( "epr-6701.bin", 0x04000, 0x2000, CRC(3c83588a) SHA1(a84c813ba9d464cffc855397aaacbb9177c86fb4) )
1483   ROM_LOAD( "epr-6700.bin", 0x06000, 0x2000, CRC(ee579266) SHA1(94dfcf506049fc78db00084ff7031d19520d9a85) )
1484   ROM_LOAD( "epr-6699.bin", 0x08000, 0x2000, CRC(9bfa4a72) SHA1(8ac4d308dab0d67a26b4e3550c2e8064aaf36a74) )
1485   ROM_LOAD( "epr-6698.bin", 0x0a000, 0x2000, CRC(7adfd1ff) SHA1(b543dd6734a681a187dabf602bea390de663039c) )
1486
1487   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE ) // chars
1488   ROM_LOAD( "epr-6710.bin", 0x00000, 0x1000, CRC(accda190) SHA1(265d2fd92574d65e7890e48d5f305bf903a67bc8) )
1489
1490   ROM_REGION( 0x10000, "gfx2", ROMREGION_DISPOSE ) // tiles
1491   ROM_LOAD( "epr-6695.bin", 0x00000, 0x2000, CRC(22bea465) SHA1(4860d7ee3c386cdacc9c608ffe74ec8bfa58edcb) )
1492   // empty space to unpack previous ROM
1493   ROM_LOAD( "epr-6694.bin", 0x04000, 0x2000, CRC(51a7345e) SHA1(184c890559ed633e23cb459c313e6179cc3eb542) )
1494   // empty space to unpack previous ROM
1495   ROM_LOAD( "epr-6689.bin", 0x08000, 0x2000, CRC(53bf7587) SHA1(0046cd04d11ce789ff69e0807700a624af96eb36) )
1496   ROM_LOAD( "epr-6688.bin", 0x0a000, 0x2000, CRC(ceb76c5b) SHA1(81fa236871f10c77eb201e1c9771bd57406df15b) )
1497   ROM_LOAD( "epr-6687.bin", 0x0c000, 0x2000, CRC(9c1f49df) SHA1(1a5cf5278777f829d3654e838bd2bb9f4dbb57ba) )
1498   ROM_LOAD( "epr-6686.bin", 0x0e000, 0x2000, CRC(3d9e516f) SHA1(498614821f87dbcc39edb1756e1af6b536044e6a) )
1499
1500   ROM_REGION( 0x10000, "gfx3", ROMREGION_DISPOSE ) // sprites
1501   ROM_LOAD( "epr-6696.bin", 0x00000, 0x2000, CRC(0625f48e) SHA1(bea09ccf37f38678fb53c55bd0a79557d6c81b3f) )
1502   // empty space to unpack previous ROM
1503   ROM_LOAD( "epr-6697.bin", 0x04000, 0x2000, CRC(f18afabe) SHA1(abd7f6c0bd0de145c423166a2f4e86ccdb12b1ce) )
1504   // empty space to unpack previous ROM
1505   ROM_LOAD( "epr-6690.bin", 0x08000, 0x2000, CRC(a142a11d) SHA1(209c7e0591622434ada4445f3f8789059c5f4f77) )
1506   ROM_LOAD( "epr-6691.bin", 0x0a000, 0x2000, CRC(b640568c) SHA1(8cef1387c469abec8b488621a94cc9575d6c5fcc) )
1507   ROM_LOAD( "epr-6692.bin", 0x0c000, 0x2000, CRC(b91d8172) SHA1(8d8f6ea78ebf652f295ce96abf19e628fe777d07) )
1508   ROM_LOAD( "epr-6693.bin", 0x0e000, 0x2000, CRC(874e3acc) SHA1(29438f196811fc2c8f54b6c47f1c175e4797dd4c) )
1509
1510   ROM_REGION( 0x0700, "proms", 0 )
1511   ROM_LOAD( "pr6627.bpr",  0x0000, 0x100, CRC(5ec5480d) SHA1(f966a277539a5d257f32692cdd92ce44b08599e8) ) // R
1512   ROM_LOAD( "pr6629.bpr",  0x0100, 0x100, CRC(29c7a393) SHA1(67cced39c0a80655c420aad668dfe836c1d7c643) ) // G
1513   ROM_LOAD( "pr6628.bpr",  0x0200, 0x100, CRC(8af247a4) SHA1(01702fbce53dd4875e4825f0487e7aed9cf212fa) ) // B
1514   ROM_LOAD( "pr6630a.bpr", 0x0300, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) ) // CLUT(same PROM x 4)
1515   ROM_LOAD( "pr6630b.bpr", 0x0400, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) )
1516   ROM_LOAD( "pr6630c.bpr", 0x0500, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) )
1517   ROM_LOAD( "pr6630d.bpr", 0x0600, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) )
1518
1519   ROM_REGION( 0x0020, "prom", 0 )
1520   ROM_LOAD( "pr.bpr",      0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
1521ROM_END
1522
1523/******************************************************************************/
15241402// Bull Fighter ROM Map
15251403
15261404ROM_START( bullfgtr )
r3115r3116
15391417   ROM_LOAD( "hv3vr.bin", 0x04000, 0x2000, CRC(51ee751c) SHA1(60bf848dfdfe313ab05df5a5c05819b0fa87ca50) )
15401418   ROM_LOAD( "hv4vr.bin", 0x06000, 0x2000, CRC(62c7a25b) SHA1(237d3cbdfbf45b33c2f65d30faba151380866a93) )
15411419
1420   ROM_REGION( 0x2000, "MCU", 0 )
1421   ROM_LOAD( "8303.bin", 0x0000, 0x2000, CRC(66adcb37) SHA1(e1c72ecb161129dcbddc0b16dd90e716d0c79311) )
1422
15421423   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE ) // chars
15431424   ROM_LOAD( "h.bin", 0x000000, 0x1000, CRC(c6894c9a) SHA1(0d5a55cded4fd833211bdc733a78c6c8423897de) )
15441425
r3115r3116
16181499   ROM_LOAD( "hv3vr.bin", 0x04000, 0x2000, CRC(51ee751c) SHA1(60bf848dfdfe313ab05df5a5c05819b0fa87ca50) )
16191500   ROM_LOAD( "hv4vr.bin", 0x06000, 0x2000, CRC(62c7a25b) SHA1(237d3cbdfbf45b33c2f65d30faba151380866a93) )
16201501
1502   ROM_REGION( 0x2000, "MCU", 0 )
1503   ROM_LOAD( "8303.bin", 0x0000, 0x2000, CRC(66adcb37) SHA1(e1c72ecb161129dcbddc0b16dd90e716d0c79311) )
1504
16211505   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE ) // chars
16221506   ROM_LOAD( "h.bin", 0x000000, 0x1000, CRC(c6894c9a) SHA1(0d5a55cded4fd833211bdc733a78c6c8423897de) )
16231507
r3115r3116
16551539ROM_END
16561540
16571541/******************************************************************************/
1542// Koukouyakyuh ROM Map
1543
1544/*
1545The Koukouyakyuh (JPN Ver.)
1546
1547(c)1985 Alpha denshi
1548
1549CPU   :MAIN  68000
1550       SOUND 8085
1551Sound :AY-3-8910 M3M5232RS
1552OSC   :12.000MHz 6.??MHz 14.31818MHz
1553*/
1554ROM_START( kouyakyu )
1555   ROM_REGION( 0x10000, "main", 0 )  // 68000 ROMs
1556   ROM_LOAD16_BYTE( "epr-6704.bin", 0x00001, 0x2000, CRC(c7ac2292) SHA1(614bfb0949620d4c260768f14a116b076dd38438) )
1557   ROM_LOAD16_BYTE( "epr-6707.bin", 0x00000, 0x2000, CRC(9cb2962e) SHA1(bd1bcbc53a3346e22789f24a35ab3aa681317d02) )
1558   ROM_LOAD16_BYTE( "epr-6705.bin", 0x04001, 0x2000, CRC(985327cb) SHA1(86969fe763cbaa527d64de35844773b5ab1d7f83) )
1559   ROM_LOAD16_BYTE( "epr-6708.bin", 0x04000, 0x2000, CRC(f8863dc5) SHA1(bfdd294d51420dd70aa97942909a9b8a95ffc05c) )
1560   ROM_LOAD16_BYTE( "epr-6706.bin", 0x08001, 0x2000, BAD_DUMP CRC(79e94cd2) SHA1(f44c2292614b46116818fad9a7eb48cceeb3b819)  )   // was bad, manually patched
1561   ROM_LOAD16_BYTE( "epr-6709.bin", 0x08000, 0x2000, CRC(f41cb58c) SHA1(f0d1048e949d51432739755f985e4df65b8e918b) )
1562   ROM_FILL(                        0x0c000, 0x4000, 0 )
1563
1564   ROM_REGION( 0x10000, "audio", 0 ) // 8085A ROMs
1565   ROM_LOAD( "epr-6703.bin", 0x00000, 0x2000, CRC(fbff3a86) SHA1(4ed2887b1e4509ded853a230f735d4d2aa475886) )
1566   ROM_LOAD( "epr-6702.bin", 0x02000, 0x2000, CRC(27ddf031) SHA1(2f11d3b693e46852762669ed1e35a667990edec7) )
1567   ROM_LOAD( "epr-6701.bin", 0x04000, 0x2000, CRC(3c83588a) SHA1(a84c813ba9d464cffc855397aaacbb9177c86fb4) )
1568   ROM_LOAD( "epr-6700.bin", 0x06000, 0x2000, CRC(ee579266) SHA1(94dfcf506049fc78db00084ff7031d19520d9a85) )
1569   ROM_LOAD( "epr-6699.bin", 0x08000, 0x2000, CRC(9bfa4a72) SHA1(8ac4d308dab0d67a26b4e3550c2e8064aaf36a74) )
1570   ROM_LOAD( "epr-6698.bin", 0x0a000, 0x2000, CRC(7adfd1ff) SHA1(b543dd6734a681a187dabf602bea390de663039c) )
1571
1572   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE ) // chars
1573   ROM_LOAD( "epr-6710.bin", 0x00000, 0x1000, CRC(accda190) SHA1(265d2fd92574d65e7890e48d5f305bf903a67bc8) )
1574
1575   ROM_REGION( 0x10000, "gfx2", ROMREGION_DISPOSE ) // tiles
1576   ROM_LOAD( "epr-6695.bin", 0x00000, 0x2000, CRC(22bea465) SHA1(4860d7ee3c386cdacc9c608ffe74ec8bfa58edcb) )
1577   // empty space to unpack previous ROM
1578   ROM_LOAD( "epr-6694.bin", 0x04000, 0x2000, CRC(51a7345e) SHA1(184c890559ed633e23cb459c313e6179cc3eb542) )
1579   // empty space to unpack previous ROM
1580   ROM_LOAD( "epr-6689.bin", 0x08000, 0x2000, CRC(53bf7587) SHA1(0046cd04d11ce789ff69e0807700a624af96eb36) )
1581   ROM_LOAD( "epr-6688.bin", 0x0a000, 0x2000, CRC(ceb76c5b) SHA1(81fa236871f10c77eb201e1c9771bd57406df15b) )
1582   ROM_LOAD( "epr-6687.bin", 0x0c000, 0x2000, CRC(9c1f49df) SHA1(1a5cf5278777f829d3654e838bd2bb9f4dbb57ba) )
1583   ROM_LOAD( "epr-6686.bin", 0x0e000, 0x2000, CRC(3d9e516f) SHA1(498614821f87dbcc39edb1756e1af6b536044e6a) )
1584
1585   ROM_REGION( 0x10000, "gfx3", ROMREGION_DISPOSE ) // sprites
1586   ROM_LOAD( "epr-6696.bin", 0x00000, 0x2000, CRC(0625f48e) SHA1(bea09ccf37f38678fb53c55bd0a79557d6c81b3f) )
1587   // empty space to unpack previous ROM
1588   ROM_LOAD( "epr-6697.bin", 0x04000, 0x2000, CRC(f18afabe) SHA1(abd7f6c0bd0de145c423166a2f4e86ccdb12b1ce) )
1589   // empty space to unpack previous ROM
1590   ROM_LOAD( "epr-6690.bin", 0x08000, 0x2000, CRC(a142a11d) SHA1(209c7e0591622434ada4445f3f8789059c5f4f77) )
1591   ROM_LOAD( "epr-6691.bin", 0x0a000, 0x2000, CRC(b640568c) SHA1(8cef1387c469abec8b488621a94cc9575d6c5fcc) )
1592   ROM_LOAD( "epr-6692.bin", 0x0c000, 0x2000, CRC(b91d8172) SHA1(8d8f6ea78ebf652f295ce96abf19e628fe777d07) )
1593   ROM_LOAD( "epr-6693.bin", 0x0e000, 0x2000, CRC(874e3acc) SHA1(29438f196811fc2c8f54b6c47f1c175e4797dd4c) )
1594
1595   ROM_REGION( 0x0700, "proms", 0 )
1596   ROM_LOAD( "pr6627.bpr",  0x0000, 0x100, CRC(5ec5480d) SHA1(f966a277539a5d257f32692cdd92ce44b08599e8) ) // R
1597   ROM_LOAD( "pr6629.bpr",  0x0100, 0x100, CRC(29c7a393) SHA1(67cced39c0a80655c420aad668dfe836c1d7c643) ) // G
1598   ROM_LOAD( "pr6628.bpr",  0x0200, 0x100, CRC(8af247a4) SHA1(01702fbce53dd4875e4825f0487e7aed9cf212fa) ) // B
1599   ROM_LOAD( "pr6630a.bpr", 0x0300, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) ) // CLUT(same PROM x 4)
1600   ROM_LOAD( "pr6630b.bpr", 0x0400, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) )
1601   ROM_LOAD( "pr6630c.bpr", 0x0500, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) )
1602   ROM_LOAD( "pr6630d.bpr", 0x0600, 0x100, CRC(d6e202da) SHA1(500ebd5c95d2d2c33535d25cf7f8f649897dc224) )
1603
1604   ROM_REGION( 0x0020, "prom", 0 )
1605   ROM_LOAD( "pr.bpr",      0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
1606ROM_END
1607
1608/******************************************************************************/
1609/*
1610Gekisou (JPN Ver.)
1611(c)1985 Eastern
1612
161368K55-2
1614CPU:MC68000P8
1615OSC:12.000MHz
1616
1617SOUND BOARD NO.59 MC 07
1618CPU  :TMP8085AP
1619Sound:AY-3-8910A,OKI M5232,D8155HC
1620OSC  :6.144MHz
1621*/
1622ROM_START( gekisou )
1623   ROM_REGION( 0x10000, "main", 0 ) // 68000 ROMs
1624   ROM_LOAD16_BYTE( "1.15b", 0x00001, 0x4000, CRC(945fd546) SHA1(6045dbf11272fcec8320aacb2852d4223d0943a0) )
1625   ROM_LOAD16_BYTE( "2.15d", 0x00000, 0x4000, CRC(3c057150) SHA1(2b1ad7993addfd1c0eee99dfe5bb3476cd387f6a) )
1626   ROM_LOAD16_BYTE( "3.14b", 0x08001, 0x4000, CRC(7c1cf4d0) SHA1(a122d3a51d205123e04c694912809e0bb31155d5) )
1627   ROM_LOAD16_BYTE( "4.14d", 0x08000, 0x4000, CRC(c7282391) SHA1(144a34d74bb1e71e2f799913ab04927d00faec87) )
1628
1629   ROM_REGION( 0x10000, "audio", 0 ) // 8085A ROMs
1630   ROM_LOAD( "v1.1l", 0x00000, 0x4000, CRC(dc6af437) SHA1(77112fec51343d8e73765b2a342a888612813c3b) )
1631   ROM_LOAD( "v2.1h", 0x04000, 0x4000, CRC(cb12582e) SHA1(ef378232e2744540cc4c9187cfb36d780dadc962) )
1632   ROM_LOAD( "v3.1e", 0x08000, 0x4000, CRC(0ab5e777) SHA1(9177c42418f022a65d73c3302873b894c5a137a4) )
1633
1634   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE ) // chars
1635   ROM_LOAD( "0.5c",  0x00000, 0x1000, CRC(7e8bf4d1) SHA1(8abb82be006e8d1df449a5f83d59637314405119) )
1636
1637   ROM_REGION( 0x10000, "gfx2", ROMREGION_DISPOSE ) // tiles
1638   ROM_LOAD( "7.18r",   0x00000, 0x2000, CRC(a1918b6c) SHA1(6ffa4c845d23d311b59cc19411a68a782618b3fd) )
1639   // empty space to unpack previous ROM
1640   ROM_CONTINUE(        0x04000, 0x2000)
1641   // empty space to unpack previous ROM
1642   ROM_LOAD( "5.16r",   0x08000, 0x2000, CRC(88ef550a) SHA1(b50e7b8257d1bb6923d289e7af885c14d089b394) )
1643   ROM_CONTINUE(        0x0c000, 0x2000)
1644   ROM_LOAD( "6.15r",   0x0a000, 0x2000, CRC(473e3fbf) SHA1(5039387b3627c19f592d630ba7bd010a3881adc5) )
1645   ROM_CONTINUE(        0x0e000, 0x2000)
1646
1647   ROM_REGION( 0x10000, "gfx3", ROMREGION_DISPOSE ) // sprites
1648   ROM_LOAD( "10.9r",   0x00000, 0x2000, CRC(11d89c73) SHA1(8753f635d321c8e9b93b0ab767cf44aca1db7a0a) )
1649   // empty space to unpack previous ROM
1650   ROM_CONTINUE(        0x04000, 0x2000)
1651   // empty space to unpack previous ROM
1652   ROM_LOAD( "8.8r",    0x08000, 0x2000, CRC(2e0c392c) SHA1(48542a24a34e3d5d00af418b29a2ee15557efc99) )
1653   ROM_CONTINUE(        0x0c000, 0x2000)
1654   ROM_LOAD( "9.6r",    0x0a000, 0x2000, CRC(56a03b08) SHA1(d90b246890fedfc437de85be8bcc6b60ff068be1) )
1655   ROM_CONTINUE(        0x0e000, 0x2000)
1656
1657   ROM_REGION( 0x0700, "proms", 0 )
1658   ROM_LOAD( "1b.bpr",  0x0000, 0x100, CRC(11a1c0aa) SHA1(d007d31f68bf802c89422ea2393747ac8de94d70) ) // R
1659   ROM_LOAD( "4b.bpr",  0x0100, 0x100, CRC(c7ebe52c) SHA1(19d2ee70d67fd5e1c57f66d030ec9a5b6af5a49e) ) // G
1660   ROM_LOAD( "2b.bpr",  0x0200, 0x100, CRC(4f5d4141) SHA1(965221c6af4a868760e6d168b55e037fc5f9fa52) ) // B
1661   ROM_LOAD( "2n.bpr",  0x0300, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) ) // CLUT(same PROM x 4)
1662   ROM_LOAD( "3n.bpr",  0x0400, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) )
1663   ROM_LOAD( "4n.bpr",  0x0500, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) )
1664   ROM_LOAD( "5n.bpr",  0x0600, 0x100, CRC(c7333120) SHA1(ad590e8ece3dcf56b285c4a080f4ee8bb4c9d77c) )
1665
1666   ROM_REGION( 0x0020, "prom", 0 )
1667   ROM_LOAD( "3h.bpr",  0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) )
1668ROM_END
1669
1670/******************************************************************************/
16581671// Splendor Blast ROM Map
16591672
16601673/*
r3115r3116
16841697   ROM_LOAD( "3_v.1k", 0x04000, 0x2000, CRC(bbee5346) SHA1(753cb784b04f081fa1f8590dc28056d9918f313b) )
16851698   ROM_LOAD( "4_v.1h", 0x06000, 0x2000, CRC(10f45af4) SHA1(00fa599bad8bf3ba6deee54165f381403096e8f9) )
16861699
1700   ROM_REGION( 0x2000, "MCU", 0 )
1701   ROM_LOAD( "8303.bin", 0x0000, 0x2000, CRC(66adcb37) SHA1(e1c72ecb161129dcbddc0b16dd90e716d0c79311) )
1702
16871703   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )   // chars
16881704   ROM_LOAD( "10.8c",  0x00000, 0x2000, CRC(501887d4) SHA1(3cf4401d6fddff1500066219a71ac3b30ecbdd28) )
16891705
r3115r3116
18521868// Equites Hardware
18531869GAME( 1984, equites,  0,        equites,  equites,  equites,  ROT90, "Alpha Denshi Co.",                "Equites", GAME_IMPERFECT_SOUND )
18541870GAME( 1984, equitess, equites,  equites,  equites,  equites,  ROT90, "Alpha Denshi Co. (Sega license)", "Equites (Sega)", GAME_IMPERFECT_SOUND )
1855GAME( 1985, gekisou,  0,        gekisou,  gekisou,  gekisou,  ROT90, "Eastern Corp.",                   "Gekisou (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
18561871GAME( 1984, bullfgtr, 0,        equites,  bullfgtr, bullfgtr, ROT90, "Alpha Denshi Co.",                "Bull Fighter", GAME_IMPERFECT_SOUND )
18571872GAME( 1984, bullfgts, bullfgtr, equites,  bullfgtr, bullfgtr, ROT90, "Alpha Denshi Co. (Sega license)", "Bull Fighter (Sega)", GAME_IMPERFECT_SOUND )
18581873GAME( 1985, kouyakyu, 0,        equites,  kouyakyu, kouyakyu, ROT0,  "Alpha Denshi Co.",                "The Koukouyakyuh", GAME_IMPERFECT_SOUND )
1874GAME( 1985, gekisou,  0,        gekisou,  gekisou,  gekisou,  ROT90, "Eastern Corp.",                   "Gekisou (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
18591875
18601876// Splendor Blast Hardware
18611877GAME( 1985, splndrbt, 0,        splndrbt, splndrbt, splndrbt, ROT0,  "Alpha Denshi Co.", "Splendor Blast", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/neodrvr.c
r3115r3116
6969   PORT_DIPNAME( 0x0080, 0x0080, "Freeze" ) PORT_DIPLOCATION("SW:8")
7070   PORT_DIPSETTING(     0x0080, DEF_STR( Off ) )
7171   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
72   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mahjong_controller_r, 0 )
72   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mahjong_controller_r, NULL)
7373
7474   STANDARD_IN1
7575
r3115r3116
143143   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED )
144144   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 )
145145   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
146   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, 0 )
146   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, NULL)
147147   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
148148
149149   STANDARD_IN3
r3115r3116
234234   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* this bit is used.. */
235235   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
236236   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* this bit is used.. */
237   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, 0 )
237   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, NULL)
238238   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
239239
240240   PORT_START("IN3")
241241   PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
242   PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_calendar_status, 0 )
243   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_audio_result, 0 )
242   PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_calendar_status, NULL)
243   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_audio_result, NULL)
244244
245245   STANDARD_IN4
246246
r3115r3116
273273   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Next Game") PORT_CODE(KEYCODE_7)
274274   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* game freezes with this bit enabled */
275275   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Previous Game") PORT_CODE(KEYCODE_8)
276   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, 0 )
276   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, NULL)
277277   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
278278
279279   STANDARD_IN3
r3115r3116
40094009
40104010   ROM_REGION16_BE( 0x20000, "mainbios", 0 )
40114011   /* special BIOS with trackball support, we only have one Irritating Maze bios and thats asia */
4012   ROM_LOAD16_WORD_SWAP("236-bios.bin", 0x00000, 0x020000, CRC(853e6b96) SHA1(de369cb4a7df147b55168fa7aaf0b98c753b735e) ) \
4012   ROM_LOAD16_WORD_SWAP("236-bios.bin", 0x00000, 0x020000, CRC(853e6b96) SHA1(de369cb4a7df147b55168fa7aaf0b98c753b735e) )
40134013
40144014   ROM_REGION( 0x20000, "audiobios", 0 )
40154015   ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
src/mame/drivers/omegrace.c
r3115r3116
252252}
253253
254254
255static READ8_HANDLER( omegrace_vg_status_r )
256{
257   return avgdvg_done() ? 0x00 : 0x80;
258}
259
260
261
262255/*************************************
263256 *
264257 *  Input handlers
r3115r3116
347340   AM_RANGE(0x08, 0x08) AM_READ(omegrace_vg_go_r)
348341   AM_RANGE(0x09, 0x09) AM_READ(watchdog_reset_r)
349342   AM_RANGE(0x0a, 0x0a) AM_WRITE(avgdvg_reset_w)
350   AM_RANGE(0x0b, 0x0b) AM_READ(omegrace_vg_status_r)      /* vg_halt */
343   AM_RANGE(0x0b, 0x0b) AM_READ_PORT("AVGDVG")            /* vg_halt */
351344   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1")            /* DIP SW C4 */
352345   AM_RANGE(0x17, 0x17) AM_READ_PORT("DSW2")            /* DIP SW C6 */
353346   AM_RANGE(0x11, 0x11) AM_READ_PORT("IN0")            /* Player 1 input */
r3115r3116
355348   AM_RANGE(0x13, 0x13) AM_WRITE(omegrace_leds_w)         /* coin counters, leds, flip screen */
356349   AM_RANGE(0x14, 0x14) AM_WRITE(omegrace_soundlatch_w)   /* Sound command */
357350   AM_RANGE(0x15, 0x15) AM_READ(omegrace_spinner1_r)      /* 1st controller */
358   AM_RANGE(0x16, 0x16) AM_READ(input_port_5_r)         /* 2nd controller (cocktail) */
351   AM_RANGE(0x16, 0x16) AM_READ_PORT("SPIN1")            /* 2nd controller (cocktail) */
359352ADDRESS_MAP_END
360353
361354
r3115r3116
388381 *************************************/
389382
390383static INPUT_PORTS_START( omegrace )
391   PORT_START("DSW1")   /* SW0 */
392   PORT_DIPNAME( 0x03, 0x03, "1st Bonus Life" )   PORT_DIPLOCATION("SW1:1,2")
393   PORT_DIPSETTING (   0x00, "40k" )
394   PORT_DIPSETTING (   0x01, "50k" )
395   PORT_DIPSETTING (   0x02, "70k" )
396   PORT_DIPSETTING (   0x03, "100k" )
384   PORT_START("DSW1")
385   PORT_DIPNAME( 0x03, 0x03, "1st Bonus Life" )      PORT_DIPLOCATION("SW1:1,2")
386   PORT_DIPSETTING(   0x00, "40k" )
387   PORT_DIPSETTING(   0x01, "50k" )
388   PORT_DIPSETTING(   0x02, "70k" )
389   PORT_DIPSETTING(   0x03, "100k" )
397390   PORT_DIPNAME( 0x0c, 0x0c, "2nd & 3rd Bonus Life" )   PORT_DIPLOCATION("SW1:3,4")
398   PORT_DIPSETTING (   0x00, "150k 250k" )
399   PORT_DIPSETTING (   0x04, "250k 500k" )
400   PORT_DIPSETTING (   0x08, "500k 750k" )
401   PORT_DIPSETTING (   0x0c, "750k 1500k" )
402   PORT_DIPNAME( 0x30, 0x30, "Credit(s)/Ships" )   PORT_DIPLOCATION("SW1:5,6")
403   PORT_DIPSETTING (   0x00, "1C/2S 2C/4S" )
404   PORT_DIPSETTING (   0x10, "1C/2S 2C/5S" )
405   PORT_DIPSETTING (   0x20, "1C/3S 2C/6S" )
406   PORT_DIPSETTING (   0x30, "1C/3S 2C/7S" )
407   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )   PORT_DIPLOCATION("SW1:7")
408   PORT_DIPSETTING (   0x00, DEF_STR( Off ) )
409   PORT_DIPSETTING (   0x40, DEF_STR( On ) )
410   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )   PORT_DIPLOCATION("SW1:8")
411   PORT_DIPSETTING (   0x00, DEF_STR( Off ) )
412   PORT_DIPSETTING (   0x80, DEF_STR( On ) )
391   PORT_DIPSETTING(   0x00, "150k 250k" )
392   PORT_DIPSETTING(   0x04, "250k 500k" )
393   PORT_DIPSETTING(   0x08, "500k 750k" )
394   PORT_DIPSETTING(   0x0c, "750k 1500k" )
395   PORT_DIPNAME( 0x30, 0x30, "Credit(s)/Ships" )      PORT_DIPLOCATION("SW1:5,6")
396   PORT_DIPSETTING(   0x00, "1C/2S 2C/4S" )
397   PORT_DIPSETTING(   0x10, "1C/2S 2C/5S" )
398   PORT_DIPSETTING(   0x20, "1C/3S 2C/6S" )
399   PORT_DIPSETTING(   0x30, "1C/3S 2C/7S" )
400   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )      PORT_DIPLOCATION("SW1:7")
401   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
402   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
403   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )      PORT_DIPLOCATION("SW1:8")
404   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
405   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
413406
414   PORT_START("DSW2")   /* SW1 */
415   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW2:1,2,3")
416   PORT_DIPSETTING (   0x06, DEF_STR( 2C_1C ) )
417   PORT_DIPSETTING (   0x07, DEF_STR( 1C_1C ) )
418   PORT_DIPSETTING (   0x03, DEF_STR( 4C_5C ) )
419   PORT_DIPSETTING (   0x04, DEF_STR( 3C_4C ) )
420   PORT_DIPSETTING (   0x05, DEF_STR( 2C_3C ) )
421   PORT_DIPSETTING (   0x00, DEF_STR( 1C_2C ) )
422   PORT_DIPSETTING (   0x01, DEF_STR( 1C_3C ) )
423   PORT_DIPSETTING (   0x02, DEF_STR( 1C_5C ) )
424   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW2:4,5,6")
425   PORT_DIPSETTING (   0x30, DEF_STR( 2C_1C ) )
426   PORT_DIPSETTING (   0x38, DEF_STR( 1C_1C ) )
427   PORT_DIPSETTING (   0x18, DEF_STR( 4C_5C ) )
428   PORT_DIPSETTING (   0x20, DEF_STR( 3C_4C ) )
429   PORT_DIPSETTING (   0x28, DEF_STR( 2C_3C ) )
430   PORT_DIPSETTING (   0x00, DEF_STR( 1C_2C ) )
431   PORT_DIPSETTING (   0x08, DEF_STR( 1C_3C ) )
432   PORT_DIPSETTING (   0x10, DEF_STR( 1C_5C ) )
407   PORT_START("DSW2")
408   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW2:1,2,3")
409   PORT_DIPSETTING(   0x06, DEF_STR( 2C_1C ) )
410   PORT_DIPSETTING(   0x07, DEF_STR( 1C_1C ) )
411   PORT_DIPSETTING(   0x03, DEF_STR( 4C_5C ) )
412   PORT_DIPSETTING(   0x04, DEF_STR( 3C_4C ) )
413   PORT_DIPSETTING(   0x05, DEF_STR( 2C_3C ) )
414   PORT_DIPSETTING(   0x00, DEF_STR( 1C_2C ) )
415   PORT_DIPSETTING(   0x01, DEF_STR( 1C_3C ) )
416   PORT_DIPSETTING(   0x02, DEF_STR( 1C_5C ) )
417   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW2:4,5,6")
418   PORT_DIPSETTING(   0x30, DEF_STR( 2C_1C ) )
419   PORT_DIPSETTING(   0x38, DEF_STR( 1C_1C ) )
420   PORT_DIPSETTING(   0x18, DEF_STR( 4C_5C ) )
421   PORT_DIPSETTING(   0x20, DEF_STR( 3C_4C ) )
422   PORT_DIPSETTING(   0x28, DEF_STR( 2C_3C ) )
423   PORT_DIPSETTING(   0x00, DEF_STR( 1C_2C ) )
424   PORT_DIPSETTING(   0x08, DEF_STR( 1C_3C ) )
425   PORT_DIPSETTING(   0x10, DEF_STR( 1C_5C ) )
433426   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("SW2:7")
434   PORT_DIPSETTING (   0x00, DEF_STR( Off ) )
435   PORT_DIPSETTING (   0x40, DEF_STR( On ) )
436   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )   PORT_DIPLOCATION("SW2:8")
437   PORT_DIPSETTING (   0x00, DEF_STR( Upright ) )
438   PORT_DIPSETTING (   0x80, DEF_STR( Cocktail ) )
427   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
428   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
429   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW2:8")
430   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
431   PORT_DIPSETTING(   0x80, DEF_STR( Cocktail ) )
439432
440   PORT_START("IN0")   /* IN2 - port 0x11 */
433   PORT_START("IN0")      /* port 0x11 */
441434   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
442435   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
443436   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
447440   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
448441   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
449442
450   PORT_START("IN1")   /* IN3 - port 0x12 */
443   PORT_START("IN1")      /* port 0x12 */
451444   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
452445   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
453446   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("2 Players Start (1 credit)")
r3115r3116
457450   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("1 Player Start (1 credit)")
458451   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START3 ) PORT_NAME("1 Player Start (2 credits)")
459452
460   PORT_START("SPIN0")    /* IN4 - port 0x15 - spinner */
461   PORT_BIT(0x3f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(12) PORT_KEYDELTA(10)
453   PORT_START("SPIN0")      /* port 0x15 - spinner */
454   PORT_BIT( 0x3f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(12) PORT_KEYDELTA(10)
462455
463   PORT_START("SPIN1")    /* IN5 - port 0x16 - second spinner */
464   PORT_BIT(0x3f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(12) PORT_KEYDELTA(10) PORT_COCKTAIL
456   PORT_START("SPIN1")      /* port 0x16 - second spinner */
457   PORT_BIT( 0x3f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(12) PORT_KEYDELTA(10) PORT_COCKTAIL
458
459   PORT_START("AVGDVG")   /* port 0x0b */
460   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
465461INPUT_PORTS_END
466462
467463
src/mame/drivers/mystwarr.c
r3115r3116
119119{
120120   if (ACCESSING_BITS_0_7)
121121   {
122      int res = input_port_read(machine, "IN1") | eeprom_read_bit();
122      int res = input_port_read(machine, "IN1");
123123
124124      if (init_eeprom_count)
125125      {
r3115r3116
139139{
140140   if (ACCESSING_BITS_0_7)
141141   {
142      int res = input_port_read(machine, "IN1") | eeprom_read_bit();
142      int res = input_port_read(machine, "IN1");
143143
144144      if (init_eeprom_count)
145145      {
r3115r3116
173173{
174174   if (ACCESSING_BITS_8_15)
175175   {
176      return (input_port_read(machine, "IN1") | eeprom_read_bit())<<8;
176      return input_port_read(machine, "IN1") << 8;
177177   }
178178
179179   return input_port_read(machine, "P2");
r3115r3116
11011101   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
11021102
11031103   PORT_START("IN1")
1104   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
1104   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
11051105   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
11061106   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
11071107   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* game loops if this is set */
1108   PORT_DIPNAME( 0x10, 0x00, "Sound Output")
1109   PORT_DIPSETTING(    0x10, DEF_STR( Mono ))
1110   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ))
1111   PORT_DIPNAME( 0x20, 0x20, "Coin Mechanism")
1112   PORT_DIPSETTING(    0x20, "Common")
1113   PORT_DIPSETTING(    0x00, "Independant")
1114   PORT_DIPNAME( 0x40, 0x40, "Number of Players")
1115   PORT_DIPSETTING(    0x00, "4")
1116   PORT_DIPSETTING(    0x40, "2")
1108   PORT_DIPNAME( 0x10, 0x00, "Sound Output" )
1109   PORT_DIPSETTING(    0x10, DEF_STR( Mono ) )
1110   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ) )
1111   PORT_DIPNAME( 0x20, 0x20, "Coin Mechanism" )
1112   PORT_DIPSETTING(    0x20, "Common" )
1113   PORT_DIPSETTING(    0x00, "Independant" )
1114   PORT_DIPNAME( 0x40, 0x40, "Number of Players" )
1115   PORT_DIPSETTING(    0x00, "4" )
1116   PORT_DIPSETTING(    0x40, "2" )
11171117   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
11181118
11191119   PORT_START("P1")
r3115r3116
11691169   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
11701170
11711171   PORT_START("IN1")
1172   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
1172   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
11731173   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
11741174   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )
11751175   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
1176   PORT_DIPNAME( 0x10, 0x00, "Sound Output")
1177   PORT_DIPSETTING(    0x10, DEF_STR( Mono ))
1178   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ))
1179   PORT_DIPNAME( 0x20, 0x20, "Coin Mechanism")
1180   PORT_DIPSETTING(    0x20, "Common")
1181   PORT_DIPSETTING(    0x00, "Independant")
1182   PORT_DIPNAME( 0x40, 0x40, "Number of Players")
1183   PORT_DIPSETTING(    0x00, "4")
1184   PORT_DIPSETTING(    0x40, "2")
1185   PORT_DIPNAME( 0x80, 0x80, "Continuous Energy Increment")
1186   PORT_DIPSETTING(    0x80, DEF_STR( No ))
1187   PORT_DIPSETTING(    0x00, DEF_STR( Yes ))
1176   PORT_DIPNAME( 0x10, 0x00, "Sound Output" )
1177   PORT_DIPSETTING(    0x10, DEF_STR( Mono ) )
1178   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ) )
1179   PORT_DIPNAME( 0x20, 0x20, "Coin Mechanism" )
1180   PORT_DIPSETTING(    0x20, "Common" )
1181   PORT_DIPSETTING(    0x00, "Independant" )
1182   PORT_DIPNAME( 0x40, 0x40, "Number of Players" )
1183   PORT_DIPSETTING(    0x00, "4" )
1184   PORT_DIPSETTING(    0x40, "2" )
1185   PORT_DIPNAME( 0x80, 0x80, "Continuous Energy Increment" )
1186   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
1187   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
11881188
11891189   PORT_START("P1")
11901190   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
12391239   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
12401240
12411241   PORT_START("IN1")
1242   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
1242   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
12431243   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
12441244   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )
12451245   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
1246   PORT_DIPNAME( 0x10, 0x00, "Sound Output")
1247   PORT_DIPSETTING(    0x10, DEF_STR( Mono ))
1248   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ))
1246   PORT_DIPNAME( 0x10, 0x00, "Sound Output" )
1247   PORT_DIPSETTING(    0x10, DEF_STR( Mono ) )
1248   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ) )
12491249   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
12501250   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
12511251   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1252   PORT_DIPNAME( 0x40, 0x40, "Coin Mechanism")
1253   PORT_DIPSETTING(    0x40, "Common")
1254   PORT_DIPSETTING(    0x00, "Independant")
1255   PORT_DIPNAME( 0x80, 0x80, "Number of Players")
1256   PORT_DIPSETTING(    0x00, "3")
1257   PORT_DIPSETTING(    0x80, "2")
1252   PORT_DIPNAME( 0x40, 0x40, "Coin Mechanism" )
1253   PORT_DIPSETTING(    0x40, "Common" )
1254   PORT_DIPSETTING(    0x00, "Independant" )
1255   PORT_DIPNAME( 0x80, 0x80, "Number of Players" )
1256   PORT_DIPSETTING(    0x00, "3" )
1257   PORT_DIPSETTING(    0x80, "2" )
12581258
12591259   PORT_START("P1")
12601260   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
13091309   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
13101310
13111311   PORT_START("IN1")
1312   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
1312   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
13131313   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
13141314   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )
13151315   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
1316   PORT_DIPNAME( 0x10, 0x00, "Sound Output")
1317   PORT_DIPSETTING(    0x10, DEF_STR( Mono ))
1318   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ))
1316   PORT_DIPNAME( 0x10, 0x00, "Sound Output" )
1317   PORT_DIPSETTING(    0x10, DEF_STR( Mono ) )
1318   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ) )
13191319   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
13201320   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
13211321   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
13751375   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
13761376
13771377   PORT_START("IN1")
1378   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
1378   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
13791379   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
13801380   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
13811381   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* game loops if this is set */
1382   PORT_DIPNAME( 0x10, 0x00, "Sound Output")
1383   PORT_DIPSETTING(    0x10, DEF_STR( Mono ))
1384   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ))
1382   PORT_DIPNAME( 0x10, 0x00, "Sound Output" )
1383   PORT_DIPSETTING(    0x10, DEF_STR( Mono ) )
1384   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ) )
13851385   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
13861386   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
13871387   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/klax.c
r3115r3116
3232
3333static void update_interrupts(running_machine *machine)
3434{
35   int newstate = 0;
36
37   if (atarigen_video_int_state || atarigen_scanline_int_state)
38      newstate = 4;
39
40   if (newstate)
41      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
42   else
43      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
35   cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state || atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
4436}
4537
4638
src/mame/drivers/quizpani.c
r3115r3116
4848
4949static ADDRESS_MAP_START( quizpani_readmem, ADDRESS_SPACE_PROGRAM, 16 )
5050   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
51   AM_RANGE(0x100000, 0x100001) AM_READ(input_port_0_word_r)
52   AM_RANGE(0x100002, 0x100003) AM_READ(input_port_1_word_r)
53   AM_RANGE(0x100008, 0x100009) AM_READ(input_port_2_word_r)
54   AM_RANGE(0x10000a, 0x10000b) AM_READ(input_port_3_word_r)
51   AM_RANGE(0x100000, 0x100001) AM_READ_PORT("SYSTEM")
52   AM_RANGE(0x100002, 0x100003) AM_READ_PORT("P1_P2")
53   AM_RANGE(0x100008, 0x100009) AM_READ_PORT("DSW1")
54   AM_RANGE(0x10000a, 0x10000b) AM_READ_PORT("DSW2")
5555   AM_RANGE(0x104000, 0x104001) AM_READ(okim6295_status_0_lsb_r)
5656   AM_RANGE(0x108000, 0x1083ff) AM_READ(SMH_RAM)
5757   AM_RANGE(0x110000, 0x113fff) AM_READ(SMH_RAM)
src/mame/drivers/djmain.c
r3115r3116
783783   PORT_DIPNAME( 0x10000000, 0x10000000, "All Song Mode" )      /* DSW 3-2 */
784784   PORT_DIPSETTING(          0x10000000, DEF_STR( Off ) )
785785   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
786   PORT_DIPNAME( 0x02000000, 0x02000000, "Enable"RAVE\"" )      /* DSW 3-5 */
786   PORT_DIPNAME( 0x02000000, 0x02000000, "Enable\"RAVE\"" )      /* DSW 3-5 */
787787   PORT_DIPSETTING(          0x02000000, DEF_STR( Off ) )
788788   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
789789   PORT_DIPNAME( 0x01000000, 0x01000000, "Bonus Track" )      /* DSW 3-6 */
src/mame/drivers/peplus.c
r3115r3116
8989          pepp0250     1
9090          pepp0447     2
9191          pepp0516     1
92          peps0014     1
93          peps0022     1
94          peps0043     1
95          peps0045     1
96          peps0308     1
9297          pebe0014     1
9398          peke1012     1
9499          peps0615     2
95100          peps0716     2
101          pex2069p     2
96102          pexp0019     2
97103          pexp0112     2
98104          pexs0006     2
src/mame/drivers/segas24.c
r3115r3116
17721772
17731773static INPUT_PORTS_START( mahmajn )
17741774   PORT_START("MJ0")
1775   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("A") PORT_CODE(KEYCODE_A)
1776   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("B") PORT_CODE(KEYCODE_B)
1777   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("C") PORT_CODE(KEYCODE_C)
1778   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("D") PORT_CODE(KEYCODE_D)
1775   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
1776   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_B )
1777   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_C )
1778   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_D )
17791779   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
17801780
17811781   PORT_START("MJ1")
1782   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("E") PORT_CODE(KEYCODE_E)
1783   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("F") PORT_CODE(KEYCODE_F)
1784   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("G") PORT_CODE(KEYCODE_G)
1785   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("H") PORT_CODE(KEYCODE_H)
1782   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_E )
1783   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
1784   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_G )
1785   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_H )
17861786   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
17871787
17881788   PORT_START("MJ2")
1789   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("I") PORT_CODE(KEYCODE_I)
1790   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("J") PORT_CODE(KEYCODE_J)
1791   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("K") PORT_CODE(KEYCODE_K)
1792   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("L") PORT_CODE(KEYCODE_L)
1789   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_I )
1790   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_J )
1791   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
1792   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_L )
17931793   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
17941794
17951795   PORT_START("MJ3")
1796   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("M") PORT_CODE(KEYCODE_M)
1797   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("N") PORT_CODE(KEYCODE_N)
1798   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Chi") PORT_CODE(KEYCODE_SPACE)
1799   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pon") PORT_CODE(KEYCODE_LALT)
1796   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_M )
1797   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_N )
1798   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
1799   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
18001800   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
18011801
18021802   PORT_START("MJ4")
r3115r3116
18041804   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
18051805
18061806   PORT_START("MJ5")
1807   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Kan") PORT_CODE(KEYCODE_LCONTROL)
1808   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Reach") PORT_CODE(KEYCODE_LSHIFT)
1809   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Ron") PORT_CODE(KEYCODE_Z)
1807   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
1808   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
1809   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
18101810   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
18111811
18121812   PORT_START("P1")
src/mame/drivers/segas16a.c
r3115r3116
147147#include "system16.h"
148148#include "machine/8255ppi.h"
149149#include "machine/fd1089.h"
150#include "cpu/i8039/i8039.h"
150#include "cpu/mcs48/mcs48.h"
151151#include "sound/dac.h"
152152#include "sound/2151intf.h"
153153
r3115r3116
848848 *
849849 *************************************/
850850
851static ADDRESS_MAP_START( n7751_map, ADDRESS_SPACE_PROGRAM, 8 )
852   ADDRESS_MAP_UNMAP_HIGH
853   AM_RANGE(0x0000, 0x03ff) AM_ROM
854ADDRESS_MAP_END
855
856851static ADDRESS_MAP_START( n7751_portmap, ADDRESS_SPACE_IO, 8 )
857   AM_RANGE(I8039_bus,I8039_bus) AM_READ(n7751_rom_r)
858   AM_RANGE(I8039_t1, I8039_t1)  AM_READ(n7751_t1_r)
859   AM_RANGE(I8039_p1, I8039_p1)  AM_WRITE(dac_0_data_w)
860   AM_RANGE(I8039_p2, I8039_p2)  AM_READWRITE(n7751_command_r, n7751_busy_w)
861   AM_RANGE(I8039_p4, I8039_p7)  AM_WRITE(n7751_rom_offset_w)
852   AM_RANGE(MCS48_PORT_BUS,MCS48_PORT_BUS) AM_READ(n7751_rom_r)
853   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1)  AM_READ(n7751_t1_r)
854   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1)  AM_WRITE(dac_0_data_w)
855   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2)  AM_READWRITE(n7751_command_r, n7751_busy_w)
856   AM_RANGE(MCS48_PORT_P4, MCS48_PORT_P7)  AM_WRITE(n7751_rom_offset_w)
862857ADDRESS_MAP_END
863858
864859
r3115r3116
17801775   MDRV_CPU_IO_MAP(sound_portmap,0)
17811776
17821777   MDRV_CPU_ADD("n7751", N7751, 6000000)
1783   MDRV_CPU_PROGRAM_MAP(n7751_map,0)
17841778   MDRV_CPU_IO_MAP(n7751_portmap,0)
17851779
17861780   MDRV_MACHINE_RESET(system16a)
r3115r3116
19271921
19281922   ROM_REGION( 0x10000, "sound", 0 ) /* sound CPU */
19291923   ROM_LOAD( "10284", 0x00000, 0x8000, CRC(8ff09116) SHA1(8b99b6d2499897cfbd037a7e7cf5bc53bce8a63a) )
1924
1925   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
1926   ROM_LOAD( "317-0018.key", 0x0000, 0x2000, CRC(fee04be8) SHA1(c58d78299ef4cede517be823a8a8a90e46c6ba0d) )
19301927ROM_END
19311928
19321929
r3115r3116
20042001   ROM_REGION( 0x10000, "n7751data", 0 ) /* 7751 sound data (not used yet) */
20052002   ROM_LOAD( "10435.1", 0x0000, 0x8000, CRC(ad89f6e3) SHA1(812a132142065b0fe13b5f0ac534b6d8830ba102) )
20062003   ROM_LOAD( "10436.2", 0x8000, 0x8000, CRC(96c76613) SHA1(fe3e4e649fd2cb2453eec0c92015bd54b3b9a1b5) )
2004
2005   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
2006   ROM_LOAD( "317-0021.key", 0x0000, 0x2000, BAD_DUMP CRC(85be8eac) SHA1(3857bf43b3b0ab60c04223e2393d99504a730d73) )
20072007ROM_END
20082008
20092009/**************************************************************************************************************************
20102010 **************************************************************************************************************************
20112011 **************************************************************************************************************************
20122012    Alien Syndrome, System 16A
2013    CPU: FD1089B
2013    CPU: FD1089B 317-0037
20142014 */
20152015
20162016ROM_START( aliensy5 )
r3115r3116
20552055   ROM_LOAD( "10706", 0x00000, 0x8000, CRC(aa114acc) SHA1(81a2b3586ae90bc7fc55b82478ffe182ac49983e) )
20562056   ROM_LOAD( "10707", 0x08000, 0x8000, CRC(800c1d82) SHA1(aac4123bd35f87da09264649f4cf8326b2ba3cb8) )
20572057   ROM_LOAD( "10708", 0x10000, 0x8000, CRC(5921ef52) SHA1(eff9978361692e6e60a9c6caf5740dd6182cfe4a) )
2058
2059   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
2060   ROM_LOAD( "317-0037.key", 0x0000, 0x2000, CRC(49e882e5) SHA1(29d87af8fc775b22a9a546c112f8f5e7f700ac1a) )
20582061ROM_END
20592062
20602063
r3115r3116
20622065 **************************************************************************************************************************
20632066 **************************************************************************************************************************
20642067    Alien Syndrome, pre-System 16
2065    CPU: FD1089A
2068    CPU: FD1089A 317-0033
20662069 */
20672070ROM_START( aliensy2 )
20682071   ROM_REGION( 0x40000, "main", 0 ) /* 68000 code */
r3115r3116
21062109   ROM_LOAD( "10706", 0x00000, 0x8000, CRC(aa114acc) SHA1(81a2b3586ae90bc7fc55b82478ffe182ac49983e) )
21072110   ROM_LOAD( "10707", 0x08000, 0x8000, CRC(800c1d82) SHA1(aac4123bd35f87da09264649f4cf8326b2ba3cb8) )
21082111   ROM_LOAD( "10708", 0x10000, 0x8000, CRC(5921ef52) SHA1(eff9978361692e6e60a9c6caf5740dd6182cfe4a) )
2112
2113   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
2114   ROM_LOAD( "317-0033.key", 0x0000, 0x2000, CRC(49e882e5) SHA1(29d87af8fc775b22a9a546c112f8f5e7f700ac1a) )
21092115ROM_END
21102116
21112117/**************************************************************************************************************************
r3115r3116
21542160   ROM_LOAD( "10706", 0x00000, 0x8000, CRC(aa114acc) SHA1(81a2b3586ae90bc7fc55b82478ffe182ac49983e) )
21552161   ROM_LOAD( "10707", 0x08000, 0x8000, CRC(800c1d82) SHA1(aac4123bd35f87da09264649f4cf8326b2ba3cb8) )
21562162   ROM_LOAD( "10708", 0x10000, 0x8000, CRC(5921ef52) SHA1(eff9978361692e6e60a9c6caf5740dd6182cfe4a) )
2163
2164   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
2165   ROM_LOAD( "317-0033.key", 0x0000, 0x2000, CRC(49e882e5) SHA1(29d87af8fc775b22a9a546c112f8f5e7f700ac1a) )
21572166ROM_END
21582167
21592168
r3115r3116
26322641
26332642   ROM_REGION( 0x10000, "sound", 0 ) /* sound CPU */
26342643   ROM_LOAD( "epr10759.12", 0x0000, 0x8000, CRC(d7f9649f) SHA1(ce4abe7dd7e33da048569d7817063345fab75ea7) )
2644
2645   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
2646   ROM_LOAD( "317-0027.key", 0x0000, 0x2000, BAD_DUMP CRC(9a5307b2) SHA1(2fcc576ed95b96ff6ea71252c3fab33b8b3fc1f5) )
26352647ROM_END
26362648
26372649
r3115r3116
28322844   ROM_LOAD( "epr12229.2", 0x08000, 0x8000, CRC(b7aa015c) SHA1(0ef023f73722e27180c271b207a5097220f40b5e) )
28332845   ROM_LOAD( "epr12230.4", 0x10000, 0x8000, CRC(d0f61fd4) SHA1(e6f29459d7395122f26957f56e38926aebd9004c) )
28342846   ROM_LOAD( "epr12231.5", 0x18000, 0x8000, CRC(780bdc57) SHA1(8c859043bba389292604385b88c743728180f9a9) )
2847
2848   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
2849   ROM_LOAD( "317-5021.key", 0x0000, 0x2000, BAD_DUMP CRC(4a3422e4) SHA1(69a32a6987ff2481f6d6cbbe399269a2461b8bad) )
28352850ROM_END
28362851
28372852
r3115r3116
29983013
29993014   ROM_REGION( 0x08000, "n7751data", 0 ) /* 7751 sound data */
30003015   ROM_LOAD( "epr10547.1", 0x0000, 0x8000, CRC(d24ffc4b) SHA1(3b250e1f026664f7a37f65d1c1a07381e88f11e8) )
3016
3017   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
3018   ROM_LOAD( "317-0024.key", 0x0000, 0x2000, BAD_DUMP CRC(ee42ec18) SHA1(cb65dd681f38ce20440ddcb01a935c2c8eecc77f) )
30013019ROM_END
30023020
30033021
r3115r3116
30823100
30833101   ROM_REGION( 0x10000, "sound", 0 ) /* sound CPU */
30843102   ROM_LOAD( "epr12089.12", 0x0000, 0x8000, CRC(8321eb0b) SHA1(61cf95833c0aa38e35fc18db39d4ec74e4aaf01e) )
3103
3104   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
3105   ROM_LOAD( "317-wb35.key", 0x0000, 0x2000, BAD_DUMP CRC(8a2e0575) SHA1(e43a2c8ca102ec38871067685a860da53d748765) )
30853106ROM_END
30863107
30873108/*************************************
r3115r3116
31033124}
31043125
31053126
3106static DRIVER_INIT( afighter )
3127static DRIVER_INIT( fd1089a_16a )
31073128{
31083129   system16a_generic_init(machine);
3109   fd1089_decrypt_0018(machine);
3130   fd1089a_decrypt(machine);
31103131}
31113132
31123133
3113static DRIVER_INIT( alexkid1 )
3134static DRIVER_INIT( fd1089b_16a )
31143135{
31153136   system16a_generic_init(machine);
3116   fd1089_decrypt_0021(machine);
3137   fd1089b_decrypt(machine);
31173138}
31183139
31193140
3120static DRIVER_INIT( aliensy1 )
3121{
3122   system16a_generic_init(machine);
3123   fd1089_decrypt_0033(machine);
3124}
3125
3126static DRIVER_INIT( aliensy5 )
3127{
3128   system16a_generic_init(machine);
3129   fd1089_decrypt_0037(machine);
3130}
3131
31323141static DRIVER_INIT( bodyslam )
31333142{
31343143   system16a_generic_init(machine);
r3115r3116
31583167static DRIVER_INIT( sdi )
31593168{
31603169   system16a_generic_init(machine);
3161   fd1089_decrypt_0027(machine);
3170   fd1089b_decrypt(machine);
31623171   custom_io_r = sdi_custom_io_r;
31633172}
31643173
r3115r3116
31663175static DRIVER_INIT( sjryukoa )
31673176{
31683177   system16a_generic_init(machine);
3169   fd1089_decrypt_5021(machine);
3178   fd1089b_decrypt(machine);
31703179   custom_io_r = sjryuko_custom_io_r;
31713180   lamp_changed_w = sjryuko_lamp_changed_w;
31723181}
31733182
31743183
3175static DRIVER_INIT( timesca1 )
3176{
3177   system16a_generic_init(machine);
3178   fd1089_decrypt_0024(machine);
3179}
3180
3181static DRIVER_INIT( wb35 )
3182{
3183   system16a_generic_init(machine);
3184   fd1089_decrypt_wb35(machine);
3185}
3186
31873184/*************************************
31883185 *
31893186 *  Game driver(s)
r3115r3116
32003197GAME( 1986, quart2,   quartet,  system16a,        quart2,   generic_16a, ROT0,   "Sega",           "Quartet 2 (unprotected)", 0 )
32013198
32023199/* System 16A */
3203GAME( 1987, aliensy5, aliensyn, system16a,        aliensyn, aliensy5,    ROT0,   "Sega",           "Alien Syndrome (set 5, System 16A, FD1089B 317-0037)", 0 )
3204GAME( 1987, aliensy2, aliensyn, system16a,        aliensyn, aliensy1,    ROT0,   "Sega",           "Alien Syndrome (set 2, System 16A, FD1089A 317-0033)", 0 )
3205GAME( 1987, aliensy1, aliensyn, system16a,        aliensy1, aliensy1,    ROT0,   "Sega",           "Alien Syndrome (set 1, System 16A, FD1089A 317-0033)", 0 )
3200GAME( 1987, aliensy5, aliensyn, system16a,        aliensyn, fd1089b_16a, ROT0,   "Sega",           "Alien Syndrome (set 5, System 16A, FD1089B 317-0037)", 0 )
3201GAME( 1987, aliensy2, aliensyn, system16a,        aliensyn, fd1089a_16a, ROT0,   "Sega",           "Alien Syndrome (set 2, System 16A, FD1089A 317-0033)", 0 )
3202GAME( 1987, aliensy1, aliensyn, system16a,        aliensy1, fd1089a_16a, ROT0,   "Sega",           "Alien Syndrome (set 1, System 16A, FD1089A 317-0033)", 0 )
32063203GAME( 1988, aceattaa, aceattac, system16a       , aceattaa, aceattaa,    ROT270, "Sega",           "Ace Attacker (Japan, System 16A, FD1094 317-0060)", 0 )
3207GAME( 1986, afighter, 0,        system16a_no7751, afighter, afighter,    ROT270, "Sega",           "Action Fighter (FD1089A 317-0018)", 0 )
3204GAME( 1986, afighter, 0,        system16a_no7751, afighter, fd1089a_16a, ROT270, "Sega",           "Action Fighter (FD1089A 317-0018)", 0 )
32083205GAME( 1986, alexkidd, 0,        system16a,        alexkidd, generic_16a, ROT0,   "Sega",           "Alex Kidd: The Lost Stars (set 2, unprotected)", 0 )
3209GAME( 1986, alexkid1, alexkidd, system16a,        alexkidd, alexkid1,    ROT0,   "Sega",           "Alex Kidd: The Lost Stars (set 1, FD1089A 317-0021)", 0 )
3206GAME( 1986, alexkid1, alexkidd, system16a,        alexkidd, fd1089a_16a, ROT0,   "Sega",           "Alex Kidd: The Lost Stars (set 1, FD1089A 317-0021)", 0 )
32103207GAME( 1986, fantzone, 0,        system16a_no7751, fantzone, generic_16a, ROT0,   "Sega",           "Fantasy Zone (set 2, unprotected)", 0 )
32113208GAME( 1986, fantzon1, fantzone, system16a_no7751, fantzone, generic_16a, ROT0,   "Sega",           "Fantasy Zone (set 1, unprotected)", 0 )
32123209GAME( 1988, pshot16a, passsht,  system16a,        pshot16a, pshot16a,    ROT270, "Sega",           "Passing Shot (Japan, 4 Players, System 16A, FD1094 317-0071)", 0 )
r3115r3116
32173214GAME( 1987, sjryuko1, sjryuko,  system16a,        sjryuko,  sjryukoa,    ROT0,   "White Board",    "Sukeban Jansi Ryuko (set 1, System 16A, FD1089B 317-5021)", 0 )
32183215GAME( 1988, tetris,   0,        system16a_no7751, tetris,   generic_16a, ROT0,   "Sega",           "Tetris (set 4, Japan, System 16A, FD1094 317-0093)", 0 )
32193216GAME( 1988, tetris3,  tetris,   system16a_no7751, tetris,   generic_16a, ROT0,   "Sega",           "Tetris (set 3, Japan, System 16A, FD1094 317-0093a)", 0 )
3220GAME( 1987, timesca1, timescan, system16a,        timescan, timesca1,    ROT270, "Sega",           "Time Scanner (set 1, System 16A, FD1089B 317-0024)", 0 )
3217GAME( 1987, timesca1, timescan, system16a,        timescan, fd1089b_16a, ROT270, "Sega",           "Time Scanner (set 1, System 16A, FD1089B 317-0024)", 0 )
32213218GAME( 1988, wb31,     wb3,      system16a_no7751, wb3,      generic_16a, ROT0,   "Sega / Westone", "Wonder Boy III - Monster Lair (set 1, System 16A, FD1094 317-0084)", 0 )
3222GAME( 1988, wb35,     wb3,      system16a_no7751, wb3,      wb35,        ROT0,   "Sega / Westone", "Wonder Boy III - Monster Lair (set 5, System 16A, FD1089A 317-xxxx)", GAME_NOT_WORKING )
3219GAME( 1988, wb35,     wb3,      system16a_no7751, wb3,      fd1089a_16a, ROT0,   "Sega / Westone", "Wonder Boy III - Monster Lair (set 5, System 16A, FD1089A 317-xxxx)", GAME_NOT_WORKING )
src/mame/drivers/neogeo.c
r3115r3116
200200
201201static void update_interrupts(running_machine *machine)
202202{
203   int level = 0;
204
205   /* determine which interrupt is active - order implies priority */
206   if (vblank_interrupt_pending) level = 1;
207   if (display_position_interrupt_pending) level = 2;
208   if (irq3_pending) level = 3;
209
210   /* either set or clear the appropriate lines */
211   if (level)
212      cpunum_set_input_line(machine, 0, level, ASSERT_LINE);
213   else
214      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
203   cpunum_set_input_line(machine, 0, 1, vblank_interrupt_pending ? ASSERT_LINE : CLEAR_LINE);
204   cpunum_set_input_line(machine, 0, 2, display_position_interrupt_pending ? ASSERT_LINE : CLEAR_LINE);
205   cpunum_set_input_line(machine, 0, 3, irq3_pending ? ASSERT_LINE : CLEAR_LINE);
215206}
216207
217208
r3115r3116
11611152
11621153
11631154#define STANDARD_IN1                                          \
1164   PORT_START("IN1")                                       \
1155   PORT_START("IN1")                                          \
11651156   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )                     \
11661157   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)      \
11671158   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)      \
r3115r3116
11741165
11751166
11761167#define STANDARD_IN2                                                            \
1177   PORT_START("IN2")                                                         \
1168   PORT_START("IN2")                                                            \
11781169   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )                                       \
11791170   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )                                       \
11801171   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Next Game") PORT_CODE(KEYCODE_7)      \
11811172   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 )                                       \
11821173   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Previous Game") PORT_CODE(KEYCODE_8)   \
1183   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, 0)            \
1174   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, NULL)         \
11841175   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
11851176
11861177
11871178#define STANDARD_IN3                                                            \
1188   PORT_START("IN3")                                                         \
1179   PORT_START("IN3")                                                            \
11891180   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )                                       \
11901181   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )                                       \
11911182   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )                                       \
11921183   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* having this ACTIVE_HIGH causes you to start with 2 credits using USA bios roms */   \
11931184   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* having this ACTIVE_HIGH causes you to start with 2 credits using USA bios roms */   \
11941185   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* what is this? */                         \
1195   PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_calendar_status, 0)            \
1196   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_audio_result, 0)
1186   PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_calendar_status, NULL)         \
1187   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_audio_result, NULL)
11971188
11981189
11991190#define STANDARD_IN4                                                         \
1200   PORT_START("IN4")                                                      \
1191   PORT_START("IN4")                                                         \
12011192   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN )                                    \
12021193   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN )                                    \
12031194   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN )                                    \
src/mame/drivers/segahang.c
r3115r3116
14001400 **************************************************************************************************************************
14011401 **************************************************************************************************************************
14021402    Enduro Racer
1403    CPU: FD1089A (317-0013A)
1403    CPU: FD1089B (317-0013A)
14041404    YM2151 sound board
14051405
14061406     ASSY CPU BD 837-6001-01
r3115r3116
14721472
14731473   ROM_REGION( 0x2000, "proms", 0 ) /* zoom table */
14741474   ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
1475
1476   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
1477   ROM_LOAD( "317-0013a.key", 0x0000, 0x2000, CRC(295e6737) SHA1(2eff36f1f24db1154cf970d4c9fd481ae4f9a57c) )
14751478ROM_END
14761479
14771480/**************************************************************************************************************************
14781481    Enduro Racer
1479    CPU: FD1089A (317-0013A)
1482    CPU: FD1089B (317-0013A)
14801483    YM2203 sound board
14811484
14821485     ASSY CPU BD 837-6001-01
r3115r3116
15491552
15501553   ROM_REGION( 0x2000, "proms", 0 ) /* zoom table */
15511554   ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
1555
1556   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
1557   ROM_LOAD( "317-0013a.key", 0x0000, 0x2000, CRC(295e6737) SHA1(2eff36f1f24db1154cf970d4c9fd481ae4f9a57c) )
15521558ROM_END
15531559
15541560/**************************************************************************************************************************
r3115r3116
17231729static DRIVER_INIT( enduror )
17241730{
17251731   hangon_generic_init();
1726   fd1089_decrypt_0013A(machine);
1732   fd1089b_decrypt(machine);
17271733}
17281734
17291735
src/mame/drivers/sprcros2.c
r3115r3116
140140
141141static ADDRESS_MAP_START( sprcros2_m_readport, ADDRESS_SPACE_IO, 8 )
142142   ADDRESS_MAP_GLOBAL_MASK(0xff)
143   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
144   AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r)
145   AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r)
146   AM_RANGE(0x04, 0x04) AM_READ(input_port_3_r)
147   AM_RANGE(0x05, 0x05) AM_READ(input_port_4_r)
143   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
144   AM_RANGE(0x01, 0x01) AM_READ_PORT("P2")
145   AM_RANGE(0x02, 0x02) AM_READ_PORT("EXTRA")
146   AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW1")
147   AM_RANGE(0x05, 0x05) AM_READ_PORT("DSW2")
148148ADDRESS_MAP_END
149149
150150static ADDRESS_MAP_START( sprcros2_m_writeport, ADDRESS_SPACE_IO, 8 )
r3115r3116
181181ADDRESS_MAP_END
182182
183183static INPUT_PORTS_START( sprcros2 )
184   PORT_START("P1")   /* IN0 */
184   PORT_START("P1")
185185   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
186186   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
187187   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
r3115r3116
191191   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
192192   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
193193
194   PORT_START("P2")   /* IN1 */
194   PORT_START("P2")
195195   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
196196   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
197197   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
r3115r3116
201201   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
202202   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
203203
204   PORT_START("EXTRA")   /* IN2 */
204   PORT_START("EXTRA")
205205   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
206206   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
207207   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
r3115r3116
210210   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
211211   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
212212
213   PORT_START("DSW1")   /* IN3 */
213   PORT_START("DSW1")
214214   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
215215   PORT_DIPSETTING(    0x07, DEF_STR( 3C_1C ) )
216216   PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
r3115r3116
222222   PORT_DIPSETTING(    0x05, DEF_STR( 1C_6C ) )
223223   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
224224
225   PORT_START("DSW2")   /* IN4 */
225   PORT_START("DSW2")
226226   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
227227   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
228228   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
src/mame/drivers/statriv2.c
r3115r3116
325325ADDRESS_MAP_END
326326
327327static ADDRESS_MAP_START( statriv2_readport, ADDRESS_SPACE_IO, 8 )
328   AM_RANGE(0x20, 0x20) AM_READ(input_port_0_r)
329   AM_RANGE(0x21, 0x21) AM_READ(input_port_1_r)
328   AM_RANGE(0x20, 0x20) AM_READ_PORT("IN0")
329   AM_RANGE(0x21, 0x21) AM_READ_PORT("IN1")
330330   AM_RANGE(0x2b, 0x2b) AM_READ(statriv2_questions_read)      // question data
331331   AM_RANGE(0xb1, 0xb1) AM_READ(ay8910_read_port_0_r)      // ???
332332   AM_RANGE(0xce, 0xce) AM_READ(SMH_NOP)            // ???
r3115r3116
343343ADDRESS_MAP_END
344344
345345static ADDRESS_MAP_START( statriv4_readport, ADDRESS_SPACE_IO, 8 )
346   AM_RANGE(0x20, 0x20) AM_READ(input_port_0_r)
347   AM_RANGE(0x21, 0x21) AM_READ(input_port_1_r)
346   AM_RANGE(0x20, 0x20) AM_READ_PORT("IN0")
347   AM_RANGE(0x21, 0x21) AM_READ_PORT("IN1")
348348   AM_RANGE(0x28, 0x28) AM_READ(statriv2_questions_read)      // question data
349349   AM_RANGE(0xb1, 0xb1) AM_READ(ay8910_read_port_0_r)      // ???
350350   AM_RANGE(0xce, 0xce) AM_READ(SMH_NOP)            // ???
r3115r3116
361361ADDRESS_MAP_END
362362
363363static ADDRESS_MAP_START( supertr2_readport, ADDRESS_SPACE_IO, 8 )
364   AM_RANGE(0x20, 0x20) AM_READ(input_port_0_r)
365   AM_RANGE(0x21, 0x21) AM_READ(input_port_1_r)
364   AM_RANGE(0x20, 0x20) AM_READ_PORT("IN0")
365   AM_RANGE(0x21, 0x21) AM_READ_PORT("IN1")
366366   AM_RANGE(0x28, 0x28) AM_READ(supertr2_questions_read)                // question data
367367   AM_RANGE(0xb1, 0xb1) AM_READ(ay8910_read_port_0_r)      // ???
368368   AM_RANGE(0xce, 0xce) AM_READ(SMH_NOP)         // ???
r3115r3116
390390ADDRESS_MAP_END
391391
392392static ADDRESS_MAP_START( trivquiz_readport, ADDRESS_SPACE_IO, 8 )
393   AM_RANGE(0x20, 0x20) AM_READ(input_port_0_r)
394   AM_RANGE(0x21, 0x21) AM_READ(input_port_1_r)
393   AM_RANGE(0x20, 0x20) AM_READ_PORT("IN0")
394   AM_RANGE(0x21, 0x21) AM_READ_PORT("IN1")
395395   AM_RANGE(0x2a, 0x2a) AM_READ(statriv2_questions_read)                // question data
396396   AM_RANGE(0xb1, 0xb1) AM_READ(ay8910_read_port_0_r)      // ???
397397   AM_RANGE(0xce, 0xce) AM_READ(SMH_NOP)            // ???
398398ADDRESS_MAP_END
399399
400400static ADDRESS_MAP_START( supertr3_readport, ADDRESS_SPACE_IO, 8 )
401   AM_RANGE(0x20, 0x20) AM_READ(input_port_0_r)
402   AM_RANGE(0x21, 0x21) AM_READ(input_port_1_r)
401   AM_RANGE(0x20, 0x20) AM_READ_PORT("IN0")
402   AM_RANGE(0x21, 0x21) AM_READ_PORT("IN1")
403403   AM_RANGE(0x28, 0x28) AM_READ(supertr3_questions_read)                // question data
404404   AM_RANGE(0xb1, 0xb1) AM_READ(ay8910_read_port_0_r)      // ???
405405   AM_RANGE(0xce, 0xce) AM_READ(SMH_NOP)            // ???
406406ADDRESS_MAP_END
407407
408408static ADDRESS_MAP_START( hangman_readport, ADDRESS_SPACE_IO, 8 )
409   AM_RANGE(0x20, 0x20) AM_READ(input_port_0_r)
410   AM_RANGE(0x21, 0x21) AM_READ(input_port_1_r)
409   AM_RANGE(0x20, 0x20) AM_READ_PORT("IN0")
410   AM_RANGE(0x21, 0x21) AM_READ_PORT("IN1")
411411   AM_RANGE(0x28, 0x28) AM_READ(hangman_questions_read)                // question data
412412   AM_RANGE(0xb1, 0xb1) AM_READ(ay8910_read_port_0_r)      // ???
413413   AM_RANGE(0xce, 0xce) AM_READ(SMH_NOP)         // ???
src/mame/drivers/thunderj.c
r3115r3116
3636
3737static void update_interrupts(running_machine *machine)
3838{
39   int newstate = 0;
40   int newstate2 = 0;
41
42   if (atarigen_scanline_int_state)
43      newstate |= 4, newstate2 |= 4;
44   if (atarigen_sound_int_state)
45      newstate |= 6;
46
47   if (newstate)
48      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
49   else
50      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
51
52   if (newstate2)
53      cpunum_set_input_line(machine, 1, newstate2, ASSERT_LINE);
54   else
55      cpunum_set_input_line(machine, 1, 7, CLEAR_LINE);
39   cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
40   cpunum_set_input_line(machine, 1, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
41   cpunum_set_input_line(machine, 0, 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
5642}
5743
5844
r3115r3116
203189   AM_RANGE(0x0e0000, 0x0e0fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size)
204190   AM_RANGE(0x160000, 0x16ffff) AM_READWRITE(shared_ram_r, SMH_BANK1) AM_BASE(&shared_ram)
205191   AM_RANGE(0x1f0000, 0x1fffff) AM_WRITE(atarigen_eeprom_enable_w)
206   AM_RANGE(0x260000, 0x26000f) AM_READ(input_port_0_word_r)
207   AM_RANGE(0x260010, 0x260011) AM_READ(input_port_1_word_r)
192   AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
193   AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010")
208194   AM_RANGE(0x260012, 0x260013) AM_READ(special_port2_r)
209195   AM_RANGE(0x260030, 0x260031) AM_READ(atarigen_sound_r)
210196   AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
r3115r3116
235221   AM_RANGE(0x000000, 0x03ffff) AM_ROM
236222   AM_RANGE(0x060000, 0x07ffff) AM_ROM
237223   AM_RANGE(0x160000, 0x16ffff) AM_READWRITE(shared_ram_r, SMH_BANK1)
238   AM_RANGE(0x260000, 0x26000f) AM_READ(input_port_0_word_r)
239   AM_RANGE(0x260010, 0x260011) AM_READ(input_port_1_word_r)
224   AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
225   AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010")
240226   AM_RANGE(0x260012, 0x260013) AM_READ(special_port2_r)
241227   AM_RANGE(0x260030, 0x260031) AM_READ(atarigen_sound_r)
242228   AM_RANGE(0x360000, 0x360001) AM_WRITE(atarigen_video_int_ack_w)
r3115r3116
254240 *************************************/
255241
256242static INPUT_PORTS_START( thunderj )
257   PORT_START("260000")      /* 260000 */
243   PORT_START("260000")
258244   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
259245
260   PORT_START("260010")      /* 260010 */
246   PORT_START("260010")
261247   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
262248   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
263249   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
r3115r3116
267253   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
268254   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
269255
270   PORT_START("260012")      /* 260012 */
256   PORT_START("260012")
271257   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
272258   PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
273259   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )   /* Input buffer full (@260030) */
src/mame/drivers/ultraman.c
r3115r3116
113113   AM_RANGE(0x000000, 0x03ffff) AM_ROM
114114   AM_RANGE(0x080000, 0x08ffff) AM_RAM
115115   AM_RANGE(0x180000, 0x183fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)/* Palette */
116   AM_RANGE(0x1c0000, 0x1c0001) AM_READ(input_port_0_word_r)   /* Coins + Service */
117   AM_RANGE(0x1c0002, 0x1c0003) AM_READ(input_port_1_word_r)   /* 1P controls */
118   AM_RANGE(0x1c0004, 0x1c0005) AM_READ(input_port_2_word_r)   /* 2P controls */
119   AM_RANGE(0x1c0006, 0x1c0007) AM_READ(input_port_3_word_r)   /* DIPSW #1 */
120   AM_RANGE(0x1c0008, 0x1c0009) AM_READ(input_port_4_word_r)   /* DIPSW #2 */
116   AM_RANGE(0x1c0000, 0x1c0001) AM_READ_PORT("SYSTEM")
117   AM_RANGE(0x1c0002, 0x1c0003) AM_READ_PORT("P1")
118   AM_RANGE(0x1c0004, 0x1c0005) AM_READ_PORT("P2")
119   AM_RANGE(0x1c0006, 0x1c0007) AM_READ_PORT("DSW1")
120   AM_RANGE(0x1c0008, 0x1c0009) AM_READ_PORT("DSW2")
121121   AM_RANGE(0x1c0018, 0x1c0019) AM_WRITE(ultraman_gfxctrl_w)   /* counters + gfx ctrl */
122122   AM_RANGE(0x1c0020, 0x1c0021) AM_WRITE(sound_cmd_w)
123123   AM_RANGE(0x1c0028, 0x1c0029) AM_WRITE(sound_irq_trigger_w)
r3115r3116
149149
150150
151151static INPUT_PORTS_START( ultraman )
152
153   PORT_START("IN0")   /* Coins + Service */
152   PORT_START("SYSTEM")
154153   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
155154   PORT_SERVICE_NO_TOGGLE(0x10, IP_ACTIVE_LOW)
156155   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 )
157156   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
158157   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
159158
160   PORT_START("IN1")
159   PORT_START("P1")
161160   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
162   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(1)
161   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
163162   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
164163   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
165164   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
167166   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
168167   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
169168
170   PORT_START("IN2")
169   PORT_START("P2")
171170   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
172   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(2)
171   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
173172   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
174173   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
175174   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
src/mame/drivers/parodius.c
r3115r3116
131131static ADDRESS_MAP_START( parodius_readmem, ADDRESS_SPACE_PROGRAM, 8 )
132132   AM_RANGE(0x0000, 0x07ff) AM_READ(bankedram_r)
133133   AM_RANGE(0x0800, 0x1fff) AM_READ(SMH_RAM)
134   AM_RANGE(0x3f8c, 0x3f8c) AM_READ(input_port_0_r)
135   AM_RANGE(0x3f8d, 0x3f8d) AM_READ(input_port_1_r)
136   AM_RANGE(0x3f8e, 0x3f8e) AM_READ(input_port_4_r)
137   AM_RANGE(0x3f8f, 0x3f8f) AM_READ(input_port_2_r)
138   AM_RANGE(0x3f90, 0x3f90) AM_READ(input_port_3_r)
134   AM_RANGE(0x3f8c, 0x3f8c) AM_READ_PORT("P1")
135   AM_RANGE(0x3f8d, 0x3f8d) AM_READ_PORT("P2")
136   AM_RANGE(0x3f8e, 0x3f8e) AM_READ_PORT("DSW3")
137   AM_RANGE(0x3f8f, 0x3f8f) AM_READ_PORT("DSW1")
138   AM_RANGE(0x3f90, 0x3f90) AM_READ_PORT("DSW2")
139139   AM_RANGE(0x3fa0, 0x3faf) AM_READ(K053244_r)
140140   AM_RANGE(0x3fc0, 0x3fc0) AM_READ(watchdog_reset_r)
141141   AM_RANGE(0x3fcc, 0x3fcd) AM_READ(parodius_sound_r)   /* K053260 */
r3115r3116
183183***************************************************************************/
184184
185185static INPUT_PORTS_START( parodius )
186   PORT_START("P1")   /* PLAYER 1 INPUTS */
186   PORT_START("P1")
187187   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
188188   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
189189   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
193193   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)      // shoot
194194   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)      // missile
195195
196   PORT_START("P2")   /* PLAYER 2 INPUTS */
196   PORT_START("P2")
197197   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
198198   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
199199   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
203203   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
204204   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
205205
206   PORT_START("DSW1")   /* DSW #1 */
206   PORT_START("DSW1")
207207   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
208208   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
209209   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
239239   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
240240//  PORT_DIPSETTING(    0x00, "No Use" )
241241
242   PORT_START("DSW2")   /* DSW #2 */
242   PORT_START("DSW2")
243243   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
244244   PORT_DIPSETTING(    0x03, "2" )
245245   PORT_DIPSETTING(    0x02, "3" )
r3115r3116
262262   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
263263   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
264264
265   PORT_START("DSW3")   /* DSW #3 */
265   PORT_START("DSW3")
266266   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
267267   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE )
268268   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
src/mame/drivers/rockrage.c
r3115r3116
105105   AM_RANGE(0x2000, 0x21ff) AM_READ(K007420_r)         /* Sprite RAM */
106106   AM_RANGE(0x2200, 0x23ff) AM_READ(K007342_scroll_r)   /* Scroll RAM */
107107   AM_RANGE(0x2400, 0x247f) AM_READ(SMH_RAM)         /* Palette */
108   AM_RANGE(0x2e01, 0x2e01) AM_READ(input_port_3_r)      /* 1P controls */
109   AM_RANGE(0x2e02, 0x2e02) AM_READ(input_port_4_r)      /* 2P controls */
110   AM_RANGE(0x2e03, 0x2e03) AM_READ(input_port_1_r)      /* DISPW #2 */
111   AM_RANGE(0x2e40, 0x2e40) AM_READ(input_port_0_r)      /* DIPSW #1 */
112   AM_RANGE(0x2e00, 0x2e00) AM_READ(input_port_2_r)      /* coinsw, testsw, startsw */
108   AM_RANGE(0x2e01, 0x2e01) AM_READ_PORT("P1")
109   AM_RANGE(0x2e02, 0x2e02) AM_READ_PORT("P2")
110   AM_RANGE(0x2e03, 0x2e03) AM_READ_PORT("DSW2")
111   AM_RANGE(0x2e40, 0x2e40) AM_READ_PORT("DSW1")
112   AM_RANGE(0x2e00, 0x2e00) AM_READ_PORT("SYSTEM")
113113   AM_RANGE(0x4000, 0x5fff) AM_READ(SMH_RAM)         /* RAM */
114114   AM_RANGE(0x6000, 0x7fff) AM_READ(SMH_BANK1)         /* banked ROM */
115115   AM_RANGE(0x8000, 0xffff) AM_READ(SMH_ROM)         /* ROM */
r3115r3116
154154***************************************************************************/
155155
156156static INPUT_PORTS_START( rockrage )
157   PORT_START("DSW1")   /* DSW #1 */
157   PORT_START("DSW1")
158158   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
159159   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
160160   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
190190   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
191191//  PORT_DIPSETTING(    0x00, "Invalid" )
192192
193   PORT_START("DSW2")   /* DSW #2 */
193   PORT_START("DSW2")
194194   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
195195   PORT_DIPSETTING(    0x03, "1" )
196196   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
214214   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
215215   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
216216
217   PORT_START("SYSTEM")   /* COINSW */
217   PORT_START("SYSTEM")
218218   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
219219   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
220220   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
r3115r3116
228228   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
229229   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
230230
231   PORT_START("P1")   /* PLAYER 1 INPUTS */
231   PORT_START("P1")
232232   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
233233   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
234234   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
238238   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
239239   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
240240
241   PORT_START("P2")   /* PLAYER 2 INPUTS */
241   PORT_START("P2")
242242   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
243243   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
244244   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
247247   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
248248   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
249249   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
250
251250INPUT_PORTS_END
252251
253252static const gfx_layout charlayout =
src/mame/drivers/ttchamp.c
r3115r3116
129129static ADDRESS_MAP_START( ttchamp_io, ADDRESS_SPACE_IO, 16 )
130130    AM_RANGE(0x0000, 0x0001) AM_WRITE(SMH_NOP)
131131
132    AM_RANGE(0x0002, 0x0003) AM_READ(input_port_0_word_r)
133    AM_RANGE(0x0004, 0x0005) AM_READ(input_port_1_word_r)
132    AM_RANGE(0x0002, 0x0003) AM_READ_PORT("SYSTEM")
133    AM_RANGE(0x0004, 0x0005) AM_READ_PORT("P1_P2")
134134
135135//  AM_RANGE(0x0018, 0x0019) AM_READ(peno_rand2)
136136//  AM_RANGE(0x001e, 0x001f) AM_READ(peno_rand2)
r3115r3116
149149
150150
151151static INPUT_PORTS_START(ttchamp)
152    PORT_START("SYSTEM")  /* 8bit */
153   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
154   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
155   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
156   PORT_DIPSETTING(    0x0004, DEF_STR( Off ) )
157   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
158   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
159   PORT_DIPSETTING(    0x0008, DEF_STR( Off ) )
160   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
161   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
162   PORT_DIPSETTING(    0x0010, DEF_STR( Off ) )
163   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
164   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
165   PORT_DIPSETTING(    0x0020, DEF_STR( Off ) )
166   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
167   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
168   PORT_DIPSETTING(    0x0040, DEF_STR( Off ) )
169   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
170   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
171   PORT_DIPSETTING(    0x0080, DEF_STR( Off ) )
172   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
173   PORT_DIPNAME( 0x0100, 0x0100, "0x000003" )
174   PORT_DIPSETTING(    0x0100, DEF_STR( Off ) )
175   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
176   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
177   PORT_DIPSETTING(    0x0200, DEF_STR( Off ) )
178   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
179   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
180   PORT_DIPSETTING(    0x0400, DEF_STR( Off ) )
181   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
182   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
183   PORT_DIPSETTING(    0x0800, DEF_STR( Off ) )
184   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
185   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
186   PORT_DIPSETTING(    0x1000, DEF_STR( Off ) )
187   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
188   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
189   PORT_DIPSETTING(    0x2000, DEF_STR( Off ) )
190   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
191   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
192   PORT_DIPSETTING(    0x4000, DEF_STR( Off ) )
193   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
194   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
195   PORT_DIPSETTING(    0x8000, DEF_STR( Off ) )
196   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
152    PORT_START("SYSTEM")
153    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
154    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
155    PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
156    PORT_DIPSETTING(    0x0004, DEF_STR( Off ) )
157    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
158    PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
159    PORT_DIPSETTING(    0x0008, DEF_STR( Off ) )
160    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
161    PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
162    PORT_DIPSETTING(    0x0010, DEF_STR( Off ) )
163    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
164    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
165    PORT_DIPSETTING(    0x0020, DEF_STR( Off ) )
166    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
167    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
168    PORT_DIPSETTING(    0x0040, DEF_STR( Off ) )
169    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
170    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
171    PORT_DIPSETTING(    0x0080, DEF_STR( Off ) )
172    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
173    PORT_DIPNAME( 0x0100, 0x0100, "0x000003" )
174    PORT_DIPSETTING(    0x0100, DEF_STR( Off ) )
175    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
176    PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
177    PORT_DIPSETTING(    0x0200, DEF_STR( Off ) )
178    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
179    PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
180    PORT_DIPSETTING(    0x0400, DEF_STR( Off ) )
181    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
182    PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
183    PORT_DIPSETTING(    0x0800, DEF_STR( Off ) )
184    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
185    PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
186    PORT_DIPSETTING(    0x1000, DEF_STR( Off ) )
187    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
188    PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
189    PORT_DIPSETTING(    0x2000, DEF_STR( Off ) )
190    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
191    PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
192    PORT_DIPSETTING(    0x4000, DEF_STR( Off ) )
193    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
194    PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
195    PORT_DIPSETTING(    0x8000, DEF_STR( Off ) )
196    PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
197197
198   PORT_START("P1_P2")   /* 8bit */
199   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY
200   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY
201   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY
202   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_8WAY
203   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
204   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
205   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
206   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
207   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY
208   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY
209   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY
210   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY
211   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
212   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
213   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
214   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START1 )
198    PORT_START("P1_P2")
199    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY
200    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY
201    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY
202    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_8WAY
203    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
204    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
205    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
206    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
207    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY
208    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY
209    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY
210    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY
211    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
212    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
213    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
214    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START1 )
215215
216216INPUT_PORTS_END
217217
src/mame/drivers/starshp1.c
r3115r3116
3030   {
3131   case 0:
3232      starshp1_attract = data;
33      discrete_sound_w(machine, STARSHP1_ATTRACT, data);
3334      break;
3435   case 1:
3536      starshp1_phasor = data;
37      discrete_sound_w(machine, STARSHP1_PHASOR_ON, data);
3638      break;
3739   case 2:
38      /* KICKER */
40      discrete_sound_w(machine, STARSHP1_KICKER, data);
3941      break;
4042   case 3:
41      /* SL1 */
43      discrete_sound_w(machine, STARSHP1_SL1, data);
4244      break;
4345   case 4:
44      /* SL2 */
46      discrete_sound_w(machine, STARSHP1_SL2, data);
4547      break;
4648   case 5:
47      /* MOLVL */
49      discrete_sound_w(machine, STARSHP1_MOLVL, data);
4850      break;
4951   case 6:
50      /* NOISE FREQ */
52      discrete_sound_w(machine, STARSHP1_NOISE_FREQ, data);
5153      break;
5254   }
5355
r3115r3116
6264}
6365
6466
65static READ8_HANDLER( starshp1_port_1_r )
67static CUSTOM_INPUT( starshp1_analog_r )
6668{
6769   int val = 0;
6870
6971   switch (starshp1_analog_in_select)
7072   {
7173   case 0:
72      val = input_port_read(machine, "STICKY");
74      val = input_port_read(field->port->machine, "STICKY");
7375      break;
7476   case 1:
75      val = input_port_read(machine, "STICKX");
77      val = input_port_read(field->port->machine, "STICKX");
7678      break;
7779   case 2:
7880      val = 0x20; /* DAC feedback, not used */
7981      break;
8082   case 3:
81      val = input_port_read(machine, "PLAYTIME");
83      val = input_port_read(field->port->machine, "PLAYTIME");
8284      break;
8385   }
8486
85   return (val & 0x3f) | input_port_read(machine, "VBLANK");
87   return val & 0x3f;
8688}
8789
8890
89static READ8_HANDLER( starshp1_port_2_r )
91static CUSTOM_INPUT( collision_latch_r )
9092{
91   return input_port_read(machine, "COINAGE") | (starshp1_collision_latch & 0x0f);
93   return starshp1_collision_latch & 0x0f;
9294}
9395
9496
r3115r3116
106108      starshp1_ship_size = data;
107109      break;
108110   case 2:
109      /* NOISE AMPLITUDE */
111      discrete_sound_w(machine, STARSHP1_NOISE_AMPLITUDE, data);
110112      break;
111113   case 3:
112      /* TONE PITCH */
114      discrete_sound_w(machine, STARSHP1_TONE_PITCH, data);
113115      break;
114116   case 4:
115      /* MOTOR SPEED */
117      discrete_sound_w(machine, STARSHP1_MOTOR_SPEED, data);
116118      break;
117119   case 5:
118120      starshp1_circle_hpos = data;
r3115r3116
164166static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
165167   AM_RANGE(0x0000, 0x00ff) AM_READ(SMH_RAM) AM_MIRROR(0x100)
166168   AM_RANGE(0x2c00, 0x3fff) AM_READ(SMH_ROM)
167   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
168   AM_RANGE(0xb000, 0xb000) AM_READ(starshp1_port_1_r)
169   AM_RANGE(0xc400, 0xc400) AM_READ(starshp1_port_2_r)
169   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("SYSTEM")
170   AM_RANGE(0xb000, 0xb000) AM_READ_PORT("VBLANK")
171   AM_RANGE(0xc400, 0xc400) AM_READ_PORT("COINAGE")
170172   AM_RANGE(0xd800, 0xd800) AM_READ(starshp1_rng_r)
171173   AM_RANGE(0xf000, 0xffff) AM_READ(SMH_ROM)
172174ADDRESS_MAP_END
r3115r3116
203205   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
204206
205207   PORT_START("VBLANK")
206   PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_UNUSED ) /* analog in */
208   PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(starshp1_analog_r, NULL)   /* analog in */
207209   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
208210   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
209211
210212   PORT_START("COINAGE")
211   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED ) /* collision latch */
212   PORT_DIPNAME( 0x70, 0x20, DEF_STR( Coinage ))
213   PORT_DIPSETTING(   0x10, DEF_STR( 2C_1C ))
214   PORT_DIPSETTING(   0x20, DEF_STR( 1C_1C ))
215   PORT_DIPSETTING(   0x40, DEF_STR( 1C_2C ))
213   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(collision_latch_r, NULL)   /* collision latch */
214   PORT_DIPNAME( 0x70, 0x20, DEF_STR( Coinage ) )
215   PORT_DIPSETTING(   0x10, DEF_STR( 2C_1C ) )
216   PORT_DIPSETTING(   0x20, DEF_STR( 1C_1C ) )
217   PORT_DIPSETTING(   0x40, DEF_STR( 1C_2C ) )
216218   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) /* ground */
217219
218220   PORT_START("PLAYTIME")
r3115r3116
320322   MDRV_VIDEO_EOF(starshp1)
321323
322324   /* sound hardware */
325   MDRV_SPEAKER_STANDARD_MONO("mono")
326
327   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
328   MDRV_SOUND_CONFIG_DISCRETE(starshp1)
329   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
323330MACHINE_DRIVER_END
324331
325332
r3115r3116
392399ROM_END
393400
394401
395GAME( 1977, starshp1, 0,        starshp1, starshp1, 0, ORIENTATION_FLIP_X, "Atari", "Starship 1",              GAME_NO_SOUND )
396GAME( 1977, starshpp, starshp1, starshp1, starshp1, 0, ORIENTATION_FLIP_X, "Atari", "Starship 1 (prototype?)", GAME_NO_SOUND )
402GAME( 1977, starshp1, 0,        starshp1, starshp1, 0, ORIENTATION_FLIP_X, "Atari", "Starship 1",              GAME_IMPERFECT_SOUND )
403GAME( 1977, starshpp, starshp1, starshp1, starshp1, 0, ORIENTATION_FLIP_X, "Atari", "Starship 1 (prototype?)", GAME_IMPERFECT_SOUND )
src/mame/drivers/pandoras.c
r3115r3116
1616#include "driver.h"
1717#include "cpu/m6809/m6809.h"
1818#include "cpu/z80/z80.h"
19#include "cpu/i8039/i8039.h"
19#include "cpu/mcs48/mcs48.h"
2020#include "sound/ay8910.h"
2121#include "sound/dac.h"
2222
r3115r3116
140140   AM_RANGE(0x0000, 0x0fff) AM_READ(SMH_RAM) AM_SHARE(1)/* Work RAM (Shared with CPU A) */
141141   AM_RANGE(0x1000, 0x13ff) AM_READ(SMH_RAM) AM_SHARE(2)       /* Color RAM (shared with CPU A) */
142142   AM_RANGE(0x1400, 0x17ff) AM_READ(SMH_RAM) AM_SHARE(3)    /* Video RAM (shared with CPU A) */
143   AM_RANGE(0x1800, 0x1800) AM_READ(input_port_0_r)         /* DIPSW #1 */
144   AM_RANGE(0x1a00, 0x1a00) AM_READ(input_port_3_r)         /* COINSW */
145   AM_RANGE(0x1a01, 0x1a01) AM_READ(input_port_4_r)         /* 1P inputs */
146   AM_RANGE(0x1a02, 0x1a02) AM_READ(input_port_5_r)         /* 2P inputs */
147   AM_RANGE(0x1a03, 0x1a03) AM_READ(input_port_2_r)         /* DIPSW #3 */
148   AM_RANGE(0x1c00, 0x1c00) AM_READ(input_port_1_r)         /* DISPW #2 */
143   AM_RANGE(0x1800, 0x1800) AM_READ_PORT("DSW1")
144   AM_RANGE(0x1a00, 0x1a00) AM_READ_PORT("SYSTEM")
145   AM_RANGE(0x1a01, 0x1a01) AM_READ_PORT("P1")
146   AM_RANGE(0x1a02, 0x1a02) AM_READ_PORT("P2")
147   AM_RANGE(0x1a03, 0x1a03) AM_READ_PORT("DSW3")
148   AM_RANGE(0x1c00, 0x1c00) AM_READ_PORT("DSW2")
149149//  AM_RANGE(0x1e00, 0x1e00) AM_READ(SMH_NOP)              /* ??? seems to be important */
150150   AM_RANGE(0xc000, 0xc7ff) AM_READ(SMH_RAM) AM_SHARE(4)   /* Shared RAM with the CPU A */
151151   AM_RANGE(0xe000, 0xffff) AM_READ(SMH_ROM)            /* ROM */
r3115r3116
191191ADDRESS_MAP_END
192192
193193static ADDRESS_MAP_START( i8039_writeport, ADDRESS_SPACE_IO, 8 )
194   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(dac_0_data_w)
195   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(i8039_irqen_and_status_w)
194   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(dac_0_data_w)
195   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(i8039_irqen_and_status_w)
196196ADDRESS_MAP_END
197197
198198
r3115r3116
203203***************************************************************************/
204204
205205static INPUT_PORTS_START( pandoras )
206   PORT_START("DSW1")   /* DSW #1 */
206   PORT_START("DSW1")
207207   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
208208   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
209209   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
r3115r3116
239239   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
240240//  PORT_DIPSETTING(    0x00, "Invalid" )
241241
242   PORT_START("DSW2")   /* DSW #2 */
242   PORT_START("DSW2")
243243   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
244244   PORT_DIPSETTING(    0x03, "3" )
245245   PORT_DIPSETTING(    0x02, "4" )
r3115r3116
262262   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
263263   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
264264
265   PORT_START("DSw3")   /* DSW #3 */
265   PORT_START("DSW3")
266266   PORT_DIPNAME( 0x01, 0x01, "Freeze" )
267267   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
268268   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
288288   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
289289   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
290290
291   PORT_START("SYSTEM")   /* COINSW */
291   PORT_START("SYSTEM")
292292   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
293293   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
294294   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
r3115r3116
297297   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
298298   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
299299
300   PORT_START("P1")   /* PLAYER 1 INPUTS */
300   PORT_START("P1")
301301   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
302302   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
303303   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
r3115r3116
305305   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
306306   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
307307
308   PORT_START("P2")   /* PLAYER 2 INPUTS */
308   PORT_START("P2")
309309   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
310310   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
311311   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
src/mame/drivers/sandscrp.c
r3115r3116
214214   AM_RANGE(0x500000, 0x501fff) AM_READWRITE(pandora_spriteram_LSB_r, pandora_spriteram_LSB_w ) // sprites
215215   AM_RANGE(0x600000, 0x600fff) AM_RAM_WRITE(paletteram16_xGGGGGRRRRRBBBBB_word_w) AM_BASE(&paletteram16)   // Palette
216216   AM_RANGE(0xa00000, 0xa00001) AM_WRITE(sandscrp_coin_counter_w)   // Coin Counters (Lockout unused)
217   AM_RANGE(0xb00000, 0xb00001) AM_READ(input_port_0_word_r)   // Inputs
218   AM_RANGE(0xb00002, 0xb00003) AM_READ(input_port_1_word_r)   //
219   AM_RANGE(0xb00004, 0xb00005) AM_READ(input_port_2_word_r)   //
220   AM_RANGE(0xb00006, 0xb00007) AM_READ(input_port_3_word_r)   //
217   AM_RANGE(0xb00000, 0xb00001) AM_READ_PORT("P1")
218   AM_RANGE(0xb00002, 0xb00003) AM_READ_PORT("P2")
219   AM_RANGE(0xb00004, 0xb00005) AM_READ_PORT("SYSTEM")
220   AM_RANGE(0xb00006, 0xb00007) AM_READ_PORT("UNK")
221221   AM_RANGE(0xec0000, 0xec0001) AM_READ(watchdog_reset16_r)   //
222222   AM_RANGE(0x800000, 0x800001) AM_READ(sandscrp_irq_cause_r)   // IRQ Cause
223223   AM_RANGE(0xe00000, 0xe00001) AM_READWRITE(sandscrp_soundlatch_word_r, sandscrp_soundlatch_word_w)   // From/To Sound CPU
r3115r3116
284284***************************************************************************/
285285
286286static INPUT_PORTS_START( sandscrp )
287   PORT_START("P1")   // IN0 - $b00000.w
287   PORT_START("P1")   /* $b00000.w */
288288   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
289289   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN    ) PORT_PLAYER(1)
290290   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
r3115r3116
295295   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
296296   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
297297
298   PORT_START("P2")   // IN1 - $b00002.w
298   PORT_START("P2")   /* $b00002.w */
299299   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
300300   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN    ) PORT_PLAYER(2)
301301   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
r3115r3116
306306   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
307307   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
308308
309   PORT_START("SYSTEM")   // IN2 - $b00004.w
309   PORT_START("SYSTEM")   /* $b00004.w */
310310   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1   )
311311   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2   )
312312   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1    )
r3115r3116
317317   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
318318   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
319319
320   PORT_START("UNK")   // IN3 - $b00006.w
320   PORT_START("UNK")   /* $b00006.w */
321321   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
322322
323   PORT_START("DSW1")   // IN4 - DSW 1 read by the Z80 through the sound chip
323   PORT_START("DSW1")   /* read by the Z80 through the sound chip */
324324   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
325325   PORT_DIPSETTING(    0x02, "1" )
326326   PORT_DIPSETTING(    0x01, "2" )
r3115r3116
342342   PORT_DIPSETTING(    0x40, "500K, 1000K" )
343343   PORT_DIPSETTING(    0x00, "1000K, 3000K" )
344344
345   PORT_START("DSW2")   // IN5 - DSW 2 read by the Z80 through the sound chip
345   PORT_START("DSW2")   /* read by the Z80 through the sound chip */
346346   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) )
347347   PORT_DIPSETTING(    0x0a, DEF_STR( 6C_1C ) )
348348   PORT_DIPSETTING(    0x0b, DEF_STR( 5C_1C ) )
src/mame/drivers/ddragon.c
r3115r3116
9797/* end of extern code & data */
9898
9999static emu_timer *scanline_timer;
100static MACHINE_START( ddragon );
101static WRITE8_HANDLER( ddragon_bankswitch_w );
102100
103101/* private globals */
104102static UINT8 dd_sub_cpu_busy;
105103static UINT8 sprite_irq, sound_irq, ym_irq, snd_cpu;
106104static UINT32 adpcm_pos[2], adpcm_end[2];
107105static UINT8 adpcm_idle[2];
106static int adpcm_data[2];
108107static UINT8 *darktowr_mcu_ports;
109108static UINT8 *rambase;
110109/* end of private globals */
r3115r3116
196195static MACHINE_RESET( ddragon )
197196{
198197   dd_sub_cpu_busy = 1;
198   adpcm_pos[0] = adpcm_pos[1] = 0;
199   adpcm_end[0] = adpcm_end[1] = 0;
199200   adpcm_idle[0] = adpcm_idle[1] = 1;
201   adpcm_data[0] = adpcm_data[1] = -1;
200202   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
201203}
202204
r3115r3116
463465
464466static void dd_adpcm_int(running_machine *machine, int chip)
465467{
466   static int adpcm_data[2] = { -1, -1 };
467
468468   if (adpcm_pos[chip] >= adpcm_end[chip] || adpcm_pos[chip] >= 0x10000)
469469   {
470470      adpcm_idle[chip] = 1;
src/mame/drivers/asterix.c
r3115r3116
6767   /* bit 8  is EEPROM data */
6868   /* bit 9  is EEPROM ready */
6969   /* bit 10 is service button */
70   res = (eeprom_read_bit()<<8) | input_port_read(machine, "IN1");
70   res = input_port_read(machine, "IN1");
7171
7272   if (init_eeprom_count)
7373   {
r3115r3116
240240   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_PLAYER(2)
241241   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_UNKNOWN )
242242   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_START2 )
243   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )  // EEPROM data
244   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNUSED )  // EEPROM ready (always 1)
243   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   // EEPROM data
244   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNUSED )   // EEPROM ready (always 1)
245245   PORT_SERVICE_NO_TOGGLE(0x0400, IP_ACTIVE_LOW )
246246   PORT_BIT( 0xf800, IP_ACTIVE_HIGH, IPT_UNKNOWN )
247247INPUT_PORTS_END
src/mame/drivers/tubep.c
r3115r3116
180180
181181static ADDRESS_MAP_START( tubep_main_portmap, ADDRESS_SPACE_IO, 8 )
182182   ADDRESS_MAP_GLOBAL_MASK(0xff)
183   AM_RANGE(0x80, 0x80) AM_READ(input_port_3_r)
184   AM_RANGE(0x90, 0x90) AM_READ(input_port_4_r)
185   AM_RANGE(0xa0, 0xa0) AM_READ(input_port_5_r)
183   AM_RANGE(0x80, 0x80) AM_READ_PORT("DSW1")
184   AM_RANGE(0x90, 0x90) AM_READ_PORT("DSW2")
185   AM_RANGE(0xa0, 0xa0) AM_READ_PORT("DSW3")
186186
187   AM_RANGE(0xb0, 0xb0) AM_READ(input_port_2_r)
188   AM_RANGE(0xc0, 0xc0) AM_READ(input_port_1_r)
189   AM_RANGE(0xd0, 0xd0) AM_READ(input_port_0_r)
187   AM_RANGE(0xb0, 0xb0) AM_READ_PORT("SYSTEM")
188   AM_RANGE(0xc0, 0xc0) AM_READ_PORT("P2")
189   AM_RANGE(0xd0, 0xd0) AM_READ_PORT("P1")
190190
191191   AM_RANGE(0x80, 0x80) AM_WRITE(main_cpu_irq_line_clear_w)
192192   AM_RANGE(0xb0, 0xb7) AM_WRITE(tubep_LS259_w)
r3115r3116
422422
423423static ADDRESS_MAP_START( rjammer_main_portmap, ADDRESS_SPACE_IO, 8 )
424424   ADDRESS_MAP_GLOBAL_MASK(0xff)
425   AM_RANGE(0x00, 0x00) AM_READ(input_port_2_r)   /* a bug in game code (during attract mode) */
426   AM_RANGE(0x80, 0x80) AM_READ(input_port_2_r)
427   AM_RANGE(0x90, 0x90) AM_READ(input_port_3_r)
428   AM_RANGE(0xa0, 0xa0) AM_READ(input_port_4_r)
429   AM_RANGE(0xb0, 0xb0) AM_READ(input_port_0_r)
430   AM_RANGE(0xc0, 0xc0) AM_READ(input_port_1_r)
425   AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW2")   /* a bug in game code (during attract mode) */
426   AM_RANGE(0x80, 0x80) AM_READ_PORT("DSW2")
427   AM_RANGE(0x90, 0x90) AM_READ_PORT("DSW1")
428   AM_RANGE(0xa0, 0xa0) AM_READ_PORT("SYSTEM")
429   AM_RANGE(0xb0, 0xb0) AM_READ_PORT("P1")
430   AM_RANGE(0xc0, 0xc0) AM_READ_PORT("P2")
431431
432432   AM_RANGE(0xd0, 0xd7) AM_WRITE(rjammer_LS259_w)
433433   AM_RANGE(0xe0, 0xe0) AM_WRITE(main_cpu_irq_line_clear_w)   /* clear IRQ interrupt */
r3115r3116
683683   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
684684   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
685685
686   PORT_START("Coin_Start")
686   PORT_START("SYSTEM")
687687   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
688688   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
689689   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
r3115r3116
795795   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
796796   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
797797
798   PORT_START("DSW2")
799   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:6")
800   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
801   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
802   PORT_DIPNAME( 0x02, 0x02, "Bonus Time" ) PORT_DIPLOCATION("SW2:5")
803   PORT_DIPSETTING(    0x02, "100" )
804   PORT_DIPSETTING(    0x00, "200" )
805   PORT_DIPNAME( 0x0c, 0x0c, "Clear Men" ) PORT_DIPLOCATION("SW2:4,3")
806   PORT_DIPSETTING(    0x0c, "20" )
807   PORT_DIPSETTING(    0x08, "30" )
808   PORT_DIPSETTING(    0x04, "40" )
809   PORT_DIPSETTING(    0x00, "50" )
810   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2")
811   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
812   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
813   PORT_DIPNAME( 0x20, 0x20, "Time" ) PORT_DIPLOCATION("SW2:1")
814   PORT_DIPSETTING(    0x20, "40" )
815   PORT_DIPSETTING(    0x00, "50" )
798   PORT_START("SYSTEM")
799   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
800   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
801   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
802   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
803   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
804   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
816805   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
817806   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
818807
r3115r3116
836825   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
837826   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
838827
839   PORT_START("Coins_Service")
840   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
841   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
842   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
843   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
844   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
845   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
828   PORT_START("DSW2")
829   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:6")
830   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
831   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
832   PORT_DIPNAME( 0x02, 0x02, "Bonus Time" ) PORT_DIPLOCATION("SW2:5")
833   PORT_DIPSETTING(    0x02, "100" )
834   PORT_DIPSETTING(    0x00, "200" )
835   PORT_DIPNAME( 0x0c, 0x0c, "Clear Men" ) PORT_DIPLOCATION("SW2:4,3")
836   PORT_DIPSETTING(    0x0c, "20" )
837   PORT_DIPSETTING(    0x08, "30" )
838   PORT_DIPSETTING(    0x04, "40" )
839   PORT_DIPSETTING(    0x00, "50" )
840   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2")
841   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
842   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
843   PORT_DIPNAME( 0x20, 0x20, "Time" ) PORT_DIPLOCATION("SW2:1")
844   PORT_DIPSETTING(    0x20, "40" )
845   PORT_DIPSETTING(    0x00, "50" )
846846   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
847847   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
848848INPUT_PORTS_END
src/mame/drivers/ppmast93.c
r3115r3116
123123The DIP sheet also seems to suggest the use of a 4-way joystick and 2 buttons,
124124one for shoot and one for select.
125125
126
1272008-08
128Dip locations added based on the notes above.
129
126130*/
127131
128132#include "driver.h"
r3115r3116
169173
170174static ADDRESS_MAP_START( ppmast93_cpu1_io, ADDRESS_SPACE_IO, 8 )
171175   ADDRESS_MAP_GLOBAL_MASK(0xff)
172   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
173   AM_RANGE(0x02, 0x02) AM_READ(input_port_1_r)
174   AM_RANGE(0x04, 0x04) AM_READ(input_port_2_r)
175   AM_RANGE(0x06, 0x06) AM_READ(input_port_3_r)
176   AM_RANGE(0x08, 0x08) AM_READ(input_port_4_r)
176   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
177   AM_RANGE(0x02, 0x02) AM_READ_PORT("P2")
178   AM_RANGE(0x04, 0x04) AM_READ_PORT("SYSTEM")
179   AM_RANGE(0x06, 0x06) AM_READ_PORT("DSW1")
180   AM_RANGE(0x08, 0x08) AM_READ_PORT("DSW2")
177181
178182   AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_w)
179183   AM_RANGE(0x04, 0x04) AM_WRITE(ppmast93_port4_w)
r3115r3116
202206ADDRESS_MAP_END
203207
204208static INPUT_PORTS_START( ppmast93 )
205   PORT_START("P1")   /* 8bit */
209   PORT_START("P1")
206210   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1)
207211   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1)
208212   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1)
r3115r3116
212216   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) // nothing?
213217   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
214218
215   PORT_START("P2")   /* 8bit */
219   PORT_START("P2")
216220   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2)
217221   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2)
218222   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
r3115r3116
222226   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) // nothing?
223227   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
224228
225   PORT_START("SYSTEM")   /* 8bit */
229   PORT_START("SYSTEM")
226230   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
227231   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
228232   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
233237   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
234238
235239   PORT_START("DSW1")
236   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
240   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
237241   PORT_DIPSETTING(    0x01, DEF_STR( 5C_1C ) )
238242   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
239243   PORT_DIPSETTING(    0x07, DEF_STR( 3C_1C ) )
r3115r3116
250254   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
251255   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
252256   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
253   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
257   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
254258   PORT_DIPSETTING(    0x10, DEF_STR( 5C_1C ) )
255259   PORT_DIPSETTING(    0x40, DEF_STR( 4C_1C ) )
256260   PORT_DIPSETTING(    0x70, DEF_STR( 3C_1C ) )
r3115r3116
269273   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
270274
271275   PORT_START("DSW2")
272   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) )
276   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
273277   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
274278   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
275279   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
276280   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
277   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )
281   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3")
278282   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
279283   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
280   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
281   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
282   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
283   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
284   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
285   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
286   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
287   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
288   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
289   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
290   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
291   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
292   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
284   PORT_SERVICE_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW2:4" )
285   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" )
286   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" )
287   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" )
288   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" )
293289INPUT_PORTS_END
294290
295291static const gfx_layout tiles8x8_layout =
src/mame/drivers/pcktgal.c
r3115r3116
7878
7979static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
8080   AM_RANGE(0x0000, 0x07ff) AM_READ(SMH_RAM)
81   AM_RANGE(0x1800, 0x1800) AM_READ(input_port_0_r)
82   AM_RANGE(0x1a00, 0x1a00) AM_READ(input_port_1_r)
83   AM_RANGE(0x1c00, 0x1c00) AM_READ(input_port_2_r)
81   AM_RANGE(0x1800, 0x1800) AM_READ_PORT("P1")
82   AM_RANGE(0x1a00, 0x1a00) AM_READ_PORT("P2")
83   AM_RANGE(0x1c00, 0x1c00) AM_READ_PORT("DSW")
8484   AM_RANGE(0x4000, 0x5fff) AM_READ(SMH_BANK1)
8585   AM_RANGE(0x6000, 0x7fff) AM_READ(SMH_BANK2)
8686   AM_RANGE(0x8000, 0xffff) AM_READ(SMH_ROM)
r3115r3116
141141   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
142142   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
143143
144   PORT_START("DSW")   /* Dip switch */
144   PORT_START("DSW")
145145   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
146146   PORT_DIPSETTING(   0x00, DEF_STR( 2C_1C ) )
147147   PORT_DIPSETTING(   0x03, DEF_STR( 1C_1C ) )
src/mame/drivers/hyhoo.c
r3115r3116
6969   ADDRESS_MAP_GLOBAL_MASK(0xff)
7070   AM_RANGE(0x00, 0x7f) AM_READ(nb1413m3_sndrom_r)
7171   AM_RANGE(0x81, 0x81) AM_READ(ay8910_read_port_0_r)
72   AM_RANGE(0x90, 0x90) AM_READ(nb1413m3_inputport0_r)
72   AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM")
7373   AM_RANGE(0xa0, 0xa0) AM_READ(nb1413m3_inputport1_r)
7474   AM_RANGE(0xb0, 0xb0) AM_READ(nb1413m3_inputport2_r)
7575   AM_RANGE(0xd0, 0xd0) AM_READ(SMH_NOP)               // unknown
r3115r3116
9494
9595
9696static INPUT_PORTS_START( hyhoo )
97   PORT_START("DSWA")   /* (0) DIPSW-A */
97   PORT_START("DSWA")
9898   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
9999   PORT_DIPSETTING(    0x00, "4 (Easy)" )
100100   PORT_DIPSETTING(    0x01, "3" )
r3115r3116
115115   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
116116   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
117117
118   PORT_START("DSWB")   /* (1) DIPSW-B */
118   PORT_START("DSWB")
119119   PORT_DIPNAME( 0x01, 0x01, "Bonus Game" )
120120   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
121121   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r3115r3116
138138   PORT_DIPSETTING(    0x40, "90%" )
139139   PORT_DIPSETTING(    0x00, "95%" )
140140
141   PORT_START("SYSTEM")   /* (2) PORT 0 */
142   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
141   PORT_START("SYSTEM")
142   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
143143   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         // NOT USED
144144   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )      // SERVICE
145145   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Memory Reset")      // MEMORY RESET
r3115r3116
148148   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )         // NOT USED
149149   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )         // COIN2
150150
151   PORT_START("IN0")   /* (3) PORT 1-0 */
151   PORT_START("IN0")
152152   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
153153   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
154154   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
r3115r3116
158158   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
159159   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
160160
161   PORT_START("IN1")   /* (4) PORT 1-1 */
161   PORT_START("IN1")
162162   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
163163   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
164164   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 )
r3115r3116
168168   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
169169   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
170170
171   PORT_START("IN2")   /* (5) PORT 2-0 */
171   PORT_START("IN2")
172172   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
173173   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
174174   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
r3115r3116
180180INPUT_PORTS_END
181181
182182static INPUT_PORTS_START( hyhoo2 )
183   PORT_START("DSWA")   /* (0) DIPSW-A */
183   PORT_START("DSWA")
184184   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
185185   PORT_DIPSETTING(    0x00, "4 (Easy)" )
186186   PORT_DIPSETTING(    0x01, "3" )
r3115r3116
203203   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
204204   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
205205
206   PORT_START("DSWB")   /* (1) DIPSW-B */
206   PORT_START("DSWB")
207207   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
208208   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
209209   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
r3115r3116
213213   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
214214   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
215215
216   PORT_START("SYSTEM")   /* (2) PORT 0 */
217   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )         // DRAW BUSY
216   PORT_START("SYSTEM")
217   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
218218   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         // NOT USED
219219   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )      // SERVICE
220220   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Memory Reset")      // MEMORY RESET
r3115r3116
223223   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )         // NOT USED
224224   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )         // COIN2
225225
226   PORT_START("IN0")   /* (3) PORT 1-0 */
226   PORT_START("IN0")
227227   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
228228   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
229229   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
r3115r3116
233233   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
234234   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
235235
236   PORT_START("IN1")   /* (4) PORT 1-1 */
236   PORT_START("IN1")
237237   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
238238   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
239239   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 )
r3115r3116
243243   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
244244   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
245245
246   PORT_START("IN2")   /* (5) PORT 2-0 */
246   PORT_START("IN2")
247247   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
248248   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
249249   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
src/mame/drivers/solomon.c
r3115r3116
5959   AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(solomon_videoram2_w) AM_BASE(&solomon_videoram2)
6060   AM_RANGE(0xe000, 0xe07f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
6161   AM_RANGE(0xe400, 0xe5ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_BASE(&paletteram)
62   AM_RANGE(0xe600, 0xe600) AM_READ(input_port_0_r)
63   AM_RANGE(0xe601, 0xe601) AM_READ(input_port_1_r)
64   AM_RANGE(0xe602, 0xe602) AM_READ(input_port_2_r)
62   AM_RANGE(0xe600, 0xe600) AM_READ_PORT("P1")
63   AM_RANGE(0xe601, 0xe601) AM_READ_PORT("P2")
64   AM_RANGE(0xe602, 0xe602) AM_READ_PORT("SYSTEM")
6565   AM_RANGE(0xe603, 0xe603) AM_READ(solomon_0xe603_r)
66   AM_RANGE(0xe604, 0xe604) AM_READ(input_port_3_r)   /* DSW1 */
67   AM_RANGE(0xe605, 0xe605) AM_READ(input_port_4_r)   /* DSW2 */
66   AM_RANGE(0xe604, 0xe604) AM_READ_PORT("DSW1")
67   AM_RANGE(0xe605, 0xe605) AM_READ_PORT("DSW2")
6868   AM_RANGE(0xe600, 0xe600) AM_WRITE(interrupt_enable_w)
6969   AM_RANGE(0xe604, 0xe604) AM_WRITE(solomon_flipscreen_w)
7070   AM_RANGE(0xe800, 0xe800) AM_WRITE(solomon_sh_command_w)
r3115r3116
9191
9292
9393static INPUT_PORTS_START( solomon )
94   PORT_START("P1")   /* IN0 */
94   PORT_START("P1")
9595   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
9696   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
9797   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
r3115r3116
101101   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
102102   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
103103
104   PORT_START("P2")   /* IN1 */
104   PORT_START("P2")
105105   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
106106   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
107107   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
r3115r3116
111111   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
112112   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
113113
114   PORT_START("SYSTEM")   /* COIN */
114   PORT_START("SYSTEM")
115115   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
116116   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
117117   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
r3115r3116
121121   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
122122   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
123123
124   PORT_START("DSW1")   /* DSW1 */
124   PORT_START("DSW1")
125125   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
126126   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
127127   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
144144   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
145145   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_3C ) )
146146
147   PORT_START("DSW2")   /* DSW2 */
147   PORT_START("DSW2")
148148   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
149149   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
150150   PORT_DIPSETTING(    0x00, DEF_STR( Normal ) )
src/mame/drivers/puckpkmn.c
r3115r3116
4949
5050static UINT16* main_ram;
5151
52static INPUT_PORTS_START( puckpkmn ) /* Puckman Pockimon Input Ports */
53   PORT_START("P2")   /* Player 2 Controls ($700011.b) */
54   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
55   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
56   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_START2 )
57   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
58   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
59   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
60   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
61   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
52/* Puckman Pockimon Input Ports */
6253
63   PORT_START("P1")   /* Player 1 Controls ($700013.b) */
64   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
54static INPUT_PORTS_START( puckpkmn )
55   PORT_START("P2")   /* $700011.b */
56   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
57   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
58   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
59   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
60   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
61   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
62   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
63   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
64
65   PORT_START("P1")   /* $700013.b */
66   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
6567   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10)
66   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_START1 )
67   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
68   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
69   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
70   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
71   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
68   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
69   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
70   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
71   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
72   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
73   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
7274
73   PORT_START("IN0")   /* ? ($700015.b) */
75   PORT_START("UNK")   /* $700015.b */
7476
75   PORT_START("DSW1")   /* DSW 1 ($700017.b) */
77   PORT_START("DSW1")   /* $700017.b */
7678   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
7779   PORT_DIPSETTING(    0x03, DEF_STR( 5C_1C ) )
7880   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
r3115r3116
9294   PORT_DIPSETTING(    0x08, "7" )
9395   PORT_DIPSETTING(    0x00, "8" )
9496   PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Difficulty ) )
95   PORT_DIPSETTING(    0xc0, DEF_STR( Easy )    )
96   PORT_DIPSETTING(    0x80, DEF_STR( Normal )  )
97   PORT_DIPSETTING(    0x40, DEF_STR( Hard )    )
97   PORT_DIPSETTING(    0xc0, DEF_STR( Easy ) )
98   PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
99   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
98100   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
99101
100   PORT_START("DSW2")   /* DSW 1 ($700019.b) */
102   PORT_START("DSW2")   /* $700019.b */
101103   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
102104   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
103105   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
r3115r3116
145147
146148static ADDRESS_MAP_START( puckpkmn_readmem, ADDRESS_SPACE_PROGRAM, 16 )
147149   AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM)               /* Main 68k Program Roms */
148   AM_RANGE(0x700010, 0x700011) AM_READ(input_port_0_word_r)      /* Input (P2) */
149   AM_RANGE(0x700012, 0x700013) AM_READ(input_port_1_word_r)      /* Input (P1) */
150   AM_RANGE(0x700014, 0x700015) AM_READ(input_port_2_word_r)      /* Input (?) */
151   AM_RANGE(0x700016, 0x700017) AM_READ(input_port_3_word_r)      /* Input (DSW1) */
152   AM_RANGE(0x700018, 0x700019) AM_READ(input_port_4_word_r)      /* Input (DSW2) */
150   AM_RANGE(0x700010, 0x700011) AM_READ_PORT("P2")
151   AM_RANGE(0x700012, 0x700013) AM_READ_PORT("P1")
152   AM_RANGE(0x700014, 0x700015) AM_READ_PORT("UNK")
153   AM_RANGE(0x700016, 0x700017) AM_READ_PORT("DSW1")
154   AM_RANGE(0x700018, 0x700019) AM_READ_PORT("DSW2")
153155   AM_RANGE(0x700022, 0x700023) AM_READ(okim6295_status_0_lsb_r)   /* M6295 Sound Chip Status Register */
154156   AM_RANGE(0xa04000, 0xa04001) AM_READ(puckpkmn_YM3438_r)         /* Ym3438 Sound Chip Status Register */
155157   AM_RANGE(0xc00000, 0xc0001f) AM_READ(genesis_vdp_r)            /* VDP Access */
156   AM_RANGE(0xe00000, 0xe1ffff) AM_READ(SMH_BANK1)            /* VDP sees the roms here */
157   AM_RANGE(0xfe0000, 0xfeffff) AM_READ(SMH_BANK2)            /* VDP sees the ram here */
158   AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM   )               /* Main Ram */
158   AM_RANGE(0xe00000, 0xe1ffff) AM_READ(SMH_BANK1)               /* VDP sees the roms here */
159   AM_RANGE(0xfe0000, 0xfeffff) AM_READ(SMH_BANK2)               /* VDP sees the ram here */
160   AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM)               /* Main Ram */
159161
160162   /* Unknown reads: */
161//  AM_RANGE(0xa10000, 0xa10001) AM_READ(SMH_NOP)                 /* ? once */
163//  AM_RANGE(0xa10000, 0xa10001) AM_READ(SMH_NOP)                   /* ? once */
162164   AM_RANGE(0xa10002, 0xa10005) AM_READ(SMH_NOP)               /* ? alternative way of reading inputs ? */
163165   AM_RANGE(0xa11100, 0xa11101) AM_READ(SMH_NOP)               /* ? */
164166ADDRESS_MAP_END
src/mame/drivers/moo.c
r3115r3116
9797   /* bit 1 is EEPROM ready */
9898   /* bit 3 is service button */
9999   /* bits 4-7 are DIP switches */
100   res = eeprom_read_bit() | input_port_read(machine, "IN1");
100   res = input_port_read(machine, "IN1");
101101
102102   if (init_eeprom_count)
103103   {
r3115r3116
480480   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 )
481481
482482   PORT_START("IN1")
483   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
483   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
484484   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
485485   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
486486   PORT_SERVICE_NO_TOGGLE(0x08, IP_ACTIVE_LOW)
487487   PORT_DIPNAME( 0x10, 0x00, "Sound Output")
488   PORT_DIPSETTING(    0x10, DEF_STR( Mono ))
489   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ))
488   PORT_DIPSETTING(    0x10, DEF_STR( Mono ) )
489   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ) )
490490   PORT_DIPNAME( 0x20, 0x20, "Coin Mechanism")
491491   PORT_DIPSETTING(    0x20, "Common")
492492   PORT_DIPSETTING(    0x00, "Independent")
src/mame/drivers/taito_l.c
r3115r3116
119119static read8_machine_func portf0_r;
120120static read8_machine_func portf1_r;
121121
122static int adpcm_pos;
123static int adpcm_data;
124static int trackx,tracky;
125static int mux_ctrl = 0;
126static int extport;
127static int last_irq_level;
128static int high = 0;
129static int high2 = 0;
130
131static const UINT8 *mcu_reply;
132static int mcu_pos = 0, mcu_reply_len = 0;
133static int last_data_adr, last_data;
134static int cur_bank = 0;
135
122136static void palette_notifier(int addr)
123137{
124138   UINT8 *p = palette_ram + (addr & ~1);
r3115r3116
166180      decodechar(machine->gfx[2], i, taitol_rambanks);
167181      decodechar(machine->gfx[2], i+512, taitol_rambanks + 0x4000);
168182   }
183
184   adpcm_pos = 0;
185   adpcm_data = -1;
186   trackx = tracky = 0;
187   mux_ctrl = 0;
188   extport = 0;
189   last_irq_level = 0;
190   high = 0;
191   high2 = 0;
192
193   mcu_pos = mcu_reply_len = 0;
194   last_data_adr = last_data = 0;
195   cur_bank = 0;
169196}
170197
171198
r3115r3116
261288}
262289
263290
264static int last_irq_level;
265
266291static IRQ_CALLBACK(irq_callback)
267292{
268293   return irq_adr_table[last_irq_level];
r3115r3116
323348
324349static WRITE8_HANDLER( rombankswitch_w )
325350{
326   static int high = 0;
327351   if(cur_rombank != data)
328352   {
329353      if(data>high)
r3115r3116
340364
341365static WRITE8_HANDLER( rombank2switch_w )
342366{
343   static int high = 0;
344
345367   data &= 0xf;
346368
347369   if(cur_rombank2 != data)
348370   {
349      if(data>high)
371      if(data>high2)
350372      {
351         high = data;
352         logerror("New rom2 size : %x\n", (high+1)*0x4000);
373         high2 = data;
374         logerror("New rom2 size : %x\n", (high2+1)*0x4000);
353375      }
354376
355377//      logerror("robs2 %02x (%04x)\n", data, activecpu_get_pc());
r3115r3116
449471   coin_counter_w(1,data & 0x08);
450472}
451473
452static int extport;
453
454474static READ8_HANDLER( portA_r )
455475{
456476   if (extport == 0) return porte0_r(machine,0);
r3115r3116
475495   return ym2203_read_port_0_r(machine,offset);
476496}
477497
478static const UINT8 *mcu_reply;
479static int mcu_pos = 0, mcu_reply_len = 0;
480static int last_data_adr, last_data;
481
482498static const UINT8 puzznic_mcu_reply[] = { 0x50, 0x1f, 0xb6, 0xba, 0x06, 0x03, 0x47, 0x05, 0x00 };
483499
484500static WRITE8_HANDLER( mcu_data_w )
r3115r3116
533549   shared_ram[offset] = data;
534550}
535551
536static int mux_ctrl = 0;
537
538552static READ8_HANDLER( mux_r )
539553{
540554   switch(mux_ctrl)
r3115r3116
575589
576590
577591
578static int adpcm_pos;
579
580592static void champwr_msm5205_vck(running_machine *machine, int chip)
581593{
582   static int adpcm_data = -1;
583
584594   if (adpcm_data != -1)
585595   {
586596      msm5205_data_w(0, adpcm_data & 0x0f);
r3115r3116
622632
623633
624634
625static int trackx,tracky;
626
627635static READ8_HANDLER( horshoes_tracky_reset_r )
628636{
629637   /* reset the trackball counter */
r3115r3116
11321140INPUT_PORTS_END
11331141
11341142static INPUT_PORTS_START( fhawkj )
1135   PORT_START("DSWA")
1136   TAITO_MACHINE_COCKTAIL
1137   TAITO_COINAGE_JAPAN_OLD
1143   PORT_INCLUDE( fhawk )
11381144
1139   PORT_START("DSWB")
1140   TAITO_DIFFICULTY
1141   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )  // all in manual
1142   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1143   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1144   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
1145   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1146   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1147   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
1148   PORT_DIPSETTING(    0x30, "3" )
1149   PORT_DIPSETTING(    0x20, "4" )
1150   PORT_DIPSETTING(    0x10, "5" )
1151   PORT_DIPSETTING(    0x00, "6" )
1152   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
1153   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1154   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1155   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
1156   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1157   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1158
1159   PORT_START("IN0")
1160   TAITO_JOY_UDLR_2_BUTTONS( 1 )
1161
1162   PORT_START("IN1")
1163   TAITO_JOY_UDLR_2_BUTTONS( 2 )
1164
1165   TAITO_L_SYSTEM_INPUT( IP_ACTIVE_LOW, 4 )
1145   PORT_MODIFY("DSWA")
1146   TAITO_COINAGE_JAPAN_OLD
11661147INPUT_PORTS_END
11671148
11681149static INPUT_PORTS_START( raimais )
r3115r3116
12001181INPUT_PORTS_END
12011182
12021183static INPUT_PORTS_START( raimaisj )
1203   PORT_START("DSWA")
1204   TAITO_MACHINE_COCKTAIL
1205   TAITO_COINAGE_JAPAN_OLD
1184   PORT_INCLUDE( raimais )
12061185
1207   PORT_START("DSWB")
1208   TAITO_DIFFICULTY
1209   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
1210   PORT_DIPSETTING(    0x08, "80k and 160k" )
1211   PORT_DIPSETTING(    0x0c, "80k only" )
1212   PORT_DIPSETTING(    0x04, "160k only" )
1213   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1214   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
1215   PORT_DIPSETTING(    0x30, "3" )
1216   PORT_DIPSETTING(    0x20, "4" )
1217   PORT_DIPSETTING(    0x10, "5" )
1218   PORT_DIPSETTING(    0x00, "6" )
1219   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1220   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1221   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1222   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )
1223   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1224   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1225
1226   PORT_START("IN0")
1227   TAITO_JOY_UDLR_2_BUTTONS( 1 )
1228
1229   PORT_START("IN1")
1230   TAITO_JOY_UDLR_2_BUTTONS( 2 )
1231
1232   TAITO_L_SYSTEM_INPUT( IP_ACTIVE_HIGH, 1 )
1186   PORT_MODIFY("DSWA")
1187   TAITO_COINAGE_JAPAN_OLD
12331188INPUT_PORTS_END
12341189
12351190static INPUT_PORTS_START( champwr )
r3115r3116
21052060
21062061static WRITE8_HANDLER( portA_w )
21072062{
2108   static int cur_bank = 0;
2109
21102063   if (cur_bank != (data & 0x03) )
21112064   {
21122065      int bankaddress;
src/mame/drivers/gyruss.c
r3115r3116
5757
5858#include "driver.h"
5959#include "machine/konami1.h"
60#include "cpu/i8039/i8039.h"
60#include "cpu/mcs48/mcs48.h"
6161#include "sound/ay8910.h"
6262#include "sound/discrete.h"
6363
r3115r3116
100100}
101101
102102
103static WRITE8_HANDLER(gyruss_dac_w)
103static WRITE8_HANDLER( gyruss_dac_w )
104104{
105105   discrete_sound_w(machine, NODE(16), data);
106106}
107107
108static WRITE8_HANDLER( gyruss_irq_clear_w )
109{
110   cputag_set_input_line(machine, "audio2", 0, CLEAR_LINE);
111}
112
108113static void filter_w(running_machine *machine, int chip, int data)
109114{
110115   int i;
r3115r3116
133138static WRITE8_HANDLER( gyruss_sh_irqtrigger_w )
134139{
135140   /* writing to this register triggers IRQ on the sound CPU */
136   cpunum_set_input_line_and_vector(machine, 2,0,HOLD_LINE,0xff);
141   cputag_set_input_line_and_vector(machine, "audio", 0, HOLD_LINE, 0xff);
137142}
138143
139144static WRITE8_HANDLER( gyruss_i8039_irq_w )
140145{
141   cpunum_set_input_line(machine, 3, 0, PULSE_LINE);
146   cputag_set_input_line(machine, "audio2", 0, ASSERT_LINE);
142147}
143148
144149
r3115r3116
201206
202207static ADDRESS_MAP_START( audio_cpu2_io_map, ADDRESS_SPACE_IO, 8 )
203208   AM_RANGE(0x00, 0xff) AM_READ(soundlatch2_r)
204   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(gyruss_dac_w)
205   AM_RANGE(I8039_p2, I8039_p2) AM_WRITE(SMH_NOP)
209   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(gyruss_dac_w)
210   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(gyruss_irq_clear_w)
206211ADDRESS_MAP_END
207212
208213
src/mame/drivers/srmp5.c
r3115r3116
168168   AM_RANGE(0x00000000, 0x000fffff) AM_RAM //maybe 0 - 2fffff ?
169169   AM_RANGE(0x002f0000, 0x002f7fff) AM_RAM
170170   AM_RANGE(0x01000000, 0x01000003) AM_WRITE(SMH_RAM)  // 0xaa .. watchdog ?
171   AM_RANGE(0x01800004, 0x01800007) AM_READ(input_port_0_dword_r)
172   AM_RANGE(0x01800008, 0x0180000b) AM_READ(input_port_1_dword_r)
171   AM_RANGE(0x01800004, 0x01800007) AM_READ_PORT("IN0")
172   AM_RANGE(0x01800008, 0x0180000b) AM_READ_PORT("IN1")
173173   AM_RANGE(0x0180000c, 0x0180000f) AM_WRITE(bank_w)
174   AM_RANGE(0x01800010, 0x01800013) AM_READ(input_port_2_dword_r) //multiplexed controls (selected by writes to 1c)
175   AM_RANGE(0x01800014, 0x01800017) AM_READ(input_port_3_dword_r)
174   AM_RANGE(0x01800010, 0x01800013) AM_READ_PORT("IN2") //multiplexed controls (selected by writes to 1c)
175   AM_RANGE(0x01800014, 0x01800017) AM_READ_PORT("IN3")
176176   AM_RANGE(0x0180001c, 0x0180001f) AM_WRITE(SMH_RAM)//c1 c2 c4 c8 => mahjong inputs (at $10) - bits 0-3
177177   AM_RANGE(0x01800200, 0x0180020f) AM_RAM  //sound related ? only few writes after boot
178178   AM_RANGE(0x01a00000, 0x01bfffff) AM_READ(data_r)
src/mame/drivers/suprloco.c
r3115r3116
4242   AM_RANGE(0x0000, 0x7fff) AM_ROM
4343   AM_RANGE(0x8000, 0xbfff) AM_ROM
4444   AM_RANGE(0xc000, 0xc1ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
45   AM_RANGE(0xc800, 0xc800) AM_READ(input_port_0_r)
46   AM_RANGE(0xd000, 0xd000) AM_READ(input_port_1_r)
47   AM_RANGE(0xd800, 0xd800) AM_READ(input_port_2_r)
48   AM_RANGE(0xe000, 0xe000) AM_READ(input_port_3_r)
49   AM_RANGE(0xe001, 0xe001) AM_READ(input_port_4_r)
45   AM_RANGE(0xc800, 0xc800) AM_READ_PORT("SYSTEM")
46   AM_RANGE(0xd000, 0xd000) AM_READ_PORT("P1")
47   AM_RANGE(0xd800, 0xd800) AM_READ_PORT("P2")
48   AM_RANGE(0xe000, 0xe000) AM_READ_PORT("DSW1")
49   AM_RANGE(0xe001, 0xe001) AM_READ_PORT("DSW2")
5050   AM_RANGE(0xe800, 0xe800) AM_WRITE(suprloco_soundport_w)
5151   AM_RANGE(0xe801, 0xe801) AM_READWRITE(suprloco_control_r, suprloco_control_w)
5252   AM_RANGE(0xf000, 0xf6ff) AM_RAM_WRITE(suprloco_videoram_w) AM_BASE(&suprloco_videoram)
r3115r3116
6666
6767
6868static INPUT_PORTS_START( suprloco )
69   PORT_START("IN0")
69   PORT_START("SYSTEM")
7070   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
7171   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
7272   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
r3115r3116
7575   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
7676   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
7777
78   PORT_START("IN1")
78   PORT_START("P1")
7979   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
8080   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
8181   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
r3115r3116
8484   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
8585   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
8686
87   PORT_START("IN2")
87   PORT_START("P2")
8888   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
8989   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
9090   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
r3115r3116
142142   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
143143   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
144144   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
145
146145INPUT_PORTS_END
147146
148147
src/mame/drivers/hal21.c
r3115r3116
11/*
22    Hal21
3    ASO
4    Alpha Mission
53
64
75Change Log
r3115r3116
108AT08XX03:
119
1210[Common]
13 - cleaned and consolidated VIDEO_UPDATE()
1411 - added shadows and highlights
1512
16 * A.S.O and HAL21 do a lot of palette cycling therefore
17   conversion to tilemaps may be disadvantageous.
18   Cocktail mode involves changing tile offsets and sprite
13 * Cocktail mode involves changing tile offsets and sprite
1914   coordinates and is still unsupported.
2015
2116 * Manuals show both boards have noise filters to smooth out
r3115r3116
2419[HAL21]
2520 - installed NMI scheduler to prevent music trashing
2621
27[ASO]
28 - fixed music and sound effects being cut short
29 - fixed service mode(hold P1 start during ROM test)
30 - improved scrolling and color
31
32 * Stage 5 boss' sky and the first half of stage 6's background
33   appear to have consistent color as shown in Beep! magazine:
34
35     http://qtq.hp.infoseek.co.jp/kouryaku/aso/aso2.jpg
36     http://qtq.hp.infoseek.co.jp/kouryaku/aso/aso3.png
37
38   Compared to MAME these areas are blacked out under pens
39   0xf0-0xff. On the other hand pens 0x170-0x17f suit them
40   perfectly but they are never used in the first two loops.
41   (I played through the game and logged pen usage. Only four
42   color codes have blue pen15 so it's not difficult to tell.)
43
44   There are unknown bits embedded in RGB triplets and the whole
45   upper half of the palette is simply unused. The fact that ASO's
46   color PROMs are identical in every set dismissed bad dumps but
47   increased the likelyhood of proprietary logic which is quite
48   obvious in Touchdown Fever and HAL21.
49
5022[TODO]
51 - find out what "really" messes up ASO's scrolling
52 - verify color effects in both games
23 - verify color effects
5324*/
5425
5526#include "driver.h"
r3115r3116
6031
6132static UINT8 *hal21_vreg, *hal21_sndfifo;
6233static UINT8 *textram;
63static UINT8 *aso_scroll_sync;
6434static int color[2];
6535static int snk_blink_parity;   // FIXME likely wrong
36static int snk_sound_busy_bit;
6637
6738/**************************************************************************/
68// Test Handlers
6939
70static WRITE8_HANDLER( aso_scroll_sync_w )
71{
72   if (data == 0x7f && (program_read_byte(0xdcd2) & 1)) data++;
73   aso_scroll_sync[offset] = data;
74}
75
7640static void hal21_sound_scheduler(running_machine *machine, int mode, int data)
7741{
7842   static int busy, hold, ffcount, ffhead, fftail;
r3115r3116
12993static WRITE8_HANDLER( hal21_vreg3_w ){ hal21_vreg[3] = data; }
13094static WRITE8_HANDLER( hal21_vreg4_w ){ hal21_vreg[4] = data; }
13195static WRITE8_HANDLER( hal21_vreg5_w ){ hal21_vreg[5] = data; }
132static WRITE8_HANDLER( hal21_vreg6_w ){ hal21_vreg[6] = data; }
133static WRITE8_HANDLER( hal21_vreg7_w ){ hal21_vreg[7] = data; }
13496
13597
13698PALETTE_INIT( aso )
r3115r3116
175137   gfx_drawmode_table[7] = DRAWMODE_NONE;
176138}
177139
178static VIDEO_START( aso )
140static VIDEO_START( hal21 )
179141{
180142   snk_blink_parity = 0;
181143}
r3115r3116
255217   }
256218}
257219
258static void aso_draw_background(bitmap_t *bitmap, const rectangle *cliprect, int scrollx, int scrolly, int attrs,
259                        const gfx_element *gfx )
220static void tnk3_draw_text(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, UINT8 *source )
260221{
261   int bankbase, c, x, y, offsx, offsy, dx, dy, sx, sy, offs, tile_number;
222   const gfx_element *gfx = machine->gfx[0];
262223
263   bankbase = attrs<<4 & 0x300;
264   c = attrs & 0x0f;
265   if (c == 7) c = 15;
224   int tile_number, color, sx, sy;
225   int x, y;
266226
267   offsx = ((scrollx>>3) + 0) & 0x3f;
268   dx = -(scrollx & 7) + 0;
269   offsy = ((scrolly>>3) + 0) & 0x3f;
270   dy = -(scrolly & 7) + 0;
227   for(x=0; x<32; x++) for(y=0; y<32; y++)
228   {
229      tile_number = source[(x<<5)+y];
271230
272   for (x=2; x<35; x++)
273      for (y=0; y<28; y++)
274      {
275         offs = (((offsx+x)&0x3f)<<6) + ((offsy+y)&0x3f);
276         sx = (x<<3) + dx;
277         sy = (y<<3) + dy;
278         tile_number = bankbase + videoram[offs];
231      if(tile_number == 0x20 || tile_number == 0xff) continue;
279232
280         drawgfx(bitmap, gfx,
281            tile_number, c,
282            0, 0,
283            sx, sy,
284            cliprect, TRANSPARENCY_NONE, 0);
233      if(bank == -1) color = 8;
234      else
235      {
236         color = tile_number >> 5;
237         tile_number |= bank << 8;
285238      }
239      sx = (x+2) << 3;
240      sy = (y+1) << 3;
241
242      drawgfx(bitmap,gfx,tile_number,color,0,0,sx,sy,cliprect,TRANSPARENCY_PEN,15);
243   }
286244}
287245
288static void aso_draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, int scrollx, int scrolly,
289                        const gfx_element *gfx )
246static void tnk3_draw_status_main(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, UINT8 *source, int start )
290247{
291   UINT8 *sprptr, *endptr;
292   int attrs, tile, x, y, color;
248   const gfx_element *gfx = machine->gfx[0];
293249
294   sprptr = spriteram;
295   endptr = spriteram + 0x100;
250   int tile_number, color, sx, sy;
251   int x, y;
296252
297   for (; sprptr<endptr; sprptr+=4)
253   for(x = start; x < start+2; x++) for(y = 0; y < 32; y++)
298254   {
299      if (*(UINT32*)sprptr == 0 || *(UINT32*)sprptr == -1) continue;
255      tile_number = source[(x<<5)+y];
300256
301      attrs = sprptr[3]; /* YBBX.CCCC */
302      tile  = sprptr[1] + (attrs<<2 & 0x100) + (~attrs<<4 & 0x200);
303      color = attrs & 0x0f;
304      y     = (sprptr[0] + (attrs<<4 & 0x100) - scrolly) & 0x1ff;
305      x     = (0x100 - (sprptr[2] + (attrs<<1 & 0x100) - scrollx)) & 0x1ff;
306      if (y > 512-16) y -= 512;
307      if (x > 512-16) x -= 512;
257      if(bank == -1) color = 8;
258      else
259      {
260          color = tile_number >> 5;
261         tile_number |= (bank << 8);
262      }
263      sx = ((x+34)&0x3f) << 3;
264      sy = (y+1) << 3;
308265
309      drawgfx(bitmap, gfx,
310            tile, color,
311            0, 0,
312            x, y,
313            cliprect, TRANSPARENCY_PEN_TABLE, 7);
266      drawgfx(bitmap,gfx,tile_number,color,0,0,sx,sy,cliprect,TRANSPARENCY_NONE,0);
314267   }
315268}
316269
317static VIDEO_UPDATE( aso )
270static void tnk3_draw_status(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, UINT8 *source )
318271{
272   tnk3_draw_status_main(machine,bitmap,cliprect,bank,source, 0);
273   tnk3_draw_status_main(machine,bitmap,cliprect,bank,source,30);
274}
275
276static VIDEO_UPDATE( hal21 )
277{
319278   int attr, msbs, spsy, spsx, bgsy, bgsx, bank, i;
320279
321280   attr = (int)hal21_vreg[0];
r3115r3116
325284   bgsy = (int)hal21_vreg[4] + (msbs<<4 & 0x100) - 8;
326285   bgsx = (int)hal21_vreg[5] - 16;
327286
328   if (snk_gamegroup)
329   {
330      hal21_draw_background(screen->machine, bitmap, cliprect, bgsx+(msbs<<7 & 0x100), bgsy, attr, screen->machine->gfx[1]);
287   hal21_draw_background(screen->machine, bitmap, cliprect, bgsx+(msbs<<7 & 0x100), bgsy, attr, screen->machine->gfx[1]);
331288
332      attr = snk_blink_parity;
333      snk_blink_parity ^= 0xdf;
334      for (i=6; i<0x80; i+=8) { palette_set_color(screen->machine, i, MAKE_RGB(attr, attr, attr)); }
289   attr = snk_blink_parity;
290   snk_blink_parity ^= 0xdf;
291   for (i=6; i<0x80; i+=8) { palette_set_color(screen->machine, i, MAKE_RGB(attr, attr, attr)); }
335292
336      hal21_draw_sprites(bitmap, cliprect, spsx, spsy, screen->machine->gfx[2]);
337   }
338   else
339   {
340      aso_draw_background(bitmap, cliprect, bgsx+(~msbs<<7 & 0x100), bgsy, attr, screen->machine->gfx[1]);
341      aso_draw_sprites(bitmap, cliprect, spsx, spsy, screen->machine->gfx[2]);
342   }
293   hal21_draw_sprites(bitmap, cliprect, spsx, spsy, screen->machine->gfx[2]);
343294
344295   bank = msbs>>6 & 1;
345296   tnk3_draw_text(screen->machine, bitmap, cliprect, bank, &textram[0]);
r3115r3116
433384
434385/**************************************************************************/
435386
436static INPUT_PORTS_START( aso )
437   PORT_START("SYSTEM")
438   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN2 )
439   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_SERVICE1 )
440   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_COIN1 )
441   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
442   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
443   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(sound_status_r, NULL) /* sound CPU status */
444   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
445   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
446
447   PORT_START("P1")
448   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
449   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
450   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
451   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
452   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 )
453   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
454   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
455   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
456
457   PORT_START("P2")
458   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
459   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
460   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
461   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
462   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
463   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
464   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
465   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
466
467   PORT_START("DSW1")
468   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) )
469   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
470   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
471   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
472   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
473   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
474   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
475   PORT_DIPSETTING(    0x04, "3" )
476   PORT_DIPSETTING(    0x00, "5" )
477   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coinage ) )
478   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C) )
479   PORT_DIPSETTING(    0x28, DEF_STR( 3C_1C) )
480   PORT_DIPSETTING(    0x30, DEF_STR( 2C_1C) )
481   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C) )
482   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C) )
483   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C) )
484   PORT_DIPSETTING(    0x08, DEF_STR( 1C_4C) )
485   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C) )
486   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) )
487   PORT_DIPSETTING(    0xc0, "50k 100k" )
488   PORT_DIPSETTING(    0x80, "60k 120k" )
489   PORT_DIPSETTING(    0x40, "100k 200k" )
490   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
491
492   PORT_START("DSW2")
493   PORT_DIPNAME( 0x01, 0x01, "Bonus Occurrence" )
494   PORT_DIPSETTING(    0x01, "1st & every 2nd" )
495   PORT_DIPSETTING(    0x00, "1st & 2nd only" )
496   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )
497   PORT_DIPSETTING(    0x06, DEF_STR( Easy ) )
498   PORT_DIPSETTING(    0x04, DEF_STR( Normal ) )
499   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
500   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
501   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
502   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
503   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
504   PORT_DIPNAME( 0x10, 0x10, "Effect of some kind (Cheat)")
505   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
506   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
507   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
508   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
509   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
510   PORT_DIPNAME( 0xc0, 0xc0, "Start Area" )
511   PORT_DIPSETTING(    0xc0, "1" )
512   PORT_DIPSETTING(    0x80, "2" )
513   PORT_DIPSETTING(    0x40, "3" )
514   PORT_DIPSETTING(    0x00, "4" )
515INPUT_PORTS_END
516
517
518/**************************************************************************/
519
520387static const gfx_layout char256 = {
521388   8,8,
522389   0x100,
r3115r3116
574441   return data;
575442}
576443
577static WRITE8_HANDLER( aso_soundcommand_w )
578{
579   snk_sound_busy_bit = 0x01;
580   soundlatch_w(machine, 0, data);
581   cpunum_set_input_line(machine, 2, 0, HOLD_LINE );
582}
583
584444static INTERRUPT_GEN( hal21_sound_interrupt )
585445{
586446   hal21_sound_scheduler(machine, 3, 0);
r3115r3116
588448
589449/**************************************************************************/
590450
591static ADDRESS_MAP_START( aso_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
592   AM_RANGE(0x0000, 0xbfff) AM_ROM
593   AM_RANGE(0xc000, 0xc7ff) AM_RAM
594   AM_RANGE(0xd000, 0xd000) AM_READ(hal21_soundcommand_r)
595   AM_RANGE(0xe000, 0xe000) AM_READ(CPUC_ready_r)
596   AM_RANGE(0xf000, 0xf000) AM_READWRITE(ym3526_status_port_0_r, ym3526_control_port_0_w) /* YM3526 #1 control port? */
597   AM_RANGE(0xf001, 0xf001) AM_WRITE(ym3526_write_port_0_w)   /* YM3526 #1 write port?  */
598   AM_RANGE(0xf002, 0xf002) AM_READNOP // unknown read
599   AM_RANGE(0xf004, 0xf004) AM_READNOP // unknown read
600   AM_RANGE(0xf006, 0xf006) AM_READNOP // unknown read
601ADDRESS_MAP_END
602
603/**************************************************************************/
604
605451static ADDRESS_MAP_START( hal21_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
606452   AM_RANGE(0x0000, 0x3fff) AM_ROM
607453   AM_RANGE(0x8000, 0x87ff) AM_RAM
r3115r3116
619465   AM_RANGE(0x0000, 0x0000) AM_NOP            // external sound ROM detection?
620466ADDRESS_MAP_END
621467
622/**************************** ASO/Alpha Mission *************************/
623
624static ADDRESS_MAP_START( aso_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
625   AM_RANGE(0x0000, 0xbfff) AM_ROM
626   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("SYSTEM")
627   AM_RANGE(0xc100, 0xc100) AM_READ_PORT("P1")
628   AM_RANGE(0xc200, 0xc200) AM_READ_PORT("P2")
629   AM_RANGE(0xc400, 0xc400) AM_WRITE(aso_soundcommand_w)
630   AM_RANGE(0xc500, 0xc500) AM_READ_PORT("DSW1")
631   AM_RANGE(0xc600, 0xc600) AM_READ_PORT("DSW2")
632   AM_RANGE(0xc700, 0xc700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w)
633   AM_RANGE(0xc800, 0xc800) AM_WRITE(hal21_vreg1_w)
634   AM_RANGE(0xc900, 0xc900) AM_WRITE(hal21_vreg2_w)
635   AM_RANGE(0xca00, 0xca00) AM_WRITE(hal21_vreg3_w)
636   AM_RANGE(0xcb00, 0xcb00) AM_WRITE(hal21_vreg4_w)
637   AM_RANGE(0xcc00, 0xcc00) AM_WRITE(hal21_vreg5_w)
638   AM_RANGE(0xcd00, 0xcd00) AM_WRITE(hal21_vreg6_w)
639   AM_RANGE(0xce00, 0xce00) AM_WRITE(hal21_vreg7_w)
640   AM_RANGE(0xcf00, 0xcf00) AM_WRITE(hal21_vreg0_w)
641   AM_RANGE(0xdcf8, 0xdcf8) AM_WRITE(aso_scroll_sync_w) AM_BASE(&aso_scroll_sync)
642   AM_RANGE(0xd800, 0xe7ff) AM_RAM AM_SHARE(2)
643   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE(&spriteram)
644   AM_RANGE(0xe800, 0xf7ff) AM_RAM AM_SHARE(3) AM_BASE(&videoram)
645   AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE(1) AM_BASE(&textram)
646ADDRESS_MAP_END
647
648static ADDRESS_MAP_START( aso_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
649   AM_RANGE(0x0000, 0xbfff) AM_ROM
650   AM_RANGE(0xc000, 0xc000) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)
651   AM_RANGE(0xc800, 0xd7ff) AM_RAM AM_SHARE(2)
652   AM_RANGE(0xd800, 0xe7ff) AM_RAM AM_SHARE(3)
653   AM_RANGE(0xe800, 0xf7ff) AM_RAM
654   AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE(1)
655ADDRESS_MAP_END
656
657468/**************************** HAL21 *************************/
658469
659470static ADDRESS_MAP_START( hal21_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
r3115r3116
686497
687498/**************************************************************************/
688499
689static DRIVER_INIT( aso )
690{
691   hal21_vreg = auto_malloc(16);
692   snk_gamegroup = 0;
693}
694
695500static DRIVER_INIT( hal21 )
696501{
697502   hal21_vreg = auto_malloc(24);
698503   hal21_sndfifo = hal21_vreg + 8;
699   snk_gamegroup = 1;
700504}
701505
702506static MACHINE_RESET( aso )
r3115r3116
706510   snk_sound_busy_bit = 0;
707511}
708512
709static MACHINE_DRIVER_START( aso )
710
711   /* basic machine hardware */
712   MDRV_CPU_ADD("main", Z80, 4000000)
713   MDRV_CPU_PROGRAM_MAP(aso_cpuA_map,0)
714   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
715
716   MDRV_CPU_ADD("sub", Z80, 4000000)
717   MDRV_CPU_PROGRAM_MAP(aso_cpuB_map,0)
718   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
719
720   MDRV_CPU_ADD("audio", Z80, 4000000)
721   MDRV_CPU_PROGRAM_MAP(aso_sound_map,0)
722   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
723
724   MDRV_INTERLEAVE(100)
725
726   /* video hardware */
727   MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
728
729   MDRV_SCREEN_ADD("main", RASTER)
730   MDRV_SCREEN_REFRESH_RATE(60)
731   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
732   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
733   MDRV_SCREEN_SIZE(36*8, 28*8)
734   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 28*8-1)
735
736   MDRV_GFXDECODE(aso)
737   MDRV_PALETTE_LENGTH(1024)
738
739   MDRV_MACHINE_RESET(aso)
740
741   MDRV_PALETTE_INIT(aso)
742   MDRV_VIDEO_START(aso)
743   MDRV_VIDEO_RESET(aso)
744   MDRV_VIDEO_UPDATE(aso)
745
746   /* sound hardware */
747   MDRV_SPEAKER_STANDARD_MONO("mono")
748
749   MDRV_SOUND_ADD("ym", YM3526, 4000000)
750   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
751MACHINE_DRIVER_END
752
753513static MACHINE_DRIVER_START( hal21 )
754514
755515   /* basic machine hardware */
r3115r3116
785545   MDRV_MACHINE_RESET(aso)
786546
787547   MDRV_PALETTE_INIT(aso)
788   MDRV_VIDEO_START(aso)
548   MDRV_VIDEO_START(hal21)
789549   MDRV_VIDEO_RESET(aso)
790   MDRV_VIDEO_UPDATE(aso)
550   MDRV_VIDEO_UPDATE(hal21)
791551
792552   /* sound hardware */
793553   MDRV_SPEAKER_STANDARD_MONO("mono")
r3115r3116
875635   ROM_LOAD( "hal21_1.prm",  0x800, 0x400, CRC(195768fc) SHA1(c88bc9552d57d52fb4b030d118f48fedccf563f4) )
876636ROM_END
877637
878ROM_START( aso )
879   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
880   ROM_LOAD( "p1.bin",  0x0000, 0x8000, CRC(3fc9d5e4) SHA1(1318904d3d896affd5affd8e475ac9ee6929b955) )
881   ROM_LOAD( "p3.bin",  0x8000, 0x4000, CRC(39a666d2) SHA1(b5426520eb600d44bc5566d742d7b88194076494) )
882638
883   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
884   ROM_LOAD( "p4.bin",  0x0000, 0x8000, CRC(2429792b) SHA1(674e81880f359f7e8d34d0ad9074267360afadbf) )
885   ROM_LOAD( "p6.bin",  0x8000, 0x4000, CRC(c0bfdf1f) SHA1(65b15ce9c2e78df79cb603c58639421d29701633) )
886639
887   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
888   ROM_LOAD( "p7.bin",  0x0000, 0x8000, CRC(49258162) SHA1(c265b79d012be1e065389f910f7b4ce61f5b27ce) )  /* YM3526 */
889   ROM_LOAD( "p9.bin",  0x8000, 0x4000, CRC(aef5a4f4) SHA1(e908e79e27ff892fe75d1ba5cb0bc9dc6b7b4268) )
890640
891   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE ) /* characters */
892   ROM_LOAD( "p14.bin", 0x0000, 0x2000, CRC(8baa2253) SHA1(e6e4a5aa005e89744c4e2a19a080cf322edc6b52) )
893
894   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE ) /* background tiles */
895   ROM_LOAD( "p10.bin", 0x0000, 0x8000, CRC(00dff996) SHA1(4f6ce4c0f2da0d2a711bcbf9aa998b4e31d0d9bf) )
896
897   ROM_REGION( 0x18000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
898   ROM_LOAD( "p11.bin", 0x00000, 0x8000, CRC(7feac86c) SHA1(13b81f006ec587583416c1e7432da4c3f0375924) )
899   ROM_LOAD( "p12.bin", 0x08000, 0x8000, CRC(6895990b) SHA1(e84554cae9a768021c3dc7183bc3d28e2dd768ee) )
900   ROM_LOAD( "p13.bin", 0x10000, 0x8000, CRC(87a81ce1) SHA1(28c1069e6c08ecd579f99620c1cb6df01ad1aa74) )
901
902   ROM_REGION( 0x0c00, "proms", 0 )
903   ROM_LOAD( "mb7122h.f12",  0x000, 0x00400, CRC(5b0a0059) SHA1(f61e17c8959f1cd6cc12b38f2fb7c6190ebd0e0c) )
904   ROM_LOAD( "mb7122h.f13",  0x400, 0x00400, CRC(37e28dd8) SHA1(681726e490872a574dd0295823a44d64ef3a7b45) )
905   ROM_LOAD( "mb7122h.f14",  0x800, 0x00400, CRC(c3fd1dd3) SHA1(c48030cc458f0bebea0ffccf3d3c43260da6a7fb) )
906
907   ROM_REGION( 0x0600, "plds", ROMREGION_DISPOSE )
908   ROM_LOAD( "pal16l8a-1.bin", 0x0000, 0x0104, CRC(4e3f9e0d) SHA1(de448d50c0d1cdef159a8c4028846142210eba0b) )
909   ROM_LOAD( "pal16l8a-2.bin", 0x0200, 0x0104, CRC(2a681f9e) SHA1(b26eb631d3e4fa6850a109a9a63d377cf86923bc) )
910   ROM_LOAD( "pal16r6a.bin",   0x0400, 0x0104, CRC(59c03681) SHA1(d21090b35596c28d44862782386e84dfc1feff0c) )
911ROM_END
912
913ROM_START( alphamis )
914   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
915   ROM_LOAD( "p1.rom",  0x0000, 0x4000, CRC(69af874b) SHA1(11a13574614e7e3b9e33c2b2827571946a805376) )
916   ROM_LOAD( "p2.rom",  0x4000, 0x4000, CRC(7707bfe3) SHA1(fb1f4ef862f6762d2479e537fc67a819d11ace76) )
917   ROM_LOAD( "p3.rom",  0x8000, 0x4000, CRC(b970d642) SHA1(d3a8045f05f001e5e2fae8ef7900cf87ab17fc74) )
918
919   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
920   ROM_LOAD( "p4.rom",  0x0000, 0x4000, CRC(91a89d3c) SHA1(46ef8718c81aac2f09dd1884538750edf9662760) )
921   ROM_LOAD( "p5.rom",  0x4000, 0x4000, CRC(9879e506) SHA1(0bce5fcb9d05ce77cd8e9ad1cac04ef617928db0) )
922   ROM_LOAD( "p6.bin",  0x8000, 0x4000, CRC(c0bfdf1f) SHA1(65b15ce9c2e78df79cb603c58639421d29701633) )
923
924   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
925   ROM_LOAD( "p7.rom",  0x0000, 0x4000, CRC(dbc19736) SHA1(fe365d70ead8243374979d2162c395fed9870405) )  /* YM3526 */
926   ROM_LOAD( "p8.rom",  0x4000, 0x4000, CRC(537726a9) SHA1(ddf66946be71d2e6ab2cc53150e3b36d45dde2eb) )
927   ROM_LOAD( "p9.bin",  0x8000, 0x4000, CRC(aef5a4f4) SHA1(e908e79e27ff892fe75d1ba5cb0bc9dc6b7b4268) )
928
929   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE ) /* characters */
930   ROM_LOAD( "p14.rom", 0x0000, 0x2000, CRC(acbe29b2) SHA1(e304c6d30888fa7549d25e6329ba94d5088bd8b7) )
931
932   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE ) /* background tiles */
933   ROM_LOAD( "p10.bin", 0x0000, 0x8000, CRC(00dff996) SHA1(4f6ce4c0f2da0d2a711bcbf9aa998b4e31d0d9bf) )
934
935   ROM_REGION( 0x18000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
936   ROM_LOAD( "p11.bin", 0x00000, 0x8000, CRC(7feac86c) SHA1(13b81f006ec587583416c1e7432da4c3f0375924) )
937   ROM_LOAD( "p12.bin", 0x08000, 0x8000, CRC(6895990b) SHA1(e84554cae9a768021c3dc7183bc3d28e2dd768ee) )
938   ROM_LOAD( "p13.bin", 0x10000, 0x8000, CRC(87a81ce1) SHA1(28c1069e6c08ecd579f99620c1cb6df01ad1aa74) )
939
940   ROM_REGION( 0x0c00, "proms", 0 )
941   ROM_LOAD( "mb7122h.f12",  0x000, 0x00400, CRC(5b0a0059) SHA1(f61e17c8959f1cd6cc12b38f2fb7c6190ebd0e0c) )
942   ROM_LOAD( "mb7122h.f13",  0x400, 0x00400, CRC(37e28dd8) SHA1(681726e490872a574dd0295823a44d64ef3a7b45) )
943   ROM_LOAD( "mb7122h.f14",  0x800, 0x00400, CRC(c3fd1dd3) SHA1(c48030cc458f0bebea0ffccf3d3c43260da6a7fb) )
944
945   ROM_REGION( 0x0600, "plds", ROMREGION_DISPOSE )
946   ROM_LOAD( "pal16l8a-1.bin", 0x0000, 0x0104, CRC(4e3f9e0d) SHA1(de448d50c0d1cdef159a8c4028846142210eba0b) )
947   ROM_LOAD( "pal16l8a-2.bin", 0x0200, 0x0104, CRC(2a681f9e) SHA1(b26eb631d3e4fa6850a109a9a63d377cf86923bc) )
948   ROM_LOAD( "pal16r6a.bin",   0x0400, 0x0104, CRC(59c03681) SHA1(d21090b35596c28d44862782386e84dfc1feff0c) )
949ROM_END
950
951ROM_START( arian )
952   ROM_REGION( 0x10000, "main", 0 )   /* 64k for cpuA code */
953   ROM_LOAD( "p1.d8",   0x0000, 0x4000, CRC(0ca89307) SHA1(d0ecb97b1e147a4001a4383fd5709394e2358a45) ) /* roms that differ from above sets all had a red stripe on the label */
954   ROM_LOAD( "p2.d7",   0x4000, 0x4000, CRC(724518c3) SHA1(debbfe2a485af5f452d208a04705dbd48d47d90f) ) /* IE: P1 through P4 and P14 */
955   ROM_LOAD( "p3.d6",   0x8000, 0x4000, CRC(4d8db650) SHA1(184141847d38077737ee7140861d94832018e2e2) )
956
957   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for cpuB code */
958   ROM_LOAD( "p4.d3",   0x0000, 0x4000, CRC(47baf1db) SHA1(3947a679745811e5499d690f2b73b4f28b1d47f9) )
959   ROM_LOAD( "p5.rom",  0x4000, 0x4000, CRC(9879e506) SHA1(0bce5fcb9d05ce77cd8e9ad1cac04ef617928db0) )
960   ROM_LOAD( "p6.bin",  0x8000, 0x4000, CRC(c0bfdf1f) SHA1(65b15ce9c2e78df79cb603c58639421d29701633) )
961
962   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for sound code */
963   ROM_LOAD( "p7.rom",  0x0000, 0x4000, CRC(dbc19736) SHA1(fe365d70ead8243374979d2162c395fed9870405) )  /* YM3526 */
964   ROM_LOAD( "p8.rom",  0x4000, 0x4000, CRC(537726a9) SHA1(ddf66946be71d2e6ab2cc53150e3b36d45dde2eb) )
965   ROM_LOAD( "p9.bin",  0x8000, 0x4000, CRC(aef5a4f4) SHA1(e908e79e27ff892fe75d1ba5cb0bc9dc6b7b4268) )
966
967   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE ) /* characters */
968   ROM_LOAD( "p14.h1",  0x0000, 0x2000, CRC(e599bd30) SHA1(bf70aae9a15d548bb532ca1fc8d7220dfa150d6e) )
969
970   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE ) /* background tiles */
971   ROM_LOAD( "p10.bin", 0x0000, 0x8000, CRC(00dff996) SHA1(4f6ce4c0f2da0d2a711bcbf9aa998b4e31d0d9bf) )
972
973   ROM_REGION( 0x18000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
974   ROM_LOAD( "p11.bin", 0x00000, 0x8000, CRC(7feac86c) SHA1(13b81f006ec587583416c1e7432da4c3f0375924) )
975   ROM_LOAD( "p12.bin", 0x08000, 0x8000, CRC(6895990b) SHA1(e84554cae9a768021c3dc7183bc3d28e2dd768ee) )
976   ROM_LOAD( "p13.bin", 0x10000, 0x8000, CRC(87a81ce1) SHA1(28c1069e6c08ecd579f99620c1cb6df01ad1aa74) )
977
978   ROM_REGION( 0x0c00, "proms", 0 )
979   ROM_LOAD( "mb7122h.f12",  0x000, 0x00400, CRC(5b0a0059) SHA1(f61e17c8959f1cd6cc12b38f2fb7c6190ebd0e0c) )
980   ROM_LOAD( "mb7122h.f13",  0x400, 0x00400, CRC(37e28dd8) SHA1(681726e490872a574dd0295823a44d64ef3a7b45) )
981   ROM_LOAD( "mb7122h.f14",  0x800, 0x00400, CRC(c3fd1dd3) SHA1(c48030cc458f0bebea0ffccf3d3c43260da6a7fb) )
982
983   ROM_REGION( 0x0600, "plds", ROMREGION_DISPOSE )
984   ROM_LOAD( "pal16l8a-1.bin", 0x0000, 0x0104, CRC(4e3f9e0d) SHA1(de448d50c0d1cdef159a8c4028846142210eba0b) )
985   ROM_LOAD( "pal16l8a-2.bin", 0x0200, 0x0104, CRC(2a681f9e) SHA1(b26eb631d3e4fa6850a109a9a63d377cf86923bc) )
986   ROM_LOAD( "pal16r6a.bin",   0x0400, 0x0104, CRC(59c03681) SHA1(d21090b35596c28d44862782386e84dfc1feff0c) )
987ROM_END
988
989GAME( 1985, aso,      0,     aso,   aso,   aso,   ROT270, "SNK", "ASO - Armored Scrum Object", GAME_NO_COCKTAIL )
990GAME( 1985, alphamis, aso,   aso,   aso,   aso,   ROT270, "SNK", "Alpha Mission", GAME_NO_COCKTAIL )
991GAME( 1985, arian,    aso,   aso,   aso,   aso,   ROT270, "SNK", "Arian Mission", GAME_NO_COCKTAIL )
992641GAME( 1985, hal21,    0,     hal21, hal21, hal21, ROT270, "SNK", "HAL21", GAME_IMPERFECT_COLORS | GAME_NO_COCKTAIL )
993642GAME( 1985, hal21j,   hal21, hal21, hal21, hal21, ROT270, "SNK", "HAL21 (Japan)", GAME_IMPERFECT_COLORS | GAME_NO_COCKTAIL )
src/mame/drivers/vendetta.c
r3115r3116
144144
145145static READ8_HANDLER( vendetta_eeprom_r )
146146{
147   int res;
147   int res = 0;
148148
149   res = eeprom_read_bit();
150
151149   res |= 0x02;   //konami_eeprom_ack() << 5;     /* add the ack */
152150
153   res |= input_port_read(machine, "EEPROM") & 0x0c;   /* test switch */
151   res |= input_port_read(machine, "EEPROM") & 0x0d;   /* test switch */
154152
155153   if (init_eeprom_count)
156154   {
r3115r3116
394392   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
395393
396394   PORT_START("EEPROM")
397   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* EEPROM data */
395   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
398396   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* EEPROM ready */
399397   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
400398   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* not really vblank, object related. Its timed, otherwise sprites flicker */
r3115r3116
473471   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
474472
475473   PORT_START("EEPROM")
476   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* EEPROM data */
474   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
477475   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* EEPROM ready */
478476   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
479477   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) /* not really vblank, object related. Its timed, otherwise sprites flicker */
src/mame/drivers/segas16b.c
r3115r3116
34063406
34073407/**************************************************************************************************************************
34083408    Alien Syndrome, Sega System 16B
3409    CPU: ????
3409    CPU: FD1089A (317-0033)
34103410    ROM Board: 171-5358?
34113411*/
34123412ROM_START( aliensy3 )
r3115r3116
34383438   ROM_LOAD( "epr10724.a8",  0x10000, 0x8000, CRC(f971a817) SHA1(502c95638e4fd5f87e5fc837cb44b39a5d62f4e4) )
34393439   ROM_LOAD( "epr10725.a9",  0x20000, 0x8000, CRC(6a50e08f) SHA1(d34b2ccadb8b07d5ad99cab5c5b5b79642c65574) )
34403440   ROM_LOAD( "epr10726.a10", 0x30000, 0x8000, CRC(d50b7736) SHA1(b1f8e3b0cf2ffee5382098100cfabe21b383cd51) )
3441
3442   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
3443   ROM_LOAD( "317-0033.key", 0x0000, 0x2000, CRC(49e882e5) SHA1(29d87af8fc775b22a9a546c112f8f5e7f700ac1a) )
34413444ROM_END
34423445
34433446
r3115r3116
38643867   ROM_LOAD( "epr13448.a10", 0x00000, 0x08000, CRC(b5183fb9) SHA1(c8372b57fa486256d49dc5851d6b17c92de593fb) )
38653868   ROM_LOAD( "mpr13449.a11", 0x10000, 0x20000, CRC(d3d9aaf9) SHA1(0fb3a8cb11033accceb3a43a691fb424cf8b9619) )
38663869   ROM_RELOAD(               0x30000, 0x20000 )
3870
3871   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
3872   ROM_LOAD( "317-0168.key", 0x0000, 0x2000, CRC(bc2d1792) SHA1(e66d2582eb74ae35f27715fcc9df3e77aba67509) )
38673873ROM_END
38683874
38693875/**************************************************************************************************************************
r3115r3116
39293935   ROM_LOAD( "epr13448.a10", 0x00000, 0x08000, CRC(b5183fb9) SHA1(c8372b57fa486256d49dc5851d6b17c92de593fb) )
39303936   ROM_LOAD( "mpr13449.a11", 0x10000, 0x20000, CRC(d3d9aaf9) SHA1(0fb3a8cb11033accceb3a43a691fb424cf8b9619) )
39313937   ROM_RELOAD(               0x30000, 0x20000 )
3938
3939   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
3940   ROM_LOAD( "317-0167.key", 0x0000, 0x2000, CRC(bc2d1792) SHA1(e66d2582eb74ae35f27715fcc9df3e77aba67509) )
39323941ROM_END
39333942
39343943
r3115r3116
42784287   ROM_LOAD( "epr10474.a8",   0x10000, 0x08000, CRC(419a656e) SHA1(aa734ae835761badeb069f99acc5fded2a19b3a3) )
42794288   ROM_LOAD( "epr10475.a9",   0x20000, 0x08000, CRC(17d55e85) SHA1(0c414bafecbfaa82679cc155f15f5255c186358d) )
42804289   ROM_LOAD( "epr10476.a10",  0x30000, 0x08000, CRC(a6be0956) SHA1(fc4d6e25e0b46679f94fddbb1850fb0b02f8d84b) )
4290
4291   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
4292   ROM_LOAD( "317-0022.key", 0x0000, 0x2000, CRC(4eedc66d) SHA1(50588fa13bf25a2d1322579cdc9937450543c978) )
42814293ROM_END
42824294
42834295
r3115r3116
52295241
52305242   ROM_REGION( 0x10000, "sound", 0 ) /* sound CPU */
52315243   ROM_LOAD( "10775.a7", 0x0000, 0x8000, CRC(4cbd55a8) SHA1(8af2c52ab61338c8a9f1a74a05470dd3d5e0c42f) )
5244
5245   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
5246   ROM_LOAD( "317-0028.key", 0x0000, 0x2000, BAD_DUMP CRC(9a5307b2) SHA1(2fcc576ed95b96ff6ea71252c3fab33b8b3fc1f5) )
52325247ROM_END
52335248
52345249/**************************************************************************************************************************
r3115r3116
52645279
52655280   ROM_REGION( 0x10000, "sound", 0 ) /* sound CPU */
52665281   ROM_LOAD( "10775.a7", 0x0000, 0x8000, CRC(4cbd55a8) SHA1(8af2c52ab61338c8a9f1a74a05470dd3d5e0c42f) )
5282
5283   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
5284   ROM_LOAD( "317-0028.key", 0x0000, 0x2000, BAD_DUMP CRC(9a5307b2) SHA1(2fcc576ed95b96ff6ea71252c3fab33b8b3fc1f5) )
52675285ROM_END
52685286
52695287/**************************************************************************************************************************
r3115r3116
55335551   ROM_LOAD( "epr12246.a9", 0x20000, 0x8000, CRC(f1242582) SHA1(f5734b31b449f3f09a0cacc712059644eedee006) )
55345552   ROM_LOAD( "epr12247.a10",0x30000, 0x8000, CRC(ef8a64c6) SHA1(525e0d968c72c6dd73df69b55b8626495d154649) )
55355553   ROM_LOAD( "epr12248.a11",0x40000, 0x8000, CRC(d1eabdab) SHA1(f255a66e082353768e8d2bb574e883a4a45f7670) )
5554
5555   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
5556   ROM_LOAD( "317-5021.key", 0x0000, 0x2000, BAD_DUMP CRC(4a3422e4) SHA1(69a32a6987ff2481f6d6cbbe399269a2461b8bad) )
55365557ROM_END
55375558
55385559
r3115r3116
61316152static DRIVER_INIT( aliensy3_5358 )
61326153{
61336154   DRIVER_INIT_CALL(generic_5358);
6134   fd1089_decrypt_0033(machine);
6155   fd1089a_decrypt(machine);
61356156}
61366157
61376158
r3115r3116
61666187static DRIVER_INIT( aurail1_5704 )
61676188{
61686189   DRIVER_INIT_CALL(generic_5704);
6169   fd1089_decrypt_0168(machine);
6190   fd1089b_decrypt(machine);
61706191}
61716192
61726193
61736194static DRIVER_INIT( aurailj_5704 )
61746195{
61756196   DRIVER_INIT_CALL(generic_5704);
6176   fd1089_decrypt_0167(machine);
6197   fd1089a_decrypt(machine);
61776198}
61786199
61796200
r3115r3116
61876208static DRIVER_INIT( dunkshot_5358 )
61886209{
61896210   DRIVER_INIT_CALL(generic_5358);
6190   fd1089_decrypt_0022(machine);
6211   fd1089a_decrypt(machine);
61916212   custom_io_r = dunkshot_custom_io_r;
61926213}
61936214
r3115r3116
62326253static DRIVER_INIT( defense_5358 )
62336254{
62346255   DRIVER_INIT_CALL(generic_5358);
6235   fd1089_decrypt_0028(machine);
6256   fd1089a_decrypt(machine);
62366257   custom_io_r = sdi_custom_io_r;
62376258}
62386259
r3115r3116
62546275static DRIVER_INIT( sjryuko_5358 )
62556276{
62566277   DRIVER_INIT_CALL(generic_5358);
6257   fd1089_decrypt_5021(machine);
6278   fd1089b_decrypt(machine);
62586279   custom_io_r = sjryuko_custom_io_r;
62596280   custom_io_w = sjryuko_custom_io_w;
62606281}
src/mame/drivers/thoop2.c
r3115r3116
5959   AM_RANGE(0x100000, 0x101fff) AM_READ(SMH_RAM)         /* Video RAM */
6060   AM_RANGE(0x200000, 0x2007ff) AM_READ(SMH_RAM)         /* Palette */
6161   AM_RANGE(0x440000, 0x440fff) AM_READ(SMH_RAM)         /* Sprite RAM */
62   AM_RANGE(0x700000, 0x700001) AM_READ(input_port_0_word_r)/* DIPSW #2 */
63   AM_RANGE(0x700002, 0x700003) AM_READ(input_port_1_word_r)/* DIPSW #1 */
64   AM_RANGE(0x700004, 0x700005) AM_READ(input_port_2_word_r)/* INPUT #1 */
65   AM_RANGE(0x700006, 0x700007) AM_READ(input_port_3_word_r)/* INPUT #2 */
66   AM_RANGE(0x700008, 0x700009) AM_READ(input_port_4_word_r)/* INPUT #3 */
62   AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW2")
63   AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSW1")
64   AM_RANGE(0x700004, 0x700005) AM_READ_PORT("P1")
65   AM_RANGE(0x700006, 0x700007) AM_READ_PORT("P2")
66   AM_RANGE(0x700008, 0x700009) AM_READ_PORT("SYSTEM")
6767   AM_RANGE(0x70000e, 0x70000f) AM_READ(okim6295_status_0_lsb_r)/* OKI6295 status register */
6868   AM_RANGE(0xfe0000, 0xfeffff) AM_READ(SMH_RAM)         /* Work RAM (partially shared with DS5002FP) */
6969ADDRESS_MAP_END
r3115r3116
111111
112112
113113static INPUT_PORTS_START( thoop2 )
114
115   PORT_START("DSW2")   /* DSW #2 */
116   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
117   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
118   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
119   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
120   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
121   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
122   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
123   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
124   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) )
125   PORT_DIPSETTING(    0x18, "2" )
126   PORT_DIPSETTING(    0x10, "3" )
127   PORT_DIPSETTING(    0x08, "4" )
128   PORT_DIPSETTING(    0x00, "1" )
129   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
130   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
131   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
132   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
133   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
134   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
135   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
136
137
138   PORT_START("DSW1")   /* DSW #1 */
114   PORT_START("DSW1")
139115   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_B ) )
140116   PORT_DIPSETTING(    0x02, DEF_STR( 6C_1C ) )
141117   PORT_DIPSETTING(    0x03, DEF_STR( 5C_1C ) )
r3115r3116
161137   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
162138   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
163139
164   PORT_START("P1")   /* 1P INPUTS & COINSW */
140   PORT_START("DSW2")
141   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
142   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
143   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
144   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
145   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
146   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
147   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
148   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
149   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) )
150   PORT_DIPSETTING(    0x18, "2" )
151   PORT_DIPSETTING(    0x10, "3" )
152   PORT_DIPSETTING(    0x08, "4" )
153   PORT_DIPSETTING(    0x00, "1" )
154   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
155   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
156   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
157   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
158   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
159   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
160   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
161
162   PORT_START("P1")
165163   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
166164   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
167165   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
171169   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
172170   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
173171
174   PORT_START("P2")   /* 2P INPUTS & STARTSW */
172   PORT_START("P2")
175173   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
176174   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
177175   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
181179   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
182180   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
183181
184   PORT_START("SYSTEM")   /* INPUTS, TEST & SERVICE */
182   PORT_START("SYSTEM")
185183   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
186184   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 )   /* test button */
187185   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
src/mame/drivers/pktgaldx.c
r3115r3116
163163
164164   /* should we really be using these to read the i/o in the BOOTLEG?
165165      these look like i/o through protection ... */
166   AM_RANGE(0x167842, 0x167843) AM_READ(input_port_2_word_r) // player controls
167   AM_RANGE(0x167c4c, 0x167c4d) AM_READ(input_port_1_word_r)
168   AM_RANGE(0x167db2, 0x167db3) AM_READ(input_port_0_word_r)
166   AM_RANGE(0x167842, 0x167843) AM_READ_PORT("INPUTS")
167   AM_RANGE(0x167c4c, 0x167c4d) AM_READ_PORT("DSW")
168   AM_RANGE(0x167db2, 0x167db3) AM_READ_PORT("SYSTEM")
169169
170170   AM_RANGE(0x167d10, 0x167d11) AM_READ(pckgaldx_protection_r) // check code at 6ea
171171   AM_RANGE(0x167d1a, 0x167d1b) AM_READ(pckgaldx_protection_r) // check code at 7C4
r3115r3116
205205/**********************************************************************************/
206206
207207static INPUT_PORTS_START( pktgaldx )
208   PORT_START("IN0")   /* 16bit */
208   PORT_START("SYSTEM")
209209   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
210210   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
211211   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
216216   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
217217   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
218218
219   PORT_START("DSW")   /* 16bit */
219   PORT_START("INPUTS")
220   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
221   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
222   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
223   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
224   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
225   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
226   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
227   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
228   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
229   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
230   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
231   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
232   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
233   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
234   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
235   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
236
237   PORT_START("DSW")
220238   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
221239   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
222240   PORT_DIPSETTING(      0x0001, DEF_STR( 2C_1C ) )
r3115r3116
263281   PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Demo_Sounds ) )
264282   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
265283   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
266
267   PORT_START("IN1")   /* 16bit */
268   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
269   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
270   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
271   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
272   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
273   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
274   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
275   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
276   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
277   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
278   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
279   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
280   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
281   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
282   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
283   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
284284INPUT_PORTS_END
285285
286286static const gfx_layout tile_8x8_layout =
src/mame/drivers/multigam.c
r3115r3116
112112   return ((in_1 >> in_1_shift++) & 0x01) | 0x40;
113113}
114114
115static READ8_HANDLER( multigam_inputs_r )
115static CUSTOM_INPUT( multigam_inputs_r )
116116{
117117   /* bit 0: serial input (dsw)
118118       bit 1: coin */
119   return ((multigam_in_dsw >> multigam_in_dsw_shift++) & 0x01) |
120         input_port_read(machine, "IN0");
119   return (multigam_in_dsw >> multigam_in_dsw_shift++) & 0x01;
121120}
122121
123122
r3115r3116
183182   AM_RANGE(0x4000, 0x4013) AM_READWRITE(nes_psg_0_r, nes_psg_0_w)         /* PSG primary registers */
184183   AM_RANGE(0x4014, 0x4014) AM_WRITE(sprite_dma_w)
185184   AM_RANGE(0x4015, 0x4015) AM_READWRITE(psg_4015_r, psg_4015_w)         /* PSG status / first control register */
186   AM_RANGE(0x4016, 0x4016) AM_READWRITE(multigam_IN0_r,        multigam_IN0_w)         /* IN0 - input port 1 */
187   AM_RANGE(0x4017, 0x4017) AM_READWRITE(multigam_IN1_r,        psg_4017_w)      /* IN1 - input port 2 / PSG second control register */
185   AM_RANGE(0x4016, 0x4016) AM_READWRITE(multigam_IN0_r, multigam_IN0_w)   /* IN0 - input port 1 */
186   AM_RANGE(0x4017, 0x4017) AM_READWRITE(multigam_IN1_r, psg_4017_w)      /* IN1 - input port 2 / PSG second control register */
188187   AM_RANGE(0x5002, 0x5002) AM_WRITENOP
189188   AM_RANGE(0x5000, 0x5ffe) AM_ROM
190   AM_RANGE(0x5fff, 0x5fff) AM_READ(multigam_inputs_r)
189   AM_RANGE(0x5fff, 0x5fff) AM_READ_PORT("IN0")
191190   AM_RANGE(0x6000, 0x7fff) AM_ROM
192191   AM_RANGE(0x6fff, 0x6fff) AM_WRITE(multigam_switch_prg_rom)
193192   AM_RANGE(0x7fff, 0x7fff) AM_WRITE(multigam_switch_gfx_rom)
r3115r3116
431430   AM_RANGE(0x4000, 0x4013) AM_READWRITE(nes_psg_0_r, nes_psg_0_w)         /* PSG primary registers */
432431   AM_RANGE(0x4014, 0x4014) AM_WRITE(sprite_dma_w)
433432   AM_RANGE(0x4015, 0x4015) AM_READWRITE(psg_4015_r, psg_4015_w)         /* PSG status / first control register */
434   AM_RANGE(0x4016, 0x4016) AM_READWRITE(multigam_IN0_r,        multigam_IN0_w)         /* IN0 - input port 1 */
435   AM_RANGE(0x4017, 0x4017) AM_READWRITE(multigam_IN1_r,        psg_4017_w)      /* IN1 - input port 2 / PSG second control register */
433   AM_RANGE(0x4016, 0x4016) AM_READWRITE(multigam_IN0_r, multigam_IN0_w)   /* IN0 - input port 1 */
434   AM_RANGE(0x4017, 0x4017) AM_READWRITE(multigam_IN1_r, psg_4017_w)      /* IN1 - input port 2 / PSG second control register */
436435   AM_RANGE(0x5001, 0x5001) AM_WRITE(multigm3_switch_prg_rom)
437436   AM_RANGE(0x5002, 0x5002) AM_WRITENOP
438437   AM_RANGE(0x5003, 0x5003) AM_WRITE(multigam_switch_gfx_rom)
439438   AM_RANGE(0x5000, 0x5ffe) AM_ROM
440   AM_RANGE(0x5fff, 0x5fff) AM_READ(multigam_inputs_r)
439   AM_RANGE(0x5fff, 0x5fff) AM_READ_PORT("IN0")
441440   AM_RANGE(0x6000, 0x7fff) AM_RAMBANK(1)
442441   AM_RANGE(0x6fff, 0x6fff) AM_WRITENOP /* 0x00 in attract mode, 0xff during play */
443442   AM_RANGE(0x8000, 0xffff) AM_ROM AM_WRITE(multigm3_mapper2_w)
r3115r3116
450449*******************************************************/
451450
452451static INPUT_PORTS_START( multigam_common )
453   PORT_START("P1")      /* IN0 */
452   PORT_START("P1")
454453   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
455454   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
456455   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1)   /* Select */
r3115r3116
460459   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
461460   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
462461
463   PORT_START("P2")      /* IN1 */
462   PORT_START("P2")
464463   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
465464   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
466465   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)   /* Select */
r3115r3116
470469   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
471470   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
472471
473   PORT_START("IN0")      /* IN2 */
472   PORT_START("IN0")
473   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(multigam_inputs_r, NULL)
474474   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
475475INPUT_PORTS_END
476476
477477static INPUT_PORTS_START( multigam )
478478   PORT_INCLUDE( multigam_common )
479479
480   PORT_START("DSW")      /* IN3 */
480   PORT_START("DSW")
481481   PORT_DIPNAME( 0x06, 0x00, "Coin/Time" )
482   PORT_DIPSETTING( 0x00, "3 min" )
483   PORT_DIPSETTING( 0x04, "5 min" )
484   PORT_DIPSETTING( 0x02, "7 min" )
485   PORT_DIPSETTING( 0x06, "10 min" )
482   PORT_DIPSETTING(    0x00, "3 min" )
483   PORT_DIPSETTING(    0x04, "5 min" )
484   PORT_DIPSETTING(    0x02, "7 min" )
485   PORT_DIPSETTING(    0x06, "10 min" )
486486INPUT_PORTS_END
487487
488488static INPUT_PORTS_START( multigm3 )
489489   PORT_INCLUDE( multigam_common )
490490
491   PORT_START("DSW")      /* IN3 */
491   PORT_START("DSW")
492492   PORT_DIPNAME( 0x06, 0x00, "Coin/Time" )
493   PORT_DIPSETTING( 0x00, "15 min" )
494   PORT_DIPSETTING( 0x04, "8 min" )
495   PORT_DIPSETTING( 0x02, "11 min" )
496   PORT_DIPSETTING( 0x06, "5 min" )
493   PORT_DIPSETTING(    0x00, "15 min" )
494   PORT_DIPSETTING(    0x04, "8 min" )
495   PORT_DIPSETTING(    0x02, "11 min" )
496   PORT_DIPSETTING(    0x06, "5 min" )
497497INPUT_PORTS_END
498498
499499
src/mame/drivers/atarigx2.c
r3115r3116
4949
5050static void update_interrupts(running_machine *machine)
5151{
52   int newstate = 0;
53
54   if (atarigen_video_int_state)
55      newstate = 4;
56   if (atarigen_sound_int_state)
57      newstate = 5;
58
59   if (newstate)
60      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
61   else
62      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
52   cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE);
53   cpunum_set_input_line(machine, 0, 5, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
6354}
6455
6556
src/mame/drivers/vulgus.c
r3115r3116
6969
7070static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
7171   AM_RANGE(0x0000, 0x9fff) AM_ROM
72   AM_RANGE(0xc000, 0xc000) AM_READ(input_port_0_r)
73   AM_RANGE(0xc001, 0xc001) AM_READ(input_port_1_r)
74   AM_RANGE(0xc002, 0xc002) AM_READ(input_port_2_r)
75   AM_RANGE(0xc003, 0xc003) AM_READ(input_port_3_r)
76   AM_RANGE(0xc004, 0xc004) AM_READ(input_port_4_r)
72   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("SYSTEM")
73   AM_RANGE(0xc001, 0xc001) AM_READ_PORT("P1")
74   AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2")
75   AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1")
76   AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2")
7777   AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_w)
7878   AM_RANGE(0xc802, 0xc803) AM_RAM AM_BASE(&vulgus_scroll_low)
7979   AM_RANGE(0xc804, 0xc804) AM_WRITE(vulgus_c804_w)
r3115r3116
9898
9999
100100static INPUT_PORTS_START( vulgus )
101   PORT_START("SYSTEM")      /* IN0 */
101   PORT_START("SYSTEM")
102102   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
103103   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
104104   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
r3115r3116
108108   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
109109   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
110110
111   PORT_START("P1")      /* IN1 */
111   PORT_START("P1")
112112   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
113113   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
114114   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
r3115r3116
118118   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
119119   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
120120
121   PORT_START("P2")      /* IN2 */
121   PORT_START("P2")
122122   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
123123   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
124124   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
r3115r3116
128128   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
129129   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
130130
131   PORT_START("DSW1")      /* DSW0 */
131   PORT_START("DSW1")
132132   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
133133   PORT_DIPSETTING(    0x01, "1" )
134134   PORT_DIPSETTING(    0x02, "2" )
r3115r3116
155155   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )
156156   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
157157
158   PORT_START("DSW2")      /* DSW1 */
158   PORT_START("DSW2")
159159   /* Not sure about difficulty
160160       Code perform a read and (& 0x03). NDMix */
161161   PORT_DIPNAME( 0x03, 0x03, "Difficulty?" )
src/mame/drivers/shangha3.c
r3115r3116
114114static ADDRESS_MAP_START( shangha3_readmem, ADDRESS_SPACE_PROGRAM, 16 )
115115   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
116116   AM_RANGE(0x100000, 0x100fff) AM_READ(SMH_RAM)
117   AM_RANGE(0x200000, 0x200001) AM_READ(input_port_0_word_r)
118   AM_RANGE(0x200002, 0x200003) AM_READ(input_port_1_word_r)
117   AM_RANGE(0x200000, 0x200001) AM_READ_PORT("INPUTS")
118   AM_RANGE(0x200002, 0x200003) AM_READ_PORT("SYSTEM")
119119   AM_RANGE(0x20001e, 0x20001f) AM_READ(ay8910_read_port_0_lsb_r)
120120   AM_RANGE(0x20004e, 0x20004f) AM_READ(shangha3_prot_r)
121121   AM_RANGE(0x20006e, 0x20006f) AM_READ(okim6295_status_0_lsb_r)
r3115r3116
141141static ADDRESS_MAP_START( heberpop_readmem, ADDRESS_SPACE_PROGRAM, 16 )
142142   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
143143   AM_RANGE(0x100000, 0x100fff) AM_READ(SMH_RAM)
144   AM_RANGE(0x200000, 0x200001) AM_READ(input_port_0_word_r)
145   AM_RANGE(0x200002, 0x200003) AM_READ(input_port_1_word_r)
146   AM_RANGE(0x200004, 0x200005) AM_READ(input_port_2_word_r)
144   AM_RANGE(0x200000, 0x200001) AM_READ_PORT("INPUTS")
145   AM_RANGE(0x200002, 0x200003) AM_READ_PORT("SYSTEM")
146   AM_RANGE(0x200004, 0x200005) AM_READ_PORT("DSW")
147147   AM_RANGE(0x300000, 0x30ffff) AM_READ(SMH_RAM)
148148   AM_RANGE(0x800000, 0xb7ffff) AM_READ(heberpop_gfxrom_r)
149149ADDRESS_MAP_END
r3115r3116
162162
163163static ADDRESS_MAP_START( blocken_readmem, ADDRESS_SPACE_PROGRAM, 16 )
164164   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
165   AM_RANGE(0x100000, 0x100001) AM_READ(input_port_0_word_r)
166   AM_RANGE(0x100002, 0x100003) AM_READ(input_port_1_word_r)
167   AM_RANGE(0x100004, 0x100005) AM_READ(input_port_2_word_r)
165   AM_RANGE(0x100000, 0x100001) AM_READ_PORT("INPUTS")
166   AM_RANGE(0x100002, 0x100003) AM_READ_PORT("SYSTEM")
167   AM_RANGE(0x100004, 0x100005) AM_READ_PORT("DSW")
168168   AM_RANGE(0x200000, 0x200fff) AM_READ(SMH_RAM)
169169   AM_RANGE(0x300000, 0x30ffff) AM_READ(SMH_RAM)
170170   AM_RANGE(0x800000, 0xb7ffff) AM_READ(heberpop_gfxrom_r)
r3115r3116
212212
213213
214214static INPUT_PORTS_START( shangha3 )
215   PORT_START("IN0")
215   PORT_START("INPUTS")
216216   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
217217   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
218218   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
230230   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
231231   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
232232
233   PORT_START("IN1")
233   PORT_START("SYSTEM")
234234   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
235235   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
236236   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
291291INPUT_PORTS_END
292292
293293static INPUT_PORTS_START( heberpop )
294   PORT_START("IN0")
294   PORT_START("INPUTS")
295295   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
296296   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
297297   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
309309   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
310310   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_VBLANK )   /* vblank?? has to toggle */
311311
312   PORT_START("IN1")
312   PORT_START("SYSTEM")
313313   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
314314   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
315315   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
370370INPUT_PORTS_END
371371
372372static INPUT_PORTS_START( blocken )
373   PORT_START("IN0")
373   PORT_START("INPUTS")
374374   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
375375   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
376376   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
388388   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
389389   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_VBLANK )   /* vblank?? has to toggle */
390390
391   PORT_START("IN1")
391   PORT_START("SYSTEM")
392392   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
393393   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
394394   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
src/mame/drivers/pkscram.c
r3115r3116
103103   AM_RANGE(0x046000, 0x046fff) AM_RAM_WRITE(pkscramble_bgtilemap_w) AM_BASE(&pkscramble_bgtilemap_ram) // bg tilemap
104104   AM_RANGE(0x047000, 0x047fff) AM_RAM // unused
105105   AM_RANGE(0x048000, 0x048fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
106   AM_RANGE(0x049000, 0x049001) AM_READ(input_port_0_word_r)
107   AM_RANGE(0x049004, 0x049005) AM_READ(input_port_1_word_r)
106   AM_RANGE(0x049000, 0x049001) AM_READ_PORT("DSW")
107   AM_RANGE(0x049004, 0x049005) AM_READ_PORT("INPUTS")
108108   AM_RANGE(0x049008, 0x049009) AM_WRITE(pkscramble_output_w)
109109   AM_RANGE(0x049010, 0x049011) AM_WRITENOP
110110   AM_RANGE(0x049014, 0x049015) AM_WRITENOP
r3115r3116
118118
119119
120120static INPUT_PORTS_START( pkscramble )
121   PORT_START("DSW")   /* Dips */
121   PORT_START("DSW")
122122   PORT_DIPNAME( 0x0007, 0x0003, "Level" )
123123   PORT_DIPSETTING(      0x0000, "0" )
124124   PORT_DIPSETTING(      0x0001, "1" )
r3115r3116
166166   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
167167   PORT_SERVICE( 0x8000, IP_ACTIVE_HIGH )
168168
169   PORT_START("INPUTS")   /* 16bit */
169   PORT_START("INPUTS")
170170   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // Kick
171171   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) // Left
172172   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) // Center
src/mame/drivers/vastar.c
r3115r3116
145145static ADDRESS_MAP_START( cpu2_map, ADDRESS_SPACE_PROGRAM, 8 )
146146   AM_RANGE(0x0000, 0x1fff) AM_ROM
147147   AM_RANGE(0x4000, 0x40ff) AM_READWRITE(vastar_sharedram_r, vastar_sharedram_w)
148   AM_RANGE(0x8000, 0x8000) AM_READ(input_port_1_r)
149   AM_RANGE(0x8040, 0x8040) AM_READ(input_port_0_r)
150   AM_RANGE(0x8080, 0x8080) AM_READ(input_port_2_r)
148   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("P2")
149   AM_RANGE(0x8040, 0x8040) AM_READ_PORT("P1")
150   AM_RANGE(0x8080, 0x8080) AM_READ_PORT("SYSTEM")
151151ADDRESS_MAP_END
152152
153153static ADDRESS_MAP_START( cpu2_port_map, ADDRESS_SPACE_IO, 8 )
r3115r3116
159159
160160
161161static INPUT_PORTS_START( vastar )
162   PORT_START("IN0")
162   PORT_START("P1")
163163   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
164164   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
165165   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
r3115r3116
169169   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
170170   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
171171
172   PORT_START("IN1")
172   PORT_START("P2")
173173   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
174174   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
175175   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
r3115r3116
179179   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
180180   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
181181
182   PORT_START("IN2")
182   PORT_START("SYSTEM")
183183   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
184184   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
185185   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
r3115r3116
189189   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
190190   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
191191
192   PORT_START("DSW0")
192   PORT_START("DSW1")
193193   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
194194   PORT_DIPSETTING(    0x03, "3" )
195195   PORT_DIPSETTING(    0x02, "4" )
r3115r3116
214214   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
215215   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
216216
217   PORT_START("DSW1")
217   PORT_START("DSW2")
218218   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
219219   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
220220   PORT_DIPSETTING(    0x01, DEF_STR( 3C_2C ) )
src/mame/drivers/taotaido.c
r3115r3116
102102   AM_RANGE(0x800000, 0x803fff) AM_RAM_WRITE(taotaido_bgvideoram_w) AM_BASE(&taotaido_bgram)   // bg ram?
103103   AM_RANGE(0xa00000, 0xa01fff) AM_RAM AM_BASE(&taotaido_spriteram)      // sprite ram
104104   AM_RANGE(0xc00000, 0xc0ffff) AM_RAM AM_BASE(&taotaido_spriteram2)      // sprite tile lookup ram
105   AM_RANGE(0xfe0000, 0xfeffff) AM_RAM                  // main ram
105   AM_RANGE(0xfe0000, 0xfeffff) AM_RAM                              // main ram
106106   AM_RANGE(0xffc000, 0xffcfff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)   // palette ram
107107   AM_RANGE(0xffe000, 0xffe3ff) AM_RAM AM_BASE(&taotaido_scrollram)      // rowscroll / rowselect / scroll ram
108   AM_RANGE(0xffff80, 0xffff81) AM_READ(input_port_0_word_r)   // player 1 inputs
109   AM_RANGE(0xffff82, 0xffff83) AM_READ(input_port_1_word_r)   // player 2 inputs
110   AM_RANGE(0xffff84, 0xffff85) AM_READ(input_port_2_word_r)   // system inputs
111   AM_RANGE(0xffff86, 0xffff87) AM_READ(input_port_3_word_r)   // DSWA
112   AM_RANGE(0xffff88, 0xffff89) AM_READ(input_port_4_word_r)   // DSWB
113   AM_RANGE(0xffff8a, 0xffff8b) AM_READ(input_port_5_word_r)   // DSWC
114   AM_RANGE(0xffff8c, 0xffff8d) AM_READ(SMH_RAM)         // unknown
115   AM_RANGE(0xffff8e, 0xffff8f) AM_READ(input_port_6_word_r)   // jumpers
108   AM_RANGE(0xffff80, 0xffff81) AM_READ_PORT("P1")
109   AM_RANGE(0xffff82, 0xffff83) AM_READ_PORT("P2")
110   AM_RANGE(0xffff84, 0xffff85) AM_READ_PORT("SYSTEM")
111   AM_RANGE(0xffff86, 0xffff87) AM_READ_PORT("DSW1")
112   AM_RANGE(0xffff88, 0xffff89) AM_READ_PORT("DSW2")
113   AM_RANGE(0xffff8a, 0xffff8b) AM_READ_PORT("DSW3")
114   AM_RANGE(0xffff8c, 0xffff8d) AM_READ(SMH_RAM)                  // unknown
115   AM_RANGE(0xffff8e, 0xffff8f) AM_READ_PORT("JP")
116116#if TAOTAIDO_SHOW_ALL_INPUTS
117   AM_RANGE(0xffffa0, 0xffffa1) AM_READ(input_port_7_word_r)   // player 3 inputs (unused)
118   AM_RANGE(0xffffa2, 0xffffa3) AM_READ(input_port_8_word_r)   // player 4 inputs (unused)
117   AM_RANGE(0xffffa0, 0xffffa1) AM_READ_PORT("P3")                  // unused
118   AM_RANGE(0xffffa2, 0xffffa3) AM_READ_PORT("P4")                  // unused
119119#endif
120120   AM_RANGE(0xffff00, 0xffff0f) AM_WRITE(taotaido_tileregs_w)
121121   AM_RANGE(0xffff10, 0xffff11) AM_WRITE(SMH_NOP)                  // unknown
122122   AM_RANGE(0xffff20, 0xffff21) AM_WRITE(SMH_NOP)                  // unknown - flip screen related
123123   AM_RANGE(0xffff40, 0xffff47) AM_WRITE(taotaido_sprite_character_bank_select_w)
124   AM_RANGE(0xffffc0, 0xffffc1) AM_WRITE(sound_command_w)               // seems right
124   AM_RANGE(0xffffc0, 0xffffc1) AM_WRITE(sound_command_w)            // seems right
125125   AM_RANGE(0xffffe0, 0xffffe1) AM_READ(pending_command_r)   // guess - seems to be needed for all the sounds to work
126126ADDRESS_MAP_END
127127
r3115r3116
159159
160160
161161static INPUT_PORTS_START( taotaido )
162   PORT_START("IN0")   /* Player 1 controls (0xffff81.b) */
162   PORT_START("P1")   /* 0xffff81.b */
163163   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
164164   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
165165   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
173173#endif
174174   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
175175
176   PORT_START("IN1")   /* Player 2 controls (0xffff83.b) */
176   PORT_START("P2")   /* 0xffff83.b */
177177   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
178178   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
179179   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
187187#endif
188188   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
189189
190   PORT_START("IN2")   /* System inputs (0xffff85.b) */
190   PORT_START("SYSTEM")   /* 0xffff85.b */
191191   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
192192   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )   // see notes
193193   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
r3115r3116
201201   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )   // see notes - SERVICE in "test mode"
202202   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   // VBLANK ? The game freezes when ON
203203
204   PORT_START("DSW0")   /* DSW A (0xffff87.b -> !0xfe2f6c.w or !0xfe30d0) */
204   PORT_START("DSW1")   /* 0xffff87.b -> !0xfe2f6c.w or !0xfe30d0 */
205205   PORT_DIPNAME( 0x01, 0x01, "Coin Slot" )
206206   PORT_DIPSETTING(    0x01, "Same" )
207207   PORT_DIPSETTING(    0x00, "Individual" )
r3115r3116
221221   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
222222   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
223223
224   PORT_START("DSW1")   /* DSW B (0xffff89.b -> !0xfe73c2.w or !0xfe751c.w) */
224   PORT_START("DSW2")   /* 0xffff89.b -> !0xfe73c2.w or !0xfe751c.w */
225225   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )   // check code at 0x0963e2 or 0x845e2
226226   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
227227   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
238238   PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )
239239   PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
240240
241   PORT_START("DSW2")   /* DSW C (0xffff8b.b -> !0xfe2f94.w or !0xfe30f8.w) */
241   PORT_START("DSW3")   /* 0xffff8b.b -> !0xfe2f94.w or !0xfe30f8.w */
242242   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )   // doesn't seem to be demo sounds
243243   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
244244   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r3115r3116
252252   PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )
253253   PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
254254
255   PORT_START("JP0")   /* Jumpers (0xffff8f.b) */
255   PORT_START("JP")   /* Jumpers (0xffff8f.b) */
256256   PORT_DIPNAME( 0x0f, 0x08, "Country" )
257257   PORT_DIPSETTING(    0x00, "US" )            // also (c) Mc O'River Inc
258258   PORT_DIPSETTING(    0x01, DEF_STR( Japan ) )
r3115r3116
267267
268268#if TAOTAIDO_SHOW_ALL_INPUTS
269269   /* These inputs are only to fit the test mode - leftover from another game ? */
270   PORT_START("IN3")   /* Player 3 inputs (0xffffa1.b) */
270   PORT_START("P3")   /* 0xffffa1.b */
271271   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
272272   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
273273   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
r3115r3116
277277   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
278278   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
279279
280   PORT_START("IN4")   /* Player 4 inputs (0xffffa3.b) */
280   PORT_START("P4")   /* 0xffffa3.b */
281281   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
282282   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
283283   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
r3115r3116
292292static INPUT_PORTS_START( taotaida )
293293   PORT_INCLUDE(taotaido)
294294
295   PORT_MODIFY("IN0")
295   PORT_MODIFY("P1")
296296   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
297297
298   PORT_MODIFY("IN1")
298   PORT_MODIFY("P2")
299299   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
300300INPUT_PORTS_END
301301
src/mame/drivers/relief.c
r3115r3116
4444
4545static void update_interrupts(running_machine *machine)
4646{
47   int newstate = 0;
48
49   if (atarigen_scanline_int_state)
50      newstate = 4;
51
52   if (newstate)
53      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
54   else
55      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
47   cpunum_set_input_line(machine, 0, 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
5648}
5749
5850
src/mame/drivers/champbas.c
r3115r3116
10001000   ROM_LOAD( "7_c6.bin",     0x6000, 0x2000, CRC(6d51521e) SHA1(2809bd2e61f40dcd31d43c62520982bdcfb0a865) )   /* vr.7h */
10011001   ROM_LOAD( "1_a6.bin",     0x8000, 0x1000, CRC(20f2207e) SHA1(b1ed2237d0bd50ddbe593fd2fbff9f1d67c1eb11) )   /* vr.7k */
10021002
1003   ROM_REGION( 0x2000, "MCU", 0 )
1004   ROM_LOAD( "8303.bin", 0x0000, 0x2000, CRC(66adcb37) SHA1(e1c72ecb161129dcbddc0b16dd90e716d0c79311) )
1005
10031006   ROM_REGION( 0x04000, "gfx1", ROMREGION_DISPOSE )   // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only chars
10041007   ROM_LOAD( "vr.5a",        0x0000, 0x2000, CRC(4ff1783d) SHA1(c45074864c3a4bcbf3a87d164027ae16dca53d9c) ) /* planes 0,1 */
10051008   ROM_LOAD( "vr.5c",        0x2000, 0x2000, CRC(1fb84ee6) SHA1(56ceb86c509be783f806403ac21e7c9684760d5f) ) /* plane 3 */
r3115r3116
10771080GAME( 1983, exctsccr, 0,        exctsccr, exctsccr, exctsccr, ROT270, "Alpha Denshi Co.", "Exciting Soccer", 0 )
10781081GAME( 1983, exctscca, exctsccr, exctsccr, exctsccr, exctsccr, ROT270, "Alpha Denshi Co.", "Exciting Soccer (alternate music)", 0 )
10791082GAME( 1983, exctsccb, exctsccr, exctsccb, exctsccr, exctsccr, ROT270, "bootleg",          "Exciting Soccer (bootleg)", 0 )
1080GAME( 1984, exctscc2, 0,        exctsccr, exctsccr, exctsccr, ROT270, "Alpha Denshi Co.", "Exciting Soccer II", GAME_IMPERFECT_GRAPHICS )
1083GAME( 1984, exctscc2, 0,        exctsccr, exctsccr, exctsccr, ROT270, "Alpha Denshi Co.", "Exciting Soccer II", 0 )
src/mame/drivers/mcr.c
r3115r3116
992992   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
993993
994994   PORT_START("SSIO.IP1")   /* J4 10-13,15-18 */
995   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
996   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
997   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
998   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
995   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
996   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
997   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
998   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
999999   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
10001000
10011001   PORT_START("SSIO.IP2")   /* J5 1-8 */
1002   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1003   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1004   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1005   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1002   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1003   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1004   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1005   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
10061006   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
10071007   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
10081008
r3115r3116
10421042   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
10431043
10441044   PORT_START("SSIO.IP1")   /* J4 10-13,15-18 */
1045   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1046   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1047   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1048   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1045   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
1046   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1047   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
1048   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
10491049   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
10501050
10511051   PORT_START("SSIO.IP2")   /* J5 1-8 */
1052   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1053   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1054   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1055   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1052   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1053   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1054   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1055   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
10561056   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
10571057   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
10581058
src/mame/drivers/megasys1.c
r3115r3116
157157                        [ Main CPU - System A / Z ]
158158***************************************************************************/
159159
160static READ16_HANDLER( dsw1_r )      {return input_port_read(machine, "DSW1");}      //   DSW 1
161static READ16_HANDLER( dsw2_r )      {return input_port_read(machine, "DSW2");}      //   DSW 2
162static READ16_HANDLER( dsw_r )      {return input_port_read(machine, "DSW1") * 256 +
163                                   input_port_read(machine, "DSW2");}      // < DSW 1 | DSW 2 >
164
165
166160#define INTERRUPT_NUM_A      3
167161static INTERRUPT_GEN( interrupt_A )
168162{
r3115r3116
181175   AM_RANGE(0x080000, 0x080001) AM_READ_PORT("SYSTEM")
182176   AM_RANGE(0x080002, 0x080003) AM_READ_PORT("P1")
183177   AM_RANGE(0x080004, 0x080005) AM_READ_PORT("P2")
184   AM_RANGE(0x080006, 0x080007) AM_READ(dsw_r)
178   AM_RANGE(0x080006, 0x080007) AM_READ_PORT("DSW")
185179   AM_RANGE(0x080008, 0x080009) AM_READ(soundlatch2_word_r)   /* from sound cpu */
186180   AM_RANGE(0x084000, 0x084fff) AM_READ(SMH_RAM)
187181   AM_RANGE(0x088000, 0x0887ff) AM_READ(SMH_RAM)
r3115r3116
253247   switch (i)
254248   {
255249         case 0 :   return input_port_read(machine, "SYSTEM");   break;
256         case 1 :   return input_port_read(machine, "P1");   break;
257         case 2 :   return input_port_read(machine, "P2");   break;
258         case 3 :   return dsw1_r(machine,0,0xffff);   break;
259         case 4 :   return dsw2_r(machine,0,0xffff);   break;
250         case 1 :   return input_port_read(machine, "P1");      break;
251         case 2 :   return input_port_read(machine, "P2");      break;
252         case 3 :   return input_port_read(machine, "DSW1");   break;
253         case 4 :   return input_port_read(machine, "DSW2");   break;
260254         default    :   return 0x0006;
261255   }
262256}
r3115r3116
351345   AM_RANGE(0x0d0000, 0x0d3fff) AM_READ(SMH_RAM)
352346   AM_RANGE(0x0d4000, 0x0d7fff) AM_READ(SMH_RAM)
353347   AM_RANGE(0x0d8000, 0x0d87ff) AM_MIRROR(0x3000) AM_READ(SMH_RAM)
354   AM_RANGE(0x0e0000, 0x0e0001) AM_READ(dsw_r)
348   AM_RANGE(0x0e0000, 0x0e0001) AM_READ_PORT("DSW")
355349   AM_RANGE(0x0e8000, 0x0ebfff) AM_READ(SMH_RAM)
356350   AM_RANGE(0x0f0000, 0x0f0001) AM_READ_PORT("SYSTEM")
357351   AM_RANGE(0x0f8000, 0x0f8001) AM_READ(okim6295_status_0_lsb_r)
r3115r3116
951945   COINAGE_8BITS
952946
953947   PORT_START("DSW2")
954   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
955   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
956   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
957   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
958   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
959   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
960   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Allow_Continue ) )
961   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
962   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
963   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) )
964   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
965   PORT_DIPSETTING(    0x18, DEF_STR( Normal ) )
966   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
967   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
968   PORT_DIPNAME( 0x60, 0x20, DEF_STR( Lives ) )
969   PORT_DIPSETTING(    0x40, "1" )
970   PORT_DIPSETTING(    0x60, "2" )
971   PORT_DIPSETTING(    0x20, "3" )
972   PORT_DIPSETTING(    0x00, "5" )
973   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
948   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
949   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
950   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
951   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
952   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
953   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
954   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Allow_Continue ) )
955   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
956   PORT_DIPSETTING(      0x0004, DEF_STR( On ) )
957   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) )
958   PORT_DIPSETTING(      0x0010, DEF_STR( Easy ) )
959   PORT_DIPSETTING(      0x0018, DEF_STR( Normal ) )
960   PORT_DIPSETTING(      0x0008, DEF_STR( Hard ) )
961   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
962   PORT_DIPNAME( 0x0060, 0x0020, DEF_STR( Lives ) )
963   PORT_DIPSETTING(      0x0040, "1" )
964   PORT_DIPSETTING(      0x0060, "2" )
965   PORT_DIPSETTING(      0x0020, "3" )
966   PORT_DIPSETTING(      0x0000, "5" )
967   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
974968INPUT_PORTS_END
975969
976970
r3115r3116
10831077   JOY_3BUTTONS(2)
10841078   RESERVE
10851079
1086   PORT_START("DSW1") /* 0x80006.b */
1087   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
1088   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
1089   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
1090   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
1091   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
1092//  PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )    // 1_2 shown in test mode
1093//  PORT_DIPSETTING(    0x05, DEF_STR( 1C_1C ) )    // 1_3
1094//  PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )    // 1_4
1095//  PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )    // 1_5
1096   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )
1097   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
1098   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1099   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
1100   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
1101//  PORT_DIPSETTING(    0x18, DEF_STR( 1C_1C ) )    // 1_2 shown in test mode
1102//  PORT_DIPSETTING(    0x28, DEF_STR( 1C_1C ) )    // 1_3
1103//  PORT_DIPSETTING(    0x08, DEF_STR( 1C_1C ) )    // 1_4
1104//  PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )    // 1_5
1105   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
1106   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1107   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1108   PORT_DIPNAME( 0x80, 0x80, "Test Mode" )
1109   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1110   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1080   PORT_START("DSW")
1081   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) // according to manual
1082   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1083   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1084   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) // according to manual
1085   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1086   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1087   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Bonus_Life ) )
1088   PORT_DIPSETTING(      0x0004, "30k 70k 110k then every 30k" )
1089   PORT_DIPSETTING(      0x0000, "50k 100k then every 40k" )
1090   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Lives ) )
1091   PORT_DIPSETTING(      0x0008, "2" )
1092   PORT_DIPSETTING(      0x0018, "3" )
1093   PORT_DIPSETTING(      0x0010, "4" )
1094   PORT_DIPSETTING(      0x0000, "5" )
1095   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Difficulty ) )
1096   PORT_DIPSETTING(      0x0020, DEF_STR( Normal ) )
1097   PORT_DIPSETTING(      0x0000, DEF_STR( Hard ) )
1098   PORT_DIPNAME( 0x0040, 0x0040, "Swap 1P/2P Controls" )
1099   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1100   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1101   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
1102   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1103   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
11111104
1112   PORT_START("DSW2")         /* 0x80007.b */
1113   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) // according to manual
1114   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1115   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1116   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) // according to manual
1117   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1118   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1119   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Bonus_Life ) )
1120   PORT_DIPSETTING(    0x04, "30k 70k 110k then every 30k" )
1121   PORT_DIPSETTING(    0x00, "50k 100k then every 40k" )
1122   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) )
1123   PORT_DIPSETTING(    0x08, "2" )
1124   PORT_DIPSETTING(    0x18, "3" )
1125   PORT_DIPSETTING(    0x10, "4" )
1126   PORT_DIPSETTING(    0x00, "5" )
1127   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) )
1128   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
1129   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
1130   PORT_DIPNAME( 0x40, 0x40, "Swap 1P/2P Controls" )
1131   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1132   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1133   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
1134   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1135   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1136
1105   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )
1106   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
1107   PORT_DIPSETTING(      0x0400, DEF_STR( 3C_1C ) )
1108   PORT_DIPSETTING(      0x0200, DEF_STR( 2C_1C ) )
1109   PORT_DIPSETTING(      0x0700, DEF_STR( 1C_1C ) )
1110//  PORT_DIPSETTING(      0x0300, DEF_STR( 1C_1C ) )    // 1_2 shown in test mode
1111//  PORT_DIPSETTING(      0x0500, DEF_STR( 1C_1C ) )    // 1_3
1112//  PORT_DIPSETTING(      0x0100, DEF_STR( 1C_1C ) )    // 1_4
1113//  PORT_DIPSETTING(      0x0600, DEF_STR( 1C_1C ) )    // 1_5
1114   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )
1115   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
1116   PORT_DIPSETTING(      0x2000, DEF_STR( 3C_1C ) )
1117   PORT_DIPSETTING(      0x1000, DEF_STR( 2C_1C ) )
1118   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )
1119//  PORT_DIPSETTING(      0x1800, DEF_STR( 1C_1C ) )    // 1_2 shown in test mode
1120//  PORT_DIPSETTING(      0x2800, DEF_STR( 1C_1C ) )    // 1_3
1121//  PORT_DIPSETTING(      0x0800, DEF_STR( 1C_1C ) )    // 1_4
1122//  PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )    // 1_5
1123   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Demo_Sounds ) )
1124   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
1125   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1126   PORT_DIPNAME( 0x8000, 0x8000, "Test Mode" )
1127   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1128   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
11371129INPUT_PORTS_END
11381130
11391131
r3115r3116
13391331   COINAGE_8BITS
13401332
13411333   PORT_START("DSW2")
1342   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
1343   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1344   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1345   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1346   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1347   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1348   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Allow_Continue ) )
1349   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1350   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1351   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) )
1352   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
1353   PORT_DIPSETTING(    0x18, DEF_STR( Normal ) )
1354   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1355   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1356   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) )
1357   PORT_DIPSETTING(    0x20, DEF_STR( Upright ) )
1358   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1359   PORT_DIPNAME( 0x40, 0x40, "Test Mode" ) // freeze & slow motion via P1 + P2 start
1360   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1361   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1362   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
1334   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
1335   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1336   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1337   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
1338   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1339   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1340   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Allow_Continue ) )
1341   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1342   PORT_DIPSETTING(      0x0004, DEF_STR( On ) )
1343   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) )
1344   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
1345   PORT_DIPSETTING(      0x0018, DEF_STR( Normal ) )
1346   PORT_DIPSETTING(      0x0010, DEF_STR( Hard ) )
1347   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1348   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Cabinet ) )
1349   PORT_DIPSETTING(      0x0020, DEF_STR( Upright ) )
1350   PORT_DIPSETTING(      0x0000, DEF_STR( Cocktail ) )
1351   PORT_DIPNAME( 0x0040, 0x0040, "Test Mode" ) // freeze & slow motion via P1 + P2 start
1352   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1353   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1354   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
13631355INPUT_PORTS_END
13641356
13651357
1358static INPUT_PORTS_START( phantasm )
1359   PORT_START("SYSTEM")
1360   COINS
13661361
1362   PORT_START("P1")
1363   JOY_2BUTTONS(1)
1364
1365   PORT_START("P2")
1366   JOY_2BUTTONS(2)
1367   RESERVE
1368
1369   PORT_START("DSW")
1370   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
1371   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1372   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1373   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
1374   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1375   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1376   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Allow_Continue ) )
1377   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1378   PORT_DIPSETTING(      0x0004, DEF_STR( On ) )
1379   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) )
1380   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
1381   PORT_DIPSETTING(      0x0018, DEF_STR( Normal ) )
1382   PORT_DIPSETTING(      0x0010, DEF_STR( Hard ) )
1383   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1384   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Cabinet ) )
1385   PORT_DIPSETTING(      0x0020, DEF_STR( Upright ) )
1386   PORT_DIPSETTING(      0x0000, DEF_STR( Cocktail ) )
1387   PORT_DIPNAME( 0x0040, 0x0040, "Test Mode" ) // freeze & slow motion via P1 + P2 start
1388   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1389   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1390   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
1391
1392   PORT_DIPNAME( 0x0f00, 0x0f00, DEF_STR( Coin_A ) )
1393   PORT_DIPSETTING(      0x0700, DEF_STR( 4C_1C ) )
1394   PORT_DIPSETTING(      0x0800, DEF_STR( 3C_1C ) )
1395   PORT_DIPSETTING(      0x0900, DEF_STR( 2C_1C ) )
1396   PORT_DIPSETTING(      0x0f00, DEF_STR( 1C_1C ) )
1397/*  PORT_DIPSETTING(      0x0500, DEF_STR( 1C_1C ) )*/
1398/*  PORT_DIPSETTING(      0x0400, DEF_STR( 1C_1C ) )*/
1399/*  PORT_DIPSETTING(      0x0300, DEF_STR( 1C_1C ) )*/
1400/*  PORT_DIPSETTING(      0x0200, DEF_STR( 1C_1C ) )*/
1401/*  PORT_DIPSETTING(      0x0100, DEF_STR( 1C_1C ) )*/
1402   PORT_DIPSETTING(      0x0600, DEF_STR( 2C_3C ) )
1403   PORT_DIPSETTING(      0x0e00, DEF_STR( 1C_2C ) )
1404   PORT_DIPSETTING(      0x0d00, DEF_STR( 1C_3C ) )
1405   PORT_DIPSETTING(      0x0c00, DEF_STR( 1C_4C ) )
1406   PORT_DIPSETTING(      0x0b00, DEF_STR( 1C_5C ) )
1407   PORT_DIPSETTING(      0x0a00, DEF_STR( 1C_6C ) )
1408   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
1409   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coin_B ) )
1410   PORT_DIPSETTING(      0x7000, DEF_STR( 4C_1C ) )
1411   PORT_DIPSETTING(      0x8000, DEF_STR( 3C_1C ) )
1412   PORT_DIPSETTING(      0x9000, DEF_STR( 2C_1C ) )
1413   PORT_DIPSETTING(      0xf000, DEF_STR( 1C_1C ) )
1414/*  PORT_DIPSETTING(      0x5000, DEF_STR( 1C_1C ) )*/
1415/*  PORT_DIPSETTING(      0x4000, DEF_STR( 1C_1C ) )*/
1416/*  PORT_DIPSETTING(      0x3000, DEF_STR( 1C_1C ) )*/
1417/*  PORT_DIPSETTING(      0x2000, DEF_STR( 1C_1C ) )*/
1418/*  PORT_DIPSETTING(      0x1000, DEF_STR( 1C_1C ) )*/
1419   PORT_DIPSETTING(      0x6000, DEF_STR( 2C_3C ) )
1420   PORT_DIPSETTING(      0xe000, DEF_STR( 1C_2C ) )
1421   PORT_DIPSETTING(      0xd000, DEF_STR( 1C_3C ) )
1422   PORT_DIPSETTING(      0xc000, DEF_STR( 1C_4C ) )
1423   PORT_DIPSETTING(      0xb000, DEF_STR( 1C_5C ) )
1424   PORT_DIPSETTING(      0xa000, DEF_STR( 1C_6C ) )
1425   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
1426INPUT_PORTS_END
1427
1428
1429
13671430/***************************************************************************
13681431
13691432                            [ Big Striker ]
r3115r3116
14371500   RESERVE
14381501
14391502   PORT_START("DSW1")
1440   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
1441   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
1442   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
1443   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
1444   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
1445   PORT_DIPSETTING(    0x05, DEF_STR( 2C_3C ) )
1446//  PORT_DIPSETTING(    0x04, DEF_STR( 2C_3C ) )
1447//  PORT_DIPSETTING(    0x03, DEF_STR( 2C_3C ) )
1448//  PORT_DIPSETTING(    0x02, DEF_STR( 2C_3C ) )
1449//  PORT_DIPSETTING(    0x01, DEF_STR( 2C_3C ) )
1450//  PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
1451   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
1452   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
1453   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
1454   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
1455   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
1456   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1457   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
1458   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
1459   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
1460   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
1461   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
1462   PORT_DIPSETTING(    0x50, DEF_STR( 2C_3C ) )
1463//  PORT_DIPSETTING(    0x40, DEF_STR( 2C_3C ) )
1464//  PORT_DIPSETTING(    0x30, DEF_STR( 2C_3C ) )
1465//  PORT_DIPSETTING(    0x20, DEF_STR( 2C_3C ) )
1466//  PORT_DIPSETTING(    0x10, DEF_STR( 2C_3C ) )
1467//  PORT_DIPSETTING(    0x60, DEF_STR( 2C_3C ) )
1468   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
1469   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
1470   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
1471   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
1472   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
1473   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1503   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) )
1504   PORT_DIPSETTING(      0x0007, DEF_STR( 4C_1C ) )
1505   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
1506   PORT_DIPSETTING(      0x0009, DEF_STR( 2C_1C ) )
1507   PORT_DIPSETTING(      0x000f, DEF_STR( 1C_1C ) )
1508   PORT_DIPSETTING(      0x0005, DEF_STR( 2C_3C ) )
1509//  PORT_DIPSETTING(      0x0004, DEF_STR( 2C_3C ) )
1510//  PORT_DIPSETTING(      0x0003, DEF_STR( 2C_3C ) )
1511//  PORT_DIPSETTING(      0x0002, DEF_STR( 2C_3C ) )
1512//  PORT_DIPSETTING(      0x0001, DEF_STR( 2C_3C ) )
1513//  PORT_DIPSETTING(      0x0006, DEF_STR( 2C_3C ) )
1514   PORT_DIPSETTING(      0x000e, DEF_STR( 1C_2C ) )
1515   PORT_DIPSETTING(      0x000d, DEF_STR( 1C_3C ) )
1516   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_4C ) )
1517   PORT_DIPSETTING(      0x000b, DEF_STR( 1C_5C ) )
1518   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_6C ) )
1519   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
1520   PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B ) )
1521   PORT_DIPSETTING(      0x0070, DEF_STR( 4C_1C ) )
1522   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C ) )
1523   PORT_DIPSETTING(      0x0090, DEF_STR( 2C_1C ) )
1524   PORT_DIPSETTING(      0x00f0, DEF_STR( 1C_1C ) )
1525   PORT_DIPSETTING(      0x0050, DEF_STR( 2C_3C ) )
1526//  PORT_DIPSETTING(      0x0040, DEF_STR( 2C_3C ) )
1527//  PORT_DIPSETTING(      0x0030, DEF_STR( 2C_3C ) )
1528//  PORT_DIPSETTING(      0x0020, DEF_STR( 2C_3C ) )
1529//  PORT_DIPSETTING(      0x0010, DEF_STR( 2C_3C ) )
1530//  PORT_DIPSETTING(      0x0060, DEF_STR( 2C_3C ) )
1531   PORT_DIPSETTING(      0x00e0, DEF_STR( 1C_2C ) )
1532   PORT_DIPSETTING(      0x00d0, DEF_STR( 1C_3C ) )
1533   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_4C ) )
1534   PORT_DIPSETTING(      0x00b0, DEF_STR( 1C_5C ) )
1535   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_6C ) )
1536   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
14741537
14751538   PORT_START("DSW2")
1476   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
1477   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1478   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1479   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )
1480   PORT_DIPSETTING(    0x02, DEF_STR( Easy )    )
1481   PORT_DIPSETTING(    0x06, DEF_STR( Normal )  )
1482   PORT_DIPSETTING(    0x04, DEF_STR( Hard )    )
1483   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1484   PORT_DIPNAME( 0x18, 0x18, "Time" )
1485   PORT_DIPSETTING(    0x00, "Very Short" )
1486   PORT_DIPSETTING(    0x10, "Short" )
1487   PORT_DIPSETTING(    0x18, DEF_STR( Normal ) )
1488   PORT_DIPSETTING(    0x08, "Long" )
1489   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
1490   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1491   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1492   PORT_DIPNAME( 0x40, 0x40, "1 Credit 2 Play" )
1493   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1494   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1495   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
1496
1539   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
1540   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1541   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1542   PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Difficulty ) )
1543   PORT_DIPSETTING(      0x0002, DEF_STR( Easy ) )
1544   PORT_DIPSETTING(      0x0006, DEF_STR( Normal )  )
1545   PORT_DIPSETTING(      0x0004, DEF_STR( Hard ) )
1546   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1547   PORT_DIPNAME( 0x0018, 0x0018, "Time" )
1548   PORT_DIPSETTING(      0x0000, "Very Short" )
1549   PORT_DIPSETTING(      0x0010, "Short" )
1550   PORT_DIPSETTING(      0x0018, DEF_STR( Normal ) )
1551   PORT_DIPSETTING(      0x0008, "Long" )
1552   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
1553   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1554   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
1555   PORT_DIPNAME( 0x0040, 0x0040, "1 Credit 2 Play" )
1556   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1557   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1558   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
14971559INPUT_PORTS_END
14981560
14991561
r3115r3116
15561618   RESERVE            // Unused
15571619
15581620   PORT_START("DSW1")
1559   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
1560   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1561   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1562   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1563   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1564   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1565   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Allow_Continue ) )
1566   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1567   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1568   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) )
1569   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
1570   PORT_DIPSETTING(    0x18, DEF_STR( Normal ) )
1571   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
1572   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1573   PORT_DIPNAME( 0x60, 0x20, DEF_STR( Lives ) )
1574   PORT_DIPSETTING(    0x40, "1" )
1575   PORT_DIPSETTING(    0x60, "2" )
1576   PORT_DIPSETTING(    0x20, "3" )
1577   PORT_DIPSETTING(    0x00, "4" )
1578   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
1621   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
1622   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1623   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1624   PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) )
1625   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1626   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1627   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Allow_Continue ) )
1628   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1629   PORT_DIPSETTING(      0x0004, DEF_STR( On ) )
1630   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) )
1631   PORT_DIPSETTING(      0x0010, DEF_STR( Easy ) )
1632   PORT_DIPSETTING(      0x0018, DEF_STR( Normal ) )
1633   PORT_DIPSETTING(      0x0008, DEF_STR( Hard ) )
1634   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1635   PORT_DIPNAME( 0x0060, 0x0020, DEF_STR( Lives ) )
1636   PORT_DIPSETTING(      0x0040, "1" )
1637   PORT_DIPSETTING(      0x0060, "2" )
1638   PORT_DIPSETTING(      0x0020, "3" )
1639   PORT_DIPSETTING(      0x0000, "4" )
1640   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
15791641
15801642   PORT_START("DSW2")
15811643   COINAGE_8BITS
r3115r3116
16811743   RESERVE            // Unused
16821744
16831745   PORT_START("DSW1")      /*1fd2d9.b, !1fd009.b */
1684   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
1685   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
1686   PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
1687   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
1688   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
1689   PORT_DIPSETTING(    0x02, DEF_STR( 2C_3C ) )
1690   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
1691   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
1692   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
1693   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )
1694   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
1695   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
1696   PORT_DIPSETTING(    0x18, DEF_STR( 2C_1C ) )
1697   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
1698   PORT_DIPSETTING(    0x10, DEF_STR( 2C_3C ) )
1699   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
1700   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
1701   PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
1702   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
1703   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1704   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1705   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
1746   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
1747   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
1748   PORT_DIPSETTING(      0x0001, DEF_STR( 3C_1C ) )
1749   PORT_DIPSETTING(      0x0003, DEF_STR( 2C_1C ) )
1750   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
1751   PORT_DIPSETTING(      0x0002, DEF_STR( 2C_3C ) )
1752   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
1753   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
1754   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
1755   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
1756   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
1757   PORT_DIPSETTING(      0x0008, DEF_STR( 3C_1C ) )
1758   PORT_DIPSETTING(      0x0018, DEF_STR( 2C_1C ) )
1759   PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
1760   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_3C ) )
1761   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_2C ) )
1762   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
1763   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
1764   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) )
1765   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1766   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1767   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
17061768
17071769   PORT_START("DSW2")      /* 1fd2d7.b, !1fd007.b */
1708   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
1709   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
1710   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
1711   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
1712   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
1713   PORT_DIPNAME( 0x04, 0x04, "Disable Instruction Screen" ) /* Manual states this dip is "Unused" */
1714   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1715   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1716   PORT_DIPNAME( 0x18, 0x018, DEF_STR( Allow_Continue ) )
1717   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1718   PORT_DIPSETTING(    0x10, "Up to Mission 4" )
1719   PORT_DIPSETTING(    0x08, "Not on Final Mission" )
1720   PORT_DIPSETTING(    0x18, DEF_STR( On ) )
1721   PORT_DIPNAME( 0x20, 0x20, "Intro Music" )
1722   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1723   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1724   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
1725   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1726   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1727   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
1728   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1729   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1730
1770   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
1771   PORT_DIPSETTING(      0x0002, DEF_STR( Easy ) )
1772   PORT_DIPSETTING(      0x0003, DEF_STR( Normal ) )
1773   PORT_DIPSETTING(      0x0001, DEF_STR( Hard ) )
1774   PORT_DIPSETTING(      0x0000, DEF_STR( Very_Hard ) )
1775   PORT_DIPNAME( 0x0004, 0x0004, "Disable Instruction Screen" ) /* Manual states this dip is "Unused" */
1776   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
1777   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1778   PORT_DIPNAME( 0x0018, 0x00018, DEF_STR( Allow_Continue ) )
1779   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1780   PORT_DIPSETTING(      0x0010, "Up to Mission 4" )
1781   PORT_DIPSETTING(      0x0008, "Not on Final Mission" )
1782   PORT_DIPSETTING(      0x0018, DEF_STR( On ) )
1783   PORT_DIPNAME( 0x0020, 0x0020, "Intro Music" )
1784   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1785   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
1786   PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Demo_Sounds ) )
1787   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1788   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1789   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
1790   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1791   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
17311792INPUT_PORTS_END
17321793
17331794
r3115r3116
18401901   RESERVE
18411902
18421903   PORT_START("DSW1")
1843   COINAGE_6BITS
1844   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
1845   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1846   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1847   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
1904   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
1905   PORT_DIPSETTING(      0x0004, DEF_STR( 3C_1C ) )
1906   PORT_DIPSETTING(      0x0002, DEF_STR( 2C_1C ) )
1907   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
1908   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_2C ) )
1909   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
1910   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_4C ) )
1911   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_5C ) )
1912   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
1913   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
1914   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_1C ) )
1915   PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ) )
1916   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
1917   PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
1918   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_2C ) )
1919   PORT_DIPSETTING(      0x0028, DEF_STR( 1C_3C ) )
1920   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_4C ) )
1921   PORT_DIPSETTING(      0x0030, DEF_STR( 1C_5C ) )
1922   PORT_DIPNAME( 0x000040, 0x000040, DEF_STR( Demo_Sounds ) )
1923   PORT_DIPSETTING(      0x000000, DEF_STR( Off ) )
1924   PORT_DIPSETTING(      0x000040, DEF_STR( On ) )
1925   PORT_SERVICE( 0x000080, IP_ACTIVE_LOW )
18481926
18491927   PORT_START("DSW2")         /* 0x66007.b */
1850   PORT_DIPNAME( 0x07, 0x07, "DSW-B bits 2-0" )
1851   PORT_DIPSETTING(    0x00, "0" )
1852   PORT_DIPSETTING(    0x01, "1" )
1853   PORT_DIPSETTING(    0x02, "2" )
1854   PORT_DIPSETTING(    0x03, "3" )
1855   PORT_DIPSETTING(    0x04, "4" )
1856   PORT_DIPSETTING(    0x05, "5" )
1857   PORT_DIPSETTING(    0x06, "6" )
1858   PORT_DIPSETTING(    0x07, "7" )
1859   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) )
1860   PORT_DIPSETTING(    0x08, "3" )
1861   PORT_DIPSETTING(    0x00, "4" )
1862   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
1863   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
1864   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
1865   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1866   PORT_DIPSETTING(    0x20, DEF_STR( Very_Hard ) )
1867   PORT_DIPNAME( 0x40, 0x40, "DSW-B bit 6" )
1868   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1869   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1870   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
1871   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1872   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1928   PORT_DIPNAME( 0x0007, 0x0007, "DSW-B bits 2-0" )
1929   PORT_DIPSETTING(      0x0000, "0" )
1930   PORT_DIPSETTING(      0x0001, "1" )
1931   PORT_DIPSETTING(      0x0002, "2" )
1932   PORT_DIPSETTING(      0x0003, "3" )
1933   PORT_DIPSETTING(      0x0004, "4" )
1934   PORT_DIPSETTING(      0x0005, "5" )
1935   PORT_DIPSETTING(      0x0006, "6" )
1936   PORT_DIPSETTING(      0x0007, "7" )
1937   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Lives ) )
1938   PORT_DIPSETTING(      0x0008, "3" )
1939   PORT_DIPSETTING(      0x0000, "4" )
1940   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Difficulty ) )
1941   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
1942   PORT_DIPSETTING(      0x0030, DEF_STR( Normal ) )
1943   PORT_DIPSETTING(      0x0010, DEF_STR( Hard ) )
1944   PORT_DIPSETTING(      0x0020, DEF_STR( Very_Hard ) )
1945   PORT_DIPNAME( 0x0040, 0x0040, "DSW-B bit 6" )
1946   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1947   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1948   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
1949   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1950   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
18731951INPUT_PORTS_END
18741952
18751953
r3115r3116
19392017   JOY_2BUTTONS(2)
19402018   RESERVE
19412019
1942   PORT_START("DSW1")   /* 0x80006.b */
2020   PORT_START("DSW")
2021   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) ) /* Manual states dips 1-4 & 6 are "Unused" */
2022   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
2023   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2024   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) )
2025   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
2026   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2027   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) )
2028   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
2029   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2030   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
2031   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
2032   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2033   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Difficulty ) )
2034   PORT_DIPSETTING(      0x0030, DEF_STR( Normal ) )
2035   PORT_DIPSETTING(      0x0020, DEF_STR( Hard ) )
2036   PORT_DIPSETTING(      0x0010, DEF_STR( Harder ) )
2037   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
2038   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
2039   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
2040   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2041   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
2042   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
2043   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2044
19432045   COINAGE_6BITS
1944   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
1945   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1946   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1947   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
1948   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1949   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1950
1951   PORT_START("DSW2")   /* 0x80007.b */
1952   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) /* Manual states dips 1-4 & 6 are "Unused" */
1953   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1954   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1955   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) )
1956   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1957   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1958   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )
1959   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1960   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1961   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
1962   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1963   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1964   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
1965   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
1966   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
1967   PORT_DIPSETTING(    0x10, DEF_STR( Harder ) )
1968   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1969   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
1970   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1971   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1972   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
1973   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1974   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2046   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )
2047   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
2048   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
2049   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )
2050   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
2051   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
19752052INPUT_PORTS_END
19762053
19772054
r3115r3116
20872164   COINAGE_8BITS
20882165
20892166   PORT_START("DSW2")         /* 0x69353.b */
2090   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
2091   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2092   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2093   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
2094   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2095   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
2096   PORT_DIPNAME( 0x04, 0x04, "Unknown 2-2" )
2097   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2098   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2099   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) )
2100   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
2101   PORT_DIPSETTING(    0x18, DEF_STR( Normal ) )
2102   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
2103   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2104   PORT_DIPNAME( 0x20, 0x20, "Points To Win" )
2105   PORT_DIPSETTING(    0x00, "10" )
2106   PORT_DIPSETTING(    0x20, "15" )
2107   PORT_DIPNAME( 0x40, 0x40, "Unknown 2-6" )
2108   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2109   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2110   PORT_DIPNAME( 0x80, 0x80, "Unknown 2-7" )
2111   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2112   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2167   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
2168   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
2169   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2170   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) )
2171   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
2172   PORT_DIPSETTING(      0x0002, DEF_STR( On ) )
2173   PORT_DIPNAME( 0x0004, 0x0004, "Unknown 2-2" )
2174   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
2175   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2176   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) )
2177   PORT_DIPSETTING(      0x0010, DEF_STR( Easy ) )
2178   PORT_DIPSETTING(      0x0018, DEF_STR( Normal ) )
2179   PORT_DIPSETTING(      0x0008, DEF_STR( Hard ) )
2180   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
2181   PORT_DIPNAME( 0x0020, 0x0020, "Points To Win" )
2182   PORT_DIPSETTING(      0x0000, "10" )
2183   PORT_DIPSETTING(      0x0020, "15" )
2184   PORT_DIPNAME( 0x0040, 0x0040, "Unknown 2-6" )
2185   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
2186   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2187   PORT_DIPNAME( 0x0080, 0x0080, "Unknown 2-7" )
2188   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
2189   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
21132190INPUT_PORTS_END
21142191
21152192
r3115r3116
22172294   JOY_2BUTTONS(2)
22182295   RESERVE
22192296
2220   PORT_START("DSW1")    /* 0x80006.b */
2297   PORT_START("DSW")
2298   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) )
2299   PORT_DIPSETTING(      0x0003, "2" )
2300   PORT_DIPSETTING(      0x0001, "3" )
2301   PORT_DIPSETTING(      0x0002, "4" )
2302   PORT_DIPSETTING(      0x0000, "Infinite (Cheat)" )
2303   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Bonus_Life ) )
2304   PORT_DIPSETTING(      0x0004, "50k" )
2305   PORT_DIPSETTING(      0x0000, "200k" )
2306   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Allow_Continue ) )
2307   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
2308   PORT_DIPSETTING(      0x0008, DEF_STR( On ) )
2309   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Difficulty ) )
2310   PORT_DIPSETTING(      0x0030, DEF_STR( Normal ) )
2311   PORT_DIPSETTING(      0x0020, DEF_STR( Hard ) )
2312   PORT_DIPSETTING(      0x0010, DEF_STR( Harder ) )
2313   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
2314   PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Cabinet ) )
2315   PORT_DIPSETTING(      0x0000, DEF_STR( Upright ) )
2316   PORT_DIPSETTING(      0x0040, DEF_STR( Cocktail ) )
2317   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
2318   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
2319   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2320
22212321   COINAGE_6BITS
2222   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
2223   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2224   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2225   PORT_DIPNAME( 0x80, 0x80, "Freeze Screen (Cheat)")
2226   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2227   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2228
2229   PORT_START("DSW2")   /* 0x80007.b */
2230   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
2231   PORT_DIPSETTING(    0x03, "2" )
2232   PORT_DIPSETTING(    0x01, "3" )
2233   PORT_DIPSETTING(    0x02, "4" )
2234   PORT_DIPSETTING(    0x00, "Infinite (Cheat)" )
2235   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Bonus_Life ) )
2236   PORT_DIPSETTING(    0x04, "50k" )
2237   PORT_DIPSETTING(    0x00, "200k" )
2238   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Allow_Continue ) )
2239   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2240   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
2241   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
2242   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
2243   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
2244   PORT_DIPSETTING(    0x10, DEF_STR( Harder ) )
2245   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2246   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
2247   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2248   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
2249   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
2250   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2251   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2322   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Demo_Sounds ) )
2323   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
2324   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2325   PORT_DIPNAME( 0x8000, 0x8000, "Freeze Screen (Cheat)")
2326   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
2327   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
22522328INPUT_PORTS_END
22532329
22542330
r3115r3116
23212397   JOY_3BUTTONS(2)
23222398   RESERVE
23232399
2324   PORT_START("DSW1")   /* 0x80006.b */
2400   PORT_START("DSW")
2401   PORT_DIPNAME( 0x0001, 0x0001, "2 Player Innings per Credit" )
2402   PORT_DIPSETTING(      0x0001, "2" )
2403   PORT_DIPSETTING(      0x0000, "3" )
2404   PORT_DIPNAME( 0x0002, 0x0002, "Difficulty for Catching Ball" )
2405   PORT_DIPSETTING(      0x0002, DEF_STR( Normal ) )   // $200-140
2406   PORT_DIPSETTING(      0x0000, DEF_STR( Hard ) )   // $400-140
2407   PORT_DIPNAME( 0x003c, 0x003c, "Franchise (Increase Batting Power)" )
2408   PORT_DIPSETTING(      0x003c, DEF_STR( Normal )  )
2409   PORT_DIPSETTING(      0x0038, "G"  )
2410   PORT_DIPSETTING(      0x0034, "D"  )
2411   PORT_DIPSETTING(      0x0030, "C"  ) /* I hope the Japanese Baseball crowd knows what these leagues are ;-) */
2412   PORT_DIPSETTING(      0x002c, "S"  )
2413   PORT_DIPSETTING(      0x0028, "W (B)"  )
2414   PORT_DIPSETTING(      0x0024, "T"  )
2415   PORT_DIPSETTING(      0x0020, "L"  )
2416   PORT_DIPSETTING(      0x001c, "Br (Bw)"  )
2417   PORT_DIPSETTING(      0x0018, "F"  )
2418   PORT_DIPSETTING(      0x0014, "H" )
2419   PORT_DIPSETTING(      0x0010, "O (M)" )
2420   PORT_DIPSETTING(      0x000c, "Bu" )
2421//  PORT_DIPSETTING(      0x0008, "13" )
2422//  PORT_DIPSETTING(      0x0004, "14" )
2423//  PORT_DIPSETTING(      0x0000, "15" )
2424   PORT_DIPNAME( 0x0040, 0x0040, "Scroll Is Based On" )
2425   PORT_DIPSETTING(      0x0040, "Shadow of Baseball" )
2426   PORT_DIPSETTING(      0x0000, "The Baseball Itself" )
2427   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
2428   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
2429   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2430
23252431   COINAGE_6BITS
2326   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
2327   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2328   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2329   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
2330   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2331   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2332
2333   PORT_START("DSW2")   /* 0x80007.b */
2334   PORT_DIPNAME( 0x01, 0x01, "2 Player Innings per Credit" )
2335   PORT_DIPSETTING(    0x01, "2" )
2336   PORT_DIPSETTING(    0x00, "3" )
2337   PORT_DIPNAME( 0x02, 0x02, "Difficulty for Catching Ball" )
2338   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )   // $200-140
2339   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )   // $400-140
2340   PORT_DIPNAME( 0x3c, 0x3c, "Franchise (Increase Batting Power)" )
2341   PORT_DIPSETTING(    0x3c, DEF_STR( Normal )  )
2342   PORT_DIPSETTING(    0x38, "G"  )
2343   PORT_DIPSETTING(    0x34, "D"  )
2344   PORT_DIPSETTING(    0x30, "C"  ) /* I hope the Japanese Baseball crowd knows what these leagues are ;-) */
2345   PORT_DIPSETTING(    0x2c, "S"  )
2346   PORT_DIPSETTING(    0x28, "W (B)"  )
2347   PORT_DIPSETTING(    0x24, "T"  )
2348   PORT_DIPSETTING(    0x20, "L"  )
2349   PORT_DIPSETTING(    0x1c, "Br (Bw)"  )
2350   PORT_DIPSETTING(    0x18, "F"  )
2351   PORT_DIPSETTING(    0x14, "H" )
2352   PORT_DIPSETTING(    0x10, "O (M)" )
2353   PORT_DIPSETTING(    0x0c, "Bu" )
2354//  PORT_DIPSETTING(    0x08, "13" )
2355//  PORT_DIPSETTING(    0x04, "14" )
2356//  PORT_DIPSETTING(    0x00, "15" )
2357   PORT_DIPNAME( 0x40, 0x40, "Scroll Is Based On" )
2358   PORT_DIPSETTING(    0x40, "Shadow of Baseball" )
2359   PORT_DIPSETTING(    0x00, "The Baseball Itself" )
2360   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
2361   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2362   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2363
2432   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Demo_Sounds ) )
2433   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
2434   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2435   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )
2436   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
2437   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
23642438INPUT_PORTS_END
23652439
23662440
r3115r3116
24462520   JOY_2BUTTONS(2)
24472521   RESERVE
24482522
2449   PORT_START("DSW1")   /* 0x80006.b */
2450   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
2451   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
2452   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
2453   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
2454   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
2455   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
2456   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
2457   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
2458   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
2459   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
2460   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2461   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2462   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
2463   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2464   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2465   PORT_DIPNAME( 0x20, 0x20, "Freeze Screen (Cheat)" )
2466   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2467   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2468   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
2469   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2470   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2471   PORT_DIPNAME( 0x80, 0x80, "Text" )
2472   PORT_DIPSETTING(    0x80, DEF_STR( Japanese ) )
2473   PORT_DIPSETTING(    0x00, DEF_STR( English ) )   // show "Japan Only" warning
2523   PORT_START("DSW")
2524   PORT_DIPNAME( 0x0003, 0x0003, "Time" )   // -> !f0082.w
2525   PORT_DIPSETTING(      0x0003, "3'" )
2526   PORT_DIPSETTING(      0x0002, "4'" )
2527   PORT_DIPSETTING(      0x0001, "5'" )
2528   PORT_DIPSETTING(      0x0000, "6'" )
2529   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) ) /* Manual states dips 3 & 4 are "Unused" */
2530   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
2531   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2532   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
2533   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
2534   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2535   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Difficulty ) )
2536   PORT_DIPSETTING(      0x0030, DEF_STR( Normal ) )
2537   PORT_DIPSETTING(      0x0020, DEF_STR( Hard ) )
2538   PORT_DIPSETTING(      0x0010, DEF_STR( Harder ) )
2539   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
2540   PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Controls ) )
2541   PORT_DIPSETTING(      0x0040, DEF_STR( Trackball ) )
2542   PORT_DIPSETTING(      0x0000, DEF_STR( Joystick ) )
2543   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
2544   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
2545   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
24742546
2475   PORT_START("DSW2")   /* 0x80007.b */
2476   PORT_DIPNAME( 0x03, 0x03, "Time" )   // -> !f0082.w
2477   PORT_DIPSETTING(    0x03, "3'" )
2478   PORT_DIPSETTING(    0x02, "4'" )
2479   PORT_DIPSETTING(    0x01, "5'" )
2480   PORT_DIPSETTING(    0x00, "6'" )
2481   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) /* Manual states dips 3 & 4 are "Unused" */
2482   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2483   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2484   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
2485   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2486   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2487   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
2488   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
2489   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
2490   PORT_DIPSETTING(    0x10, DEF_STR( Harder ) )
2491   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2492   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Controls ) )
2493   PORT_DIPSETTING(    0x40, DEF_STR( Trackball ) )
2494   PORT_DIPSETTING(    0x00, DEF_STR( Joystick ) )
2495   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
2496   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2497   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2547   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )
2548   PORT_DIPSETTING(      0x0100, DEF_STR( 4C_1C ) )
2549   PORT_DIPSETTING(      0x0200, DEF_STR( 3C_1C ) )
2550   PORT_DIPSETTING(      0x0300, DEF_STR( 2C_1C ) )
2551   PORT_DIPSETTING(      0x0700, DEF_STR( 1C_1C ) )
2552   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_2C ) )
2553   PORT_DIPSETTING(      0x0500, DEF_STR( 1C_3C ) )
2554   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
2555   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
2556   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unused ) )
2557   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
2558   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2559   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) )
2560   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
2561   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2562   PORT_DIPNAME( 0x2000, 0x2000, "Freeze Screen (Cheat)" )
2563   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
2564   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2565   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Demo_Sounds ) )
2566   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
2567   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2568   PORT_DIPNAME( 0x8000, 0x8000, "Text" )
2569   PORT_DIPSETTING(      0x8000, DEF_STR( Japanese ) )
2570   PORT_DIPSETTING(      0x0000, DEF_STR( English ) )   // show "Japan Only" warning
24982571INPUT_PORTS_END
24992572
25002573
r3115r3116
25652638   JOY_2BUTTONS(2)
25662639   RESERVE
25672640
2568   PORT_START("DSW1")   /* 0x80006.b */
2641   PORT_START("DSW")
2642   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) )
2643   PORT_DIPSETTING(      0x0000, "2" )
2644   PORT_DIPSETTING(      0x0003, "3" )
2645   PORT_DIPSETTING(      0x0002, "4" )
2646   PORT_DIPSETTING(      0x0001, "5" )
2647   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
2648   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
2649   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2650   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
2651   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
2652   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2653   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Difficulty ) )   // boss enemy damage bar
2654   PORT_DIPSETTING(      0x0030, DEF_STR( Easy ) )         // 6 dots
2655   PORT_DIPSETTING(      0x0020, DEF_STR( Normal ) )      // 8 dots
2656   PORT_DIPSETTING(      0x0010, DEF_STR( Hard ) )         // 9 dots
2657   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )      // 12 dots
2658   PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Cabinet ) )
2659   PORT_DIPSETTING(      0x0000, DEF_STR( Upright ) )
2660   PORT_DIPSETTING(      0x0040, DEF_STR( Cocktail ) )
2661   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
2662   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
2663   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2664
25692665   COINAGE_6BITS_2
2570   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
2571   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2572   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2573   PORT_DIPNAME( 0x80, 0x80, "Invulnerability (Cheat)")
2574   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2575   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2576
2577   PORT_START("DSW2")   /* 0x80007.b */
2578   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
2579   PORT_DIPSETTING(    0x00, "2" )
2580   PORT_DIPSETTING(    0x03, "3" )
2581   PORT_DIPSETTING(    0x02, "4" )
2582   PORT_DIPSETTING(    0x01, "5" )
2583   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
2584   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2585   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2586   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
2587   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2588   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2589   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) // boss enemy damage bar
2590   PORT_DIPSETTING(    0x30, DEF_STR( Easy ) ) // 6 dots
2591   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) ) // 8 dots
2592   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) ) // 9 dots
2593   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) ) // 12 dots
2594   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
2595   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2596   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
2597   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
2598   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2599   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2666   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Demo_Sounds ) )
2667   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
2668   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2669   PORT_DIPNAME( 0x8000, 0x8000, "Invulnerability (Cheat)")
2670   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
2671   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
26002672INPUT_PORTS_END
26012673
26022674
r3115r3116
27472819   JOY_2BUTTONS(2)
27482820   RESERVE
27492821
2750   PORT_START("DSW1")   /* 0x80006.b */
2822   PORT_START("DSW")
2823   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) )
2824   PORT_DIPSETTING(      0x0002, "2" )
2825   PORT_DIPSETTING(      0x0003, "3" )
2826   PORT_DIPSETTING(      0x0001, "4" )
2827   PORT_DIPSETTING(      0x0000, "5" )
2828   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) ) /* Manual states dips 3 & 4 are "Unused" */
2829   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
2830   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2831   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
2832   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
2833   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2834   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Difficulty ) )
2835   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
2836   PORT_DIPSETTING(      0x0030, DEF_STR( Normal ) )
2837   PORT_DIPSETTING(      0x0020, DEF_STR( Hard ) )
2838   PORT_DIPSETTING(      0x0010, DEF_STR( Hardest ) )
2839   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) ) /* Manual states this dip is "Unused" */
2840   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
2841   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2842   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
2843   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
2844   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2845
27512846   COINAGE_6BITS_2
2752   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
2753   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2754   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
2755   PORT_DIPNAME( 0x80, 0x80, "Invulnerability (Cheat)")
2756   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2757   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2758
2759   PORT_START("DSW2")   /* 0x80007.b */
2760   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
2761   PORT_DIPSETTING(    0x02, "2" )
2762   PORT_DIPSETTING(    0x03, "3" )
2763   PORT_DIPSETTING(    0x01, "4" )
2764   PORT_DIPSETTING(    0x00, "5" )
2765   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) /* Manual states dips 3 & 4 are "Unused" */
2766   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2767   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2768   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
2769   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2770   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2771   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
2772   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
2773   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
2774   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
2775   PORT_DIPSETTING(    0x10, DEF_STR( Hardest ) )
2776   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) /* Manual states this dip is "Unused" */
2777   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2778   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2779   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
2780   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2781   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2847   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )
2848   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
2849   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
2850   PORT_DIPNAME( 0x8000, 0x8000, "Invulnerability (Cheat)")
2851   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
2852   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
27822853INPUT_PORTS_END
27832854
27842855
r3115r3116
29323003   PEEKABOO_PADDLE(2) PORT_COCKTAIL
29333004   RESERVE
29343005
2935   PORT_START("DSW1")   /* 1f003a.b<-e0000.b */
3006   PORT_START("DSW")
3007   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )      // 1f0358<-!
3008   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
3009   PORT_DIPSETTING(      0x0003, DEF_STR( Normal ) )
3010   PORT_DIPSETTING(      0x0002, DEF_STR( Hard ) )
3011   PORT_DIPSETTING(      0x0001, DEF_STR( Hardest ) )
3012   PORT_SERVICE( 0x0004, IP_ACTIVE_LOW )
3013   PORT_DIPNAME( 0x0008, 0x0008, "Movement" )               // 1f0392<-!
3014   PORT_DIPSETTING(      0x0008, "Paddles" )
3015   PORT_DIPSETTING(      0x0000, "Buttons" )
3016   PORT_DIPNAME( 0x0030, 0x0030, "Nudity" )               // 1f0356<-!
3017   PORT_DIPSETTING(      0x0030, "Female and Male (Full)" )
3018   PORT_DIPSETTING(      0x0020, "Female (Full)" )
3019   PORT_DIPSETTING(      0x0010, "Female (Partial)" )
3020   PORT_DIPSETTING(      0x0000, DEF_STR( None ) )
3021   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Cabinet ) )         // 1f006a<-!
3022   PORT_DIPSETTING(      0x0040, DEF_STR( Upright ) )
3023   PORT_DIPSETTING(      0x0000, DEF_STR( Cocktail ) )
3024   PORT_DIPNAME( 0x0080, 0x0080, "Number of controllers" )      // 1f0074<-!
3025   PORT_DIPSETTING(      0x0080, "1" )
3026   PORT_DIPSETTING(      0x0000, "2" )
3027
29363028   COINAGE_6BITS_2
2937   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )      // 1f0354<-
2938   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2939   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
2940   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )      // 1f0022/6e<-!
2941   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2942   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2943
2944   PORT_START("DSW2")   /* 1f003b.b<-e0001.b */
2945   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )            // 1f0358<-!
2946   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
2947   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
2948   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
2949   PORT_DIPSETTING(    0x01, DEF_STR( Hardest ) )
2950   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
2951   PORT_DIPNAME( 0x08, 0x08, "Movement" )               // 1f0392<-!
2952   PORT_DIPSETTING(    0x08, "Paddles" )
2953   PORT_DIPSETTING(    0x00, "Buttons" )
2954   PORT_DIPNAME( 0x30, 0x30, "Nudity" )               // 1f0356<-!
2955   PORT_DIPSETTING(    0x30, "Female and Male (Full)" )
2956   PORT_DIPSETTING(    0x20, "Female (Full)" )
2957   PORT_DIPSETTING(    0x10, "Female (Partial)" )
2958   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
2959   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )         // 1f006a<-!
2960   PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
2961   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
2962   PORT_DIPNAME( 0x80, 0x80, "Number of controllers" )   // 1f0074<-!
2963   PORT_DIPSETTING(    0x80, "1" )
2964   PORT_DIPSETTING(    0x00, "2" )
3029   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )      // 1f0354<-
3030   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
3031   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
3032   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Flip_Screen ) )      // 1f0022/6e<-!
3033   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
3034   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
29653035INPUT_PORTS_END
29663036
29673037
r3115r3116
30683138   JOY_2BUTTONS(2)
30693139   RESERVE
30703140
3071   PORT_START("DSW1")   /* 0x80006.b */
3141   PORT_START("DSW")
3142   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) )
3143   PORT_DIPSETTING(      0x0003, "3" )
3144   PORT_DIPSETTING(      0x0002, "4" )
3145   PORT_DIPSETTING(      0x0001, "5" )
3146   PORT_DIPSETTING(      0x0000, "Infinite (Cheat)" )
3147   PORT_DIPNAME( 0x0004, 0x0004, "Hyper Laser Beams" )
3148   PORT_DIPSETTING(      0x0000, "2" )
3149   PORT_DIPSETTING(      0x0004, "3" )
3150   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Bonus_Life ) )
3151   PORT_DIPSETTING(      0x0008, "70k and every 200k")      /* As stated in manual, but was 70K & Every 130K */
3152   PORT_DIPSETTING(      0x0000, "100k and 300k Only")      /* As stated in manual, but was 100K & Every 200K */
3153   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Difficulty ) )
3154   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
3155   PORT_DIPSETTING(      0x0030, DEF_STR( Normal ) )
3156   PORT_DIPSETTING(      0x0010, DEF_STR( Hard ) )
3157   PORT_DIPSETTING(      0x0020, DEF_STR( Hardest ) )
3158   PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Cabinet ) )
3159   PORT_DIPSETTING(      0x0000, DEF_STR( Upright ) )
3160   PORT_DIPSETTING(      0x0040, DEF_STR( Cocktail ) )
3161   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
3162   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
3163   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3164
30723165   COINAGE_6BITS
3073   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
3074   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3075   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3076   PORT_DIPNAME( 0x80, 0x80, "Freeze Screen (Cheat)")
3077   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3078   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3079
3080   PORT_START("DSW2")   /* 0x80007.b */
3081   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
3082   PORT_DIPSETTING(    0x03, "3" )
3083   PORT_DIPSETTING(    0x02, "4" )
3084   PORT_DIPSETTING(    0x01, "5" )
3085   PORT_DIPSETTING(    0x00, "Infinite (Cheat)" )
3086   PORT_DIPNAME( 0x04, 0x04, "Hyper Laser Beams" )
3087   PORT_DIPSETTING(    0x00, "2" )
3088   PORT_DIPSETTING(    0x04, "3" )
3089   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )
3090   PORT_DIPSETTING(    0x08, "70k and every 200k")      /* As stated in manual, but was 70K & Every 130K */
3091   PORT_DIPSETTING(    0x00, "100k and 300k Only")      /* As stated in manual, but was 100K & Every 200K */
3092   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
3093   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
3094   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
3095   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
3096   PORT_DIPSETTING(    0x20, DEF_STR( Hardest ) )
3097   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
3098   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
3099   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
3100   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
3101   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3102   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3166   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )
3167   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
3168   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
3169   PORT_DIPNAME( 0x8000, 0x8000, "Freeze Screen (Cheat)")
3170   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
3171   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
31033172INPUT_PORTS_END
31043173
31053174
r3115r3116
32603329   JOY_2BUTTONS(2)
32613330   RESERVE
32623331
3263   PORT_START("DSW1")   /* 0x80006.b */
3332   PORT_START("DSW")
3333   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) ) /* according to manual */
3334   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
3335   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3336   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) ) /* according to manual */
3337   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
3338   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3339   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) )
3340   PORT_DIPSETTING(      0x0004, "2" )
3341   PORT_DIPSETTING(      0x000c, "3" )
3342   PORT_DIPSETTING(      0x0008, "4" )
3343   PORT_DIPSETTING(      0x0000, "Infinite (Cheat)")
3344   PORT_DIPNAME( 0x0010, 0x0010, "Default episode" )
3345   PORT_DIPSETTING(      0x0010, "1" )
3346   PORT_DIPSETTING(      0x0000, "2" )
3347   PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )
3348   PORT_DIPSETTING(      0x0000, DEF_STR( Easy ) )
3349   PORT_DIPSETTING(      0x0060, DEF_STR( Normal ) )
3350   PORT_DIPSETTING(      0x0020, DEF_STR( Hard ) )
3351   PORT_DIPSETTING(      0x0040, DEF_STR( Hardest ) )
3352   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
3353   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
3354   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3355
32643356   COINAGE_6BITS
3265   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
3266   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3267   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3268   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
3269
3270   PORT_START("DSW2")   /* 0x80007.b */
3271   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) /* according to manual */
3272   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
3273   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3274   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) /* according to manual */
3275   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3276   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3277   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
3278   PORT_DIPSETTING(    0x04, "2" )
3279   PORT_DIPSETTING(    0x0c, "3" )
3280   PORT_DIPSETTING(    0x08, "4" )
3281   PORT_DIPSETTING(    0x00, "Infinite (Cheat)")
3282   PORT_DIPNAME( 0x10, 0x10, "Default episode" )
3283   PORT_DIPSETTING(    0x10, "1" )
3284   PORT_DIPSETTING(    0x00, "2" )
3285   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
3286   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
3287   PORT_DIPSETTING(    0x60, DEF_STR( Normal ) )
3288   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
3289   PORT_DIPSETTING(    0x40, DEF_STR( Hardest ) )
3290   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
3291   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3292   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3357   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Demo_Sounds ) )
3358   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
3359   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3360   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
32933361INPUT_PORTS_END
32943362
32953363
r3115r3116
33563424   JOY_2BUTTONS(2)
33573425   RESERVE
33583426
3359   PORT_START("DSW1")   /* 0x80006.b */
3427   PORT_START("DSW")
3428   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) )
3429   PORT_DIPSETTING(      0x0002, "2" )
3430   PORT_DIPSETTING(      0x0003, "3" )
3431   PORT_DIPSETTING(      0x0001, "4" )
3432   PORT_DIPSETTING(      0x0000, "5" )
3433   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) ) /* Manual states dips 3 & 4 are "Unused" */
3434   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
3435   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3436   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
3437   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
3438   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3439   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Difficulty ) )
3440   PORT_DIPSETTING(      0x0030, DEF_STR( Easy ) )
3441   PORT_DIPSETTING(      0x0020, DEF_STR( Normal ) )
3442   PORT_DIPSETTING(      0x0010, DEF_STR( Hard ) )
3443   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
3444   PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Cabinet ) )
3445   PORT_DIPSETTING(      0x0000, DEF_STR( Upright ) )
3446   PORT_DIPSETTING(      0x0040, DEF_STR( Cocktail ) )
3447   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
3448   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
3449   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3450
33603451   COINAGE_6BITS_2
3361   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
3362   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3363   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
3364   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )   // used?
3365   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3366   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3367
3368   PORT_START("DSW2")   /* 0x80007.b */
3369   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
3370   PORT_DIPSETTING(    0x02, "2" )
3371   PORT_DIPSETTING(    0x03, "3" )
3372   PORT_DIPSETTING(    0x01, "4" )
3373   PORT_DIPSETTING(    0x00, "5" )
3374   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) /* Manual states dips 3 & 4 are "Unused" */
3375   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
3376   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3377   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
3378   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
3379   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3380   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
3381   PORT_DIPSETTING(    0x30, DEF_STR( Easy ) )
3382   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
3383   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
3384   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
3385   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
3386   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
3387   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
3388   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
3389   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3390   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3452   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )
3453   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
3454   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
3455   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )   // used?
3456   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
3457   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
33913458INPUT_PORTS_END
33923459
33933460
r3115r3116
34483515   JOY_2BUTTONS(2)
34493516   RESERVE
34503517
3451   PORT_START("DSW1")   /* 0x80006.b */
3518   PORT_START("DSW")
3519   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
3520   PORT_DIPSETTING(      0x0000, DEF_STR( Easy )   )
3521   PORT_DIPSETTING(      0x0003, DEF_STR( Normal ) )
3522   PORT_DIPSETTING(      0x0002, DEF_STR( Hard )   )
3523   PORT_DIPSETTING(      0x0001, DEF_STR( Hardest ))
3524   PORT_DIPNAME( 0x000c, 0x000c, "Games To Play (Vs)" )
3525   PORT_DIPSETTING(      0x0000, "1" )
3526   PORT_DIPSETTING(      0x000c, "2" )
3527   PORT_DIPSETTING(      0x0008, "3" )
3528   PORT_DIPSETTING(      0x0004, "4" )
3529   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Allow_Continue ) )
3530   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
3531   PORT_DIPSETTING(      0x0010, DEF_STR( On ) )
3532   PORT_DIPNAME( 0x0020, 0x0020, "Credits To Start (Vs)" )
3533   PORT_DIPSETTING(      0x0020, "1" )
3534   PORT_DIPSETTING(      0x0000, "2" )
3535   PORT_DIPNAME( 0x0040, 0x0040, "Credits To Continue (Vs)" )
3536   PORT_DIPSETTING(      0x0040, "1" )
3537   PORT_DIPSETTING(      0x0000, "2" )
3538   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
3539   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
3540   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3541
34523542   COINAGE_6BITS_2
3453   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
3454   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3455   PORT_DIPSETTING(    0x40, DEF_STR( On )  )
3456   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
3457
3458   PORT_START("DSW2")   /* 0x80007.b */
3459   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
3460   PORT_DIPSETTING(    0x00, DEF_STR( Easy )   )
3461   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
3462   PORT_DIPSETTING(    0x02, DEF_STR( Hard )   )
3463   PORT_DIPSETTING(    0x01, DEF_STR( Hardest ))
3464   PORT_DIPNAME( 0x0c, 0x0c, "Games To Play (Vs)" )
3465   PORT_DIPSETTING(    0x00, "1" )
3466   PORT_DIPSETTING(    0x0c, "2" )
3467   PORT_DIPSETTING(    0x08, "3" )
3468   PORT_DIPSETTING(    0x04, "4" )
3469   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )
3470   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3471   PORT_DIPSETTING(    0x10, DEF_STR( On )  )
3472   PORT_DIPNAME( 0x20, 0x20, "Credits To Start (Vs)" )
3473   PORT_DIPSETTING(    0x20, "1" )
3474   PORT_DIPSETTING(    0x00, "2" )
3475   PORT_DIPNAME( 0x40, 0x40, "Credits To Continue (Vs)" )
3476   PORT_DIPSETTING(    0x40, "1" )
3477   PORT_DIPSETTING(    0x00, "2" )
3478   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
3479   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3480   PORT_DIPSETTING(    0x00, DEF_STR( On )  )
3543   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )
3544   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
3545   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
3546   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
34813547INPUT_PORTS_END
34823548
34833549static READ16_HANDLER( soldamj_spriteram16_r )
r3115r3116
35863652   JOY_3BUTTONS(2)
35873653   RESERVE
35883654
3589   PORT_START("DSW1")   /* 0x80006.b */
3655   PORT_START("DSW")
3656   PORT_DIPNAME( 0x0003, 0x0001, DEF_STR( Lives ) )
3657   PORT_DIPSETTING(      0x0003, "2" )
3658   PORT_DIPSETTING(      0x0001, "3" )
3659   PORT_DIPSETTING(      0x0002, "4" )
3660   PORT_DIPSETTING(      0x0000, "Infinite (Cheat)" )
3661   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Bonus_Life ) )
3662   PORT_DIPSETTING(      0x000c, "20k" )
3663   PORT_DIPSETTING(      0x0004, "30k" )
3664   PORT_DIPSETTING(      0x0008, "40k" )
3665   PORT_DIPSETTING(      0x0000, "50k" )
3666   PORT_DIPNAME( 0x0030, 0x0010, DEF_STR( Difficulty ) )   // damage when hit
3667   PORT_DIPSETTING(      0x0030, DEF_STR( Easy ) )         // 0
3668   PORT_DIPSETTING(      0x0010, DEF_STR( Normal )  )      // 1
3669   PORT_DIPSETTING(      0x0020, DEF_STR( Hard ) )         // 2
3670   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )      // 3
3671   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Allow_Continue ) )
3672   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
3673   PORT_DIPSETTING(      0x0040, DEF_STR( On ) )
3674   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
3675   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
3676   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
3677
35903678   COINAGE_6BITS
3591   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
3592   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3593   PORT_DIPSETTING(    0x40, DEF_STR( On )  )
3594   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
3595   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3596   PORT_DIPSETTING(    0x80, DEF_STR( On )  )
3597
3598   PORT_START("DSW2")   /* 0x80007.b */
3599   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
3600   PORT_DIPSETTING(    0x03, "2" )
3601   PORT_DIPSETTING(    0x01, "3" )
3602   PORT_DIPSETTING(    0x02, "4" )
3603   PORT_DIPSETTING(    0x00, "Infinite (Cheat)" )
3604   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
3605   PORT_DIPSETTING(    0x0c, "20k" )
3606   PORT_DIPSETTING(    0x04, "30k" )
3607   PORT_DIPSETTING(    0x08, "40k" )
3608   PORT_DIPSETTING(    0x00, "50k" )
3609   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Difficulty ) )   // damage when hit
3610   PORT_DIPSETTING(    0x30, DEF_STR( Easy )    )      // 0
3611   PORT_DIPSETTING(    0x10, DEF_STR( Normal )  )      // 1
3612   PORT_DIPSETTING(    0x20, DEF_STR( Hard )    )      // 2
3613   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )      // 3
3614   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )
3615   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3616   PORT_DIPSETTING(    0x40, DEF_STR( On )  )
3617   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
3618   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3619   PORT_DIPSETTING(    0x00, DEF_STR( On )  )
3679   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) )
3680   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
3681   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
3682   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )
3683   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
3684   PORT_DIPSETTING(      0x8000, DEF_STR( On ) )
36203685INPUT_PORTS_END
36213686
36223687
r3115r3116
40164081GAME( 1990, rodlandj, rodland,  system_A,          rodland,  rodlandj, ROT0,   "Jaleco", "Rod-Land (Japan)", 0 )
40174082GAME( 1990, rodlndjb, rodland,  system_A,          rodland,  0,        ROT0,   "Jaleco", "Rod-Land (Japan bootleg)", 0 )
40184083GAME( 1991, avspirit, 0,        system_B,          avspirit, avspirit, ROT0,   "Jaleco", "Avenging Spirit", 0 )
4019GAME( 1990, phantasm, avspirit, system_A,          avspirit, phantasm, ROT0,   "Jaleco", "Phantasm (Japan)", 0 )
4084GAME( 1990, phantasm, avspirit, system_A,          phantasm, phantasm, ROT0,   "Jaleco", "Phantasm (Japan)", 0 )
40204085GAME( 1990, monkelf,  avspirit, system_B,          avspirit, monkelf,  ROT0,   "bootleg", "Monky Elf (Korean bootleg of Avenging Spirit)", GAME_NOT_WORKING )
40214086GAME( 1991, edf,      0,        system_B,          edf,      edf,      ROT0,   "Jaleco", "E.D.F. : Earth Defense Force", 0 )
40224087GAME( 1991, edfu,     edf,      system_B,          edf,      edf,      ROT0,   "Jaleco", "E.D.F. : Earth Defense Force (North America)", 0 )
src/mame/drivers/dcheese.c
r3115r3116
6262static void update_irq_state(running_machine *machine)
6363{
6464   int i;
65
66   /* loop from high priority to low; if we find a live IRQ, assert it */
67   for (i = 4; i >= 0; i--)
68      if (irq_state[i])
69      {
70         cpunum_set_input_line(machine, 0, i, ASSERT_LINE);
71         return;
72      }
73
74   /* otherwise, clear them all */
75   cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
65   for (i = 1; i < 5; i++)
66      cpunum_set_input_line(machine, 0, i, irq_state[i] ? ASSERT_LINE : CLEAR_LINE);
7667}
7768
7869
src/mame/drivers/cave.c
r3115r3116
493493   AM_RANGE(0x800000, 0x800007) AM_READ(cave_irq_cause_r      )   // IRQ Cause
494494/**/AM_RANGE(0x900000, 0x900005) AM_READ(SMH_RAM            )   // Layer 0 Control
495495/**/AM_RANGE(0xa00000, 0xa00005) AM_READ(SMH_RAM            )   // Layer 1 Control
496   AM_RANGE(0xb00000, 0xb00001) AM_READ_PORT("IN0")            // Inputs
497   AM_RANGE(0xb00002, 0xb00003) AM_READ_PORT("IN1")            // Inputs + EEPROM
496   AM_RANGE(0xb00000, 0xb00001) AM_READ_PORT("IN0"            )   // Inputs
497   AM_RANGE(0xb00002, 0xb00003) AM_READ_PORT("IN1"            )   // Inputs + EEPROM
498498ADDRESS_MAP_END
499499
500500static ADDRESS_MAP_START( dfeveron_writemem, ADDRESS_SPACE_PROGRAM, 16 )
501501   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM                  )   // ROM
502502   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM                  )   // RAM
503503   AM_RANGE(0x300000, 0x300003) AM_WRITE(cave_sound_w               )   // YMZ280
504   AM_RANGE(0x400000, 0x407fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites
504   AM_RANGE(0x400000, 0x407fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   // Sprites
505505   AM_RANGE(0x408000, 0x40ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2)
506506   AM_RANGE(0x500000, 0x507fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0   )   // Layer 0
507507   AM_RANGE(0x600000, 0x607fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1   )   // Layer 1
508508   AM_RANGE(0x708000, 0x708fff) AM_WRITE(SMH_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size)   // Palette
509   AM_RANGE(0x710c00, 0x710fff) AM_WRITE(SMH_RAM                  )   // ?
510   AM_RANGE(0x800000, 0x80007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs   )   // Video Regs
509   AM_RANGE(0x710c00, 0x710fff) AM_WRITE(SMH_RAM                        )   // ?
510   AM_RANGE(0x800000, 0x80007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs      )   // Video Regs
511511   AM_RANGE(0x900000, 0x900005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_0      )   // Layer 0 Control
512512   AM_RANGE(0xa00000, 0xa00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_1      )   // Layer 1 Control
513   AM_RANGE(0xc00000, 0xc00001) AM_WRITE(cave_eeprom_msb_w            )   // EEPROM
513   AM_RANGE(0xc00000, 0xc00001) AM_WRITE(cave_eeprom_msb_w                  )   // EEPROM
514514ADDRESS_MAP_END
515515
516516
r3115r3116
532532/**/AM_RANGE(0xa00000, 0xa00005) AM_READ(SMH_RAM            )   // Layer 1 Control
533533/**/AM_RANGE(0xb00000, 0xb00005) AM_READ(SMH_RAM            )   // Layer 2 Control
534534/**/AM_RANGE(0xc00000, 0xc0ffff) AM_READ(SMH_RAM            )   // Palette
535   AM_RANGE(0xd00000, 0xd00001) AM_READ_PORT("IN0")            // Inputs
536   AM_RANGE(0xd00002, 0xd00003) AM_READ_PORT("IN1")            // Inputs + EEPROM
535   AM_RANGE(0xd00000, 0xd00001) AM_READ_PORT("IN0"            )   // Inputs
536   AM_RANGE(0xd00002, 0xd00003) AM_READ_PORT("IN1"            )   // Inputs + EEPROM
537537ADDRESS_MAP_END
538538
539539static ADDRESS_MAP_START( ddonpach_writemem, ADDRESS_SPACE_PROGRAM, 16 )
540540   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM                     )   // ROM
541541   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM                     )   // RAM
542542   AM_RANGE(0x300000, 0x300003) AM_WRITE(cave_sound_w                  )   // YMZ280
543   AM_RANGE(0x400000, 0x407fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites
544   AM_RANGE(0x408000, 0x40ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2)
545   AM_RANGE(0x500000, 0x507fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0   )   // Layer 0
546   AM_RANGE(0x600000, 0x607fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1   )   // Layer 1
543   AM_RANGE(0x400000, 0x407fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   // Sprites
544   AM_RANGE(0x408000, 0x40ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2      )
545   AM_RANGE(0x500000, 0x507fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0      )   // Layer 0
546   AM_RANGE(0x600000, 0x607fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1      )   // Layer 1
547547   AM_RANGE(0x700000, 0x70ffff) AM_WRITE(cave_vram_2_8x8_w) AM_BASE(&cave_vram_2   )   // Layer 2
548   AM_RANGE(0x800000, 0x80007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs      )   // Video Regs
548   AM_RANGE(0x800000, 0x80007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs         )   // Video Regs
549549   AM_RANGE(0x900000, 0x900005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_0         )   // Layer 0 Control
550550   AM_RANGE(0xa00000, 0xa00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_1         )   // Layer 1 Control
551551   AM_RANGE(0xb00000, 0xb00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_2         )   // Layer 2 Control
552552   AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(SMH_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size)   // Palette
553   AM_RANGE(0xe00000, 0xe00001) AM_WRITE(cave_eeprom_msb_w               )   // EEPROM
553   AM_RANGE(0xe00000, 0xe00001) AM_WRITE(cave_eeprom_msb_w                     )   // EEPROM
554554ADDRESS_MAP_END
555555
556556
r3115r3116
598598/**/AM_RANGE(0xa08000, 0xa08fff) AM_READ(SMH_RAM               )   // Palette
599599   AM_RANGE(0xb00000, 0xb00001) AM_READ(okim6295_status_0_lsb_r   )   // M6295
600600   AM_RANGE(0xb00010, 0xb00011) AM_READ(okim6295_status_1_lsb_r   )   //
601   AM_RANGE(0xc00000, 0xc00001) AM_READ_PORT("IN0")               // Inputs
602   AM_RANGE(0xc00002, 0xc00003) AM_READ_PORT("IN1")               // Inputs + EEPROM
601   AM_RANGE(0xc00000, 0xc00001) AM_READ_PORT("IN0"               )   // Inputs
602   AM_RANGE(0xc00002, 0xc00003) AM_READ_PORT("IN1"               )   // Inputs + EEPROM
603603ADDRESS_MAP_END
604604
605605static ADDRESS_MAP_START( donpachi_writemem, ADDRESS_SPACE_PROGRAM, 16 )
606606   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM                     )   // ROM
607607   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM                     )   // RAM
608   AM_RANGE(0x200000, 0x207fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1   )   // Layer 1
609   AM_RANGE(0x300000, 0x307fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0   )   // Layer 0
608   AM_RANGE(0x200000, 0x207fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1      )   // Layer 1
609   AM_RANGE(0x300000, 0x307fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0      )   // Layer 0
610610   AM_RANGE(0x400000, 0x407fff) AM_WRITE(cave_vram_2_8x8_w) AM_BASE(&cave_vram_2   )   // Layer 2
611611   AM_RANGE(0x500000, 0x507fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites
612   AM_RANGE(0x508000, 0x50ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2)
612   AM_RANGE(0x508000, 0x50ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2      )
613613   AM_RANGE(0x600000, 0x600005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_1         )   // Layer 1 Control
614614   AM_RANGE(0x700000, 0x700005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_0         )   // Layer 0 Control
615615   AM_RANGE(0x800000, 0x800005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_2         )   // Layer 2 Control
616   AM_RANGE(0x900000, 0x90007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs      )   // Video Regs
616   AM_RANGE(0x900000, 0x90007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs         )   // Video Regs
617617   AM_RANGE(0xa08000, 0xa08fff) AM_WRITE(SMH_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size)   // Palette
618618   AM_RANGE(0xb00000, 0xb00003) AM_WRITE(okim6295_data_0_lsb_w            )   // M6295
619619   AM_RANGE(0xb00010, 0xb00013) AM_WRITE(okim6295_data_1_lsb_w            )   //
r3115r3116
640640/**/AM_RANGE(0xa00000, 0xa00005) AM_READ(SMH_RAM            )   // Layer 1 Control
641641/**/AM_RANGE(0xb00000, 0xb00005) AM_READ(SMH_RAM            )   // Layer 2 Control
642642/**/AM_RANGE(0xc00000, 0xc0ffff) AM_READ(SMH_RAM            )   // Palette
643   AM_RANGE(0xd00000, 0xd00001) AM_READ_PORT("IN0")            // Inputs
644   AM_RANGE(0xd00002, 0xd00003) AM_READ_PORT("IN1")            // Inputs + EEPROM
643   AM_RANGE(0xd00000, 0xd00001) AM_READ_PORT("IN0"            )   // Inputs
644   AM_RANGE(0xd00002, 0xd00003) AM_READ_PORT("IN1"            )   // Inputs + EEPROM
645645ADDRESS_MAP_END
646646
647647static ADDRESS_MAP_START( esprade_writemem, ADDRESS_SPACE_PROGRAM, 16 )
648648   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM                  )   // ROM
649649   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM                  )   // RAM
650650   AM_RANGE(0x300000, 0x300003) AM_WRITE(cave_sound_w               )   // YMZ280
651   AM_RANGE(0x400000, 0x407fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites
651   AM_RANGE(0x400000, 0x407fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   // Sprites
652652   AM_RANGE(0x408000, 0x40ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2)   // Sprites?
653653   AM_RANGE(0x500000, 0x507fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0   )   // Layer 0
654654   AM_RANGE(0x600000, 0x607fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1   )   // Layer 1
655655   AM_RANGE(0x700000, 0x707fff) AM_WRITE(cave_vram_2_w) AM_BASE(&cave_vram_2   )   // Layer 2
656   AM_RANGE(0x800000, 0x80007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs   )   // Video Regs
656   AM_RANGE(0x800000, 0x80007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs      )   // Video Regs
657657   AM_RANGE(0x900000, 0x900005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_0      )   // Layer 0 Control
658658   AM_RANGE(0xa00000, 0xa00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_1      )   // Layer 1 Control
659659   AM_RANGE(0xb00000, 0xb00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_2      )   // Layer 2 Control
r3115r3116
683683/**/AM_RANGE(0xa00000, 0xa00005) AM_READ(SMH_RAM            )   // Layer 1 Control
684684/**/AM_RANGE(0xb00000, 0xb00005) AM_READ(SMH_RAM            )   // Layer 2 Control
685685   AM_RANGE(0xc00000, 0xc0ffff) AM_READ(SMH_RAM            )   // Palette
686   AM_RANGE(0xd00010, 0xd00011) AM_READ_PORT("IN0")            // Inputs
687   AM_RANGE(0xd00012, 0xd00013) AM_READ_PORT("IN1")            // Inputs
688   AM_RANGE(0xd00014, 0xd00015) AM_READ_PORT("DSW")            // Dips
686   AM_RANGE(0xd00010, 0xd00011) AM_READ_PORT("IN0"            )   // Inputs
687   AM_RANGE(0xd00012, 0xd00013) AM_READ_PORT("IN1"            )   // Inputs
688   AM_RANGE(0xd00014, 0xd00015) AM_READ_PORT("DSW"            )   // Dips
689689ADDRESS_MAP_END
690690
691691static ADDRESS_MAP_START( gaia_writemem, ADDRESS_SPACE_PROGRAM, 16 )
r3115r3116
693693   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM                  )   // RAM
694694   AM_RANGE(0x300000, 0x300003) AM_WRITE(cave_sound_w               )   // YMZ280
695695   AM_RANGE(0x400000, 0x407fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprite bank 1
696   AM_RANGE(0x408000, 0x40ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2) // Sprite bank 2
696   AM_RANGE(0x408000, 0x40ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2   )   // Sprite bank 2
697697   AM_RANGE(0x500000, 0x507fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0   )   // Layer 0
698   AM_RANGE(0x508000, 0x50ffff) AM_WRITE(SMH_RAM                  )   // More Layer 0, Tested but not used?
698   AM_RANGE(0x508000, 0x50ffff) AM_WRITE(SMH_RAM                        )   // More Layer 0, Tested but not used?
699699   AM_RANGE(0x600000, 0x607fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1   )   // Layer 1
700   AM_RANGE(0x608000, 0x60ffff) AM_WRITE(SMH_RAM                  )   // More Layer 1, Tested but not used?
700   AM_RANGE(0x608000, 0x60ffff) AM_WRITE(SMH_RAM                        )   // More Layer 1, Tested but not used?
701701   AM_RANGE(0x700000, 0x707fff) AM_WRITE(cave_vram_2_w) AM_BASE(&cave_vram_2   )   // Layer 2
702   AM_RANGE(0x708000, 0x70ffff) AM_WRITE(SMH_RAM                  )   // More Layer 2, Tested but not used?
703   AM_RANGE(0x800000, 0x80007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs   )   // Video Regs
702   AM_RANGE(0x708000, 0x70ffff) AM_WRITE(SMH_RAM                        )   // More Layer 2, Tested but not used?
703   AM_RANGE(0x800000, 0x80007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs      )   // Video Regs
704704   AM_RANGE(0x900000, 0x900005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_0      )   // Layer 0 Control
705705   AM_RANGE(0xa00000, 0xa00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_1      )   // Layer 1 Control
706706   AM_RANGE(0xb00000, 0xb00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_2      )   // Layer 2 Control
r3115r3116
728728/**/AM_RANGE(0xa00000, 0xa00005) AM_READ(SMH_RAM            )   // Layer 1 Control
729729/**/AM_RANGE(0xb00000, 0xb00005) AM_READ(SMH_RAM            )   // Layer 2 Control
730730/**/AM_RANGE(0xc00000, 0xc0ffff) AM_READ(SMH_RAM            )   // Palette
731   AM_RANGE(0xd00010, 0xd00011) AM_READ_PORT("IN0")            // Inputs
732   AM_RANGE(0xd00012, 0xd00013) AM_READ_PORT("IN1")            // Inputs + EEPROM
731   AM_RANGE(0xd00010, 0xd00011) AM_READ_PORT("IN0"            )   // Inputs
732   AM_RANGE(0xd00012, 0xd00013) AM_READ_PORT("IN1"            )   // Inputs + EEPROM
733733ADDRESS_MAP_END
734734
735735static ADDRESS_MAP_START( guwange_writemem, ADDRESS_SPACE_PROGRAM, 16 )
736736   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM                  )   // ROM
737737   AM_RANGE(0x200000, 0x20ffff) AM_WRITE(SMH_RAM                  )   // RAM
738   AM_RANGE(0x300000, 0x30007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs   )   // Video Regs
739   AM_RANGE(0x400000, 0x407fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites
740   AM_RANGE(0x408000, 0x40ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2)
738   AM_RANGE(0x300000, 0x30007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs      )   // Video Regs
739   AM_RANGE(0x400000, 0x407fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   // Sprites
740   AM_RANGE(0x408000, 0x40ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2   )
741741   AM_RANGE(0x500000, 0x507fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0   )   // Layer 0
742742   AM_RANGE(0x600000, 0x607fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1   )   // Layer 1
743743   AM_RANGE(0x700000, 0x707fff) AM_WRITE(cave_vram_2_w) AM_BASE(&cave_vram_2   )   // Layer 2
744   AM_RANGE(0x800000, 0x800003) AM_WRITE(cave_sound_w               )   // YMZ280
744   AM_RANGE(0x800000, 0x800003) AM_WRITE(cave_sound_w                     )   // YMZ280
745745   AM_RANGE(0x900000, 0x900005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_0      )   // Layer 0 Control
746746   AM_RANGE(0xa00000, 0xa00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_1      )   // Layer 1 Control
747747   AM_RANGE(0xb00000, 0xb00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_2      )   // Layer 2 Control
748748   AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(SMH_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size)   // Palette
749749   AM_RANGE(0xd00010, 0xd00011) AM_WRITE(cave_eeprom_lsb_w            )   // EEPROM
750//  AM_RANGE(0xd00012, 0xd00013) AM_WRITE(SMH_NOP             )   // ?
751//  AM_RANGE(0xd00014, 0xd00015) AM_WRITE(SMH_NOP             )   // ? $800068 in dfeveron ? probably Watchdog
750//  AM_RANGE(0xd00012, 0xd00013) AM_WRITE(SMH_NOP                       )   // ?
751//  AM_RANGE(0xd00014, 0xd00015) AM_WRITE(SMH_NOP                       )   // ? $800068 in dfeveron ? probably Watchdog
752752ADDRESS_MAP_END
753753
754754
r3115r3116
768768/**/AM_RANGE(0xb00000, 0xb00005) AM_READ(SMH_RAM            )   // Layer 0 Control
769769/**/AM_RANGE(0xb80000, 0xb80005) AM_READ(SMH_RAM            )   // Layer 1 Control
770770/**/AM_RANGE(0xc00000, 0xc00005) AM_READ(SMH_RAM            )   // Layer 2 Control
771   AM_RANGE(0xc80000, 0xc80001) AM_READ_PORT("IN0")            // Inputs
772   AM_RANGE(0xc80002, 0xc80003) AM_READ_PORT("IN1")            // Inputs + EEPROM
771   AM_RANGE(0xc80000, 0xc80001) AM_READ_PORT("IN0"            )   // Inputs
772   AM_RANGE(0xc80002, 0xc80003) AM_READ_PORT("IN1"            )   // Inputs + EEPROM
773773/**/AM_RANGE(0xf00000, 0xf07fff) AM_READ(SMH_RAM            )   // Sprites
774774/**/AM_RANGE(0xf08000, 0xf0ffff) AM_READ(SMH_RAM            )   // Sprites?
775775ADDRESS_MAP_END
r3115r3116
781781   AM_RANGE(0x880000, 0x887fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0   )   // Layer 0
782782   AM_RANGE(0x900000, 0x907fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1   )   // Layer 1
783783   AM_RANGE(0x980000, 0x987fff) AM_WRITE(cave_vram_2_w) AM_BASE(&cave_vram_2   )   // Layer 2
784   AM_RANGE(0xa8006e, 0xa8006f) AM_WRITE(sound_cmd_w               )   // To Sound CPU
785   AM_RANGE(0xa80000, 0xa8007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs   )   // Video Regs
784   AM_RANGE(0xa8006e, 0xa8006f) AM_WRITE(sound_cmd_w                     )   // To Sound CPU
785   AM_RANGE(0xa80000, 0xa8007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs      )   // Video Regs
786786   AM_RANGE(0xb00000, 0xb00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_0      )   // Layer 0 Control
787787   AM_RANGE(0xb80000, 0xb80005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_1      )   // Layer 1 Control
788788   AM_RANGE(0xc00000, 0xc00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_2      )   // Layer 2 Control
789   AM_RANGE(0xd00000, 0xd00001) AM_WRITE(hotdogst_eeprom_msb_w         )   // EEPROM
790   AM_RANGE(0xd00002, 0xd00003) AM_WRITE(SMH_NOP                  )   // ???
791   AM_RANGE(0xf00000, 0xf07fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites
789   AM_RANGE(0xd00000, 0xd00001) AM_WRITE(hotdogst_eeprom_msb_w               )   // EEPROM
790   AM_RANGE(0xd00002, 0xd00003) AM_WRITE(SMH_NOP                        )   // ???
791   AM_RANGE(0xf00000, 0xf07fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   // Sprites
792792   AM_RANGE(0xf08000, 0xf0ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2)
793793ADDRESS_MAP_END
794794
r3115r3116
868868   AM_RANGE(0x1c0000, 0x1c0007) AM_READ( cave_irq_cause_r      )   // IRQ Cause
869869//  AM_RANGE(0x200000, 0x207fff) AM_READ( SMH_RAM               )   // Palette
870870//  AM_RANGE(0x240000, 0x240003) AM_READ( cave_sound_r          )   // YMZ280
871   AM_RANGE(0x280000, 0x280001) AM_READ_PORT("IN0")            // Inputs + ???
872   AM_RANGE(0x280002, 0x280003) AM_READ_PORT("IN1")            // Inputs + EEPROM
871   AM_RANGE(0x280000, 0x280001) AM_READ_PORT("IN0"            )   // Inputs + ???
872   AM_RANGE(0x280002, 0x280003) AM_READ_PORT("IN1"            )   // Inputs + EEPROM
873873   AM_RANGE(0x300000, 0x30ffff) AM_READ( SMH_RAM            )   // RAM
874874ADDRESS_MAP_END
875875
876876static ADDRESS_MAP_START( korokoro_writemem, ADDRESS_SPACE_PROGRAM, 16 )
877877   AM_RANGE(0x000000, 0x07ffff) AM_WRITE( SMH_ROM            )   // ROM
878   AM_RANGE(0x100000, 0x107fff) AM_WRITE( cave_vram_0_w         ) AM_BASE( &cave_vram_0      )   // Layer 0
878   AM_RANGE(0x100000, 0x107fff) AM_WRITE( cave_vram_0_w      ) AM_BASE( &cave_vram_0      )   // Layer 0
879879   AM_RANGE(0x140000, 0x140005) AM_WRITE( SMH_RAM            ) AM_BASE( &cave_vctrl_0   )   // Layer 0 Control
880880   AM_RANGE(0x180000, 0x187fff) AM_WRITE( SMH_RAM            ) AM_BASE( &spriteram16      ) AM_SIZE(&spriteram_size   )   // Sprites
881881   AM_RANGE(0x1c0000, 0x1c007f) AM_WRITE( SMH_RAM            ) AM_BASE( &cave_videoregs   )   // Video Regs
r3115r3116
883883   AM_RANGE(0x240000, 0x240003) AM_WRITE( cave_sound_w            )   // YMZ280
884884   AM_RANGE(0x280008, 0x280009) AM_WRITE( korokoro_leds_w         )
885885   AM_RANGE(0x28000a, 0x28000b) AM_WRITE( korokoro_eeprom_msb_w   )   // EEPROM
886   AM_RANGE(0x28000c, 0x28000d) AM_WRITE( SMH_NOP            )   // 0 (watchdog?)
887   AM_RANGE(0x300000, 0x30ffff) AM_WRITE( SMH_RAM            )   // RAM
886   AM_RANGE(0x28000c, 0x28000d) AM_WRITE( SMH_NOP               )   // 0 (watchdog?)
887   AM_RANGE(0x300000, 0x30ffff) AM_WRITE( SMH_RAM               )   // RAM
888888ADDRESS_MAP_END
889889
890890
r3115r3116
903903/**/AM_RANGE(0x504000, 0x507fff) AM_READ(SMH_RAM            )   // Layer 0
904904/**/AM_RANGE(0x600000, 0x600005) AM_READ(SMH_RAM            )   // Layer 1 Control
905905/**/AM_RANGE(0x700000, 0x700005) AM_READ(SMH_RAM            )   // Layer 0 Control
906   AM_RANGE(0x800000, 0x800001) AM_READ_PORT("IN0")            // Inputs
907   AM_RANGE(0x800002, 0x800003) AM_READ_PORT("IN1")            // Inputs + EEPROM
906   AM_RANGE(0x800000, 0x800001) AM_READ_PORT("IN0"            )   // Inputs
907   AM_RANGE(0x800002, 0x800003) AM_READ_PORT("IN1"            )   // Inputs + EEPROM
908908/**/AM_RANGE(0xc08000, 0xc0ffff) AM_READ(SMH_RAM            )   // Palette
909909   AM_RANGE(0xd00000, 0xd7ffff) AM_READ(SMH_BANK1            )   // ROM
910910ADDRESS_MAP_END
r3115r3116
912912static ADDRESS_MAP_START( mazinger_writemem, ADDRESS_SPACE_PROGRAM, 16 )
913913   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM                     )   // ROM
914914   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM                     )   // RAM
915   AM_RANGE(0x200000, 0x207fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites
915   AM_RANGE(0x200000, 0x207fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   // Sprites
916916   AM_RANGE(0x208000, 0x20ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2)
917917   AM_RANGE(0x300068, 0x300069) AM_WRITE(watchdog_reset16_w            )   // Watchdog
918918   AM_RANGE(0x30006e, 0x30006f) AM_WRITE(sound_cmd_w                  )   // To Sound CPU
919   AM_RANGE(0x300000, 0x30007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs      )   // Video Regs
919   AM_RANGE(0x300000, 0x30007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs   )   // Video Regs
920920   AM_RANGE(0x400000, 0x407fff) AM_WRITE(cave_vram_1_8x8_w) AM_BASE(&cave_vram_1   )   // Layer 1
921921   AM_RANGE(0x500000, 0x507fff) AM_WRITE(cave_vram_0_8x8_w) AM_BASE(&cave_vram_0   )   // Layer 0
922922   AM_RANGE(0x600000, 0x600005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_1         )   // Layer 1 Control
r3115r3116
949949/**/AM_RANGE(0xb00000, 0xb00005) AM_READ(SMH_RAM            )   // Layer 0 Control
950950/**/AM_RANGE(0xb80000, 0xb80005) AM_READ(SMH_RAM            )   // Layer 1 Control
951951/**/AM_RANGE(0xc00000, 0xc00005) AM_READ(SMH_RAM            )   // Layer 2 Control
952   AM_RANGE(0xc80000, 0xc80001) AM_READ_PORT("IN0")            // Inputs
953   AM_RANGE(0xc80002, 0xc80003) AM_READ_PORT("IN1")            // Inputs + EEPROM
952   AM_RANGE(0xc80000, 0xc80001) AM_READ_PORT("IN0"            )   // Inputs
953   AM_RANGE(0xc80002, 0xc80003) AM_READ_PORT("IN1"            )   // Inputs + EEPROM
954954   AM_RANGE(0xf00000, 0xf07fff) AM_READ(SMH_RAM            )   // Sprites
955955   AM_RANGE(0xf08000, 0xf0ffff) AM_READ(SMH_RAM            )   // RAM
956956ADDRESS_MAP_END
r3115r3116
961961   AM_RANGE(0x200000, 0x27ffff) AM_WRITE(SMH_ROM                  )   // ROM
962962   AM_RANGE(0x408000, 0x408fff) AM_WRITE(SMH_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size)   // Palette
963963   AM_RANGE(0x880000, 0x887fff) AM_WRITE(cave_vram_2_w) AM_BASE(&cave_vram_2   )   // Layer 2
964   AM_RANGE(0x888000, 0x88ffff) AM_WRITE(SMH_RAM                  )   //
964   AM_RANGE(0x888000, 0x88ffff) AM_WRITE(SMH_RAM                        )   //
965965   AM_RANGE(0x900000, 0x907fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1   )   // Layer 1
966   AM_RANGE(0x908000, 0x90ffff) AM_WRITE(SMH_RAM                  )   //
966   AM_RANGE(0x908000, 0x90ffff) AM_WRITE(SMH_RAM                        )   //
967967   AM_RANGE(0x980000, 0x987fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0   )   // Layer 0
968   AM_RANGE(0x988000, 0x98ffff) AM_WRITE(SMH_RAM                  )   //
969   AM_RANGE(0xa80068, 0xa80069) AM_WRITE(watchdog_reset16_w         )   // Watchdog?
970   AM_RANGE(0xa8006c, 0xa8006d) AM_WRITE(SMH_NOP                  )   // ?
971   AM_RANGE(0xa8006e, 0xa8006f) AM_WRITE(sound_cmd_w               )   // To Sound CPU
972   AM_RANGE(0xa80000, 0xa8007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs   )   // Video Regs
968   AM_RANGE(0x988000, 0x98ffff) AM_WRITE(SMH_RAM                        )   //
969   AM_RANGE(0xa80068, 0xa80069) AM_WRITE(watchdog_reset16_w               )   // Watchdog?
970   AM_RANGE(0xa8006c, 0xa8006d) AM_WRITE(SMH_NOP                        )   // ?
971   AM_RANGE(0xa8006e, 0xa8006f) AM_WRITE(sound_cmd_w                     )   // To Sound CPU
972   AM_RANGE(0xa80000, 0xa8007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs      )   // Video Regs
973973   AM_RANGE(0xb00000, 0xb00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_2      )   // Layer 2 Control
974974   AM_RANGE(0xb80000, 0xb80005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_1      )   // Layer 1 Control
975975   AM_RANGE(0xc00000, 0xc00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_0      )   // Layer 0 Control
976   AM_RANGE(0xd00000, 0xd00001) AM_WRITE(metmqstr_eeprom_msb_w         )   // EEPROM
977   AM_RANGE(0xf00000, 0xf07fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites
976   AM_RANGE(0xd00000, 0xd00001) AM_WRITE(metmqstr_eeprom_msb_w               )   // EEPROM
977   AM_RANGE(0xf00000, 0xf07fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   // Sprites
978978   AM_RANGE(0xf08000, 0xf0ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2)
979979ADDRESS_MAP_END
980980
r3115r3116
10111011static ADDRESS_MAP_START( pwrinst2_readmem, ADDRESS_SPACE_PROGRAM, 16 )
10121012   AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM               )   // ROM
10131013   AM_RANGE(0x400000, 0x40ffff) AM_READ(SMH_RAM               )   // RAM
1014   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("IN0")               // Inputs
1015   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("IN1")               //
1014   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("IN0"               )   // Inputs
1015   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("IN1"               )   //
10161016   AM_RANGE(0x600000, 0x6fffff) AM_READ(SMH_ROM) AM_REGION("user1", 0)   // extra data ROM space
10171017   AM_RANGE(0x800000, 0x807fff) AM_READ(SMH_RAM               )   // Layer 2
10181018   AM_RANGE(0x880000, 0x887fff) AM_READ(SMH_RAM               )   // Layer 0
r3115r3116
10261026/**/AM_RANGE(0xc00000, 0xc00005) AM_READ(SMH_RAM               )   // Layer 1 Control
10271027/**/AM_RANGE(0xc80000, 0xc80005) AM_READ(SMH_RAM               )   // Layer 3 Control
10281028   AM_RANGE(0xa80000, 0xa8007f) AM_READ(donpachi_videoregs_r      )   // Video Regs
1029   AM_RANGE(0xd80000, 0xd80001) AM_READ(SMH_NOP               )   // ? From Sound CPU
1029   AM_RANGE(0xd80000, 0xd80001) AM_READ(soundlatch_ack_r         )   // ? From Sound CPU
10301030   AM_RANGE(0xe80000, 0xe80001) AM_READ(pwrinst2_eeprom_r         )   // EEPROM
10311031   AM_RANGE(0xf00000, 0xf04fff) AM_READ(SMH_RAM               )   // Palette
10321032ADDRESS_MAP_END
10331033
10341034static ADDRESS_MAP_START( pwrinst2_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1035   AM_RANGE(0x000000, 0x1fffff) AM_WRITE(SMH_ROM                     )   // ROM
1036   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SMH_RAM                     )   // RAM
1037   AM_RANGE(0x700000, 0x700001) AM_WRITE(cave_eeprom_msb_w               )   // EEPROM
1035   AM_RANGE(0x000000, 0x1fffff) AM_WRITE(SMH_ROM                        )   // ROM
1036   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SMH_RAM                        )   // RAM
1037   AM_RANGE(0x700000, 0x700001) AM_WRITE(cave_eeprom_msb_w                  )   // EEPROM
10381038   AM_RANGE(0x800000, 0x807fff) AM_WRITE(cave_vram_2_w) AM_BASE(&cave_vram_2   )   // Layer 2
10391039   AM_RANGE(0x880000, 0x887fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0   )   // Layer 0
10401040   AM_RANGE(0x900000, 0x907fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1   )   // Layer 1
1041   AM_RANGE(0x980000, 0x987fff) AM_WRITE(cave_vram_3_8x8_w) AM_BASE(&cave_vram_3   )   // Layer 3
1041   AM_RANGE(0x980000, 0x987fff) AM_WRITE(cave_vram_3_8x8_w) AM_BASE(&cave_vram_3)   // Layer 3
10421042   AM_RANGE(0xa00000, 0xa07fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites
10431043   AM_RANGE(0xa08000, 0xa0ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2)
1044   AM_RANGE(0xa10000, 0xa1ffff) AM_WRITE(SMH_RAM                     )   // Sprites?
1044   AM_RANGE(0xa10000, 0xa1ffff) AM_WRITE(SMH_RAM                        )   // Sprites?
10451045   AM_RANGE(0xa80000, 0xa8007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs      )   // Video Regs
10461046   AM_RANGE(0xb00000, 0xb00005) AM_WRITE(pwrinst2_vctrl_2_w) AM_BASE(&cave_vctrl_2         )   // Layer 2 Control
10471047   AM_RANGE(0xb80000, 0xb80005) AM_WRITE(pwrinst2_vctrl_0_w) AM_BASE(&cave_vctrl_0         )   // Layer 0 Control
10481048   AM_RANGE(0xc00000, 0xc00005) AM_WRITE(pwrinst2_vctrl_1_w) AM_BASE(&cave_vctrl_1         )   // Layer 1 Control
10491049   AM_RANGE(0xc80000, 0xc80005) AM_WRITE(pwrinst2_vctrl_3_w) AM_BASE(&cave_vctrl_3         )   // Layer 3 Control
1050   AM_RANGE(0xe00000, 0xe00001) AM_WRITE(sound_cmd_w                  )   // To Sound CPU
1050   AM_RANGE(0xe00000, 0xe00001) AM_WRITE(sound_cmd_w                     )   // To Sound CPU
10511051   AM_RANGE(0xf00000, 0xf04fff) AM_WRITE(SMH_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size)   // Palette
10521052ADDRESS_MAP_END
10531053
r3115r3116
10891089   AM_RANGE(0x508000, 0x50ffff) AM_READ(SMH_RAM            )   // Sprites?
10901090   AM_RANGE(0x510000, 0x510001) AM_READ(SMH_RAM            )   // (agallet)
10911091   AM_RANGE(0x600000, 0x600001) AM_READ(sailormn_input0_r      )   // Inputs + Watchdog!
1092   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("IN1")            // Inputs + EEPROM
1092   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("IN1"            )   // Inputs + EEPROM
10931093   AM_RANGE(0x800000, 0x887fff) AM_READ(SMH_RAM            )   // Layer 0
10941094   AM_RANGE(0x880000, 0x887fff) AM_READ(SMH_RAM            )   // Layer 1
10951095   AM_RANGE(0x900000, 0x907fff) AM_READ(SMH_RAM            )   // Layer 2
r3115r3116
11031103ADDRESS_MAP_END
11041104
11051105static ADDRESS_MAP_START( sailormn_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1106   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM                     )   // ROM
1107   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM                     )   // RAM
1108   AM_RANGE(0x110000, 0x110001) AM_WRITE(SMH_RAM                     )   // (agallet)
1109   AM_RANGE(0x200000, 0x3fffff) AM_WRITE(SMH_ROM                     )   // ROM
1110   AM_RANGE(0x400000, 0x407fff) AM_WRITE(SMH_RAM                     )   // (agallet)
1106   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM                        )   // ROM
1107   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM                        )   // RAM
1108   AM_RANGE(0x110000, 0x110001) AM_WRITE(SMH_RAM                        )   // (agallet)
1109   AM_RANGE(0x200000, 0x3fffff) AM_WRITE(SMH_ROM                        )   // ROM
1110   AM_RANGE(0x400000, 0x407fff) AM_WRITE(SMH_RAM                        )   // (agallet)
11111111   AM_RANGE(0x408000, 0x40bfff) AM_WRITE(SMH_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size)   // Palette
1112   AM_RANGE(0x40c000, 0x40ffff) AM_WRITE(SMH_RAM                     )   // (agallet)
1113   AM_RANGE(0x410000, 0x410001) AM_WRITE(SMH_RAM                     )   // (agallet)
1114   AM_RANGE(0x500000, 0x507fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites
1112   AM_RANGE(0x40c000, 0x40ffff) AM_WRITE(SMH_RAM                        )   // (agallet)
1113   AM_RANGE(0x410000, 0x410001) AM_WRITE(SMH_RAM                        )   // (agallet)
1114   AM_RANGE(0x500000, 0x507fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   // Sprites
11151115   AM_RANGE(0x508000, 0x50ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2)
1116   AM_RANGE(0x510000, 0x510001) AM_WRITE(SMH_RAM                     )   // (agallet)
1117   AM_RANGE(0x700000, 0x700001) AM_WRITE(sailormn_eeprom_msb_w            )   // EEPROM
1118   AM_RANGE(0x800000, 0x807fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0      )   // Layer 0
1119   AM_RANGE(0x880000, 0x887fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1      )   // Layer 1
1120   AM_RANGE(0x900000, 0x907fff) AM_WRITE(cave_vram_2_w) AM_BASE(&cave_vram_2      )   // Layer 2
1121   AM_RANGE(0x908000, 0x908001) AM_WRITE(SMH_RAM                     )   // (agallet)
1122   AM_RANGE(0xa00000, 0xa00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_0         )   // Layer 0 Control
1123   AM_RANGE(0xa80000, 0xa80005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_1         )   // Layer 1 Control
1124   AM_RANGE(0xb00000, 0xb00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_2         )   // Layer 2 Control
1125   AM_RANGE(0xb8006e, 0xb8006f) AM_WRITE(sound_cmd_w                  )   // To Sound CPU
1116   AM_RANGE(0x510000, 0x510001) AM_WRITE(SMH_RAM                        )   // (agallet)
1117   AM_RANGE(0x700000, 0x700001) AM_WRITE(sailormn_eeprom_msb_w               )   // EEPROM
1118   AM_RANGE(0x800000, 0x807fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0   )   // Layer 0
1119   AM_RANGE(0x880000, 0x887fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1   )   // Layer 1
1120   AM_RANGE(0x900000, 0x907fff) AM_WRITE(cave_vram_2_w) AM_BASE(&cave_vram_2   )   // Layer 2
1121   AM_RANGE(0x908000, 0x908001) AM_WRITE(SMH_RAM                        )   // (agallet)
1122   AM_RANGE(0xa00000, 0xa00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_0      )   // Layer 0 Control
1123   AM_RANGE(0xa80000, 0xa80005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_1      )   // Layer 1 Control
1124   AM_RANGE(0xb00000, 0xb00005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_2      )   // Layer 2 Control
1125   AM_RANGE(0xb8006e, 0xb8006f) AM_WRITE(sound_cmd_w                     )   // To Sound CPU
11261126   AM_RANGE(0xb80000, 0xb8007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs      )   // Video Regs
11271127ADDRESS_MAP_END
11281128
r3115r3116
11411141   AM_RANGE(0x600000, 0x600007) AM_READ(cave_irq_cause_r      )   // IRQ Cause
11421142/**/AM_RANGE(0x700000, 0x700005) AM_READ(SMH_RAM            )   // Layer 0 Control
11431143/**/AM_RANGE(0x800000, 0x80ffff) AM_READ(SMH_RAM            )   // Palette
1144   AM_RANGE(0x900000, 0x900001) AM_READ_PORT("IN0")            // Inputs
1145   AM_RANGE(0x900002, 0x900003) AM_READ_PORT("IN1")            // Inputs + EEPROM
1144   AM_RANGE(0x900000, 0x900001) AM_READ_PORT("IN0"            )   // Inputs
1145   AM_RANGE(0x900002, 0x900003) AM_READ_PORT("IN1"            )   // Inputs + EEPROM
11461146ADDRESS_MAP_END
11471147
11481148static ADDRESS_MAP_START( uopoko_writemem, ADDRESS_SPACE_PROGRAM, 16 )
11491149   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM                  )   // ROM
11501150   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM                  )   // RAM
11511151   AM_RANGE(0x300000, 0x300003) AM_WRITE(cave_sound_w               )   // YMZ280
1152   AM_RANGE(0x400000, 0x407fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites
1153   AM_RANGE(0x408000, 0x40ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2)
1152   AM_RANGE(0x400000, 0x407fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   // Sprites
1153   AM_RANGE(0x408000, 0x40ffff) AM_WRITE(SMH_RAM) AM_BASE(&cave_spriteram16_2   )
11541154   AM_RANGE(0x500000, 0x507fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0   )   // Layer 0
1155   AM_RANGE(0x600000, 0x60007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs   )   // Video Regs
1155   AM_RANGE(0x600000, 0x60007f) AM_WRITE(SMH_RAM) AM_BASE(&cave_videoregs      )   // Video Regs
11561156   AM_RANGE(0x700000, 0x700005) AM_WRITE(SMH_RAM) AM_BASE(&cave_vctrl_0      )   // Layer 0 Control
11571157   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(SMH_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size)   // Palette
11581158   AM_RANGE(0xa00000, 0xa00001) AM_WRITE(cave_eeprom_msb_w            )   // EEPROM
r3115r3116
12061206   ADDRESS_MAP_GLOBAL_MASK(0xff)
12071207   AM_RANGE(0x30, 0x30) AM_READ(soundlatch_lo_r         )   // From Main CPU
12081208   AM_RANGE(0x40, 0x40) AM_READ(soundlatch_hi_r         )   //
1209   AM_RANGE(0x50, 0x50) AM_READ(ym2203_status_port_0_r   )   // YM2203
1209   AM_RANGE(0x50, 0x50) AM_READ(ym2203_status_port_0_r      )   // YM2203
12101210   AM_RANGE(0x51, 0x51) AM_READ(ym2203_read_port_0_r      )   //
12111211   AM_RANGE(0x60, 0x60) AM_READ(okim6295_status_0_r      )   // M6295
12121212ADDRESS_MAP_END
r3115r3116
12511251static ADDRESS_MAP_START( mazinger_sound_readport, ADDRESS_SPACE_IO, 8 )
12521252   ADDRESS_MAP_GLOBAL_MASK(0xff)
12531253   AM_RANGE(0x30, 0x30) AM_READ(soundlatch_lo_r         )   // From Main CPU
1254   AM_RANGE(0x52, 0x52) AM_READ(ym2203_status_port_0_r   )   // YM2203
1254   AM_RANGE(0x52, 0x52) AM_READ(ym2203_status_port_0_r      )   // YM2203
12551255ADDRESS_MAP_END
12561256
12571257static ADDRESS_MAP_START( mazinger_sound_writeport, ADDRESS_SPACE_IO, 8 )
r3115r3116
13131313   AM_RANGE(0x20, 0x20) AM_READ(soundflags_r            )   // Communication
13141314   AM_RANGE(0x30, 0x30) AM_READ(soundlatch_lo_r         )   // From Main CPU
13151315   AM_RANGE(0x40, 0x40) AM_READ(soundlatch_hi_r         )   //
1316   AM_RANGE(0x51, 0x51) AM_READ(ym2151_status_port_0_r   )   // YM2151
1316   AM_RANGE(0x51, 0x51) AM_READ(ym2151_status_port_0_r      )   // YM2151
13171317ADDRESS_MAP_END
13181318
13191319static ADDRESS_MAP_START( metmqstr_sound_writeport, ADDRESS_SPACE_IO, 8 )
r3115r3116
13571357   ADDRESS_MAP_GLOBAL_MASK(0xff)
13581358   AM_RANGE(0x00, 0x00) AM_READ(okim6295_status_0_r      )   // M6295
13591359   AM_RANGE(0x08, 0x08) AM_READ(okim6295_status_1_r      )   //
1360   AM_RANGE(0x40, 0x40) AM_READ(ym2203_status_port_0_r   )   // YM2203
1360   AM_RANGE(0x40, 0x40) AM_READ(ym2203_status_port_0_r      )   // YM2203
13611361   AM_RANGE(0x41, 0x41) AM_READ(ym2203_read_port_0_r      )   //
13621362   AM_RANGE(0x60, 0x60) AM_READ(soundlatch_hi_r         )   // From Main CPU
13631363   AM_RANGE(0x70, 0x70) AM_READ(soundlatch_lo_r         )   //
r3115r3116
13701370   AM_RANGE(0x10, 0x17) AM_WRITE(NMK112_okibank_w         )   // Samples bank
13711371   AM_RANGE(0x40, 0x40) AM_WRITE(ym2203_control_port_0_w   )   // YM2203
13721372   AM_RANGE(0x41, 0x41) AM_WRITE(ym2203_write_port_0_w      )   //
1373//  AM_RANGE(0x50, 0x50) AM_WRITE(SMH_NOP      )   // ?? volume
1374//  AM_RANGE(0x51, 0x51) AM_WRITE(SMH_NOP      )   // ?? volume
1373   AM_RANGE(0x50, 0x50) AM_WRITE(soundlatch_ack_w         )   // To Main CPU
1374//  AM_RANGE(0x51, 0x51) AM_WRITE(SMH_NOP                   )   // ?? volume
13751375   AM_RANGE(0x80, 0x80) AM_WRITE(pwrinst2_rombank_w      )   // ROM bank
13761376ADDRESS_MAP_END
13771377
r3115r3116
14181418}
14191419
14201420static ADDRESS_MAP_START( sailormn_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
1421   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM               )   // ROM
1422   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK1               )   // ROM (Banked)
1423   AM_RANGE(0xc000, 0xdfff) AM_READ(mirror_ram_r            )   // RAM
1424   AM_RANGE(0xe000, 0xffff) AM_READ(mirror_ram_r            )   // Mirrored RAM (agallet)
1421   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM      )   // ROM
1422   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK1      )   // ROM (Banked)
1423   AM_RANGE(0xc000, 0xdfff) AM_READ(mirror_ram_r   )   // RAM
1424   AM_RANGE(0xe000, 0xffff) AM_READ(mirror_ram_r   )   // Mirrored RAM (agallet)
14251425ADDRESS_MAP_END
14261426
14271427static ADDRESS_MAP_START( sailormn_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
14281428   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM               )   // ROM
14291429   AM_RANGE(0x4000, 0x7fff) AM_WRITE(SMH_ROM               )   // ROM (Banked)
1430   AM_RANGE(0xc000, 0xdfff) AM_WRITE(mirror_ram_w) AM_BASE(&mirror_ram   )   // RAM
1430   AM_RANGE(0xc000, 0xdfff) AM_WRITE(mirror_ram_w) AM_BASE(&mirror_ram)   // RAM
14311431   AM_RANGE(0xe000, 0xffff) AM_WRITE(mirror_ram_w            )   // Mirrored RAM (agallet)
14321432ADDRESS_MAP_END
14331433
r3115r3116
14361436   AM_RANGE(0x20, 0x20) AM_READ(soundflags_r            )   // Communication
14371437   AM_RANGE(0x30, 0x30) AM_READ(soundlatch_lo_r         )   // From Main CPU
14381438   AM_RANGE(0x40, 0x40) AM_READ(soundlatch_hi_r         )   //
1439   AM_RANGE(0x51, 0x51) AM_READ(ym2151_status_port_0_r   )   // YM2151
1439   AM_RANGE(0x51, 0x51) AM_READ(ym2151_status_port_0_r      )   // YM2151
14401440   AM_RANGE(0x60, 0x60) AM_READ(okim6295_status_0_r      )   // M6295 #0
14411441   AM_RANGE(0x80, 0x80) AM_READ(okim6295_status_1_r      )   // M6295 #1
14421442ADDRESS_MAP_END
src/mame/drivers/tbowl.c
r3115r3116
1818#include "sound/msm5205.h"
1919#include "rendlay.h"
2020
21static int adpcm_pos[2],adpcm_end[2];
22static int adpcm_data[2];
23static UINT8 *shared_ram;
24
2125/* in video/tbowl.c */
2226extern UINT8 *tbowl_txvideoram, *tbowl_bgvideoram, *tbowl_bg2videoram;
2327extern UINT8 *tbowl_spriteram;
r3115r3116
7175
7276***/
7377
74static UINT8 *shared_ram;
75
7678static READ8_HANDLER( shared_r )
7779{
7880   return shared_ram[offset];
r3115r3116
110112//  AM_RANGE(0xf000, 0xf000) AM_WRITE(unknown_write) * written during start-up, not again */
111113   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(SMH_BANK1, SMH_ROM)
112114   AM_RANGE(0xf800, 0xfbff) AM_READWRITE(shared_r, shared_w) AM_BASE(&shared_ram) /* check */
113   AM_RANGE(0xfc00, 0xfc00) AM_READWRITE(input_port_0_r, tbowlb_bankswitch_w)   /* Player 1 inputs */
114   AM_RANGE(0xfc01, 0xfc01) AM_READ(input_port_1_r) /* Player 2 inputs */
115   AM_RANGE(0xfc00, 0xfc00) AM_READ_PORT("P1") AM_WRITE(tbowlb_bankswitch_w)
116   AM_RANGE(0xfc01, 0xfc01) AM_READ_PORT("P2")
115117//  AM_RANGE(0xfc01, 0xfc01) AM_WRITE(unknown_write) /* written during start-up, not again */
116   AM_RANGE(0xfc02, 0xfc02) AM_READ(input_port_2_r) /* Player 3 inputs */
118   AM_RANGE(0xfc02, 0xfc02) AM_READ_PORT("P3")
117119//  AM_RANGE(0xfc02, 0xfc02) AM_WRITE(unknown_write) /* written during start-up, not again */
118   AM_RANGE(0xfc03, 0xfc03) AM_READWRITE(input_port_3_r, tbowl_coin_counter_w)   /* Player 4 inputs */
120   AM_RANGE(0xfc03, 0xfc03) AM_READ_PORT("P4") AM_WRITE(tbowl_coin_counter_w)
119121//  AM_RANGE(0xfc05, 0xfc05) AM_WRITE(unknown_write) /* no idea */
120122//  AM_RANGE(0xfc06, 0xfc06) AM_READ(dummy_r)        /* Read During NMI */
121   AM_RANGE(0xfc07, 0xfc07) AM_READ(input_port_4_r) /* System inputs */
122   AM_RANGE(0xfc08, 0xfc08) AM_READ(input_port_5_r) /* DSW1 */
123   AM_RANGE(0xfc07, 0xfc07) AM_READ_PORT("SYSTEM")
124   AM_RANGE(0xfc08, 0xfc08) AM_READ_PORT("DSW1")
123125//  AM_RANGE(0xfc08, 0xfc08) AM_WRITE(unknown_write) /* hardly used .. */
124   AM_RANGE(0xfc09, 0xfc09) AM_READ(input_port_6_r) /* DSW2 */
125   AM_RANGE(0xfc0a, 0xfc0a) AM_READ(input_port_7_r) /* DSW3 */
126   AM_RANGE(0xfc09, 0xfc09) AM_READ_PORT("DSW2")
127   AM_RANGE(0xfc0a, 0xfc0a) AM_READ_PORT("DSW3")
126128//  AM_RANGE(0xfc0a, 0xfc0a) AM_WRITE(unknown_write) /* hardly used .. */
127129   AM_RANGE(0xfc0d, 0xfc0d) AM_WRITE(tbowl_sound_command_w) /* not sure, used quite a bit */
128130   AM_RANGE(0xfc10, 0xfc10) AM_WRITE(tbowl_bg2xscroll_lo)
r3115r3116
159161
160162/* Board A */
161163
162static int adpcm_pos[2],adpcm_end[2];
163
164164static WRITE8_HANDLER( tbowl_adpcm_start_w )
165165{
166166   adpcm_pos[offset & 1] = data << 8;
r3115r3116
179179
180180static void tbowl_adpcm_int(running_machine *machine, int num)
181181{
182   static int adpcm_data[2] = { -1, -1 };
183
184182   if (adpcm_pos[num] >= adpcm_end[num] ||
185183            adpcm_pos[num] >= memory_region_length(machine, "adpcm")/2)
186184      msm5205_reset_w(num,1);
r3115r3116
271269
272270
273271static INPUT_PORTS_START( tbowl )
274   PORT_START("P1")   /* player 1 inputs (0xfc00) */
272   PORT_START("P1")   /* 0xfc00 */
275273   TBOWL_PLAYER_INPUT(1)
276274
277   PORT_START("P2")   /* player 2 inputs (0xfc01) */
275   PORT_START("P2")   /* 0xfc01 */
278276   TBOWL_PLAYER_INPUT(2)
279277
280   PORT_START("P3")   /* player 3 inputs (0xfc02) */
278   PORT_START("P3")   /* 0xfc02 */
281279   TBOWL_PLAYER_INPUT(3)
282280
283   PORT_START("P4")   /* player 4 inputs (0xfc03) */
281   PORT_START("P4")   /* 0xfc03 */
284282   TBOWL_PLAYER_INPUT(4)
285283
286   PORT_START("SYSTEM")   /* system inputs (0xfc07 -> 0x80f9) */
284   PORT_START("SYSTEM")   /* 0xfc07 -> 0x80f9 */
287285   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
288286   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
289287   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
r3115r3116
293291   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
294292   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
295293
296   PORT_START("DSW1")   /* DSW1 (0xfc08 -> 0xffb4) */
294   PORT_START("DSW1")   /* 0xfc08 -> 0xffb4 */
297295   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
298296   PORT_DIPSETTING (   0x00, DEF_STR( 8C_1C ) )
299297   PORT_DIPSETTING (   0x01, DEF_STR( 7C_1C ) )
r3115r3116
337335   PORT_DIPSETTING (   0xf0, "0:25" )
338336//  PORT_DIPSETTING (   0xf8, "1:00" )
339337
340   PORT_START("DSW2")   /* DSW2 (0xfc09 -> 0xffb5) */
338   PORT_START("DSW2")   /* 0xfc09 -> 0xffb5 */
341339   PORT_DIPNAME( 0x03, 0x03, "Difficulty (unused ?)" )   // To be checked again
342340   PORT_DIPSETTING (   0x00, "0x00" )
343341   PORT_DIPSETTING (   0x01, "0x01" )
r3115r3116
360358   PORT_DIPSETTING (   0x00, DEF_STR( Off ) )
361359   PORT_DIPSETTING (   0x80, DEF_STR( On ) )
362360
363   PORT_START("DSW3")   /* DSW3 (0xfc0a -> 0xffb6) */
361   PORT_START("DSW3")   /* 0xfc0a -> 0xffb6 */
364362   PORT_DIPNAME( 0x03, 0x03, "Time (Quarter)" )
365363   PORT_DIPSETTING (   0x00, "8:00" )
366364   PORT_DIPSETTING (   0x01, "5:00" )
r3115r3116
377375/* same as 'tbowl', but different "Quarter Time" Dip Switch
378376   ("3:00" and "4:00" are inverted) */
379377static INPUT_PORTS_START( tbowlj )
380   PORT_START("P1")   /* player 1 inputs (0xfc00) */
381   TBOWL_PLAYER_INPUT(1)
378   PORT_INCLUDE( tbowl )
382379
383   PORT_START("P2")   /* player 2 inputs (0xfc01) */
384   TBOWL_PLAYER_INPUT(2)
385
386   PORT_START("P3")   /* player 3 inputs (0xfc02) */
387   TBOWL_PLAYER_INPUT(3)
388
389   PORT_START("P4")   /* player 4 inputs (0xfc03) */
390   TBOWL_PLAYER_INPUT(4)
391
392   PORT_START("SYSTEM")   /* system inputs (0xfc07 -> 0x80f9) */
393   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
394   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
395   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
396   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 )
397   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Service (General)") PORT_CODE(KEYCODE_F1)
398   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
399   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
400   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
401
402   PORT_START("DSW1")   /* DSW1 (0xfc08 -> 0xffb4) */
403   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
404   PORT_DIPSETTING (   0x00, DEF_STR( 8C_1C ) )
405   PORT_DIPSETTING (   0x01, DEF_STR( 7C_1C ) )
406   PORT_DIPSETTING (   0x02, DEF_STR( 6C_1C ) )
407   PORT_DIPSETTING (   0x03, DEF_STR( 5C_1C ) )
408   PORT_DIPSETTING (   0x04, DEF_STR( 4C_1C ) )
409   PORT_DIPSETTING (   0x05, DEF_STR( 3C_1C ) )
410   PORT_DIPSETTING (   0x06, DEF_STR( 2C_1C ) )
411   PORT_DIPSETTING (   0x07, DEF_STR( 1C_1C ) )
412   PORT_DIPNAME( 0xf8, 0xb8, "Time (Players)" )
413   PORT_DIPSETTING (   0x00, "7:00" )
414   PORT_DIPSETTING (   0x08, "6:00" )
415   PORT_DIPSETTING (   0x10, "5:00" )
416   PORT_DIPSETTING (   0x18, "4:30" )
417   PORT_DIPSETTING (   0x20, "3:40" )
418   PORT_DIPSETTING (   0x28, "3:20" )
419   PORT_DIPSETTING (   0x30, "3:00" )
420   PORT_DIPSETTING (   0x38, "2:50" )
421   PORT_DIPSETTING (   0x40, "2:40" )
422   PORT_DIPSETTING (   0x48, "2:30" )
423   PORT_DIPSETTING (   0x50, "2:20" )
424   PORT_DIPSETTING (   0x58, "2:10" )
425   PORT_DIPSETTING (   0x60, "2:00" )
426   PORT_DIPSETTING (   0x68, "1:55" )
427   PORT_DIPSETTING (   0x70, "1:50" )
428   PORT_DIPSETTING (   0x78, "1:45" )
429   PORT_DIPSETTING (   0x80, "1:40" )
430   PORT_DIPSETTING (   0x88, "1:35" )
431   PORT_DIPSETTING (   0x90, "1:25" )
432   PORT_DIPSETTING (   0x98, "1:20" )
433   PORT_DIPSETTING (   0xa0, "1:15" )
434   PORT_DIPSETTING (   0xa8, "1:10" )
435   PORT_DIPSETTING (   0xb0, "1:05" )
436   PORT_DIPSETTING (   0xb8, "1:00" )
437   PORT_DIPSETTING (   0xc0, "0:55" )
438   PORT_DIPSETTING (   0xc8, "0:50" )
439   PORT_DIPSETTING (   0xd0, "0:45" )
440   PORT_DIPSETTING (   0xd8, "0:40" )
441   PORT_DIPSETTING (   0xe0, "0:35" )
442   PORT_DIPSETTING (   0xe8, "0:30" )
443   PORT_DIPSETTING (   0xf0, "0:25" )
444//  PORT_DIPSETTING (   0xf8, "1:00" )
445
446   PORT_START("DSW2")   /* DSW2 (0xfc09 -> 0xffb5) */
447   PORT_DIPNAME( 0x03, 0x03, "Difficulty (unused ?)" )   // To be checked again
448   PORT_DIPSETTING (   0x00, "0x00" )
449   PORT_DIPSETTING (   0x01, "0x01" )
450   PORT_DIPSETTING (   0x02, "0x02" )
451   PORT_DIPSETTING (   0x03, "0x03" )
452   PORT_DIPNAME( 0x0c, 0x0c, "Extra Time (Players)" )   // For multiple "credits"
453   PORT_DIPSETTING (   0x00, "0:30" )
454   PORT_DIPSETTING (   0x04, "0:20" )
455   PORT_DIPSETTING (   0x08, "0:10" )
456   PORT_DIPSETTING (   0x0c, DEF_STR( None ) )
457   PORT_DIPNAME( 0x30, 0x30, "Timer Speed" )
458   PORT_DIPSETTING (   0x00, "56/60" )
459   PORT_DIPSETTING (   0x10, "51/60" )
460   PORT_DIPSETTING (   0x30, "47/60" )
461   PORT_DIPSETTING (   0x20, "42/60" )
462   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )   // Check code at 0x0393
463   PORT_DIPSETTING (   0x00, DEF_STR( Off ) )
464   PORT_DIPSETTING (   0x40, DEF_STR( On ) )
465   PORT_DIPNAME( 0x80, 0x80, "Hi-Score Reset" )      // Only if P1 buttons 1 and 2 are pressed during P.O.S.T. !
466   PORT_DIPSETTING (   0x00, DEF_STR( Off ) )
467   PORT_DIPSETTING (   0x80, DEF_STR( On ) )
468
469   PORT_START("DSW3")   /* DSW3 (0xfc0a -> 0xffb6) */
380   PORT_MODIFY("DSW3")
470381   PORT_DIPNAME( 0x03, 0x03, "Time (Quarter)" )
471382   PORT_DIPSETTING (   0x00, "8:00" )
472383   PORT_DIPSETTING (   0x01, "5:00" )
r3115r3116
477388   PORT_DIPSETTING (   0x04, "0x04 = 0x5402" )
478389   PORT_DIPSETTING (   0x08, "0x08 = 0x54f0" )
479390   PORT_DIPSETTING (   0x0c, "0x0c = 0x54de" )
480   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
481391INPUT_PORTS_END
482392
483393
r3115r3116
559469
560470***/
561471
472static MACHINE_RESET( tbowl )
473{
474   adpcm_pos[0] = adpcm_pos[1] = 0;
475   adpcm_end[0] = adpcm_end[1] = 0;
476   adpcm_data[0] = adpcm_data[1] = -1;
477}
478
562479static MACHINE_DRIVER_START( tbowl )
563480
564481   /* CPU on Board '6206B' */
r3115r3116
599516   MDRV_VIDEO_START(tbowl)
600517   MDRV_VIDEO_UPDATE(tbowl)
601518
519   MDRV_MACHINE_RESET( tbowl )
520
602521   /* sound hardware */
603522   MDRV_SPEAKER_STANDARD_MONO("mono")
604523
src/mame/drivers/atarigt.c
r3115r3116
5656
5757static void update_interrupts(running_machine *machine)
5858{
59   int newstate = 0;
60
61   if (atarigen_sound_int_state)
62      newstate = 3;
63   if (atarigen_video_int_state)
64      newstate = 4;
65   if (atarigen_scanline_int_state)
66      newstate = 6;
67
68   if (newstate)
69      cpunum_set_input_line(machine, 0, newstate, ASSERT_LINE);
70   else
71      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
59   cpunum_set_input_line(machine, 0, 3, atarigen_sound_int_state    ? ASSERT_LINE : CLEAR_LINE);
60   cpunum_set_input_line(machine, 0, 4, atarigen_video_int_state    ? ASSERT_LINE : CLEAR_LINE);
61   cpunum_set_input_line(machine, 0, 6, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
7262}
7363
7464
src/mame/drivers/rbmk.c
r3115r3116
7979
8080}
8181
82static READ16_HANDLER( eeprom_r )
83{
84   return (eeprom_read_bit() << 15)|(input_port_read(machine, "IN3") & 0x7fff);
85}
86
8782static WRITE16_HANDLER( eeprom_w )
8883{
8984   //bad ?
r3115r3116
108103   AM_RANGE(0xb00000, 0xb00001) AM_WRITE(eeprom_w)
109104   AM_RANGE(0xC00000, 0xC00001) AM_READ_PORT("IN0") AM_WRITE(gms_write1)
110105   AM_RANGE(0xC08000, 0xC08001) AM_READ_PORT("IN1") AM_WRITE(gms_write2)
111   AM_RANGE(0xC10000, 0xC10001) AM_READ(eeprom_r)
106   AM_RANGE(0xC10000, 0xC10001) AM_READ_PORT("IN3")
112107   AM_RANGE(0xC18080, 0xC18081) AM_READ(gms_read)
113108   AM_RANGE(0xC20000, 0xC20001) AM_READ_PORT("IN2")
114109   AM_RANGE(0xC28000, 0xC28001) AM_WRITE(gms_write3)
r3115r3116
116111
117112
118113static INPUT_PORTS_START( rbmk )
119
120   PORT_START("IN0")   /* 16bit */
121   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Controls ) )
122   PORT_DIPSETTING(      0x0080, DEF_STR( Joystick ) )
123   PORT_DIPSETTING(      0x0000, "Keyboard" )
124   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Version ) )
125   PORT_DIPSETTING(      0x4000, "8.8" )
126   PORT_DIPSETTING(      0x0000, "8.8-" )
127
128
114   PORT_START("IN0")
129115   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
130116   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
131117   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r3115r3116
147133   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
148134   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
149135   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
136   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Controls ) )
137   PORT_DIPSETTING(      0x0080, DEF_STR( Joystick ) )
138   PORT_DIPSETTING(      0x0000, "Keyboard" )
150139
151140   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
152141   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
r3115r3116
166155   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
167156   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
168157   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
169
158   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Version ) )
159   PORT_DIPSETTING(      0x4000, "8.8" )
160   PORT_DIPSETTING(      0x0000, "8.8-" )
170161   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
171162   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
172163   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r3115r3116
187178
188179   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  )
189180   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT  )
190
191181   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 )
192182   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
193183   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 )
r3115r3116
302292   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
303293   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
304294   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
305   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
306   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
307   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
295   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
308296
309297   PORT_START("IN4")   /* 16bit */
310298   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
r3115r3116
405393   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
406394   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
407395   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
408
409396INPUT_PORTS_END
410397
411398
src/mame/drivers/genesis.c
r3115r3116
6969/* call this whenever the interrupt state has changed */
7070static void update_interrupts(running_machine *machine)
7171{
72   int level = 0;
73
74   /* determine which interrupt is active */
75   if (irq2_int) level = 2;
76   if (scanline_int) level = 4;
77   if (vblank_int) level = 6;
78
79   /* either set or clear the appropriate lines */
80   if (level)
81      cpunum_set_input_line(machine, 0, level, ASSERT_LINE);
82   else
83      cpunum_set_input_line(machine, 0, 7, CLEAR_LINE);
72   cpunum_set_input_line(machine, 0, 2, irq2_int ? ASSERT_LINE : CLEAR_LINE);
73   cpunum_set_input_line(machine, 0, 4, scanline_int ? ASSERT_LINE : CLEAR_LINE);
74   cpunum_set_input_line(machine, 0, 6, vblank_int ? ASSERT_LINE : CLEAR_LINE);
8475}
8576
8677
src/mame/drivers/thepit.c
r3115r3116
172172   AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(&thepit_spriteram) AM_SIZE(&thepit_spriteram_size)
173173   AM_RANGE(0x9860, 0x98ff) AM_RAM
174174   AM_RANGE(0xa000, 0xa000) AM_READWRITE(thepit_input_port_0_r, SMH_NOP) // Not hooked up according to the schematics
175   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
176   AM_RANGE(0xb000, 0xb000) AM_READWRITE(input_port_2_r, interrupt_enable_w)
175   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1")
176   AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW") AM_WRITE(interrupt_enable_w)
177177   AM_RANGE(0xb001, 0xb001) AM_WRITE(SMH_NOP) // Unused, but initialized
178178   AM_RANGE(0xb002, 0xb002) AM_WRITE(SMH_NOP) // coin_lockout_w
179179   AM_RANGE(0xb003, 0xb003) AM_WRITE(thepit_sound_enable_w)
r3115r3116
193193   AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(&thepit_spriteram) AM_SIZE(&thepit_spriteram_size)
194194   AM_RANGE(0x9860, 0x98ff) AM_RAM
195195   AM_RANGE(0xa000, 0xa000) AM_READ(thepit_input_port_0_r)
196   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
197   AM_RANGE(0xb000, 0xb000) AM_READWRITE(input_port_2_r, interrupt_enable_w)
196   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1")
197   AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW") AM_WRITE(interrupt_enable_w)
198198   AM_RANGE(0xb001, 0xb001) AM_WRITE(SMH_NOP) // Unused, but initialized
199199   AM_RANGE(0xb002, 0xb002) AM_WRITE(SMH_NOP) // coin_lockout_w
200200   AM_RANGE(0xb003, 0xb003) AM_WRITE(thepit_sound_enable_w)
src/mame/drivers/trvmadns.c
r3115r3116
212212   ADDRESS_MAP_GLOBAL_MASK(0xff)
213213   AM_RANGE(0x00, 0x00) AM_WRITE(ay8910_control_port_0_w)
214214   AM_RANGE(0x01, 0x01) AM_WRITE(ay8910_write_port_0_w)
215   AM_RANGE(0x02, 0x02) AM_READ(input_port_0_r)
215   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN0")
216216   AM_RANGE(0x80, 0x80) AM_WRITE(trvmadns_banking_w)
217217ADDRESS_MAP_END
218218
src/mame/drivers/rpunch.c
r3115r3116
163163 *
164164 *************************************/
165165
166static READ16_HANDLER( common_port_r )
166static CUSTOM_INPUT( hi_bits_r )
167167{
168   return input_port_read(machine, offset ? "P2" : "P1") | input_port_read(machine, "SERVICE");
168   return input_port_read(field->port->machine, "SERVICE");
169169}
170170
171171
172
173172/*************************************
174173 *
175174 *  Sound I/O
r3115r3116
245244   AM_RANGE(0x040000, 0x04ffff) AM_READ(SMH_RAM)
246245   AM_RANGE(0x060000, 0x060fff) AM_READ(SMH_RAM)
247246   AM_RANGE(0x080000, 0x083fff) AM_READ(SMH_RAM)
248   AM_RANGE(0x0c0018, 0x0c001b) AM_READ(common_port_r)
247   AM_RANGE(0x0c0018, 0x0c0019) AM_READ_PORT("P1")
248   AM_RANGE(0x0c001a, 0x0c001b) AM_READ_PORT("P2")
249249   AM_RANGE(0x0c001c, 0x0c001d) AM_READ_PORT("DSW")
250250   AM_RANGE(0x0c001e, 0x0c001f) AM_READ(sound_busy_r)
251251   AM_RANGE(0x0a0000, 0x0a07ff) AM_READ(SMH_RAM)
r3115r3116
310310   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
311311   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
312312   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
313   PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNUSED )
313   PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED )
314   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(hi_bits_r, NULL)
314315
315316   PORT_START("P2")   /* c001a lower 8 bits */
316317   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3115r3116
319320   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
320321   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
321322   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
322   PORT_BIT( 0xffc0, IP_ACTIVE_HIGH, IPT_UNUSED )
323   PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED )
324   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(hi_bits_r, NULL)
323325
324326   PORT_START("SERVICE")   /* c0018/c001a upper 8 bits */
325   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
326   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SERVICE1 )
327   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_SERVICE ) /* Hold F2 at bootup */
328   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )  /* Freeze game */
329   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_COIN2 )
330   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_COIN1 )
331   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_START1 )
332   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_START2 )
333   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
327   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 )
328   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE ) /* Hold F2 at bootup */
329   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )  /* Freeze game */
330   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
331   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
332   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
333   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
334   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
334335
335336   PORT_START("DSW")   /* c001c DIP switches */
336   PORT_DIPNAME( 0x000f, 0x0000, DEF_STR( Coin_A )) PORT_DIPLOCATION("SWA:1,2,3,4")
337   PORT_DIPSETTING(      0x000d, DEF_STR( 3C_1C ))
338   PORT_DIPSETTING(      0x000c, DEF_STR( 2C_1C ))
337   PORT_DIPNAME( 0x000f, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:1,2,3,4")
338   PORT_DIPSETTING(      0x000d, DEF_STR( 3C_1C ) )
339   PORT_DIPSETTING(      0x000c, DEF_STR( 2C_1C ) )
339340   PORT_DIPSETTING(      0x0005, "6 Coins/4 Credits")
340   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
341   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
341342   PORT_DIPSETTING(      0x0003, "5 Coins/6 Credits" )
342   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_5C ))
343   PORT_DIPSETTING(      0x0006, DEF_STR( 2C_3C ))
344   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_2C ))
345   PORT_DIPSETTING(      0x0009, DEF_STR( 1C_3C ))
346   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_4C ))
347   PORT_DIPSETTING(      0x000b, DEF_STR( 1C_5C ))
348   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_6C ))
349   PORT_DIPNAME( 0x00f0, 0x0000, DEF_STR( Coin_B )) PORT_DIPLOCATION("SWA:5,6,7,8")
350   PORT_DIPSETTING(      0x00d0, DEF_STR( 3C_1C ))
351   PORT_DIPSETTING(      0x00c0, DEF_STR( 2C_1C ))
343   PORT_DIPSETTING(      0x0002, DEF_STR( 4C_5C ) )
344   PORT_DIPSETTING(      0x0006, DEF_STR( 2C_3C ) )
345   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_2C ) )
346   PORT_DIPSETTING(      0x0009, DEF_STR( 1C_3C ) )
347   PORT_DIPSETTING(      0x000a, DEF_STR( 1C_4C ) )
348   PORT_DIPSETTING(      0x000b, DEF_STR( 1C_5C ) )
349   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_6C ) )
350   PORT_DIPNAME( 0x00f0, 0x0000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:5,6,7,8")
351   PORT_DIPSETTING(      0x00d0, DEF_STR( 3C_1C ) )
352   PORT_DIPSETTING(      0x00c0, DEF_STR( 2C_1C ) )
352353   PORT_DIPSETTING(      0x0050, "6 Coins/4 Credits")
353   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
354   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
354355   PORT_DIPSETTING(      0x0030, "5 Coins/6 Credits" )
355   PORT_DIPSETTING(      0x0020, DEF_STR( 4C_5C ))
356   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_3C ))
357   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ))
358   PORT_DIPSETTING(      0x0090, DEF_STR( 1C_3C ))
359   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_4C ))
360   PORT_DIPSETTING(      0x00b0, DEF_STR( 1C_5C ))
361   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_6C ))
356   PORT_DIPSETTING(      0x0020, DEF_STR( 4C_5C ) )
357   PORT_DIPSETTING(      0x0060, DEF_STR( 2C_3C ) )
358   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )
359   PORT_DIPSETTING(      0x0090, DEF_STR( 1C_3C ) )
360   PORT_DIPSETTING(      0x00a0, DEF_STR( 1C_4C ) )
361   PORT_DIPSETTING(      0x00b0, DEF_STR( 1C_5C ) )
362   PORT_DIPSETTING(      0x0040, DEF_STR( 1C_6C ) )
362363
363364
364   PORT_DIPNAME( 0x0300, 0x0000, DEF_STR( Difficulty )) PORT_DIPLOCATION("SWB:1,2")
365   PORT_DIPNAME( 0x0300, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:1,2")
365366   PORT_DIPSETTING(      0x0200, DEF_STR( Easy ) )
366367   PORT_DIPSETTING(      0x0000, DEF_STR( Normal ) )
367368   PORT_DIPSETTING(      0x0100, DEF_STR( Hard ) )
368369   PORT_DIPSETTING(      0x0300, DEF_STR( Hardest ) )
369   PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Lives )) PORT_DIPLOCATION("SWB:3")
370   PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3")
370371   PORT_DIPSETTING(      0x0000, "2" )
371372   PORT_DIPSETTING(      0x0400, "3" )
372373   PORT_DIPNAME( 0x0800, 0x0000, "Laser" ) PORT_DIPLOCATION("SWB:4")
r3115r3116
375376   PORT_DIPNAME( 0x1000, 0x0000, "Extended Play" ) PORT_DIPLOCATION("SWB:5")
376377   PORT_DIPSETTING(      0x0000, "500000 points" )
377378   PORT_DIPSETTING(      0x1000, DEF_STR( None ) )
378   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Demo_Sounds )) PORT_DIPLOCATION("SWB:6")
379   PORT_DIPSETTING(      0x0000, DEF_STR( Off ))
380   PORT_DIPSETTING(      0x2000, DEF_STR( On ))
379   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:6")
380   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
381   PORT_DIPSETTING(      0x2000, DEF_STR( On ) )
381382   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Continues ) ) PORT_DIPLOCATION("SWB:7")
382   PORT_DIPSETTING(      0x4000, DEF_STR( Off ))
383   PORT_DIPSETTING(      0x0000, DEF_STR( On ))
384   PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Flip_Screen )) PORT_DIPLOCATION("SWB:8")
385   PORT_DIPSETTING(      0x0000, DEF_STR( Off ))
386   PORT_DIPSETTING(      0x8000, DEF_STR( On ))
383   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
384   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
385   PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:8")
386   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
387   PORT_DIPSETTING(      0x8000, DEF_STR( On ) )
387388INPUT_PORTS_END
388389
389390
r3115r3116
391392   PORT_INCLUDE( rpunch )
392393
393394   PORT_MODIFY("DSW")
394   PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Lives )) PORT_DIPLOCATION("SWB:3")
395   PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3")
395396   PORT_DIPSETTING(      0x0000, "3" )
396397   PORT_DIPSETTING(      0x0400, "2" )
397398   PORT_DIPNAME( 0x0800, 0x0000, "Laser" ) PORT_DIPLOCATION("SWB:4")
r3115r3116
400401   PORT_DIPNAME( 0x1000, 0x0000, "Extended Play" ) PORT_DIPLOCATION("SWB:5")
401402   PORT_DIPSETTING(      0x0000, "500000 points" )
402403   PORT_DIPSETTING(      0x1000, "300000 points" )
403   PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Demo_Sounds )) PORT_DIPLOCATION("SWB:6")
404   PORT_DIPSETTING(      0x2000, DEF_STR( Off ))
405   PORT_DIPSETTING(      0x0000, DEF_STR( On ))
404   PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:6")
405   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
406   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
406407INPUT_PORTS_END
407408
408409
r3115r3116
414415   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
415416
416417   PORT_MODIFY("DSW")
417   PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Game_Time )) PORT_DIPLOCATION("SWB:1")
418   PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("SWB:1")
418419   PORT_DIPSETTING(      0x0100, "2 min/1 min" )
419420   PORT_DIPSETTING(      0x0000, "3 min/1.5 min" )
420421   PORT_DIPNAME( 0x0600, 0x0000, "2P Starting Score" ) PORT_DIPLOCATION("SWB:2,3")
r3115r3116
428429   PORT_DIPSETTING(      0x0800, "10-11" )
429430   PORT_DIPSETTING(      0x0000, "11-11" )
430431   PORT_SERVICE_DIPLOC( 0x2000, IP_ACTIVE_HIGH, "SWB:6" )
431   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds )) PORT_DIPLOCATION("SWB:7")
432   PORT_DIPSETTING(      0x0000, DEF_STR( Off ))
433   PORT_DIPSETTING(      0x4000, DEF_STR( On ))
432   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:7")
433   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
434   PORT_DIPSETTING(      0x4000, DEF_STR( On ) )
434435INPUT_PORTS_END
435436
436437
src/mame/drivers/rabbit.c
r3115r3116
445445}
446446
447447
448static READ32_HANDLER( rabbit_input_r )
449{
450   int rv;
451
452   rv = (input_port_read(machine, "IN1")<<16)|(input_port_read(machine, "IN0"));
453   rv &= ~1;
454   rv |= eeprom_read_bit();   // as per code at 4d932
455   return rv;
456}
457
458static READ32_HANDLER( tmmjprd_input_r )
459{
460   int rv;
461
462   rv = (input_port_read(machine, "IN1")<<16)|(input_port_read(machine, "IN0"));
463   rv &= ~0x80;
464   rv |= (eeprom_read_bit()<<7);   // as per code at 778
465   return rv;
466}
467
468448static WRITE32_HANDLER( rabbit_paletteram_dword_w )
469449{
470450   int r,g,b;
r3115r3116
504484
505485static ADDRESS_MAP_START( rabbit_readmem, ADDRESS_SPACE_PROGRAM, 32 )
506486   AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM)
507   AM_RANGE(0x200000, 0x200003) AM_READ(rabbit_input_r)
487   AM_RANGE(0x200000, 0x200003) AM_READ_PORT("INPUTS")
508488   AM_RANGE(0x400010, 0x400013) AM_READ(randomrabbits) // gfx chip status?
509489   AM_RANGE(0x400980, 0x400983) AM_READ(randomrabbits) // sound chip status?
510490   AM_RANGE(0x400984, 0x400987) AM_READ(randomrabbits) // sound chip status?
r3115r3116
781761   AM_RANGE(0x288000, 0x28bfff) AM_READ(rabbit_tilemap2_r)
782762   AM_RANGE(0x28c000, 0x28ffff) AM_READ(rabbit_tilemap3_r)
783763   AM_RANGE(0x290000, 0x29ffff) AM_READ(SMH_RAM)
784   AM_RANGE(0x400000, 0x400003) AM_READ(tmmjprd_input_r)
764   AM_RANGE(0x400000, 0x400003) AM_READ_PORT("INPUTS")
785765   AM_RANGE(0xf00000, 0xffffff) AM_READ(SMH_RAM)
786766ADDRESS_MAP_END
787767
r3115r3116
828808ADDRESS_MAP_END
829809
830810static INPUT_PORTS_START( rabbit )
831   PORT_START("IN0")   /* 16bit */
832   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL ) // Eeprom
833   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unlabeled in input test
834   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
835   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 )
836   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
837   PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
838   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN1 )
839   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN2 )
840   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
841   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
842   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
843   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
844   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
845   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
846   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
847   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
811   PORT_START("INPUTS")
812   PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   // as per code at 4d932
813   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unlabeled in input test
814   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_START1 )
815   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_START2 )
816   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
817   PORT_SERVICE( 0x00000020, IP_ACTIVE_LOW )
818   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_COIN1 )
819   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_COIN2 )
820   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
821   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
822   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
823   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
824   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
825   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
826   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
827   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
848828
849   PORT_START("IN1")   /* 16bit */
850   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
851   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
852   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
853   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
854   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
855   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
856   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
857   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
858   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
859   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
860   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
861   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
862   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
863   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
864   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
865   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
866   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
867   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
868   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
869   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
870   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
871   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
872   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
873   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
874   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
875   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
876   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
877   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
878   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
879   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
880   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
881   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
829   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
830   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
831   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
832   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
833   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
834   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
835   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
836   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
837   PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Unknown ) )
838   PORT_DIPSETTING(          0x01000000, DEF_STR( Off ) )
839   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
840   PORT_DIPNAME( 0x02000000, 0x02000000, DEF_STR( Unknown ) )
841   PORT_DIPSETTING(          0x02000000, DEF_STR( Off ) )
842   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
843   PORT_DIPNAME( 0x04000000, 0x04000000, DEF_STR( Unknown ) )
844   PORT_DIPSETTING(          0x04000000, DEF_STR( Off ) )
845   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
846   PORT_DIPNAME( 0x08000000, 0x08000000, DEF_STR( Unknown ) )
847   PORT_DIPSETTING(          0x08000000, DEF_STR( Off ) )
848   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
849   PORT_DIPNAME( 0x10000000, 0x10000000, DEF_STR( Unknown ) )
850   PORT_DIPSETTING(          0x10000000, DEF_STR( Off ) )
851   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
852   PORT_DIPNAME( 0x20000000, 0x20000000, DEF_STR( Unknown ) )
853   PORT_DIPSETTING(          0x20000000, DEF_STR( Off ) )
854   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
855   PORT_DIPNAME( 0x40000000, 0x40000000, DEF_STR( Unknown ) )
856   PORT_DIPSETTING(          0x40000000, DEF_STR( Off ) )
857   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
858   PORT_DIPNAME( 0x80000000, 0x80000000, DEF_STR( Unknown ) )
859   PORT_DIPSETTING(          0x80000000, DEF_STR( Off ) )
860   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
882861INPUT_PORTS_END
883862
884863static INPUT_PORTS_START( tmmjprd )
885   PORT_START("IN0")   /* 16bit */
886   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
887   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unlabeled in input test
888   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
889   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 )
890   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
891   PORT_SERVICE( 0x0020, IP_ACTIVE_LOW )
892   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN1 )
893   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL )  // Eeprom
894   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
895   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
896   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
897   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
898   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
899   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
900   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
901   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
864   PORT_START("INPUTS")
865   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_UNKNOWN )
866   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unlabeled in input test
867   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_START1 )
868   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_START2 )
869   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
870   PORT_SERVICE( 0x00000020, IP_ACTIVE_LOW )
871   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_COIN1 )
872   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   // as per code at 778
873   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
874   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
875   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
876   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
877   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
878   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
879   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
880   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
902881
903   PORT_START("IN1")   /* 16bit */
904   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
905   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
906   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
907   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
908   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
909   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
910   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
911   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
912   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
913   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
914   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
915   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
916   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
917   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
918   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
919   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
920   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
921   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
922   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
923   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
924   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
925   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
926   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
927   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
928   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
929   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
930   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
931   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
932   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
933   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
934   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
935   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
882   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
883   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
884   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
885   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
886   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
887   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
888   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
889   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
890   PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Unknown ) )
891   PORT_DIPSETTING(          0x01000000, DEF_STR( Off ) )
892   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
893   PORT_DIPNAME( 0x02000000, 0x02000000, DEF_STR( Unknown ) )
894   PORT_DIPSETTING(          0x02000000, DEF_STR( Off ) )
895   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
896   PORT_DIPNAME( 0x04000000, 0x04000000, DEF_STR( Unknown ) )
897   PORT_DIPSETTING(          0x04000000, DEF_STR( Off ) )
898   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
899   PORT_DIPNAME( 0x08000000, 0x08000000, DEF_STR( Unknown ) )
900   PORT_DIPSETTING(          0x08000000, DEF_STR( Off ) )
901   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
902   PORT_DIPNAME( 0x10000000, 0x10000000, DEF_STR( Unknown ) )
903   PORT_DIPSETTING(          0x10000000, DEF_STR( Off ) )
904   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
905   PORT_DIPNAME( 0x20000000, 0x20000000, DEF_STR( Unknown ) )
906   PORT_DIPSETTING(          0x20000000, DEF_STR( Off ) )
907   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
908   PORT_DIPNAME( 0x40000000, 0x40000000, DEF_STR( Unknown ) )
909   PORT_DIPSETTING(          0x40000000, DEF_STR( Off ) )
910   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
911   PORT_DIPNAME( 0x80000000, 0x80000000, DEF_STR( Unknown ) )
912   PORT_DIPSETTING(          0x80000000, DEF_STR( Off ) )
913   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
936914INPUT_PORTS_END
937915
938916
src/mame/drivers/sstrangr.c
r3115r3116
135135
136136
137137static ADDRESS_MAP_START( sstrangr_io_map, ADDRESS_SPACE_IO, 8 )
138   AM_RANGE(0x41, 0x41) AM_READ(input_port_0_r)
139   AM_RANGE(0x42, 0x42) AM_READ(input_port_1_r)
140   AM_RANGE(0x44, 0x44) AM_READWRITE(input_port_2_r, port_w)
138   AM_RANGE(0x41, 0x41) AM_READ_PORT("DSW")
139   AM_RANGE(0x42, 0x42) AM_READ_PORT("INPUTS")
140   AM_RANGE(0x44, 0x44) AM_READ_PORT("EXT") AM_WRITE(port_w)
141141ADDRESS_MAP_END
142142
143143
144144
145145static INPUT_PORTS_START( sstrangr )
146   PORT_START("DSW0")
146   PORT_START("DSW")
147147   PORT_DIPNAME( 0x03, 0x01, "Extra Play" )
148148   PORT_DIPSETTING(    0x00, "Never" )
149149   PORT_DIPSETTING(    0x01, "3000" )
r3115r3116
160160   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
161161   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
162162
163   PORT_START("IN0")
163   PORT_START("INPUTS")
164164   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
165165   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
166166   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
r3115r3116
210210/* color version of Space Stranger, board has Stranger 2 written on it */
211211
212212static INPUT_PORTS_START( sstrngr2 )
213   PORT_START("DSW0")
213   PORT_START("DSW")
214214   PORT_DIPNAME( 0x03, 0x01, "Extra Play" )
215215   PORT_DIPSETTING(    0x00, "Never" )
216216   PORT_DIPSETTING(    0x01, "3000" )
r3115r3116
229229   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
230230   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
231231
232   PORT_START("IN0")
232   PORT_START("INPUTS")
233233   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
234234   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
235235   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
src/mame/drivers/asuka.c
r3115r3116
231231VIDEO_UPDATE( asuka );
232232VIDEO_UPDATE( bonzeadv );
233233
234static int adpcm_pos;
235static int adpcm_data;
236
237
234238/***********************************************************
235239                INTERRUPTS
236240***********************************************************/
r3115r3116
258262
259263
260264
261static int adpcm_pos;
262
263265static void asuka_msm5205_vck(running_machine *machine, int chip)
264266{
265   static int adpcm_data = -1;
266
267267   if (adpcm_data != -1)
268268   {
269269      msm5205_data_w(0, adpcm_data & 0x0f);
r3115r3116
304304   state_save_register_global(adpcm_pos);
305305}
306306
307static MACHINE_RESET( asuka )
308{
309   adpcm_pos = 0;
310   adpcm_data = -1;
311}
307312
308313
309314/***********************************************************
r3115r3116
803808   MDRV_PALETTE_LENGTH(4096)
804809
805810   MDRV_MACHINE_START(asuka)
811   MDRV_MACHINE_RESET(asuka)
806812
807813   MDRV_VIDEO_START(asuka)
808814   MDRV_VIDEO_EOF(asuka)
r3115r3116
841847   MDRV_PALETTE_LENGTH(4096)
842848
843849   MDRV_MACHINE_START(asuka)
850   MDRV_MACHINE_RESET(asuka)
844851
845852   MDRV_VIDEO_START(asuka)
846853   MDRV_VIDEO_EOF(asuka)
r3115r3116
882889   MDRV_PALETTE_LENGTH(4096)
883890
884891   MDRV_MACHINE_START(asuka)
892   MDRV_MACHINE_RESET(asuka)
885893
886894   MDRV_VIDEO_START(cadash)
887895   MDRV_VIDEO_EOF(asuka)
r3115r3116
919927   MDRV_PALETTE_LENGTH(4096)   /* only Mofflott uses full palette space */
920928
921929   MDRV_MACHINE_START(asuka)
930   MDRV_MACHINE_RESET(asuka)
922931
923932   MDRV_VIDEO_START(galmedes)
924933   MDRV_VIDEO_EOF(asuka)
r3115r3116
960969   MDRV_PALETTE_LENGTH(4096)   /* only Mofflott uses full palette space */
961970
962971   MDRV_MACHINE_START(asuka)
972   MDRV_MACHINE_RESET(asuka)
963973
964974   MDRV_VIDEO_START(galmedes)
965975   MDRV_VIDEO_EOF(asuka)
r3115r3116
9971007   MDRV_PALETTE_LENGTH(4096)
9981008
9991009   MDRV_MACHINE_START(asuka)
1010   MDRV_MACHINE_RESET(asuka)
10001011
10011012   MDRV_VIDEO_START(galmedes)
10021013   MDRV_VIDEO_EOF(asuka)
src/mame/drivers/rollerg.c
r3115r3116
7979static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
8080   AM_RANGE(0x0020, 0x0020) AM_READ(watchdog_reset_r)
8181   AM_RANGE(0x0030, 0x0031) AM_READ(rollerg_sound_r)   /* K053260 */
82   AM_RANGE(0x0050, 0x0050) AM_READ(input_port_0_r)
83   AM_RANGE(0x0051, 0x0051) AM_READ(input_port_1_r)
84   AM_RANGE(0x0052, 0x0052) AM_READ(input_port_4_r)
85   AM_RANGE(0x0053, 0x0053) AM_READ(input_port_2_r)
86   AM_RANGE(0x0060, 0x0060) AM_READ(input_port_3_r)
82   AM_RANGE(0x0050, 0x0050) AM_READ_PORT("P1")
83   AM_RANGE(0x0051, 0x0051) AM_READ_PORT("P2")
84   AM_RANGE(0x0052, 0x0052) AM_READ_PORT("DSW3")
85   AM_RANGE(0x0053, 0x0053) AM_READ_PORT("DSW1")
86   AM_RANGE(0x0060, 0x0060) AM_READ_PORT("DSW2")
8787   AM_RANGE(0x0061, 0x0061) AM_READ(pip_r)            /* ????? */
8888   AM_RANGE(0x0300, 0x030f) AM_READ(K053244_r)
8989   AM_RANGE(0x0800, 0x0fff) AM_READ(rollerg_K051316_r)
src/mame/drivers/sidepckt.c
r3115r3116
130130   AM_RANGE(0x1000, 0x13ff) AM_READ(SMH_RAM)
131131   AM_RANGE(0x1800, 0x1bff) AM_READ(SMH_RAM)
132132   AM_RANGE(0x2000, 0x20ff) AM_READ(SMH_RAM)
133   AM_RANGE(0x3000, 0x3000) AM_READ(input_port_0_r)
134   AM_RANGE(0x3001, 0x3001) AM_READ(input_port_1_r)
135   AM_RANGE(0x3002, 0x3002) AM_READ(input_port_2_r)
136   AM_RANGE(0x3003, 0x3003) AM_READ(input_port_3_r)
133   AM_RANGE(0x3000, 0x3000) AM_READ_PORT("P1")
134   AM_RANGE(0x3001, 0x3001) AM_READ_PORT("P2")
135   AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW1")
136   AM_RANGE(0x3003, 0x3003) AM_READ_PORT("DSW2")
137137   AM_RANGE(0x3014, 0x3014) AM_READ(sidepckt_i8751_r)
138138   AM_RANGE(0x4000, 0xffff) AM_READ(SMH_ROM)
139139ADDRESS_MAP_END
r3115r3116
178178/******************************************************************************/
179179
180180static INPUT_PORTS_START( sidepckt )
181    PORT_START("0X3000")
181    PORT_START("P1")
182182    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
183183    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
184184    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
r3115r3116
188188    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
189189    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
190190
191    PORT_START("0X3001")
191    PORT_START("P2")
192192   /* I haven't found a way to make the game use the 2p controls */
193193    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
194194    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
r3115r3116
199199    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
200200    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
201201
202    PORT_START("0X3002")
202    PORT_START("DSW1")
203203   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) )
204204   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) )
205205   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
r3115r3116
223223   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
224224   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
225225
226    PORT_START("0X3003")
226    PORT_START("DSW2")
227227   PORT_DIPNAME( 0x03, 0x03, "Timer Speed" )
228228   PORT_DIPSETTING(    0x00, "Stopped (Cheat)")
229229   PORT_DIPSETTING(    0x03, "Slow" )
src/mame/drivers/pirates.c
r3115r3116
142142//  logerror("%06x: out_w %04x\n",activecpu_get_pc(),data);
143143}
144144
145static READ16_HANDLER( pirates_in1_r )
145static CUSTOM_INPUT( prot_r )
146146{
147147//  static int prot = 0xa3;
148148   int bit;
r3115r3116
169169#endif
170170      bit = 1;
171171
172   /* bit 4 is EEPROM data, bit 7 is protection */
173   return input_port_read(machine, "IN1") | (eeprom_read_bit() << 4) | (bit << 7);
172   return bit;
174173}
175174
176175
r3115r3116
180179static ADDRESS_MAP_START( pirates_readmem, ADDRESS_SPACE_PROGRAM, 16 )
181180   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
182181   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
183   AM_RANGE(0x300000, 0x300001) AM_READ_PORT("IN0")
184   AM_RANGE(0x400000, 0x400001) AM_READ(pirates_in1_r)
182   AM_RANGE(0x300000, 0x300001) AM_READ_PORT("INPUTS")
183   AM_RANGE(0x400000, 0x400001) AM_READ_PORT("SYSTEM")
185184//  AM_RANGE(0x500000, 0x5007ff) AM_READ(SMH_RAM)
186185   AM_RANGE(0x800000, 0x803fff) AM_READ(SMH_RAM)
187186//  AM_RANGE(0x900000, 0x903fff) AM_READ(SMH_RAM)
r3115r3116
210209/* Input Ports */
211210
212211static INPUT_PORTS_START( pirates )
213   PORT_START("IN0")   /* IN0 - 0x300000.w */
212   PORT_START("INPUTS")   /* 0x300000.w */
214213   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
215214   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
216215   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
r3115r3116
228227   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
229228   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
230229
231   PORT_START("IN1")   /* IN1 - 0x400000.w */
230   PORT_START("SYSTEM")   /* 0x400000.w */
232231   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
233232   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
234233   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
235234   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
236   PORT_BIT( 0x0010, IP_ACTIVE_HIGH,IPT_SPECIAL )      // EEPROM data
235   PORT_BIT( 0x0010, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   // EEPROM data
237236   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN )      // seems checked in "test mode"
238237   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN )      // seems checked in "test mode"
239   PORT_BIT( 0x0080, IP_ACTIVE_HIGH,IPT_SPECIAL )      // protection (see pirates_in1_r)
238   PORT_BIT( 0x0080, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_CUSTOM(prot_r, NULL)      // protection
240239   /* What do these bits do ? */
241240   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNKNOWN )
242241   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN )
src/mame/drivers/rotaryf.c
r3115r3116
8080ADDRESS_MAP_END
8181
8282static ADDRESS_MAP_START( rotaryf_io_map, ADDRESS_SPACE_IO, 8 )
83//  AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
84   AM_RANGE(0x21, 0x21) AM_READ(input_port_1_r)
85   AM_RANGE(0x26, 0x26) AM_READ(input_port_3_r)
86   AM_RANGE(0x29, 0x29) AM_READ(input_port_2_r)
83//  AM_RANGE(0x00, 0x00) AM_READ_PORT("UNK")
84   AM_RANGE(0x21, 0x21) AM_READ_PORT("COIN")
85   AM_RANGE(0x26, 0x26) AM_READ_PORT("DSW")
86   AM_RANGE(0x29, 0x29) AM_READ_PORT("INPUTS")
8787ADDRESS_MAP_END
8888
8989
9090static INPUT_PORTS_START( rotaryf )
91   PORT_START("IN0")      /* IN0 */
91   PORT_START("UNK")
9292   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
9393   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
9494   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
r3115r3116
9898   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
9999   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
100100
101   PORT_START("IN1")      /* IN1 */
101   PORT_START("COIN")
102102   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
103103
104   PORT_START("IN2")
104   PORT_START("INPUTS")
105105   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
106106   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
107107   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
r3115r3116
111111   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
112112   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
113113
114   PORT_START("DSW")      /* DSW0 */
114   PORT_START("DSW")
115115   PORT_DIPNAME( 0x81, 0x00, DEF_STR( Lives ) )
116116   PORT_DIPSETTING(    0x81, "3" )
117117   PORT_DIPSETTING(    0x01, "4" )
118118   PORT_DIPSETTING(    0x80, "5" )
119119   PORT_DIPSETTING(    0x00, "6" )
120120   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
121   PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
122   PORT_DIPSETTING( 0x02, DEF_STR( On ) )
121   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
122   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
123123   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
124   PORT_DIPSETTING( 0x04, "1000" )
125   PORT_DIPSETTING( 0x00, "1500" )
124   PORT_DIPSETTING(    0x04, "1000" )
125   PORT_DIPSETTING(    0x00, "1500" )
126126   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Coinage ) )
127127   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
128128   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
129129   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
130   PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
131   PORT_DIPSETTING( 0x10, DEF_STR( On ) )
130   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
131   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
132132   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
133   PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
134   PORT_DIPSETTING( 0x20, DEF_STR( On ) )
133   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
134   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
135135   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
136   PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
137   PORT_DIPSETTING( 0x40, DEF_STR( On ) )
136   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
137   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
138138//  PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
139139//  PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
140140//  PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
src/mame/drivers/nmk16.c
r3115r3116
469469static ADDRESS_MAP_START( tharrier_readmem, ADDRESS_SPACE_PROGRAM, 16 )
470470   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
471471   AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN0")
472   AM_RANGE(0x080002, 0x080003) AM_READ(tharrier_mcu_r) //input_port_1_word_r },
472   AM_RANGE(0x080002, 0x080003) AM_READ(tharrier_mcu_r) // AM_READ_PORT("IN1")
473473   AM_RANGE(0x080004, 0x080005) AM_READ_PORT("DSW1")
474474   AM_RANGE(0x08000e, 0x08000f) AM_READ(soundlatch2_word_r)   /* from Z80 */
475475   AM_RANGE(0x080202, 0x080203) AM_READ_PORT("IN2")
r3115r3116
765765static ADDRESS_MAP_START( hachamf_map, ADDRESS_SPACE_PROGRAM, 16 )
766766   AM_RANGE(0x000000, 0x03ffff) AM_ROM
767767   /* I/O Region */
768   AM_RANGE(0x080000, 0x080001) AM_READ(input_port_0_word_r)
769   AM_RANGE(0x080002, 0x080003) AM_READ(input_port_1_word_r)
770   AM_RANGE(0x080008, 0x080009) AM_READ(input_port_2_word_r)
771   AM_RANGE(0x08000a, 0x08000b) AM_READ(input_port_3_word_r)
768   AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN0")
769   AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1")
770   AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1")
771   AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("UNK")
772772   AM_RANGE(0x08000e, 0x08000f) AM_READ(NMK004_r)
773773   AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w)
774774   AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w)
r3115r3116
11411141
11421142
11431143static INPUT_PORTS_START( vandyke )
1144   PORT_START("IN0")      /* IN0 */
1144   PORT_START("IN0")
11451145   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
11461146   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
11471147   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
11511151   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
11521152   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
11531153
1154   PORT_START("IN1")      /* IN1 */
1154   PORT_START("IN1")
11551155   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
11561156   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
11571157   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
11691169   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
11701170   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
11711171
1172   PORT_START("DSW1")      /* DSW 1 */
1172   PORT_START("DSW1")
11731173   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )   /* The manual states this dip is "Unused" */
11741174   PORT_DIPSETTING(    0x00,  "2" )
11751175   PORT_DIPSETTING(    0x01,  "3" )
r3115r3116
11921192   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
11931193   PORT_DIPSETTING(    0x80, DEF_STR( Hardest ) )
11941194
1195   PORT_START("DSW2")      /* DSW 2 */
1195   PORT_START("DSW2")
11961196   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
11971197   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
11981198   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
12201220INPUT_PORTS_END
12211221
12221222static INPUT_PORTS_START( blkheart )
1223   PORT_START("IN0")      /* IN0 */
1223   PORT_START("IN0")
12241224   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
12251225   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
12261226   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
12301230   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
12311231   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
12321232
1233   PORT_START("IN1")      /* IN1 */
1233   PORT_START("IN1")
12341234   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
12351235   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
12361236   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
12481248   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
12491249   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
12501250
1251   PORT_START("DSW1")      /* DSW 1 */
1251   PORT_START("DSW1")
12521252   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
12531253   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
12541254   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
12701270   PORT_DIPSETTING(    0x80,  "4" )
12711271   PORT_DIPSETTING(    0x00,  "5" )
12721272
1273   PORT_START("DSW2")      /* DSW 2 */
1273   PORT_START("DSW2")
12741274   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
12751275   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
12761276   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
12981298INPUT_PORTS_END
12991299
13001300static INPUT_PORTS_START( manybloc )
1301   PORT_START("IN0")   /* IN0 - 0x080000 */
1301   PORT_START("IN0")   /* 0x080000 */
13021302   PORT_BIT( 0x7fff, IP_ACTIVE_HIGH, IPT_UNUSED )
13031303   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN )      // VBLANK ? Check code at 0x005640
13041304
1305   PORT_START("IN1")   /* IN1 - 0x080002 */
1305   PORT_START("IN1")   /* 0x080002 */
13061306   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_START1 )
13071307   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)   // select fruits
13081308   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)   // help
r3115r3116
13201320   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
13211321   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_COIN2 )
13221322
1323   PORT_START("DSW1")   /* DSW - 0x080004 -> 0x0f0036 */
1323   PORT_START("DSW1")   /* 0x080004 -> 0x0f0036 */
13241324   PORT_DIPNAME( 0x0001, 0x0000, "Slot System" )
13251325   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
13261326   PORT_DIPSETTING(      0x0001, DEF_STR( On ) )
r3115r3116
13771377
13781378
13791379static INPUT_PORTS_START( tharrier )
1380   PORT_START("IN0")      /* IN0 */
1380   PORT_START("IN0")
13811381   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_COIN1 )
13821382   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_COIN2 )
13831383   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_SERVICE1 )
r3115r3116
13861386   PORT_BIT( 0x7fe0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
13871387   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SPECIAL ) /* Mcu status? */
13881388
1389   PORT_START("IN1")      /* IN1 */
1389   PORT_START("IN1")
13901390   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1)
13911391   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2) //title
13921392   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3115r3116
14041404   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
14051405   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
14061406
1407   PORT_START("DSW1")      /* DSW */
1407   PORT_START("DSW1")
14081408   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
14091409   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
14101410   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r3115r3116
14511451   PORT_DIPSETTING(      0x8000, "4" )
14521452   PORT_DIPSETTING(      0x0000, "5" )
14531453
1454   PORT_START("IN2")      /* IN2 ? */
1454   PORT_START("IN2")
14551455   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN )
14561456   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1)
14571457   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(1)
r3115r3116
14731473
14741474
14751475static INPUT_PORTS_START( mustang )
1476   PORT_START("IN0")      /* IN0 */
1476   PORT_START("IN0")
14771477   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
14781478   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
14791479   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
14831483   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
14841484   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
14851485
1486   PORT_START("IN1")      /* IN1 */
1486   PORT_START("IN1")
14871487   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
14881488   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
14891489   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
15011501   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15021502   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15031503
1504   PORT_START("DSW1")      /* DSW */
1504   PORT_START("DSW1")
15051505   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
15061506   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
15071507   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r3115r3116
15541554INPUT_PORTS_END
15551555
15561556static INPUT_PORTS_START( hachamf )
1557   PORT_START("IN0")      /* IN0 */
1557   PORT_START("IN0")
15581558   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
15591559   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
15601560   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
15641564   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
15651565   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //bryan:  test mode in some games?
15661566
1567   PORT_START("IN1")      /* IN1 */
1567   PORT_START("IN1")
15681568   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
15691569   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
15701570   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
15821582   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15831583   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15841584
1585   PORT_START("DSW1")      /* DSW A */
1585   PORT_START("DSW1")
15861586   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )
15871587   PORT_DIPSETTING(    0x0100, DEF_STR( 4C_1C ) )
15881588   PORT_DIPSETTING(    0x0200, DEF_STR( 3C_1C ) )
r3115r3116
16071607   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
16081608   PORT_DIPSETTING(    0x8000, DEF_STR( Off ) )
16091609   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
1610                  /* DSW B */
1610
16111611   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
16121612   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
16131613   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
16301630   PORT_DIPSETTING(    0x40, "2" )
16311631   PORT_DIPSETTING(    0xc0, "3" )
16321632   PORT_DIPSETTING(    0x80, "4" )
1633
1634   PORT_START("UNK")
16331635INPUT_PORTS_END
16341636
16351637static INPUT_PORTS_START( strahl )
1636   PORT_START("IN0")      /* IN0 */
1638   PORT_START("IN0")
16371639   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
16381640   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
16391641   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
16431645   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
16441646   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //bryan:  test mode in some games?
16451647
1646   PORT_START("IN1")      /* IN1 */
1648   PORT_START("IN1")
16471649   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
16481650   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
16491651   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
16611663   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
16621664   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
16631665
1664   PORT_START("DSW1")      /* DSW A */
1666   PORT_START("DSW1")
16651667   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
16661668   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
16671669   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
r3115r3116
16871689   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
16881690   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
16891691
1690   PORT_START("DSW2")      /* DSW B */
1692   PORT_START("DSW2")
16911693   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
16921694   PORT_DIPSETTING(    0x02, "2" )
16931695   PORT_DIPSETTING(    0x03, "3" )
r3115r3116
17101712INPUT_PORTS_END
17111713
17121714static INPUT_PORTS_START( acrobatm )
1713   PORT_START("IN0")      /* IN0 */
1715   PORT_START("IN0")
17141716   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
17151717   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
17161718   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
17201722   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
17211723   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
17221724
1723   PORT_START("IN1")      /* IN1 */
1725   PORT_START("IN1")
17241726   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
17251727   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
17261728   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
17381740   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
17391741   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
17401742
1741   PORT_START("DSW1")      /* DSW A */
1743   PORT_START("DSW1")
17421744   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) )
17431745   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
17441746   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r3115r3116
17641766   PORT_DIPSETTING(      0x00A0, DEF_STR( 1C_3C ) )
17651767   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
17661768
1767   PORT_START("DSW2")      /* DSW B */
1769   PORT_START("DSW2")
17681770   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
17691771   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )
17701772   PORT_DIPSETTING(    0x02, "50k and 100k" )
r3115r3116
17871789INPUT_PORTS_END
17881790
17891791static INPUT_PORTS_START( bioship )
1790   PORT_START("IN0")      /* IN0 */
1792   PORT_START("IN0")
17911793   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
17921794   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
17931795   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
17971799   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
17981800   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //bryan:  test mode in some games?
17991801
1800   PORT_START("IN1")      /* IN1 */
1802   PORT_START("IN1")
18011803   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
18021804   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
18031805   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
18151817   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
18161818   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
18171819
1818   PORT_START("DSW1")      /* DSW A */
1820   PORT_START("DSW1")
18191821   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
18201822   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
18211823   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r3115r3116
18371839   PORT_DIPSETTING(      0x0080, "4" )
18381840   PORT_DIPSETTING(      0x0040, "5" )
18391841
1840   PORT_START("DSW2")      /* DSW B */
1842   PORT_START("DSW2")
18411843   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
18421844   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
18431845   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r3115r3116
18651867INPUT_PORTS_END
18661868
18671869static INPUT_PORTS_START( tdragon )
1868   PORT_START("IN0")      /* IN0 */
1870   PORT_START("IN0")
18691871   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
18701872   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
18711873   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
18751877   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
18761878   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
18771879
1878   PORT_START("IN1")      /* IN1 */
1880   PORT_START("IN1")
18791881   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
18801882   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
18811883   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
18931895   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
18941896   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
18951897
1896   PORT_START("DSW1")      /* DSW 1 */
1898   PORT_START("DSW1")
18971899   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
18981900   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
18991901   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r3115r3116
19171919   PORT_DIPSETTING(      0x00c0, "3" )
19181920   PORT_DIPSETTING(      0x0080, "4" )
19191921
1920   PORT_START("DSW2")      /* DSW 2 */
1922   PORT_START("DSW2")
19211923   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
19221924   PORT_DIPSETTING(      0x0004, DEF_STR( 4C_1C ) )
19231925   PORT_DIPSETTING(      0x0005, DEF_STR( 3C_1C ) )
r3115r3116
19451947INPUT_PORTS_END
19461948
19471949static INPUT_PORTS_START( tdragonb )
1948   PORT_START("IN0")      /* IN0 */
1950   PORT_START("IN0")
19491951   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
19501952   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
19511953   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
19551957   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
19561958   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
19571959
1958   PORT_START("IN1")      /* IN1 */
1960   PORT_START("IN1")
19591961   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
19601962   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
19611963   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
19731975   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
19741976   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
19751977
1976   PORT_START("DSW1")      /* DSW 1 */
1978   PORT_START("DSW1")
19771979   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) )
19781980   PORT_DIPSETTING(      0x0000, "1" )
19791981   PORT_DIPSETTING(      0x0002, "2" )
r3115r3116
19971999   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
19982000   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
19992001
2000   PORT_START("DSW2")   /* DSW 2 */
2002   PORT_START("DSW2")
20012003   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
20022004   PORT_DIPSETTING(      0x0004, DEF_STR( 4C_1C ) )
20032005   PORT_DIPSETTING(      0x0005, DEF_STR( 3C_1C ) )
r3115r3116
20282030INPUT_PORTS_END
20292031
20302032static INPUT_PORTS_START( ssmissin )
2031   PORT_START("IN0")      /* IN0 */
2033   PORT_START("IN0")
20322034   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
20332035   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
20342036   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )      // "Servise" in "test mode"
r3115r3116
20382040   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
20392041   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
20402042
2041   PORT_START("IN1")      /* IN1 */
2043   PORT_START("IN1")
20422044   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
20432045   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
20442046   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
20562058   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
20572059   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
20582060
2059   PORT_START("DSW1")   /* DSW 1 */
2061   PORT_START("DSW1")
20602062   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
20612063   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
20622064   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r3115r3116
21182120INPUT_PORTS_END
21192121
21202122static INPUT_PORTS_START( airattck )
2121   PORT_START("IN0")      /* IN0 */
2123   PORT_START("IN0")
21222124   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
21232125   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
21242126   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )      // "Servise" in "test mode"
r3115r3116
21282130   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
21292131   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
21302132
2131   PORT_START("IN1")      /* IN1 */
2133   PORT_START("IN1")
21322134   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
21332135   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
21342136   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
21462148   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
21472149   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
21482150
2149   PORT_START("DSW1")      /* DSW 1 */
2151   PORT_START("DSW1")
21502152   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
21512153   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
21522154   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r3115r3116
21962198INPUT_PORTS_END
21972199
21982200static INPUT_PORTS_START( macross )
2199   PORT_START("IN0")      /* IN0 */
2201   PORT_START("IN0")
22002202   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
22012203   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
22022204   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
22062208   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
22072209   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
22082210
2209   PORT_START("IN1")      /* IN1 */
2211   PORT_START("IN1")
22102212   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
22112213   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
22122214   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
22242226   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
22252227   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
22262228
2227   PORT_START("DSW1")      /* DSW A */
2229   PORT_START("DSW1")
22282230   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
22292231   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
22302232   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
r3115r3116
22462248   PORT_DIPSETTING(    0xc0, "3" )
22472249   PORT_DIPSETTING(    0x80, "4" )
22482250
2249   PORT_START("DSW2")      /* DSW B */
2251   PORT_START("DSW2")
22502252   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_B ) )
22512253   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
22522254   PORT_DIPSETTING(    0x0a, DEF_STR( 3C_1C ) )
r3115r3116
22842286INPUT_PORTS_END
22852287
22862288static INPUT_PORTS_START( macross2 )
2287   PORT_START("IN0")      /* IN0 */
2289   PORT_START("IN0")
22882290   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
22892291   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
22902292   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
22942296   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
22952297   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
22962298
2297   PORT_START("IN1")      /* IN1 */
2299   PORT_START("IN1")
22982300   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
22992301   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
23002302   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
23122314   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
23132315   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
23142316
2315   PORT_START("DSW1")      /* DSW A */
2317   PORT_START("DSW1")
23162318   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
23172319   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
23182320   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
r3115r3116
23352337   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
23362338   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
23372339
2338   PORT_START("DSW2")      /* DSW B */
2340   PORT_START("DSW2")
23392341   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_B ) )
23402342   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
23412343   PORT_DIPSETTING(    0x0a, DEF_STR( 3C_1C ) )
r3115r3116
23732375INPUT_PORTS_END
23742376
23752377static INPUT_PORTS_START( tdragon2 )
2376   PORT_START("IN0")      /* IN0 */
2378   PORT_START("IN0")
23772379   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
23782380   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
23792381   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
23832385   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
23842386   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
23852387
2386   PORT_START("IN1")      /* IN1 */
2388   PORT_START("IN1")
23872389   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
23882390   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
23892391   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
24012403   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
24022404   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
24032405
2404   PORT_START("DSW1")      /* DSW A */
2406   PORT_START("DSW1")
24052407   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
24062408   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
24072409   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
r3115r3116
24232425   PORT_DIPSETTING(    0xc0, "3" )
24242426   PORT_DIPSETTING(    0x80, "4" )
24252427
2426   PORT_START("DSW2")      /* DSW B */
2428   PORT_START("DSW2")
24272429   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_B ) )
24282430   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
24292431   PORT_DIPSETTING(    0x0a, DEF_STR( 3C_1C ) )
r3115r3116
24612463INPUT_PORTS_END
24622464
24632465static INPUT_PORTS_START( gunnail )
2464   PORT_START("IN0")      /* IN0 */
2466   PORT_START("IN0")
24652467   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
24662468   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
24672469   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
24712473   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
24722474   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
24732475
2474   PORT_START("IN1")      /* IN1 */
2476   PORT_START("IN1")
24752477   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
24762478   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
24772479   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
24892491   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
24902492   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
24912493
2492   PORT_START("DSW1")      /* DSW A */
2494   PORT_START("DSW1")
24932495   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
24942496   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
24952497   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
25142516   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
25152517   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
25162518
2517   PORT_START("DSW2")      /* DSW B */
2519   PORT_START("DSW2")
25182520   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) /* The manual states this dip is "Unused" */
25192521   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
25202522   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
25422544INPUT_PORTS_END
25432545
25442546static INPUT_PORTS_START( raphero )
2545   PORT_START("IN0")      /* IN0 */
2547   PORT_START("IN0")
25462548   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
25472549   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
25482550   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
25522554   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
25532555   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
25542556
2555   PORT_START("IN1")      /* IN1 */
2557   PORT_START("IN1")
25562558   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
25572559   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
25582560   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
25702572   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
25712573   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
25722574
2573   PORT_START("DSW1")      /* DSW A */
2575   PORT_START("DSW1")
25742576   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
25752577   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Language ) ) /* Doesn't seem to have any effect */
25762578   PORT_DIPSETTING(    0x02, DEF_STR( Japanese ) )
r3115r3116
25922594   PORT_DIPSETTING(    0xc0, "3" )
25932595   PORT_DIPSETTING(    0x80, "4" )
25942596
2595   PORT_START("DSW2")      /* DSW B */
2597   PORT_START("DSW2")
25962598   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
25972599   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
25982600   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
26202622INPUT_PORTS_END
26212623
26222624static INPUT_PORTS_START( sabotenb )
2623   PORT_START("IN0")      /* IN0 */
2625   PORT_START("IN0")
26242626   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
26252627   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
26262628   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
26302632   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
26312633   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
26322634
2633   PORT_START("IN1")      /* IN1 */
2635   PORT_START("IN1")
26342636   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
26352637   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
26362638   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
26482650   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
26492651   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
26502652
2651   PORT_START("DSW1")      /* DSW A */
2653   PORT_START("DSW1")
26522654   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
26532655   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
26542656   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
26662668   PORT_DIPSETTING(    0xc0, "3" )
26672669   PORT_DIPSETTING(    0x80, "4" )
26682670
2669   PORT_START("DSW2")      /* DSW B */
2671   PORT_START("DSW2")
26702672   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) /* The manual states this dip is "Unused" */
26712673   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
26722674   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
26942696INPUT_PORTS_END
26952697
26962698static INPUT_PORTS_START( bjtwin )
2697   PORT_START("IN0")      /* IN0 */
2699   PORT_START("IN0")
26982700   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
26992701   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
27002702   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
27042706   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
27052707   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* Maybe unused */
27062708
2707   PORT_START("IN1")      /* IN1 */
2709   PORT_START("IN1")
27082710   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
27092711   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
27102712   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
27222724   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
27232725   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
27242726
2725   PORT_START("DSW1")      /* DSW A */
2727   PORT_START("DSW1")
27262728   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
27272729   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
27282730   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
27462748   PORT_DIPSETTING(    0xc0, "3" )
27472749   PORT_DIPSETTING(    0x80, "4" )
27482750
2749   PORT_START("DSW2")      /* DSW B */
2751   PORT_START("DSW2")
27502752   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
27512753   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
27522754   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
27742776INPUT_PORTS_END
27752777
27762778static INPUT_PORTS_START( nouryoku )
2777   PORT_START("IN0")      /* IN0 */
2779   PORT_START("IN0")
27782780   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
27792781   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
27802782   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r3115r3116
27842786   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
27852787   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
27862788
2787   PORT_START("IN1")      /* IN1 */
2789   PORT_START("IN1")
27882790   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
27892791   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
27902792   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r3115r3116
28022804   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
28032805   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
28042806
2805   PORT_START("DSW1")      /* DSW A */
2807   PORT_START("DSW1")
28062808   PORT_DIPNAME( 0x03, 0x03, "Life Decrease Speed" )
28072809   PORT_DIPSETTING(    0x02, "Slow" )
28082810   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
r3115r3116
28262828   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
28272829   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
28282830
2829   PORT_START("DSW2")      /* DSW B */
2831   PORT_START("DSW2")
28302832   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) /* The manual states this dip is "Unused" */
28312833   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
28322834   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r3115r3116
69866988
69876989// bee-oh board - different display / interrupt timing to others?
69886990GAME( 1991, manybloc, 0,        manybloc, manybloc, 0,        ROT270,             "Bee-Oh",            "Many Block", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
6989
src/mame/drivers/nitedrvr.c
r3115r3116
131131
132132/* Machine Initialization */
133133
134static TIMER_CALLBACK( nitedrvr_crash_toggle_callback )
135{
136   nitedrvr_crash_toggle(machine);
137}
138
139static MACHINE_RESET( nitedrvr )
140{
141   timer_pulse(PERIOD_OF_555_ASTABLE(RES_K(180), 330, CAP_U(1)), NULL, 0, nitedrvr_crash_toggle_callback);
142   nitedrvr_register_machine_vars();
143}
144
145134/* Machine Driver */
146135
147136static MACHINE_DRIVER_START( nitedrvr )
r3115r3116
151140   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
152141   MDRV_WATCHDOG_VBLANK_INIT(3)
153142
143   MDRV_MACHINE_START(nitedrvr)
154144   MDRV_MACHINE_RESET(nitedrvr)
155145
156146   // video hardware
src/tools/chdman.c
r3115r3116
15531553      {
15541554         avierr = avi_append_sound_samples(avi, chnum, avconfig.audio[chnum], numsamples, 0);
15551555         if (avierr != AVIERR_NONE)
1556         {
1557            fprintf(stderr, "Error writing samples for hunk %d to AVI file: %s\n", firstframe + framenum, avi_error_string(avierr));
15561558            goto cleanup;
1559         }
15571560      }
15581561
15591562      /* write video */
r3115r3116
15611564      {
15621565         avierr = avi_append_video_frame_yuy16(avi, fullbitmap);
15631566         if (avierr != AVIERR_NONE)
1567         {
1568            fprintf(stderr, "Error writing video for hunk %d to AVI file: %s\n", firstframe + framenum, avi_error_string(avierr));
15641569            goto cleanup;
1570         }
15651571      }
15661572   }
15671573   progress(TRUE, "Extraction complete!                    \n");
src/osd/windows/windows.mak
r3115r3116
3535# UNICODE = 1
3636
3737# set this to the minimum Direct3D version to support (8 or 9)
38DIRECT3D = 8
38# DIRECT3D = 9
3939
4040# set this to the minimum DirectInput version to support (7 or 8)
41DIRECTINPUT = 7
41# DIRECTINPUT = 8
4242
4343
4444
r3115r3116
203203# add the windows libraries
204204LIBS += -luser32 -lgdi32 -lddraw -ldsound -ldxguid -lwinmm -ladvapi32 -lcomctl32 -lshlwapi
205205
206ifeq ($(DIRECTINPUT),7)
206ifeq ($(DIRECTINPUT),8)
207LIBS += -ldinput8
208CFLAGS += -DDIRECTINPUT_VERSION=0x0800
209else
207210LIBS += -ldinput
208211CFLAGS += -DDIRECTINPUT_VERSION=0x0700
209else
210LIBS += -ldinput8
211CFLAGS += -DDIRECTINPUT_VERSION=0x0800
212212endif
213213
214214ifdef PTR64
r3115r3116
262262   $(WINOBJ)/window.o \
263263   $(WINOBJ)/winmain.o
264264
265ifeq ($(DIRECT3D),8)
265ifeq ($(DIRECT3D),9)
266CFLAGS += -DDIRECT3D_VERSION=0x0900
267else
266268OSDOBJS += $(WINOBJ)/d3d8intf.o
267else
268CFLAGS += -DDIRECT3D_VERSION=0x0900
269269endif
270270
271271# extra dependencies
src/osd/windows/drawd3d.c
r3115r3116
16891689      DWORD usage = d3d->dynamic_supported ? D3DUSAGE_DYNAMIC : 0;
16901690      DWORD pool = d3d->dynamic_supported ? D3DPOOL_DEFAULT : D3DPOOL_MANAGED;
16911691      int maxdim = MAX(d3d->presentation.BackBufferWidth, d3d->presentation.BackBufferHeight);
1692      int attempt;
16921693
16931694      // pick the format
16941695      if (PRIMFLAG_GET_TEXFORMAT(flags) == TEXFORMAT_YUY16)
r3115r3116
17101711      if (texture->xprescale != video_config.prescale || texture->yprescale != video_config.prescale)
17111712         mame_printf_verbose("Direct3D: adjusting prescale from %dx%d to %dx%d\n", video_config.prescale, video_config.prescale, texture->xprescale, texture->yprescale);
17121713
1713      // screen textures with no prescaling are pretty easy
1714      if (texture->xprescale == 1 && texture->yprescale == 1)
1714      // loop until we allocate something or error
1715      for (attempt = 0; attempt < 2; attempt++)
17151716      {
1716         result = (*d3dintf->device.create_texture)(d3d->device, texture->rawwidth, texture->rawheight, 1, usage, format, pool, &texture->d3dtex);
1717         if (result != D3D_OK)
1718            goto error;
1719         texture->d3dfinaltex = texture->d3dtex;
1720         texture->type = d3d->dynamic_supported ? TEXTURE_TYPE_DYNAMIC : TEXTURE_TYPE_PLAIN;
1721      }
1717         // second attempt is always 1:1
1718         if (attempt == 1)
1719            texture->xprescale = texture->yprescale = 1;
17221720
1723      // screen textures with prescaling require two allocations
1724      else
1725      {
1726         int scwidth, scheight;
1727
1728         // use an offscreen plain surface for stretching if supported
1729         if (d3d->stretch_supported)
1721         // screen textures with no prescaling are pretty easy
1722         if (texture->xprescale == 1 && texture->yprescale == 1)
17301723         {
1731            result = (*d3dintf->device.create_offscreen_plain_surface)(d3d->device, texture->rawwidth, texture->rawheight, format, D3DPOOL_DEFAULT, &texture->d3dsurface);
1732            if (result != D3D_OK)
1733               goto error;
1734            texture->type = TEXTURE_TYPE_SURFACE;
1724            result = (*d3dintf->device.create_texture)(d3d->device, texture->rawwidth, texture->rawheight, 1, usage, format, pool, &texture->d3dtex);
1725            if (result == D3D_OK)
1726            {
1727               texture->d3dfinaltex = texture->d3dtex;
1728               texture->type = d3d->dynamic_supported ? TEXTURE_TYPE_DYNAMIC : TEXTURE_TYPE_PLAIN;
1729               break;
1730            }
17351731         }
17361732
1737         // otherwise, we allocate a dynamic texture for the source
1733         // screen textures with prescaling require two allocations
17381734         else
17391735         {
1740            result = (*d3dintf->device.create_texture)(d3d->device, texture->rawwidth, texture->rawheight, 1, usage, format, pool, &texture->d3dtex);
1741            if (result != D3D_OK)
1742               goto error;
1743            texture->type = d3d->dynamic_supported ? TEXTURE_TYPE_DYNAMIC : TEXTURE_TYPE_PLAIN;
1736            int scwidth, scheight;
1737            int finalfmt;
1738
1739            // use an offscreen plain surface for stretching if supported
1740            // (won't work for YUY textures)
1741            if (d3d->stretch_supported && PRIMFLAG_GET_TEXFORMAT(flags) != TEXFORMAT_YUY16)
1742            {
1743               result = (*d3dintf->device.create_offscreen_plain_surface)(d3d->device, texture->rawwidth, texture->rawheight, format, D3DPOOL_DEFAULT, &texture->d3dsurface);
1744               if (result != D3D_OK)
1745                  continue;
1746               texture->type = TEXTURE_TYPE_SURFACE;
1747            }
1748
1749            // otherwise, we allocate a dynamic texture for the source
1750            else
1751            {
1752               result = (*d3dintf->device.create_texture)(d3d->device, texture->rawwidth, texture->rawheight, 1, usage, format, pool, &texture->d3dtex);
1753               if (result != D3D_OK)
1754                  continue;
1755               texture->type = d3d->dynamic_supported ? TEXTURE_TYPE_DYNAMIC : TEXTURE_TYPE_PLAIN;
1756            }
1757
1758            // for the target surface, we allocate a render target texture
1759            scwidth = texture->rawwidth * texture->xprescale;
1760            scheight = texture->rawheight * texture->yprescale;
1761
1762            // target surfaces typically cannot be YCbCr, so we always pick RGB in that case
1763             finalfmt = (format != d3d->yuv_format) ? format : D3DFMT_A8R8G8B8;
1764            result = (*d3dintf->device.create_texture)(d3d->device, scwidth, scheight, 1, D3DUSAGE_RENDERTARGET, finalfmt, D3DPOOL_DEFAULT, &texture->d3dfinaltex);
1765            if (result == D3D_OK)
1766               break;
1767            (*d3dintf->texture.release)(texture->d3dtex);
1768            texture->d3dtex = NULL;
17441769         }
1745
1746         // for the target surface, we allocate a render target texture
1747         scwidth = texture->rawwidth * texture->xprescale;
1748         scheight = texture->rawheight * texture->yprescale;
1749         result = (*d3dintf->device.create_texture)(d3d->device, scwidth, scheight, 1, D3DUSAGE_RENDERTARGET, format, D3DPOOL_DEFAULT, &texture->d3dfinaltex);
1750         if (result != D3D_OK)
1751            goto error;
17521770      }
17531771   }
17541772
src/emu/debug/debugcpu.c
r3115r3116
21332133
21342134
21352135/*-------------------------------------------------
2136    expression_cpu_index - return the CPU index
2137    based on a case insensitive tag search
2138-------------------------------------------------*/
2139
2140static int expression_cpu_index(running_machine *machine, const char *tag)
2141{
2142   int index;
2143
2144   for (index = 0; index < ARRAY_LENGTH(machine->config->cpu); index++)
2145      if (machine->config->cpu[index].tag != NULL && mame_stricmp(machine->config->cpu[index].tag, tag) == 0)
2146         return index;
2147
2148   return -1;
2149}
2150
2151
2152/*-------------------------------------------------
21362153    expression_read_memory - read 1,2,4 or 8 bytes
21372154    at the given offset in the given address
21382155    space
r3115r3116
21472164      case EXPSPACE_PROGRAM:
21482165      case EXPSPACE_DATA:
21492166      case EXPSPACE_IO:
2150         cpuindex = (name != NULL) ? mame_find_cpu_index(Machine, name) : cpu_getactivecpu();
2167         cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpu_getactivecpu();
21512168         if (cpuindex < 0)
21522169            break;
21532170         return expression_read_address_space(cpuindex, ADDRESS_SPACE_PROGRAM + (space - EXPSPACE_PROGRAM), address, size);
21542171
21552172      case EXPSPACE_OPCODE:
21562173      case EXPSPACE_RAMWRITE:
2157         cpuindex = (name != NULL) ? mame_find_cpu_index(Machine, name) : cpu_getactivecpu();
2174         cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpu_getactivecpu();
21582175         if (cpuindex < 0)
21592176            break;
21602177         if (name == NULL)
r3115r3116
23562373      case EXPSPACE_PROGRAM:
23572374      case EXPSPACE_DATA:
23582375      case EXPSPACE_IO:
2359         cpuindex = (name != NULL) ? mame_find_cpu_index(Machine, name) : cpu_getactivecpu();
2376         cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpu_getactivecpu();
23602377         if (cpuindex < 0)
23612378            break;
23622379         expression_write_address_space(cpuindex, ADDRESS_SPACE_PROGRAM + (space - EXPSPACE_PROGRAM), address, size, data);
r3115r3116
23642381
23652382      case EXPSPACE_OPCODE:
23662383      case EXPSPACE_RAMWRITE:
2367         cpuindex = (name != NULL) ? mame_find_cpu_index(Machine, name) : cpu_getactivecpu();
2384         cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpu_getactivecpu();
23682385         if (cpuindex < 0)
23692386            break;
23702387         expression_write_program_direct(cpuindex, (space == EXPSPACE_OPCODE), address, size, data);
r3115r3116
25892606      case EXPSPACE_PROGRAM:
25902607      case EXPSPACE_DATA:
25912608      case EXPSPACE_IO:
2592         cpuindex = (name != NULL) ? mame_find_cpu_index(Machine, name) : cpu_getactivecpu();
2609         cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpu_getactivecpu();
25932610         if (cpuindex < 0)
25942611            return (name == NULL) ? EXPRERR_MISSING_MEMORY_NAME : EXPRERR_INVALID_MEMORY_NAME;
25952612         if (cpunum_addrbus_width(cpuindex, ADDRESS_SPACE_PROGRAM + (space - EXPSPACE_PROGRAM)) == 0)
r3115r3116
25982615
25992616      case EXPSPACE_OPCODE:
26002617      case EXPSPACE_RAMWRITE:
2601         cpuindex = (name != NULL) ? mame_find_cpu_index(Machine, name) : cpu_getactivecpu();
2618         cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpu_getactivecpu();
26022619         if (cpuindex < 0)
26032620            return (name == NULL) ? EXPRERR_MISSING_MEMORY_NAME : EXPRERR_INVALID_MEMORY_NAME;
26042621         break;
src/emu/cpu/m68000/m68kcpu.h
r3115r3116
896896   uint cyc_movem_l;
897897   uint cyc_shift;
898898   uint cyc_reset;
899
900   /* Virtual IRQ lines state */
901   uint virq_state;
902
899903   const uint8* cyc_instruction;
900904   const uint8* cyc_exception;
901905
src/emu/cpu/m68000/m68kmame.c
r3115r3116
2222
2323static UINT16 m68008_read_immediate_16(offs_t address)
2424{
25   offs_t addr = (address) ^ m68k_memory_intf.opcode_xor;
25   offs_t addr = address;
2626   return (cpu_readop(addr) << 8) | (cpu_readop(addr + 1));
2727}
2828
r3115r3116
5252static const m68k_memory_interface interface_d16 =
5353{
5454   0,
55   read_immediate_16,
55   cpu_readop16,
5656   program_read_byte_16be,
5757   program_read_word_16be,
5858   program_read_dword_16be,
r3115r3116
142142{
143143   if (irqline == INPUT_LINE_NMI)
144144      irqline = 7;
145   switch(state)
146   {
147      case CLEAR_LINE:
148         m68k_set_irq(0);
149         break;
150      case ASSERT_LINE:
151         m68k_set_irq(irqline);
152         break;
153      default:
154         m68k_set_irq(irqline);
155         break;
156   }
145
146   m68k_set_virq(irqline, state == ASSERT_LINE ? 1 : 0);
157147}
158148
159149
r3115r3116
475465      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 0;               break;
476466      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO:       info->i = 0;               break;
477467
478      case CPUINFO_INT_INPUT_STATE + 0:            info->i = 0;   /* fix me */         break;
479      case CPUINFO_INT_INPUT_STATE + 1:            info->i = 0;   /* fix me */         break;
480      case CPUINFO_INT_INPUT_STATE + 2:            info->i = 0;   /* fix me */         break;
481      case CPUINFO_INT_INPUT_STATE + 3:            info->i = 0;   /* fix me */         break;
482      case CPUINFO_INT_INPUT_STATE + 4:            info->i = 0;   /* fix me */         break;
483      case CPUINFO_INT_INPUT_STATE + 5:            info->i = 0;   /* fix me */         break;
484      case CPUINFO_INT_INPUT_STATE + 6:            info->i = 0;   /* fix me */         break;
485      case CPUINFO_INT_INPUT_STATE + 7:            info->i = 0;   /* fix me */         break;
468      case CPUINFO_INT_INPUT_STATE + 0:            info->i = 0;  /* there is no level 0 */   break;
469      case CPUINFO_INT_INPUT_STATE + 1:            info->i = m68k_get_virq(1);            break;
470      case CPUINFO_INT_INPUT_STATE + 2:            info->i = m68k_get_virq(2);            break;
471      case CPUINFO_INT_INPUT_STATE + 3:            info->i = m68k_get_virq(3);            break;
472      case CPUINFO_INT_INPUT_STATE + 4:            info->i = m68k_get_virq(4);            break;
473      case CPUINFO_INT_INPUT_STATE + 5:            info->i = m68k_get_virq(5);            break;
474      case CPUINFO_INT_INPUT_STATE + 6:            info->i = m68k_get_virq(6);            break;
475      case CPUINFO_INT_INPUT_STATE + 7:            info->i = m68k_get_virq(7);            break;
486476
487477      case CPUINFO_INT_PREVIOUSPC:               info->i = m68k_get_reg(NULL, M68K_REG_PPC); break;
488478
r3115r3116
653643      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 0;               break;
654644      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO:       info->i = 0;               break;
655645
656      case CPUINFO_INT_INPUT_STATE + 0:            info->i = 0;   /* fix me */         break;
657      case CPUINFO_INT_INPUT_STATE + 1:            info->i = 0;   /* fix me */         break;
658      case CPUINFO_INT_INPUT_STATE + 2:            info->i = 0;   /* fix me */         break;
659      case CPUINFO_INT_INPUT_STATE + 3:            info->i = 0;   /* fix me */         break;
660      case CPUINFO_INT_INPUT_STATE + 4:            info->i = 0;   /* fix me */         break;
661      case CPUINFO_INT_INPUT_STATE + 5:            info->i = 0;   /* fix me */         break;
662      case CPUINFO_INT_INPUT_STATE + 6:            info->i = 0;   /* fix me */         break;
663      case CPUINFO_INT_INPUT_STATE + 7:            info->i = 0;   /* fix me */         break;
646      case CPUINFO_INT_INPUT_STATE + 0:            info->i = 0;  /* there is no level 0 */   break;
647      case CPUINFO_INT_INPUT_STATE + 1:            info->i = m68k_get_virq(1);            break;
648      case CPUINFO_INT_INPUT_STATE + 2:            info->i = m68k_get_virq(2);            break;
649      case CPUINFO_INT_INPUT_STATE + 3:            info->i = m68k_get_virq(3);            break;
650      case CPUINFO_INT_INPUT_STATE + 4:            info->i = m68k_get_virq(4);            break;
651      case CPUINFO_INT_INPUT_STATE + 5:            info->i = m68k_get_virq(5);            break;
652      case CPUINFO_INT_INPUT_STATE + 6:            info->i = m68k_get_virq(6);            break;
653      case CPUINFO_INT_INPUT_STATE + 7:            info->i = m68k_get_virq(7);            break;
664654
665655      case CPUINFO_INT_PREVIOUSPC:               info->i = m68k_get_reg(NULL, M68K_REG_PPC); break;
666656
r3115r3116
885875      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 0;               break;
886876      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO:       info->i = 0;               break;
887877
888      case CPUINFO_INT_INPUT_STATE + 0:            info->i = 0;   /* fix me */         break;
889      case CPUINFO_INT_INPUT_STATE + 1:            info->i = 1;   /* fix me */         break;
890      case CPUINFO_INT_INPUT_STATE + 2:            info->i = 2;   /* fix me */         break;
891      case CPUINFO_INT_INPUT_STATE + 3:            info->i = 3;   /* fix me */         break;
892      case CPUINFO_INT_INPUT_STATE + 4:            info->i = 4;   /* fix me */         break;
893      case CPUINFO_INT_INPUT_STATE + 5:            info->i = 5;   /* fix me */         break;
894      case CPUINFO_INT_INPUT_STATE + 6:            info->i = 6;   /* fix me */         break;
895      case CPUINFO_INT_INPUT_STATE + 7:            info->i = 7;   /* fix me */         break;
878      case CPUINFO_INT_INPUT_STATE + 0:            info->i = 0;  /* there is no level 0 */   break;
879      case CPUINFO_INT_INPUT_STATE + 1:            info->i = m68k_get_virq(1);            break;
880      case CPUINFO_INT_INPUT_STATE + 2:            info->i = m68k_get_virq(2);            break;
881      case CPUINFO_INT_INPUT_STATE + 3:            info->i = m68k_get_virq(3);            break;
882      case CPUINFO_INT_INPUT_STATE + 4:            info->i = m68k_get_virq(4);            break;
883      case CPUINFO_INT_INPUT_STATE + 5:            info->i = m68k_get_virq(5);            break;
884      case CPUINFO_INT_INPUT_STATE + 6:            info->i = m68k_get_virq(6);            break;
885      case CPUINFO_INT_INPUT_STATE + 7:            info->i = m68k_get_virq(7);            break;
896886
897887      case CPUINFO_INT_PREVIOUSPC:               info->i = m68k_get_reg(NULL, M68K_REG_PPC); break;
898888
r3115r3116
11231113      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 0;               break;
11241114      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO:       info->i = 0;               break;
11251115
1126      case CPUINFO_INT_INPUT_STATE + 0:            info->i = 0;   /* fix me */         break;
1127      case CPUINFO_INT_INPUT_STATE + 1:            info->i = 1;   /* fix me */         break;
1128      case CPUINFO_INT_INPUT_STATE + 2:            info->i = 2;   /* fix me */         break;
1129      case CPUINFO_INT_INPUT_STATE + 3:            info->i = 3;   /* fix me */         break;
1130      case CPUINFO_INT_INPUT_STATE + 4:            info->i = 4;   /* fix me */         break;
1131      case CPUINFO_INT_INPUT_STATE + 5:            info->i = 5;   /* fix me */         break;
1132      case CPUINFO_INT_INPUT_STATE + 6:            info->i = 6;   /* fix me */         break;
1133      case CPUINFO_INT_INPUT_STATE + 7:            info->i = 7;   /* fix me */         break;
1116      case CPUINFO_INT_INPUT_STATE + 0:            info->i = 0;  /* there is no level 0 */   break;
1117      case CPUINFO_INT_INPUT_STATE + 1:            info->i = m68k_get_virq(1);            break;
1118      case CPUINFO_INT_INPUT_STATE + 2:            info->i = m68k_get_virq(2);            break;
1119      case CPUINFO_INT_INPUT_STATE + 3:            info->i = m68k_get_virq(3);            break;
1120      case CPUINFO_INT_INPUT_STATE + 4:            info->i = m68k_get_virq(4);            break;
1121      case CPUINFO_INT_INPUT_STATE + 5:            info->i = m68k_get_virq(5);            break;
1122      case CPUINFO_INT_INPUT_STATE + 6:            info->i = m68k_get_virq(6);            break;
1123      case CPUINFO_INT_INPUT_STATE + 7:            info->i = m68k_get_virq(7);            break;
11341124
11351125      case CPUINFO_INT_PREVIOUSPC:               info->i = m68k_get_reg(NULL, M68K_REG_PPC); break;
11361126
src/emu/cpu/m68000/m68k.h
r3115r3116
325325 */
326326void m68k_set_irq(unsigned int int_level);
327327
328/* Set the virtual irq lines, where the highest level
329 * active line is automatically selected.  If you use this function,
330 * do not use m68k_set_irq.
331 */
332void m68k_set_virq(unsigned int level, unsigned int active);
333unsigned int m68k_get_virq(unsigned int level);
328334
329335/* Halt the CPU as if you pulsed the HALT pin. */
330336void m68k_pulse_halt(void);
src/emu/cpu/m68000/m68kcpu.c
r3115r3116
882882      m68ki_check_interrupts(); /* Level triggered (IRQ) */
883883}
884884
885void m68k_set_virq(unsigned int level, unsigned int active)
886{
887   uint state = m68ki_cpu.virq_state;
888   uint blevel;
889
890   if(active)
891      state |= 1 << level;
892   else
893      state &= ~(1 << level);
894   m68ki_cpu.virq_state = state;
895
896   for(blevel = 7; blevel > 0; blevel--)
897      if(state & (1 << blevel))
898         break;
899   m68k_set_irq(blevel);
900}
901
902unsigned int m68k_get_virq(unsigned int level)
903{
904   return (m68ki_cpu.virq_state & (1 << level)) ? 1 : 0;
905}
906
885907void m68k_init(void)
886908{
887909   static uint emulation_initialized = 0;
r3115r3116
919941   /* Interrupt mask to level 7 */
920942   FLAG_INT_MASK = 0x0700;
921943   CPU_INT_LEVEL = 0;
944   m68ki_cpu.virq_state = 0;
922945   /* Reset VBR */
923946   REG_VBR = 0;
924947   /* Go to supervisor mode */
src/emu/cpu/mcs48/mcs48.c
r0r3116
1/*
2EA pin - defined by architecture, must implement:
3   1 means external access, bypassing internal ROM
4   reimplement as a push, not a pull
5T0 output clock
6*/
7
8/***************************************************************************
9
10    mcs48.c
11
12    Intel MCS-48 Portable Emulator
13
14    Copyright Mirko Buffoni
15    Based on the original work Copyright Dan Boris, an 8048 emulator
16    You are not allowed to distribute this software commercially
17
18****************************************************************************
19
20    Note that the default internal divisor for this chip is by 3 and
21    then again by 5, or by 15 total.
22
23****************************************************************************
24
25    Chip   RAM  ROM  I/O
26    ----   ---  ---  ---
27    8021    64   1k   21  (ROM, reduced instruction set)
28
29    8035    64    0   27  (external ROM)
30    8041    64   1k   18  (ROM)
31    8048    64   1k   27  (ROM)
32    8648    64   1k   27  (OTPROM)
33    8741    64   1k   18  (EPROM)
34    8748    64   1k   27  (EPROM)
35    8884    64   1k
36    N7751  128   2k
37
38    8039   128    0   27  (external ROM)
39    8049   128   2k   27  (ROM)
40    8749   128   2k   27  (EPROM)
41    M58715 128    0       (external ROM)
42
43***************************************************************************/
44
45#include "debugger.h"
46#include "mcs48.h"
47
48
49/***************************************************************************
50    CONSTANTS
51***************************************************************************/
52
53/* timer/counter enable bits */
54#define TIMER_ENABLED   0x01
55#define COUNTER_ENABLED   0x02
56
57/* flag bits */
58#define C_FLAG         0x80
59#define A_FLAG         0x40
60#define F_FLAG         0x20
61#define B_FLAG         0x10
62
63
64
65/***************************************************************************
66    TYPE DEFINITIONS
67***************************************************************************/
68
69/* live processor state */
70typedef struct _mcs48_regs mcs48_regs;
71struct _mcs48_regs
72{
73   PAIR      prevpc;            /* 16-bit previous program counter */
74   PAIR      pc;               /* 16-bit program counter */
75   UINT8      a;               /* 8-bit accumulator */
76   UINT8 *      regptr;            /* pointer to r0-r7 */
77   UINT8      psw;            /* 8-bit PSW */
78   UINT8      p1;               /* 8-bit latched port 1 */
79   UINT8      p2;               /* 8-bit latched port 2 */
80   UINT8      f1;               /* 1-bit flag 1 */
81   UINT8      ea;               /* 1-bit latched ea input */
82   UINT8      timer;            /* 8-bit timer */
83   UINT8      prescaler;         /* 5-bit timer prescaler */
84   UINT8      t1_history;         /* 8-bit history of the T1 input */
85
86   UINT8      irq_state;         /* TRUE if an IRQ is pending */
87   UINT8      irq_in_progress;   /* TRUE if an IRQ is in progress */
88   UINT8      timer_overflow;      /* TRUE on a timer overflow; cleared by taking interrupt */
89   UINT8      timer_flag;         /* TRUE on a timer overflow; cleared on JTF */
90   UINT8      tirq_enabled;      /* TRUE if the timer IRQ is enabled */
91   UINT8      xirq_enabled;      /* TRUE if the external IRQ is enabled */
92   UINT8      timecount_enabled;   /* bitmask of timer/counter enabled */
93
94   UINT16      a11;            /* A11 value, either 0x000 or 0x800 */
95
96   int         (*irq_callback)(int irqline);
97   int         inst_cycles;      /* cycles for the current instruction */
98   UINT8      cpu_feature;      /* processor feature flags */
99   UINT16      int_rom_size;      /* internal rom size */
100};
101
102
103/* opcode table entry */
104typedef struct _mcs48_opcode mcs48_opcode;
105struct _mcs48_opcode
106{
107   UINT8      cycles;
108   void       (*function)(void);
109};
110
111
112
113/***************************************************************************
114    MACROS
115***************************************************************************/
116
117/*** Cycle times for the jump on condition instructions, are unusual.
118     Condition is tested during the first cycle, so if condition is not
119     met, second address fetch cycle may not really be taken. For now we
120     just use the cycle counts as listed in the i8048 user manual.
121***/
122
123#if 0
124#define ADJUST_CYCLES { inst_cycles -= 1; }   /* Possible real cycles setting */
125#else
126#define ADJUST_CYCLES { }               /* User Manual cycles setting */
127#endif
128
129
130/* ROM is mapped to ADDRESS_SPACE_PROGRAM */
131#define program_r(a)   program_read_byte_8le(a)
132
133/* RAM is mapped to ADDRESS_SPACE_DATA */
134#define ram_r(a)      data_read_byte_8le(a)
135#define ram_w(a,V)      data_write_byte_8le(a, V)
136
137/* ports are mapped to ADDRESS_SPACE_IO */
138#define ext_r(a)      io_read_byte_8le(a)
139#define ext_w(a,V)      io_write_byte_8le(a, V)
140#define port_r(a)      io_read_byte_8le(MCS48_PORT_P0 + a)
141#define port_w(a,V)      io_write_byte_8le(MCS48_PORT_P0 + a, V)
142#define test_r(a)      io_read_byte_8le(MCS48_PORT_T0 + a)
143#define test_w(a,V)      io_write_byte_8le(MCS48_PORT_T0 + a, V)
144#define bus_r()         io_read_byte_8le(MCS48_PORT_BUS)
145#define bus_w(V)      io_write_byte_8le(MCS48_PORT_BUS, V)
146#define ea_r()         io_read_byte_8le(MCS48_PORT_EA)
147
148/* simplfied access to common bits */
149#undef A
150#define A            mcs48.a
151#undef PC
152#define PC            mcs48.pc.w.l
153#undef PSW
154#define PSW            mcs48.psw
155
156/* r0-r7 map to memory via the regptr */
157#define R0            mcs48.regptr[0]
158#define R1            mcs48.regptr[1]
159#define R2            mcs48.regptr[2]
160#define R3            mcs48.regptr[3]
161#define R4            mcs48.regptr[4]
162#define R5            mcs48.regptr[5]
163#define R6            mcs48.regptr[6]
164#define R7            mcs48.regptr[7]
165
166/* the carry flag as 0 or 1, used for carry-in */
167#define CARRYIN         ((PSW & C_FLAG) >> 7)
168
169
170
171/***************************************************************************
172    GLOBAL VARIABLES
173***************************************************************************/
174
175static mcs48_regs   mcs48;
176static int         mcs48_icount;
177
178
179
180/***************************************************************************
181    FUNCTION PROTOTYPES
182***************************************************************************/
183
184static void check_irqs(void);
185
186
187
188/***************************************************************************
189    INLINE FUNCTIONS
190***************************************************************************/
191
192/*-------------------------------------------------
193    opcode_fetch - fetch an opcode byte
194-------------------------------------------------*/
195
196INLINE UINT8 opcode_fetch(offs_t address)
197{
198   /* fix me - need to figure out how to bypass internal ROM in this case */
199   if (mcs48.ea && address < mcs48.int_rom_size)
200      return 0x00;
201   return cpu_readop(address);
202}
203
204
205/*-------------------------------------------------
206    argument_fetch - fetch an opcode argument
207    byte
208-------------------------------------------------*/
209
210INLINE UINT8 argument_fetch(offs_t address)
211{
212   /* fix me - need to figure out how to bypass internal ROM in this case */
213   if (mcs48.ea && address < mcs48.int_rom_size)
214      return 0x00;
215   return cpu_readop_arg(address);
216}
217
218
219/*-------------------------------------------------
220    update_regptr - update the regptr member to
221    point to the appropriate register bank
222-------------------------------------------------*/
223
224INLINE void update_regptr(void)
225{
226   mcs48.regptr = memory_get_write_ptr(cpu_getactivecpu(), ADDRESS_SPACE_DATA, (PSW & B_FLAG) ? 24 : 0);
227}
228
229
230/*-------------------------------------------------
231    push_pc_psw - push the PC and PSW values onto
232    the stack
233-------------------------------------------------*/
234
235INLINE void push_pc_psw(void)
236{
237   UINT8 sp = PSW & 0x07;
238   ram_w(8 + 2*sp, mcs48.pc.b.l);
239   ram_w(9 + 2*sp, (mcs48.pc.b.h & 0x0f) | (PSW & 0xf0));
240   PSW = (PSW & 0xf8) | ((sp + 1) & 0x07);
241}
242
243
244/*-------------------------------------------------
245    pull_pc_psw - pull the PC and PSW values from
246    the stack
247-------------------------------------------------*/
248
249INLINE void pull_pc_psw(void)
250{
251   UINT8 sp = (PSW - 1) & 0x07;
252   mcs48.pc.b.l = ram_r(8 + 2*sp);
253   mcs48.pc.b.h = ram_r(9 + 2*sp);
254   PSW = (mcs48.pc.b.h & 0xf0) | 0x08 | sp;
255   mcs48.pc.b.h &= 0x0f;
256   update_regptr();
257   change_pc(PC);
258}
259
260
261/*-------------------------------------------------
262    pull_pc - pull the PC value from the stack,
263    leaving the upper part of PSW intact
264-------------------------------------------------*/
265
266INLINE void pull_pc(void)
267{
268   UINT8 sp = (PSW - 1) & 0x07;
269   mcs48.pc.b.l = ram_r(8 + 2*sp);
270   mcs48.pc.b.h = ram_r(9 + 2*sp) & 0x0f;
271   PSW = (PSW & 0xf0) | 0x08 | sp;
272   change_pc(PC);
273}
274
275
276/*-------------------------------------------------
277    execute_add - perform the logic of an ADD
278    instruction
279-------------------------------------------------*/
280
281INLINE void execute_add(UINT8 dat)
282{
283   UINT16 temp = A + dat;
284
285   PSW &= ~(C_FLAG | A_FLAG);
286   PSW |= ((A ^ temp) << 2) & A_FLAG;
287   PSW |= (temp >> 1) & C_FLAG;
288   A = temp;
289}
290
291
292/*-------------------------------------------------
293    execute_addc - perform the logic of an ADDC
294    instruction
295-------------------------------------------------*/
296
297INLINE void execute_addc(UINT8 dat)
298{
299   UINT16 temp = A + dat + CARRYIN;
300
301   PSW &= ~(C_FLAG | A_FLAG);
302   PSW |= ((A ^ temp) << 2) & A_FLAG;
303   PSW |= (temp >> 1) & C_FLAG;
304   A = temp;
305}
306
307
308/*-------------------------------------------------
309    execute_jmp - perform the logic of a JMP
310    instruction
311-------------------------------------------------*/
312
313INLINE void execute_jmp(UINT16 address)
314{
315   UINT16 a11 = (mcs48.irq_in_progress) ? 0 : mcs48.a11;
316   PC = address | a11;
317   change_pc(PC);
318}
319
320
321/*-------------------------------------------------
322    execute_call - perform the logic of a CALL
323    instruction
324-------------------------------------------------*/
325
326INLINE void execute_call(UINT16 address)
327{
328   push_pc_psw();
329   execute_jmp(address);
330}
331
332
333/*-------------------------------------------------
334    execute_jcc - perform the logic of a
335    conditional jump instruction
336-------------------------------------------------*/
337
338INLINE void execute_jcc(UINT8 result)
339{
340   UINT8 offset = argument_fetch(PC++);
341   if (result != 0)
342   {
343      PC = ((PC - 1) & 0xf00) | offset;
344      change_pc(PC);
345   }
346   else
347      ADJUST_CYCLES;
348}
349
350
351
352/***************************************************************************
353    OPCODE HANDLERS
354***************************************************************************/
355
356static void illegal(void)
357{
358   logerror("I8039:  pc = %04x,  Illegal opcode = %02x\n", PC-1, program_r(PC-1));
359}
360
361static void add_a_r0(void)      { execute_add(R0); }
362static void add_a_r1(void)      { execute_add(R1); }
363static void add_a_r2(void)      { execute_add(R2); }
364static void add_a_r3(void)      { execute_add(R3); }
365static void add_a_r4(void)      { execute_add(R4); }
366static void add_a_r5(void)      { execute_add(R5); }
367static void add_a_r6(void)      { execute_add(R6); }
368static void add_a_r7(void)      { execute_add(R7); }
369static void add_a_xr0(void)      { execute_add(ram_r(R0)); }
370static void add_a_xr1(void)      { execute_add(ram_r(R1)); }
371static void add_a_n(void)      { execute_add(argument_fetch(PC++)); }
372
373static void adc_a_r0(void)      { execute_addc(R0); }
374static void adc_a_r1(void)      { execute_addc(R1); }
375static void adc_a_r2(void)      { execute_addc(R2); }
376static void adc_a_r3(void)      { execute_addc(R3); }
377static void adc_a_r4(void)      { execute_addc(R4); }
378static void adc_a_r5(void)      { execute_addc(R5); }
379static void adc_a_r6(void)      { execute_addc(R6); }
380static void adc_a_r7(void)      { execute_addc(R7); }
381static void adc_a_xr0(void)      { execute_addc(ram_r(R0)); }
382static void adc_a_xr1(void)      { execute_addc(ram_r(R1)); }
383static void adc_a_n(void)      { execute_addc(argument_fetch(PC++)); }
384
385static void anl_a_r0(void)      { A &= R0; }
386static void anl_a_r1(void)      { A &= R1; }
387static void anl_a_r2(void)      { A &= R2; }
388static void anl_a_r3(void)      { A &= R3; }
389static void anl_a_r4(void)      { A &= R4; }
390static void anl_a_r5(void)      { A &= R5; }
391static void anl_a_r6(void)      { A &= R6; }
392static void anl_a_r7(void)      { A &= R7; }
393static void anl_a_xr0(void)      { A &= ram_r(R0); }
394static void anl_a_xr1(void)      { A &= ram_r(R1); }
395static void anl_a_n(void)      { A &= argument_fetch(PC++); }
396static void anl_bus_n(void)      { bus_w(bus_r() & argument_fetch(PC++)); }
397static void anl_p1_n(void)      { port_w(1, mcs48.p1 &= argument_fetch(PC++)); }
398static void anl_p2_n(void)      { port_w(2, mcs48.p2 &= argument_fetch(PC++)); }
399
400static void anld_p4_a(void)      { port_w(4, port_r(4) & A & 0x0f); }
401static void anld_p5_a(void)      { port_w(5, port_r(5) & A & 0x0f); }
402static void anld_p6_a(void)      { port_w(6, port_r(6) & A & 0x0f); }
403static void anld_p7_a(void)      { port_w(7, port_r(7) & A & 0x0f); }
404
405static void call_0(void)      { execute_call(argument_fetch(PC++) | 0x000); }
406static void call_1(void)      { execute_call(argument_fetch(PC++) | 0x100); }
407static void call_2(void)      { execute_call(argument_fetch(PC++) | 0x200); }
408static void call_3(void)      { execute_call(argument_fetch(PC++) | 0x300); }
409static void call_4(void)      { execute_call(argument_fetch(PC++) | 0x400); }
410static void call_5(void)      { execute_call(argument_fetch(PC++) | 0x500); }
411static void call_6(void)      { execute_call(argument_fetch(PC++) | 0x600); }
412static void call_7(void)      { execute_call(argument_fetch(PC++) | 0x700); }
413
414static void clr_a(void)         { A = 0; }
415static void clr_c(void)         { PSW &= ~C_FLAG; }
416static void clr_f0(void)      { PSW &= ~F_FLAG; }
417static void clr_f1(void)      { mcs48.f1 = 0; }
418
419static void cpl_a(void)         { A ^= 0xff; }
420static void cpl_c(void)         { PSW ^= C_FLAG; }
421static void cpl_f0(void)      { PSW ^= F_FLAG; }
422static void cpl_f1(void)      { mcs48.f1 ^= 1; }
423
424static void da_a(void)
425{
426   if ((A & 0x0f) > 0x09 || (PSW & A_FLAG))
427   {
428      A += 0x06;
429      if ((A & 0xf0) == 0x00)
430         PSW |= C_FLAG;
431   }
432   if ((A & 0xf0) > 0x90 || (PSW & C_FLAG))
433   {
434      A += 0x60;
435      PSW |= C_FLAG;
436   }
437   else
438      PSW &= ~C_FLAG;
439}
440
441static void dec_a(void)         { A--; }
442static void dec_r0(void)      { R0--; }
443static void dec_r1(void)      { R1--; }
444static void dec_r2(void)      { R2--; }
445static void dec_r3(void)      { R3--; }
446static void dec_r4(void)      { R4--; }
447static void dec_r5(void)      { R5--; }
448static void dec_r6(void)      { R6--; }
449static void dec_r7(void)      { R7--; }
450
451static void dis_i(void)         { mcs48.xirq_enabled = FALSE; }
452static void dis_tcnti(void)      { mcs48.tirq_enabled = FALSE; mcs48.timer_overflow = FALSE; }
453
454static void djnz_r0(void)      { execute_jcc(--R0 != 0); }
455static void djnz_r1(void)      { execute_jcc(--R1 != 0); }
456static void djnz_r2(void)      { execute_jcc(--R2 != 0); }
457static void djnz_r3(void)      { execute_jcc(--R3 != 0); }
458static void djnz_r4(void)      { execute_jcc(--R4 != 0); }
459static void djnz_r5(void)      { execute_jcc(--R5 != 0); }
460static void djnz_r6(void)      { execute_jcc(--R6 != 0); }
461static void djnz_r7(void)      { execute_jcc(--R7 != 0); }
462
463static void en_i(void)         { mcs48.xirq_enabled = TRUE; check_irqs(); }
464static void en_tcnti(void)      { mcs48.tirq_enabled = TRUE; check_irqs(); }
465
466static void ento_clk(void)
467{
468   logerror("I8039:  pc = %04x,  Unimplemented opcode = %02x\n", PC-1, program_r(PC-1));
469}
470
471static void in_a_p1(void)      { A = port_r(1) & mcs48.p1; }
472static void in_a_p2(void)      { A = port_r(2) & mcs48.p2; }
473static void ins_a_bus(void)      { A = bus_r(); }
474
475static void inc_a(void)         { A++; }
476static void inc_r0(void)      { R0++; }
477static void inc_r1(void)      { R1++; }
478static void inc_r2(void)      { R2++; }
479static void inc_r3(void)      { R3++; }
480static void inc_r4(void)      { R4++; }
481static void inc_r5(void)      { R5++; }
482static void inc_r6(void)      { R6++; }
483static void inc_r7(void)      { R7++; }
484static void inc_xr0(void)      { ram_w(R0, ram_r(R0) + 1); }
485static void inc_xr1(void)      { ram_w(R1, ram_r(R1) + 1); }
486
487static void jb_0(void)         { execute_jcc((A & 0x01) != 0); }
488static void jb_1(void)         { execute_jcc((A & 0x02) != 0); }
489static void jb_2(void)         { execute_jcc((A & 0x04) != 0); }
490static void jb_3(void)         { execute_jcc((A & 0x08) != 0); }
491static void jb_4(void)         { execute_jcc((A & 0x10) != 0); }
492static void jb_5(void)         { execute_jcc((A & 0x20) != 0); }
493static void jb_6(void)         { execute_jcc((A & 0x40) != 0); }
494static void jb_7(void)         { execute_jcc((A & 0x80) != 0); }
495static void jc(void)         { execute_jcc((PSW & C_FLAG) != 0); }
496static void jf0(void)         { execute_jcc((PSW & F_FLAG) != 0); }
497static void jf1(void)         { execute_jcc(mcs48.f1 != 0); }
498
499static void jmp_0(void)         { execute_jmp(argument_fetch(PC) | 0x000); }
500static void jmp_1(void)         { execute_jmp(argument_fetch(PC) | 0x100); }
501static void jmp_2(void)         { execute_jmp(argument_fetch(PC) | 0x200); }
502static void jmp_3(void)         { execute_jmp(argument_fetch(PC) | 0x300); }
503static void jmp_4(void)         { execute_jmp(argument_fetch(PC) | 0x400); }
504static void jmp_5(void)         { execute_jmp(argument_fetch(PC) | 0x500); }
505static void jmp_6(void)         { execute_jmp(argument_fetch(PC) | 0x600); }
506static void jmp_7(void)         { execute_jmp(argument_fetch(PC) | 0x700); }
507static void jmpp_xa(void)      { PC &= 0xf00; PC |= program_r(PC | A); change_pc(PC); }
508
509static void jnc(void)         { execute_jcc((PSW & C_FLAG) == 0); }
510static void jni(void)         { execute_jcc(mcs48.irq_state != 0); }
511static void jnt_0(void)        { execute_jcc(test_r(0) == 0); }
512static void jnt_1(void)        { execute_jcc(test_r(1) == 0); }
513static void jnz(void)         { execute_jcc(A != 0); }
514static void jtf(void)         { execute_jcc(mcs48.timer_flag); mcs48.timer_flag = FALSE; }
515static void jt_0(void)        { execute_jcc(test_r(0) != 0); }
516static void jt_1(void)        { execute_jcc(test_r(1) != 0); }
517static void jz(void)         { execute_jcc(A == 0); }
518
519static void mov_a_n(void)      { A = argument_fetch(PC++); }
520static void mov_a_psw(void)      { A = PSW; }
521static void mov_a_r0(void)      { A = R0; }
522static void mov_a_r1(void)      { A = R1; }
523static void mov_a_r2(void)      { A = R2; }
524static void mov_a_r3(void)      { A = R3; }
525static void mov_a_r4(void)      { A = R4; }
526static void mov_a_r5(void)      { A = R5; }
527static void mov_a_r6(void)      { A = R6; }
528static void mov_a_r7(void)      { A = R7; }
529static void mov_a_xr0(void)      { A = ram_r(R0); }
530static void mov_a_xr1(void)      { A = ram_r(R1); }
531static void mov_a_t(void)      { A = mcs48.timer; }
532
533static void mov_psw_a(void)      { PSW = A; update_regptr(); }
534static void mov_r0_a(void)      { R0 = A; }
535static void mov_r1_a(void)      { R1 = A; }
536static void mov_r2_a(void)      { R2 = A; }
537static void mov_r3_a(void)      { R3 = A; }
538static void mov_r4_a(void)      { R4 = A; }
539static void mov_r5_a(void)      { R5 = A; }
540static void mov_r6_a(void)      { R6 = A; }
541static void mov_r7_a(void)      { R7 = A; }
542static void mov_r0_n(void)      { R0 = argument_fetch(PC++); }
543static void mov_r1_n(void)      { R1 = argument_fetch(PC++); }
544static void mov_r2_n(void)      { R2 = argument_fetch(PC++); }
545static void mov_r3_n(void)      { R3 = argument_fetch(PC++); }
546static void mov_r4_n(void)      { R4 = argument_fetch(PC++); }
547static void mov_r5_n(void)      { R5 = argument_fetch(PC++); }
548static void mov_r6_n(void)      { R6 = argument_fetch(PC++); }
549static void mov_r7_n(void)      { R7 = argument_fetch(PC++); }
550static void mov_t_a(void)      { mcs48.timer = A; }
551static void mov_xr0_a(void)      { ram_w(R0, A); }
552static void mov_xr1_a(void)      { ram_w(R1, A); }
553static void mov_xr0_n(void)      { ram_w(R0, argument_fetch(PC++)); }
554static void mov_xr1_n(void)      { ram_w(R1, argument_fetch(PC++)); }
555
556static void movd_a_p4(void)      { A = port_r(4) & 0x0f; }
557static void movd_a_p5(void)      { A = port_r(5) & 0x0f; }
558static void movd_a_p6(void)      { A = port_r(6) & 0x0f; }
559static void movd_a_p7(void)      { A = port_r(7) & 0x0f; }
560static void movd_p4_a(void)      { port_w(4, A & 0x0f); }
561static void movd_p5_a(void)      { port_w(5, A & 0x0f); }
562static void movd_p6_a(void)      { port_w(6, A & 0x0f); }
563static void movd_p7_a(void)      { port_w(7, A & 0x0f); }
564
565static void movp_a_xa(void)      { A = program_r((PC & 0xf00) | A); }
566static void movp3_a_xa(void)   { A = program_r(0x300 | A); }
567
568static void movx_a_xr0(void)   { A = ext_r(R0); }
569static void movx_a_xr1(void)   { A = ext_r(R1); }
570static void movx_xr0_a(void)   { ext_w(R0, A); }
571static void movx_xr1_a(void)   { ext_w(R1, A); }
572
573static void nop(void)         { }
574
575static void orl_a_r0(void)      { A |= R0; }
576static void orl_a_r1(void)      { A |= R1; }
577static void orl_a_r2(void)      { A |= R2; }
578static void orl_a_r3(void)      { A |= R3; }
579static void orl_a_r4(void)      { A |= R4; }
580static void orl_a_r5(void)      { A |= R5; }
581static void orl_a_r6(void)      { A |= R6; }
582static void orl_a_r7(void)      { A |= R7; }
583static void orl_a_xr0(void)      { A |= ram_r(R0); }
584static void orl_a_xr1(void)      { A |= ram_r(R1); }
585static void orl_a_n(void)      { A |= argument_fetch(PC++); }
586static void orl_bus_n(void)      { bus_w(bus_r() | argument_fetch(PC++)); }
587static void orl_p1_n(void)      { port_w(1, mcs48.p1 |= argument_fetch(PC++)); }
588static void orl_p2_n(void)      { port_w(2, mcs48.p2 |= argument_fetch(PC++)); }
589static void orld_p4_a(void)      { port_w(4, port_r(4) | A); }
590static void orld_p5_a(void)      { port_w(5, port_r(5) | A); }
591static void orld_p6_a(void)      { port_w(6, port_r(6) | A); }
592static void orld_p7_a(void)      { port_w(7, port_r(7) | A); }
593
594static void outl_bus_a(void)   { bus_w(A); }
595static void outl_p1_a(void)      { port_w(1, mcs48.p1 = A); }
596static void outl_p2_a(void)      { port_w(2, mcs48.p2 = A); }
597static void ret(void)         { pull_pc(); }
598
599static void retr(void)
600{
601   pull_pc_psw();
602
603   /* implicitly clear the IRQ in progress flip flop and re-check interrupts */
604   mcs48.irq_in_progress = FALSE;
605   check_irqs();
606}
607
608static void rl_a(void)         { A = (A << 1) | (A >> 7); }
609static void rlc_a(void)       { UINT8 newc = A & C_FLAG; A = (A << 1) | (PSW >> 7); PSW = (PSW & ~C_FLAG) | newc; }
610
611static void rr_a(void)         { A = (A >> 1) | (A << 7); }
612static void rrc_a(void)         { UINT8 newc = (A << 7) & C_FLAG; A = (A >> 1) | (PSW & C_FLAG); PSW = (PSW & ~C_FLAG) | newc; }
613
614static void sel_mb0(void)      { mcs48.a11 = 0x000; }
615static void sel_mb1(void)      { mcs48.a11 = 0x800; }
616
617static void sel_rb0(void)      { PSW &= ~B_FLAG; update_regptr();  }
618static void sel_rb1(void)      { PSW |=  B_FLAG; update_regptr(); }
619
620static void stop_tcnt(void)      { mcs48.timecount_enabled = 0; }
621
622static void strt_cnt(void)      { mcs48.timecount_enabled = COUNTER_ENABLED; mcs48.t1_history = test_r(1); }
623static void strt_t(void)      { mcs48.timecount_enabled = TIMER_ENABLED; mcs48.prescaler = 0; }
624
625static void swap_a(void)      { A = (A << 4) | (A >> 4); }
626
627static void xch_a_r0(void)      { UINT8 tmp = A; A = R0; R0 = tmp; }
628static void xch_a_r1(void)      { UINT8 tmp = A; A = R1; R1 = tmp; }
629static void xch_a_r2(void)      { UINT8 tmp = A; A = R2; R2 = tmp; }
630static void xch_a_r3(void)      { UINT8 tmp = A; A = R3; R3 = tmp; }
631static void xch_a_r4(void)      { UINT8 tmp = A; A = R4; R4 = tmp; }
632static void xch_a_r5(void)      { UINT8 tmp = A; A = R5; R5 = tmp; }
633static void xch_a_r6(void)      { UINT8 tmp = A; A = R6; R6 = tmp; }
634static void xch_a_r7(void)      { UINT8 tmp = A; A = R7; R7 = tmp; }
635static void xch_a_xr0(void)      { UINT8 tmp = A; A = ram_r(R0); ram_w(R0, tmp); }
636static void xch_a_xr1(void)      { UINT8 tmp = A; A = ram_r(R1); ram_w(R1, tmp); }
637
638static void xchd_a_xr0(void)   { UINT8 oldram = ram_r(R0); ram_w(R0, (oldram & 0xf0) | (A & 0x0f)); A = (A & 0xf0) | (oldram & 0x0f); }
639static void xchd_a_xr1(void)   { UINT8 oldram = ram_r(R1); ram_w(R1, (oldram & 0xf0) | (A & 0x0f)); A = (A & 0xf0) | (oldram & 0x0f); }
640
641static void xrl_a_r0(void)      { A ^= R0; }
642static void xrl_a_r1(void)      { A ^= R1; }
643static void xrl_a_r2(void)      { A ^= R2; }
644static void xrl_a_r3(void)      { A ^= R3; }
645static void xrl_a_r4(void)      { A ^= R4; }
646static void xrl_a_r5(void)      { A ^= R5; }
647static void xrl_a_r6(void)      { A ^= R6; }
648static void xrl_a_r7(void)      { A ^= R7; }
649static void xrl_a_xr0(void)      { A ^= ram_r(R0); }
650static void xrl_a_xr1(void)      { A ^= ram_r(R1); }
651static void xrl_a_n(void)      { A ^= argument_fetch(PC++); }
652
653
654
655/***************************************************************************
656    OPCODE TABLES
657***************************************************************************/
658
659static const mcs48_opcode opcode_table[256]=
660{
661   {1, nop          },{1, illegal   },{2, outl_bus_a},{2, add_a_n   },{2, jmp_0         },{1, en_i      },{1, illegal   },{1, dec_a      },
662   {2, ins_a_bus  },{2, in_a_p1   },{2, in_a_p2   },{1, illegal   },{2, movd_a_p4 },{2, movd_a_p5   },{2, movd_a_p6   },{2, movd_a_p7 },
663   {1, inc_xr0    },{1, inc_xr1   },{2, jb_0      },{2, adc_a_n   },{2, call_0      },{1, dis_i      },{2, jtf      },{1, inc_a      },
664   {1, inc_r0      },{1, inc_r1    },{1, inc_r2   },{1, inc_r3   },{1, inc_r4   },{1, inc_r5    },{1, inc_r6   },{1, inc_r7   },
665   {1, xch_a_xr0  },{1, xch_a_xr1   },{1, illegal   },{2, mov_a_n   },{2, jmp_1         },{1, en_tcnti   },{2, jnt_0    },{1, clr_a        },
666   {1, xch_a_r0   },{1, xch_a_r1   },{1, xch_a_r2   },{1, xch_a_r3  },{1, xch_a_r4  },{1, xch_a_r5   },{1, xch_a_r6   },{1, xch_a_r7  },
667   {1, xchd_a_xr0 },{1, xchd_a_xr1   },{2, jb_1      },{1, illegal   },{2, call_1   },{1, dis_tcnti   },{2, jt_0      },{1, cpl_a        },
668   {0, illegal    },{2, outl_p1_a   },{2, outl_p2_a   },{1, illegal   },{2, movd_p4_a },{2, movd_p5_a   },{2, movd_p6_a },{2, movd_p7_a },
669   {1, orl_a_xr0  },{1, orl_a_xr1   },{1, mov_a_t   },{2, orl_a_n   },{2, jmp_2         },{1, strt_cnt   },{2, jnt_1    },{1, swap_a   },
670   {1, orl_a_r0   },{1, orl_a_r1   },{1, orl_a_r2   },{1, orl_a_r3  },{1, orl_a_r4  },{1, orl_a_r5   },{1, orl_a_r6   },{1, orl_a_r7  },
671   {1, anl_a_xr0  },{1, anl_a_xr1   },{2, jb_2      },{2, anl_a_n   },{2, call_2   },{1, strt_t    },{2, jt_1      },{1, da_a        },
672   {1, anl_a_r0   },{1, anl_a_r1   },{1, anl_a_r2   },{1, anl_a_r3  },{1, anl_a_r4  },{1, anl_a_r5   },{1, anl_a_r6   },{1, anl_a_r7  },
673   {1, add_a_xr0  },{1, add_a_xr1   },{1, mov_t_a   },{1, illegal   },{2, jmp_3         },{1, stop_tcnt   },{1, illegal   },{1, rrc_a        },
674   {1, add_a_r0   },{1, add_a_r1   },{1, add_a_r2   },{1, add_a_r3  },{1, add_a_r4  },{1, add_a_r5   },{1, add_a_r6   },{1, add_a_r7  },
675   {1, adc_a_xr0  },{1, adc_a_xr1   },{2, jb_3      },{1, illegal   },{2, call_3   },{1, ento_clk   },{2, jf1      },{1, rr_a         },
676   {1, adc_a_r0   },{1, adc_a_r1   },{1, adc_a_r2   },{1, adc_a_r3  },{1, adc_a_r4  },{1, adc_a_r5   },{1, adc_a_r6   },{1, adc_a_r7  },
677   {2, movx_a_xr0 },{2, movx_a_xr1 },{1, illegal   },{2, ret      },{2, jmp_4         },{1, clr_f0    },{2, jni      },{1, illegal   },
678   {2, orl_bus_n  },{2, orl_p1_n   },{2, orl_p2_n   },{1, illegal   },{2, orld_p4_a },{2, orld_p5_a   },{2, orld_p6_a },{2, orld_p7_a },
679   {2, movx_xr0_a },{2, movx_xr1_a },{2, jb_4      },{2, retr      },{2, call_4   },{1, cpl_f0    },{2, jnz      },{1, clr_c        },
680   {2, anl_bus_n  },{2, anl_p1_n   },{2, anl_p2_n   },{1, illegal   },{2, anld_p4_a },{2, anld_p5_a   },{2, anld_p6_a },{2, anld_p7_a },
681   {1, mov_xr0_a  },{1, mov_xr1_a   },{1, illegal   },{2, movp_a_xa },{2, jmp_5         },{1, clr_f1    },{1, illegal   },{1, cpl_c        },
682   {1, mov_r0_a   },{1, mov_r1_a   },{1, mov_r2_a   },{1, mov_r3_a  },{1, mov_r4_a  },{1, mov_r5_a   },{1, mov_r6_a   },{1, mov_r7_a  },
683   {2, mov_xr0_n  },{2, mov_xr1_n   },{2, jb_5      },{2, jmpp_xa   },{2, call_5   },{1, cpl_f1    },{2, jf0      },{1, illegal   },
684   {2, mov_r0_n   },{2, mov_r1_n   },{2, mov_r2_n   },{2, mov_r3_n  },{2, mov_r4_n  },{2, mov_r5_n   },{2, mov_r6_n   },{2, mov_r7_n  },
685   {0, illegal    },{1, illegal   },{1, illegal   },{1, illegal   },{2, jmp_6         },{1, sel_rb0   },{2, jz      },{1, mov_a_psw },
686   {1, dec_r0      },{1, dec_r1    },{1, dec_r2   },{1, dec_r3   },{1, dec_r4   },{1, dec_r5    },{1, dec_r6   },{1, dec_r7   },
687   {1, xrl_a_xr0  },{1, xrl_a_xr1   },{2, jb_6      },{2, xrl_a_n   },{2, call_6   },{1, sel_rb1   },{1, illegal   },{1, mov_psw_a },
688   {1, xrl_a_r0   },{1, xrl_a_r1   },{1, xrl_a_r2   },{1, xrl_a_r3  },{1, xrl_a_r4  },{1, xrl_a_r5   },{1, xrl_a_r6   },{1, xrl_a_r7  },
689   {0, illegal    },{1, illegal   },{1, illegal   },{2, movp3_a_xa},{2, jmp_7      },{1, sel_mb0   },{2, jnc      },{1, rl_a         },
690   {2, djnz_r0    },{2, djnz_r1   },{2, djnz_r2   },{2, djnz_r3   },{2, djnz_r4   },{2, djnz_r5   },{2, djnz_r6   },{2, djnz_r7   },
691   {1, mov_a_xr0  },{1, mov_a_xr1   },{2, jb_7      },{1, illegal   },{2, call_7   },{1, sel_mb1   },{2, jc      },{1, rlc_a        },
692   {1, mov_a_r0   },{1, mov_a_r1   },{1, mov_a_r2   },{1, mov_a_r3  },{1, mov_a_r4  },{1, mov_a_r5   },{1, mov_a_r6   },{1, mov_a_r7  }
693};
694
695
696
697/***************************************************************************
698    INITIALIZATION/RESET
699***************************************************************************/
700
701/*-------------------------------------------------
702    mcs48_init - generic MCS-48 initialization
703-------------------------------------------------*/
704
705static void mcs48_init(int index, int clock, const void *config, int (*irqcallback)(int), UINT16 romsize)
706{
707   memset(&mcs48, 0, sizeof(mcs48));
708
709   mcs48.irq_callback = irqcallback;
710   mcs48.int_rom_size = romsize;
711
712   state_save_register_item("mcs48", index, mcs48.prevpc.w.l);
713   state_save_register_item("mcs48", index, PC);
714   state_save_register_item("mcs48", index, A);
715   state_save_register_item("mcs48", index, PSW);
716   state_save_register_item("mcs48", index, mcs48.p1);
717   state_save_register_item("mcs48", index, mcs48.p2);
718   state_save_register_item("mcs48", index, mcs48.f1);
719   state_save_register_item("mcs48", index, mcs48.ea);
720   state_save_register_item("mcs48", index, mcs48.timer);
721   state_save_register_item("mcs48", index, mcs48.prescaler);
722   state_save_register_item("mcs48", index, mcs48.t1_history);
723   state_save_register_item("mcs48", index, mcs48.irq_state);
724   state_save_register_item("mcs48", index, mcs48.irq_in_progress);
725   state_save_register_item("mcs48", index, mcs48.timer_overflow);
726   state_save_register_item("mcs48", index, mcs48.timer_flag);
727   state_save_register_item("mcs48", index, mcs48.tirq_enabled);
728   state_save_register_item("mcs48", index, mcs48.xirq_enabled);
729   state_save_register_item("mcs48", index, mcs48.timecount_enabled);
730   state_save_register_item("mcs48", index, mcs48.a11);
731}
732
733
734/*-------------------------------------------------
735    i8035_init - initialization for systems with
736    1k of internal ROM and 64 bytes of internal
737    RAM
738-------------------------------------------------*/
739
740#if (HAS_I8035 || HAS_I8041 || HAS_I8048 || HAS_I8648 || HAS_I8748 || HAS_MB8884 || HAS_N7751)
741static void i8035_init(int index, int clock, const void *config, int (*irqcallback)(int))
742{
743   mcs48_init(index, clock, config, irqcallback, 0x400);
744}
745#endif
746
747
748/*-------------------------------------------------
749    i8039_init - initialization for systems with
750    2k of internal ROM and 128 bytes of internal
751    RAM
752-------------------------------------------------*/
753
754#if (HAS_I8039 || HAS_I8049 || HAS_I8749 || HAS_M58715)
755static void i8039_init(int index, int clock, const void *config, int (*irqcallback)(int))
756{
757   mcs48_init(index, clock, config, irqcallback, 0x800);
758}
759#endif
760
761
762/*-------------------------------------------------
763    mcs48_reset - general reset routine
764-------------------------------------------------*/
765
766static void mcs48_reset(void)
767{
768   /* confirmed from reset description */
769   PC = 0;
770   PSW = (PSW & (C_FLAG | A_FLAG)) | 0x08;
771   mcs48.a11 = 0x000;
772   bus_w(0xff);
773   mcs48.p1 = 0xff;
774   mcs48.p2 = 0xff;
775   mcs48.tirq_enabled = FALSE;
776   mcs48.xirq_enabled = FALSE;
777   mcs48.timecount_enabled = 0;
778   mcs48.timer_flag = FALSE;
779   mcs48.f1 = 0;
780
781   /* confirmed from interrupt logic description */
782   mcs48.irq_in_progress = FALSE;
783   mcs48.timer_overflow = FALSE;
784}
785
786
787
788/***************************************************************************
789    EXECUTION
790***************************************************************************/
791
792/*-------------------------------------------------
793    check_irqs - check for and process IRQs
794-------------------------------------------------*/
795
796static void check_irqs(void)
797{
798   /* if something is in progress, we do nothing */
799   if (mcs48.irq_in_progress)
800      return;
801
802   /* external interrupts take priority */
803   if (mcs48.irq_state && mcs48.xirq_enabled)
804   {
805      mcs48.irq_in_progress = TRUE;
806
807      /* transfer to location 0x03 */
808      push_pc_psw();
809      PC = 0x03;
810      change_pc(0x03);
811      mcs48.inst_cycles += 2;
812
813      /* indicate we took the external IRQ */
814      if (mcs48.irq_callback != NULL)
815         (*mcs48.irq_callback)(0);
816   }
817
818   /* timer overflow interrupts follow */
819   if (mcs48.timer_overflow && mcs48.tirq_enabled)
820   {
821      mcs48.irq_in_progress = TRUE;
822
823      /* transfer to location 0x07 */
824      push_pc_psw();
825      PC = 0x07;
826      change_pc(0x07);
827      mcs48.inst_cycles += 2;
828
829      /* timer overflow flip-flop is reset once taken */
830      mcs48.timer_overflow = FALSE;
831   }
832}
833
834
835/*-------------------------------------------------
836    burn_cycles - burn cycles, processing timers
837    and counters
838-------------------------------------------------*/
839
840static void burn_cycles(int count)
841{
842   int timerover = FALSE;
843
844   /* if the timer is enabled, accumulate prescaler cycles */
845   if (mcs48.timecount_enabled & TIMER_ENABLED)
846   {
847      mcs48.prescaler += count;
848      mcs48.timer += mcs48.prescaler >> 5;
849      mcs48.prescaler &= 0x1f;
850      timerover = (mcs48.timer == 0);
851   }
852
853   /* if the counter is enabled, poll the T1 test input once for each cycle */
854   else if (mcs48.timecount_enabled & COUNTER_ENABLED)
855      for ( ; count > 0; count--)
856      {
857         mcs48.t1_history = (mcs48.t1_history << 1) | (test_r(1) & 1);
858         if ((mcs48.t1_history & 3) == 2)
859            timerover = (++mcs48.timer == 0);
860      }
861
862   /* if either source caused a timer overflow, set the flags and check IRQs */
863   if (timerover)
864   {
865      mcs48.timer_flag = TRUE;
866
867      /* according to the docs, if an overflow occurs with interrupts disabled, the overflow is not stored */
868      if (mcs48.tirq_enabled)
869      {
870         mcs48.timer_overflow = TRUE;
871         check_irqs();
872      }
873   }
874}
875
876
877/*-------------------------------------------------
878    mcs48_execute - execute until we run out
879    of cycles
880-------------------------------------------------*/
881
882static int mcs48_execute(int cycles)
883{
884   unsigned opcode;
885
886   mcs48_icount = cycles;
887
888   /* external interrupts may have been set since we last checked */
889   mcs48.inst_cycles = 0;
890   check_irqs();
891   mcs48_icount -= mcs48.inst_cycles;
892   if (mcs48.timecount_enabled != 0)
893      burn_cycles(mcs48.inst_cycles);
894
895   /* iterate over remaining cycles, guaranteeing at least one instruction */
896   do
897   {
898      /* fetch next opcode */
899      mcs48.prevpc = mcs48.pc;
900      debugger_instruction_hook(Machine, PC);
901      opcode = opcode_fetch(PC++);
902
903      /* process opcode and count cycles */
904      mcs48.inst_cycles = opcode_table[opcode].cycles;
905      (*opcode_table[opcode].function)();
906
907      /* burn the cycles */
908      mcs48_icount -= mcs48.inst_cycles;
909      if (mcs48.timecount_enabled != 0)
910         burn_cycles(mcs48.inst_cycles);
911
912   } while (mcs48_icount > 0);
913
914   return cycles - mcs48_icount;
915}
916
917
918
919/***************************************************************************
920    ADDRESS MAPS
921***************************************************************************/
922
923static ADDRESS_MAP_START(program_10bit, ADDRESS_SPACE_PROGRAM, 8)
924   AM_RANGE(0x00, 0x3ff) AM_ROM
925ADDRESS_MAP_END
926
927static ADDRESS_MAP_START(program_11bit, ADDRESS_SPACE_PROGRAM, 8)
928   AM_RANGE(0x00, 0x7ff) AM_ROM
929ADDRESS_MAP_END
930
931static ADDRESS_MAP_START(data_6bit, ADDRESS_SPACE_DATA, 8)
932   AM_RANGE(0x00, 0x3f) AM_RAM
933ADDRESS_MAP_END
934
935static ADDRESS_MAP_START(data_7bit, ADDRESS_SPACE_DATA, 8)
936   AM_RANGE(0x00, 0x7f) AM_RAM
937ADDRESS_MAP_END
938
939
940
941/***************************************************************************
942    GENERAL CONTEXT ACCESS
943***************************************************************************/
944
945/*-------------------------------------------------
946    mcs48_get_context - copy the context to the
947    destination
948-------------------------------------------------*/
949
950static void mcs48_get_context(void *dst)
951{
952   if (dst != NULL)
953      *(mcs48_regs *)dst = mcs48;
954}
955
956
957/*-------------------------------------------------
958    mcs48_set_context - set the current context
959    from the source
960-------------------------------------------------*/
961
962static void mcs48_set_context(void *src)
963{
964   if (src != NULL)
965   {
966      mcs48 = *(mcs48_regs *)src;
967      update_regptr();
968      change_pc(PC);
969   }
970}
971
972
973/*-------------------------------------------------
974    mcs48_set_info - set a piece of information
975    on the CPU core
976-------------------------------------------------*/
977
978static void mcs48_set_info(UINT32 state, cpuinfo *info)
979{
980   switch (state)
981   {
982      /* --- the following bits of info are set as 64-bit signed integers --- */
983      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_IRQ:   mcs48.irq_state = (info->i != CLEAR_LINE);   break;
984      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_EA:   mcs48.ea = info->i;                     break;
985
986      case CPUINFO_INT_PC:
987      case CPUINFO_INT_REGISTER + MCS48_PC:         PC = info->i;                        break;
988      case CPUINFO_INT_SP:
989      case CPUINFO_INT_REGISTER + MCS48_PSW:         PSW = info->i;                        break;
990      case CPUINFO_INT_REGISTER + MCS48_A:         A = info->i;                        break;
991      case CPUINFO_INT_REGISTER + MCS48_TC:         mcs48.timer = info->i;                  break;
992      case CPUINFO_INT_REGISTER + MCS48_P1:         mcs48.p1 = info->i;                     break;
993      case CPUINFO_INT_REGISTER + MCS48_P2:         mcs48.p2 = info->i;                     break;
994      case CPUINFO_INT_REGISTER + MCS48_R0:         R0 = info->i;                        break;
995      case CPUINFO_INT_REGISTER + MCS48_R1:         R1 = info->i;                        break;
996      case CPUINFO_INT_REGISTER + MCS48_R2:         R2 = info->i;                        break;
997      case CPUINFO_INT_REGISTER + MCS48_R3:         R3 = info->i;                        break;
998      case CPUINFO_INT_REGISTER + MCS48_R4:         R4 = info->i;                        break;
999      case CPUINFO_INT_REGISTER + MCS48_R5:         R5 = info->i;                        break;
1000      case CPUINFO_INT_REGISTER + MCS48_R6:         R6 = info->i;                        break;
1001      case CPUINFO_INT_REGISTER + MCS48_R7:         R7 = info->i;                        break;
1002      case CPUINFO_INT_REGISTER + MCS48_EA:         mcs48.ea = info->i;                     break;
1003   }
1004}
1005
1006
1007/*-------------------------------------------------
1008    mcs48_get_info - retrieve a piece of
1009    information from the CPU core
1010-------------------------------------------------*/
1011
1012static void mcs48_get_info(UINT32 state, cpuinfo *info)
1013{
1014   switch (state)
1015   {
1016      /* --- the following bits of info are returned as 64-bit signed integers --- */
1017      case CPUINFO_INT_CONTEXT_SIZE:                     info->i = sizeof(mcs48);            break;
1018      case CPUINFO_INT_INPUT_LINES:                     info->i = 2;                     break;
1019      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:               info->i = MCS48_INPUT_IRQ;            break;
1020      case CPUINFO_INT_ENDIANNESS:                     info->i = CPU_IS_LE;               break;
1021      case CPUINFO_INT_CLOCK_MULTIPLIER:                  info->i = 1;                     break;
1022      case CPUINFO_INT_CLOCK_DIVIDER:                     info->i = 3*5;                     break;
1023      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:               info->i = 1;                     break;
1024      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:               info->i = 2;                     break;
1025      case CPUINFO_INT_MIN_CYCLES:                     info->i = 1;                     break;
1026      case CPUINFO_INT_MAX_CYCLES:                     info->i = 3;                     break;
1027
1028      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM:   info->i = 8;                     break;
1029      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: /*info->i = 10 or 11 or 12;*/         break;
1030      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0;                     break;
1031      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA:   info->i = 8;                     break;
1032      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:    /*info->i = 6 or 7;*/               break;
1033      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA:    info->i = 0;                     break;
1034      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 8;                     break;
1035      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 9;                     break;
1036      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO:       info->i = 0;                     break;
1037
1038      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_IRQ:         info->i = mcs48.irq_state ? ASSERT_LINE : CLEAR_LINE; break;
1039      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_EA:         info->i = mcs48.ea;                  break;
1040
1041      case CPUINFO_INT_PREVIOUSPC:                     info->i = mcs48.prevpc.w.l;            break;
1042
1043      case CPUINFO_INT_PC:
1044      case CPUINFO_INT_REGISTER + MCS48_PC:               info->i = PC;                     break;
1045      case CPUINFO_INT_REGISTER + MCS48_PSW:               info->i = PSW;                     break;
1046      case CPUINFO_INT_REGISTER + MCS48_A:               info->i = A;                     break;
1047      case CPUINFO_INT_REGISTER + MCS48_TC:               info->i = mcs48.timer;               break;
1048      case CPUINFO_INT_REGISTER + MCS48_P1:               info->i = mcs48.p1;                  break;
1049      case CPUINFO_INT_REGISTER + MCS48_P2:               info->i = mcs48.p2;                  break;
1050      case CPUINFO_INT_REGISTER + MCS48_R0:               info->i = R0;                     break;
1051      case CPUINFO_INT_REGISTER + MCS48_R1:               info->i = R1;                     break;
1052      case CPUINFO_INT_REGISTER + MCS48_R2:               info->i = R2;                     break;
1053      case CPUINFO_INT_REGISTER + MCS48_R3:               info->i = R3;                     break;
1054      case CPUINFO_INT_REGISTER + MCS48_R4:               info->i = R4;                     break;
1055      case CPUINFO_INT_REGISTER + MCS48_R5:               info->i = R5;                     break;
1056      case CPUINFO_INT_REGISTER + MCS48_R6:               info->i = R6;                     break;
1057      case CPUINFO_INT_REGISTER + MCS48_R7:               info->i = R7;                     break;
1058      case CPUINFO_INT_REGISTER + MCS48_EA:               info->i = mcs48.ea;                  break;
1059
1060      /* --- the following bits of info are returned as pointers to data or functions --- */
1061      case CPUINFO_PTR_SET_INFO:                        info->setinfo = mcs48_set_info;         break;
1062      case CPUINFO_PTR_GET_CONTEXT:                     info->getcontext = mcs48_get_context;   break;
1063      case CPUINFO_PTR_SET_CONTEXT:                     info->setcontext = mcs48_set_context;   break;
1064      case CPUINFO_PTR_INIT:                           /*info->init = i8039_init;*/         break;
1065      case CPUINFO_PTR_RESET:                           info->reset = mcs48_reset;            break;
1066      case CPUINFO_PTR_EXECUTE:                        info->execute = mcs48_execute;         break;
1067      case CPUINFO_PTR_BURN:                           info->burn = NULL;                  break;
1068      case CPUINFO_PTR_DISASSEMBLE:                     info->disassemble = mcs48_dasm;         break;
1069      case CPUINFO_PTR_INSTRUCTION_COUNTER:               info->icount = &mcs48_icount;         break;
1070
1071      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: /*info->internal_map8 = address_map_program_10bit;*/ break;
1072      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:    /*info->internal_map8 = address_map_data_7bit;*/ break;
1073
1074      /* --- the following bits of info are returned as NULL-terminated strings --- */
1075      case CPUINFO_STR_NAME:                           /*strcpy(info->s, "I8039");*/         break;
1076      case CPUINFO_STR_CORE_FAMILY:                     strcpy(info->s, "Intel 8039");         break;
1077      case CPUINFO_STR_CORE_VERSION:                     strcpy(info->s, "1.2");               break;
1078      case CPUINFO_STR_CORE_FILE:                        strcpy(info->s, __FILE__);            break;
1079      case CPUINFO_STR_CORE_CREDITS:                     strcpy(info->s, "Copyright Mirko Buffoni\nBased on the original work Copyright Dan Boris"); break;
1080
1081      case CPUINFO_STR_FLAGS:
1082         sprintf(info->s, "%c %c%c%c%c%c%c%c%c",
1083            mcs48.a11        ? 'M':'.',
1084            PSW & 0x80 ? 'C':'.',
1085            PSW & 0x40 ? 'a':'.',
1086            PSW & 0x20 ? 'F':'.',
1087            PSW & 0x10 ? 'B':'.',
1088            PSW & 0x08 ? '?':'.',
1089            PSW & 0x04 ? '4':'.',
1090            PSW & 0x02 ? '2':'.',
1091            PSW & 0x01 ? '1':'.');
1092         break;
1093
1094      case CPUINFO_STR_REGISTER + MCS48_PC:               sprintf(info->s, "PC:%04X", PC);       break;
1095      case CPUINFO_STR_REGISTER + MCS48_PSW:               sprintf(info->s, "PSW:%02X", PSW);       break;
1096      case CPUINFO_STR_REGISTER + MCS48_A:               sprintf(info->s, "A:%02X", A);          break;
1097      case CPUINFO_STR_REGISTER + MCS48_TC:               sprintf(info->s, "TC:%02X", mcs48.timer); break;
1098      case CPUINFO_STR_REGISTER + MCS48_P1:               sprintf(info->s, "P1:%02X", mcs48.p1);    break;
1099      case CPUINFO_STR_REGISTER + MCS48_P2:               sprintf(info->s, "P2:%02X", mcs48.p2);    break;
1100      case CPUINFO_STR_REGISTER + MCS48_R0:               sprintf(info->s, "R0:%02X", R0);      break;
1101      case CPUINFO_STR_REGISTER + MCS48_R1:               sprintf(info->s, "R1:%02X", R1);       break;
1102      case CPUINFO_STR_REGISTER + MCS48_R2:               sprintf(info->s, "R2:%02X", R2);       break;
1103      case CPUINFO_STR_REGISTER + MCS48_R3:               sprintf(info->s, "R3:%02X", R3);       break;
1104      case CPUINFO_STR_REGISTER + MCS48_R4:               sprintf(info->s, "R4:%02X", R4);       break;
1105      case CPUINFO_STR_REGISTER + MCS48_R5:               sprintf(info->s, "R5:%02X", R5);       break;
1106      case CPUINFO_STR_REGISTER + MCS48_R6:               sprintf(info->s, "R6:%02X", R6);       break;
1107      case CPUINFO_STR_REGISTER + MCS48_R7:               sprintf(info->s, "R7:%02X", R7);       break;
1108      case CPUINFO_STR_REGISTER + MCS48_EA:               sprintf(info->s, "EA:%02X", mcs48.ea);    break;
1109   }
1110}
1111
1112
1113
1114/***************************************************************************
1115    CPU-SPECIFIC CONTEXT ACCESS
1116***************************************************************************/
1117
1118#if (HAS_I8035)
1119void i8035_get_info(UINT32 state, cpuinfo *info)
1120{
1121   switch (state)
1122   {
1123      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM:       info->i = 12;                              break;
1124      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:          info->i = 6;                              break;
1125      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:       info->internal_map8 = address_map_data_6bit;      break;
1126      case CPUINFO_PTR_INIT:                                 info->init = i8035_init;                     break;
1127      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8035");                     break;
1128      default:                                          mcs48_get_info(state, info);                  break;
1129   }
1130}
1131#endif
1132
1133#if (HAS_I8041)
1134void i8041_get_info(UINT32 state, cpuinfo *info)
1135{
1136   switch (state)
1137   {
1138      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM:       info->i = 10;                              break;
1139      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:          info->i = 6;                              break;
1140      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:   info->internal_map8 = address_map_program_10bit;   break;
1141      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:       info->internal_map8 = address_map_data_6bit;      break;
1142      case CPUINFO_PTR_INIT:                                 info->init = i8035_init;                     break;
1143      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8041");                     break;
1144      default:                                          mcs48_get_info(state, info);                  break;
1145   }
1146}
1147#endif
1148
1149#if (HAS_I8048)
1150void i8048_get_info(UINT32 state, cpuinfo *info)
1151{
1152   switch (state)
1153   {
1154      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM:       info->i = 10;                              break;
1155      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:          info->i = 6;                              break;
1156      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:   info->internal_map8 = address_map_program_10bit;   break;
1157      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:       info->internal_map8 = address_map_data_6bit;      break;
1158      case CPUINFO_PTR_INIT:                                 info->init = i8035_init;                     break;
1159      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8048");                     break;
1160      default:                                          mcs48_get_info(state, info);                  break;
1161   }
1162}
1163#endif
1164
1165#if (HAS_I8648)
1166void i8648_get_info(UINT32 state, cpuinfo *info)
1167{
1168   switch (state)
1169   {
1170      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM:       info->i = 10;                              break;
1171      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:          info->i = 6;                              break;
1172      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:   info->internal_map8 = address_map_program_10bit;   break;
1173      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:       info->internal_map8 = address_map_data_6bit;      break;
1174      case CPUINFO_PTR_INIT:                                 info->init = i8035_init;                     break;
1175      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8648");                     break;
1176      default:                                          mcs48_get_info(state, info);                  break;
1177   }
1178}
1179#endif
1180
1181#if (HAS_I8748)
1182void i8748_get_info(UINT32 state, cpuinfo *info)
1183{
1184   switch (state)
1185   {
1186      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM:       info->i = 10;                              break;
1187      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:          info->i = 6;                              break;
1188      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:   info->internal_map8 = address_map_program_10bit;   break;
1189      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:       info->internal_map8 = address_map_data_6bit;      break;
1190      case CPUINFO_PTR_INIT:                                 info->init = i8035_init;                     break;
1191      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8748");                     break;
1192      default:                                          mcs48_get_info(state, info);                  break;
1193   }
1194}
1195#endif
1196
1197#if (HAS_MB8884)
1198void mb8884_get_info(UINT32 state, cpuinfo *info)
1199{
1200   switch (state)
1201   {
1202      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM:       info->i = 10;                              break;
1203      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:          info->i = 6;                              break;
1204      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:   info->internal_map8 = address_map_program_10bit;   break;
1205      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:       info->internal_map8 = address_map_data_6bit;      break;
1206      case CPUINFO_PTR_INIT:                                 info->init = i8035_init;                     break;
1207      case CPUINFO_STR_NAME:                                 strcpy(info->s, "MB8884");                     break;
1208      default:                                          mcs48_get_info(state, info);                  break;
1209   }
1210}
1211#endif
1212
1213#if (HAS_N7751)
1214void n7751_get_info(UINT32 state, cpuinfo *info)
1215{
1216   switch (state)
1217   {
1218      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM:       info->i = 10;                              break;
1219      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:          info->i = 6;                              break;
1220      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:   info->internal_map8 = address_map_program_10bit;   break;
1221      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:       info->internal_map8 = address_map_data_6bit;      break;
1222      case CPUINFO_PTR_INIT:                                 info->init = i8035_init;                     break;
1223      case CPUINFO_STR_NAME:                                 strcpy(info->s, "N7751");                     break;
1224      default:                                          mcs48_get_info(state, info);                  break;
1225   }
1226}
1227#endif
1228
1229
1230
1231#if (HAS_I8039)
1232void i8039_get_info(UINT32 state, cpuinfo *info)
1233{
1234   switch (state)
1235   {
1236      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM:       info->i = 12;                              break;
1237      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:          info->i = 7;                              break;
1238      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:       info->internal_map8 = address_map_data_7bit;      break;
1239      case CPUINFO_PTR_INIT:                                 info->init = i8039_init;                     break;
1240      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8039");                     break;
1241      default:                                          mcs48_get_info(state, info);                  break;
1242   }
1243}
1244#endif
1245
1246#if (HAS_I8049)
1247void i8049_get_info(UINT32 state, cpuinfo *info)
1248{
1249   switch (state)
1250   {
1251      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM:       info->i = 11;                              break;
1252      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:          info->i = 7;                              break;
1253      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:   info->internal_map8 = address_map_program_11bit;   break;
1254      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:       info->internal_map8 = address_map_data_7bit;      break;
1255      case CPUINFO_PTR_INIT:                                 info->init = i8039_init;                     break;
1256      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8049");                     break;
1257      default:                                          mcs48_get_info(state, info);                  break;
1258   }
1259}
1260#endif
1261
1262#if (HAS_I8749)
1263void i8749_get_info(UINT32 state, cpuinfo *info)
1264{
1265   switch (state)
1266   {
1267      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM:       info->i = 11;                              break;
1268      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:          info->i = 7;                              break;
1269      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM:   info->internal_map8 = address_map_program_11bit;   break;
1270      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:       info->internal_map8 = address_map_data_7bit;      break;
1271      case CPUINFO_PTR_INIT:                                 info->init = i8039_init;                     break;
1272      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8749");                     break;
1273      default:                                          mcs48_get_info(state, info);                  break;
1274   }
1275}
1276#endif
1277
1278#if (HAS_M58715)
1279void m58715_get_info(UINT32 state, cpuinfo *info)
1280{
1281   switch (state)
1282   {
1283      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM:       info->i = 12;                              break;
1284      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:          info->i = 7;                              break;
1285      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_DATA:       info->internal_map8 = address_map_data_7bit;      break;
1286      case CPUINFO_PTR_INIT:                                 info->init = i8039_init;                     break;
1287      case CPUINFO_STR_NAME:                                 strcpy(info->s, "M58715");                     break;
1288      default:                                          mcs48_get_info(state, info);                  break;
1289   }
1290}
1291#endif
src/emu/cpu/mcs48/mcs48dsm.c
r0r3116
1/****************************************************************************
2 *
3 *      mcs48 disassembler
4 *
5 * This file is Copyright Michael Cuddy, Fen's Ende Sofware.
6 * Redistribution is allowed in source and binary form as long as both
7 * forms are distributed together with the file 'README'.  This copyright
8 * notice must also accompany the files.
9 *
10 * This software should be considered a small token to all of the
11 * emulator authors for thier dilligence in preserving our Arcade and
12 * Computer history.
13 *
14 * Michael Cuddy, Fen's Ende Software.
15 * 11/25/1996
16 *
17 * Adapted by Andrea Mazzoleni for use with MAME
18 *
19 ***************************************************************************/
20
21#include <ctype.h>
22
23#include "cpuintrf.h"
24
25#define mame_printf_debug printf
26
27typedef unsigned char byte;
28
29#define FMT(a,b) a, b
30#define PTRS_PER_FORMAT 2
31
32static const char *const Formats[] = {
33   FMT("00000011dddddddd", "add  a,#$%X"),
34   FMT("01101rrr", "add  a,%R"),
35   FMT("0110000r", "add  a,@%R"),
36   FMT("00010011dddddddd", "adc  a,#$%X"),
37   FMT("01111rrr", "adc  a,%R"),
38   FMT("0111000r", "adc  a,@%R"),
39   FMT("01010011dddddddd", "anl  a,#$%X"),
40   FMT("01011rrr", "anl  a,%R"),
41   FMT("0101000r", "anl  a,@%R"),
42   FMT("10011000dddddddd", "anl  bus,#$%X"),
43   FMT("10011001dddddddd", "anl  p1,#$%X"),
44   FMT("10011010dddddddd", "anl  p2,#$%X"),
45   FMT("100111pp", "anld %P,a"),
46   FMT("aaa10100aaaaaaaa", "!call %A"),
47   FMT("00100111", "clr  a"),
48   FMT("10010111", "clr  c"),
49   FMT("10100101", "clr  f1"),
50   FMT("10000101", "clr  f0"),
51   FMT("00110111", "cpl  a"),
52   FMT("10100111", "cpl  c"),
53   FMT("10010101", "cpl  f0"),
54   FMT("10110101", "cpl  f1"),
55   FMT("01010111", "da   a"),
56   FMT("00000111", "dec  a"),
57   FMT("11001rrr", "dec  %R"),
58   FMT("00010101", "dis  i"),
59   FMT("00110101", "dis  tcnti"),
60   FMT("11101rrraaaaaaaa", "!djnz %R,%J"),
61   FMT("00000101", "en   i"),
62   FMT("00100101", "en   tcnti"),
63   FMT("01110101", "ent0 clk"),
64   FMT("00001001", "in   a,p1"),
65   FMT("00001010", "in   a,p2"),
66   FMT("00010111", "inc  a"),
67   FMT("00011rrr", "inc  %R"),
68   FMT("0001000r", "inc  @%R"),
69   FMT("00001000", "ins  a,bus"),
70   FMT("0001 0110aaaaaaaa", "jtf  %J"),
71   FMT("0010 0110aaaaaaaa", "jnt0 %J"),
72   FMT("0011 0110aaaaaaaa", "jt0  %J"),
73   FMT("0100 0110aaaaaaaa", "jnt1 %J"),
74   FMT("0101 0110aaaaaaaa", "jt1  %J"),
75   FMT("0111 0110aaaaaaaa", "jf1  %J"),
76   FMT("1000 0110aaaaaaaa", "jni  %J"),
77   FMT("1001 0110aaaaaaaa", "jnz  %J"),
78   FMT("1011 0110aaaaaaaa", "jf0  %J"),
79   FMT("1100 0110aaaaaaaa", "jz   %J"),
80   FMT("1110 0110aaaaaaaa", "jnc  %J"),
81   FMT("1111 0110aaaaaaaa", "jc   %J"),
82   FMT("bbb10010aaaaaaaa", "jb%B  %J"),
83   FMT("aaa00100aaaaaaaa", "jmp  %A"),
84   FMT("10110011", "jmpp @a"),
85   FMT("00100011dddddddd", "mov  a,#$%X"),
86   FMT("11111rrr", "mov  a,%R"),
87   FMT("1111000r", "mov  a,@%R"),
88   FMT("11000111", "mov  a,psw"),
89   FMT("10111rrrdddddddd", "mov  %R,#$%X"),
90   FMT("10101rrr", "mov  %R,a"),
91   FMT("1010000r", "mov  @%R,a"),
92   FMT("1011000rdddddddd", "mov  @%R,#$%X"),
93   FMT("11010111", "mov  psw,a"),
94   FMT("000011pp", "movd a,%P"),
95   FMT("001111pp", "movd %P,a"),
96   FMT("01000010", "mov  a,t"),
97   FMT("01100010", "mov  t,a"),
98   FMT("11100011", "movp3 a,@a"),
99   FMT("10100011", "movp a,@a"),
100   FMT("1000000r", "movx a,@%R"),
101   FMT("1001000r", "movx @%R,a"),
102   FMT("0100 1rrr", "orl  a,%R"),
103   FMT("0100 000r", "orl  a,@%R"),
104   FMT("0100 0011dddddddd", "orl  a,#$%X"),
105   FMT("1000 1000dddddddd", "orl  bus,#$%X"),
106   FMT("1000 1001dddddddd", "orl  p1,#$%X"),
107   FMT("1000 1010dddddddd", "orl  p2,#$%X"),
108   FMT("1000 11pp", "orld %P,a"),
109   FMT("00000010", "outl bus,a"),
110   FMT("001110pp", "outl %P,a"),
111   FMT("10000011", "^ret"),
112   FMT("10010011", "^retr"),
113   FMT("11100111", "rl   a"),
114   FMT("11110111", "rlc  a"),
115   FMT("01110111", "rr   a"),
116   FMT("01100111", "rrc  a"),
117   FMT("11100101", "sel  mb0"),
118   FMT("11110101", "sel  mb1"),
119   FMT("11000101", "sel  rb0"),
120   FMT("11010101", "sel  rb1"),
121   FMT("01100101", "stop tcnt"),
122   FMT("01000101", "strt cnt"),
123   FMT("01010101", "strt t"),
124   FMT("01000111", "swap a"),
125   FMT("00101rrr", "xch  a,%R"),
126   FMT("0010000r", "xch  a,@%R"),
127   FMT("0011000r", "xchd a,@%R"),
128   FMT("1101 0011dddddddd", "xrl  a,#$%X"),
129   FMT("1101 1rrr", "xrl  a,%R"),
130   FMT("1101 000r", "xrl  a,@%R"),
131   FMT("00000000", "nop"),
132   NULL
133};
134
135#define MAX_OPS (((sizeof(Formats) / sizeof(Formats[0])) - 1) / PTRS_PER_FORMAT)
136
137typedef struct opcode {
138   byte mask;   /* instruction mask */
139   byte bits;   /* constant bits */
140   char extcode;   /* value that gets extension code */
141   const char *parse;   /* how to parse bits */
142   const char *fmt;   /* instruction format */
143   unsigned long flags;
144} M48Opcode;
145
146static M48Opcode Op[MAX_OPS+1];
147static int OpInizialized = 0;
148
149static void InitDasm8039(void)
150{
151   const char *p;
152   const char *const *ops;
153   byte mask, bits;
154   int bit;
155   int i;
156
157   ops = Formats; i = 0;
158   while (*ops) {
159   unsigned long flags = 0;
160   p = *ops;
161   mask = 0; bits = 0; bit = 7;
162   while (*p && bit >= 0) {
163      switch (*p++) {
164         case '1': mask |= 1<<bit; bits |= 1<<bit; bit--; break;
165         case '0': mask |= 1<<bit; bit--; break;
166         case ' ': break;
167         case 'b':
168         case 'a': case 'r': case 'd': case 'p':
169            bit --;
170            break;
171         default:
172            fatalerror("Invalid instruction encoding '%s %s'\n", ops[0],ops[1]);
173            break;
174      }
175   }
176   if (bit != -1 ) {
177      fatalerror("not enough bits in encoding '%s %s' %d\n", ops[0],ops[1],bit);
178      break;
179   }
180   while (isspace(*p)) p++;
181   if (*p) Op[i].extcode = *p;
182   Op[i].bits = bits;
183   Op[i].mask = mask;
184   Op[i].fmt = ops[1];
185   Op[i].parse = ops[0];
186
187   if (Op[i].fmt[0] == '!')
188   {
189      flags |= DASMFLAG_STEP_OVER;
190      Op[i].fmt++;
191   }
192   if (Op[i].fmt[0] == '^')
193   {
194      flags |= DASMFLAG_STEP_OUT;
195      Op[i].fmt++;
196   }
197   Op[i].flags = flags;
198
199   ops += PTRS_PER_FORMAT;
200   i++;
201   }
202
203   OpInizialized = 1;
204}
205
206offs_t mcs48_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
207{
208   int b, a, d, r, p;   /* these can all be filled in by parsing an instruction */
209   int i;
210   int op;
211   int cnt = 1;
212   int code, bit;
213   const char *cp;
214
215   if (!OpInizialized) InitDasm8039();
216
217   code = oprom[0];
218   op = -1;   /* no matching opcode */
219   for ( i = 0; i < MAX_OPS; i++)
220   {
221      if( (code & Op[i].mask) == Op[i].bits )
222      {
223         if (op != -1)
224         {
225            fprintf(stderr, "Error: opcode %02X matches %d (%s) and %d (%s)\n",
226               code,i,Op[i].fmt,op,Op[op].fmt);
227         }
228         op = i;
229      }
230   }
231
232   if (op == -1)
233   {
234      sprintf(buffer,"db   %2.2x",code);
235      return cnt | DASMFLAG_SUPPORTED;
236   }
237
238   if (Op[op].extcode)
239   {
240      cnt++;
241      code <<= 8;
242      code |= opram[1];
243      bit = 15;
244   }
245   else
246   {
247      bit = 7;
248   }
249
250   /* shift out operands */
251   cp = Op[op].parse;
252   b = a = d = r = p = 0;
253
254   while (bit >= 0)
255   {
256      /* mame_printf_debug("{%c/%d}",*cp,bit); */
257      switch(*cp)
258      {
259         case 'a': a <<=1; a |= ((code & (1<<bit)) ? 1 : 0); bit--; break;
260         case 'b': b <<=1; b |= ((code & (1<<bit)) ? 1 : 0); bit--; break;
261         case 'd': d <<=1; d |= ((code & (1<<bit)) ? 1 : 0); bit--; break;
262         case 'r': r <<=1; r |= ((code & (1<<bit)) ? 1 : 0); bit--; break;
263         case 'p': p <<=1; p |= ((code & (1<<bit)) ? 1 : 0); bit--; break;
264         case ' ': break;
265         case '1': case '0': bit--; break;
266         case '\0': fatalerror("premature end of parse string, opcode %x, bit = %d\n",code,bit); break;
267      }
268      cp++;
269   }
270
271   /* now traverse format string */
272   cp = Op[op].fmt;
273   while (*cp)
274   {
275      if (*cp == '%')
276      {
277         char num[10], *q;
278         cp++;
279         switch (*cp++)
280         {
281            case 'A': sprintf(num,"$%04X",a); break;
282            case 'J': sprintf(num,"$%04X",((pc+1) & 0xf00) | a); break;
283            case 'B': sprintf(num,"%d",b); break;
284            case 'D': sprintf(num,"%d",d); break;
285            case 'X': sprintf(num,"%X",d); break;
286            case 'R': sprintf(num,"r%d",r); break;
287            case 'P': sprintf(num,"p%d",p); break;
288            default:
289               fatalerror("illegal escape character in format '%s'\n",Op[op].fmt);
290               break;
291         }
292         q = num; while (*q) *buffer++ = *q++;
293         *buffer = '\0';
294      }
295      else
296      {
297         *buffer++ = *cp++;
298         *buffer = '\0';
299      }
300   }
301
302   return cnt | Op[op].flags | DASMFLAG_SUPPORTED;
303}
src/emu/cpu/mcs48/mcs48.h
r0r3116
1/***************************************************************************
2
3    mcs48.c
4
5    Intel MCS-48 Portable Emulator
6
7    Copyright Mirko Buffoni
8    Based on the original work Copyright Dan Boris, an 8048 emulator
9    You are not allowed to distribute this software commercially
10
11***************************************************************************/
12
13#pragma once
14
15#ifndef __I8039_H__
16#define __I8039_H__
17
18#include "cpuintrf.h"
19
20
21/***************************************************************************
22    CONSTANTS
23***************************************************************************/
24
25/* register access indexes */
26enum
27{
28   MCS48_PC = 1,
29   MCS48_PSW,
30   MCS48_A,
31   MCS48_TC,
32   MCS48_P1,
33   MCS48_P2,
34   MCS48_R0,
35   MCS48_R1,
36   MCS48_R2,
37   MCS48_R3,
38   MCS48_R4,
39   MCS48_R5,
40   MCS48_R6,
41   MCS48_R7,
42   MCS48_EA
43};
44
45
46/* I/O port access indexes */
47enum
48{
49   MCS48_INPUT_IRQ = 0,
50   MCS48_INPUT_EA
51};
52
53
54/* special I/O space ports */
55enum
56{
57   MCS48_PORT_P0   = 0x100,   /* Not used */
58   MCS48_PORT_P1   = 0x101,
59   MCS48_PORT_P2   = 0x102,
60   MCS48_PORT_P4   = 0x104,
61   MCS48_PORT_P5   = 0x105,
62   MCS48_PORT_P6   = 0x106,
63   MCS48_PORT_P7   = 0x107,
64   MCS48_PORT_T0   = 0x110,
65   MCS48_PORT_T1   = 0x111,
66   MCS48_PORT_BUS   = 0x120
67};
68
69
70
71/***************************************************************************
72    FUNCTION PROTOTYPES
73***************************************************************************/
74
75/* variants with 64 bytes of internal RAM and up to 1k of internal ROM */
76void i8035_get_info(UINT32 state, cpuinfo *info);
77void i8041_get_info(UINT32 state, cpuinfo *info);
78void i8048_get_info(UINT32 state, cpuinfo *info);
79void i8648_get_info(UINT32 state, cpuinfo *info);
80void i8748_get_info(UINT32 state, cpuinfo *info);
81void mb8884_get_info(UINT32 state, cpuinfo *info);
82void n7751_get_info(UINT32 state, cpuinfo *info);
83
84/* variants with 128 bytes of internal RAM and up to 2k of internal ROM */
85void i8039_get_info(UINT32 state, cpuinfo *info);
86void i8049_get_info(UINT32 state, cpuinfo *info);
87void i8749_get_info(UINT32 state, cpuinfo *info);
88void m58715_get_info(UINT32 state, cpuinfo *info);
89
90/* disassembler */
91offs_t mcs48_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
92
93#endif  /* __I8039_H__ */
src/emu/cpu/cpu.mak
r3115r3116
606606#-------------------------------------------------
607607
608608CPUDEFS += -DHAS_I8035=$(if $(filter I8035,$(CPUS)),1,0)
609CPUDEFS += -DHAS_I8041=$(if $(filter I8041,$(CPUS)),1,0)
610CPUDEFS += -DHAS_I8048=$(if $(filter I8048,$(CPUS)),1,0)
611CPUDEFS += -DHAS_I8648=$(if $(filter I8648,$(CPUS)),1,0)
612CPUDEFS += -DHAS_I8748=$(if $(filter I8748,$(CPUS)),1,0)
613CPUDEFS += -DHAS_MB8884=$(if $(filter MB8884,$(CPUS)),1,0)
614
609615CPUDEFS += -DHAS_I8039=$(if $(filter I8039,$(CPUS)),1,0)
610CPUDEFS += -DHAS_I8048=$(if $(filter I8048,$(CPUS)),1,0)
616CPUDEFS += -DHAS_I8049=$(if $(filter I8049,$(CPUS)),1,0)
611617CPUDEFS += -DHAS_I8749=$(if $(filter I8749,$(CPUS)),1,0)
612618CPUDEFS += -DHAS_N7751=$(if $(filter N7751,$(CPUS)),1,0)
613CPUDEFS += -DHAS_MB8884=$(if $(filter MB8884,$(CPUS)),1,0)
614619CPUDEFS += -DHAS_M58715=$(if $(filter M58715,$(CPUS)),1,0)
615620
616ifneq ($(filter I8035 I8039 I8048 I8749 N7751 MB8884 M58715,$(CPUS)),)
617OBJDIRS += $(CPUOBJ)/i8039
618CPUOBJS += $(CPUOBJ)/i8039/i8039.o
619DBGOBJS += $(CPUOBJ)/i8039/8039dasm.o
621ifneq ($(filter I8035 I8041 I8048 I8648 I8748 MB8884 I8039 I8049 I8749 N7751 M58715,$(CPUS)),)
622OBJDIRS += $(CPUOBJ)/mcs48
623CPUOBJS += $(CPUOBJ)/mcs48/mcs48.o
624DBGOBJS += $(CPUOBJ)/mcs48/mcs48dsm.o
620625endif
621626
622$(CPUOBJ)/i8039/i8039.o:   $(CPUSRC)/i8039/i8039.c \
623                     $(CPUSRC)/i8039/i8039.h
627$(CPUOBJ)/mcs48/mcs48.o:   $(CPUSRC)/mcs48/mcs48.c \
628                     $(CPUSRC)/mcs48/mcs48.h
624629
625630
626631
r3115r3116
11351140endif
11361141
11371142# rule to ensure we build the header before building the core CPU file
1138$(CPUOBJ)/m68000/m68kcpu.o: $(CPUOBJ)/m68000/m68kops.c
1143$(CPUOBJ)/m68000/m68kcpu.o:    $(CPUOBJ)/m68000/m68kops.c \
1144                        $(CPUSRC)/m68000/m68kcpu.h
11391145
1146$(CPUOBJ)/m68000/m68kmame.o:   $(CPUSRC)/m68000/m68kmame.c \
1147                        $(CPUSRC)/m68000/m68kcpu.h
11401148
11411149
1150
11421151#-------------------------------------------------
11431152# Motorola/Freescale dsp56k
11441153#-------------------------------------------------
src/emu/cpu/m6502/ill02.h
r3115r3116
233233   S = A & X;                                       \
234234    tmp = S & (EAH+1)
235235#if 0
236#define SSH                                        \
236237   tmp = S = A & X;                                 \
237238   tmp &= (UINT8)(cpu_readop_arg((PCW + 1) & 0xffff) + 1)
238239#endif
src/emu/cpu/sh4/sh4.c
r3115r3116
300300   sh4.ea = sh4.gbr + sh4.r[0];
301301   temp = i & RB( sh4.ea );
302302   WB( sh4.ea, temp );
303   sh4_icount -= 2;
303   sh4.sh4_icount -= 2;
304304}
305305
306306/*  code                 cycles  t-bit
r3115r3116
314314      INT32 disp = ((INT32)d << 24) >> 24;
315315      sh4.pc = sh4.ea = sh4.pc + disp * 2 + 2;
316316      change_pc(sh4.pc & AM);
317      sh4_icount -= 2;
317      sh4.sh4_icount -= 2;
318318   }
319319}
320320
r3115r3116
329329      INT32 disp = ((INT32)d << 24) >> 24;
330330      sh4.delay = sh4.pc;
331331      sh4.pc = sh4.ea = sh4.pc + disp * 2 + 2;
332      sh4_icount--;
332      sh4.sh4_icount--;
333333   }
334334}
335335
r3115r3116
349349         * NOP
350350         */
351351      if (next_opcode == 0x0009)
352         sh4_icount %= 3;   /* cycles for BRA $ and NOP taken (3) */
352         sh4.sh4_icount %= 3;   /* cycles for BRA $ and NOP taken (3) */
353353   }
354354#endif
355355   sh4.delay = sh4.pc;
356356   sh4.pc = sh4.ea = sh4.pc + disp * 2 + 2;
357   sh4_icount--;
357   sh4.sh4_icount--;
358358}
359359
360360/*  code                 cycles  t-bit
r3115r3116
365365{
366366   sh4.delay = sh4.pc;
367367   sh4.pc += sh4.r[m] + 2;
368   sh4_icount--;
368   sh4.sh4_icount--;
369369}
370370
371371/*  code                 cycles  t-bit
r3115r3116
379379   sh4.pr = sh4.pc + 2;
380380   sh4.delay = sh4.pc;
381381   sh4.pc = sh4.ea = sh4.pc + disp * 2 + 2;
382   sh4_icount--;
382   sh4.sh4_icount--;
383383}
384384
385385/*  code                 cycles  t-bit
r3115r3116
391391   sh4.pr = sh4.pc + 2;
392392   sh4.delay = sh4.pc;
393393   sh4.pc += sh4.r[m] + 2;
394   sh4_icount--;
394   sh4.sh4_icount--;
395395}
396396
397397/*  code                 cycles  t-bit
r3115r3116
405405      INT32 disp = ((INT32)d << 24) >> 24;
406406      sh4.pc = sh4.ea = sh4.pc + disp * 2 + 2;
407407      change_pc(sh4.pc & AM);
408      sh4_icount -= 2;
408      sh4.sh4_icount -= 2;
409409   }
410410}
411411
r3115r3116
420420      INT32 disp = ((INT32)d << 24) >> 24;
421421      sh4.delay = sh4.pc;
422422      sh4.pc = sh4.ea = sh4.pc + disp * 2 + 2;
423      sh4_icount--;
423      sh4.sh4_icount--;
424424   }
425425}
426426
r3115r3116
732732   }
733733   sh4.mach = Res2;
734734   sh4.macl = Res0;
735   sh4_icount--;
735   sh4.sh4_icount--;
736736}
737737
738738/*  DMULU.L Rm,Rn */
r3115r3116
760760   Res2 = Res2 + ((Res1 >> 16) & 0x0000ffff) + temp3;
761761   sh4.mach = Res2;
762762   sh4.macl = Res0;
763   sh4_icount--;
763   sh4.sh4_icount--;
764764}
765765
766766/*  DT      Rn */
r3115r3116
779779         */
780780      if (next_opcode == 0x8bfd)
781781      {
782         while (sh4.r[n] > 1 && sh4_icount > 4)
782         while (sh4.r[n] > 1 && sh4.sh4_icount > 4)
783783         {
784784            sh4.r[n]--;
785            sh4_icount -= 4;   /* cycles for DT (1) and BF taken (3) */
785            sh4.sh4_icount -= 4;   /* cycles for DT (1) and BF taken (3) */
786786         }
787787      }
788788   }
r3115r3116
826826   sh4.delay = sh4.pc;
827827   sh4.pr = sh4.pc + 2;
828828   sh4.pc = sh4.ea = sh4.r[m];
829   sh4_icount--;
829   sh4.sh4_icount--;
830830}
831831
832832
833833/*  LDC     Rm,SR */
834834INLINE void LDCSR(UINT32 m)
835835{
836UINT32 reg;
837
838   reg = sh4.r[m];
836839   if ((Machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
837840      sh4_syncronize_register_bank((sh4.sr & sRB) >> 29);
838841   if ((sh4.r[m] & sRB) != (sh4.sr & sRB))
839842      sh4_change_register_bank(sh4.r[m] & sRB ? 1 : 0);
840   sh4.sr = sh4.r[m] & FLAGS;
843   sh4.sr = reg & FLAGS;
841844   sh4_exception_recompute();
842845}
843846
r3115r3116
866869   if ((old & sRB) != (sh4.sr & sRB))
867870      sh4_change_register_bank(sh4.sr & sRB ? 1 : 0);
868871   sh4.r[m] += 4;
869   sh4_icount -= 2;
872   sh4.sh4_icount -= 2;
870873   sh4_exception_recompute();
871874}
872875
r3115r3116
876879   sh4.ea = sh4.r[m];
877880   sh4.gbr = RL( sh4.ea );
878881   sh4.r[m] += 4;
879   sh4_icount -= 2;
882   sh4.sh4_icount -= 2;
880883}
881884
882885/*  LDC.L   @Rm+,VBR */
r3115r3116
885888   sh4.ea = sh4.r[m];
886889   sh4.vbr = RL( sh4.ea );
887890   sh4.r[m] += 4;
888   sh4_icount -= 2;
891   sh4.sh4_icount -= 2;
889892}
890893
891894/*  LDS     Rm,MACH */
r3115r3116
10041007      sh4.mach = Res2;
10051008      sh4.macl = Res0;
10061009   }
1007   sh4_icount -= 2;
1010   sh4.sh4_icount -= 2;
10081011}
10091012
10101013/*  MAC.W   @Rm+,@Rn+ */
r3115r3116
10561059      if (templ > sh4.macl)
10571060         sh4.mach += 1;
10581061      }
1059   sh4_icount -= 2;
1062   sh4.sh4_icount -= 2;
10601063}
10611064
10621065/*  MOV     Rm,Rn */
r3115r3116
13371340INLINE void MULL(UINT32 m, UINT32 n)
13381341{
13391342   sh4.macl = sh4.r[n] * sh4.r[m];
1340   sh4_icount--;
1343   sh4.sh4_icount--;
13411344}
13421345
13431346/*  MULS    Rm,Rn */
r3115r3116
13921395INLINE void ORI(UINT32 i)
13931396{
13941397   sh4.r[0] |= i;
1395   sh4_icount -= 2;
1398   sh4.sh4_icount -= 2;
13961399}
13971400
13981401/*  OR.B    #imm,@(R0,GBR) */
r3115r3116
14521455   if ((sh4.ssr & sRB) != (sh4.sr & sRB))
14531456      sh4_change_register_bank(sh4.ssr & sRB ? 1 : 0);
14541457   sh4.sr = sh4.ssr;
1455   sh4_icount--;
1458   sh4.sh4_icount--;
14561459   sh4_exception_recompute();
14571460}
14581461
r3115r3116
14611464{
14621465   sh4.delay = sh4.pc;
14631466   sh4.pc = sh4.ea = sh4.pr;
1464   sh4_icount--;
1467   sh4.sh4_icount--;
14651468}
14661469
14671470/*  SETT */
r3115r3116
15381541INLINE void SLEEP(void)
15391542{
15401543   sh4.pc -= 2;
1541   sh4_icount -= 2;
1544   sh4.sh4_icount -= 2;
15421545   /* Wait_for_exception; */
15431546}
15441547
r3115r3116
15661569   sh4.r[n] -= 4;
15671570   sh4.ea = sh4.r[n];
15681571   WL( sh4.ea, sh4.sr );
1569   sh4_icount--;
1572   sh4.sh4_icount--;
15701573}
15711574
15721575/*  STC.L   GBR,@-Rn */
r3115r3116
15751578   sh4.r[n] -= 4;
15761579   sh4.ea = sh4.r[n];
15771580   WL( sh4.ea, sh4.gbr );
1578   sh4_icount--;
1581   sh4.sh4_icount--;
15791582}
15801583
15811584/*  STC.L   VBR,@-Rn */
r3115r3116
15841587   sh4.r[n] -= 4;
15851588   sh4.ea = sh4.r[n];
15861589   WL( sh4.ea, sh4.vbr );
1587   sh4_icount--;
1590   sh4.sh4_icount--;
15881591}
15891592
15901593/*  STS     MACH,Rn */
r3115r3116
17161719   temp |= 0x80;
17171720   /* Bus Lock disable */
17181721   WB( sh4.ea, temp );
1719   sh4_icount -= 3;
1722   sh4.sh4_icount -= 3;
17201723}
17211724
17221725/*  TRAPA   #imm */
r3115r3116
17421745   sh4.pc = sh4.vbr + 0x00000100;
17431746   change_pc(sh4.pc & AM);
17441747
1745   sh4_icount -= 7;
1748   sh4.sh4_icount -= 7;
17461749}
17471750
17481751/*  TST     Rm,Rn */
r3115r3116
17751778      sh4.sr |= T;
17761779   else
17771780      sh4.sr &= ~T;
1778   sh4_icount -= 2;
1781   sh4.sh4_icount -= 2;
17791782}
17801783
17811784/*  XOR     Rm,Rn */
r3115r3116
18011804   temp = RB( sh4.ea );
18021805   temp ^= imm;
18031806   WB( sh4.ea, temp );
1804   sh4_icount -= 2;
1807   sh4.sh4_icount -= 2;
18051808}
18061809
18071810/*  XTRCT   Rm,Rn */
r3115r3116
18621865   sh4.r[n] -= 4;
18631866   sh4.ea = sh4.r[n];
18641867   WL( sh4.ea, sh4.rbnk[sh4.sr&sRB ? 0 : 1][m & 7]);
1865   sh4_icount--;
1868   sh4.sh4_icount--;
18661869}
18671870
18681871/*  MOVCA.L     R0,@Rn */
r3115r3116
33133316/* Execute cycles - returns number of cycles actually run */
33143317static int sh4_execute(int cycles)
33153318{
3316   sh4_icount = cycles;
3319   sh4.sh4_icount = cycles;
33173320
33183321   if (sh4.cpu_off)
33193322      return 0;
r3115r3116
33613364      {
33623365         sh4_check_pending_irq("mame_sh4_execute");
33633366      }
3364      sh4_icount--;
3365   } while( sh4_icount > 0 );
3367      sh4.sh4_icount--;
3368   } while( sh4.sh4_icount > 0 );
33663369
3367   return cycles - sh4_icount;
3370   return cycles - sh4.sh4_icount;
33683371}
33693372
33703373/* Get registers, return context size */
r3115r3116
37063709      case CPUINFO_PTR_EXECUTE:                  info->execute = sh4_execute;         break;
37073710      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
37083711      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = sh4_dasm;         break;
3709      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &sh4_icount;            break;
3712      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &sh4.sh4_icount;            break;
37103713
37113714      /* --- the following bits of info are returned as NULL-terminated strings --- */
37123715      case CPUINFO_STR_NAME:                  strcpy(info->s, "SH-4");            break;
src/emu/cpu/sh4/sh4comn.h
r3115r3116
7474   emu_timer *rtc_timer;
7575   emu_timer *timer[3];
7676   UINT32   refresh_timer_base;
77   int     dma_timer_active[2];
77   int     dma_timer_active[4];
7878
79   int    sh4_icount;
7980   int     is_slave, cpu_number;
8081   int      cpu_clock, bus_clock, pm_clock;
8182   int      fpu_sz, fpu_pr;
r3115r3116
8586   void   (*ftcsr_read_callback)(UINT32 data);
8687} SH4;
8788
88extern int sh4_icount;
8989extern SH4 sh4;
9090
9191enum
src/emu/cpu/sh4/sh4comn.c
r3115r3116
1212#include "sh4regs.h"
1313#include "sh4comn.h"
1414
15int sh4_icount;
1615SH4 sh4;
1716
1817static const int tcnt_div[8] = { 4, 16, 64, 256, 1024, 1, 1, 1 };
r3115r3116
886885      sh4.ioport16_direction &= 0xffff;
887886      sh4.ioport16_pullup = (sh4.ioport16_pullup | sh4.ioport16_direction) ^ 0xffff;
888887      if (sh4.m[BCR2] & 1)
889         io_write_dword_64le(SH4_IOPORT_16, sh4.m[PDTRA] & sh4.ioport16_direction);
888         io_write_dword_64le(SH4_IOPORT_16, (UINT64)(sh4.m[PDTRA] & sh4.ioport16_direction) | ((UINT64)sh4.m[PCTRA] << 16));
890889      break;
891890   case PDTRA:
892891      if (sh4.m[BCR2] & 1)
893         io_write_dword_64le(SH4_IOPORT_16, sh4.m[PDTRA] & sh4.ioport16_direction);
892         io_write_dword_64le(SH4_IOPORT_16, (UINT64)(sh4.m[PDTRA] & sh4.ioport16_direction) | ((UINT64)sh4.m[PCTRA] << 16));
894893      break;
895894   case PCTRB:
896895      sh4.ioport4_pullup = 0;
r3115r3116
902901      sh4.ioport4_direction &= 0xf;
903902      sh4.ioport4_pullup = (sh4.ioport4_pullup | sh4.ioport4_direction) ^ 0xf;
904903      if (sh4.m[BCR2] & 1)
905         io_write_dword_64le(SH4_IOPORT_4, sh4.m[PDTRB] & sh4.ioport4_direction);
904         io_write_dword_64le(SH4_IOPORT_4, (sh4.m[PDTRB] & sh4.ioport4_direction) | (sh4.m[PCTRB] << 16));
906905      break;
907906   case PDTRB:
908907      if (sh4.m[BCR2] & 1)
909         io_write_dword_64le(SH4_IOPORT_4, sh4.m[PDTRB] & sh4.ioport4_direction);
908         io_write_dword_64le(SH4_IOPORT_4, (sh4.m[PDTRB] & sh4.ioport4_direction) | (sh4.m[PCTRB] << 16));
910909      break;
911910
912911   case SCBRR2:
src/emu/cpu/alph8201/8201dasm.c
r3115r3116
67671110--xx mirror for the above
68681111--xx mirror for the above
6969
70Bugs:
71[1] the Z flag is not updated correctly after a LD A,Rn instruction. Fixed in 8301.
70Notes:
71[1] bug: the Z flag is not updated correctly after a LD A,Rn instruction. Fixed in 8302 (possibly 8301).
7272
7373
74748302 CONFIRMED OPCODES:
r3115r3116
12512511111110     LD A,(IX0+A) A=[IX0+A]        --
12612611111111     RET          restore PC       --
127127
128
1298303 CONFIRMED OPCODES:
130----------------------
131all of the 8302 ones, with stricter decoding for the following:
132
13311010000 imm JNC imm      branch if !C  --
13411010001 imm JZ  imm      branch if Z   --
1351101001- imm J   imm      branch        --
136
137additionally, this opcode is modified to support 11-bit instead of 10-bit
138external addressing, this wasn't used in games however.
139
1401011-0aa     LD MB,i      modified so that bit 3 is shifted to bit 2 before loading MB.
141
142and these new opcodes are added:
143
144110101--
14511010100 imm LD A,(R77:$%02X)
14611010101 imm LD (R77:$%02X),A
14711010110 imm LD PC,(R77:$%02X)  [1]
14811010111 imm LD (R77:$%02X),PC  [2]
149
150Notes:
151[1] appears to be LD PC,x in the disassembly, however it's LD LP0,x for kouyakyu
152    which uses a 8304, so the opcode was probably changed again.
153[2] appears to be LD x,PC in the disassembly, however it's LD x,LP0 for hvoltage
154    which uses a 8304 (or 8404?), so the opcode was probably changed again.
155
128156****************************************************/
129157
130158
r3115r3116
181209
182210   /* -------------- 830x only ------------- */
183211
184   FMT("1101_0100 I", "LD   A,(R7:$%02X)"),   // D4 : 8303+ only? exctscc2, bullfgtr; not sure if R7 or R77
185   FMT("1101_0101 I", "LD   (R7:$%02X),A"),   // D5 : 8303+ only? exctscc2, bullfgtr, kouyakyu; not sure if R7 or R77
186   FMT("1101_0110 I", "LD   LP0,(R7:$%02X)"),   // D6 : 8303+ only? kouyakyu; not sure if R7 or R77
187   FMT("1101_0111 I", "LD   (R7:$%02X),LP0"),   // D7 : 8303+ only? hvoltage; not sure if R7 or R77
212   FMT("1101_0100 I", "LD   A,(R77:$%02X)"),   // D4 : 8303+ only. exctscc2, bullfgtr
213   FMT("1101_0101 I", "LD   (R77:$%02X),A"),   // D5 : 8303+ only. exctscc2, bullfgtr, kouyakyu
214   FMT("1101_0110 I", "LD   LP0,(R77:$%02X)"),   // D6 : 8303+ only. kouyakyu
215   FMT("1101_0111 I", "LD   (R77:$%02X),LP0"),   // D7 : 8303+ only. hvoltage
188216   FMT("1101_1000 I", "LD   A,($%02X)"),      // D8 : equites
189217   FMT("1101_1001 I", "LD   ($%02X),A"),      // D9 : equites
190218   FMT("1101_1010 I", "CMP  A,$%02X"),         // DA :
src/emu/cpu/alph8201/alph8201.c
r3115r3116
2121Champion Base Ball        1983  8201 (schematics)
2222Exciting Soccer           1983  8301?
2323Champion Base Ball II     1983  8302 (pcb, unofficial schematics)
24Exciting Soccer II        1984  8303?
24Exciting Soccer II        1984  8303 (uses 8303+ opcodes)
2525Equites                   1984  8303 (post)
2626Bull Fighter              1984  8303 (post)
2727Splendor Blast            1985  8303 (post)
r3115r3116
585585static void exg_ix0_ix1(void)  { UINT8 t=IX1; IX1 = IX0; IX0 = t; }
586586static void exg_ix0_ix2(void)  { UINT8 t=IX2; IX2 = IX0; IX0 = t; }
587587
588static void op_d4(void) { R.A = M_RDMEM( ((RD_REG(7) & 3) << 8) | M_RDMEM_OPCODE() ); }
589static void op_d5(void) { M_WRMEM( ((RD_REG(7) & 3) << 8) | M_RDMEM_OPCODE(), R.A ); }
590static void op_d6(void) { LP0 = M_RDMEM( ((RD_REG(7) & 3) << 8) | M_RDMEM_OPCODE() ); }
591static void op_d7(void) { M_WRMEM( ((RD_REG(7) & 3) << 8) | M_RDMEM_OPCODE(), LP0 ); }
588static void op_d4(void) { R.A = M_RDMEM( ((regRAM[(7<<3)+7] & 3) << 8) | M_RDMEM_OPCODE() ); }
589static void op_d5(void) { M_WRMEM( ((regRAM[(7<<3)+7] & 3) << 8) | M_RDMEM_OPCODE(), R.A ); }
590static void op_d6(void) { LP0 = M_RDMEM( ((regRAM[(7<<3)+7] & 3) << 8) | M_RDMEM_OPCODE() ); }
591static void op_d7(void) { M_WRMEM( ((regRAM[(7<<3)+7] & 3) << 8) | M_RDMEM_OPCODE(), LP0 ); }
592
592593static void ld_a_abs(void) { R.A = M_RDMEM( ((R.mb & 3) << 8) | M_RDMEM_OPCODE() ); }
593594static void ld_abs_a(void) { M_WRMEM( ((R.mb & 3) << 8) | M_RDMEM_OPCODE(), R.A ); }
594595
src/emu/cpu/tms32025/tms32025.c
r3115r3116
291291INLINE void SET1(UINT16 flag) { R.STR1 |=  flag; R.STR1 |= 0x0180; }
292292INLINE void MODIFY_DP (int data) { R.STR0 &= ~DP_REG;  R.STR0 |= (data & DP_REG); R.STR0 |= 0x0400; }
293293INLINE void MODIFY_PM (int data) { R.STR1 &= ~PM_REG;  R.STR1 |= (data & PM_REG); R.STR1 |= 0x0180; }
294INLINE void MODIFY_ARP(int data) { R.STR1 &= ~ARB_REG; R.STR1 |= (R.STR0 & ARP_REG); R.STR1 |= 0x0180; \
294INLINE void MODIFY_ARP(int data) { R.STR1 &= ~ARB_REG; R.STR1 |= (R.STR0 & ARP_REG); R.STR1 |= 0x0180;
295295                           R.STR0 &= ~ARP_REG; R.STR0 |= ((data << 13) & ARP_REG); R.STR0 |= 0x0400; }
296296#ifdef UNUSED_FUNCTION
297297INLINE void MODIFY_ARB(int data) { R.STR1 &= ~ARB_REG; R.STR1 |= ((data << 13) & ARB_REG); R.STR1 |= 0x0180; }
src/emu/cpu/cp1610/cp1610.c
r3115r3116
101101  }
102102
103103#if 0
104#define SET_COV(n,m)         \
104105   if ((n&0x7fff)+(m&0x7fff) > 0x7fff)   \
105106   {                     \
106107      if (!(cp1610.flags & C))\
src/emu/tilemap.c
r3115r3116
9696   UINT8                  all_tiles_dirty;   /* true if all tiles are dirty */
9797   UINT8                  all_tiles_clean;   /* true if all tiles are clean */
9898   UINT32                  palette_offset;      /* palette offset */
99   UINT32                  pen_data_offset;   /* pen data offset */
99100
100101   /* scroll information */
101102   UINT32                  scrollrows;         /* number of independently scrolled rows */
r3115r3116
344345   state_save_register_item("tilemap", tilemap_instance, tmap->enable);
345346   state_save_register_item("tilemap", tilemap_instance, tmap->attributes);
346347   state_save_register_item("tilemap", tilemap_instance, tmap->palette_offset);
348   state_save_register_item("tilemap", tilemap_instance, tmap->pen_data_offset);
347349   state_save_register_item("tilemap", tilemap_instance, tmap->scrollrows);
348350   state_save_register_item("tilemap", tilemap_instance, tmap->scrollcols);
349351   state_save_register_item_pointer("tilemap", tilemap_instance, tmap->rowscroll, rows * tileheight);
r3115r3116
384386
385387
386388/*-------------------------------------------------
389    tilemap_set_pen_data_offset - specify an offset
390    to be added to pen_data while rendering tiles
391-------------------------------------------------*/
392
393void tilemap_set_pen_data_offset(tilemap *tmap, UINT32 offset)
394{
395   if (tmap->pen_data_offset != offset)
396   {
397      tmap->pen_data_offset = offset;
398      tilemap_mark_all_tiles_dirty(tmap);
399   }
400}
401
402
403/*-------------------------------------------------
387404    tilemap_set_enable - set an enable flag for
388405    the tilemap; if 0, requests to draw the
389406    tilemap are ignored
r3115r3116
12481265   flags = tmap->tileinfo.flags ^ (tmap->attributes & 0x03);
12491266
12501267   /* draw the tile, using either direct or transparent */
1251   tmap->tileflags[logindex] = tile_draw(tmap, tmap->tileinfo.pen_data, x0, y0, tmap->tileinfo.palette_base, tmap->tileinfo.category, tmap->tileinfo.group, flags);
1268   tmap->tileflags[logindex] = tile_draw(tmap, tmap->tileinfo.pen_data + tmap->pen_data_offset, x0, y0, tmap->tileinfo.palette_base, tmap->tileinfo.category, tmap->tileinfo.group, flags);
12521269
12531270   /* if mask data is specified, apply it */
12541271   if ((flags & (TILE_FORCE_LAYER0 | TILE_FORCE_LAYER1 | TILE_FORCE_LAYER2)) == 0 && tmap->tileinfo.mask_data != NULL)
src/emu/tilemap.h
r3115r3116
131131            * setting a global palette offset via
132132                tilemap_set_palette_offset()
133133
134            * setting a global pen data offset via
135                tilemap_set_pen_data_offset()
136
134137    3. In your memory write handlers for the tile memory, anytime tile
135138        data is modified, you need to mark the tile dirty so that it is
136139        re-rendered with the new data the next time the tilemap is drawn.
r3115r3116
432435/* specify a parameter to be passed into the tile_get_info callback */
433436void tilemap_set_user_data(tilemap *tmap, void *user_data);
434437
435/* specify an offset to be added to each pixel before looking up the palette
438/* specify an offset to be added to each pixel before looking up the palette.
436439 * The offset only applies at final rendering time (e.g., tilemap_draw())
437440 * It does not apply to the cached pixmap, which is provided by tilemap_get_pixmap().
438441 */
439442void tilemap_set_palette_offset(tilemap *tmap, UINT32 offset);
440443
444/* specify an offset to be added to pen_data while rendering tiles.
445 * This will automatically mark all tiles dirty if the offset changes.
446 */
447void tilemap_set_pen_data_offset(tilemap *tmap, UINT32 offset);
448
441449/* set an enable flag for the tilemap; if 0, requests to draw the tilemap are ignored */
442450void tilemap_set_enable(tilemap *tmap, int enable);
443451
src/emu/uimenu.c
r3115r3116
240240static void ui_menu_exit(running_machine *machine);
241241
242242/* internal menu processing */
243static void ui_menu_draw(ui_menu *menu);
243static void ui_menu_draw(ui_menu *menu, int customonly);
244244static void ui_menu_draw_text_box(ui_menu *menu);
245245static void ui_menu_handle_events(ui_menu *menu);
246246static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags);
r3115r3116
275275static void menu_cheat_populate(running_machine *machine, ui_menu *menu);
276276static void menu_memory_card(running_machine *machine, ui_menu *menu, void *parameter, void *state);
277277static void menu_memory_card_populate(running_machine *machine, ui_menu *menu, int cardnum);
278static void menu_sliders(running_machine *machine, ui_menu *menu, void *parameter, void *state);
279static void menu_sliders_populate(running_machine *machine, ui_menu *menu);
280static void menu_sliders_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2);
278281static void menu_video_targets(running_machine *machine, ui_menu *menu, void *parameter, void *state);
279282static void menu_video_targets_populate(running_machine *machine, ui_menu *menu);
280283static void menu_video_options(running_machine *machine, ui_menu *menu, void *parameter, void *state);
r3115r3116
578581   if (menu->numitems > 1 && (menu->item[0].flags & MENU_FLAG_MULTILINE) != 0)
579582      ui_menu_draw_text_box(menu);
580583   else
581      ui_menu_draw(menu);
584      ui_menu_draw(menu, (flags & UI_MENU_PROCESS_CUSTOM_ONLY) != 0);
582585
583586   /* process input */
584587   if (!(flags & UI_MENU_PROCESS_NOKEYS))
r3115r3116
718721    ui_menu_draw - draw a menu
719722-------------------------------------------------*/
720723
721static void ui_menu_draw(ui_menu *menu)
724static void ui_menu_draw(ui_menu *menu, int customonly)
722725{
723726   float line_height = ui_get_line_height();
724727   float lr_arrow_width = 0.4f * line_height * render_get_ui_aspect();
r3115r3116
730733   float visible_width, visible_main_menu_height;
731734   float visible_extra_menu_height = 0;
732735   float visible_top, visible_left;
733   int selected_subitem_too_big = 0;
736   int selected_subitem_too_big = FALSE;
734737   int visible_lines;
735738   int top_line;
736739   int itemnum, linenum;
r3115r3116
792795   y1 = visible_top - UI_BOX_TB_BORDER;
793796   x2 = visible_left + visible_width + UI_BOX_LR_BORDER;
794797   y2 = visible_top + visible_main_menu_height + UI_BOX_TB_BORDER;
795   ui_draw_outlined_box(x1, y1, x2, y2, UI_FILLCOLOR);
798   if (!customonly)
799      ui_draw_outlined_box(x1, y1, x2, y2, UI_FILLCOLOR);
796800
797801   /* determine the first visible line based on the current selection */
798802   top_line = menu->selected - visible_lines / 2;
r3115r3116
807811
808812   /* locate mouse */
809813   mouse_hit = FALSE;
810   mouse_target = ui_input_find_mouse(Machine, &mouse_target_x, &mouse_target_y);
811   if (mouse_target != NULL)
812      if (render_target_map_point_container(mouse_target, mouse_target_x, mouse_target_y, render_container_get_ui(), &mouse_x, &mouse_y))
813         mouse_hit = TRUE;
814   if (!customonly)
815   {
816      mouse_target = ui_input_find_mouse(Machine, &mouse_target_x, &mouse_target_y);
817      if (mouse_target != NULL)
818         if (render_target_map_point_container(mouse_target, mouse_target_x, mouse_target_y, render_container_get_ui(), &mouse_x, &mouse_y))
819            mouse_hit = TRUE;
820   }
814821
815822   /* loop over visible lines */
816823   menu->hover = menu->numitems + 1;
817   for (linenum = 0; linenum < visible_lines; linenum++)
818   {
819      float line_y = visible_top + (float)linenum * line_height;
820      int itemnum = top_line + linenum;
821      const ui_menu_item *item = &menu->item[itemnum];
822      const char *itemtext = item->text;
823      rgb_t fgcolor = text_fgcolor;
824      rgb_t bgcolor = text_bgcolor;
825      float line_x0 = x1 + 0.5f * UI_LINE_WIDTH;
826      float line_y0 = line_y;
827      float line_x1 = x2 - 0.5f * UI_LINE_WIDTH;
828      float line_y1 = line_y + line_height;
829
830      /* set the hover if this is our item */
831      if (mouse_hit && line_x0 <= mouse_x && line_x1 > mouse_x && line_y0 <= mouse_y && line_y1 > mouse_y && item_is_selectable(item))
832         menu->hover = itemnum;
833
834      /* if we're selected, draw with a different background */
835      if (itemnum == menu->selected)
824   if (!customonly)
825      for (linenum = 0; linenum < visible_lines; linenum++)
836826      {
837         fgcolor = sel_fgcolor;
838         bgcolor = sel_bgcolor;
839      }
827         float line_y = visible_top + (float)linenum * line_height;
828         int itemnum = top_line + linenum;
829         const ui_menu_item *item = &menu->item[itemnum];
830         const char *itemtext = item->text;
831         rgb_t fgcolor = text_fgcolor;
832         rgb_t bgcolor = text_bgcolor;
833         float line_x0 = x1 + 0.5f * UI_LINE_WIDTH;
834         float line_y0 = line_y;
835         float line_x1 = x2 - 0.5f * UI_LINE_WIDTH;
836         float line_y1 = line_y + line_height;
840837
841      /* else if the mouse is over this item, draw with a different background */
842      else if (menu->hover == itemnum)
843      {
844         fgcolor = mouseover_fgcolor;
845         bgcolor = mouseover_bgcolor;
846      }
838         /* set the hover if this is our item */
839         if (mouse_hit && line_x0 <= mouse_x && line_x1 > mouse_x && line_y0 <= mouse_y && line_y1 > mouse_y && item_is_selectable(item))
840            menu->hover = itemnum;
847841
848      /* if we have some background hilighting to do, add a quad behind everything else */
849      if (bgcolor != text_bgcolor)
850         render_ui_add_quad(line_x0, line_y0, line_x1, line_y1, bgcolor, hilight_texture,
851                        PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
842         /* if we're selected, draw with a different background */
843         if (itemnum == menu->selected)
844         {
845            fgcolor = sel_fgcolor;
846            bgcolor = sel_bgcolor;
847         }
852848
853      /* if we're on the top line, display the up arrow */
854      if (linenum == 0 && top_line != 0)
855      {
856         render_ui_add_quad(   0.5f * (x1 + x2) - 0.5f * ud_arrow_width,
857                        line_y + 0.25f * line_height,
858                        0.5f * (x1 + x2) + 0.5f * ud_arrow_width,
859                        line_y + 0.75f * line_height,
860                        fgcolor,
861                        arrow_texture,
862                        PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT0));
863         if (menu->hover == itemnum)
864            menu->hover = -2;
865      }
866
867      /* if we're on the bottom line, display the down arrow */
868      else if (linenum == visible_lines - 1 && itemnum != menu->numitems - 1)
869      {
870         render_ui_add_quad(   0.5f * (x1 + x2) - 0.5f * ud_arrow_width,
871                        line_y + 0.25f * line_height,
872                        0.5f * (x1 + x2) + 0.5f * ud_arrow_width,
873                        line_y + 0.75f * line_height,
874                        fgcolor,
875                        arrow_texture,
876                        PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT0 ^ ORIENTATION_FLIP_Y));
877         if (menu->hover == itemnum)
878            menu->hover = -1;
879      }
880
881      /* if we're just a divider, draw a line */
882      else if (strcmp(itemtext, MENU_SEPARATOR_ITEM) == 0)
883         render_ui_add_line(visible_left, line_y + 0.5f * line_height, visible_left + visible_width, line_y + 0.5f * line_height, UI_LINE_WIDTH, bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
884
885      /* if we don't have a subitem, just draw the string centered */
886      else if (item->subtext == NULL)
887         ui_draw_text_full(itemtext, effective_left, line_y, effective_width,
888                  JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, NULL, NULL);
889
890      /* otherwise, draw the item on the left and the subitem text on the right */
891      else
892      {
893         int subitem_invert = item->flags & MENU_FLAG_INVERT;
894         const char *subitem_text = item->subtext;
895         float item_width, subitem_width;
896
897         /* draw the left-side text */
898         ui_draw_text_full(itemtext, effective_left, line_y, effective_width,
899                  JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, &item_width, NULL);
900
901         /* give 2 spaces worth of padding */
902         item_width += 2.0f * gutter_width;
903
904         /* if the subitem doesn't fit here, display dots */
905         if (ui_get_string_width(subitem_text) > effective_width - item_width)
849         /* else if the mouse is over this item, draw with a different background */
850         else if (menu->hover == itemnum)
906851         {
907            subitem_text = "...";
908            if (itemnum == menu->selected)
909               selected_subitem_too_big = 1;
852            fgcolor = mouseover_fgcolor;
853            bgcolor = mouseover_bgcolor;
910854         }
911855
912         /* draw the subitem right-justified */
913         ui_draw_text_full(subitem_text, effective_left + item_width, line_y, effective_width - item_width,
914                  JUSTIFY_RIGHT, WRAP_TRUNCATE, subitem_invert ? DRAW_OPAQUE : DRAW_NORMAL, fgcolor, bgcolor, &subitem_width, NULL);
856         /* if we have some background hilighting to do, add a quad behind everything else */
857         if (bgcolor != text_bgcolor)
858            render_ui_add_quad(line_x0, line_y0, line_x1, line_y1, bgcolor, hilight_texture,
859                           PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
915860
916         /* apply arrows */
917         if (itemnum == menu->selected && (item->flags & MENU_FLAG_LEFT_ARROW))
861         /* if we're on the top line, display the up arrow */
862         if (linenum == 0 && top_line != 0)
918863         {
919            render_ui_add_quad(   effective_left + effective_width - subitem_width - gutter_width,
920                           line_y + 0.1f * line_height,
921                           effective_left + effective_width - subitem_width - gutter_width + lr_arrow_width,
922                           line_y + 0.9f * line_height,
864            render_ui_add_quad(   0.5f * (x1 + x2) - 0.5f * ud_arrow_width,
865                           line_y + 0.25f * line_height,
866                           0.5f * (x1 + x2) + 0.5f * ud_arrow_width,
867                           line_y + 0.75f * line_height,
923868                           fgcolor,
924869                           arrow_texture,
925                           PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT90 ^ ORIENTATION_FLIP_X));
870                           PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT0));
871            if (menu->hover == itemnum)
872               menu->hover = -2;
926873         }
927         if (itemnum == menu->selected && (item->flags & MENU_FLAG_RIGHT_ARROW))
874
875         /* if we're on the bottom line, display the down arrow */
876         else if (linenum == visible_lines - 1 && itemnum != menu->numitems - 1)
928877         {
929            render_ui_add_quad(   effective_left + effective_width + gutter_width - lr_arrow_width,
930                           line_y + 0.1f * line_height,
931                           effective_left + effective_width + gutter_width,
932                           line_y + 0.9f * line_height,
878            render_ui_add_quad(   0.5f * (x1 + x2) - 0.5f * ud_arrow_width,
879                           line_y + 0.25f * line_height,
880                           0.5f * (x1 + x2) + 0.5f * ud_arrow_width,
881                           line_y + 0.75f * line_height,
933882                           fgcolor,
934883                           arrow_texture,
935                           PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT90));
884                           PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT0 ^ ORIENTATION_FLIP_Y));
885            if (menu->hover == itemnum)
886               menu->hover = -1;
936887         }
888
889         /* if we're just a divider, draw a line */
890         else if (strcmp(itemtext, MENU_SEPARATOR_ITEM) == 0)
891            render_ui_add_line(visible_left, line_y + 0.5f * line_height, visible_left + visible_width, line_y + 0.5f * line_height, UI_LINE_WIDTH, bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
892
893         /* if we don't have a subitem, just draw the string centered */
894         else if (item->subtext == NULL)
895            ui_draw_text_full(itemtext, effective_left, line_y, effective_width,
896                     JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, NULL, NULL);
897
898         /* otherwise, draw the item on the left and the subitem text on the right */
899         else
900         {
901            int subitem_invert = item->flags & MENU_FLAG_INVERT;
902            const char *subitem_text = item->subtext;
903            float item_width, subitem_width;
904
905            /* draw the left-side text */
906            ui_draw_text_full(itemtext, effective_left, line_y, effective_width,
907                     JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, fgcolor, bgcolor, &item_width, NULL);
908
909            /* give 2 spaces worth of padding */
910            item_width += 2.0f * gutter_width;
911
912            /* if the subitem doesn't fit here, display dots */
913            if (ui_get_string_width(subitem_text) > effective_width - item_width)
914            {
915               subitem_text = "...";
916               if (itemnum == menu->selected)
917                  selected_subitem_too_big = TRUE;
918            }
919
920            /* draw the subitem right-justified */
921            ui_draw_text_full(subitem_text, effective_left + item_width, line_y, effective_width - item_width,
922                     JUSTIFY_RIGHT, WRAP_TRUNCATE, subitem_invert ? DRAW_OPAQUE : DRAW_NORMAL, fgcolor, bgcolor, &subitem_width, NULL);
923
924            /* apply arrows */
925            if (itemnum == menu->selected && (item->flags & MENU_FLAG_LEFT_ARROW))
926            {
927               render_ui_add_quad(   effective_left + effective_width - subitem_width - gutter_width,
928                              line_y + 0.1f * line_height,
929                              effective_left + effective_width - subitem_width - gutter_width + lr_arrow_width,
930                              line_y + 0.9f * line_height,
931                              fgcolor,
932                              arrow_texture,
933                              PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT90 ^ ORIENTATION_FLIP_X));
934            }
935            if (itemnum == menu->selected && (item->flags & MENU_FLAG_RIGHT_ARROW))
936            {
937               render_ui_add_quad(   effective_left + effective_width + gutter_width - lr_arrow_width,
938                              line_y + 0.1f * line_height,
939                              effective_left + effective_width + gutter_width,
940                              line_y + 0.9f * line_height,
941                              fgcolor,
942                              arrow_texture,
943                              PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT90));
944            }
945         }
937946      }
938   }
939947
940948   /* if the selected subitem is too big, display it in a separate offset box */
941949   if (selected_subitem_too_big)
r3115r3116
13311339
13321340
13331341/*-------------------------------------------------
1342    ui_slider_ui_handler - pushes the slider
1343    menu on the stack and hands off to the
1344    standard menu handler
1345-------------------------------------------------*/
1346
1347UINT32 ui_slider_ui_handler(running_machine *machine, UINT32 state)
1348{
1349   /* if we have no menus stacked up, start with the sliders menu */
1350   if (menu_stack == NULL)
1351      ui_menu_stack_push(ui_menu_alloc(machine, menu_sliders, machine));
1352   return ui_menu_ui_handler(machine, state);
1353}
1354
1355
1356/*-------------------------------------------------
13341357    ui_menu_force_game_select - force the game
13351358    select menu to be visible and inescapable
13361359-------------------------------------------------*/
r3115r3116
14591482#endif /* HAS_WAVE */
14601483#endif /* MESS */
14611484
1485   /* add sliders menu */
1486   ui_menu_item_append(menu, "Slider Controls", NULL, 0, menu_sliders);
1487
14621488   /* add video options menu */
14631489   ui_menu_item_append(menu, "Video Options", NULL, 0, (render_target_get_indexed(1) != NULL) ? menu_video_targets : menu_video_options);
14641490
r3115r3116
25742600            /* left decrements the card number */
25752601            case IPT_UI_LEFT:
25762602               *cardnum -= 1;
2603               ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_REF);
25772604               break;
25782605
25792606            /* right decrements the card number */
25802607            case IPT_UI_RIGHT:
25812608               *cardnum += 1;
2609               ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_REF);
25822610               break;
25832611         }
25842612      }
r3115r3116
26132641
26142642
26152643/*-------------------------------------------------
2644    menu_sliders - handle the sliders menu
2645-------------------------------------------------*/
2646
2647static void menu_sliders(running_machine *machine, ui_menu *menu, void *parameter, void *state)
2648{
2649   const ui_menu_event *event;
2650   UINT8 *hidden = state;
2651
2652   /* if no state, allocate some */
2653   if (hidden == NULL)
2654      hidden = ui_menu_alloc_state(menu, sizeof(*hidden), NULL);
2655
2656   /* if the menu isn't built, populate now */
2657   if (!ui_menu_populated(menu))
2658      menu_sliders_populate(machine, menu);
2659
2660   /* process the menu */
2661   event = ui_menu_process(menu, UI_MENU_PROCESS_LR_REPEAT | (*hidden ? UI_MENU_PROCESS_CUSTOM_ONLY : 0));
2662   if (event != NULL)
2663   {
2664      /* handle keys if there is a valid item selected */
2665      if (event->itemref != NULL)
2666      {
2667         const slider_state *slider = event->itemref;
2668         INT32 curvalue = (*slider->update)(machine, slider->arg, NULL, SLIDER_NOCHANGE);
2669         INT32 increment = 0;
2670
2671         switch (event->iptkey)
2672         {
2673            /* toggle visibility */
2674            case IPT_UI_ON_SCREEN_DISPLAY:
2675               *hidden = !*hidden;
2676               break;
2677
2678            /* decrease value */
2679            case IPT_UI_LEFT:
2680               if (input_code_pressed(KEYCODE_LALT) || input_code_pressed(KEYCODE_RALT))
2681                  increment = -1;
2682               else if (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT))
2683                  increment = (slider->incval > 10) ? -(slider->incval / 10) : -1;
2684               else if (input_code_pressed(KEYCODE_LCONTROL) || input_code_pressed(KEYCODE_RCONTROL))
2685                  increment = -slider->incval * 10;
2686               else
2687                  increment = -slider->incval;
2688               break;
2689
2690            /* increase value */
2691            case IPT_UI_RIGHT:
2692               if (input_code_pressed(KEYCODE_LALT) || input_code_pressed(KEYCODE_RALT))
2693                  increment = 1;
2694               else if (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT))
2695                  increment = (slider->incval > 10) ? (slider->incval / 10) : 1;
2696               else if (input_code_pressed(KEYCODE_LCONTROL) || input_code_pressed(KEYCODE_RCONTROL))
2697                  increment = slider->incval * 10;
2698               else
2699                  increment = slider->incval;
2700               break;
2701
2702            /* restore default */
2703            case IPT_UI_SELECT:
2704               increment = slider->defval - curvalue;
2705               break;
2706         }
2707
2708         /* handle any changes */
2709         if (increment != 0)
2710         {
2711            INT32 newvalue = curvalue + increment;
2712
2713            /* clamp within bounds */
2714            if (newvalue < slider->minval)
2715               newvalue = slider->minval;
2716            if (newvalue > slider->maxval)
2717               newvalue = slider->maxval;
2718
2719            /* update the slider and recompute the menu */
2720            (*slider->update)(machine, slider->arg, NULL, newvalue);
2721            ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_REF);
2722         }
2723      }
2724
2725      /* if we are selecting an invalid item and we are hidden, skip to the next one */
2726      else if (*hidden)
2727      {
2728         /* if we got here via up or page up, select the previous item */
2729         if (event->iptkey == IPT_UI_UP || event->iptkey == IPT_UI_PAGE_UP)
2730         {
2731            menu->selected = (menu->selected + menu->numitems - 1) % menu->numitems;
2732            ui_menu_validate_selection(menu, -1);
2733         }
2734
2735         /* otherwise select the next item */
2736         else if (event->iptkey == IPT_UI_DOWN || event->iptkey == IPT_UI_PAGE_DOWN)
2737         {
2738            menu->selected = (menu->selected + 1) % menu->numitems;
2739            ui_menu_validate_selection(menu, 1);
2740         }
2741      }
2742   }
2743}
2744
2745
2746/*-------------------------------------------------
2747    menu_sliders_populate - populate the sliders
2748    menu
2749-------------------------------------------------*/
2750
2751static void menu_sliders_populate(running_machine *machine, ui_menu *menu)
2752{
2753   astring *tempstring = astring_alloc();
2754   const slider_state *curslider;
2755
2756   /* add all sliders */
2757   for (curslider = ui_get_slider_list(); curslider != NULL; curslider = curslider->next)
2758   {
2759      INT32 curval = (*curslider->update)(machine, curslider->arg, tempstring, SLIDER_NOCHANGE);
2760      UINT32 flags = 0;
2761      if (curval > curslider->minval)
2762         flags |= MENU_FLAG_LEFT_ARROW;
2763      if (curval < curslider->maxval)
2764         flags |= MENU_FLAG_RIGHT_ARROW;
2765      ui_menu_item_append(menu, curslider->description, astring_c(tempstring), flags, (void *)curslider);
2766   }
2767
2768   ui_menu_set_custom_render(menu, menu_sliders_custom_render, 0.0f, 2.0f * ui_get_line_height());
2769   astring_free(tempstring);
2770}
2771
2772
2773/*-------------------------------------------------
2774    menu_sliders_custom_render - perform our special
2775    rendering
2776-------------------------------------------------*/
2777
2778static void menu_sliders_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
2779{
2780   const slider_state *curslider = selectedref;
2781   if (curslider != NULL)
2782   {
2783      astring *tempstring = astring_alloc();
2784      INT32 curval = (*curslider->update)(machine, curslider->arg, tempstring, SLIDER_NOCHANGE);
2785      float percentage = (float)(curval - curslider->minval) / (float)(curslider->maxval - curslider->minval);
2786      float default_percentage = (float)(curslider->defval - curslider->minval) / (float)(curslider->maxval - curslider->minval);
2787      float bar_left, bar_area_top, bar_width, bar_area_height, bar_top, bar_bottom, default_x, current_x;
2788      float space_width = ui_get_char_width(' ');
2789      float line_height = ui_get_line_height();
2790      float ui_width, ui_height;
2791      float text_height;
2792
2793      /* finish assembling the text */
2794      astring_insc(tempstring, 0, " ");
2795      astring_insc(tempstring, 0, curslider->description);
2796
2797      /* leave a spaces' worth of room along the left/right sides, and a lines' worth on the top/bottom */
2798      ui_width = 1.0f - 2.0f * space_width;
2799      ui_height = 1.0f - 2.0f * line_height;
2800
2801      /* determine the text height */
2802      ui_draw_text_full(astring_c(tempstring), 0, 0, ui_width - 2 * UI_BOX_LR_BORDER,
2803               JUSTIFY_CENTER, WRAP_WORD, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, NULL, &text_height);
2804
2805      /* add a box around the whole area */
2806      ui_draw_outlined_box(space_width,
2807                   line_height + ui_height - text_height - line_height - 2 * UI_BOX_TB_BORDER,
2808                   space_width + ui_width,
2809                   line_height + ui_height, UI_FILLCOLOR);
2810
2811      /* draw the thermometer */
2812      bar_left = 2.0f * space_width;
2813      bar_area_top = line_height + ui_height - UI_BOX_TB_BORDER - text_height - line_height * 0.75f;
2814      bar_width = ui_width - 2.0f * space_width;
2815      bar_area_height = line_height * 0.75f;
2816
2817      /* compute positions */
2818      bar_top = bar_area_top + 0.125f * bar_area_height;
2819      bar_bottom = bar_area_top + 0.875f * bar_area_height;
2820      default_x = bar_left + bar_width * default_percentage;
2821      current_x = bar_left + bar_width * percentage;
2822
2823      /* fill in the percentage */
2824      render_ui_add_rect(bar_left, bar_top, current_x, bar_bottom, ARGB_WHITE, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
2825
2826      /* draw the top and bottom lines */
2827      render_ui_add_line(bar_left, bar_top, bar_left + bar_width, bar_top, UI_LINE_WIDTH, ARGB_WHITE, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
2828      render_ui_add_line(bar_left, bar_bottom, bar_left + bar_width, bar_bottom, UI_LINE_WIDTH, ARGB_WHITE, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
2829
2830      /* draw default marker */
2831      render_ui_add_line(default_x, bar_area_top, default_x, bar_top, UI_LINE_WIDTH, ARGB_WHITE, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
2832      render_ui_add_line(default_x, bar_bottom, default_x, bar_area_top + bar_area_height, UI_LINE_WIDTH, ARGB_WHITE, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
2833
2834      /* draw the actual text */
2835      ui_draw_text_full(astring_c(tempstring), space_width + UI_BOX_LR_BORDER, line_height + ui_height - UI_BOX_TB_BORDER - text_height, ui_width - 2.0f * UI_BOX_LR_BORDER,
2836               JUSTIFY_CENTER, WRAP_WORD, DRAW_NORMAL, ARGB_WHITE, ARGB_BLACK, NULL, &text_height);
2837
2838      astring_free(tempstring);
2839   }
2840}
2841
2842
2843/*-------------------------------------------------
26162844    menu_video_targets - handle the video targets
26172845    menu
26182846-------------------------------------------------*/
r3115r3116
28073035{
28083036   select_game_state *menustate;
28093037   const ui_menu_event *event;
2810   int changed = FALSE;
28113038
28123039   /* if no state, allocate some */
28133040   if (state == NULL)
r3115r3116
28653092            /* otherwise, display an error */
28663093            else
28673094            {
2868               changed = TRUE;
3095               ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_REF);
28693096               menustate->error = TRUE;
28703097            }
28713098         }
r3115r3116
28883115         {
28893116            *(char *)utf8_previous_char(&menustate->search[buflen]) = 0;
28903117            menustate->rerandomize = TRUE;
2891            changed = TRUE;
3118            ui_menu_reset(menu, UI_MENU_RESET_SELECT_FIRST);
28923119         }
28933120
28943121         /* if it's any other key and we're not maxed out, update */
r3115r3116
28963123         {
28973124            buflen += utf8_from_uchar(&menustate->search[buflen], ARRAY_LENGTH(menustate->search) - buflen, event->unichar);
28983125            menustate->search[buflen] = 0;
2899            changed = TRUE;
3126            ui_menu_reset(menu, UI_MENU_RESET_SELECT_FIRST);
29003127         }
29013128      }
29023129   }
r3115r3116
29063133      ui_draw_text_box("The selected game is missing one or more required ROM or CHD images. "
29073134                       "Please select a different game.\n\nPress any key to continue.",
29083135                       JUSTIFY_CENTER, 0.5f, 0.5f, UI_REDCOLOR);
2909
2910   /* if we changed, force a redraw on the next go */
2911   if (changed)
2912      ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_REF);
29133136}
29143137
29153138
src/emu/audit.c
r3115r3116
437437      else if (hash_data_has_info(record->exphash, HASH_INFO_NO_DUMP))
438438         set_status(record, AUDIT_STATUS_NOT_FOUND, SUBSTATUS_NOT_FOUND_NODUMP);
439439
440      /* not found but optional */
441      else if (DISK_ISOPTIONAL(rom))
442         set_status(record, AUDIT_STATUS_NOT_FOUND, SUBSTATUS_NOT_FOUND_OPTIONAL);
443
440444      /* not found at all */
441445      else
442446         set_status(record, AUDIT_STATUS_NOT_FOUND, SUBSTATUS_NOT_FOUND);
src/emu/video.c
r3115r3116
269269INLINE int effective_throttle(running_machine *machine)
270270{
271271   /* if we're paused, or if the UI is active, we always throttle */
272   if (mame_is_paused(machine) || ui_is_menu_active() || ui_is_slider_active())
272   if (mame_is_paused(machine) || ui_is_menu_active())
273273      return TRUE;
274274
275275   /* if we're fast forwarding, we don't throttle */
src/emu/uimenu.h
r3115r3116
3535/* flags to pass to ui_menu_process */
3636#define UI_MENU_PROCESS_NOKEYS      1
3737#define UI_MENU_PROCESS_LR_REPEAT   2
38#define UI_MENU_PROCESS_CUSTOM_ONLY   4
3839
3940/* options for ui_menu_reset */
4041enum _ui_menu_reset_options
r3115r3116
142143/* master handler */
143144UINT32 ui_menu_ui_handler(running_machine *machine, UINT32 state);
144145
146/* slider handler */
147UINT32 ui_slider_ui_handler(running_machine *machine, UINT32 state);
148
145149/* force game select menu */
146150void ui_menu_force_game_select(void);
147151int ui_menu_is_force_game_select(void);
src/emu/emu.mak
r3115r3116
138138   $(EMUMACHINE)/i2cmem.o \
139139    $(EMUMACHINE)/idectrl.o \
140140    $(EMUMACHINE)/intelfsh.o \
141   $(EMUMACHINE)/latch8.o \
141142   $(EMUMACHINE)/laserdsc.o \
142143   $(EMUMACHINE)/mb3773.o \
143144   $(EMUMACHINE)/mb87078.o \
src/emu/inptport.c
r3115r3116
19841984static void frame_update(running_machine *machine)
19851985{
19861986   input_port_private *portdata = machine->input_port_data;
1987   int ui_visible = ui_is_menu_active() || ui_is_slider_active();
1987   int ui_visible = ui_is_menu_active();
19881988   attotime curtime = timer_get_time();
19891989   const input_port_config *port;
19901990
src/emu/devintrf.c
r3115r3116
132132   (*type)(NULL, DEVINFO_FCT_RESET, &info);
133133   device->reset = info.reset;
134134
135   info.nvram = NULL;
136   (*type)(NULL, DEVINFO_FCT_NVRAM, &info);
137   device->nvram = info.nvram;
138
135139   /* link us to the end and return */
136140   *devptr = device;
137141   return device;
r3115r3116
591595
592596
593597/*-------------------------------------------------
598    devtag_get_device - return the device associated
599    with a tag
600-------------------------------------------------*/
601
602const device_config *devtag_get_device(running_machine *machine, device_type type, const char *tag)
603{
604   const device_config *device;
605
606   assert(machine != NULL);
607   assert(type != NULL);
608   assert(tag != NULL);
609
610   device = device_list_find_by_tag(machine->config->devicelist, type, tag);
611   if (device == NULL)
612      fatalerror("devtag_get_device failed to find device: type=%s tag=%s\n", devtype_name(type), tag);
613   return device;
614}
615
616
617/*-------------------------------------------------
594618    devtag_get_static_config - return a pointer to
595619    the static configuration for a device based on
596620    type and tag
src/emu/machine/roc10937.c
r3115r3116
3838//
3939static const char roc10937ASCII[]=
4040//0123456789ABCDEF0123456789ABC DEF01 23456789ABCDEF0123456789ABCDEF
41 "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ ?\"#$%%'()*+;-./0123456789&%<=>?"\
42 "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ ?\"#$%%'()*+;-./0123456789&%<=>?"\
41 "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ ?\"#$%%'()*+;-./0123456789&%<=>?"
42 "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ ?\"#$%%'()*+;-./0123456789&%<=>?"
4343 "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ ?\"#$%%'()*+;-./0123456789&%<=>?";
4444
4545/*
src/emu/machine/laserdsc.c
r3115r3116
26022602            break;
26032603
26042604         case 0x04:   CMDPRINTF(("pr8210: Step forward\n"));
2605            /* step forward */
2605            /* step forward one frame */
26062606            if (laserdisc_ready(ld))
2607               set_state(ld, LASERDISC_STEPPING_FORWARD, PR8210_STEP_SPEED, NULL_TARGET_FRAME);
2607            {
2608               set_state(ld, LASERDISC_STEPPING_FORWARD, STOP_SPEED, NULL_TARGET_FRAME);
2609               add_to_current_track(ld, ONE_TRACK);
2610            }
26082611            break;
26092612
26102613         case 0x06 :   CMDPRINTF(("pr8210: Chapter\n"));
src/emu/machine/at28c16.c
r3115r3116
33 *
44 * 16K ( 2K x 8 ) Parallel EEPROM
55 *
6 * Todo:
7 *  Emulate write timing.
8 *
96 */
107
118#include "driver.h"
r3115r3116
1512#define SIZE_ID ( 0x020 )
1613#define OFFSET_ID ( SIZE_DATA - SIZE_ID )
1714
18struct at28c16_chip
15typedef struct
1916{
2017   UINT8 *data;
2118   UINT8 *id;
22   UINT8 a9_12v;
23};
19   UINT8 *default_data;
20   UINT8 *default_id;
21   int last_write;
22   int a9_12v;
23   int oe_12v;
24   emu_timer *write_timer;
25} at28c16_state;
2426
25static struct at28c16_chip at28c16[ MAX_AT28C16_CHIPS ];
27static TIMER_CALLBACK( write_finished )
28{
29   at28c16_state *c = (at28c16_state *) ptr;
30   c->last_write = -1;
31}
2632
27void at28c16_a9_12v( int chip, int a9_12v )
33/*-------------------------------------------------
34    get_safe_token - makes sure that the passed
35    in device is, in fact, an AT28C16
36-------------------------------------------------*/
37
38INLINE at28c16_state *get_safe_token(const device_config *device)
2839{
29   struct at28c16_chip *c;
30   if( chip >= MAX_AT28C16_CHIPS )
40   assert(device != NULL);
41   assert(device->token != NULL);
42   assert(device->type == AT28C16);
43
44   return (at28c16_state *)device->token;
45}
46
47WRITE8_DEVICE_HANDLER( at28c16_w )
48{
49   at28c16_state *c = get_safe_token(device);
50
51   if( c->last_write >= 0 )
3152   {
32      logerror( "at28c16_a9_12v: invalid chip %d\n", chip );
33      return;
53//      logerror( "%08x: at28c16_write( %d, %04x, %02x ) busy\n", activecpu_get_pc(), chip, offset, data );
3454   }
35   c = &at28c16[ chip ];
36
37   c->a9_12v = a9_12v;
55   else if( c->oe_12v )
56   {
57//      logerror( "%08x: at28c16_write( %d, %04x, %02x ) erase\n", activecpu_get_pc(), chip, offset, data );
58      memset( c->data, 0xff, SIZE_DATA );
59      memset( c->id, 0xff, SIZE_ID );
60      c->last_write = 0xff;
61      timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
62   }
63   else if( offset >= OFFSET_ID && c->a9_12v )
64   {
65//      logerror( "%08x: at28c16_write( %d, %04x, %02x ) id\n", activecpu_get_pc(), chip, offset, data );
66      c->id[ offset - OFFSET_ID ] = data;
67      c->last_write = data;
68      timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
69   }
70   else
71   {
72//      logerror( "%08x: at28c16_write( %d, %04x, %02x ) data\n", activecpu_get_pc(), chip, offset, data );
73      c->data[ offset ] = data;
74      c->last_write = data;
75      timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
76   }
3877}
3978
40/* nvram handlers */
4179
42void at28c16_init( int chip, UINT8 *data, UINT8 *id )
80READ8_DEVICE_HANDLER( at28c16_r )
4381{
44   struct at28c16_chip *c;
45   if( chip >= MAX_AT28C16_CHIPS )
82   at28c16_state *c = get_safe_token(device);
83
84   if( c->last_write >= 0 )
4685   {
47      logerror( "at28c16_init: invalid chip %d\n", chip );
48      return;
86//      logerror( "at28c16_read( %04x ) write status\n", offset );
87      return c->last_write ^ 0x80;
4988   }
50   c = &at28c16[ chip ];
89   else if( offset >= OFFSET_ID && c->a9_12v )
90   {
91//      logerror( "at28c16_read( %04x ) id\n", offset );
92      return c->id[ offset - OFFSET_ID ];
93   }
94   else
95   {
96//      logerror( "%08x: at28c16_read( %d, %04x ) %02x data\n", activecpu_get_pc(), chip, offset, c->data[ offset ] );
97      return c->data[ offset ];
98   }
99}
51100
101void at28c16_a9_12v( const device_config *device, int a9_12v )
102{
103   at28c16_state *c = get_safe_token(device);
104
105   c->a9_12v = a9_12v;
106}
107
108void at28c16_oe_12v( const device_config *device, int oe_12v )
109{
110   at28c16_state *c = get_safe_token(device);
111
112   c->oe_12v = oe_12v;
113}
114
115/*-------------------------------------------------
116    device start callback
117-------------------------------------------------*/
118
119static DEVICE_START(at28c16)
120{
121   at28c16_state *c = get_safe_token(device);
122   const at28c16_config *config;
123   char unique_tag[50];
124
125   /* validate some basic stuff */
126   assert(device != NULL);
127//  assert(device->static_config != NULL);
128   assert(device->inline_config == NULL);
129   assert(device->machine != NULL);
130   assert(device->machine->config != NULL);
131
132   c->data = auto_malloc( SIZE_DATA );
133   c->id = auto_malloc( SIZE_ID );
52134   c->a9_12v = 0;
135   c->oe_12v = 0;
136   c->last_write = -1;
137   c->write_timer = timer_alloc( write_finished, c );
53138
54   if( data == NULL )
139   config = device->static_config;
140   if( config != NULL && config->data != NULL )
55141   {
56      data = auto_malloc( SIZE_DATA );
142      c->default_data = memory_region( device->machine, config->data );
57143   }
58144
59   if( id == NULL )
145   if( config != NULL && config->id != NULL )
60146   {
61      id = auto_malloc( SIZE_ID );
147      c->default_id = memory_region( device->machine, config->id );
62148   }
63149
64   c->data = data;
65   c->id = id;
150   /* create the name for save states */
151   assert( strlen( device->tag ) < 30 );
152   state_save_combine_module_and_tag( unique_tag, "at28c16", device->tag );
66153
67   state_save_register_item_pointer( "at28c16", chip, c->data, SIZE_DATA );
68   state_save_register_item_pointer( "at28c16", chip, c->id, SIZE_ID );
69   state_save_register_item( "at28c16", chip, c->a9_12v );
154   state_save_register_item_pointer( unique_tag, 0, c->data, SIZE_DATA );
155   state_save_register_item_pointer( unique_tag, 0, c->id, SIZE_ID );
156   state_save_register_item( unique_tag, 0, c->a9_12v );
157   state_save_register_item( unique_tag, 0, c->oe_12v );
158   state_save_register_item( unique_tag, 0, c->last_write );
70159}
71160
72static void nvram_handler_at28c16( running_machine *machine, int chip, mame_file *file, int read_or_write )
161/*-------------------------------------------------
162    device reset callback
163-------------------------------------------------*/
164
165static DEVICE_RESET(at28c16)
73166{
74   struct at28c16_chip *c;
75   if( chip >= MAX_AT28C16_CHIPS )
76   {
77      logerror( "at28c16_nvram_handler: invalid chip %d\n", chip );
78      return;
79   }
80   c = &at28c16[ chip ];
167}
81168
169static DEVICE_NVRAM(at28c16)
170{
171   at28c16_state *c = get_safe_token(device);
172
82173   if( read_or_write )
83174   {
84175      mame_fwrite( file, c->data, SIZE_DATA );
r3115r3116
91182         mame_fread( file, c->data, SIZE_DATA );
92183         mame_fread( file, c->id, SIZE_ID );
93184      }
185      else
186      {
187         if( c->default_data != NULL )
188         {
189            memcpy( c->data, c->default_data, SIZE_DATA );
190         }
191         else
192         {
193            memset( c->data, 0xff, SIZE_DATA );
194         }
195
196         if( c->default_id != NULL )
197         {
198            memcpy( c->id, c->default_id, SIZE_ID );
199         }
200         else
201         {
202            memset( c->id, 0xff, SIZE_ID );
203         }
204      }
94205   }
95206}
96207
97NVRAM_HANDLER( at28c16_0 ) { nvram_handler_at28c16( machine, 0, file, read_or_write ); }
98NVRAM_HANDLER( at28c16_1 ) { nvram_handler_at28c16( machine, 1, file, read_or_write ); }
99NVRAM_HANDLER( at28c16_2 ) { nvram_handler_at28c16( machine, 2, file, read_or_write ); }
100NVRAM_HANDLER( at28c16_3 ) { nvram_handler_at28c16( machine, 3, file, read_or_write ); }
208/*-------------------------------------------------
209    device set info callback
210-------------------------------------------------*/
101211
102/* read / write */
103
104static UINT8 at28c16_read( UINT32 chip, offs_t offset )
212static DEVICE_SET_INFO(at28c16)
105213{
106   struct at28c16_chip *c;
107   if( chip >= MAX_AT28C16_CHIPS )
214   switch (state)
108215   {
109      logerror( "at28c16_read( %d, %04x ) chip out of range\n", chip, offset );
110      return 0;
216      /* no parameters to set */
111217   }
112   c = &at28c16[ chip ];
113
114   if( offset >= OFFSET_ID && c->a9_12v )
115   {
116      logerror( "at28c16_read( %04x ) id\n", offset );
117      return c->id[ offset - OFFSET_ID ];
118   }
119   else
120   {
121//      logerror( "%08x: at28c16_read( %d, %04x ) %02x data\n", activecpu_get_pc(), chip, offset, c->data[ offset ] );
122      return c->data[ offset ];
123   }
124218}
125219
126static void at28c16_write( UINT32 chip, offs_t offset, UINT8 data )
220/*-------------------------------------------------
221    device get info callback
222-------------------------------------------------*/
223
224DEVICE_GET_INFO(at28c16)
127225{
128   struct at28c16_chip *c;
129   if( chip >= MAX_AT28C16_CHIPS )
226   switch (state)
130227   {
131      logerror( "at28c16_write( %d, %04x, %02x ) chip out of range\n", chip, offset, data );
132      return;
133   }
134   c = &at28c16[ chip ];
228      /* --- the following bits of info are returned as 64-bit signed integers --- */
229      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(at28c16_state); break;
230      case DEVINFO_INT_INLINE_CONFIG_BYTES:   info->i = 0; break; // sizeof(at28c16_config)
231      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_PERIPHERAL; break;
135232
136   if( offset >= OFFSET_ID && c->a9_12v )
137   {
138      logerror( "at28c16_write( %d, %04x, %02x ) id\n", chip, offset, data );
139      c->id[ offset - OFFSET_ID ] = data;
233      /* --- the following bits of info are returned as pointers to data or functions --- */
234      case DEVINFO_FCT_SET_INFO:            info->set_info = DEVICE_SET_INFO_NAME(at28c16); break;
235      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(at28c16); break;
236      case DEVINFO_FCT_STOP:               /* nothing */ break;
237      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(at28c16); break;
238      case DEVINFO_FCT_NVRAM:               info->nvram = DEVICE_NVRAM_NAME(at28c16); break;
239
240      /* --- the following bits of info are returned as NULL-terminated strings --- */
241      case DEVINFO_STR_NAME:               info->s = "AT28C16"; break;
242      case DEVINFO_STR_FAMILY:            info->s = "EEPROM"; break;
243      case DEVINFO_STR_VERSION:            info->s = "1.0"; break;
244      case DEVINFO_STR_SOURCE_FILE:         info->s = __FILE__; break;
245      case DEVINFO_STR_CREDITS:            info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
140246   }
141   else
142   {
143//      logerror( "%08x: at28c16_write( %d, %04x, %02x ) data\n", activecpu_get_pc(), chip, offset, data );
144      c->data[ offset ] = data;
145   }
146247}
147
148READ8_HANDLER( at28c16_0_r ) { return at28c16_read( 0, offset ); }
149READ8_HANDLER( at28c16_1_r ) { return at28c16_read( 1, offset ); }
150READ8_HANDLER( at28c16_2_r ) { return at28c16_read( 2, offset ); }
151READ8_HANDLER( at28c16_3_r ) { return at28c16_read( 3, offset ); }
152WRITE8_HANDLER( at28c16_0_w ) { at28c16_write( 0, offset, data ); }
153WRITE8_HANDLER( at28c16_1_w ) { at28c16_write( 1, offset, data ); }
154WRITE8_HANDLER( at28c16_2_w ) { at28c16_write( 2, offset, data ); }
155WRITE8_HANDLER( at28c16_3_w ) { at28c16_write( 3, offset, data ); }
src/emu/machine/at28c16.h
r3115r3116
88#if !defined( AT28C16_H )
99#define AT28C16_H ( 1 )
1010
11#define MAX_AT28C16_CHIPS ( 4 )
11typedef struct _at28c16_config at28c16_config;
12struct _at28c16_config
13{
14   const char *data;
15   const char *id;
16};
1217
13extern void at28c16_init( int chip, UINT8 *data, UINT8 *id );
14extern void at28c16_a9_12v( int chip, int a9_12v );
18#define AT28C16 DEVICE_GET_INFO_NAME(at28c16)
19DEVICE_GET_INFO(at28c16);
1520
16/* nvram handlers */
21extern void at28c16_a9_12v( const device_config *device, int a9_12v );
22extern void at28c16_oe_12v( const device_config *device, int a9_12v );
1723
18NVRAM_HANDLER( at28c16_0 );
19NVRAM_HANDLER( at28c16_1 );
20NVRAM_HANDLER( at28c16_2 );
21NVRAM_HANDLER( at28c16_3 );
22
2324/* memory handlers */
2425
25extern READ8_HANDLER( at28c16_0_r );
26extern READ8_HANDLER( at28c16_1_r );
27extern READ8_HANDLER( at28c16_2_r );
28extern READ8_HANDLER( at28c16_3_r );
29extern WRITE8_HANDLER( at28c16_0_w );
30extern WRITE8_HANDLER( at28c16_1_w );
31extern WRITE8_HANDLER( at28c16_2_w );
32extern WRITE8_HANDLER( at28c16_3_w );
26WRITE8_DEVICE_HANDLER( at28c16_w );
27READ8_DEVICE_HANDLER( at28c16_r );
3328
3429#endif
src/emu/machine/generic.c
r3115r3116
270270
271271void nvram_load(running_machine *machine)
272272{
273   mame_file *nvram_file = NULL;
274   device_config *device;
275
273276   if (machine->config->nvram_handler != NULL)
274277   {
275      mame_file *nvram_file = nvram_fopen(machine, OPEN_FLAG_READ);
278      nvram_file = nvram_fopen(machine, OPEN_FLAG_READ);
276279      (*machine->config->nvram_handler)(machine, nvram_file, 0);
277      if (nvram_file != NULL)
278         mame_fclose(nvram_file);
279280   }
281
282   for (device = (device_config *)machine->config->devicelist; device != NULL; device = device->next)
283   {
284      if (device->nvram != NULL)
285      {
286         if (nvram_file == NULL)
287         {
288            nvram_file = nvram_fopen(machine, OPEN_FLAG_READ);
289         }
290
291         (*device->nvram)(device, nvram_file, 0);
292      }
293   }
294
295   if (nvram_file != NULL)
296   {
297      mame_fclose(nvram_file);
298   }
280299}
281300
282301
r3115r3116
286305
287306void nvram_save(running_machine *machine)
288307{
308   mame_file *nvram_file = NULL;
309   device_config *device;
310
289311   if (machine->config->nvram_handler != NULL)
290312   {
291      mame_file *nvram_file = nvram_fopen(machine, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
292      if (nvram_file != NULL)
313      nvram_file = nvram_fopen(machine, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
314      (*machine->config->nvram_handler)(machine, nvram_file, 1);
315   }
316
317   for (device = (device_config *)machine->config->devicelist; device != NULL; device = device->next)
318   {
319      if (device->nvram != NULL)
293320      {
294         (*machine->config->nvram_handler)(machine, nvram_file, 1);
295         mame_fclose(nvram_file);
321         if (nvram_file == NULL)
322         {
323            nvram_file = nvram_fopen(machine, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
324         }
325
326         (*device->nvram)(device, nvram_file, 1);
296327      }
297328   }
329
330   if (nvram_file != NULL)
331   {
332      mame_fclose(nvram_file);
333   }
298334}
299335
300336
src/emu/machine/latch8.c
r0r3116
1/**********************************************************************
2
3    8 bit latch interface and emulation
4
5    2008/08     couriersud
6
7**********************************************************************/
8
9#include "driver.h"
10#include "memconv.h"
11#include "sound/discrete.h"
12#include "latch8.h"
13
14typedef struct _latch8_t latch8_t;
15struct _latch8_t
16{
17   latch8_config   *intf;
18   UINT8          value;
19   UINT8          has_node_map;
20   UINT8          has_devread;
21   UINT8          has_read;
22   const device_config   *devices[8];
23};
24
25/* ----------------------------------------------------------------------- */
26
27INLINE latch8_t *get_safe_token(const device_config *device) {
28   assert( device != NULL );
29   assert( device->token != NULL );
30   assert( device->type == LATCH8 );
31   return ( latch8_t * ) device->token;
32}
33
34static void update(const device_config *device, UINT8 new_val, UINT8 mask)
35{
36   latch8_t *latch8 = get_safe_token(device);
37   UINT8 old_val = latch8->value;
38
39   latch8->value = (latch8->value & ~mask) | (new_val & mask);
40
41   if (latch8->has_node_map)
42   {
43      int i;
44      UINT8 changed = old_val ^ latch8->value;
45      for (i=0; i<8; i++)
46         if (((changed & (1<<i)) != 0) && latch8->intf->node_map[i] != 0)
47            discrete_sound_w(device->machine, latch8->intf->node_map[i] , (latch8->value >> i) & 1);
48   }
49}
50
51static TIMER_CALLBACK( latch8_timerproc )
52{
53   const device_config *device = ptr;
54   UINT8 new_val = param & 0xFF;
55   UINT8 mask = param >> 8;
56
57   update(device, new_val, mask);
58}
59
60/* ----------------------------------------------------------------------- */
61
62READ8_DEVICE_HANDLER( latch8_r )
63{
64   latch8_t *latch8 = get_safe_token(device);
65   UINT8 res;
66
67   assert(offset == 0);
68
69   res = latch8->value;
70   if (latch8->has_devread)
71   {
72      int i;
73      for (i=0; i<8; i++)
74      {
75         const device_config *read_dev = latch8->devices[i];
76         if (read_dev != NULL)
77         {
78            res &= ~( 1 << i);
79            res |= ((latch8->intf->devread[i].devread_handler(read_dev, 0) >> latch8->intf->devread[i].from_bit) & 0x01) << i;
80         }
81      }
82   }
83   if (latch8->has_read)
84   {
85      int i;
86      for (i=0; i<8; i++)
87      {
88         if (latch8->intf->devread[i].read_handler != NULL)
89         {
90            res &= ~( 1 << i);
91            res |= ((latch8->intf->devread[i].read_handler(device->machine, 0) >> latch8->intf->devread[i].from_bit) & 0x01) << i;
92         }
93      }
94   }
95
96   return (res & ~latch8->intf->maskout) ^ latch8->intf->xor;
97}
98
99
100WRITE8_DEVICE_HANDLER( latch8_w )
101{
102   latch8_t *latch8 = get_safe_token(device);
103   assert(offset == 0);
104
105   if (latch8->intf->nosync != 0xff)
106      timer_call_after_resynch((void *)device, (0xFF << 8) | data, latch8_timerproc);
107   else
108      update(device, data, 0xFF);
109}
110
111
112WRITE8_DEVICE_HANDLER( latch8_reset)
113{
114   latch8_t *latch8 = get_safe_token(device);
115
116   assert(offset == 0);
117
118   latch8->value = 0;
119}
120
121/* read bit x                 */
122/* return (latch >> x) & 0x01 */
123
124INLINE UINT8 latch8_bitx_r(const device_config *device, offs_t offset, int bit)
125{
126   latch8_t *latch8 = get_safe_token(device);
127
128   assert( offset == 0);
129
130   return (latch8->value >> bit) & 0x01;
131}
132
133READ8_DEVICE_HANDLER( latch8_bit0_r) { return latch8_bitx_r(device, offset, 0); }
134READ8_DEVICE_HANDLER( latch8_bit1_r) { return latch8_bitx_r(device, offset, 1); }
135READ8_DEVICE_HANDLER( latch8_bit2_r) { return latch8_bitx_r(device, offset, 2); }
136READ8_DEVICE_HANDLER( latch8_bit3_r) { return latch8_bitx_r(device, offset, 3); }
137READ8_DEVICE_HANDLER( latch8_bit4_r) { return latch8_bitx_r(device, offset, 4); }
138READ8_DEVICE_HANDLER( latch8_bit5_r) { return latch8_bitx_r(device, offset, 5); }
139READ8_DEVICE_HANDLER( latch8_bit6_r) { return latch8_bitx_r(device, offset, 6); }
140READ8_DEVICE_HANDLER( latch8_bit7_r) { return latch8_bitx_r(device, offset, 7); }
141
142READ8_DEVICE_HANDLER( latch8_bit0_q_r) { return latch8_bitx_r(device, offset, 0) ^ 1; }
143READ8_DEVICE_HANDLER( latch8_bit1_q_r) { return latch8_bitx_r(device, offset, 1) ^ 1; }
144READ8_DEVICE_HANDLER( latch8_bit2_q_r) { return latch8_bitx_r(device, offset, 2) ^ 1; }
145READ8_DEVICE_HANDLER( latch8_bit3_q_r) { return latch8_bitx_r(device, offset, 3) ^ 1; }
146READ8_DEVICE_HANDLER( latch8_bit4_q_r) { return latch8_bitx_r(device, offset, 4) ^ 1; }
147READ8_DEVICE_HANDLER( latch8_bit5_q_r) { return latch8_bitx_r(device, offset, 5) ^ 1; }
148READ8_DEVICE_HANDLER( latch8_bit6_q_r) { return latch8_bitx_r(device, offset, 6) ^ 1; }
149READ8_DEVICE_HANDLER( latch8_bit7_q_r) { return latch8_bitx_r(device, offset, 7) ^ 1; }
150
151/* write bit x from data into bit determined by offset */
152/* latch = (latch & ~(1<<offset)) | (((data >> x) & 0x01) << offset) */
153
154INLINE void latch8_bitx_w(const device_config *device, int bit, offs_t offset, UINT8 data)
155{
156   latch8_t *latch8 = get_safe_token(device);
157   UINT8 mask = (1<<offset);
158   UINT8 masked_data = (((data >> bit) & 0x01) << offset);
159
160   assert( offset < 8);
161
162   /* No need to synchronize ? */
163   if (latch8->intf->nosync & mask)
164      update(device, masked_data, mask);
165   else
166      timer_call_after_resynch((void *) device, (mask << 8) | masked_data, latch8_timerproc);
167}
168
169WRITE8_DEVICE_HANDLER( latch8_bit0_w ) { latch8_bitx_w(device, 0, offset, data); }
170WRITE8_DEVICE_HANDLER( latch8_bit1_w ) { latch8_bitx_w(device, 1, offset, data); }
171WRITE8_DEVICE_HANDLER( latch8_bit2_w ) { latch8_bitx_w(device, 2, offset, data); }
172WRITE8_DEVICE_HANDLER( latch8_bit3_w ) { latch8_bitx_w(device, 3, offset, data); }
173WRITE8_DEVICE_HANDLER( latch8_bit4_w ) { latch8_bitx_w(device, 4, offset, data); }
174WRITE8_DEVICE_HANDLER( latch8_bit5_w ) { latch8_bitx_w(device, 0, offset, data); }
175WRITE8_DEVICE_HANDLER( latch8_bit6_w ) { latch8_bitx_w(device, 0, offset, data); }
176WRITE8_DEVICE_HANDLER( latch8_bit7_w ) { latch8_bitx_w(device, 0, offset, data); }
177
178/* ----------------------------------------------------------------------- */
179
180/* device interface */
181
182static DEVICE_START( latch8 )
183{
184   latch8_t *latch8 = get_safe_token(device);
185   char unique_tag[30];
186   int i;
187
188   /* validate arguments */
189   assert(strlen(device->tag) < 20);
190
191   latch8->intf = device->inline_config;
192
193   latch8->value = 0x0;
194
195   /* setup nodemap */
196   for (i=0; i<8; i++)
197      if (latch8->intf->node_map[i] )
198         latch8->has_node_map = 1;
199
200   /* setup device read handlers */
201   for (i=0; i<8; i++)
202      if (latch8->intf->devread[i].tag != NULL)
203      {
204         if (latch8->devices[i] != NULL)
205            fatalerror("Device %s: Bit %d already has a handler.\n", device->tag, i);
206         latch8->devices[i] = devtag_get_device(device->machine,
207               latch8->intf->devread[i].type,
208               latch8->intf->devread[i].tag);
209         if (latch8->devices[i] == NULL)
210            fatalerror("Device %s: Unable to find device %s\n", device->tag, latch8->intf->devread[i].tag);
211         latch8->has_devread = 1;
212      }
213
214   /* setup machine read handlers */
215   for (i=0; i<8; i++)
216      if (latch8->intf->devread[i].read_handler != NULL)
217      {
218         if (latch8->devices[i] != NULL)
219            fatalerror("Device %s: Bit %d already has a handler.\n", device->tag, i);
220         latch8->has_read = 1;
221      }
222
223   state_save_combine_module_and_tag(unique_tag, "latch8", device->tag);
224
225   state_save_register_item(unique_tag, 0, latch8->value);
226}
227
228
229static DEVICE_RESET( latch8 )
230{
231   latch8_t *latch8 = get_safe_token(device);
232
233   latch8->value = 0;
234}
235
236
237static DEVICE_SET_INFO( latch8 )
238{
239   switch (state)
240   {
241      /* no parameters to set */
242   }
243}
244
245
246DEVICE_GET_INFO( latch8 )
247{
248   switch (state)
249   {
250      /* --- the following bits of info are returned as 64-bit signed integers --- */
251      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(latch8_t);            break;
252      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = sizeof(latch8_config);                     break;
253      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;      break;
254
255      /* --- the following bits of info are returned as pointers to data or functions --- */
256      case DEVINFO_FCT_SET_INFO:                  info->set_info = DEVICE_SET_INFO_NAME(latch8); break;
257      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(latch8);break;
258      case DEVINFO_FCT_STOP:                     /* Nothing */                     break;
259      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(latch8);break;
260
261      /* --- the following bits of info are returned as NULL-terminated strings --- */
262      case DEVINFO_STR_NAME:                     info->s = "8 bit latch";            break;
263      case DEVINFO_STR_FAMILY:                  info->s = "Latches";               break;
264      case DEVINFO_STR_VERSION:                  info->s = "1.0";                  break;
265      case DEVINFO_STR_SOURCE_FILE:               info->s = __FILE__;                  break;
266      case DEVINFO_STR_CREDITS:                  info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
267   }
268}
src/emu/machine/latch8.h
r0r3116
1/**********************************************************************
2
3    8 bit latch interface and emulation
4
5    Generic emulation of 74LS174/175, 74LS259 and other latches.
6    Apart from providing synched latch operation, these
7    latches can be configured to read their input bitwise from other
8    devices as well and individual bits can be connected to
9    discrete nodes.
10
11    Please see audio/dkong.c for examples.
12
13**********************************************************************/
14
15#ifndef __LATCH8_H_
16#define __LATCH8_H_
17
18#define LATCH8      DEVICE_GET_INFO_NAME(latch8)
19
20/***************************************************************************
21    TYPE DEFINITIONS
22***************************************************************************/
23
24typedef struct _latch8_devread latch8_devread;
25struct _latch8_devread
26{
27   /* only for byte reads, does not affect bit reads and node_map */
28   UINT32               from_bit;
29   device_type            type;
30   const char            *tag;
31   read8_device_func      devread_handler;
32   read8_machine_func      read_handler;
33};
34
35typedef struct _latch8_config latch8_config;
36struct _latch8_config
37{
38   /* only for byte reads, does not affect bit reads and node_map */
39   UINT32               maskout;
40   UINT32               xor;  /* after mask */
41   UINT32               nosync;
42   UINT32               node_map[8];
43   latch8_devread         devread[8];
44};
45
46/***************************************************************************
47    DEVICE CONFIGURATION MACROS
48***************************************************************************/
49
50/* add device */
51#define MDRV_LATCH8_ADD(_tag) \
52   MDRV_DEVICE_ADD(_tag, LATCH8)
53
54/* Bit mask specifying bits to be masked *out* */
55#define MDRV_LATCH8_MASKOUT(_maskout) \
56   MDRV_DEVICE_CONFIG_DATA32(latch8_config, maskout, _maskout)
57
58/* Bit mask specifying bits to be inverted */
59#define MDRV_LATCH8_INVERT(_xor) \
60   MDRV_DEVICE_CONFIG_DATA32(latch8_config, xor, _xor)
61
62/* Bit mask specifying bits not needing cpu synchronization. */
63#define MDRV_LATCH8_NOSYNC(_nosync) \
64   MDRV_DEVICE_CONFIG_DATA32(latch8_config, nosync, _nosync)
65
66/* Write bit to discrete node */
67#define MDRV_LATCH8_DISCRETE_NODE(_bit, _node) \
68   MDRV_DEVICE_CONFIG_DATA32_ARRAY(latch8_config, node_map, _bit, _node)
69
70/* Upon read, replace bits by reading from another device handler */
71#define MDRV_LATCH8_DEVREAD(_bit, _type, _tag, _handler, _from_bit) \
72   MDRV_DEVICE_CONFIG_DATA32_ARRAY_MEMBER(latch8_config, devread, _bit, latch8_devread, from_bit, _from_bit) \
73   MDRV_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(latch8_config, devread, _bit, latch8_devread, type, _type) \
74   MDRV_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(latch8_config, devread, _bit, latch8_devread, tag, _tag) \
75   MDRV_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(latch8_config, devread, _bit, latch8_devread, devread_handler, _handler) \
76
77/* Upon read, replace bits by reading from another machine handler */
78#define MDRV_LATCH8_READ(_bit, _handler, _from_bit) \
79   MDRV_DEVICE_CONFIG_DATA32_ARRAY_MEMBER(latch8_config, devread, _bit, latch8_devread, from_bit, _from_bit) \
80   MDRV_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(latch8_config, devread, _bit, latch8_devread, read_handler, _handler) \
81
82/* remove device */
83#define MDRV_LATCH8_REMOVE(_tag) \
84   MDRV_DEVICE_REMOVE(LATCH8, _type)
85
86/* Accessor macros */
87
88#define AM_LATCH8_READ(_tag) \
89   AM_DEVREAD(LATCH8, _tag, latch8_r)
90
91#define AM_LATCH8_READBIT(_tag, _bit) \
92   AM_DEVREAD(LATCH8, _tag, latch8_bit ## _bit ## _q_r)
93
94#define AM_LATCH8_WRITE(_tag) \
95   AM_DEVWRITE(LATCH8, _tag, latch8_w)
96
97#define AM_LATCH8_READWRITE(_tag) \
98   AM_DEVREADWRITE(LATCH8, _tag, latch8_r, latch8_w)
99
100/* device interface */
101DEVICE_GET_INFO( latch8 );
102
103/* write & read full byte */
104
105READ8_DEVICE_HANDLER( latch8_r );
106WRITE8_DEVICE_HANDLER( latch8_w );
107
108/* reset the latch */
109
110WRITE8_DEVICE_HANDLER( latch8_reset );
111
112/* read bit x                 */
113/* return (latch >> x) & 0x01 */
114
115READ8_DEVICE_HANDLER( latch8_bit0_r );
116READ8_DEVICE_HANDLER( latch8_bit1_r );
117READ8_DEVICE_HANDLER( latch8_bit2_r );
118READ8_DEVICE_HANDLER( latch8_bit3_r );
119READ8_DEVICE_HANDLER( latch8_bit4_r );
120READ8_DEVICE_HANDLER( latch8_bit5_r );
121READ8_DEVICE_HANDLER( latch8_bit6_r );
122READ8_DEVICE_HANDLER( latch8_bit7_r );
123
124/* read inverted bit x        */
125/* return (latch >> x) & 0x01 */
126
127READ8_DEVICE_HANDLER( latch8_bit0_q_r );
128READ8_DEVICE_HANDLER( latch8_bit1_q_r );
129READ8_DEVICE_HANDLER( latch8_bit2_q_r );
130READ8_DEVICE_HANDLER( latch8_bit3_q_r );
131READ8_DEVICE_HANDLER( latch8_bit4_q_r );
132READ8_DEVICE_HANDLER( latch8_bit5_q_r );
133READ8_DEVICE_HANDLER( latch8_bit6_q_r );
134READ8_DEVICE_HANDLER( latch8_bit7_q_r );
135
136/* write bit x from data into bit determined by offset */
137/* latch = (latch & ~(1<<offset)) | (((data >> x) & 0x01) << offset) */
138
139WRITE8_DEVICE_HANDLER( latch8_bit0_w );
140WRITE8_DEVICE_HANDLER( latch8_bit1_w );
141WRITE8_DEVICE_HANDLER( latch8_bit2_w );
142WRITE8_DEVICE_HANDLER( latch8_bit3_w );
143WRITE8_DEVICE_HANDLER( latch8_bit4_w );
144WRITE8_DEVICE_HANDLER( latch8_bit5_w );
145WRITE8_DEVICE_HANDLER( latch8_bit6_w );
146WRITE8_DEVICE_HANDLER( latch8_bit7_w );
147
148#endif /* __LATCH8_H_ */
src/emu/devintrf.h
r3115r3116
7070      DEVINFO_FCT_STOP,                        /* R/O: device_stop_func */
7171      DEVINFO_FCT_RESET,                        /* R/O: device_reset_func */
7272      DEVINFO_FCT_VALIDITY_CHECK,                  /* R/O: device_validity_check_func */
73      DEVINFO_FCT_NVRAM,                        /* R/O: device_nvram_func */
7374
7475   DEVINFO_FCT_DEVICE_SPECIFIC = 0x28000,            /* R/W: device-specific values start here */
7576   DEVINFO_FCT_LAST = 0x2ffff,
r3115r3116
113114#define DEVICE_RESET(name)         void DEVICE_RESET_NAME(name)(const device_config *device)
114115#define DEVICE_RESET_CALL(name)      DEVICE_RESET_NAME(name)(device)
115116
117#define DEVICE_NVRAM_NAME(name)      device_NVRAM_##name
118#define DEVICE_NVRAM(name)         void DEVICE_NVRAM_NAME(name)(const device_config *device, mame_file *file, int read_or_write)
119#define DEVICE_NVRAM_CALL(name)      DEVICE_NVRAM_NAME(name)(device, file, read_or_write)
120
116121#define DEVICE_VALIDITY_CHECK_NAME(name)   device_validity_check_##name
117122#define DEVICE_VALIDITY_CHECK(name)         int DEVICE_VALIDITY_CHECK_NAME(name)(const game_driver *driver, const device_config *device)
118123#define DEVICE_VALIDITY_CHECK_CALL(name)   DEVICE_VALIDITY_CHECK(name)(driver, device)
r3115r3116
134139typedef void (*device_start_func)(const device_config *device);
135140typedef void (*device_stop_func)(const device_config *device);
136141typedef void (*device_reset_func)(const device_config *device);
142typedef void (*device_nvram_func)(const device_config *device, mame_file *file, int read_or_write);
137143typedef int (*device_validity_check_func)(const game_driver *driver, const device_config *device);
138144
139145
r3115r3116
154160   device_stop_func      stop;               /* DEVINFO_FCT_STOP */
155161   device_reset_func      reset;               /* DEVINFO_FCT_RESET */
156162   device_validity_check_func validity_check;      /* DEVINFO_FCT_VALIDITY_CHECK */
163   device_nvram_func      nvram;               /* DEVINFO_FCT_NVRAM */
157164   const rom_entry *      romregion;            /* DEVINFO_PTR_ROM_REGION */
158165};
159166
r3115r3116
168175   device_start_func      start;               /* quick pointer to start callback */
169176   device_stop_func      stop;               /* quick pointer to stop callback */
170177   device_reset_func      reset;               /* quick pointer to reset callback */
178   device_nvram_func      nvram;               /* quick pointer to nvram callback */
171179   const void *         static_config;         /* static device configuration */
172180   void *               inline_config;         /* inline device configuration */
173181
r3115r3116
254262
255263/* ----- device information getters ----- */
256264
265/* return the device associated with a tag */
266const device_config *devtag_get_device(running_machine *machine, device_type type, const char *tag);
267
257268/* return the token associated with an allocated device */
258269void *devtag_get_token(running_machine *machine, device_type type, const char *tag);
259270
src/emu/rendersw.c
r3115r3116
115115}
116116
117117
118/*-------------------------------------------------
118/*------------------------------------------------------------------------
119119    ycc_to_rgb - convert YCC to RGB; the YCC pixel
120120    contains Y in the LSB, Cb << 8, and Cr << 16
121-------------------------------------------------*/
121    This actually a YCbCr conversion,
122    details my be found in chapter 6.4 ff of
123    http://softwarecommunity.intel.com/isn/downloads/softwareproducts/pdfs/346495.pdf
124    The document also contains the constants below as floats.
125--------------------------------------------------------------------------*/
122126
127INLINE UINT8 clamp16_shift8(UINT32 x)
128{
129   return (((INT32) x < 0) ? 0 : (x > 65535 ? 255: x >> 8));
130}
131
123132INLINE UINT32 ycc_to_rgb(UINT32 ycc)
124133{
125134   /* original equations:
r3115r3116
143152        R = clip(( 298 * Y - 298 * 16                        + 409 * Cr - 409 * 128 + 128) >> 8)
144153        G = clip(( 298 * Y - 298 * 16 - 100 * Cb + 100 * 128 - 208 * Cr + 208 * 128 + 128) >> 8)
145154        B = clip(( 298 * Y - 298 * 16 + 516 * Cb - 516 * 128                        + 128) >> 8)
155
156        Now combine constants:
157
158        R = clip(( 298 * Y            + 409 * Cr - 56992) >> 8)
159        G = clip(( 298 * Y - 100 * Cb - 208 * Cr + 34784) >> 8)
160        B = clip(( 298 * Y + 516 * Cb            - 70688) >> 8)
161
162        Define common = 298 * y - 56992. This will save one addition
163
164        R = clip(( common            + 409 * Cr -     0) >> 8)
165        G = clip(( common - 100 * Cb - 208 * Cr + 91776) >> 8)
166        B = clip(( common + 516 * Cb            - 13696) >> 8)
167
146168    */
147169    UINT8 y = ycc;
148170    UINT8 cb = ycc >> 8;
149171    UINT8 cr = ycc >> 16;
150   int r, g, b, common;
172   UINT32 r, g, b, common;
151173
152   common = 298 * y - 298 * 16;
153   r = (common +                        409 * cr - 409 * 128 + 128) >> 8;
154   g = (common - 100 * cb + 100 * 128 - 208 * cr + 208 * 128 + 128) >> 8;
155   b = (common + 516 * cb - 516 * 128                        + 128) >> 8;
174   common = 298 * y - 56992;
175   r = (common +            409 * cr);
176   g = (common - 100 * cb - 208 * cr + 91776);
177   b = (common + 516 * cb - 13696);
156178
157   if (r < 0) r = 0;
158   else if (r > 255) r = 255;
159   if (g < 0) g = 0;
160   else if (g > 255) g = 255;
161   if (b < 0) b = 0;
162   else if (b > 255) b = 255;
163
164   return MAKE_RGB(r, g, b);
179   /* Now clamp and shift back */
180   return MAKE_RGB(clamp16_shift8(r), clamp16_shift8(g), clamp16_shift8(b));
165181}
166182
167
168183/*-------------------------------------------------
169184    get_texel_palette16_nearest - return the
170185    nearest neighbor texel from a palettized
src/emu/cpuintrf.c
r3115r3116
5050void v60_get_info(UINT32 state, cpuinfo *info);
5151void v70_get_info(UINT32 state, cpuinfo *info);
5252void i8035_get_info(UINT32 state, cpuinfo *info);
53void i8041_get_info(UINT32 state, cpuinfo *info);
54void i8048_get_info(UINT32 state, cpuinfo *info);
55void i8648_get_info(UINT32 state, cpuinfo *info);
56void i8748_get_info(UINT32 state, cpuinfo *info);
57void mb8884_get_info(UINT32 state, cpuinfo *info);
5358void i8039_get_info(UINT32 state, cpuinfo *info);
54void i8048_get_info(UINT32 state, cpuinfo *info);
59void i8049_get_info(UINT32 state, cpuinfo *info);
5560void i8749_get_info(UINT32 state, cpuinfo *info);
5661void n7751_get_info(UINT32 state, cpuinfo *info);
57void mb8884_get_info(UINT32 state, cpuinfo *info);
5862void m58715_get_info(UINT32 state, cpuinfo *info);
5963void i8x41_get_info(UINT32 state, cpuinfo *info);
6064void i8051_get_info(UINT32 state, cpuinfo *info);
r3115r3116
377381#if (HAS_I8035)
378382   { CPU_I8035, i8035_get_info },
379383#endif
380#if (HAS_I8039)
381   { CPU_I8039, i8039_get_info },
384#if (HAS_I8041)
385   { CPU_I8041, i8041_get_info },
382386#endif
383387#if (HAS_I8048)
384388   { CPU_I8048, i8048_get_info },
385389#endif
386#if (HAS_I8749)
387   { CPU_I8749, i8749_get_info },
390#if (HAS_I8648)
391   { CPU_I8648, i8648_get_info },
388392#endif
389#if (HAS_N7751)
390   { CPU_N7751, n7751_get_info },
393#if (HAS_I8748)
394   { CPU_I8748, i8748_get_info },
391395#endif
392396#if (HAS_MB8884)
393397   { CPU_MB8884, mb8884_get_info },
394398#endif
399#if (HAS_N7751)
400   { CPU_N7751, n7751_get_info },
401#endif
402#if (HAS_I8039)
403   { CPU_I8039, i8039_get_info },
404#endif
405#if (HAS_I8049)
406   { CPU_I8049, i8049_get_info },
407#endif
408#if (HAS_I8749)
409   { CPU_I8749, i8749_get_info },
410#endif
395411#if (HAS_M58715)
396412   { CPU_M58715, m58715_get_info },
397413#endif
src/emu/cpuexec.h
r3115r3116
7777   CPU_V60,
7878   CPU_V70,
7979   CPU_I8035,
80   CPU_I8041,
81   CPU_I8048,
82   CPU_I8648,
83   CPU_I8748,
84   CPU_MB8884,
85   CPU_N7751,
8086   CPU_I8039,
81   CPU_I8048,
87   CPU_I8049,
8288   CPU_I8749,
83   CPU_N7751,
84   CPU_MB8884,
8589   CPU_M58715,
8690   CPU_I8X41,
8791   CPU_I8051,
src/emu/sound/disc_inp.c
r3115r3116
3333
3434READ8_HANDLER(discrete_sound_r)
3535{
36   discrete_info *info = sndti_token(SOUND_DISCRETE, 0);
36   discrete_info    *info = sndti_token(SOUND_DISCRETE, 0);
3737   node_description *node = discrete_find_node(info, offset);
38
3839   UINT8 data = 0;
3940
4041   /* Read the node input value if allowed */
r3115r3116
5859
5960WRITE8_HANDLER(discrete_sound_w)
6061{
61   discrete_info *info = sndti_token(SOUND_DISCRETE, 0);
62   discrete_info    *info = sndti_token(SOUND_DISCRETE, 0);
6263   node_description *node = discrete_find_node(info, offset);
6364
6465   /* Update the node input value if it's a proper input node */
6566   if (node)
6667   {
6768      UINT8 *node_data = node->context;
68      UINT8 last_data = *node_data;
69      UINT8 new_data = 0;
69      UINT8 last_data  = *node_data;
70      UINT8 new_data    = 0;
7071
7172      switch (node->module.type)
7273      {
r3115r3116
122123static void dss_adjustment_step(node_description *node)
123124{
124125   struct dss_adjustment_context *context = node->context;
125   INT32 rawportval = input_port_read_direct(context->port);
126126
127   INT32  rawportval = input_port_read_direct(context->port);
128
127129   /* only recompute if the value changed from last time */
128130   if (rawportval != context->lastpval)
129131   {
130      double portval = (double)(rawportval - context->pmin) * context->pscale;
132      double portval   = (double)(rawportval - context->pmin) * context->pscale;
131133      double scaledval = portval * context->scale + context->min;
132134
133135      context->lastpval = rawportval;
r3115r3116
141143static void dss_adjustment_reset(node_description *node)
142144{
143145   struct dss_adjustment_context *context = node->context;
146
144147   double min, max;
145148
146149   if (node->custom)
r3115r3116
153156      context->port = input_port_by_index(Machine->portconfig, DSS_ADJUSTMENT__PORT);
154157
155158   context->lastpval = 0x7fffffff;
156   context->pmin = DSS_ADJUSTMENT__PMIN;
157   context->pscale = 1.0 / (double)(DSS_ADJUSTMENT__PMAX - DSS_ADJUSTMENT__PMIN);
159   context->pmin     = DSS_ADJUSTMENT__PMIN;
160   context->pscale   = 1.0 / (double)(DSS_ADJUSTMENT__PMAX - DSS_ADJUSTMENT__PMIN);
158161
159162   /* linear scale */
160163   if (DSS_ADJUSTMENT__LOG == 0)
161164   {
162      context->min = DSS_ADJUSTMENT__MIN;
165      context->min   = DSS_ADJUSTMENT__MIN;
163166      context->scale = DSS_ADJUSTMENT__MAX - DSS_ADJUSTMENT__MIN;
164167   }
165168
r3115r3116
169172      /* force minimum and maximum to be > 0 */
170173      min = (DSS_ADJUSTMENT__MIN > 0) ? DSS_ADJUSTMENT__MIN : 1;
171174      max = (DSS_ADJUSTMENT__MAX > 0) ? DSS_ADJUSTMENT__MAX : 1;
172      context->min = log10(min);
175      context->min   = log10(min);
173176      context->scale = log10(max) - log10(min);
174177   }
175178
r3115r3116
249252
250253static void dss_input_stream_step(node_description *node)
251254{
252   // the context pointer is set to point to the current input stream data in discrete_stream_update
255   /* the context pointer is set to point to the current input stream data in discrete_stream_update */
253256   stream_sample_t **ptr = node->context;
254257   stream_sample_t *data = *ptr;
255258
src/emu/sound/disc_mth.c
r3115r3116
4545
4646struct dst_dac_r1_context
4747{
48   double   iBias;      // current of the bias circuit
49   double   exponent;   // smoothing curve
50   double   rTotal;      // all resistors in parallel
48   double   i_bias;      /* current of the bias circuit */
49   double   exponent;   /* smoothing curve */
50   double   r_total;   /* all resistors in parallel */
51   int      last_data;
5152};
5253
5354struct dst_flipflop_context
r3115r3116
5859struct dst_integrate_context
5960{
6061   double   change;
61   double   vMaxIn;      // v1 - norton VBE
62   double   vMaxInD;   // v1 - norton VBE - diode drop
63   double   vMaxOut;
62   double   v_max_in;   /* v1 - norton VBE */
63   double   v_max_in_d;   /* v1 - norton VBE - diode drop */
64   double   v_max_out;
6465};
6566
6667#define DISC_MIXER_MAX_INPS   8
6768
6869struct dst_mixer_context
6970{
70   int   type;
71   int   size;
72   double   rTotal;
73   double *rNode[DISC_MIXER_MAX_INPS];         // Either pointer to resistance node output OR NULL
74   double   exponent_rc[DISC_MIXER_MAX_INPS];   // For high pass filtering cause by cIn
75   double   vCap[DISC_MIXER_MAX_INPS];      // cap voltage of each input
76   double   exponent_cF;            // Low pass on mixed inputs
77   double   exponent_cAmp;            // Final high pass caused by out cap and amp input impedance
78   double   vCapF;               // cap voltage of cF
79   double   vCapAmp;            // cap voltage of cAmp
80   double   gain;               // used for DISC_MIXER_IS_OP_AMP_WITH_RI
71   int      type;
72   int      size;
73   int      has_r_node;
74   double   r_total;
75   double *r_node[DISC_MIXER_MAX_INPS];      /* Either pointer to resistance node output OR NULL */
76   double   exponent_rc[DISC_MIXER_MAX_INPS];   /* For high pass filtering cause by cIn */
77   double   v_cap[DISC_MIXER_MAX_INPS];         /* cap voltage of each input */
78   double   exponent_c_f;         /* Low pass on mixed inputs */
79   double   exponent_c_amp;         /* Final high pass caused by out cap and amp input impedance */
80   double   v_cap_f;            /* cap voltage of cF */
81   double   v_cap_amp;            /* cap voltage of cAmp */
82   double   gain;               /* used for DISC_MIXER_IS_OP_AMP_WITH_RI */
8183};
8284
8385struct dst_oneshot_context
8486{
85   double countdown;
86   int state;
87   int lastTrig;
87   double   countdown;
88   int      state;
89   int      last_trig;
8890};
8991
9092struct dss_ramp_context
9193{
92   double step;
93   int dir;      /* 1 if End is higher then Start */
94   int last_en;   /* Keep track of the last enable value */
94   double   step;
95   int      dir;      /* 1 if End is higher then Start */
96   int      last_en;   /* Keep track of the last enable value */
9597};
9698
9799struct dst_samphold_context
98100{
99   double lastinput;
101   double last_input;
100102   int clocktype;
101103};
102104
r3115r3116
110112   UINT8   has_cap;
111113   UINT8   has_r1;
112114   UINT8   has_r4;
113   double   vMax;
114   double   iFixed;
115   double   vCap;
115   double   v_max;
116   double   i_fixed;
117   double   v_cap;
116118   double   exponent;
117119};
118120
119121struct dst_op_amp_1sht_context
120122{
121   double   iFixed;
122   double   vMax;
123   double   i_fixed;
124   double   v_max;
123125   double   r34ratio;
124   double   vCap1;
125   double   vCap2;
126   double   v_cap1;
127   double   v_cap2;
126128   double   exponent1c;
127129   double   exponent1d;
128130   double   exponent2;
r3115r3116
130132
131133struct dst_tvca_op_amp_context
132134{
133   double   vOutMax;      // Maximum output voltage
134   double   vTrig[2];      // Voltage used to charge cap1 based on function F3
135   double   vTrig2;         // Voltage used to charge cap2
136   double   vTrig3;         // Voltage used to charge cap3
137   double   iFixed;         // Fixed current going into - input
138   double   exponentC[2];   // Charge exponents based on function F3
139   double   exponentD[2];   // Discharge exponents based on function F3
140   double   exponent2[2];   // Discharge/charge exponents based on function F4
141   double   exponent3[2];   // Discharge/charge exponents based on function F5
142   double   vCap1;         // charge on cap c1
143   double   vCap2;         // charge on cap c2
144   double   vCap3;         // charge on cap c3
145   double   r67;         // = r6 + r7 (for easy use later)
135   double   v_out_max;      /* Maximum output voltage */
136   double   v_trig[2];      /* Voltage used to charge cap1 based on function F3 */
137   double   v_trig2;         /* Voltage used to charge cap2 */
138   double   v_trig3;         /* Voltage used to charge cap3 */
139   double   i_fixed;      /* Fixed current going into - input */
140   double   exponent_c[2];   /* Charge exponents based on function F3 */
141   double   exponent_d[2];   /* Discharge exponents based on function F3 */
142   double   exponent2[2];   /* Discharge/charge exponents based on function F4 */
143   double   exponent3[2];   /* Discharge/charge exponents based on function F5 */
144   double   v_cap1;         /* charge on cap c1 */
145   double   v_cap2;         /* charge on cap c2 */
146   double   v_cap3;         /* charge on cap c3 */
147   double   r67;         /* = r6 + r7 (for easy use later) */
146148};
147149
148150
r3115r3116
244246{
245247   if(DST_CLAMP__ENABLE)
246248   {
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      if (DST_CLAMP__IN < DST_CLAMP__MIN) node->output[0] = DST_CLAMP__MIN;
250      else if (DST_CLAMP__IN > DST_CLAMP__MAX) node->output[0] = DST_CLAMP__MAX;
249251      else node->output[0]= DST_CLAMP__IN;
250252   }
251253   else
r3115r3116
273275
274276static void dst_dac_r1_step(node_description *node)
275277{
276   const discrete_dac_r1_ladder *info = node->custom;
277   struct dst_dac_r1_context *context = node->context;
278   const  discrete_dac_r1_ladder *info    = node->custom;
279   struct dst_dac_r1_context     *context = node->context;
278280
279   int   bit;
280   double   v;
281   double   i;
281   int      bit, bit_val, data;
282   double   v, i_bit, i_total, x_time;
282283
283   i = context->iBias;
284   i_total = context->i_bias;
284285
286   data  = (int)DST_DAC_R1__DATA;
287   x_time = DST_DAC_R1__DATA - data;
288
285289   if (DST_DAC_R1__ENABLE)
286290   {
287291      for (bit=0; bit < info->ladderLength; bit++)
288292      {
289293         /* Add up currents of ON circuits per Millman. */
290         /* Off, being 0V and having no current, can be ignored. */
291         if ((DST_DAC_R1__DATA & (1 << bit)) && info->r[bit])
292            i += DST_DAC_R1__VON / info->r[bit];
294
295         /* ignore if no resistor present */
296         if (info->r[bit] != 0)
297         {
298            i_bit   = DST_DAC_R1__VON / info->r[bit];
299            bit_val = (data >> bit) & 0x01;
300
301            if ((x_time != 0) && (bit_val != ((context->last_data >> bit) & 0x01)))
302            {
303               /* there is x_time and a change in bit,
304                     * so anti-alias the current */
305               i_bit *= bit_val ? x_time : 1.0 - x_time;
306            }
307            else
308            {
309               /* there is no x_time or a change in bit,
310                     * so 0 the current if the bit value is 0 */
311                if (bit_val == 0) i_bit = 0;
312            }
313         i_total += i_bit;
314         }
293315      }
294316
295      v = i * context->rTotal;
317      v = i_total * context->r_total;
296318
297319      /* Filter if needed, else just output voltage */
298320      node->output[0] = info->cFilter ? node->output[0] + ((v - node->output[0]) * context->exponent) : v;
r3115r3116
316338
317339   /* Calculate the Millman current of the bias circuit */
318340   if (info->rBias)
319      context->iBias = info->vBias / info->rBias;
341      context->i_bias = info->vBias / info->rBias;
320342   else
321      context->iBias = 0;
343      context->i_bias = 0;
322344
323345   /*
324346     * We will do a small amount of error checking.
r3115r3116
340362     * This is the combined resistance of the voltage sources.
341363     * This is used for the charging curve.
342364     */
343   context->rTotal = 0;
344   for(bit=0; bit < info->ladderLength; bit++)
365   context->r_total = 0;
366   for(bit = 0; bit < info->ladderLength; bit++)
345367   {
346368      if (info->r[bit])
347         context->rTotal += 1.0 / info->r[bit];
369         context->r_total += 1.0 / info->r[bit];
348370   }
349   if (info->rBias) context->rTotal += 1.0 / info->rBias;
350   if (info->rGnd) context->rTotal += 1.0 / info->rGnd;
351   context->rTotal = 1.0 / context->rTotal;
371   if (info->rBias) context->r_total += 1.0 / info->rBias;
372   if (info->rGnd)  context->r_total += 1.0 / info->rGnd;
373   context->r_total = 1.0 / context->r_total;
352374
353375   node->output[0] = 0;
354376
355377   if (info->cFilter)
356378   {
357379      /* Setup filter constants */
358      context->exponent = -1.0 / (context->rTotal * info->cFilter  * discrete_current_context->sample_rate);
359      context->exponent = 1.0 - exp(context->exponent);
380      context->exponent = -1.0 / (context->r_total * info->cFilter  * discrete_current_context->sample_rate);
381      context->exponent =  1.0 - exp(context->exponent);
360382   }
361383}
362384
r3115r3116
378400
379401static void dst_diode_mix_step(node_description *node)
380402{
381   struct dst_size_context *context = node->context;
382   double max = 0;
383   int addr;
403   struct   dst_size_context *context = node->context;
384404
405   double   max = 0;
406   int      addr;
407
385408   if (DST_DIODE_MIX__ENABLE)
386409   {
387410      for (addr = 0; addr < context->size; addr++)
r3115r3116
426449   {
427450      if(DST_DIVIDE__DIV == 0)
428451      {
429         node->output[0]=DBL_MAX;   /* Max out but don't break */
452         node->output[0 ]= DBL_MAX;   /* Max out but don't break */
430453         discrete_log("dst_divider_step() - Divide by Zero attempted in NODE_%02d.\n",NODE_INDEX(node->node));
431454      }
432455      else
r3115r3116
460483{
461484   if(DST_GAIN__ENABLE)
462485   {
463      node->output[0] = DST_GAIN__IN * DST_GAIN__GAIN;
486      node->output[0] = DST_GAIN__IN * DST_GAIN__GAIN;
464487      node->output[0] += DST_GAIN__OFFSET;
465488   }
466489   else
467490   {
468      node->output[0]=0;
491      node->output[0] = 0;
469492   }
470493}
471494
r3115r3116
520543
521544static void dst_integrate_step(node_description *node)
522545{
523   const discrete_integrate_info *info = node->custom;
524   struct dst_integrate_context *context = node->context;
546   const  discrete_integrate_info *info    = node->custom;
547   struct dst_integrate_context   *context = node->context;
525548
526549   int      trig0, trig1;
527   double   iNeg = 0;   // current into - input
528   double   iPos = 0;   // current into + input
550   double   i_neg = 0;   /* current into - input */
551   double   i_pos = 0;   /* current into + input */
529552
530553   switch (info->type)
531554   {
r3115r3116
535558            /* This forces the cap to completely charge,
536559                 * and the output to go to it's max value.
537560                 */
538            node->output[0] = context->vMaxOut;
561            node->output[0] = context->v_max_out;
539562            return;
540563         }
541564         node->output[0] -= context->change;
542565         break;
543566
544567      case DISC_INTEGRATE_OP_AMP_1 | DISC_OP_AMP_IS_NORTON:
545         iNeg = context->vMaxIn / info->r1;
546         iPos = (DST_INTEGRATE__TRG0 - OP_AMP_NORTON_VBE) / info->r2;
547         if (iPos < 0) iPos = 0;
548         node->output[0] += (iPos - iNeg) / discrete_current_context->sample_rate / info->c;
568         i_neg = context->v_max_in / info->r1;
569         i_pos = (DST_INTEGRATE__TRG0 - OP_AMP_NORTON_VBE) / info->r2;
570         if (i_pos < 0) i_pos = 0;
571         node->output[0] += (i_pos - i_neg) / discrete_current_context->sample_rate / info->c;
549572         break;
550573
551574      case DISC_INTEGRATE_OP_AMP_2 | DISC_OP_AMP_IS_NORTON:
552         trig0 = (int)DST_INTEGRATE__TRG0;
553         trig1 = (int)DST_INTEGRATE__TRG1;
554         iNeg = dst_trigger_function(trig0, trig1, 0, info->f0) ? context->vMaxInD / info->r1 : 0;
555         iPos =  dst_trigger_function(trig0, trig1, 0, info->f1) ? context->vMaxIn / info->r2 : 0;
556         iPos +=  dst_trigger_function(trig0, trig1, 0, info->f2) ? context->vMaxInD / info->r3 : 0;
557         node->output[0] += (iPos - iNeg) / discrete_current_context->sample_rate / info->c;
575         trig0  = (int)DST_INTEGRATE__TRG0;
576         trig1  = (int)DST_INTEGRATE__TRG1;
577         i_neg  = dst_trigger_function(trig0, trig1, 0, info->f0) ? context->v_max_in_d / info->r1 : 0;
578         i_pos  = dst_trigger_function(trig0, trig1, 0, info->f1) ? context->v_max_in / info->r2 : 0;
579         i_pos += dst_trigger_function(trig0, trig1, 0, info->f2) ? context->v_max_in_d / info->r3 : 0;
580         node->output[0] += (i_pos - i_neg) / discrete_current_context->sample_rate / info->c;
558581         break;
559582   }
560583
561584   /* Clip the output. */
562585   if (node->output[0] < 0) node->output[0] = 0;
563   if (node->output[0] > context->vMaxOut) node->output[0] = context->vMaxOut;
586   if (node->output[0] > context->v_max_out) node->output[0] = context->v_max_out;
564587}
565588
566589static void dst_integrate_reset(node_description *node)
r3115r3116
571594
572595   if (info->type & DISC_OP_AMP_IS_NORTON)
573596   {
574      context->vMaxOut = info->vP - OP_AMP_NORTON_VBE;
575      context->vMaxIn  = info->v1 - OP_AMP_NORTON_VBE;
576      context->vMaxInD = context->vMaxIn - OP_AMP_NORTON_VBE;
597      context->v_max_out  = info->vP - OP_AMP_NORTON_VBE;
598      context->v_max_in   = info->v1 - OP_AMP_NORTON_VBE;
599      context->v_max_in_d = context->v_max_in - OP_AMP_NORTON_VBE;
577600   }
578601   else
579602   {
580      context->vMaxOut =  info->vP - OP_AMP_VP_RAIL_OFFSET;
603      context->v_max_out =  info->vP - OP_AMP_VP_RAIL_OFFSET;
581604
582605      v = info->v1 * info->r3 / (info->r2 + info->r3);   /* vRef */
583606      v = info->v1 - v;   /* actual charging voltage */
r3115r3116
607630   }
608631   else
609632   {
610      node->output[0]=0.0;
633      node->output[0] = 0.0;
611634   }
612635}
613636
r3115r3116
632655{
633656   if(DST_LOGIC_AND__ENABLE)
634657   {
635      node->output[0]= (DST_LOGIC_AND__IN0 && DST_LOGIC_AND__IN1 && DST_LOGIC_AND__IN2 && DST_LOGIC_AND__IN3)? 1.0 : 0.0;
658      node->output[0] = (DST_LOGIC_AND__IN0 && DST_LOGIC_AND__IN1 && DST_LOGIC_AND__IN2 && DST_LOGIC_AND__IN3)? 1.0 : 0.0;
636659   }
637660   else
638661   {
639      node->output[0]=0.0;
662      node->output[0] = 0.0;
640663   }
641664}
642665
r3115r3116
665688   }
666689   else
667690   {
668      node->output[0]=0.0;
691      node->output[0] = 0.0;
669692   }
670693}
671694
r3115r3116
694717   }
695718   else
696719   {
697      node->output[0]=0.0;
720      node->output[0] = 0.0;
698721   }
699722}
700723
r3115r3116
723746   }
724747   else
725748   {
726      node->output[0]=0.0;
749      node->output[0] = 0.0;
727750   }
728751}
729752
r3115r3116
744767{
745768   if(DST_LOGIC_XOR__ENABLE)
746769   {
747      node->output[0]=((DST_LOGIC_XOR__IN0 && !DST_LOGIC_XOR__IN1) || (!DST_LOGIC_XOR__IN0 && DST_LOGIC_XOR__IN1)) ? 1.0 : 0.0;
770      node->output[0] = ((DST_LOGIC_XOR__IN0 && !DST_LOGIC_XOR__IN1) || (!DST_LOGIC_XOR__IN0 && DST_LOGIC_XOR__IN1)) ? 1.0 : 0.0;
748771   }
749772   else
750773   {
751      node->output[0]=0.0;
774      node->output[0] = 0.0;
752775   }
753776}
754777
r3115r3116
769792{
770793   if(DST_LOGIC_XNOR__ENABLE)
771794   {
772      node->output[0]=((DST_LOGIC_XNOR__IN0 && !DST_LOGIC_XNOR__IN1) || (!DST_LOGIC_XNOR__IN0 && DST_LOGIC_XNOR__IN1)) ? 0.0 : 1.0;
795      node->output[0] = ((DST_LOGIC_XNOR__IN0 && !DST_LOGIC_XNOR__IN1) || (!DST_LOGIC_XNOR__IN0 && DST_LOGIC_XNOR__IN1)) ? 0.0 : 1.0;
773796   }
774797   else
775798   {
776      node->output[0]=0.0;
799      node->output[0] = 0.0;
777800   }
778801}
779802
r3115r3116
798821static void dst_logic_dff_step(node_description *node)
799822{
800823   struct dst_flipflop_context *context = node->context;
824
801825   int clk = (int)DST_LOGIC_DFF__CLOCK;
802826
803827   if (DST_LOGIC_DFF__ENABLE)
r3115r3116
807831      else if (DST_LOGIC_DFF__SET)
808832         node->output[0] = 1;
809833      else if (!context->last_clk && clk)   /* low to high */
810      {
811834         node->output[0] = DST_LOGIC_DFF__DATA;
812      }
813835   }
814836   else
815837   {
r3115r3116
821843static void dst_logic_ff_reset(node_description *node)
822844{
823845   struct dst_flipflop_context *context = node->context;
846
824847   context->last_clk = 0;
825   node->output[0] = 0;
848   node->output[0]   = 0;
826849}
827850
828851
r3115r3116
848871static void dst_logic_jkff_step(node_description *node)
849872{
850873   struct dst_flipflop_context *context = node->context;
874
851875   int clk = (int)DST_LOGIC_JKFF__CLOCK;
852   int j = (int)DST_LOGIC_JKFF__J;
853   int k = (int)DST_LOGIC_JKFF__K;
876   int j   = (int)DST_LOGIC_JKFF__J;
877   int k   = (int)DST_LOGIC_JKFF__K;
854878
855879   if (DST_LOGIC_JKFF__ENABLE)
856880   {
r3115r3116
880904   }
881905   else
882906   {
883      node->output[0]=0;
907      node->output[0] = 0;
884908   }
885909   context->last_clk = clk;
886910}
r3115r3116
905929static void dst_lookup_table_step(node_description *node)
906930{
907931   const double *table = node->custom;
932
908933   int   addr = DST_LOOKUP_TABLE__IN;
909934
910935   if (!DST_LOOKUP_TABLE__ENABLE || addr < 0 || addr >= DST_LOOKUP_TABLE__SIZE)
r3115r3116
968993
969994static void dst_mixer_step(node_description *node)
970995{
971   const discrete_mixer_desc *info = node->custom;
972   struct dst_mixer_context *context = node->context;
996   const  discrete_mixer_desc *info    = node->custom;
997   struct dst_mixer_context   *context = node->context;
973998
974   double   v, vTemp, rTotal, rTemp, rTemp2 = 0;
975   double   i = 0;      // total current of inputs
976   int   bit, connected;
999   double   v, vTemp, r_total, rTemp, rTemp2 = 0;
1000   double   i = 0;      /* total current of inputs */
1001   int      bit, connected;
9771002
9781003   if (DST_MIXER__ENABLE)
9791004   {
980      rTotal = context->rTotal;
1005      r_total = context->r_total;
9811006
982      if (context->type & DISC_MIXER_HAS_R_NODE)
1007      if (context->has_r_node)
9831008      {
984         for(bit=0; bit < context->size; bit++)
1009         /* loop and do any high pass filtering for connected caps */
1010         /* but first see if there is an r_node for the current path */
1011         /* if so, then the exponents need to be re-calculated */
1012         for (bit = 0; bit < context->size; bit++)
9851013         {
986            rTemp = info->r[bit];
1014            rTemp     = info->r[bit];
9871015            connected = 1;
988            vTemp = DST_MIXER__IN(bit);
1016            vTemp     = DST_MIXER__IN(bit);
9891017
990            if (info->rNode[bit])
1018            if (context->r_node[bit] != NULL)
9911019            {
9921020               /* a node has the posibility of being disconnected from the circuit. */
993               if (*context->rNode[bit] == 0)
1021               if (*context->r_node[bit] == 0)
9941022                  connected = 0;
9951023               else
9961024               {
997                  rTemp += *context->rNode[bit];
998                  rTotal += 1.0 / rTemp;
1025                  rTemp   += *context->r_node[bit];
1026                  r_total += 1.0 / rTemp;
9991027                  if (info->c[bit] != 0)
10001028                  {
1001                     switch (context->type & DISC_MIXER_TYPE_MASK)
1029                     switch (context->type)
10021030                     {
10031031                        case DISC_MIXER_IS_RESISTOR:
10041032                           /* is there an rF? */
r3115r3116
10171045                     }
10181046                     /* Re-calculate exponent if resistor is a node */
10191047                     context->exponent_rc[bit] = -1.0 / (rTemp2 * info->c[bit]  * discrete_current_context->sample_rate);
1020                     context->exponent_rc[bit] = 1.0 - exp(context->exponent_rc[bit]);
1048                     context->exponent_rc[bit] = 1.0 - exp(context->exponent_rc[bit]);
10211049                  }
10221050               }
10231051            }
r3115r3116
10271055               if (info->c[bit] != 0)
10281056               {
10291057                  /* do input high pass filtering if needed. */
1030                  context->vCap[bit] += (vTemp - info->vRef - context->vCap[bit]) * context->exponent_rc[bit];
1031                  vTemp -= context->vCap[bit];
1058                  context->v_cap[bit] += (vTemp - info->vRef - context->v_cap[bit]) * context->exponent_rc[bit];
1059                  vTemp -= context->v_cap[bit];
10321060               }
1033               i += (((context->type & DISC_MIXER_TYPE_MASK) == DISC_MIXER_IS_OP_AMP) ? info->vRef - vTemp : vTemp) / rTemp;
1061               i += ((context->type == DISC_MIXER_IS_OP_AMP) ? info->vRef - vTemp : vTemp) / rTemp;
10341062            }
10351063         }
10361064      }
10371065      else
10381066      {
1067         /* no r_nodes, so just do high pass filtering */
10391068         for (bit = 0; bit < context->size; bit++)
10401069         {
10411070            rTemp = info->r[bit];
r3115r3116
10441073            if (info->c[bit] != 0)
10451074            {
10461075               /* do input high pass filtering if needed. */
1047               context->vCap[bit] += (vTemp - info->vRef - context->vCap[bit]) * context->exponent_rc[bit];
1048               vTemp -= context->vCap[bit];
1076               context->v_cap[bit] += (vTemp - info->vRef - context->v_cap[bit]) * context->exponent_rc[bit];
1077               vTemp -= context->v_cap[bit];
10491078            }
1050            i += (((context->type & DISC_MIXER_TYPE_MASK) == DISC_MIXER_IS_OP_AMP) ? info->vRef - vTemp : vTemp) / rTemp;
1079            i += ((context->type == DISC_MIXER_IS_OP_AMP) ? info->vRef - vTemp : vTemp) / rTemp;
10511080         }
10521081      }
10531082
1054      if ((context->type & DISC_MIXER_TYPE_MASK) == DISC_MIXER_IS_OP_AMP_WITH_RI)
1083      if (context->type == DISC_MIXER_IS_OP_AMP_WITH_RI)
10551084         i += info->vRef / info->rI;
10561085
1057      rTotal = 1.0 / rTotal;
1086      r_total = 1.0 / r_total;
10581087
10591088      /* If resistor network or has rI then Millman is used.
10601089         * If op-amp then summing formula is used. */
1061      v = i * (((context->type & DISC_MIXER_TYPE_MASK) == DISC_MIXER_IS_OP_AMP) ? info->rF : rTotal);
1090      v = i * ((context->type == DISC_MIXER_IS_OP_AMP) ? info->rF : r_total);
10621091
1063      if ((context->type & DISC_MIXER_TYPE_MASK) == DISC_MIXER_IS_OP_AMP_WITH_RI)
1092      if (context->type == DISC_MIXER_IS_OP_AMP_WITH_RI)
10641093         v = info->vRef + (context->gain * (info->vRef - v));
10651094
10661095      /* Do the low pass filtering for cF */
10671096      if (info->cF != 0)
10681097      {
1069         if (context->type & DISC_MIXER_HAS_R_NODE)
1098         if (context->has_r_node)
10701099         {
10711100            /* Re-calculate exponent if resistor nodes are used */
1072            context->exponent_cF = -1.0 / (rTotal * info->cF  * discrete_current_context->sample_rate);
1073            context->exponent_cF = 1.0 - exp(context->exponent_cF);
1101            context->exponent_c_f = -1.0 / (r_total * info->cF  * discrete_current_context->sample_rate);
1102            context->exponent_c_f =  1.0 - exp(context->exponent_c_f);
10741103         }
1075         context->vCapF += (v -info->vRef - context->vCapF) * context->exponent_cF;
1076         v = context->vCapF;
1104         context->v_cap_f += (v -info->vRef - context->v_cap_f) * context->exponent_c_f;
1105         v = context->v_cap_f;
10771106      }
10781107
10791108      /* Do the high pass filtering for cAmp */
10801109      if (info->cAmp != 0)
10811110      {
1082         context->vCapAmp += (v - context->vCapAmp) * context->exponent_cAmp;
1083         v -= context->vCapAmp;
1111         context->v_cap_amp += (v - context->v_cap_amp) * context->exponent_c_amp;
1112         v -= context->v_cap_amp;
10841113      }
10851114      node->output[0] = v * info->gain;
10861115   }
r3115r3116
10921121
10931122static void dst_mixer_reset(node_description *node)
10941123{
1095   const discrete_mixer_desc *info = node->custom;
1096   struct dst_mixer_context *context = node->context;
1124   const  discrete_mixer_desc *info    = node->custom;
1125   struct dst_mixer_context   *context = node->context;
10971126   node_description *r_node;
10981127
1099   int   bit;
1128   int      bit;
11001129   double   rTemp = 0;
11011130
1102   /* link to rNode outputs */
1103   for (bit = 0; bit < 8; bit ++)
1131   /* link to r_node outputs */
1132   context->has_r_node = 0;
1133   for (bit = 0; bit < 8; bit++)
11041134   {
1105      r_node = discrete_find_node(NULL, info->rNode[bit]);
1135      r_node = discrete_find_node(NULL, info->r_node[bit]);
11061136      if (r_node)
1107         context->rNode[bit] = &(r_node->output[NODE_CHILD_NODE_NUM(info->rNode[bit])]);
1137      {
1138         context->r_node[bit] = &(r_node->output[NODE_CHILD_NODE_NUM(info->r_node[bit])]);
1139         context->has_r_node = 1;
1140      }
11081141      else
1109         context->rNode[bit] = NULL;
1142         context->r_node[bit] = NULL;
11101143   }
11111144
11121145   context->size = node->active_inputs - 1;
r3115r3116
11171150     * then you deserve a crash.
11181151     */
11191152
1120   context->type = ((info->type == DISC_MIXER_IS_OP_AMP) && info->rI) ? DISC_MIXER_IS_OP_AMP_WITH_RI : info->type;
1153   context->type = info->type;
1154   if ((info->type == DISC_MIXER_IS_OP_AMP) && (info->rI != 0))
1155      context->type = DISC_MIXER_IS_OP_AMP_WITH_RI;
11211156
11221157   /*
11231158     * Calculate the total of all resistors in parallel.
11241159     * This is the combined resistance of the voltage sources.
11251160     * Also calculate the exponents while we are here.
11261161     */
1127   context->rTotal = 0;
1128   for(bit=0; bit < context->size; bit++)
1162   context->r_total = 0;
1163   for(bit = 0; bit < context->size; bit++)
11291164   {
1130      if (info->rNode[bit])
1131         context->type = context->type | DISC_MIXER_HAS_R_NODE;
1132
1133      if ((info->r[bit] != 0) && !info->rNode[bit] )
1165      if ((info->r[bit] != 0) && !info->r_node[bit] )
11341166      {
1135         context->rTotal += 1.0 / info->r[bit];
1167         context->r_total += 1.0 / info->r[bit];
11361168      }
11371169
1138      context->vCap[bit] = 0;
1170      context->v_cap[bit]      = 0;
11391171      context->exponent_rc[bit] = 0;
1140      if ((info->c[bit] != 0)  && !info->rNode[bit])
1172      if ((info->c[bit] != 0)  && !info->r_node[bit])
11411173      {
11421174         switch (context->type)
11431175         {
r3115r3116
11581190         }
11591191         /* Setup filter constants */
11601192         context->exponent_rc[bit] = -1.0 / (rTemp * info->c[bit]  * discrete_current_context->sample_rate);
1161         context->exponent_rc[bit] = 1.0 - exp(context->exponent_rc[bit]);
1193         context->exponent_rc[bit] = 1.0 - exp(context->exponent_rc[bit]);
11621194      }
11631195   }
11641196
11651197   if (info->rF != 0)
11661198   {
1167      if (info->type == DISC_MIXER_IS_RESISTOR) context->rTotal += 1.0 / info->rF;
1199      if (context->type == DISC_MIXER_IS_RESISTOR) context->r_total += 1.0 / info->rF;
11681200   }
1169   if (context->type == DISC_MIXER_IS_OP_AMP_WITH_RI) context->rTotal += 1.0 / info->rI;
1201   if (context->type == DISC_MIXER_IS_OP_AMP_WITH_RI) context->r_total += 1.0 / info->rI;
11701202
1171   context->vCapF = 0;
1172   context->exponent_cF = 0;
1203   context->v_cap_f      = 0;
1204   context->exponent_c_f = 0;
11731205   if (info->cF != 0)
11741206   {
11751207      /* Setup filter constants */
1176      context->exponent_cF = -1.0 / (((info->type == DISC_MIXER_IS_OP_AMP) ? info->rF : (1.0 / context->rTotal))* info->cF  * discrete_current_context->sample_rate);
1177      context->exponent_cF = 1.0 - exp(context->exponent_cF);
1208      context->exponent_c_f = -1.0 / (((info->type == DISC_MIXER_IS_OP_AMP) ? info->rF : (1.0 / context->r_total))* info->cF  * discrete_current_context->sample_rate);
1209      context->exponent_c_f =  1.0 - exp(context->exponent_c_f);
11781210   }
11791211
1180   context->vCapAmp = 0;
1181   context->exponent_cAmp = 0;
1212   context->v_cap_amp      = 0;
1213   context->exponent_c_amp = 0;
11821214   if (info->cAmp != 0)
11831215   {
11841216      /* Setup filter constants */
11851217      /* We will use 100000 ohms as an average final stage impedance. */
11861218      /* Your amp/speaker system will have more effect on incorrect filtering then any value used here. */
1187      context->exponent_cAmp = -1.0 / (100000 * info->cAmp  * discrete_current_context->sample_rate);
1188      context->exponent_cAmp = 1.0 - exp(context->exponent_cAmp);
1219      context->exponent_c_amp = -1.0 / (100000 * info->cAmp  * discrete_current_context->sample_rate);
1220      context->exponent_c_amp =  1.0 - exp(context->exponent_c_amp);
11891221   }
11901222
1191   if ((context->type & DISC_MIXER_TYPE_MASK) == DISC_MIXER_IS_OP_AMP_WITH_RI) context->gain = info->rF / info->rI;
1223   if (context->type == DISC_MIXER_IS_OP_AMP_WITH_RI) context->gain = info->rF / info->rI;
11921224
11931225   node->output[0] = 0;
11941226}
r3115r3116
12131245static void dst_multiplex_step(node_description *node)
12141246{
12151247   struct dst_size_context *context = node->context;
1248
12161249   int addr;
12171250
12181251   if(DST_MULTIPLEX__ENABLE)
12191252   {
1220      addr = DST_MULTIPLEX__ADDR;   // FP to INT
1253      addr = DST_MULTIPLEX__ADDR;   /* FP to INT */
12211254      if ((addr >= 0) && (addr < context->size))
12221255      {
12231256         node->output[0] = DST_MULTIPLEX__INP(addr);
r3115r3116
12251258      else
12261259      {
12271260         /* Bad address.  We will leave the output alone. */
1228         discrete_log("NODE_%02d - Address = %d. Out of bounds\n",node->node-NODE_00, addr);
1261         discrete_log("NODE_%02d - Address = %d. Out of bounds\n", node->node-NODE_00, addr);
12291262      }
12301263   }
12311264   else
12321265   {
1233      node->output[0]=0;
1266      node->output[0] = 0;
12341267   }
12351268}
12361269
r3115r3116
12651298static void dst_oneshot_step(node_description *node)
12661299{
12671300   struct dst_oneshot_context *context = node->context;
1301
12681302   int trigger = (DST_ONESHOT__TRIG != 0);
12691303
12701304   /* If the state is triggered we will need to countdown later */
1271   int doCount = context->state;
1305   int do_count = context->state;
12721306
12731307   if (DST_ONESHOT__RESET)
12741308   {
12751309      /* Hold in Reset */
12761310      node->output[0] = 0;
1277      context->state = 0;
1311      context->state = 0;
12781312   }
12791313   else
12801314   {
12811315      /* are we at an edge? */
1282      if (trigger != context->lastTrig)
1316      if (trigger != context->last_trig)
12831317      {
12841318         /* There has been a trigger edge */
1285         context->lastTrig = trigger;
1319         context->last_trig = trigger;
12861320
12871321         /* Is it the proper edge trigger */
12881322         if ((DST_ONESHOT__TYPE & DISC_ONESHOT_REDGE) ? trigger : !trigger)
r3115r3116
12901324            if (!context->state)
12911325            {
12921326               /* We have first trigger */
1293               context->state = 1;
1294               node->output[0] = (DST_ONESHOT__TYPE & DISC_OUT_ACTIVE_LOW) ? 0 : DST_ONESHOT__AMP;
1327               context->state     = 1;
1328               node->output[0]    = (DST_ONESHOT__TYPE & DISC_OUT_ACTIVE_LOW) ? 0 : DST_ONESHOT__AMP;
12951329               context->countdown = DST_ONESHOT__WIDTH;
12961330            }
12971331            else
r3115r3116
13011335               {
13021336                  /* Retrigger */
13031337                  context->countdown = DST_ONESHOT__WIDTH;
1304                  doCount = 0;
1338                  do_count = 0;
13051339               }
13061340            }
13071341         }
13081342      }
13091343
1310      if (doCount)
1344      if (do_count)
13111345      {
13121346         context->countdown -= discrete_current_context->sample_time;
13131347         if(context->countdown <= 0.0)
13141348         {
1315            node->output[0] = (DST_ONESHOT__TYPE & DISC_OUT_ACTIVE_LOW) ? DST_ONESHOT__AMP : 0;
1349            node->output[0]    = (DST_ONESHOT__TYPE & DISC_OUT_ACTIVE_LOW) ? DST_ONESHOT__AMP : 0;
13161350            context->countdown = 0;
1317            context->state = 0;
1351            context->state     = 0;
13181352         }
13191353      }
13201354   }
r3115r3116
13241358static void dst_oneshot_reset(node_description *node)
13251359{
13261360   struct dst_oneshot_context *context = node->context;
1361
13271362   context->countdown = 0;
1328   context->state = 0;
1363   context->state     = 0;
13291364
1330    context->lastTrig = 0;
1365    context->last_trig = 0;
13311366    node->output[0] = (DST_ONESHOT__TYPE & DISC_OUT_ACTIVE_LOW) ? DST_ONESHOT__AMP : 0;
13321367}
13331368
r3115r3116
13601395      if (!context->last_en)
13611396      {
13621397         context->last_en = 1;
1363         node->output[0] = DST_RAMP__START;
1398         node->output[0] = DST_RAMP__START;
13641399      }
13651400      if(context->dir ? DST_RAMP__DIR : !DST_RAMP__DIR) node->output[0]+=context->step;
1366      else node->output[0]-=context->step;
1401      else node->output[0] -= context->step;
13671402      /* Clamp to min/max */
13681403      if(context->dir ? (node->output[0] < DST_RAMP__START)
1369            : (node->output[0] > DST_RAMP__START)) node->output[0]=DST_RAMP__START;
1404            : (node->output[0] > DST_RAMP__START)) node->output[0] = DST_RAMP__START;
13701405      if(context->dir ? (node->output[0] > DST_RAMP__END)
1371            : (node->output[0] < DST_RAMP__END)) node->output[0]=DST_RAMP__END;
1406            : (node->output[0] < DST_RAMP__END)) node->output[0] = DST_RAMP__END;
13721407   }
13731408   else
13741409   {
13751410      context->last_en = 0;
1376      // Disabled so clamp to output
1377      node->output[0]=DST_RAMP__CLAMP;
1411      /* Disabled so clamp to output */
1412      node->output[0] = DST_RAMP__CLAMP;
13781413   }
13791414}
13801415
r3115r3116
13821417{
13831418   struct dss_ramp_context *context = node->context;
13841419
1385   node->output[0]=DST_RAMP__CLAMP;
1386   context->step = DST_RAMP__GRAD / discrete_current_context->sample_rate;
1387   context->dir = ((DST_RAMP__END - DST_RAMP__START) == abs(DST_RAMP__END - DST_RAMP__START));
1420   node->output[0]  = DST_RAMP__CLAMP;
1421   context->step    = DST_RAMP__GRAD / discrete_current_context->sample_rate;
1422   context->dir     = ((DST_RAMP__END - DST_RAMP__START) == abs(DST_RAMP__END - DST_RAMP__START));
13881423   context->last_en = 0;
13891424}
13901425
r3115r3116
14141449      {
14151450         case DISC_SAMPHOLD_REDGE:
14161451            /* Clock the whole time the input is rising */
1417            if(DST_SAMPHOLD__CLOCK > context->lastinput) node->output[0]=DST_SAMPHOLD__IN0;
1452            if (DST_SAMPHOLD__CLOCK > context->last_input) node->output[0] = DST_SAMPHOLD__IN0;
14181453            break;
14191454         case DISC_SAMPHOLD_FEDGE:
14201455            /* Clock the whole time the input is falling */
1421            if(DST_SAMPHOLD__CLOCK < context->lastinput) node->output[0]=DST_SAMPHOLD__IN0;
1456            if(DST_SAMPHOLD__CLOCK < context->last_input) node->output[0] = DST_SAMPHOLD__IN0;
14221457            break;
14231458         case DISC_SAMPHOLD_HLATCH:
14241459            /* Output follows input if clock != 0 */
1425            if(DST_SAMPHOLD__CLOCK) node->output[0]=DST_SAMPHOLD__IN0;
1460            if( DST_SAMPHOLD__CLOCK) node->output[0] = DST_SAMPHOLD__IN0;
14261461            break;
14271462         case DISC_SAMPHOLD_LLATCH:
14281463            /* Output follows input if clock == 0 */
1429            if(DST_SAMPHOLD__CLOCK==0) node->output[0]=DST_SAMPHOLD__IN0;
1464            if (DST_SAMPHOLD__CLOCK == 0) node->output[0] = DST_SAMPHOLD__IN0;
14301465            break;
14311466         default:
14321467            discrete_log("dst_samphold_step - Invalid clocktype passed");
r3115r3116
14351470   }
14361471   else
14371472   {
1438      node->output[0]=0;
1473      node->output[0] = 0;
14391474   }
14401475   /* Save the last value */
1441   context->lastinput=DST_SAMPHOLD__CLOCK;
1476   context->last_input = DST_SAMPHOLD__CLOCK;
14421477}
14431478
14441479static void dst_samphold_reset(node_description *node)
14451480{
14461481   struct dst_samphold_context *context = node->context;
14471482
1448   node->output[0]=0;
1449   context->lastinput=-1;
1483   node->output[0]     =  0;
1484   context->last_input = -1;
14501485   /* Only stored in here to speed up and save casting in the step function */
1451   context->clocktype=(int)DST_SAMPHOLD__TYPE;
1486   context->clocktype = (int)DST_SAMPHOLD__TYPE;
14521487   dst_samphold_step(node);
14531488}
14541489
r3115r3116
14721507{
14731508   if(DSS_SWITCH__ENABLE)
14741509   {
1475      node->output[0]=DSS_SWITCH__SWITCH ? DSS_SWITCH__IN1 : DSS_SWITCH__IN0;
1510      node->output[0] = DSS_SWITCH__SWITCH ? DSS_SWITCH__IN1 : DSS_SWITCH__IN0;
14761511   }
14771512   else
14781513   {
1479      node->output[0]=0;
1514      node->output[0] = 0;
14801515   }
14811516}
14821517
r3115r3116
15001535{
15011536   if(DSS_SWITCH__ENABLE)
15021537   {
1503      node->output[0]=DSS_ASWITCH__CTRL > DSS_ASWITCH__THRESHOLD ? DSS_ASWITCH__IN : 0;
1538      node->output[0] = DSS_ASWITCH__CTRL > DSS_ASWITCH__THRESHOLD ? DSS_ASWITCH__IN : 0;
15041539   }
15051540   else
15061541   {
1507      node->output[0]=0;
1542      node->output[0] = 0;
15081543   }
15091544}
15101545
r3115r3116
15291564
15301565#define MAX_TRANS_STACK   16
15311566
1532INLINE double dst_transform_pop(double *stack,int *pointer)
1567INLINE double dst_transform_pop(double *stack, int *pointer)
15331568{
15341569   //decrement THEN read
15351570   assert(*pointer > 0);
r3115r3116
15371572   return stack[*pointer];
15381573}
15391574
1540INLINE void dst_transform_push(double *stack,int *pointer,double value)
1575INLINE void dst_transform_push(double *stack, int *pointer, double value)
15411576{
15421577   //Store THEN increment
15431578   assert(*pointer < MAX_TRANS_STACK);
1544   stack[(*pointer)++]=value;
1579   stack[(*pointer)++] = value;
15451580}
15461581
15471582static void dst_transform_step(node_description *node)
15481583{
15491584   if(DST_TRANSFORM__ENABLE)
15501585   {
1551      double trans_stack[MAX_TRANS_STACK];
1552      double number1,top;
1553      int   trans_stack_ptr=0;
1586      double   trans_stack[MAX_TRANS_STACK];
1587      double   number1,top;
1588      int      trans_stack_ptr = 0;
15541589
15551590      const char *fPTR = node->custom;
1556      node->output[0]=0;
1591      node->output[0]  = 0;
15571592
15581593      top = HUGE_VAL;
15591594
1560      while(*fPTR!=0)
1595      while(*fPTR != 0)
15611596      {
15621597         switch (*fPTR++)
15631598         {
15641599            case '*':
1565               number1 = dst_transform_pop(trans_stack,&trans_stack_ptr);
1600               number1 = dst_transform_pop(trans_stack, &trans_stack_ptr);
15661601               top = number1 * top;
15671602               break;
15681603            case '/':
1569               number1 = dst_transform_pop(trans_stack,&trans_stack_ptr);
1604               number1 = dst_transform_pop(trans_stack, &trans_stack_ptr);
15701605               top = number1 / top;
15711606               break;
15721607            case '+':
1573               number1=dst_transform_pop(trans_stack,&trans_stack_ptr);
1608               number1=dst_transform_pop(trans_stack, &trans_stack_ptr);
15741609               top = number1 + top;
15751610               break;
15761611            case '-':
1577               number1 = dst_transform_pop(trans_stack,&trans_stack_ptr);
1612               number1 = dst_transform_pop(trans_stack, &trans_stack_ptr);
15781613               top = number1 - top;
15791614               break;
15801615            case '0':
1581               dst_transform_push(trans_stack,&trans_stack_ptr, top);
1616               dst_transform_push(trans_stack, &trans_stack_ptr, top);
15821617               top = DST_TRANSFORM__IN0;
15831618               break;
15841619            case '1':
1585               dst_transform_push(trans_stack,&trans_stack_ptr, top);
1620               dst_transform_push(trans_stack, &trans_stack_ptr, top);
15861621               top = DST_TRANSFORM__IN1;
15871622               break;
15881623            case '2':
1589               dst_transform_push(trans_stack,&trans_stack_ptr, top);
1624               dst_transform_push(trans_stack, &trans_stack_ptr, top);
15901625               top = DST_TRANSFORM__IN2;
15911626               break;
15921627            case '3':
1593               dst_transform_push(trans_stack,&trans_stack_ptr, top);
1628               dst_transform_push(trans_stack, &trans_stack_ptr, top);
15941629               top = DST_TRANSFORM__IN3;
15951630               break;
15961631            case '4':
1597               dst_transform_push(trans_stack,&trans_stack_ptr, top);
1632               dst_transform_push(trans_stack, &trans_stack_ptr, top);
15981633               top = DST_TRANSFORM__IN4;
15991634               break;
16001635            case 'P':
1601               dst_transform_push(trans_stack,&trans_stack_ptr, top);
1636               dst_transform_push(trans_stack, &trans_stack_ptr, top);
16021637               break;
1603            case 'i':   // * -1
1638            case 'i':   /* * -1 */
16041639               top = -top;
16051640               break;
1606            case '!':   // Logical NOT of Last Value
1641            case '!':   /* Logical NOT of Last Value */
16071642               top = !top;
16081643               break;
1609            case '=':   // Logical =
1610               number1 = dst_transform_pop(trans_stack,&trans_stack_ptr);
1644            case '=':   /* Logical = */
1645               number1 = dst_transform_pop(trans_stack, &trans_stack_ptr);
16111646               top = (int)number1 == (int)top;
16121647               break;
1613            case '>':   // Logical >
1614               number1 = dst_transform_pop(trans_stack,&trans_stack_ptr);
1648            case '>':   /* Logical > */
1649               number1 = dst_transform_pop(trans_stack, &trans_stack_ptr);
16151650               top = number1 > top;
16161651               break;
1617            case '<':   // Logical <
1618               number1 = dst_transform_pop(trans_stack,&trans_stack_ptr);
1652            case '<':   /* Logical < */
1653               number1 = dst_transform_pop(trans_stack, &trans_stack_ptr);
16191654               top = number1 < top;
16201655               break;
1621            case '&':   // Bitwise AND
1622               number1 = dst_transform_pop(trans_stack,&trans_stack_ptr);
1656            case '&':   /* Bitwise AND */
1657               number1 = dst_transform_pop(trans_stack, &trans_stack_ptr);
16231658               top = (int)number1 & (int)top;
16241659               break;
1625            case '|':   // Bitwise OR
1626               number1 = dst_transform_pop(trans_stack,&trans_stack_ptr);
1660            case '|':   /* Bitwise OR */
1661               number1 = dst_transform_pop(trans_stack, &trans_stack_ptr);
16271662               top = (int)number1 | (int)top;
16281663               break;
1629            case '^':   // Bitwise XOR
1630               number1 = dst_transform_pop(trans_stack,&trans_stack_ptr);
1664            case '^':   /* Bitwise XOR */
1665               number1 = dst_transform_pop(trans_stack, &trans_stack_ptr);
16311666               top = (int)number1 ^ (int)top;
16321667               break;
16331668            default:
r3115r3116
16401675   }
16411676   else
16421677   {
1643      node->output[0]=0;
1678      node->output[0] = 0;
16441679   }
16451680}
16461681
r3115r3116
16631698
16641699static void dst_op_amp_step(node_description *node)
16651700{
1666   const discrete_op_amp_info *info = node->custom;
1667   struct dst_op_amp_context *context = node->context;
1701   const  discrete_op_amp_info *info    = node->custom;
1702   struct dst_op_amp_context   *context = node->context;
16681703
1669   double iPos = 0;
1670   double iNeg = 0;
1671   double i = 0;
1704   double i_pos = 0;
1705   double i_neg = 0;
1706   double i    = 0;
16721707
16731708   if (DST_OP_AMP__ENABLE)
16741709   {
r3115r3116
16781713            /* work out neg pin current */
16791714            if  (context->has_r1)
16801715            {
1681               iNeg = (DST_OP_AMP__INP0 - OP_AMP_NORTON_VBE) / info->r1;
1682               if (iNeg < 0) iNeg = 0;
1716               i_neg = (DST_OP_AMP__INP0 - OP_AMP_NORTON_VBE) / info->r1;
1717               if (i_neg < 0) i_neg = 0;
16831718            }
1684            iNeg += context->iFixed;
1719            i_neg += context->i_fixed;
16851720
16861721            /* work out neg pin current */
1687            iPos = (DST_OP_AMP__INP1 - OP_AMP_NORTON_VBE) / info->r2;
1688            if (iPos < 0) iPos = 0;
1722            i_pos = (DST_OP_AMP__INP1 - OP_AMP_NORTON_VBE) / info->r2;
1723            if (i_pos < 0) i_pos = 0;
16891724
16901725            /* work out current across r4 */
1691            i = iPos - iNeg;
1726            i = i_pos - i_neg;
16921727
16931728            if (context->has_cap)
16941729            {
r3115r3116
16971732                  /* voltage across r4 charging cap */
16981733                  i *= info->r4;
16991734                  /* exponential charge */
1700                  context->vCap += (i - context->vCap) * context->exponent;
1735                  context->v_cap += (i - context->v_cap) * context->exponent;
17011736               }
17021737               else
17031738                  /* linear charge */
1704                  context->vCap += i / context->exponent;
1705               node->output[0] = context->vCap;
1739                  context->v_cap += i / context->exponent;
1740               node->output[0] = context->v_cap;
17061741            }
17071742            else
17081743               node->output[0] = i * info->r4;
17091744
17101745            /* clamp output */
1711            if (node->output[0] > context->vMax) node->output[0] = context->vMax;
1746            if (node->output[0] > context->v_max) node->output[0] = context->v_max;
17121747            else if (node->output[0] < info->vN) node->output[0] = info->vN;
1713            context->vCap = node->output[0];
1748            context->v_cap = node->output[0];
17141749            break;
17151750
17161751         default:
r3115r3116
17291764   context->has_r1 = info->r1 > 0;
17301765   context->has_r4 = info->r4 > 0;
17311766
1732   context->vMax = info->vP - OP_AMP_NORTON_VBE;
1767   context->v_max = info->vP - OP_AMP_NORTON_VBE;
17331768
1734   context->vCap = 0;
1769   context->v_cap = 0;
17351770   if (info->c > 0)
17361771   {
17371772      context->has_cap = 1;
r3115r3116
17401775      {
17411776         /* exponential charge */
17421777         context->exponent = -1.0 / (info->r4 * info->c  * discrete_current_context->sample_rate);
1743         context->exponent = 1.0 - exp(context->exponent);
1778         context->exponent = 1.0 - exp(context->exponent);
17441779      }
17451780      else
17461781         /* linear charge */
r3115r3116
17481783   }
17491784
17501785   if (info->r3 >= 0)
1751      context->iFixed = (info->vP - OP_AMP_NORTON_VBE) / info->r3;
1786      context->i_fixed = (info->vP - OP_AMP_NORTON_VBE) / info->r3;
17521787}
17531788
17541789
r3115r3116
17661801
17671802static void dst_op_amp_1sht_step(node_description *node)
17681803{
1769   const discrete_op_amp_1sht_info *info = node->custom;
1770   struct dst_op_amp_1sht_context *context = node->context;
1804   const  discrete_op_amp_1sht_info *info    = node->custom;
1805   struct dst_op_amp_1sht_context   *context = node->context;
17711806
1772   double iPos;
1773   double iNeg;
1807   double i_pos;
1808   double i_neg;
17741809   double v;
17751810
17761811   /* update trigger circuit */
1777   iPos = (DST_OP_AMP_1SHT__TRIGGER - context->vCap2) / info->r2;
1778   iPos += node->output[0] / info->r5;
1779   context->vCap2 += (DST_OP_AMP_1SHT__TRIGGER - context->vCap2) * context->exponent2;
1812   i_pos  = (DST_OP_AMP_1SHT__TRIGGER - context->v_cap2) / info->r2;
1813   i_pos += node->output[0] / info->r5;
1814   context->v_cap2 += (DST_OP_AMP_1SHT__TRIGGER - context->v_cap2) * context->exponent2;
17801815
17811816   /* calculate currents and output */
1782   iNeg = (context->vCap1 - OP_AMP_NORTON_VBE) / info->r3;
1783   if (iNeg < 0) iNeg = 0;
1784   iNeg += context->iFixed;
1817   i_neg = (context->v_cap1 - OP_AMP_NORTON_VBE) / info->r3;
1818   if (i_neg < 0) i_neg = 0;
1819   i_neg += context->i_fixed;
17851820
1786   if (iPos > iNeg) node->output[0] = context->vMax;
1821   if (i_pos > i_neg) node->output[0] = context->v_max;
17871822   else node->output[0] = info->vN;
17881823
17891824   /* update c1 */
17901825   /* rough value of voltage at anode of diode if discharging */
17911826   v = node->output[0] + 0.6;
1792   if (context->vCap1 > node->output[0])
1827   if (context->v_cap1 > node->output[0])
17931828   {
17941829      /* discharge */
1795      if (context->vCap1 > v)
1830      if (context->v_cap1 > v)
17961831         /* immediate discharge through diode */
1797         context->vCap1 = v;
1832         context->v_cap1 = v;
17981833      else
17991834         /* discharge through r4 */
1800         context->vCap1 += (node->output[0] - context->vCap1) * context->exponent1d;
1835         context->v_cap1 += (node->output[0] - context->v_cap1) * context->exponent1d;
18011836   }
18021837   else
18031838      /* charge */
1804      context->vCap1 += ((node->output[0] - OP_AMP_NORTON_VBE) * context->r34ratio + OP_AMP_NORTON_VBE - context->vCap1) * context->exponent1c;
1839      context->v_cap1 += ((node->output[0] - OP_AMP_NORTON_VBE) * context->r34ratio + OP_AMP_NORTON_VBE - context->v_cap1) * context->exponent1c;
18051840}
18061841
18071842static void dst_op_amp_1sht_reset(node_description *node)
18081843{
1809   const discrete_op_amp_1sht_info *info = node->custom;
1810   struct dst_op_amp_1sht_context *context = node->context;
1844   const  discrete_op_amp_1sht_info *info    = node->custom;
1845   struct dst_op_amp_1sht_context   *context = node->context;
18111846
18121847   context->exponent1c = -1.0 / ((1.0 / (1.0 / info->r3 + 1.0 / info->r4)) * info->c1  * discrete_current_context->sample_rate);
1813   context->exponent1c = 1.0 - exp(context->exponent1c);
1848   context->exponent1c = 1.0 - exp(context->exponent1c);
18141849   context->exponent1d = -1.0 / (info->r4 * info->c1  * discrete_current_context->sample_rate);
1815   context->exponent1d = 1.0 - exp(context->exponent1d);
1816   context->exponent2 = -1.0 / (info->r2 * info->c2  * discrete_current_context->sample_rate);
1817   context->exponent2 = 1.0 - exp(context->exponent2);
1818   context->iFixed = (info->vP - OP_AMP_NORTON_VBE) / info->r1;
1819   context->vCap1 = context->vCap2 = 0;
1820   context->vMax = info->vP - OP_AMP_NORTON_VBE;
1850   context->exponent1d =  1.0 - exp(context->exponent1d);
1851   context->exponent2  = -1.0 / (info->r2 * info->c2  * discrete_current_context->sample_rate);
1852   context->exponent2  =  1.0 - exp(context->exponent2);
1853   context->i_fixed  = (info->vP - OP_AMP_NORTON_VBE) / info->r1;
1854   context->v_cap1   = context->v_cap2 = 0;
1855   context->v_max    = info->vP - OP_AMP_NORTON_VBE;
18211856   context->r34ratio = info->r3 / (info->r3 + info->r4);
18221857}
18231858
r3115r3116
18441879
18451880static void dst_tvca_op_amp_step(node_description *node)
18461881{
1847   const discrete_op_amp_tvca_info *info = node->custom;
1848   struct dst_tvca_op_amp_context *context = node->context;
1882   const  discrete_op_amp_tvca_info *info    = node->custom;
1883   struct dst_tvca_op_amp_context   *context = node->context;
18491884
18501885   int      trig0, trig1, trig2, f3;
1851   double   i2 = 0;      // current through r2
1852   double   i3 = 0;      // current through r3
1853   double   iNeg = 0;   // current into - input
1854   double   iPos = 0;   // current into + input
1855   double   iOut = 0;   // current at output
1886   double   i2 = 0;      /* current through r2 */
1887   double   i3 = 0;      /* current through r3 */
1888   double   i_neg = 0;   /* current into - input */
1889   double   i_pos = 0;   /* current into + input */
1890   double   i_out = 0;   /* current at output */
18561891
18571892   trig0 = (int)DST_TVCA_OP_AMP__TRG0;
18581893   trig1 = (int)DST_TVCA_OP_AMP__TRG1;
r3115r3116
18751910      }
18761911
18771912   /* Calculate current going in to - input. */
1878   iNeg = context->iFixed + i2 + i3;
1913   i_neg = context->i_fixed + i2 + i3;
18791914
18801915   /* Update the c1 cap voltage. */
18811916   if (dst_trigger_function(trig0, trig1, trig2, info->f2))
18821917   {
18831918      /* F2 is not grounding the circuit so we charge the cap. */
1884      context->vCap1 += (context->vTrig[f3] - context->vCap1) * context->exponentC[f3];
1919      context->v_cap1 += (context->v_trig[f3] - context->v_cap1) * context->exponent_c[f3];
18851920   }
18861921   else
18871922   {
r3115r3116
18891924         * So now the discharge rate is dependent upon F3.
18901925         * If F3 is at ground then we discharge to 0V through r6.
18911926         * If F3 is out of circuit then we discharge to OP_AMP_NORTON_VBE through r6+r7. */
1892       context->vCap1 += ((f3 ? OP_AMP_NORTON_VBE : 0.0) - context->vCap1) * context->exponentD[f3];
1927       context->v_cap1 += ((f3 ? OP_AMP_NORTON_VBE : 0.0) - context->v_cap1) * context->exponent_d[f3];
18931928   }
18941929
18951930   /* Calculate c1 current going in to + input. */
1896   iPos = (context->vCap1 - OP_AMP_NORTON_VBE) / context->r67;
1897   if ((iPos < 0) || !f3) iPos = 0;
1931   i_pos = (context->v_cap1 - OP_AMP_NORTON_VBE) / context->r67;
1932   if ((i_pos < 0) || !f3) i_pos = 0;
18981933
18991934   /* Update the c2 cap voltage and current. */
19001935   if (info->r9 != 0)
19011936   {
19021937      f3 = dst_trigger_function(trig0, trig1, trig2, info->f4);
1903      context->vCap2 += ((f3 ? context->vTrig2 : 0) - context->vCap2) * context->exponent2[f3];
1904      iPos += context->vCap2 / info->r9;
1938      context->v_cap2 += ((f3 ? context->v_trig2 : 0) - context->v_cap2) * context->exponent2[f3];
1939      i_pos += context->v_cap2 / info->r9;
19051940   }
19061941
19071942   /* Update the c3 cap voltage and current. */
19081943   if (info->r11 != 0)
19091944   {
19101945      f3 = dst_trigger_function(trig0, trig1, trig2, info->f5);
1911      context->vCap3 += ((f3 ? context->vTrig3 : 0) - context->vCap3) * context->exponent3[f3];
1912      iPos += context->vCap3 / info->r11;
1946      context->v_cap3 += ((f3 ? context->v_trig3 : 0) - context->v_cap3) * context->exponent3[f3];
1947      i_pos += context->v_cap3 / info->r11;
19131948   }
19141949
19151950
19161951   /* Calculate output current. */
1917   iOut = iPos - iNeg;
1918   if (iOut < 0) iOut = 0;
1952   i_out = i_pos - i_neg;
1953   if (i_out < 0) i_out = 0;
19191954   /* Convert to voltage for final output. */
1920   node->output[0] = iOut * info->r4;
1955   node->output[0] = i_out * info->r4;
19211956   /* Clip the output if needed. */
1922   if (node->output[0] > context->vOutMax) node->output[0] = context->vOutMax;
1957   if (node->output[0] > context->v_out_max) node->output[0] = context->v_out_max;
19231958}
19241959
19251960static void dst_tvca_op_amp_reset(node_description *node)
19261961{
1927   const discrete_op_amp_tvca_info *info = node->custom;
1928   struct dst_tvca_op_amp_context *context = node->context;
1962   const  discrete_op_amp_tvca_info *info    = node->custom;
1963   struct dst_tvca_op_amp_context   *context = node->context;
19291964
19301965   context->r67 = info->r6 + info->r7;
19311966
1932   context->vOutMax = info->vP - OP_AMP_NORTON_VBE;
1967   context->v_out_max = info->vP - OP_AMP_NORTON_VBE;
19331968   /* This is probably overkill because R5 is usually much lower then r6 or r7,
19341969     * but it is better to play it safe. */
1935   context->vTrig[0] = (info->v1 - 0.6) * (info->r6 / (info->r6 + info->r5));
1936   context->vTrig[1] = (info->v1 - 0.6 - OP_AMP_NORTON_VBE) * (context->r67 / (context->r67 + info->r5)) + OP_AMP_NORTON_VBE;
1937   context->iFixed = context->vOutMax / info->r1;
1970   context->v_trig[0] = (info->v1 - 0.6) * (info->r6 / (info->r6 + info->r5));
1971   context->v_trig[1] = (info->v1 - 0.6 - OP_AMP_NORTON_VBE) * (context->r67 / (context->r67 + info->r5)) + OP_AMP_NORTON_VBE;
1972   context->i_fixed   = context->v_out_max / info->r1;
19381973
1939   context->vCap1 = 0;
1974   context->v_cap1 = 0;
19401975   /* Charge rate thru r5 */
19411976   /* There can be a different charge rates depending on function F3. */
1942   context->exponentC[0] = -1.0 / ((1.0 / (1.0 / info->r5 + 1.0 / info->r6)) * info->c1 * discrete_current_context->sample_rate);
1943   context->exponentC[0] = 1.0 - exp(context->exponentC[0]);
1944   context->exponentC[1] = -1.0 / ((1.0 / (1.0 / info->r5 + 1.0 / context->r67)) * info->c1 * discrete_current_context->sample_rate);
1945   context->exponentC[1] = 1.0 - exp(context->exponentC[1]);
1977   context->exponent_c[0] = -1.0 / ((1.0 / (1.0 / info->r5 + 1.0 / info->r6)) * info->c1 * discrete_current_context->sample_rate);
1978   context->exponent_c[0] =  1.0 - exp(context->exponent_c[0]);
1979   context->exponent_c[1] = -1.0 / ((1.0 / (1.0 / info->r5 + 1.0 / context->r67)) * info->c1 * discrete_current_context->sample_rate);
1980   context->exponent_c[1] =  1.0 - exp(context->exponent_c[1]);
19461981   /* Discharge rate thru r6 + r7 */
1947   context->exponentD[1] = -1.0 / (context->r67 * info->c1 * discrete_current_context->sample_rate);
1948   context->exponentD[1] = 1.0 - exp(context->exponentD[1]);
1982   context->exponent_d[1] = -1.0 / (context->r67 * info->c1 * discrete_current_context->sample_rate);
1983   context->exponent_d[1] =  1.0 - exp(context->exponent_d[1]);
19491984   /* Discharge rate thru r6 */
19501985   if (info->r6 != 0)
19511986   {
1952      context->exponentD[0] = -1.0 / (info->r6 * info->c1 * discrete_current_context->sample_rate);
1953      context->exponentD[0] = 1.0 - exp(context->exponentD[0]);
1987      context->exponent_d[0] = -1.0 / (info->r6 * info->c1 * discrete_current_context->sample_rate);
1988      context->exponent_d[0] =  1.0 - exp(context->exponent_d[0]);
19541989   }
1955   context->vCap2 = 0;
1956   context->vTrig2 = (info->v2 - 0.6 - OP_AMP_NORTON_VBE) * (info->r9 / (info->r8 + info->r9));
1990   context->v_cap2       = 0;
1991   context->v_trig2      = (info->v2 - 0.6 - OP_AMP_NORTON_VBE) * (info->r9 / (info->r8 + info->r9));
19571992   context->exponent2[0] = -1.0 / (info->r9 * info->c2 * discrete_current_context->sample_rate);
1958   context->exponent2[0] = 1.0 - exp(context->exponent2[0]);
1993   context->exponent2[0] = 1.0 - exp(context->exponent2[0]);
19591994   context->exponent2[1] = -1.0 / ((1.0 / (1.0 / info->r8 + 1.0 / info->r9)) * info->c2 * discrete_current_context->sample_rate);
1960   context->exponent2[1] = 1.0 - exp(context->exponent2[1]);
1961   context->vCap3 = 0;
1962   context->vTrig3 = (info->v3 - 0.6 - OP_AMP_NORTON_VBE) * (info->r11 / (info->r10 + info->r11));
1995   context->exponent2[1] =  1.0 - exp(context->exponent2[1]);
1996   context->v_cap3  = 0;
1997   context->v_trig3 = (info->v3 - 0.6 - OP_AMP_NORTON_VBE) * (info->r11 / (info->r10 + info->r11));
19631998   context->exponent3[0] = -1.0 / (info->r11 * info->c3 * discrete_current_context->sample_rate);
1964   context->exponent3[0] = 1.0 - exp(context->exponent3[0]);
1999   context->exponent3[0] = 1.0 - exp(context->exponent3[0]);
19652000   context->exponent3[1] = -1.0 / ((1.0 / (1.0 / info->r10 + 1.0 / info->r11)) * info->c3 * discrete_current_context->sample_rate);
1966   context->exponent3[1] = 1.0 - exp(context->exponent3[1]);
2001   context->exponent3[1] = 1.0 - exp(context->exponent3[1]);
19672002
19682003   dst_tvca_op_amp_step(node);
19692004}
src/emu/sound/discrete.c
r3115r3116
307307
308308   /* create the logfile */
309309   sprintf(name, "discrete%d.log", info->sndindex);
310   if (DISCRETE_DEBUGLOG && !discrete_current_context->disclogfile)
311      discrete_current_context->disclogfile = fopen(name, "w");
310   if (DISCRETE_DEBUGLOG && !info->disclogfile)
311      info->disclogfile = fopen(name, "w");
312312
313   discrete_current_context = info;
314
313315   /* first pass through the nodes: sanity check, fill in the indexed_nodes, and make a total count */
314316   discrete_log("discrete_start() - Doing node list sanity check");
315317   for (info->node_count = 0; intf[info->node_count].type != DSS_NULL; info->node_count++)
r3115r3116
329331      /* make sure this is a main node */
330332      if (NODE_CHILD_NODE_NUM(intf[info->node_count].node) > 0)
331333         fatalerror("discrete_start() - Child node number on NODE_%02d", NODE_INDEX(intf[info->node_count].node) );
332
333
334334   }
335335   info->node_count++;
336336   discrete_log("discrete_start() - Sanity check counted %d nodes", info->node_count);
r3115r3116
357357   setup_output_nodes(info);
358358
359359   setup_disc_logs(info);
360
361   discrete_current_context = NULL;
360362   return info;
361363}
362364
r3115r3116
414416   if (DISCRETE_DEBUGLOG)
415417   {
416418      /* close the debug log */
417       if (discrete_current_context->disclogfile)
418          fclose(discrete_current_context->disclogfile);
419      discrete_current_context->disclogfile = NULL;
419       if (info->disclogfile)
420          fclose(info->disclogfile);
421      info->disclogfile = NULL;
420422   }
421423}
422424
r3115r3116
449451      /* otherwise, just step it */
450452      else if (node->module.step)
451453         (*node->module.step)(node);
454
455      /* and register save state */
456      state_save_register_item_array("discrete", nodenum, node->output);
452457   }
453458
454459   discrete_current_context = NULL;
r3115r3116
663668         node->context = NULL;
664669         info->discrete_input_streams++;
665670      }
671
666672   }
667673
668674   /* if no outputs, give an error */
r3115r3116
703709            if (NODE_CHILD_NODE_NUM(inputnode) >= node_ref->module.num_output)
704710               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));
705711
706            node->input[inputnum] = &(node_ref->output[NODE_CHILD_NODE_NUM(inputnode)]);   // Link referenced node out to input
707            node->input_is_node |= 1 << inputnum;         // Bit flag if input is node
712            node->input[inputnum] = &(node_ref->output[NODE_CHILD_NODE_NUM(inputnode)]);   /* Link referenced node out to input */
713            node->input_is_node |= 1 << inputnum;         /* Bit flag if input is node */
708714         }
709715      }
710716   }
src/emu/sound/discrete.h
r3115r3116
121121 *
122122 ***********************************************************************
123123 *
124 * x_time - ANTI-ALSING features.
125 *
126 * Certain modules make use of x_time.  This is a feature that passes
127 * infomation between modules about how long in the current sample, the
128 * switch in state happened.  This is a decimal value of the % of the
129 * full sample period that it has been in the new state.
130 * 0 means it has been at the same state the whole sample.
131 *
132 * Example: Here is the output of a clock source with x_time on the
133 *          output.  The square wave is the real world waveform we
134 *          want.  The ^'s are the sample point.  The numbers under
135 *          the ^'s are the node output with the logic state left of
136 *          the decimal and the x_time to the right.  Under that is
137 *          what the node's anti-aliased output energy would be.
138 *          Note: the example is not 4x sampling so the energy
139 *                does not provide an accurate representation of the
140 *                original waveform.  This is intentional so it fits
141 *                in this header file.
142 *  1      ____    ____    ____    ____    ____    ____    ____    ____
143 *  0   ___    ____    ____    ____    ____    ____    ____    ____    __
144 *        ^....^....^....^....^....^....^....^....^....^....^....^....^
145 *   x_time   0.2  1.4  0.6  1.8  1.2  0.4  1.6  0.8  0.2  1.4  0.6
146 *   energy   0.8  0.4  0.4  0.8  0.2  0.6  0.6  0.2  0.8  0.4  0.4
147 *
148 * Some modules will just pass the x_time onto another module.
149 *
150 * Modules that process x_time will keep track of the node's previous
151 * state so they can calculate the actual energy at the sample time.
152 *
153 * Example: Say we have a 555 module that outputs a clock with x_time
154 *          that is connected to a counter.  The output of the counter
155 *          is connected to DAC_R1.
156 *          In this case the counter module continues counting dependant
157 *          on the integer portion of the 555 output.  But it also
158 *          passes the decimal portion as the x_time.
159 *          The DAC_R1 then uses this info to anti-alias its output.
160 *          Consider the following counter outputs vs DAC_R1
161 *          calculations.  The count changes from 9 to 10.  It has
162 *          been at the new state for 75% of the sample.
163 *
164 *          counter    binary   x_time    -- DAC_R1 bit energy --
165 *            out       count              D3    D2    D1    D0
166 *            9.0       1001     0.0      1.0   0.0   0.0   1.0
167 *           10.75      1010     0.75     1.0   0.0   0.75  0.25
168 *           10.0       1010     0.0      1.0   0.0   1.0   0.0
169 *
170 *           The DAC_R1 uses these energy calculations to scale the
171 *           voltages created on each of its resistors.  This
172 *           anti-aliases the waveform no mater what the resistor
173 *           weighting is.
174 *
175 ***********************************************************************
176 *
124177 * LIST OF CURRENTLY IMPLEMENTED DISCRETE BLOCKS
125178 * ---------------------------------------------
126179 *
r3115r3116
142195 * DISCRETE_INPUTX_STREAM(NODE,NUM, GAIN,OFFSET)
143196 *
144197 * DISCRETE_COUNTER(NODE,ENAB,RESET,CLK,MAX,DIR,INIT0,CLKTYPE)
145 * DISCRETE_COUNTER_7492(NODE,ENAB,RESET,CLK)
198 * DISCRETE_COUNTER_7492(NODE,ENAB,RESET,CLK,CLKTYPE)
146199 * DISCRETE_LFSR_NOISE(NODE,ENAB,RESET,CLK,AMPL,FEED,BIAS,LFSRTB)
147200 * DISCRETE_NOISE(NODE,ENAB,FREQ,AMP,BIAS)
148201 * DISCRETE_NOTE(NODE,ENAB,CLK,DATA,MAX1,MAX2,CLKTYPE)
r3115r3116
386439 *  This counter counts up/down from 0 to MAX.  When the enable is low, the output
387440 *  is held at it's last value.  When reset is high, the reset value is loaded
388441 *  into the output.  The counter can be clocked internally or externally.  It also
389 *  supports xTime used by the clock modules to pass on anti-aliasing info.
442 *  supports x_time used by the clock modules to pass on anti-aliasing info.
390443 *
391444 *  Declaration syntax
392445 *
r3115r3116
399452 *                           DISC_CLK_IS_FREQ   - internally clock at this frequency.
400453 *                                                Clock node must be static if
401454 *                                                DISC_CLK_IS_FREQ is used.
455 *               x_time options: you can also | these x_time features to the basic
456 *                               types above if needed, or use seperately with 7492.
457 *                           DISC_OUT_IS_ENERGY - This will uses the x_time to
458 *                                                anti-alias the count.  Might be
459 *                                                usefull if not connected to other
460 *                                                modules.
461 *                           DISC_OUT_HAS_XTIME - This will generate x_time if
462 *                                                being used with DISC_CLK_IS_FREQ.
463 *                                                It will pass x_time for the
464 *                                                other clock types.
402465 *
403466 *     DISCRETE_COUNTER(name of node,
404467 *                      enable node or static value,
r3115r3116
413476 *                           enable node or static value,
414477 *                           reset node or static value,
415478 *                           clock node or static value,
416 *                           max count static value)
479 *                           clock type static value)
417480 *
418481 *  Note: A 7492 counter outputs a special bit pattern on its /6 stage.
419 *        A 7492 clocks on falling edge.  This emulates the /6 stage only.
482 *        A 7492 clocks on the falling edge,
483 *        so it is not recommended to use DISC_CLK_ON_R_EDGE for a 7492.
484 *        This module emulates the /6 stage only.
420485 *        Use another DISCRETE_COUNTER for the /2 stage.
421486 *
422487 * EXAMPLES: see Fire Truck, Monte Carlo, Super Bug, Polaris
r3115r3116
16591724 *     DISCRETE_DAC_R1(name of node,
16601725 *                     enable node or static value,
16611726 *                     data node (static value is useless),
1662 *                     vData node or static value (vON),
1727 *                     vData node or static value (voltage when a bit is on ),
16631728 *                     address of discrete_dac_r1_ladder structure)
16641729 *
16651730 *     discrete_dac_r1_ladder = {ladderLength, r{}, vBias, rBias, rGnd, cFilter}
r3115r3116
16681733 *        are out of circuit.  So the bit selecting them will have no effect
16691734 *        on the DAC output voltage.
16701735 *
1736 * x_time - this modules automatically handles any non-integer value
1737 *          on the data input as x_time.
1738 *
16711739 * EXAMPLES: see Fire Truck, Monte Carlo, Super Bug, Polaris
16721740 *
16731741 ***********************************************************************
r3115r3116
18021870 *                     input 7 node,  (if used)
18031871 *                     address of discrete_mixer_info structure)
18041872 *
1805 *     discrete_mixer_desc = {type, r{}, rNode{}, c{}, rI, rF, cF, cAmp, vRef, gain}
1873 *     discrete_mixer_desc = {type, r{}, r_node{}, c{}, rI, rF, cF, cAmp, vRef, gain}
18061874 *
18071875 * Note: Set all unused components to 0.
18081876 *       If an rNode is not used it should also be set to 0.
r3115r3116
26812749 * DISCRETE_555_ASTABLE    - NE555 Chip simulation (astable mode).
26822750 * DISCRETE_555_ASTABLE_CV - NE555 Chip simulation (astable mode) with CV control.
26832751 *
2684 *                                v555
2685 *                                 |
2686 *                       .---------+
2687 *                       |         |
2688 *                       Z         |8
2689 *                    R1 Z     .---------.
2690 *                       |    7|  Vcc    |
2691 *                       +-----|Discharge|
2692 *                       |     |         |
2693 *                       Z     |   555   |3
2694 *                    R2 Z     |      Out|---> Netlist Node
2695 *                       |    6|         |
2696 *                       +-----|Threshold|
2697 *                       |     |         |
2698 *                       +-----|Trigger  |
2699 *                       |    2|         |---< Control Voltage
2700 *                       |     |  Reset  |5
2701 *                       |     '---------'
2702 *                      ---        4|
2703 *                    C ---         |
2704 *                       |          ^
2705 *                      gnd       Reset
2752 *                            v_charge     v_pos
2753 *                                 V         V
2754 *                                 |         |
2755 *                                 |         |
2756 *                                 |         |
2757 *                                 Z         |8
2758 *    _FAST_CHARGE_DIODE        R1 Z     .---------.
2759 *       (optional)                |    7|  Vcc    |
2760 *                    +--------->  +-----|Discharge|
2761 *                    |            |     |         |
2762 *                   ---           Z     |   555   |3
2763 *                   \ /        R2 Z     |      Out|---> Netlist Node
2764 *                    V            |    6|         |
2765 *                   ---           +-----|Threshold|
2766 *                    |            |     |         |
2767 *                    +--------->  +-----|Trigger  |
2768 *                                 |    2|         |---< Control Voltage
2769 *                                 |     |  Reset  |5
2770 *                                 |     '---------'
2771 *                                ---        4|
2772 *                              C ---         |
2773 *                                 |          ^
2774 *                                gnd       Reset
27062775 *
27072776 *  Declaration syntax
27082777 *
r3115r3116
27232792 *
27242793 *    discrete_555_desc =
27252794 *    {
2726 *        options,        // bit mapped options
2727 *        v555,           // B+ voltage of 555
2728 *        v555high,       // High output voltage of 555 (Usually v555 - 1.2V)
2729 *        threshold555,   // normally 2/3 of v555
2730 *        trigger555      // normally 1/3 of v555
2795 *        options,        - bit mapped options
2796 *        v_pos,          - B+ voltage of 555
2797 *        v_charge,       - voltage (or node) to charge circuit  (Defaults to v_pos)
2798 *        v_out_high,     - High output voltage of 555 (Defaults to v_pos - 1.2V)
27312799 *    }
27322800 *
2733 * The last 3 options of discrete_555_desc can use the following defaults
2734 * unless otherwise needed.
2735 *     DEFAULT_555_HIGH, DEFAULT_555_THRESHOLD, DEFAULT_555_TRIGGER
2736 * or all 3 combined as:
2801 * The last 2 options of discrete_555_desc can use the following defaults:
2802 *     DEFAULT_555_CHARGE -  to connect v_charge to v_pos
2803 *     DEFAULT_555_HIGH   - to use the normal output voltage based on v_pos
2804 * or combine both as:
27372805 *     DEFAULT_555_VALUES
27382806 *
2739 * eg. {DISC_555_OUT_DC | DISC_555_OUT_SQW, 12, DEFAULT_555_VALUES}
2807 * eg. {DISC_555_OUT_SQW | DISC_555_OUT_DC, 12, DEFAULT_555_VALUES}
27402808 *
2741 *  Output Types:
2809 *  Output Types: (only needed with DISC_555_OUT_SQW, DISC_555_OUT_CAP
2810 *                 and DISC_555_OUT_ENERGY)
27422811 *     DISC_555_OUT_DC - Output is actual DC. (DEFAULT)
27432812 *     DISC_555_OUT_AC - A cheat to make the waveform AC.
27442813 *
27452814 *  Waveform Types: (ORed with output types)
2746 *     DISC_555_OUT_SQW     - Output is Squarewave.  0 or v555high. (DEFAULT)
2815 *     DISC_555_OUT_SQW     - Output is Squarewave.  0 or v_out_high. (DEFAULT)
27472816 *                            When the state changes from low to high (or high to low)
27482817 *                            during a sample, the output will high (or low) for that
27492818 *                            sample.  This can cause alaising effects.
r3115r3116
27632832 *                            through the sample, then the output will be 75% of the
27642833 *                            normal high value.
27652834 *     DISC_555_OUT_LOGIC_X - This will output the 0/1 level of the flip-flop with
2766 *                            some eXtra info.  This X info is in decimal remainder.
2835 *                            some eXtra info.  This x_time is in decimal remainder.
27672836 *                            It lets you know the percent of sample time where the
27682837 *                            flip-flop changed state.  If 0, the change did not happen
27692838 *                            during the sample.  1.75 means the flip-flop is 1 and
r3115r3116
27712840 *                            0.2 means the flip-flop is 0 and switched over 4/5 of
27722841 *                            the way through the sample.
27732842 *                            X modules can be used with counters to reduce alaising.
2774 *   DISC_555_OUT_COUNT_F_X - Same as DISC_555_OUT_COUNT_F but with X info.
2775 *   DISC_555_OUT_COUNT_R_X - Same as DISC_555_OUT_COUNT_R but with X info.
2843 *   DISC_555_OUT_COUNT_F_X - Same as DISC_555_OUT_COUNT_F but with x_time.
2844 *   DISC_555_OUT_COUNT_R_X - Same as DISC_555_OUT_COUNT_R but with x_time.
27762845 *
27772846 *  other options - DISCRETE_555_ASTABLE only:
27782847 *     DISC_555_ASTABLE_HAS_FAST_CHARGE_DIODE - diode used to bypass rDischarge
r3115r3116
27852854 * DISCRETE_555_MSTABLE - NE555 Chip simulation (monostable mode)
27862855 *                      - Triggered on falling edge.
27872856 *
2788 *                          v555
2789 *                           |
2790 *                 .---------+
2857 *            v_charge     v_pos
2858 *                 V         V
27912859 *                 |         |
2860 *                 |         |
2861 *                 |         |
27922862 *                 Z         |
27932863 *               R Z     .---------.
27942864 *                 |     |  Vcc    |
r3115r3116
28172887 *                          C node (or value) in farads,
28182888 *                          address of discrete_555_desc structure)
28192889 *
2890 *    discrete_555_desc = See DISCRETE_555_ASTABLE for description.
2891 *      Note: v_charge can not be a node for this circuit.
2892 *
28202893 *  Trigger Types
28212894 *     DISC_555_TRIGGER_IS_LOGIC   - Input is (0 or !0) logic (DEFAULT)
28222895 *     DISC_555_TRIGGER_IS_VOLTAGE - Input is actual voltage.
28232896 *                                   Voltage must drop below
2824 *                                   trigger555 to activate.
2897 *                                   trigger to activate.
28252898 *     DISC_555_TRIGGER_DISCHARGES_CAP - some circuits connect an external
28262899 *                                       device (transistor) to the cap to
28272900 *                                       discharge it when the trigger is
r3115r3116
28332906 *     DISC_555_OUT_AC - A cheat to make the waveform AC.
28342907 *
28352908 *  Waveform Types: (ORed with trigger types)
2836 *     DISC_555_OUT_SQW     - Output is Squarewave.  0 or v555high. (DEFAULT)
2909 *     DISC_555_OUT_SQW     - Output is Squarewave.  0 or v_out_high. (DEFAULT)
28372910 *     DISC_555_OUT_CAP     - Output is Timing Capacitor 'C' voltage.
28382911 *
28392912 * EXAMPLES: see Frogs
r3115r3116
28432916 * DISCRETE_555_CC - Constant Current Controlled 555 Oscillator
28442917 *                   Which works out to a VCO when R is fixed.
28452918 *
2846 *       vCCsource                       v555
2919 *       v_cc_source                     v_pos
28472920 *           V                            V
28482921 *           |     .----------------------+
28492922 *           |     |                      |
r3115r3116
28952968 *                     address of discrete_555_cc_desc structure)
28962969 *
28972970 *     discrete_555_cc_desc =
2898 *     {
2899 *          options,        // bit mapped options
2900 *          v555,           // B+ voltage of 555
2901 *          v555high,       // High output voltage of 555 (Usually v555 - 1.2V)
2902 *          threshold555,   // normally 2/3 of v555
2903 *          trigger555,     // normally 1/3 of v555
2904 *          vCCsource,      // B+ voltage of the Constant Current source
2905 *          vCCjunction     // The voltage drop of the Constant Current source transitor (0 if Op Amp)
2906 *     }
2971 * {
2972 *         options;         - bit mapped options
2973 *         v_pos;           - B+ voltage of 555
2974 *         v_cc_source;     - Voltage of the Constant Current source
2975 *         v_out_high;      - High output voltage of 555 (Defaults to v_pos - 1.2V)
2976 *         v_cc_junction;   - The voltage drop of the Constant Current source transitor
2977 *                            (0 if Op Amp)
2978 *  }
29072979 *
2980 * The last 2 options of discrete_555_desc can use the following defaults:
2981 *     DEFAULT_555_CC_SOURCE - to connect v_cc_source to v_pos
2982 *     DEFAULT_555_HIGH      - to use the normal output voltage based on v_pos
2983 * or combine both as:
2984 *     DEFAULT_555_VALUES
2985 *
29082986 *  Output Types:
29092987 *     See DISCRETE_555_ASTABLE for description.
29102988 *
r3115r3116
29423020 * |  En|<--------.     |                 .---|Discharge   |
29433021 * '----'         |    gnd                |   '------------'
29443022 *   |            |                       |
2945 *  gnd           '-----------------------+---ZZZZ------> 5V
3023 *  gnd           '-----------------------+---ZZZZ------> v_charge (ignored)
29463024 *                                             rX
29473025 *
29483026 *  Declaration syntax
r3115r3116
29583036 *                          Vin2 (CV) node or static value,
29593037 *                          address of discrete_555_vco1_desc structure)
29603038 *
2961 *  discrete_555_vco1_desc = {options,        // bit mapped options
2962 *                            r1, r2, r3, r4, c,
2963 *                            v555,           // B+ voltage of 555
2964 *                            v555high,       // High output voltage of 555 (Usually v555 - 1.2V)
2965 *                            threshold555,   // normally 2/3 of v555
2966 *                            trigger555}     // normally 1/3 of v555
3039 *  discrete_555_vco1_desc =
3040 *  {
3041 *      options,            - bit mapped options
3042 *      r1, r2, r3, r4, c,
3043 *      v_pos,              - B+ voltage of 555
3044 *      v_out_high,         - High output voltage of 555 (Defaults to v_pos - 1.2V)
3045 *  }
29673046 *
3047 * The last option of discrete_555_vco1_desc can use the following default:
3048 *     DEFAULT_555_HIGH      - to use the normal output voltage based on v_pos
3049 *
29683050 * Notes: The value of resistor rX is not needed.  It is just a pull-up
29693051 *        for the discharge output.
29703052 *        The 'En' block can be a transistor or 4066 switch.  It connects
r3115r3116
29743056 *
29753057 * DISCRETE_566 - NE566 VCO simulation.
29763058 *
2977 *                       vPlus
2978 *                         V
2979 *           .-------------+
3059 *       v_charge        v_pos
3060 *           V             V
29803061 *           |             |
3062 *           |             |
29813063 *           |    R    .-------.
29823064 *           '---/\/\--|6  8   |
29833065 *                     |       |
r3115r3116
29883070 *                ---      |
29893071 *                --- C    |
29903072 *                 |       |
2991 *                vNeg    vNeg
3073 *               v_neg   v_neg
29923074 *
29933075 *  Declaration syntax
29943076 *
r3115r3116
29993081 *                  C node or static value in Farads,
30003082 *                  address of discrete_566_desc structure)
30013083 *
3002 *     discrete_566_desc = {options, vPlus, vNeg}
3084 *     discrete_566_desc = {options, v_pos, v_neg, v_charge}
3085 *       Note: v_charge can be static value, a node
3086 *             or use DEFAULT_566_CHARGE to connect to v_pos
30033087 *
30043088 *  Output Types:
30053089 *     DISC_566_OUT_DC - Output is actual DC. (DEFAULT)
r3115r3116
32453329/* Mixer types */
32463330#define DISC_MIXER_IS_RESISTOR         0
32473331#define DISC_MIXER_IS_OP_AMP         1
3248
32493332#define DISC_MIXER_IS_OP_AMP_WITH_RI    2   // Used only internally.  Use DISC_MIXER_IS_OP_AMP
3250#define DISC_MIXER_TYPE_MASK         3   // Used only internally.
3251#define DISC_MIXER_HAS_R_NODE         4   // Used only internally.
32523333
32533334/* Triggered Op Amp Functions */
32543335enum
r3115r3116
33483429
33493430#define DISC_566_OUT_MASK            0x30   /* Bits that define output type.
33503431                                                 * Used only internally in module. */
3432#define DEFAULT_566_CHARGE   -1
3433
33513434/* LS624 output flags */
33523435#define DISC_LS624_OUT_ENERGY         0x01
33533436#define DISC_LS624_OUT_LOGIC         0x02
r3115r3116
35433626struct _discrete_mixer_desc
35443627{
35453628   int      type;
3546   double   r[DISC_MAX_MIXER_INPUTS];   // static input resistance values.  These are in series with rNode, if used.
3547   int      rNode[DISC_MAX_MIXER_INPUTS];   // variable resistance nodes, if needed.  0 if not used.
3629   double   r[DISC_MAX_MIXER_INPUTS];      /* static input resistance values.  These are in series with rNode, if used. */
3630   int      r_node[DISC_MAX_MIXER_INPUTS];   /* variable resistance nodes, if needed.  0 if not used. */
35483631   double   c[DISC_MAX_MIXER_INPUTS];
35493632   double   rI;
35503633   double   rF;
35513634   double   cF;
35523635   double   cAmp;
35533636   double   vRef;
3554   double   gain;            // Scale value to get output close to +/- 32767
3637   double   gain;            /* Scale value to get output close to +/- 32767 */
35553638};
35563639
35573640
r3115r3116
36323715};
36333716
36343717
3718#define DEFAULT_555_CHARGE      -1
36353719#define DEFAULT_555_HIGH      -1
3636#define DEFAULT_555_THRESHOLD   -1
3637#define DEFAULT_555_TRIGGER      -1
3638#define DEFAULT_555_VALUES      DEFAULT_555_HIGH, DEFAULT_555_THRESHOLD, DEFAULT_555_TRIGGER
3720#define DEFAULT_555_VALUES      DEFAULT_555_CHARGE, DEFAULT_555_HIGH
36393721
36403722typedef struct _discrete_555_desc discrete_555_desc;
36413723struct _discrete_555_desc
36423724{
3643   int      options;      // bit mapped options
3644   double   v555;         // B+ voltage of 555
3645   double   v555high;      // High output voltage of 555 (Usually v555 - 1.2V)
3646   double   threshold555;   // normally 2/3 of v555
3647   double   trigger555;      // normally 1/3 of v555
3725   int      options;   /* bit mapped options */
3726   double   v_pos;      /* B+ voltage of 555 */
3727   double  v_charge;   /* voltage to charge circuit  (Defaults to v_pos) */
3728   double   v_out_high;   /* High output voltage of 555 (Defaults to v_pos - 1.2V) */
36483729};
36493730
3731#define DEFAULT_555_CC_SOURCE   DEFAULT_555_CHARGE
36503732
36513733typedef struct _discrete_555_cc_desc discrete_555_cc_desc;
36523734struct _discrete_555_cc_desc
36533735{
3654   int      options;      // bit mapped options
3655   double   v555;         // B+ voltage of 555
3656   double   v555high;      // High output voltage of 555 (Usually v555 - 1.2V)
3657   double   threshold555;   // normally 2/3 of v555
3658   double   trigger555;      // normally 1/3 of v555
3659   double   vCCsource;      // B+ voltage of the Constant Current source
3660   double   vCCjunction;   // The voltage drop of the Constant Current source transitor (0 if Op Amp)
3736   int      options;      /* bit mapped options */
3737   double   v_pos;         /* B+ voltage of 555 */
3738   double   v_cc_source;   /* Voltage of the Constant Current source */
3739   double   v_out_high;      /* High output voltage of 555 (Defaults to v_pos - 1.2V) */
3740   double   v_cc_junction;   /* The voltage drop of the Constant Current source transitor (0 if Op Amp) */
36613741};
36623742
36633743
36643744typedef struct _discrete_555_vco1_desc discrete_555_vco1_desc;
36653745struct _discrete_555_vco1_desc
36663746{
3667   int    options;            // bit mapped options
3747   int    options;            /* bit mapped options */
36683748   double r1, r2, r3, r4, c;
3669   double v555;            // B+ voltage of 555
3670   double v555high;         // High output voltage of 555 (Usually v555 - 1.2V)
3671   double threshold555;      // normally 2/3 of v555
3672   double trigger555;         // normally 1/3 of v555
3749   double v_pos;            /* B+ voltage of 555 */
3750   double v_charge;         /* (ignored) */
3751   double v_out_high;         /* High output voltage of 555 (Defaults to v_pos - 1.2V) */
36733752};
36743753
36753754
r3115r3116
36773756struct _discrete_566_desc
36783757{
36793758   int      options;   // bit mapped options
3680   double   vPlus;      // B+ voltage of 566
3681   double   vNeg;      // B- voltage of 566
3759   double   v_pos;      // B+ voltage of 566
3760   double   v_neg;      // B- voltage of 566
3761   double   v_charge;
36823762};
36833763
36843764
r3115r3116
37853865#define NODE_SUB(_x, _y) (NODE(_x) + (_y))
37863866
37873867#if DISCRETE_MAX_NODE_OUTPUTS == 8
3788#define NODE_CHILD_NODE_NUM(_x)      ((_x) & 7)
3789#define NODE_DEFAULT_NODE(_x)      ((_x) & ~7)
3790#define NODE_INDEX(_x)            (((_x) - NODE_START)>>3)
3868#define NODE_CHILD_NODE_NUM(_x)      ((int)(_x) & 7)
3869#define NODE_DEFAULT_NODE(_x)      ((int)(_x) & ~7)
3870#define NODE_INDEX(_x)            (((int)(_x) - NODE_START)>>3)
37913871#else
37923872#error "DISCRETE_MAX_NODE_OUTPUTS != 8"
37933873#endif
r3115r3116
39584038/* from disc_wav.c */
39594039/* generic modules */
39604040#define DISCRETE_COUNTER(NODE,ENAB,RESET,CLK,MAX,DIR,INIT0,CLKTYPE)     { NODE, DSS_COUNTER     , 7, { ENAB,RESET,CLK,NODE_NC,DIR,INIT0,NODE_NC }, { ENAB,RESET,CLK,MAX,DIR,INIT0,CLKTYPE }, NULL, "DISCRETE_COUNTER" },
3961#define DISCRETE_COUNTER_7492(NODE,ENAB,RESET,CLK)                      { NODE, DSS_COUNTER     , 7, { ENAB,RESET,CLK,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { ENAB,RESET,CLK,5,1,0,DISC_COUNTER_IS_7492 }, NULL, "DISCRETE_COUNTER_7492" },
4041#define DISCRETE_COUNTER_7492(NODE,ENAB,RESET,CLK,CLKTYPE)              { NODE, DSS_COUNTER     , 7, { ENAB,RESET,CLK,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { ENAB,RESET,CLK,CLKTYPE,1,0,DISC_COUNTER_IS_7492 }, NULL, "DISCRETE_COUNTER_7492" },
39624042#define DISCRETE_LFSR_NOISE(NODE,ENAB,RESET,CLK,AMPL,FEED,BIAS,LFSRTB)  { NODE, DSS_LFSR_NOISE  , 6, { ENAB,RESET,CLK,AMPL,FEED,BIAS }, { ENAB,RESET,CLK,AMPL,FEED,BIAS }, LFSRTB, "LFSR Noise Source" },
39634043#define DISCRETE_NOISE(NODE,ENAB,FREQ,AMPL,BIAS)                        { NODE, DSS_NOISE       , 4, { ENAB,FREQ,AMPL,BIAS }, { ENAB,FREQ,AMPL,BIAS }, NULL, "Noise Source" },
39644044#define DISCRETE_NOTE(NODE,ENAB,CLK,DATA,MAX1,MAX2,CLKTYPE)             { NODE, DSS_NOTE        , 6, { ENAB,CLK,DATA,NODE_NC,NODE_NC,NODE_NC }, { ENAB,CLK,DATA,MAX1,MAX2,CLKTYPE }, NULL, "Note Generator" },
r3115r3116
40794159#define DISCRETE_555_VCO1_CV(NODE,RESET,VIN,CTRLV,OPTIONS)              { NODE, DSD_555_VCO1    , 3, { RESET,VIN,CTRLV }, { RESET,VIN,CTRLV }, OPTIONS, "555 VCO1 with CV - Op-Amp type" },
40804160#define DISCRETE_566(NODE,ENAB,VMOD,R,C,OPTIONS)                        { NODE, DSD_566         , 4, { ENAB,VMOD,R,C }, { ENAB,VMOD,R,C }, OPTIONS, "566" },
40814161#define DISCRETE_74LS624(NODE,ENAB,VMOD,VRNG,C,OUTTYPE)                 { NODE, DSD_LS624       , 5, { ENAB,VMOD,VRNG,C,NODE_NC }, { ENAB,VMOD,VRNG,C, OUTTYPE }, NULL, "74LS624" },
4162
4163/* logging */
40824164#define DISCRETE_CSVLOG1(NODE1)                                    { NODE_SPECIAL, DSO_CSVLOG   , 1, { NODE1 }, { NODE1 }, NULL, "CSV Log 1 Node" },
40834165#define DISCRETE_CSVLOG2(NODE1,NODE2)                              { NODE_SPECIAL, DSO_CSVLOG   , 2, { NODE1,NODE2 }, { NODE1,NODE2 }, NULL, "CSV Log 2 Nodes" },
40844166#define DISCRETE_CSVLOG3(NODE1,NODE2,NODE3)                        { NODE_SPECIAL, DSO_CSVLOG   , 3, { NODE1,NODE2,NODE3 }, { NODE1,NODE2,NODE3 }, NULL, "CSV Log 3 Nodes" },
r3115r3116
40864168#define DISCRETE_CSVLOG5(NODE1,NODE2,NODE3,NODE4,NODE5)            { NODE_SPECIAL, DSO_CSVLOG   , 5, { NODE1,NODE2,NODE3,NODE4,NODE5 }, { NODE1,NODE2,NODE3,NODE4,NODE5 }, NULL, "CSV Log 5 Nodes" },
40874169#define DISCRETE_WAVELOG1(NODE1,GAIN1)                             { NODE_SPECIAL, DSO_WAVELOG  , 2, { NODE1,NODE_NC }, { NODE1,GAIN1 }, NULL, "Wave Log 1 Node" },
40884170#define DISCRETE_WAVELOG2(NODE1,GAIN1,NODE2,GAIN2)                 { NODE_SPECIAL, DSO_WAVELOG  , 4, { NODE1,NODE_NC,NODE2,NODE_NC }, { NODE1,GAIN1,NODE2,GAIN2 }, NULL, "Wave Log 2 Nodes" },
4171/* output */
40894172#define DISCRETE_OUTPUT(OPNODE,GAIN)                               { NODE_SPECIAL, DSO_OUTPUT   , 2, { OPNODE,NODE_NC }, { 0,GAIN }, NULL, "Output Node" },
40904173
40914174
src/emu/sound/disc_dev.c
r3115r3116
2727
2828struct dsd_555_astbl_context
2929{
30   int      error;
3130   int      use_ctrlv;
3231   int      output_type;
3332   int      output_is_ac;
34   double   ac_shift;            // DC shift needed to make waveform ac
35   int      flip_flop;            // 555 flip/flop output state
36   double   x_init;
37   double   cap_voltage;         // voltage on cap
33   double   ac_shift;         /* DC shift needed to make waveform ac */
34   int      flip_flop;         /* 555 flip/flop output state */
35   double   cap_voltage;      /* voltage on cap */
3836   double   threshold;
3937   double   trigger;
40   double   output_high_voltage;   // Logic 1 voltage level
41   double   v555;
38   double   v_out_high;         /* Logic 1 voltage level */
39   double   v_charge;
40   double *v_charge_node;      /* point to output of node */
4241};
4342
4443struct dsd_555_mstbl_context
4544{
46   int      error;
4745   int      trig_is_logic;
4846   int      trig_discharges_cap;
4947   int      output_type;
5048   int      output_is_ac;
51   double   ac_shift;            // DC shift needed to make waveform ac
52   int      flip_flop;            // 555 flip/flop output state
53   double   cap_voltage;         // voltage on cap
49   double   ac_shift;            /* DC shift needed to make waveform ac */
50   int      flip_flop;            /* 555 flip/flop output state */
51   double   cap_voltage;         /* voltage on cap */
5452   double   threshold;
5553   double   trigger;
56   double   output_high_voltage;   // Logic 1 voltage level
54   double   v_out_high;            /* Logic 1 voltage level */
55   double   v_charge;
5756};
5857
5958struct dsd_555_cc_context
6059{
61   int            error;
62   unsigned int   type;         // type of 555cc circuit
60   unsigned int   type;         /* type of 555cc circuit */
6361   int            output_type;
6462   int            output_is_ac;
65   double         ac_shift;      // DC shift needed to make waveform ac
66   int            flip_flop;      // 555 flip/flop output state
67   double         x_init;
68   double         cap_voltage;   // voltage on cap
63   double         ac_shift;      /* DC shift needed to make waveform ac */
64   int            flip_flop;      /* 555 flip/flop output state */
65   double         cap_voltage;   /* voltage on cap */
6966   double         threshold;
7067   double         trigger;
71   double         output_high_voltage;   // Logic 1 voltage level
68   double         v_out_high;      /* Logic 1 voltage level */
69   double         v_cc_source;
7270};
7371
7472struct dsd_555_vco1_context
r3115r3116
7674   int      ctrlv_is_node;
7775   int      output_type;
7876   int      output_is_ac;
79   double   ac_shift;            // DC shift needed to make waveform ac
80   int      flip_flop;            // flip/flop output state
81   double   output_high_voltage;   // 555 high voltage
82   double   threshold;            // falling threshold
83   double   trigger;            // rising threshold
84   double   i_charge;            // charge current
85   double   i_discharge;         // discharge current
86   double   cap_voltage;         // current capacitor voltage
77   double   ac_shift;         /* DC shift needed to make waveform ac */
78   int      flip_flop;         /* flip/flop output state */
79   double   v_out_high;         /* 555 high voltage */
80   double   threshold;         /* falling threshold */
81   double   trigger;         /* rising threshold */
82   double   i_charge;         /* charge current */
83   double   i_discharge;      /* discharge current */
84   double   cap_voltage;      /* current capacitor voltage */
8785};
8886
8987struct dsd_566_context
9088{
9189   int         error;
92   unsigned int state[2];      // keeps track of excess flip_flop changes during the current step
93   int         flip_flop;      // 566 flip/flop output state
94   double      cap_voltage;   // voltage on cap
95   double      vDiff;         // voltage difference between vPlus and vNeg
96   double      vSqrLow;      // voltage for a squarewave at low
97   double      vSqrHigh;      // voltage for a squarewave at high
98   double      thresholdLow;   // falling threshold
99   double      thresholdHigh;   // rising threshold
100   double      triOffset;      // used to shift a triangle to AC
90   unsigned int state[2];         /* keeps track of excess flip_flop changes during the current step */
91   int         flip_flop;         /* 566 flip/flop output state */
92   double      cap_voltage;      /* voltage on cap */
93   double      v_charge;         /* static charge value */
94   double      *v_charge_node;      /* point to charge node */
95   double      v_sqr_low;         /* voltage for a squarewave at low */
96   double      v_sqr_high;         /* voltage for a squarewave at high */
97   double      threshold_low;      /* falling threshold */
98   double      threshold_high;      /* rising threshold */
99   double      triangle_ac_offset;   /* used to shift a triangle to AC */
101100};
102101
103102struct dsd_ls624_context
104103{
105104   int         state;
106   double      remain;         // remaining time from last step
107   int         outtype;
105   double      remain;         /* remaining time from last step */
106   int         out_type;
108107};
109108
110109
111/* Test to see if basic 555 options are valid. */
112static int test_555(double threshold, double trigger, double v555, int node)
113{
114   int error = 0;
115   if (threshold > v555)
116   {
117      logerror("[Threshold > B+]");
118      error = 1;
119   }
120   if (threshold <= trigger)
121   {
122      logerror("[Threshold <= Trigger]");
123      error = 1;
124   }
125   if (trigger < 0)
126   {
127      logerror("[Trigger < 0]");
128      error = 1;
129   }
130   if (v555 <= 0)
131   {
132      logerror("[B+ <= 0]");
133      error = 1;
134   }
135   if (error)
136      logerror(" - NODE_%d DISABLED!\n", node - NODE_00);
137   return error;
138}
139
140
141110/************************************************************************
142111 *
143112 * DSD_555_ASTBL -  - 555 Astable simulation
r3115r3116
160129
161130static void dsd_555_astbl_step(node_description *node)
162131{
163   const discrete_555_desc *info = node->custom;
132   const discrete_555_desc     *info    = node->custom;
164133   struct dsd_555_astbl_context *context = node->context;
165134
166135   int      count_f = 0;
167136   int      count_r = 0;
168   double   dt;               // change in time
169   double   xTime;            // time since change happened
170   double   tRC = 0;         // RC time constant
171   double   vC = context->cap_voltage;   // Current voltage on capacitor, before dt
172   double   vCnext = 0;         // Voltage on capacitor, after dt
137   double   dt;                        /* change in time */
138   double   x_time  = 0;               /* time since change happened */
139   double   t_rc    = 0;               /* RC time constant */
140   double   v_cap   = context->cap_voltage;   /* Current voltage on capacitor, before dt */
141   double   v_cap_next = 0;               /* Voltage on capacitor, after dt */
142   double   v_charge;
173143
174   if(DSD_555_ASTBL__RESET || context->error)
144   if(DSD_555_ASTBL__RESET)
175145   {
176146      /* We are in RESET */
177      /* If there was a fatal INIT error then we will also stay in RESET */
178      node->output[0] = 0;
179      context->flip_flop = 1;
147      node->output[0]      = 0;
148      context->flip_flop   = 1;
180149      context->cap_voltage = 0;
181150      return;
182151   }
r3115r3116
189158      if (DSD_555_ASTBL__CTRLV < .25) return;
190159      /* If it is a node then calculate thresholds based on Control Voltage */
191160      context->threshold = DSD_555_ASTBL__CTRLV;
192      context->trigger = DSD_555_ASTBL__CTRLV / 2.0;
161      context->trigger   = DSD_555_ASTBL__CTRLV / 2.0;
193162      /* Since the thresholds may have changed we need to update the FF */
194      if (vC >= context->threshold)
163      if (v_cap >= context->threshold)
195164      {
196165         context->flip_flop = 0;
197166         count_f++;
198167      }
199168      else
200      if (vC <= context->trigger)
169      if (v_cap <= context->trigger)
201170      {
202171         context->flip_flop = 1;
203172         count_r++;
204173      }
205174   }
206175
176   /* get the v_charge and update each step if it is a node */
177   if (context->v_charge_node != NULL)
178   {
179      v_charge = *context->v_charge_node;
180      if (info->options & DISC_555_ASTABLE_HAS_FAST_CHARGE_DIODE) v_charge -= 0.5;
181   }
182   else
183      v_charge = context->v_charge;
184
185
207186   /* Calculate future capacitor voltage.
208187     * ref@ http://www.physics.rutgers.edu/ugrad/205/capacitance.html
209188     * The formulas from the ref pages have been modified to reflect that we are stepping the change.
r3115r3116
223202     */
224203
225204   dt = discrete_current_context->sample_time;
226   xTime = context->x_init;
227205
228206   /* Sometimes a switching network is used to setup the capacitance.
229207     * These may select no capacitor, causing oscillation to stop.
r3115r3116
232210   {
233211      context->flip_flop = 1;
234212      /* The voltage goes high because the cap circuit is open. */
235      vCnext = context->v555;
236      vC = context->v555;
213      v_cap_next = v_charge;
214      v_cap      = v_charge;
237215      context->cap_voltage = 0;
238216   }
239217   else
r3115r3116
247225            {
248226               /* Oscillation disabled because there is no longer any charge resistor. */
249227               /* Bleed the cap due to circuit losses. */
250               tRC = DEFAULT_555_CAP_BLEED * DSD_555_ASTBL__C;
251               vCnext = vC - (vC * (1.0 - exp(-(dt / tRC))));
228               t_rc       = DEFAULT_555_CAP_BLEED * DSD_555_ASTBL__C;
229               v_cap_next = v_cap - (v_cap * (1.0 - exp(-(dt / t_rc ))));
252230               dt = 0;
253231            }
254232            else
255233            {
256234               /* Charging */
257235               /* Use quick charge if specified. */
258               tRC = (DSD_555_ASTBL__R1 + ((info->options & DISC_555_ASTABLE_HAS_FAST_CHARGE_DIODE) ? 0 : DSD_555_ASTBL__R2)) * DSD_555_ASTBL__C;
259               vCnext = vC + ((context->v555 - vC) * (1.0 - exp(-(dt / tRC))));
236               t_rc       = (DSD_555_ASTBL__R1 + ((info->options & DISC_555_ASTABLE_HAS_FAST_CHARGE_DIODE) ? 0 : DSD_555_ASTBL__R2)) * DSD_555_ASTBL__C;
237               v_cap_next = v_cap + ((v_charge - v_cap) * (1.0 - exp(-(dt / t_rc ))));
260238               dt = 0;
261239
262240               /* has it charged past upper limit? */
263               if (vCnext > context->threshold)
241               if (v_cap_next >= context->threshold)
264242               {
265243                  /* calculate the overshoot time */
266                  dt = tRC * log(1.0 / (1.0 - ((vCnext - context->threshold) / (context->v555 - vC))));
267                  xTime = dt;
268                  vC = context->threshold;
244                  dt     = t_rc  * log(1.0 / (1.0 - ((v_cap_next - context->threshold) / (v_charge - v_cap))));
245                  x_time = dt;
246                  v_cap  = context->threshold;
269247                  context->flip_flop = 0;
270248                  count_f++;
271249               }
r3115r3116
274252         else
275253         {
276254            /* Discharging */
277            if(DSD_555_ASTBL__R2!=0)
255            if(DSD_555_ASTBL__R2 != 0)
278256            {
279               tRC = DSD_555_ASTBL__R2 * DSD_555_ASTBL__C;
280               vCnext = vC - (vC * (1 - exp(-(dt / tRC))));
257               t_rc       = DSD_555_ASTBL__R2 * DSD_555_ASTBL__C;
258               v_cap_next = v_cap - (v_cap * (1 - exp(-(dt / t_rc ))));
281259               dt = 0;
282260            }
283261            else
284262            {
285               vCnext = context->trigger;
286               dt = 0;
263               /* no discharge resistor so we imediately discharge */
264               v_cap_next = context->trigger;
287265            }
288266
289267            /* has it discharged past lower limit? */
290            if (vCnext < context->trigger)
268            if (v_cap_next <= context->trigger)
291269            {
292270               /* calculate the overshoot time */
293               dt = tRC * log(1.0 / (1.0 - ((context->trigger - vCnext) / vC)));
294               xTime = dt;
295               vC = context->trigger;
271               if (dt == 0)
272                  dt = t_rc  * log(1.0 / (1.0 - ((context->trigger - v_cap_next) / v_cap)));
273               x_time = dt;
274               v_cap  = context->trigger;
296275               context->flip_flop = 1;
297276               count_r++;
298277            }
299278         }
300279      } while(dt);
301280
302      context->cap_voltage = vCnext;
281      context->cap_voltage = v_cap_next;
303282   }
304283
305284   /* Convert last switch time to a ratio */
306   xTime = xTime / discrete_current_context->sample_time;
285   x_time = x_time / discrete_current_context->sample_time;
307286
308287   switch (context->output_type)
309288   {
310289      case DISC_555_OUT_SQW:
311         node->output[0] = context->flip_flop * context->output_high_voltage + context->ac_shift;
290         node->output[0] = context->flip_flop * context->v_out_high + context->ac_shift;
312291         break;
313292      case DISC_555_OUT_CAP:
314         node->output[0] = vCnext;
293         node->output[0] = v_cap_next;
315294         /* Fake it to AC if needed */
316295         if (context->output_is_ac)
317296            node->output[0] -= context->threshold * 3.0 /4.0;
318297         break;
319298      case DISC_555_OUT_ENERGY:
320         node->output[0] = context->output_high_voltage * (context->flip_flop ? xTime : (1 - xTime));
299         if (x_time == 0) x_time = 1.0;
300         node->output[0]  = context->v_out_high * (context->flip_flop ? x_time : (1.0 - x_time));
321301         node->output[0] += context->ac_shift;
322302         break;
323303      case DISC_555_OUT_LOGIC_X:
324         node->output[0] = context->flip_flop + xTime;
304         node->output[0] = context->flip_flop + x_time;
325305         break;
326306      case DISC_555_OUT_COUNT_F_X:
327         node->output[0] = count_f ? count_f + xTime : count_f;
307         node->output[0] = count_f ? count_f + x_time : count_f;
328308         break;
329309      case DISC_555_OUT_COUNT_R_X:
330         node->output[0] =  count_r ? count_r + xTime : count_r;
310         node->output[0] =  count_r ? count_r + x_time : count_r;
331311         break;
332312      case DISC_555_OUT_COUNT_F:
333313         node->output[0] = count_f;
r3115r3116
340320
341321static void dsd_555_astbl_reset(node_description *node)
342322{
343   const discrete_555_desc *info = node->custom;
323   const discrete_555_desc     *info    = node->custom;
344324   struct dsd_555_astbl_context *context = node->context;
325   node_description *v_charge_node;
345326
346   context->use_ctrlv = (node->input_is_node >> 4) & 1;
327   context->use_ctrlv   = (node->input_is_node >> 4) & 1;
347328   context->output_type = info->options & DISC_555_OUT_MASK;
348329
349   /* Use the supplied values or set to defaults. */
350   context->output_high_voltage = (info->v555high == DEFAULT_555_HIGH) ? info->v555 - 1.2 : info->v555high;
330   /* Use the defaults or supplied values. */
331   context->v_out_high = (info->v_out_high == DEFAULT_555_HIGH) ? info->v_pos - 1.2 : info->v_out_high;
332
333   /* setup v_charge or node */
334   v_charge_node = discrete_find_node(NULL, info->v_charge);
335   if (v_charge_node)
336      context->v_charge_node = &(v_charge_node->output[NODE_CHILD_NODE_NUM(info->v_charge)]);
337   else
338   {
339      context->v_charge   = (info->v_charge == DEFAULT_555_CHARGE) ? info->v_pos : info->v_charge;
340      context->v_charge_node = NULL;
341
342      if (info->options & DISC_555_ASTABLE_HAS_FAST_CHARGE_DIODE) context->v_charge -= 0.5;
343   }
344
351345   if ((DSD_555_ASTBL__CTRLV != -1) && !context->use_ctrlv)
352346   {
353      /* Setup based on supplied static value */
347      /* Setup based on supplied Control Voltage static value */
354348      context->threshold = DSD_555_ASTBL__CTRLV;
355      context->trigger = DSD_555_ASTBL__CTRLV / 2.0;
349      context->trigger   = DSD_555_ASTBL__CTRLV / 2.0;
356350   }
357351   else
358352   {
359      /* use values passed in structure */
360      context->threshold = (info->threshold555 == DEFAULT_555_THRESHOLD) ? info->v555 *2 /3 : info->threshold555;
361      context->trigger =  (info->trigger555 == DEFAULT_555_TRIGGER) ? info->v555 /3 : info->trigger555;
353      /* Setup based on v_pos power source */
354      context->threshold = info->v_pos * 2.0 / 3.0;
355      context->trigger   = info->v_pos / 3.0;
362356   }
363357
364358   context->output_is_ac = info->options & DISC_555_OUT_AC;
365359   /* Calculate DC shift needed to make squarewave waveform AC */
366   context->ac_shift = context->output_is_ac ? -context->output_high_voltage / 2.0 : 0;
360   context->ac_shift = context->output_is_ac ? -context->v_out_high / 2.0 : 0;
367361
368   context->error = test_555(context->threshold, context->trigger, info->v555, node->node);
369
370   context->v555 = (info->options & DISC_555_ASTABLE_HAS_FAST_CHARGE_DIODE) ? info->v555 - 0.5: info->v555;
371362   context->flip_flop = 1;
372363   context->cap_voltage = 0;
373364
374   /* Used to adjust the ratio depending on if it is the extra percent or energy */
375   context->x_init = 0;
376   if (context->output_type == DISC_555_OUT_ENERGY)
377      context->x_init = discrete_current_context->sample_time;
378
379365   /* Step to set the output */
380366   dsd_555_astbl_step(node);
381367}
r3115r3116
401387
402388static void dsd_555_mstbl_step(node_description *node)
403389{
404   const discrete_555_desc *info = node->custom;
390   const discrete_555_desc     *info    = node->custom;
405391   struct dsd_555_mstbl_context *context = node->context;
406392
407   double vC;   // Current voltage on capacitor, before dt
408   double vCnext = 0;   // Voltage on capacitor, after dt
393   double v_cap;         /* Current voltage on capacitor, before dt */
394   double v_cap_next = 0;   /* Voltage on capacitor, after dt */
409395
410   if(DSD_555_MSTBL__RESET || context->error)
396   if(DSD_555_MSTBL__RESET)
411397   {
412398      /* We are in RESET */
413      /* If there was a fatal INIT error then we will also stay in RESET */
414      node->output[0] = 0;
415      context->flip_flop = 0;
399      node->output[0]     = 0;
400      context->flip_flop  = 0;
416401      context->cap_voltage = 0;
417402   }
418403   else
r3115r3116
435420      }
436421      else
437422      {
438         vC = context->cap_voltage;
423         v_cap = context->cap_voltage;
439424
440425         /* Sometimes a switching network is used to setup the capacitance.
441426             * These may select 'no' capacitor, causing oscillation to stop.
r3115r3116
444429         {
445430            context->flip_flop = 0;
446431            /* The voltage goes high because the cap circuit is open. */
447            vCnext = info->v555;
448            vC = info->v555;
432            v_cap_next = info->v_pos;
433            v_cap      = info->v_pos;
449434            context->cap_voltage = 0;
450435         }
451436         else
452437         {
453438            /* Charging */
454            vCnext = vC + ((info->v555 - vC) * (1.0 - exp(-(discrete_current_context->sample_time / (DSD_555_MSTBL__R * DSD_555_MSTBL__C)))));
439            v_cap_next = v_cap + ((info->v_pos - v_cap) * (1.0 - exp(-(discrete_current_context->sample_time / (DSD_555_MSTBL__R * DSD_555_MSTBL__C)))));
455440
456441            /* Has it charged past upper limit? */
457442            /* If trigger is still enabled, then we keep charging,
458443                 * regardless of threshold. */
459            if ((vCnext >= context->threshold) && !trigger)
444            if ((v_cap_next >= context->threshold) && !trigger)
460445            {
461               vCnext = 0;
462               vC = context->threshold;
446               v_cap_next = 0;
447               v_cap      = context->threshold;
463448               context->flip_flop = 0;
464449            }
465450         }
466451
467         context->cap_voltage = vCnext;
452         context->cap_voltage = v_cap_next;
468453
469454         switch (info->options & DISC_555_OUT_MASK)
470455         {
471456            case DISC_555_OUT_SQW:
472               node->output[0] = context->flip_flop * context->output_high_voltage;
457               node->output[0] = context->flip_flop * context->v_out_high;
473458               /* Fake it to AC if needed */
474459               if (context->output_is_ac)
475                  node->output[0] -= context->output_high_voltage / 2.0;
460                  node->output[0] -= context->v_out_high / 2.0;
476461               break;
477462            case DISC_555_OUT_CAP:
478               node->output[0] = vCnext;
463               node->output[0] = v_cap_next;
479464               /* Fake it to AC if needed */
480465               if (context->output_is_ac)
481466                  node->output[0] -= context->threshold * 3.0 /4.0;
r3115r3116
487472
488473static void dsd_555_mstbl_reset(node_description *node)
489474{
490   const discrete_555_desc *info = node->custom;
475   const discrete_555_desc     *info    = node->custom;
491476   struct dsd_555_mstbl_context *context = node->context;
492477
493478   context->output_type = info->options & DISC_555_OUT_MASK;
r3115r3116
497482      context->output_type = DISC_555_OUT_SQW;
498483   }
499484
500   /* Use the supplied values or set to defaults. */
501   context->threshold = (info->threshold555 == DEFAULT_555_THRESHOLD) ? info->v555 *2 /3 : info->threshold555;
502   context->trigger =  (info->trigger555 == DEFAULT_555_TRIGGER) ? info->v555 /3 : info->trigger555;
503   context->output_high_voltage = (info->v555high == DEFAULT_555_HIGH) ? info->v555 - 1.2 : info->v555high;
485   /* Use the defaults or supplied values. */
486   context->v_out_high = (info->v_out_high == DEFAULT_555_HIGH) ? info->v_pos - 1.2 : info->v_out_high;
487   context->v_charge   = (info->v_charge   == DEFAULT_555_CHARGE) ? info->v_pos : info->v_charge;
504488
489   /* Setup based on v_pos power source */
490   context->threshold = info->v_pos * 2.0 / 3.0;
491   context->trigger   = info->v_pos / 3.0;
492
505493   context->output_is_ac = info->options & DISC_555_OUT_AC;
506494   /* Calculate DC shift needed to make squarewave waveform AC */
507   context->ac_shift = context->output_is_ac ? -context->output_high_voltage / 2.0 : 0;
495   context->ac_shift     = context->output_is_ac ? -context->v_out_high / 2.0 : 0;
508496
509   context->error = test_555(context->threshold, context->trigger, info->v555, node->node);
510
511   context->trig_is_logic = (info->options & DISC_555_TRIGGER_IS_VOLTAGE) ? 0: 1;
497   context->trig_is_logic       = (info->options & DISC_555_TRIGGER_IS_VOLTAGE) ? 0: 1;
512498   context->trig_discharges_cap = (info->options & DISC_555_TRIGGER_DISCHARGES_CAP) ? 1: 0;
513499
514   context->flip_flop = 0;
500   context->flip_flop   = 0;
515501   context->cap_voltage = 0;
516502
517503   node->output[0] = 0;
r3115r3116
544530
545531static void dsd_555_cc_step(node_description *node)
546532{
547   const discrete_555_cc_desc *info = node->custom;
548   struct dsd_555_cc_context *context = node->context;
533   const  discrete_555_cc_desc *info    = node->custom;
534   struct dsd_555_cc_context   *context = node->context;
549535
550   int      count_f = 0;
551   int      count_r = 0;
552   double   i;         // Charging current created by vIn
553   double   rC = 0;      // Equivalent charging resistor
554   double   rD = 0;      // Equivalent discharging resistor
555   double   vi = 0;      // Equivalent voltage from current source
556   double   vB = 0;      // Equivalent voltage from bias voltage
557   double   v  = 0;      // Equivalent voltage total from current source and bias circuit if used
558   double   dt;         // change in time
559   double   xTime;   // time since change happened
560   double   tRC;      // RC time constant
561   double   vC;         // Current voltage on capacitor, before dt
562   double   vCnext = 0;   // Voltage on capacitor, after dt
563   double   viLimit;   // vIn and the junction voltage limit the max charging voltage from i
564   double   rTemp;      // play thing
536   int      count_f  = 0;
537   int      count_r  = 0;
538   double   i;               /* Charging current created by vIn */
539   double   r_charge = 0;      /* Equivalent charging resistor */
540   double   r_discharge = 0;   /* Equivalent discharging resistor */
541   double   vi     = 0;         /* Equivalent voltage from current source */
542   double   v_bias = 0;         /* Equivalent voltage from bias voltage */
543   double   v      = 0;         /* Equivalent voltage total from current source and bias circuit if used */
544   double   dt;               /* change in time */
545   double   x_time = 0;         /* time since change happened */
546   double   t_rc ;            /* RC time constant */
547   double   v_cap;            /* Current voltage on capacitor, before dt */
548   double   v_cap_next = 0;      /* Voltage on capacitor, after dt */
549   double   v_vcharge_limit;   /* vIn and the junction voltage limit the max charging voltage from i */
550   double   r_temp;            /* play thing */
565551
566552
567   if (DSD_555_CC__RESET || context->error)
553   if (DSD_555_CC__RESET)
568554   {
569555      /* We are in RESET */
570      /* If there was a fatal INIT error then we will also stay in RESET */
571      node->output[0] = 0;
572      context->flip_flop = 1;
556      node->output[0]      = 0;
557      context->flip_flop   = 1;
573558      context->cap_voltage = 0;
574559      return;
575560   }
576561
577   dt = discrete_current_context->sample_time;   // Change in time
578   xTime = context->x_init;
579   vC = context->cap_voltage;   // Set to voltage before change
580   viLimit = DSD_555_CC__VIN + info->vCCjunction;   // the max vC can be and still be charged by i
562   dt    = discrete_current_context->sample_time;   /* Change in time */
563   v_cap = context->cap_voltage;   /* Set to voltage before change */
564   v_vcharge_limit = DSD_555_CC__VIN + info->v_cc_junction;   /* the max v_cap can be and still be charged by i */
581565   /* Calculate charging current */
582   i = (info->vCCsource - viLimit) / DSD_555_CC__R;
566   i = (context->v_cc_source - v_vcharge_limit) / DSD_555_CC__R;
583567   if ( i < 0) i = 0;
584568
585569   if (info->options & DISCRETE_555_CC_TO_CAP)
r3115r3116
587571      vi = i * DSD_555_CC__RDIS;
588572   }
589573   else
590   switch (context->type)   // see dsd_555_cc_reset for descriptions
574   switch (context->type)   /* see dsd_555_cc_reset for descriptions */
591575   {
592576      case 1:
593         rD = DSD_555_CC__RDIS;
577         r_discharge = DSD_555_CC__RDIS;
594578      case 0:
595579         break;
596580      case 3:
597         rD = (DSD_555_CC__RDIS * DSD_555_CC__RGND) / (DSD_555_CC__RDIS + DSD_555_CC__RGND);
581         r_discharge = (DSD_555_CC__RDIS * DSD_555_CC__RGND) / (DSD_555_CC__RDIS + DSD_555_CC__RGND);
598582      case 2:
599         rC = DSD_555_CC__RGND;
600         vi = i * rC;
583         r_charge = DSD_555_CC__RGND;
584         vi       = i * r_charge;
601585         break;
602586      case 4:
603         rC = DSD_555_CC__RBIAS;
604         vi = i * rC;
605         vB = info->v555;
587         r_charge = DSD_555_CC__RBIAS;
588         vi       = i * r_charge;
589         v_bias   = info->v_pos;
606590         break;
607591      case 5:
608         rC = DSD_555_CC__RBIAS + DSD_555_CC__RDIS;
609         vi = i * DSD_555_CC__RBIAS;
610         vB = info->v555;
611         rD = DSD_555_CC__RDIS;
592         r_charge = DSD_555_CC__RBIAS + DSD_555_CC__RDIS;
593         vi       = i * DSD_555_CC__RBIAS;
594         v_bias   = info->v_pos;
595         r_discharge = DSD_555_CC__RDIS;
612596         break;
613597      case 6:
614         rC = (DSD_555_CC__RBIAS * DSD_555_CC__RGND) / (DSD_555_CC__RBIAS + DSD_555_CC__RGND);
615         vi = i * rC;
616         vB = info->v555 * (DSD_555_CC__RGND / (DSD_555_CC__RBIAS + DSD_555_CC__RGND));
598         r_charge = (DSD_555_CC__RBIAS * DSD_555_CC__RGND) / (DSD_555_CC__RBIAS + DSD_555_CC__RGND);
599         vi       = i * r_charge;
600         v_bias   = info->v_pos * (DSD_555_CC__RGND / (DSD_555_CC__RBIAS + DSD_555_CC__RGND));
617601         break;
618602      case 7:
619         rTemp = DSD_555_CC__RBIAS + DSD_555_CC__RDIS;
620         rC = (rTemp * DSD_555_CC__RGND) / (rTemp + DSD_555_CC__RGND);
621         rTemp += DSD_555_CC__RGND;
622         rTemp = DSD_555_CC__RGND / rTemp;   // now has voltage divider ratio, not resistance
623         vi = i * DSD_555_CC__RBIAS * rTemp;
624         vB = info->v555 * rTemp;
625         rD = (DSD_555_CC__RGND * DSD_555_CC__RDIS) / (DSD_555_CC__RGND + DSD_555_CC__RDIS);
603         r_temp   = DSD_555_CC__RBIAS + DSD_555_CC__RDIS;
604         r_charge = (r_temp * DSD_555_CC__RGND) / (r_temp + DSD_555_CC__RGND);
605         r_temp  += DSD_555_CC__RGND;
606         r_temp   = DSD_555_CC__RGND / r_temp;   /* now has voltage divider ratio, not resistance */
607         vi       = i * DSD_555_CC__RBIAS * r_temp;
608         v_bias   = info->v_pos * r_temp;
609         r_discharge = (DSD_555_CC__RGND * DSD_555_CC__RDIS) / (DSD_555_CC__RGND + DSD_555_CC__RDIS);
626610         break;
627611   }
628612
r3115r3116
639623               /* No charging current, so we have to discharge the cap
640624                     * due to cap and circuit losses.
641625                     */
642               tRC = DEFAULT_555_CAP_BLEED * DSD_555_CC__C;
643               vCnext = vC - (vC * (1.0 - exp(-(dt / tRC))));
626               t_rc       = DEFAULT_555_CAP_BLEED * DSD_555_CC__C;
627               v_cap_next = v_cap - (v_cap * (1.0 - exp(-(dt / t_rc ))));
644628               dt = 0;
645629            }
646630            else
647631            {
648632               /* Charging */
649633               /* iC=C*dv/dt  works out to dv=iC*dt/C */
650               vCnext = vC + (i * dt / DSD_555_CC__C);
634               v_cap_next = v_cap + (i * dt / DSD_555_CC__C);
651635               /* Yes, if the cap voltage has reached the max voltage it can,
652636                     * and the 555 threshold has not been reached, then oscillation stops.
653637                     * This is the way the actual electronics works.
654638                     * This is why you never play with the pots after being factory adjusted
655639                     * to work in the proper range. */
656               if (vCnext > viLimit) vCnext = viLimit;
640               if (v_cap_next > v_vcharge_limit) v_cap_next = v_vcharge_limit;
657641               dt = 0;
658642
659643               /* has it charged past upper limit? */
660               if (vCnext >= context->threshold)
644               if (v_cap_next >= context->threshold)
661645               {
662646                  /* calculate the overshoot time */
663                  dt = DSD_555_CC__C * (vCnext - context->threshold) / i;
664                  xTime = dt;
665                  vC = context->threshold;
647                  dt     = DSD_555_CC__C * (v_cap_next - context->threshold) / i;
648                  x_time = dt;
649                  v_cap  = context->threshold;
666650                  context->flip_flop = 0;
667651                  count_f++;
668652               }
r3115r3116
671655         else if (DSD_555_CC__RDIS)
672656         {
673657            /* Discharging */
674            tRC = DSD_555_CC__RDIS * DSD_555_CC__C;
658            t_rc = DSD_555_CC__RDIS * DSD_555_CC__C;
675659
676660            if (info->options & DISCRETE_555_CC_TO_CAP)
677661            {
r3115r3116
679663               /* Charging in discharge mode */
680664               /* If the cap voltage is past the current source charging limit
681665                     * then only the bias voltage will charge the cap. */
682               v = (vC < viLimit) ? vi : viLimit;
683               vCnext = vC + ((v - vC) * (1.0 - exp(-(dt / tRC))));
666               v          = (v_cap < v_vcharge_limit) ? vi : v_vcharge_limit;
667               v_cap_next = v_cap + ((v - v_cap) * (1.0 - exp(-(dt / t_rc ))));
684668            }
685669            else
686670            {
687               vCnext = vC - (vC * (1.0 - exp(-(dt / tRC))));
671               v_cap_next = v_cap - (v_cap * (1.0 - exp(-(dt / t_rc ))));
688672            }
689673
690674            dt = 0;
691675            /* has it discharged past lower limit? */
692            if (vCnext <= context->trigger)
676            if (v_cap_next <= context->trigger)
693677            {
694               dt = tRC * log(1.0 / (1.0 - ((context->trigger - vCnext) / vC)));
695               xTime = dt;
696               vC = context->trigger;
678               dt     = t_rc  * log(1.0 / (1.0 - ((context->trigger - v_cap_next) / v_cap)));
679               x_time = dt;
680               v_cap  = context->trigger;
697681               context->flip_flop = 1;
698682               count_r++;
699683            }
700684         }
701         else   // Immediate discharge. No change in dt.
685         else   /* Immediate discharge. No change in dt. */
702686         {
703            vC = context->trigger;
687            x_time = dt;
688            v_cap  = context->trigger;
704689            context->flip_flop = 1;
705690            count_r++;
706691         }
r3115r3116
715700               /* No charging current, so we have to discharge the cap
716701                     * due to rGnd.
717702                     */
718               tRC = DSD_555_CC__RGND * DSD_555_CC__C;
719               vCnext = vC - (vC * (1.0 - exp(-(dt / tRC))));
703               t_rc       = DSD_555_CC__RGND * DSD_555_CC__C;
704               v_cap_next = v_cap - (v_cap * (1.0 - exp(-(dt / t_rc ))));
720705               dt = 0;
721706            }
722707            else
r3115r3116
724709               /* Charging */
725710               /* If the cap voltage is past the current source charging limit
726711                     * then only the bias voltage will charge the cap. */
727               v = vB;
728               if (vC < viLimit) v += vi;
729               else if (context->type <= 3) v = viLimit;
712               v = v_bias;
713               if (v_cap < v_vcharge_limit) v += vi;
714               else if (context->type <= 3) v = v_vcharge_limit;
730715
731               tRC = rC * DSD_555_CC__C;
732               vCnext = vC + ((v - vC) * (1.0 - exp(-(dt / tRC))));
733               dt = 0;
716               t_rc       = r_charge * DSD_555_CC__C;
717               v_cap_next = v_cap + ((v - v_cap) * (1.0 - exp(-(dt / t_rc ))));
718               dt         = 0;
734719
735720               /* has it charged past upper limit? */
736               if (vCnext >= context->threshold)
721               if (v_cap_next >= context->threshold)
737722               {
738723                  /* calculate the overshoot time */
739                  dt = tRC * log(1.0 / (1.0 - ((vCnext - context->threshold) / (v - vC))));
740                  xTime = dt;
741                  vC = context->threshold;
724                  dt     = t_rc  * log(1.0 / (1.0 - ((v_cap_next - context->threshold) / (v - v_cap))));
725                  x_time = dt;
726                  v_cap  = context->threshold;
742727                  context->flip_flop = 0;
743728                  count_f++;
744729               }
745730            }
746731         }
747732         else /* Discharging */
748         if (rD)
733         if (r_discharge)
749734         {
750            tRC = rD * DSD_555_CC__C;
751            vCnext = vC - (vC * (1.0 - exp(-(dt / tRC))));
735            t_rc       = r_discharge * DSD_555_CC__C;
736            v_cap_next = v_cap - (v_cap * (1.0 - exp(-(dt / t_rc ))));
752737            dt = 0;
753738
754739            /* has it discharged past lower limit? */
755            if (vCnext <= context->trigger)
740            if (v_cap_next <= context->trigger)
756741            {
757742               /* calculate the overshoot time */
758               dt = tRC * log(1.0 / (1.0 - ((context->trigger - vCnext) / vC)));
759               xTime = dt;
760               vC = context->trigger;
743               dt     = t_rc  * log(1.0 / (1.0 - ((context->trigger - v_cap_next) / v_cap)));
744               x_time = dt;
745               v_cap  = context->trigger;
761746               context->flip_flop = 1;
762747               count_r++;
763748            }
764749         }
765         else   // Immediate discharge. No change in dt.
750         else   /* Immediate discharge. No change in dt. */
766751         {
767            vC = context->trigger;
752            x_time = dt;
753            v_cap  = context->trigger;
768754            context->flip_flop = 1;
769755            count_r++;
770756         }
771757      }
772758   } while(dt);
773759
774   context->cap_voltage = vCnext;
760   context->cap_voltage = v_cap_next;
775761
776762   /* Convert last switch time to a ratio */
777   xTime = xTime / discrete_current_context->sample_time;
763   x_time = x_time / discrete_current_context->sample_time;
778764
779765   switch (context->output_type)
780766   {
r3115r3116
785771            node->output[0] = 0;
786772         }
787773         else
788            node->output[0] = context->flip_flop * context->output_high_voltage;
774            node->output[0] = context->flip_flop * context->v_out_high;
789775         /* Fake it to AC if needed */
790776         node->output[0] += context->ac_shift;
791777         break;
792778      case DISC_555_OUT_CAP:
793         node->output[0] = vCnext + context->ac_shift;
779         node->output[0] = v_cap_next + context->ac_shift;
794780         break;
795781      case DISC_555_OUT_ENERGY:
796         node->output[0] = context->output_high_voltage * (context->flip_flop ? xTime : (1 - xTime));
782         if (x_time == 0) x_time = 1.0;
783         node->output[0]  = context->v_out_high * (context->flip_flop ? x_time : (1.0 - x_time));
797784         node->output[0] += context->ac_shift;
798785         break;
799786      case DISC_555_OUT_LOGIC_X:
800         node->output[0] = context->flip_flop + xTime;
787         node->output[0] = context->flip_flop + x_time;
801788         break;
802789      case DISC_555_OUT_COUNT_F_X:
803         node->output[0] = count_f + xTime;
790         node->output[0] = count_f ? count_f + x_time : count_f;
804791         break;
805792      case DISC_555_OUT_COUNT_R_X:
806         node->output[0] = count_r + xTime;
793         node->output[0] = count_r ? count_r + x_time : count_r;
807794         break;
808795      case DISC_555_OUT_COUNT_F:
809796         node->output[0] = count_f;
r3115r3116
816803
817804static void dsd_555_cc_reset(node_description *node)
818805{
819   const discrete_555_cc_desc *info = node->custom;
820   struct dsd_555_cc_context *context = node->context;
806   const  discrete_555_cc_desc *info    = node->custom;
807   struct dsd_555_cc_context   *context = node->context;
821808
822   context->flip_flop=1;
809   context->flip_flop   = 1;
823810   context->cap_voltage = 0;
824811
825812   context->output_type = info->options & DISC_555_OUT_MASK;
826813
827   /* Used to adjust the ratio depending on if it is the extra percent or energy */
828   context->x_init = 0;
829   if (context->output_type == DISC_555_OUT_ENERGY)
830      context->x_init = discrete_current_context->sample_time;
814   /* Use the defaults or supplied values. */
815   context->v_out_high  = (info->v_out_high  == DEFAULT_555_HIGH) ? info->v_pos - 1.2 : info->v_out_high;
816   context->v_cc_source = (info->v_cc_source == DEFAULT_555_CC_SOURCE) ? info->v_pos : info->v_cc_source;
831817
832   /* Use the supplied values or set to defaults. */
833   context->threshold = (info->threshold555 == DEFAULT_555_THRESHOLD) ? info->v555 *2 /3 : info->threshold555;
834   context->trigger =  (info->trigger555 == DEFAULT_555_TRIGGER) ? info->v555 /3 : info->trigger555;
835   context->output_high_voltage = (info->v555high == DEFAULT_555_HIGH) ? info->v555 - 1.2 : info->v555high;
818   /* Setup based on v_pos power source */
819   context->threshold = info->v_pos * 2.0 / 3.0;
820   context->trigger   = info->v_pos / 3.0;
836821
837822   context->output_is_ac = info->options & DISC_555_OUT_AC;
838823   /* Calculate DC shift needed to make squarewave waveform AC */
839   context->ac_shift = context->output_is_ac ? -context->output_high_voltage / 2.0 : 0;
824   context->ac_shift     = context->output_is_ac ? -context->v_out_high / 2.0 : 0;
840825
841   context->error = test_555(context->threshold, context->trigger, info->v555, node->node);
842
843826   /* There are 8 different types of basic oscillators
844827     * depending on the resistors used.  We will determine
845828     * the type of circuit at reset, because the ciruit type
846     * is constant. */
829     * is constant.
830     */
847831   context->type = (DSD_555_CC__RDIS > 0) | ((DSD_555_CC__RGND  > 0) << 1) | ((DSD_555_CC__RBIAS  > 0) << 2);
848832   /*
849833     * TYPES:
r3115r3116
995979 *
996980 * Apr 2006, D Renaud.
997981 ************************************************************************/
998#define DSD_555_VCO1__RESET   (*(node->input[0]))   // reset active low
982#define DSD_555_VCO1__RESET   (*(node->input[0]))   /* reset active low */
999983#define DSD_555_VCO1__VIN1   (*(node->input[1]))
1000984#define DSD_555_VCO1__VIN2   (*(node->input[2]))
1001985
1002986static void dsd_555_vco1_step(node_description *node)
1003987{
1004   const discrete_555_vco1_desc *info = node->custom;
1005   struct dsd_555_vco1_context *context = node->context;
988   const  discrete_555_vco1_desc *info    = node->custom;
989   struct dsd_555_vco1_context   *context = node->context;
1006990
1007991   int      count_f = 0;
1008992   int      count_r = 0;
1009   double   dt;         // change in time
1010   double   xTime = 0;   // time since change happened
1011   double   vC;         // Current voltage on capacitor, before dt
1012   double   vCnext = 0;   // Voltage on capacitor, after dt
993   double   dt;            /* change in time */
994   double   x_time  = 0;   /* time since change happened */
995   double   v_cap;         /* Current voltage on capacitor, before dt */
996   double   v_cap_next = 0;   /* Voltage on capacitor, after dt */
1013997
1014   dt = discrete_current_context->sample_time;   // Change in time
1015   vC = context->cap_voltage;
998   dt    = discrete_current_context->sample_time;   /* Change in time */
999   v_cap = context->cap_voltage;
10161000
10171001   /* Check: if the Control Voltage node is connected. */
1018   if (context->ctrlv_is_node && DSD_555_VCO1__RESET)   // reset active low
1002   if (context->ctrlv_is_node && DSD_555_VCO1__RESET)   /* reset active low */
10191003   {
10201004      /* If CV is less then .25V, the circuit will oscillate way out of range.
10211005         * So we will just ignore it when it happens. */
10221006      if (DSD_555_VCO1__VIN2 < .25) return;
10231007      /* If it is a node then calculate thresholds based on Control Voltage */
10241008      context->threshold = DSD_555_VCO1__VIN2;
1025      context->trigger = DSD_555_VCO1__VIN2 / 2.0;
1009      context->trigger   = DSD_555_VCO1__VIN2 / 2.0;
10261010      /* Since the thresholds may have changed we need to update the FF */
1027      if (vC >= context->threshold)
1011      if (v_cap >= context->threshold)
10281012      {
1013         x_time = dt;
10291014         context->flip_flop = 0;
10301015         count_f++;
10311016      }
10321017      else
1033      if (vC <= context->trigger)
1018      if (v_cap <= context->trigger)
10341019      {
1020         x_time = dt;
10351021         context->flip_flop = 1;
10361022         count_r++;
10371023      }
r3115r3116
10421028   {
10431029      if (context->flip_flop)
10441030      {
1045         // if we are in reset then toggle f/f and discharge
1046         if (!DSD_555_VCO1__RESET)   // reset active low
1031         /* if we are in reset then toggle f/f and discharge */
1032         if (!DSD_555_VCO1__RESET)   /* reset active low */
10471033         {
10481034            context->flip_flop = 0;
10491035            count_f++;
r3115r3116
10521038         {
10531039            /* Charging */
10541040            /* iC=C*dv/dt  works out to dv=iC*dt/C */
1055            vCnext = vC + (context->i_charge * dt / info->c);
1056            dt = 0;
1041            v_cap_next = v_cap + (context->i_charge * dt / info->c);
1042            dt         = 0;
10571043
10581044            /* has it charged past upper limit? */
1059            if (vCnext >= context->threshold)
1045            if (v_cap_next >= context->threshold)
10601046            {
1061               if (vCnext > context->threshold)
1062               {
1063                  /* calculate the overshoot time */
1064                  dt = info->c * (vCnext - context->threshold) / context->i_charge;
1065               }
1066               vC = context->threshold;
1047               /* calculate the overshoot time */
1048               dt     = info->c * (v_cap_next - context->threshold) / context->i_charge;
1049               v_cap  = context->threshold;
1050               x_time = dt;
10671051               context->flip_flop = 0;
10681052               count_f++;
1069               xTime = dt;
10701053            }
10711054         }
10721055      }
r3115r3116
10741057      {
10751058         /* Discharging */
10761059         /* iC=C*dv/dt  works out to dv=iC*dt/C */
1077         vCnext = vC - (context->i_discharge * dt / info->c);
1060         v_cap_next = v_cap - (context->i_discharge * dt / info->c);
10781061
1079         // if we are in reset, then the cap can discharge to 0
1080         if (!DSD_555_VCO1__RESET)   // reset active low
1062         /* if we are in reset, then the cap can discharge to 0 */
1063         if (!DSD_555_VCO1__RESET)   /* reset active low */
10811064         {
1082            if (vCnext < 0) vCnext = 0;
1065            if (v_cap_next < 0) v_cap_next = 0;
10831066            dt = 0;
10841067         }
10851068         else
10861069         {
1087            // if we are out of reset and the cap voltage is less then
1088            // the lower threshold, toggle f/f and start charging
1089            if (vC <= context->trigger)
1070            /* if we are out of reset and the cap voltage is less then
1071                 * the lower threshold, toggle f/f and start charging */
1072            if (v_cap <= context->trigger)
10901073            {
1091               context->flip_flop = 1;
1092               count_r++;
1074               if (context->flip_flop == 0)
1075               {
1076                  /* don't need to track x_time here */
1077                  context->flip_flop = 1;
1078                  count_r++;
1079               }
10931080            }
10941081            else
10951082            {
10961083               dt = 0;
10971084               /* has it discharged past lower limit? */
1098               if (vCnext <= context->trigger)
1085               if (v_cap_next <= context->trigger)
10991086               {
1100                  if (vCnext < context->trigger)
1101                  {
1102                     /* calculate the overshoot time */
1103                     dt = info->c * (vCnext - context->trigger) / context->i_discharge;
1104                  }
1105                  vC = context->trigger;
1087                  /* calculate the overshoot time */
1088                  dt     = info->c * (v_cap_next - context->trigger) / context->i_discharge;
1089                  v_cap  = context->trigger;
1090                  x_time = dt;
11061091                  context->flip_flop = 1;
11071092                  count_r++;
1108                  xTime = dt;
11091093               }
11101094            }
11111095         }
11121096      }
11131097   } while(dt);
11141098
1115   context->cap_voltage = vCnext;
1099   context->cap_voltage = v_cap_next;
11161100
1117   /* Convert last switch time to a ratio */
1118   xTime = xTime / discrete_current_context->sample_time;
1101   /* Convert last switch time to a ratio.  No x_time in reset. */
1102   x_time = x_time / discrete_current_context->sample_time;
1103   if (!DSD_555_VCO1__RESET) x_time = 0;
11191104
11201105   switch (context->output_type)
11211106   {
11221107      case DISC_555_OUT_SQW:
1123         node->output[0] = context->flip_flop * context->output_high_voltage + context->ac_shift;
1108         node->output[0] = context->flip_flop * context->v_out_high + context->ac_shift;
11241109         break;
11251110      case DISC_555_OUT_CAP:
1126         node->output[0] = vCnext;
1111         node->output[0] = v_cap_next;
11271112         /* Fake it to AC if needed */
11281113         if (context->output_is_ac)
11291114            node->output[0] -= context->threshold * 3.0 /4.0;
11301115         break;
11311116      case DISC_555_OUT_ENERGY:
1132         node->output[0] = context->output_high_voltage * (context->flip_flop ? xTime : (1 - xTime));
1117         if (x_time == 0) x_time = 1.0;
1118         node->output[0]  = context->v_out_high * (context->flip_flop ? x_time : (1.0 - x_time));
11331119         node->output[0] += context->ac_shift;
11341120         break;
11351121      case DISC_555_OUT_LOGIC_X:
1136         node->output[0] = context->flip_flop + xTime;
1122         node->output[0] = context->flip_flop + x_time;
11371123         break;
11381124      case DISC_555_OUT_COUNT_F_X:
1139         node->output[0] = count_f ? count_f + xTime : count_f;
1125         node->output[0] = count_f ? count_f + x_time : count_f;
11401126         break;
11411127      case DISC_555_OUT_COUNT_R_X:
1142         node->output[0] =  count_r ? count_r + xTime : count_r;
1128         node->output[0] =  count_r ? count_r + x_time : count_r;
11431129         break;
11441130      case DISC_555_OUT_COUNT_F:
11451131         node->output[0] = count_f;
r3115r3116
11521138
11531139static void dsd_555_vco1_reset(node_description *node)
11541140{
1155   const discrete_555_vco1_desc *info = node->custom;
1156   struct dsd_555_vco1_context *context = node->context;
1141   const  discrete_555_vco1_desc *info    = node->custom;
1142   struct dsd_555_vco1_context   *context = node->context;
11571143
11581144   double v_ratio_r3, v_ratio_r4_1, r_in_1;
11591145
1160   context->output_type = info->options & DISC_555_OUT_MASK;
1146   context->output_type = info->options & DISC_555_OUT_MASK;
11611147   context->output_is_ac = info->options & DISC_555_OUT_AC;
11621148
11631149   /* Setup op-amp parameters */
11641150
11651151   /* The voltage at op-amp +in is always a fixed ratio of the modulation voltage. */
1166   v_ratio_r3 = info->r3 / (info->r2 + info->r3);         // +in voltage
1152   v_ratio_r3 = info->r3 / (info->r2 + info->r3);         /* +in voltage */
11671153   /* The voltage at op-amp -in is 1 of 2 fixed ratios of the modulation voltage,
11681154     * based on the 555 Flip-Flop state. */
11691155   /* If the FF is 0, then only R1 is connected allowing the full modulation volatge to pass. */
11701156   /* v_ratio_r4_0 = 1 */
11711157   /* If the FF is 1, then R1 & R4 make a voltage divider similar to R2 & R3 */
1172   v_ratio_r4_1 = info->r4 / (info->r1 + info->r4);      // -in voltage
1158   v_ratio_r4_1 = info->r4 / (info->r1 + info->r4);      /* -in voltage */
11731159   /* the input resistance to the op amp depends on the FF state */
11741160   /* r_in_0 = info->r1 when FF = 0 */
1175   r_in_1 = 1.0 / (1.0 / info->r1 + 1.0 / info->r4);   // input resistance when r4 switched in
1161   r_in_1 = 1.0 / (1.0 / info->r1 + 1.0 / info->r4);   /* input resistance when r4 switched in */
11761162
11771163   /* Now that we know the voltages entering the op amp and the resistance for the
11781164     * FF states, we can predetermine the ratios for the charge/discharge currents. */
1179    context->i_discharge = (1 - v_ratio_r3) / info->r1;
1180    context->i_charge = (v_ratio_r3 - v_ratio_r4_1) / r_in_1;
1165   context->i_discharge = (1 - v_ratio_r3) / info->r1;
1166   context->i_charge    = (v_ratio_r3 - v_ratio_r4_1) / r_in_1;
11811167
11821168   /* the cap starts off discharged */
11831169   context->cap_voltage = 0;
r3115r3116
11851171   /* Setup 555 parameters */
11861172
11871173   /* There is no charge on the cap so the 555 goes high at init. */
1188   context->flip_flop = 1;
1174   context->flip_flop     = 1;
11891175   context->ctrlv_is_node = (node->input_is_node >> 2) & 1;
1190   context->output_high_voltage = (info->v555high == DEFAULT_555_HIGH) ? info->v555 - 1.2 : info->v555high;
1176   context->v_out_high    = (info->v_out_high == DEFAULT_555_HIGH) ? info->v_pos - 1.2 : info->v_out_high;
11911177
11921178   /* Calculate 555 thresholds.
11931179     * If the Control Voltage is a node, then the thresholds will be calculated each step.
11941180     * If the Control Voltage is a fixed voltage, then the thresholds will be calculated
1195     * from that.  Otherwise we will use the thresholds specified in the setup info. */
1181     * from that.  Otherwise we will use thresholds based on v_pos. */
11961182   if (!context->ctrlv_is_node && (DSD_555_VCO1__VIN2 != -1))
11971183   {
1198      /* Setup based on supplied static value */
1184      /* Setup based on supplied Control Voltage static value */
11991185      context->threshold = DSD_555_VCO1__VIN2;
1200      context->trigger = DSD_555_VCO1__VIN2 / 2.0;
1186      context->trigger   = DSD_555_VCO1__VIN2 / 2.0;
12011187   }
12021188   else
12031189   {
1204      /* use values passed in structure */
1205      context->threshold = (info->threshold555 == DEFAULT_555_THRESHOLD) ? info->v555 * 2 /3 : info->threshold555;
1206      context->trigger =  (info->trigger555 == DEFAULT_555_TRIGGER) ? info->v555 /3 : info->trigger555;
1190      /* Setup based on v_pos power source */
1191      context->threshold = info->v_pos * 2.0 / 3.0;
1192      context->trigger   = info->v_pos / 3.0;
12071193   }
12081194
12091195   /* Calculate DC shift needed to make squarewave waveform AC */
1210   context->ac_shift = context->output_is_ac ? -context->output_high_voltage / 2.0 : 0;
1196   context->ac_shift = context->output_is_ac ? -context->v_out_high / 2.0 : 0;
12111197}
12121198
12131199/************************************************************************
r3115r3116
12301216
12311217static void dsd_566_step(node_description *node)
12321218{
1233   const discrete_566_desc *info = node->custom;
1234   struct dsd_566_context *context = node->context;
1219   const  discrete_566_desc *info    = node->custom;
1220   struct dsd_566_context   *context = node->context;
12351221
1236   double i;   // Charging current created by vIn
1237   double dt;   // change in time
1238   double vC;   // Current voltage on capacitor, before dt
1239   double vCnext = 0;   // Voltage on capacitor, after dt
1222   double i;            /* Charging current created by vIn */
1223   double dt;            /* change in time */
1224   double v_cap;         /* Current voltage on capacitor, before dt */
1225   double v_cap_next = 0;   /* Voltage on capacitor, after dt */
1226   double v_charge;
12401227
12411228   if (DSD_566__ENABLE && !context->error)
12421229   {
1243      dt = discrete_current_context->sample_time;   // Change in time
1244      vC = context->cap_voltage;   // Set to voltage before change
1230      dt    = discrete_current_context->sample_time;   /* Change in time */
1231      v_cap = context->cap_voltage;   /* Set to voltage before change */
1232
1233      /* get the v_charge and update each step if it is a node */
1234      if (context->v_charge_node != NULL)
1235      {
1236         v_charge  = *context->v_charge_node;
1237         v_charge -= info->v_neg;
1238      }
1239      else
1240         v_charge = context->v_charge;
1241
12451242      /* Calculate charging current */
1246      i = (context->vDiff - DSD_566__VMOD) / DSD_566__R;
1243      i = (v_charge - DSD_566__VMOD) / DSD_566__R;
12471244
12481245      /* Keep looping until all toggling in time sample is used up. */
12491246      do
r3115r3116
12511248         if (context->flip_flop)
12521249         {
12531250            /* Discharging */
1254            vCnext = vC - (i * dt / DSD_566__C);
1255            dt = 0;
1251            v_cap_next = v_cap - (i * dt / DSD_566__C);
1252            dt         = 0;
12561253
12571254            /* has it discharged past lower limit? */
1258            if (vCnext <= context->thresholdLow)
1255            if (v_cap_next <= context->threshold_low)
12591256            {
1260               if (vCnext < context->thresholdLow)
1257               if (v_cap_next < context->threshold_low)
12611258               {
12621259                  /* calculate the overshoot time */
1263                  dt = DSD_566__C * (context->thresholdLow - vCnext) / i;
1260                  dt = DSD_566__C * (context->threshold_low - v_cap_next) / i;
12641261               }
1265               vC = context->thresholdLow;
1262               v_cap = context->threshold_low;
12661263               context->flip_flop = 0;
12671264               /*
12681265                     * If the sampling rate is too low and the desired frequency is too high
r3115r3116
12771274         {
12781275            /* Charging */
12791276            /* iC=C*dv/dt  works out to dv=iC*dt/C */
1280            vCnext = vC + (i * dt / DSD_566__C);
1281            dt = 0;
1277            v_cap_next = v_cap + (i * dt / DSD_566__C);
1278            dt         = 0;
12821279            /* Yes, if the cap voltage has reached the max voltage it can,
12831280                 * and the 566 threshold has not been reached, then oscillation stops.
12841281                 * This is the way the actual electronics works.
12851282                 * This is why you never play with the pots after being factory adjusted
12861283                 * to work in the proper range. */
1287            if (vCnext > DSD_566__VMOD) vCnext = DSD_566__VMOD;
1284            if (v_cap_next > DSD_566__VMOD) v_cap_next = DSD_566__VMOD;
12881285
12891286            /* has it charged past upper limit? */
1290            if (vCnext >= context->thresholdHigh)
1287            if (v_cap_next >= context->threshold_high)
12911288            {
1292               if (vCnext > context->thresholdHigh)
1289               if (v_cap_next > context->threshold_high)
12931290               {
12941291                  /* calculate the overshoot time */
1295                  dt = DSD_566__C * (vCnext - context->thresholdHigh) / i;
1292                  dt = DSD_566__C * (v_cap_next - context->threshold_high) / i;
12961293               }
1297               vC = context->thresholdHigh;
1294               v_cap = context->threshold_high;
12981295               context->flip_flop = 1;
12991296               context->state[1] = (context->state[1] + 1) & 0x03;
13001297            }
13011298         }
13021299      } while(dt);
13031300
1304      context->cap_voltage = vCnext;
1301      context->cap_voltage = v_cap_next;
13051302
13061303      switch (info->options & DISC_566_OUT_MASK)
13071304      {
r3115r3116
13231320               node->output[0] = context->flip_flop;
13241321            }
13251322            if ((info->options & DISC_566_OUT_MASK) != DISC_566_OUT_LOGIC)
1326               node->output[0] = context->flip_flop ? context->vSqrHigh : context->vSqrLow;
1323               node->output[0] = context->flip_flop ? context->v_sqr_high : context->v_sqr_low;
13271324            break;
13281325         case DISC_566_OUT_TRIANGLE:
13291326            /* we can ignore any unused states when
13301327                 * outputting the cap voltage */
1331            node->output[0] = vCnext;
1328            node->output[0] = v_cap_next;
13321329            if (info->options & DISC_566_OUT_AC)
1333               node->output[0] -= context->triOffset;
1330               node->output[0] -= context->triangle_ac_offset;
13341331            break;
13351332      }
13361333   }
r3115r3116
13401337
13411338static void dsd_566_reset(node_description *node)
13421339{
1343   const discrete_566_desc *info = node->custom;
1344   struct dsd_566_context *context = node->context;
1340   const  discrete_566_desc *info    = node->custom;
1341   struct dsd_566_context   *context = node->context;
1342   node_description *v_charge_node;
13451343
1346   double   temp;
1344   double   v_diff, temp;
13471345
13481346   context->error = 0;
1349   if (info->vNeg >= info->vPlus)
1347   if (info->v_neg >= info->v_pos)
13501348   {
1351      logerror("[vNeg >= vPlus] - NODE_%d DISABLED!\n", node->node - NODE_00);
1349      logerror("[v_neg >= v_pos] - NODE_%d DISABLED!\n", node->node - NODE_00);
13521350      context->error = 1;
1351      return;
13531352   }
13541353
1355   context->vDiff = info->vPlus - info->vNeg;
1356   context->flip_flop = 0;
1354   /* setup v_charge or node */
1355   v_charge_node = discrete_find_node(NULL, info->v_charge);
1356   if (v_charge_node)
1357      context->v_charge_node = &(v_charge_node->output[NODE_CHILD_NODE_NUM(info->v_charge)]);
1358   else
1359   {
1360      context->v_charge  = (info->v_charge == DEFAULT_566_CHARGE) ? info->v_pos : info->v_charge;
1361      context->v_charge -= info->v_neg;
1362      context->v_charge_node = NULL;
1363   }
1364
1365   v_diff = info->v_pos - info->v_neg;
1366   context->flip_flop   = 0;
13571367   context->cap_voltage = 0;
1358   context->state[0] = 0;
1359   context->state[1] = 0;
1368   context->state[0]    = 0;
1369   context->state[1]    = 0;
13601370
1361   /* The data sheets are crap on this IC.  I will have to get my hands on a chip
1371   /* The data sheets are useless for this IC.  I will have to get my hands on a chip
13621372     * to make real measurements.  For now this should work fine for 12V. */
1363   context->thresholdHigh = context->vDiff / 2 + info->vNeg;
1364   context->thresholdLow = context->thresholdHigh - (0.2 * context->vDiff);
1365   context->vSqrHigh = info->vPlus - 0.6;
1366   context->vSqrLow = context->thresholdHigh;
1373   context->threshold_high = v_diff / 2 + info->v_neg;
1374   context->threshold_low  = context->threshold_high - (0.2 * v_diff);
1375   context->v_sqr_high     = info->v_pos - 0.6;
1376   context->v_sqr_low      = context->threshold_high;
13671377
13681378   if (info->options & DISC_566_OUT_AC)
13691379   {
1370      temp = (context->vSqrHigh - context->vSqrLow) / 2;
1371      context->vSqrHigh = temp;
1372      context->vSqrLow = -temp;
1373      context->triOffset = context->thresholdHigh - (0.1 * context->vDiff);
1380      temp = (context->v_sqr_high - context->v_sqr_low) / 2;
1381      context->v_sqr_high =  temp;
1382      context->v_sqr_low  = -temp;
1383      context->triangle_ac_offset = context->threshold_high - (0.1 * v_diff);
13741384   }
13751385
13761386   /* Step the output */
r3115r3116
14101420
14111421   if (DSD_LS624__ENABLE)
14121422   {
1413      double dt;   // change in time
1414      double sample_t;
1415      double t;
1416      int lst, cntf=0, cntr=0;
1423      double   dt;   /* change in time */
1424      double   sample_t;
1425      double   t;
1426      int      lst, cntf=0, cntr=0;
14171427
1418      sample_t = discrete_current_context->sample_time;   // Change in time
1419      dt = LS624_T(DSD_LS624__C, DSD_LS624__VRNG, DSD_LS624__VMOD);
1420      dt = 16 * dt;
1421      t = context->remain;
1428      sample_t = discrete_current_context->sample_time;   /* Change in time */
1429      dt  = LS624_T(DSD_LS624__C, DSD_LS624__VRNG, DSD_LS624__VMOD);
1430      dt  = 16 * dt;
1431      t   = context->remain;
14221432      lst = context->state;
14231433      while (t + dt < sample_t)
14241434      {
r3115r3116
14311441      }
14321442      context->remain = t - sample_t;
14331443
1434      switch (context->outtype)
1444      switch (context->out_type)
14351445      {
14361446         case DISC_LS624_OUT_ENERGY:
14371447            node->output[0] = ((double) lst) * (1.0+context->remain/sample_t) - ((double) context->state) * context->remain/sample_t;
r3115r3116
14561466{
14571467   struct dsd_ls624_context *context = node->context;
14581468
1459   context->remain = 0;
1460   context->state = 0;
1461   context->outtype = DSD_LS624__OUTTYPE;
1469   context->remain   = 0;
1470   context->state    = 0;
1471   context->out_type = DSD_LS624__OUTTYPE;
14621472
14631473   /* Step the output */
14641474   dsd_ls624_step(node);
src/emu/sound/disc_wav.c
r3115r3116
1818 * DSS_SINEWAVE       - Sinewave generator source code
1919 * DSS_SQUAREWAVE     - Squarewave generator source code
2020 * DSS_SQUAREWFIX     - Squarewave generator - fixed frequency
21 * DSS_SQUAREWAVE2    - Squarewave generator - by tOn/tOff
21 * DSS_SQUAREWAVE2    - Squarewave generator - by t_on/t_off
2222 * DSS_TRIANGLEWAVE   - Triangle waveform generator
2323 *
2424 ************************************************************************/
r3115r3116
3333   int      clock_type;
3434   int      out_type;
3535   int      is_7492;
36   int      last;      // Last clock state
37   int      count;      // current count
38   double   t_clock;   // fixed counter clock in seconds
39   double   t_left;      // time unused during last sample in seconds
36   int      last;      /* Last clock state */
37   int      count;      /* current count */
38   double   t_clock;   /* fixed counter clock in seconds */
39   double   t_left;      /* time unused during last sample in seconds */
4040};
4141
4242struct dss_lfsr_context
4343{
4444   unsigned int   lfsr_reg;
45   int            last;      // Last clock state
46   double         t_clock;   // fixed counter clock in seconds
47   double         t_left;      // time unused during last sample in seconds
48   double         sampleStep;
49   double         shiftStep;
45   int            last;      /* Last clock state */
46   double         t_clock;   /* fixed counter clock in seconds */
47   double         t_left;      /* time unused during last sample in seconds */
48   double         sample_step;
5049   double         t;
5150   UINT8         reset_on_high;
5251   UINT8         invert_output;
r3115r3116
6261{
6362   int      clock_type;
6463   int      out_type;
65   int      last;      // Last clock state
66   double   t_clock;   // fixed counter clock in seconds
67   double   t_left;      // time unused during last sample in seconds
68   int      max1;      // Max 1 Count stored as int for easy use.
69   int      max2;      // Max 2 Count stored as int for easy use.
70   int      count1;      // current count1
71   int      count2;      // current count2
64   int      last;      /* Last clock state */
65   double   t_clock;   /* fixed counter clock in seconds */
66   double   t_left;      /* time unused during last sample in seconds */
67   int      max1;      /* Max 1 Count stored as int for easy use. */
68   int      max2;      /* Max 2 Count stored as int for easy use. */
69   int      count1;      /* current count1 */
70   int      count2;      /* current count2 */
7271};
7372
7473struct dss_op_amp_osc_context
7574{
76   const double *r1;      // pointers to resistor values
75   const double *r1;      /* pointers to resistor values */
7776   const double *r2;
7877   const double *r3;
7978   const double *r4;
r3115r3116
8281   const double *r7;
8382   const double *r8;
8483   int      type;
85   UINT8   flip_flop;      // flip/flop output state
86   UINT8   flip_flopXOR;   // flip_flop ^ flip_flopXOR, 0 = discharge, 1 = charge
84   UINT8   flip_flop;      /* flip/flop output state */
85   UINT8   flip_flop_xor;   /* flip_flop ^ flip_flop_xor, 0 = discharge, 1 = charge */
8786   UINT8   is_squarewave;
88   double   high_out_V;
89   double   thresholdLow;   // falling threshold
90   double   thresholdHigh;   // rising threshold
91   double   vCap;         // current capacitor voltage
92   double   rTotal;         // all input resistors in parallel
93   double   iFixed;         // fixed current at the input
94   double   temp1;         // Multi purpose
95   double   temp2;         // Multi purpose
96   double   temp3;         // Multi purpose
87   double   v_out_high;
88   double   threshold_low;   /* falling threshold */
89   double   threshold_high;   /* rising threshold */
90   double   v_cap;         /* current capacitor voltage */
91   double   r_total;      /* all input resistors in parallel */
92   double   i_fixed;      /* fixed current at the input */
93   double   temp1;         /* Multi purpose */
94   double   temp2;         /* Multi purpose */
95   double   temp3;         /* Multi purpose */
9796};
9897
9998struct dss_sawtoothwave_context
r3115r3116
104103
105104struct dss_schmitt_osc_context
106105{
107   double   ratioIn;      // ratio of total charging voltage that comes from the input
108   double   ratioFeedback;   // ratio of total charging voltage that comes from the feedback
109   double   vCap;         // current capacitor voltage
110   double   rc;            // r*c
106   double   ration_in;         /* ratio of total charging voltage that comes from the input */
107   double   ratio_feedback;   /* ratio of total charging voltage that comes from the feedback */
108   double   v_cap;            /* current capacitor voltage */
109   double   rc;               /* r*c */
111110   double   exponent;
112   int      state;         // state of the output
111   int      state;            /* state of the output */
113112   int      enable_type;
114113   UINT8   input_is_voltage;
115114};
r3115r3116
128127struct dss_squarewfix_context
129128{
130129   int      flip_flop;
131   double   sampleStep;
132   double   tLeft;
133   double   tOff;
134   double   tOn;
130   double   sample_step;
131   double   t_left;
132   double   t_off;
133   double   t_on;
135134};
136135
137136struct dss_trianglewave_context
r3115r3116
145144{
146145   double   w;
147146   double  wc;
148   double   vCap;
149   double  vG2_old;
150   double   Rp;
151   double  R1;
152   double  R2;
153   double  C;
147   double   v_cap;
148   double  v_g2_old;
149   double   rp;
150   double  r1;
151   double  r2;
152   double  c;
154153   double   tf_a;
155154   double   tf_b;
156155   double  tf_tab[DSS_INV_TAB_SIZE];
157156};
158157
158
159159/************************************************************************
160160 *
161161 * DSS_COUNTER - External clock Binary Counter
r3115r3116
177177#define DSS_COUNTER__DIR      (*(node->input[4]))
178178#define DSS_COUNTER__INIT      (*(node->input[5]))
179179#define DSS_COUNTER__CLOCK_TYPE   (*(node->input[6]))
180#define DSS_7492__CLOCK_TYPE    DSS_COUNTER__MAX
180181
181182static const int disc_7492_count[6] = {0x00, 0x01, 0x02, 0x04, 0x05, 0x06};
182183
183184static void dss_counter_step(node_description *node)
184185{
185   struct dss_counter_context *context = node->context;
186   double cycles;
187   int clock = 0, last_count, inc = 0;
188   int max = DSS_COUNTER__MAX;
189   double xTime = 0;
186   struct   dss_counter_context *context = node->context;
187   double   cycles;
188   int      clock = 0, last_count, inc = 0;
189   int      max;
190   double   x_time = 0;
190191
192   if (context->is_7492)
193      max = 5;
194   else
195      max = DSS_COUNTER__MAX;
196
191197   if (context->clock_type == DISC_CLK_IS_FREQ)
192198   {
193199      /* We need to keep clocking the internal clock even if disabled. */
194200      cycles = (context->t_left + discrete_current_context->sample_time) / context->t_clock;
195      inc = (int)cycles;
201      inc    = (int)cycles;
196202      context->t_left = (cycles - inc) * context->t_clock;
197      if (inc) xTime = context->t_left / discrete_current_context->sample_time;
203      if (inc) x_time = context->t_left / discrete_current_context->sample_time;
198204   }
199205   else
200206   {
201      clock = (int)DSS_COUNTER__CLOCK;
202      xTime = DSS_COUNTER__CLOCK - clock;
207      clock  = (int)DSS_COUNTER__CLOCK;
208      x_time = DSS_COUNTER__CLOCK - clock;
203209   }
204210
205211
206   /* If reset enabled then set output to the reset value.  No xTime in reset. */
212   /* If reset enabled then set output to the reset value.  No x_time in reset. */
207213   if (DSS_COUNTER__RESET)
208214   {
209215      context->count = DSS_COUNTER__INIT;
210      node->output[0] = context->is_7492 ? 0 : context->count;
216      node->output[0] = context->count;
211217      return;
212218   }
213219
r3115r3116
244250
245251      for (clock = 0; clock < inc; clock++)
246252      {
247         context->count += DSS_COUNTER__DIR ? 1 : -1; // up/down
253         context->count += DSS_COUNTER__DIR ? 1 : -1; /* up/down */
248254         if (context->count < 0) context->count = max;
249255         if (context->count > max) context->count = 0;
250256      }
r3115r3116
253259
254260      if (context->count != last_count)
255261      {
256         /* the xTime is only output if the output changed. */
262         /* the x_time is only output if the output changed. */
257263         switch (context->out_type)
258264         {
259265            case DISC_OUT_IS_ENERGY:
260               if (xTime != 0)
261                  node->output[0] = (context->count > last_count) ? (last_count + xTime) : (last_count - xTime);
266               if (x_time == 0) x_time = 1.0;
267               node->output[0] = last_count;
268               if (context->count > last_count)
269                  node->output[0] += (context->count - last_count) * x_time;
270               else
271                  node->output[0] -= (last_count - context->count) * x_time;
262272               break;
263273            case DISC_OUT_HAS_XTIME:
264               node->output[0] += xTime;
274               node->output[0] += x_time;
265275               break;
266276         }
267277      }
r3115r3116
274284{
275285   struct dss_counter_context *context = node->context;
276286
277   context->clock_type = (int)DSS_COUNTER__CLOCK_TYPE;
278   if (context->clock_type == DISC_COUNTER_IS_7492)
287   if ((int)DSS_COUNTER__CLOCK_TYPE & DISC_COUNTER_IS_7492)
279288   {
280      context->clock_type = DISC_CLK_ON_F_EDGE;
281      context->is_7492 = 1;
289      context->is_7492    = 1;
290      context->clock_type = (int)DSS_7492__CLOCK_TYPE;
282291   }
283292   else
284      context->is_7492 = 0;
285   if ((context->clock_type < DISC_CLK_ON_F_EDGE) || (context->clock_type > DISC_CLK_IS_FREQ))
286      discrete_log("Invalid clock type passed in NODE_%d\n", NODE_INDEX(node->node));
287   context->last = 0;
288   if (context->clock_type == DISC_CLK_IS_FREQ) context->t_clock = 1.0 / DSS_COUNTER__CLOCK;
289   context->t_left = 0;
290   context->count = DSS_COUNTER__INIT; /* count starts at reset value */
291   node->output[0] = DSS_COUNTER__INIT;
293   {
294      context->is_7492    = 0;
295      context->clock_type = (int)DSS_COUNTER__CLOCK_TYPE;
296   }
297   context->out_type    = context->clock_type & DISC_OUT_MASK;
298   context->clock_type &= DISC_CLK_MASK;
299
300   context->t_clock = 1.0 / DSS_COUNTER__CLOCK;
301   context->t_left  = 0;
302   context->last    = 0;
303   context->count   = DSS_COUNTER__INIT; /* count starts at reset value */
304   node->output[0]  = DSS_COUNTER__INIT;
292305}
293306
294307
r3115r3116
313326#define DSS_LFSR_NOISE__FEED   (*(node->input[4]))
314327#define DSS_LFSR_NOISE__BIAS   (*(node->input[5]))
315328
316int   dss_lfsr_function(int myfunc,int in0,int in1,int bitmask)
329static int   dss_lfsr_function(int myfunc, int in0, int in1, int bitmask)
317330{
318331   int retval;
319332
320   in0&=bitmask;
321   in1&=bitmask;
333   in0 &= bitmask;
334   in1 &= bitmask;
322335
323336   switch(myfunc)
324337   {
325338      case DISC_LFSR_XOR:
326         retval=in0^in1;
339         retval = in0 ^ in1;
327340         break;
328341      case DISC_LFSR_OR:
329         retval=in0|in1;
342         retval = in0 | in1;
330343         break;
331344      case DISC_LFSR_AND:
332         retval=in0&in1;
345         retval = in0 & in1;
333346         break;
334347      case DISC_LFSR_XNOR:
335         retval=in0^in1;
336         retval=retval^bitmask;   /* Invert output */
348         retval = in0 ^ in1;
349         retval = retval ^ bitmask;   /* Invert output */
337350         break;
338351      case DISC_LFSR_NOR:
339         retval=in0|in1;
340         retval=retval^bitmask;   /* Invert output */
352         retval = in0 | in1;
353         retval = retval ^ bitmask;   /* Invert output */
341354         break;
342355      case DISC_LFSR_NAND:
343         retval=in0&in1;
344         retval=retval^bitmask;   /* Invert output */
356         retval = in0 & in1;
357         retval = retval ^ bitmask;   /* Invert output */
345358         break;
346359      case DISC_LFSR_IN0:
347         retval=in0;
360         retval = in0;
348361         break;
349362      case DISC_LFSR_IN1:
350         retval=in1;
363         retval = in1;
351364         break;
352365      case DISC_LFSR_NOT_IN0:
353         retval=in0^bitmask;
366         retval = in0 ^ bitmask;
354367         break;
355368      case DISC_LFSR_NOT_IN1:
356         retval=in1^bitmask;
369         retval = in1 ^ bitmask;
357370         break;
358371      case DISC_LFSR_REPLACE:
359         retval=in0&~in1;
360         retval=retval|in1;
372         retval = in0 & ~in1;
373         retval = retval | in1;
361374         break;
362375      case DISC_LFSR_XOR_INV_IN0:
363         retval = in0^bitmask; /* invert in0 */
364         retval = retval^in1;  /* xor in1 */
376         retval = in0 ^ bitmask; /* invert in0 */
377         retval = retval ^ in1;  /* xor in1 */
365378         break;
366379      case DISC_LFSR_XOR_INV_IN1:
367         retval = in1^bitmask; /* invert in1 */
368         retval = retval^in0;  /* xor in0 */
380         retval = in1 ^ bitmask; /* invert in1 */
381         retval = retval ^ in0;  /* xor in0 */
369382         break;
370383      default:
371384         discrete_log("dss_lfsr_function - Invalid function type passed");
r3115r3116
380393
381394static void dss_lfsr_step(node_description *node)
382395{
383   const discrete_lfsr_desc *lfsr_desc = node->custom;
384   struct dss_lfsr_context *context = node->context;
396   const  discrete_lfsr_desc *lfsr_desc = node->custom;
397   struct dss_lfsr_context   *context   = node->context;
385398   double cycles;
386399   int clock, inc = 0;
387   int fb0,fb1,fbresult;
400   int fb0, fb1, fbresult;
388401
389402   if (lfsr_desc->clock_type == DISC_CLK_IS_FREQ)
390403   {
391404      /* We need to keep clocking the internal clock even if disabled. */
392405      cycles = (context->t_left + discrete_current_context->sample_time) / context->t_clock;
393      inc = (int)cycles;
406      inc    = (int)cycles;
394407      context->t_left = (cycles - inc) * context->t_clock;
395408   }
396409
r3115r3116
427440   for (clock = 0; clock < inc; clock++)
428441   {
429442      /* Fetch the last feedback result */
430      fbresult=((context->lfsr_reg)>>(lfsr_desc->bitlength))&0x01;
443      fbresult = (context->lfsr_reg >> lfsr_desc->bitlength) & 0x01;
431444
432445      /* Stage 2 feedback combine fbresultNew with infeed bit */
433      fbresult=dss_lfsr_function(lfsr_desc->feedback_function1,fbresult,((DSS_LFSR_NOISE__FEED)?0x01:0x00),0x01);
446      fbresult = dss_lfsr_function(lfsr_desc->feedback_function1, fbresult, (DSS_LFSR_NOISE__FEED ? 0x01 : 0x00), 0x01);
434447
435448      /* Stage 3 first we setup where the bit is going to be shifted into */
436      fbresult=fbresult*lfsr_desc->feedback_function2_mask;
449      fbresult = fbresult * lfsr_desc->feedback_function2_mask;
437450      /* Then we left shift the register, */
438      context->lfsr_reg=(context->lfsr_reg)<<1;
451      context->lfsr_reg = context->lfsr_reg << 1;
439452      /* Now move the fbresult into the shift register and mask it to the bitlength */
440      context->lfsr_reg=dss_lfsr_function(lfsr_desc->feedback_function2,fbresult, (context->lfsr_reg), ((1<<(lfsr_desc->bitlength))-1));
453      context->lfsr_reg = dss_lfsr_function(lfsr_desc->feedback_function2, fbresult, context->lfsr_reg, (1 << lfsr_desc->bitlength) - 1 );
441454
442455      /* Now get and store the new feedback result */
443456      /* Fetch the feedback bits */
444      fb0=((context->lfsr_reg)>>(lfsr_desc->feedback_bitsel0))&0x01;
445      fb1=((context->lfsr_reg)>>(lfsr_desc->feedback_bitsel1))&0x01;
457      fb0 = (context->lfsr_reg >> lfsr_desc->feedback_bitsel0) & 0x01;
458      fb1 = (context->lfsr_reg >> lfsr_desc->feedback_bitsel1) & 0x01;
446459      /* Now do the combo on them */
447      fbresult=dss_lfsr_function(lfsr_desc->feedback_function0,fb0,fb1,0x01);
448      context->lfsr_reg=dss_lfsr_function(DISC_LFSR_REPLACE,(context->lfsr_reg), fbresult<<(lfsr_desc->bitlength), ((2<<(lfsr_desc->bitlength))-1));
460      fbresult = dss_lfsr_function(lfsr_desc->feedback_function0, fb0, fb1, 0x01);
461      context->lfsr_reg = dss_lfsr_function(DISC_LFSR_REPLACE, context->lfsr_reg, fbresult << lfsr_desc->bitlength, (2 << lfsr_desc->bitlength) - 1);
449462
450463      /* Now select the output bit */
451464      if (context->out_is_f0)
452465         node->output[0] = fbresult & 0x01;
453466      else
454         node->output[0]=((context->lfsr_reg)>>(lfsr_desc->output_bit))&0x01;
467         node->output[0] = (context->lfsr_reg >> lfsr_desc->output_bit) & 0x01;
455468
456469      /* Final inversion if required */
457      if(context->invert_output) node->output[0]=(node->output[0])?0.0:1.0;
470      if (context->invert_output) node->output[0] = node->output[0] ? 0 : 1;
458471
459472      /* Gain stage */
460      node->output[0]=(node->output[0])?(DSS_LFSR_NOISE__AMP)/2:-(DSS_LFSR_NOISE__AMP)/2;
473      node->output[0] = node->output[0] ? DSS_LFSR_NOISE__AMP / 2 : -DSS_LFSR_NOISE__AMP / 2;
461474      /* Bias input as required */
462      node->output[0]=node->output[0]+DSS_LFSR_NOISE__BIAS;
475      node->output[0] = node->output[0] + DSS_LFSR_NOISE__BIAS;
463476   }
464477
465478   if(!DSS_LFSR_NOISE__ENABLE)
466479   {
467      node->output[0]=0;
480      node->output[0] = 0;
468481   }
469482}
470483
471484static void dss_lfsr_reset(node_description *node)
472485{
473   const discrete_lfsr_desc *lfsr_desc = node->custom;
474   struct dss_lfsr_context *context = node->context;
475   int fb0,fb1,fbresult;
486   const  discrete_lfsr_desc *lfsr_desc = node->custom;
487   struct dss_lfsr_context   *context   = node->context;
488   int    fb0 , fb1, fbresult;
476489
477490   context->reset_on_high = (lfsr_desc->flags & DISC_LFSR_FLAG_RESET_TYPE_H) ? 1 : 0;
478491   context->invert_output = lfsr_desc->flags & DISC_LFSR_FLAG_OUT_INVERT;
r3115r3116
484497   if (lfsr_desc->clock_type == DISC_CLK_IS_FREQ) context->t_clock = 1.0 / DSS_LFSR_NOISE__CLOCK;
485498   context->t_left = 0;
486499
487   context->lfsr_reg=lfsr_desc->reset_value;
500   context->lfsr_reg = lfsr_desc->reset_value;
488501
489502   /* Now get and store the new feedback result */
490503   /* Fetch the feedback bits */
491   fb0=((context->lfsr_reg)>>(lfsr_desc->feedback_bitsel0))&0x01;
492   fb1=((context->lfsr_reg)>>(lfsr_desc->feedback_bitsel1))&0x01;
504   fb0 = (context->lfsr_reg >> lfsr_desc->feedback_bitsel0) & 0x01;
505   fb1=(context->lfsr_reg >> lfsr_desc->feedback_bitsel1) & 0x01;
493506   /* Now do the combo on them */
494   fbresult=dss_lfsr_function(lfsr_desc->feedback_function0,fb0,fb1,0x01);
495   context->lfsr_reg=dss_lfsr_function(DISC_LFSR_REPLACE,(context->lfsr_reg), fbresult<<(lfsr_desc->bitlength), ((2<<(lfsr_desc->bitlength))-1));
507   fbresult = dss_lfsr_function(lfsr_desc->feedback_function0, fb0, fb1, 0x01);
508   context->lfsr_reg=dss_lfsr_function(DISC_LFSR_REPLACE, context->lfsr_reg, fbresult << lfsr_desc->bitlength, (2<< lfsr_desc->bitlength ) - 1);
496509
497510   /* Now select and setup the output bit */
498   node->output[0]=((context->lfsr_reg)>>(lfsr_desc->output_bit))&0x01;
511   node->output[0] = (context->lfsr_reg >> lfsr_desc->output_bit) & 0x01;
499512
500513   /* Final inversion if required */
501   if(lfsr_desc->flags&DISC_LFSR_FLAG_OUT_INVERT) node->output[0]=(node->output[0])?0.0:1.0;
514   if(lfsr_desc->flags & DISC_LFSR_FLAG_OUT_INVERT) node->output[0] = node->output[0] ? 0 : 1;
502515
503516   /* Gain stage */
504   node->output[0]=(node->output[0])?(DSS_LFSR_NOISE__AMP)/2:-(DSS_LFSR_NOISE__AMP)/2;
517   node->output[0] = node->output[0] ? DSS_LFSR_NOISE__AMP / 2 : -DSS_LFSR_NOISE__AMP / 2;
505518   /* Bias input as required */
506   node->output[0]=node->output[0]+DSS_LFSR_NOISE__BIAS;
519   node->output[0] = node->output[0] + DSS_LFSR_NOISE__BIAS;
507520}
508521
509522
r3115r3116
529542   if(DSS_NOISE__ENABLE)
530543   {
531544      /* Only sample noise on rollover to next cycle */
532      if(context->phase > (2.0*M_PI))
545      if(context->phase > (2.0 * M_PI))
533546      {
534547         /* GCC's rand returns a RAND_MAX value of 0x7fff */
535548         int newval = (mame_rand(Machine) & 0x7fff) - 16384;
r3115r3116
551564   }
552565
553566   /* Keep the new phasor in the 2Pi range.*/
554   context->phase = fmod(context->phase, 2.0*M_PI);
567   context->phase = fmod(context->phase, 2.0 * M_PI);
555568
556569   /* The enable input only curtails output, phase rotation still occurs. */
557570   /* We allow the phase to exceed 2Pi here, so we can tell when to sample the noise. */
558   context->phase += ((2.0*M_PI * DSS_NOISE__FREQ) / discrete_current_context->sample_rate);
571   context->phase += ((2.0 * M_PI * DSS_NOISE__FREQ) / discrete_current_context->sample_rate);
559572}
560573
561574
r3115r3116
592605{
593606   struct dss_note_context *context = node->context;
594607
595   double cycles;
596   int clock = 0, last_count2, inc = 0;
597   double xTime = 0;
608   double   cycles;
609   int      clock  = 0, last_count2, inc = 0;
610   double   x_time = 0;
598611
599612   if (context->clock_type == DISC_CLK_IS_FREQ)
600613   {
601614      /* We need to keep clocking the internal clock even if disabled. */
602615      cycles = (context->t_left + discrete_current_context->sample_time) / context->t_clock;
603      inc = (int)cycles;
616      inc    = (int)cycles;
604617      context->t_left = (cycles - inc) * context->t_clock;
605      if (inc) xTime = context->t_left / discrete_current_context->sample_time;
618      if (inc) x_time = context->t_left / discrete_current_context->sample_time;
606619   }
607620   else
608621   {
609      /* Seperate clock info from xTime info. */
622      /* Seperate clock info from x_time info. */
610623      clock = (int)DSS_NOTE__CLOCK;
611      xTime = DSS_NOTE__CLOCK - clock;
624      x_time = DSS_NOTE__CLOCK - clock;
612625   }
613626
614627   if (DSS_NOTE__ENABLE)
r3115r3116
647660            if (context->count1 > context->max1)
648661            {
649662               /* Max 1 count reached.  Load Data into counter. */
650               context->count1 = (int)DSS_NOTE__DATA;
663               context->count1 = (int)DSS_NOTE__DATA;
651664               context->count2 += 1;
652665               if (context->count2 > context->max2) context->count2 = 0;
653666            }
r3115r3116
657670      node->output[0] = context->count2;
658671      if (context->count2 != last_count2)
659672      {
660         /* the xTime is only output if the output changed. */
673         /* the x_time is only output if the output changed. */
661674         switch (context->out_type)
662675         {
663676            case DISC_OUT_IS_ENERGY:
664               if (xTime != 0)
665                  node->output[0] = (context->count2 > last_count2) ? (last_count2 + xTime) : (last_count2 - xTime);
677               if (x_time == 0) x_time = 1.0;
678               node->output[0] = last_count2;
679               if (context->count2 > last_count2)
680                  node->output[0] += (context->count2 - last_count2) * x_time;
681               else
682                  node->output[0] -= (last_count2 - context->count2) * x_time;
666683               break;
667684            case DISC_OUT_HAS_XTIME:
668               node->output[0] += xTime;
685               node->output[0] += x_time;
669686               break;
670687         }
671688      }
r3115r3116
679696   struct dss_note_context *context = node->context;
680697
681698   context->clock_type = (int)DSS_NOTE__CLOCK_TYPE & DISC_CLK_MASK;
682   context->out_type =  (int)DSS_NOTE__CLOCK_TYPE & DISC_OUT_MASK;
683   context->last = (DSS_NOTE__CLOCK != 0);
684   if (context->clock_type == DISC_CLK_IS_FREQ) context->t_clock = 1.0 / DSS_NOTE__CLOCK;
685   context->t_left = 0;
699   context->out_type   = (int)DSS_NOTE__CLOCK_TYPE & DISC_OUT_MASK;
686700
701   context->last    = (DSS_NOTE__CLOCK != 0);
702   context->t_left  = 0;
703   context->t_clock = 1.0 / DSS_NOTE__CLOCK;
704
687705   context->count1 = (int)DSS_NOTE__DATA;
688706   context->count2 = 0;
689   context->max1 = (int)DSS_NOTE__MAX1;
690   context->max2 = (int)DSS_NOTE__MAX2;
707   context->max1   = (int)DSS_NOTE__MAX1;
708   context->max2   = (int)DSS_NOTE__MAX2;
691709   node->output[0] = 0;
692710}
693711
r3115r3116
710728/* The inputs on a norton op-amp are (info->vP - OP_AMP_NORTON_VBE) */
711729/* which is the same as the output high voltage.  We will define them */
712730/* the same to save a calculation step */
713#define DSS_OP_AMP_OSC_NORTON_VP_IN      context->high_out_V
731#define DSS_OP_AMP_OSC_NORTON_VP_IN      context->v_out_high
714732
715733static void dss_op_amp_osc_step(node_description *node)
716734{
717   const discrete_op_amp_osc_info *info = node->custom;
718   struct dss_op_amp_osc_context *context = node->context;
735   const  discrete_op_amp_osc_info *info    = node->custom;
736   struct dss_op_amp_osc_context   *context = node->context;
719737
720738
721   double i;         // Charging current created by vIn
722   double v = 0;      // all input voltages mixed
723   double dt;         // change in time
724   double vC;         // Current voltage on capacitor, before dt
725   double vCnext = 0;   // Voltage on capacitor, after dt
726   double iCharge[2] = {0};
739   double i;         /* Charging current created by vIn */
740   double v = 0;      /* all input voltages mixed */
741   double dt;         /* change in time */
742   double vC;         /* Current voltage on capacitor, before dt */
743   double vCnext = 0;   /* Voltage on capacitor, after dt */
744   double iCharge[2]  = {0};
727745   UINT8 force_charge = 0;
728746   UINT8 enable = DSS_OP_AMP_OSC__ENABLE;
729747
730   dt = discrete_current_context->sample_time;   // Change in time
731   vC = context->vCap;   // Set to voltage before change
748   dt = discrete_current_context->sample_time;   /* Change in time */
749   vC = context->v_cap;   /* Set to voltage before change */
732750
733751   /* work out the charge currents for the VCOs. */
734752   switch (context->type)
735753   {
736754      case DISC_OP_AMP_OSCILLATOR_VCO_1:
737755         /* Work out the charge rates. */
738         i = DSS_OP_AMP_OSC__VMOD1 * context->temp1;      // i is not a current.  It is being used as a temp variable.
756         /* i is not a current.  It is being used as a temp variable. */
757         i = DSS_OP_AMP_OSC__VMOD1 * context->temp1;
739758         iCharge[0] = (DSS_OP_AMP_OSC__VMOD1 - i) / info->r1;
740759         iCharge[1] = (i - (DSS_OP_AMP_OSC__VMOD1 * context->temp2)) / context->temp3;
741760         break;
r3115r3116
746765         double i1, i2;
747766         /* Work out the charge rates. */
748767         iCharge[0] = DSS_OP_AMP_OSC_NORTON_VP_IN / *context->r1;
749         iCharge[1] = (context->high_out_V - OP_AMP_NORTON_VBE) / *context->r2 - iCharge[0];
768         iCharge[1] = (context->v_out_high - OP_AMP_NORTON_VBE) / *context->r2 - iCharge[0];
750769         /* Work out the Inverting Schmitt thresholds. */
751770         i1 = DSS_OP_AMP_OSC_NORTON_VP_IN / *context->r5;
752771         i2 = (0.0 - OP_AMP_NORTON_VBE) / *context->r4;
753         context->thresholdLow = (i1 + i2) * *context->r3 + OP_AMP_NORTON_VBE;
754         i2 = (context->high_out_V - OP_AMP_NORTON_VBE) / *context->r4;
755         context->thresholdHigh = (i1 + i2) * *context->r3 + OP_AMP_NORTON_VBE;
772         context->threshold_low  = (i1 + i2) * *context->r3 + OP_AMP_NORTON_VBE;
773         i2 = (context->v_out_high - OP_AMP_NORTON_VBE) / *context->r4;
774         context->threshold_high = (i1 + i2) * *context->r3 + OP_AMP_NORTON_VBE;
756775         break;
757776      }
758777
r3115r3116
766785         else
767786         {
768787            /* we need to mix any bias and all modulation voltages together. */
769            i = context->iFixed;
788            i = context->i_fixed;
770789            i += DSS_OP_AMP_OSC__VMOD1 / info->r7;
771790            if (info->r8 != 0)
772791               i += DSS_OP_AMP_OSC__VMOD2 / info->r8;
773            v = i * context->rTotal;
792            v = i * context->r_total;
774793         }
775794
776795         /* Work out the charge rates. */
r3115r3116
792811         /* then the osc is disabled and the cap keeps charging */
793812         if (iCharge[0] < 0)
794813         {
795            force_charge = 1;
796            iCharge[0] *= -1;
814            force_charge =  1;
815            iCharge[0]  *= -1;
797816         }
798817         break;
799818
800819      case DISC_OP_AMP_OSCILLATOR_VCO_3 | DISC_OP_AMP_IS_NORTON:
801820         /* we need to mix any bias and all modulation voltages together. */
802         iCharge[0] = context->iFixed;
821         iCharge[0] = context->i_fixed;
803822         v = DSS_OP_AMP_OSC__VMOD1 - OP_AMP_NORTON_VBE;
804823         iCharge[0] += v / info->r1;
805824         if (info->r6 != 0)
r3115r3116
817836      /* Keep looping until all toggling in time sample is used up. */
818837      do
819838      {
820         if ((context->flip_flop ^ context->flip_flopXOR) || force_charge)
839         if ((context->flip_flop ^ context->flip_flop_xor) || force_charge)
821840         {
822841            /* Charging */
823842            /* iC=C*dv/dt  works out to dv=iC*dt/C */
r3115r3116
825844            dt = 0;
826845
827846            /* has it charged past upper limit? */
828            if (vCnext > context->thresholdHigh)
847            if (vCnext > context->threshold_high)
829848            {
830               context->flip_flop = context->flip_flopXOR;
849               context->flip_flop = context->flip_flop_xor;
831850               toggled++;
832851               if (force_charge)
833852               {
834853                  /* we need to keep charging the cap to the max thereby disabling the circuit */
835                  if (vCnext > context->high_out_V)
836                     vCnext = context->high_out_V;
854                  if (vCnext > context->v_out_high)
855                     vCnext = context->v_out_high;
837856               }
838857               else
839858               {
840859                  /* calculate the overshoot time */
841                  dt = info->c * (vCnext - context->thresholdHigh) / iCharge[1];
842                  vC = context->thresholdHigh;
860                  dt = info->c * (vCnext - context->threshold_high) / iCharge[1];
861                  vC = context->threshold_high;
843862               }
844863            }
845864         }
r3115r3116
847866         {
848867            /* Discharging */
849868            vCnext = vC - (iCharge[0] * dt / info->c);
850            dt = 0;
869            dt     = 0;
851870
852871            /* has it discharged past lower limit? */
853            if (vCnext < context->thresholdLow)
872            if (vCnext < context->threshold_low)
854873            {
855               context->flip_flop = !context->flip_flopXOR;
874               context->flip_flop = !context->flip_flop_xor;
856875               toggled++;
857876               /* calculate the overshoot time */
858               dt = info->c * (context->thresholdLow - vCnext) / iCharge[0];
859               vC = context->thresholdLow;
877               dt = info->c * (context->threshold_low - vCnext) / iCharge[0];
878               vC = context->threshold_low;
860879            }
861880         }
862881      } while(dt);
863882
864      context->vCap = vCnext;
883      context->v_cap = vCnext;
865884
866885      if (context->is_squarewave)
867886      {
r3115r3116
870889            /* squarewave to happen in the sample time causing it to be missed. */
871890            /* If we toggle 2 states we force the missed output for 1 sample. */
872891            /* If more then 2 states happen, there is no hope, the sample rate is just too low. */
873            node->output[0] = context->high_out_V * (context->flip_flop ? 0 : 1);
892            node->output[0] = context->v_out_high * (context->flip_flop ? 0 : 1);
874893         else
875            node->output[0] = context->high_out_V * context->flip_flop;
894            node->output[0] = context->v_out_high * context->flip_flop;
876895      }
877896      else
878         node->output[0] = context->vCap;
897         node->output[0] = context->v_cap;
879898   }
880899   else
881900   {
r3115r3116
893912   int loop;
894913   node_description *r_node;
895914
896   double i1 = 0;   // inverting input current
897   double i2 = 0;   // non-inverting input current
915   double i1 = 0;   /* inverting input current */
916   double i2 = 0;   /* non-inverting input current */
898917
899918   /* link to resistor static or node values */
900   r_info_ptr = &info->r1;
919   r_info_ptr    = &info->r1;
901920   r_context_ptr = &context->r1;
902921   for (loop = 0; loop < 8; loop ++)
903922   {
r3115r3116
912931      r_context_ptr++;
913932   }
914933
915   context->is_squarewave = (info->type & DISC_OP_AMP_OSCILLATOR_OUT_SQW);
916   context->type = info->type & DISC_OP_AMP_OSCILLATOR_TYPE_MASK;
934   context->is_squarewave = info->type & DISC_OP_AMP_OSCILLATOR_OUT_SQW;
935   context->type          = info->type & DISC_OP_AMP_OSCILLATOR_TYPE_MASK;
917936
918937   switch (context->type)
919938   {
920939      case DISC_OP_AMP_OSCILLATOR_VCO_1:
921940         /* The charge rates vary depending on vMod so they are not precalculated. */
922941         /* Charges while FlipFlop High */
923         context->flip_flopXOR = 0;
942         context->flip_flop_xor = 0;
924943         /* Work out the Non-inverting Schmitt thresholds. */
925944         context->temp1 = (info->vP / 2) / info->r4;
926945         context->temp2 = (info->vP - OP_AMP_VP_RAIL_OFFSET) / info->r3;
927946         context->temp3 = 1.0 / (1.0 / info->r3 + 1.0 / info->r4);
928         context->thresholdLow = context->temp1 * context->temp3;
929         context->thresholdHigh = (context->temp1 + context->temp2) * context->temp3;
947         context->threshold_low  =  context->temp1 * context->temp3;
948         context->threshold_high = (context->temp1 + context->temp2) * context->temp3;
930949         /* There is no charge on the cap so the schmitt goes high at init. */
931950         context->flip_flop = 1;
932951         /* Setup some commonly used stuff */
933         context->temp1 = info->r5 / (info->r2 + info->r5);         // voltage ratio across r5
934         context->temp2 = info->r6 / (info->r1 + info->r6);         // voltage ratio across r6
935         context->temp3 = 1.0 / (1.0 / info->r1 + 1.0 / info->r6);   // input resistance when r6 switched in
952         context->temp1 = info->r5 / (info->r2 + info->r5);         /* voltage ratio across r5 */
953         context->temp2 = info->r6 / (info->r1 + info->r6);         /* voltage ratio across r6 */
954         context->temp3 = 1.0 / (1.0 / info->r1 + 1.0 / info->r6);   /* input resistance when r6 switched in */
936955         break;
937956
938957      case DISC_OP_AMP_OSCILLATOR_1 | DISC_OP_AMP_IS_NORTON:
939958         /* Charges while FlipFlop High */
940         context->flip_flopXOR = 0;
959         context->flip_flop_xor = 0;
941960         /* There is no charge on the cap so the schmitt inverter goes high at init. */
942961         context->flip_flop = 1;
943962         break;
944963
945964      case DISC_OP_AMP_OSCILLATOR_VCO_1 | DISC_OP_AMP_IS_NORTON:
946965         /* Charges while FlipFlop Low */
947         context->flip_flopXOR = 1;
966         context->flip_flop_xor = 1;
948967         /* There is no charge on the cap so the schmitt goes low at init. */
949968         context->flip_flop = 0;
950969         /* The charge rates vary depending on vMod so they are not precalculated. */
951970         /* But we can precalculate the fixed currents. */
952         context->iFixed = 0;
953         if (info->r6 != 0) context->iFixed += info->vP / info->r6;
954         context->iFixed += OP_AMP_NORTON_VBE / info->r1;
955         context->iFixed += OP_AMP_NORTON_VBE / info->r2;
971         context->i_fixed = 0;
972         if (info->r6 != 0) context->i_fixed += info->vP / info->r6;
973         context->i_fixed += OP_AMP_NORTON_VBE / info->r1;
974         context->i_fixed += OP_AMP_NORTON_VBE / info->r2;
956975         /* Work out the input resistance to be used later to calculate the Millman voltage. */
957         context->rTotal = 1.0 / info->r1 + 1.0 / info->r2 + 1.0 / info->r7;
958         if (info->r6) context->rTotal += 1.0 / info->r6;
959         if (info->r8) context->rTotal += 1.0 / info->r8;
960         context->rTotal = 1.0 / context->rTotal;
976         context->r_total = 1.0 / info->r1 + 1.0 / info->r2 + 1.0 / info->r7;
977         if (info->r6) context->r_total += 1.0 / info->r6;
978         if (info->r8) context->r_total += 1.0 / info->r8;
979         context->r_total = 1.0 / context->r_total;
961980         /* Work out the Non-inverting Schmitt thresholds. */
962981         i1 = (info->vP - OP_AMP_NORTON_VBE) / info->r5;
963982         i2 = (info->vP - OP_AMP_NORTON_VBE - OP_AMP_NORTON_VBE) / info->r4;
964         context->thresholdLow = (i1 - i2) * info->r3 + OP_AMP_NORTON_VBE;
983         context->threshold_low = (i1 - i2) * info->r3 + OP_AMP_NORTON_VBE;
965984         i2 = (0.0 - OP_AMP_NORTON_VBE) / info->r4;
966         context->thresholdHigh = (i1 - i2) * info->r3 + OP_AMP_NORTON_VBE;
985         context->threshold_high = (i1 - i2) * info->r3 + OP_AMP_NORTON_VBE;
967986         break;
968987
969988      case DISC_OP_AMP_OSCILLATOR_VCO_2 | DISC_OP_AMP_IS_NORTON:
970989         /* Charges while FlipFlop High */
971         context->flip_flopXOR = 0;
990         context->flip_flop_xor = 0;
972991         /* There is no charge on the cap so the schmitt inverter goes high at init. */
973992         context->flip_flop = 1;
974993         /* Work out the charge rates. */
r3115r3116
977996         /* Work out the Inverting Schmitt thresholds. */
978997         i1 = (info->vP - OP_AMP_NORTON_VBE) / info->r5;
979998         i2 = (0.0 - OP_AMP_NORTON_VBE) / info->r4;
980         context->thresholdLow = (i1 + i2) * info->r3 + OP_AMP_NORTON_VBE;
999         context->threshold_low = (i1 + i2) * info->r3 + OP_AMP_NORTON_VBE;
9811000         i2 = (info->vP - OP_AMP_NORTON_VBE - OP_AMP_NORTON_VBE) / info->r4;
982         context->thresholdHigh = (i1 + i2) * info->r3 + OP_AMP_NORTON_VBE;
1001         context->threshold_high = (i1 + i2) * info->r3 + OP_AMP_NORTON_VBE;
9831002         break;
9841003
9851004      case DISC_OP_AMP_OSCILLATOR_VCO_3 | DISC_OP_AMP_IS_NORTON:
9861005         /* Charges while FlipFlop High */
987         context->flip_flopXOR = 0;
1006         context->flip_flop_xor = 0;
9881007         /* There is no charge on the cap so the schmitt inverter goes high at init. */
9891008         context->flip_flop = 1;
9901009         /* Work out the charge rates. */
9911010         /* The charge rates vary depending on vMod so they are not precalculated. */
9921011         /* But we can precalculate the fixed currents. */
993         if (info->r7 != 0) context->iFixed = (info->vP - OP_AMP_NORTON_VBE) / info->r7;
1012         if (info->r7 != 0) context->i_fixed = (info->vP - OP_AMP_NORTON_VBE) / info->r7;
9941013         context->temp1 = (info->vP - OP_AMP_NORTON_VBE - OP_AMP_NORTON_VBE) / info->r2;
9951014         /* Work out the Inverting Schmitt thresholds. */
9961015         i1 = (info->vP - OP_AMP_NORTON_VBE) / info->r5;
9971016         i2 = (0.0 - OP_AMP_NORTON_VBE) / info->r4;
998         context->thresholdLow = (i1 + i2) * info->r3 + OP_AMP_NORTON_VBE;
1017         context->threshold_low = (i1 + i2) * info->r3 + OP_AMP_NORTON_VBE;
9991018         i2 = (info->vP - OP_AMP_NORTON_VBE - OP_AMP_NORTON_VBE) / info->r4;
1000         context->thresholdHigh = (i1 + i2) * info->r3 + OP_AMP_NORTON_VBE;
1019         context->threshold_high = (i1 + i2) * info->r3 + OP_AMP_NORTON_VBE;
10011020         break;
10021021   }
10031022
1004   context->high_out_V = info->vP - ((context->type & DISC_OP_AMP_IS_NORTON) ? OP_AMP_NORTON_VBE : OP_AMP_VP_RAIL_OFFSET);
1005   context->vCap = 0;
1023   context->v_out_high = info->vP - ((context->type & DISC_OP_AMP_IS_NORTON) ? OP_AMP_NORTON_VBE : OP_AMP_VP_RAIL_OFFSET);
1024   context->v_cap      = 0;
10061025
10071026   dss_op_amp_osc_step(node);
10081027}
r3115r3116
10331052
10341053   if(DSS_SAWTOOTHWAVE__ENABLE)
10351054   {
1036      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)));
1037      node->output[0]-=DSS_SAWTOOTHWAVE__AMP/2.0;
1055      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)));
1056      node->output[0] -= DSS_SAWTOOTHWAVE__AMP / 2.0;
10381057      /* Add DC Bias component */
1039      node->output[0]=node->output[0]+DSS_SAWTOOTHWAVE__BIAS;
1058      node->output[0] = node->output[0] + DSS_SAWTOOTHWAVE__BIAS;
10401059   }
10411060   else
10421061   {
1043      node->output[0]=0;
1062      node->output[0] = 0;
10441063   }
10451064
10461065   /* Work out the phase step based on phase/freq & sample rate */
r3115r3116
10501069   /*                    boils out to                           */
10511070   /*     phase step = (2Pi*output freq)/sample freq)           */
10521071   /* Also keep the new phasor in the 2Pi range.                */
1053   context->phase=fmod((context->phase+((2.0*M_PI*DSS_SAWTOOTHWAVE__FREQ)/discrete_current_context->sample_rate)),2.0*M_PI);
1072   context->phase = fmod((context->phase + ((2.0 * M_PI * DSS_SAWTOOTHWAVE__FREQ) / discrete_current_context->sample_rate)), 2.0 * M_PI);
10541073}
10551074
10561075static void dss_sawtoothwave_reset(node_description *node)
r3115r3116
10591078   double start;
10601079
10611080   /* Establish starting phase, convert from degrees to radians */
1062   start=(DSS_SAWTOOTHWAVE__PHASE/360.0)*(2.0*M_PI);
1081   start = (DSS_SAWTOOTHWAVE__PHASE / 360.0) * (2.0 * M_PI);
10631082   /* Make sure its always mod 2Pi */
1064   context->phase=fmod(start,2.0*M_PI);
1083   context->phase=fmod(start, 2.0 * M_PI);
10651084
10661085   /* Invert gradient depending on sawtooth type /|/|/|/|/| or |\|\|\|\|\ */
1067   context->type=(DSS_SAWTOOTHWAVE__GRAD)?1:0;
1086   context->type=(DSS_SAWTOOTHWAVE__GRAD) ? 1 : 0;
10681087
10691088   /* Step the node to set the output */
10701089   dss_sawtoothwave_step(node);
r3115r3116
10891108
10901109static void dss_schmitt_osc_step(node_description *node)
10911110{
1092   const discrete_schmitt_osc_desc *info = node->custom;
1093   struct dss_schmitt_osc_context *context = node->context;
1111   const  discrete_schmitt_osc_desc *info    = node->custom;
1112   struct dss_schmitt_osc_context   *context = node->context;
10941113
1095   double supply, vCap, new_vCap, t, exponent;
1114   double supply, v_cap, new_vCap, t, exponent;
10961115
10971116   /* We will always oscillate.  The enable just affects the output. */
1098   vCap = context->vCap;
1117   v_cap    = context->v_cap;
10991118   exponent = context->exponent;
11001119
11011120   /* Keep looping until all toggling in time sample is used up. */
r3115r3116
11051124      /* The charging voltage to the cap is the sum of the input voltage and the gate
11061125         * output voltage in the ratios determined by their resistors in a divider network.
11071126         * The input voltage is selectable as straight voltage in or logic level that will
1108         * use vGate as its voltage.  Note that ratioIn is just the ratio of the total
1109         * voltage and needs to be multipled by the input voltage.  ratioFeedback has
1127         * use vGate as its voltage.  Note that ration_in is just the ratio of the total
1128         * voltage and needs to be multipled by the input voltage.  ratio_feedback has
11101129         * already been multiplied by vGate to save time because that voltage never changes. */
1111      supply = context->input_is_voltage ? context->ratioIn * DSS_SCHMITT_OSC__VIN : (DSS_SCHMITT_OSC__VIN ? context->ratioIn * info->vGate : 0);
1112      supply += (context->state ? context->ratioFeedback : 0);
1113      new_vCap = vCap + ((supply - vCap) * exponent);
1130      supply   = context->input_is_voltage ? context->ration_in * DSS_SCHMITT_OSC__VIN : (DSS_SCHMITT_OSC__VIN ? context->ration_in * info->vGate : 0);
1131      supply  += (context->state ? context->ratio_feedback : 0);
1132      new_vCap = v_cap + ((supply - v_cap) * exponent);
11141133      if (context->state)
11151134      {
11161135         /* Charging */
r3115r3116
11181137         if (new_vCap > info->trshRise)
11191138         {
11201139            /* calculate the overshoot time */
1121            t = context->rc * log(1.0 / (1.0 - ((new_vCap - info->trshRise) / (info->vGate - vCap))));
1140            t = context->rc * log(1.0 / (1.0 - ((new_vCap - info->trshRise) / (info->vGate - v_cap))));
11221141            /* calculate new exponent because of reduced time */
11231142            exponent = 1.0 - exp(-t / context->rc);
1124            vCap = new_vCap = info->trshRise;
1143            v_cap    = new_vCap = info->trshRise;
11251144            context->state = 0;
11261145         }
11271146      }
r3115r3116
11321151         if (new_vCap < info->trshFall)
11331152         {
11341153            /* calculate the overshoot time */
1135            t = context->rc * log(1.0 / (1.0 - ((info->trshFall - new_vCap) / vCap)));
1154            t = context->rc * log(1.0 / (1.0 - ((info->trshFall - new_vCap) / v_cap)));
11361155            /* calculate new exponent because of reduced time */
11371156            exponent = 1.0 - exp(-t / context->rc);
1138            vCap = new_vCap = info->trshFall;
1157            v_cap    = new_vCap = info->trshFall;
11391158            context->state = 1;
11401159         }
11411160      }
11421161   } while(t);
11431162
1144   context->vCap = new_vCap;
1163   context->v_cap = new_vCap;
11451164
11461165   switch (context->enable_type)
11471166   {
r3115r3116
11631182
11641183static void dss_schmitt_osc_reset(node_description *node)
11651184{
1166   const discrete_schmitt_osc_desc *info = node->custom;
1167   struct dss_schmitt_osc_context *context = node->context;
1185   const  discrete_schmitt_osc_desc *info    = node->custom;
1186   struct dss_schmitt_osc_context   *context = node->context;
11681187   double rSource;
11691188
1170   context->enable_type = info->options & DISC_SCHMITT_OSC_ENAB_MASK;
1189   context->enable_type      = info->options & DISC_SCHMITT_OSC_ENAB_MASK;
11711190   context->input_is_voltage = (info->options & DISC_SCHMITT_OSC_IN_IS_VOLTAGE) ? 1 : 0;
11721191
11731192   /* The 2 resistors make a voltage divider, so their ratios add together
11741193     * to make the charging voltage. */
1175   context->ratioIn = info->rFeedback / (info->rIn + info->rFeedback);
1176   context->ratioFeedback = info->rIn / (info->rIn + info->rFeedback) * info->vGate;
1194   context->ration_in      = info->rFeedback / (info->rIn + info->rFeedback);
1195   context->ratio_feedback = info->rIn / (info->rIn + info->rFeedback) * info->vGate;
11771196
11781197   /* The voltage source resistance works out to the 2 resistors in parallel.
11791198     * So use this for the RC charge constant. */
1180   rSource = 1.0 / ((1.0 / info->rIn) + (1.0 / info->rFeedback));
1199   rSource     = 1.0 / ((1.0 / info->rIn) + (1.0 / info->rFeedback));
11811200   context->rc = rSource * info->c;
11821201   context->exponent = -1.0 / (context->rc  * discrete_current_context->sample_rate);
11831202   context->exponent = 1.0 - exp(context->exponent);
11841203
11851204   /* Cap is at 0V on power up.  Causing output to be high. */
1186   context->vCap = 0;
1205   context->v_cap = 0;
11871206   context->state = 1;
11881207
11891208   node->output[0] = info->options ? 0 : DSS_SCHMITT_OSC__AMP;
r3115r3116
12141233   /* Set the output */
12151234   if(DSS_SINEWAVE__ENABLE)
12161235   {
1217      node->output[0]=(DSS_SINEWAVE__AMPL/2.0) * sin(context->phase);
1236      node->output[0] = (DSS_SINEWAVE__AMPL / 2.0) * sin(context->phase);
12181237      /* Add DC Bias component */
1219      node->output[0]=node->output[0]+DSS_SINEWAVE__BIAS;
1238      node->output[0] = node->output[0] + DSS_SINEWAVE__BIAS;
12201239   }
12211240   else
12221241   {
1223      node->output[0]=0;
1242      node->output[0] = 0;
12241243   }
12251244
12261245   /* Work out the phase step based on phase/freq & sample rate */
r3115r3116
12301249   /*                    boils out to                           */
12311250   /*     phase step = (2Pi*output freq)/sample freq)           */
12321251   /* Also keep the new phasor in the 2Pi range.                */
1233   context->phase=fmod((context->phase+((2.0*M_PI*DSS_SINEWAVE__FREQ)/discrete_current_context->sample_rate)),2.0*M_PI);
1252   context->phase=fmod((context->phase + ((2.0 * M_PI * DSS_SINEWAVE__FREQ) / discrete_current_context->sample_rate)), 2.0 * M_PI);
12341253}
12351254
12361255static void dss_sinewave_reset(node_description *node)
r3115r3116
12391258   double start;
12401259
12411260   /* Establish starting phase, convert from degrees to radians */
1242   start=(DSS_SINEWAVE__PHASE/360.0)*(2.0*M_PI);
1261   start = (DSS_SINEWAVE__PHASE / 360.0) * (2.0 * M_PI);
12431262   /* Make sure its always mod 2Pi */
1244   context->phase=fmod(start,2.0*M_PI);
1263   context->phase = fmod(start, 2.0 * M_PI);
12451264   /* Step the output to make it correct */
12461265   dss_sinewave_step(node);
12471266}
r3115r3116
12771296   if(DSS_SQUAREWAVE__ENABLE)
12781297   {
12791298      if(context->phase>context->trigger)
1280         node->output[0]=(DSS_SQUAREWAVE__AMP/2.0);
1299         node->output[0] = DSS_SQUAREWAVE__AMP /2.0;
12811300      else
1282         node->output[0]=-(DSS_SQUAREWAVE__AMP/2.0);
1301         node->output[0] =- DSS_SQUAREWAVE__AMP / 2.0;
12831302
12841303      /* Add DC Bias component */
1285      node->output[0]=node->output[0]+DSS_SQUAREWAVE__BIAS;
1304      node->output[0] = node->output[0] + DSS_SQUAREWAVE__BIAS;
12861305   }
12871306   else
12881307   {
1289      node->output[0]=0;
1308      node->output[0] = 0;
12901309   }
12911310
12921311   /* Work out the phase step based on phase/freq & sample rate */
r3115r3116
12961315   /*                    boils out to                           */
12971316   /*     phase step = (2Pi*output freq)/sample freq)           */
12981317   /* Also keep the new phasor in the 2Pi range.                */
1299   context->phase=fmod((context->phase+((2.0*M_PI*DSS_SQUAREWAVE__FREQ)/discrete_current_context->sample_rate)),2.0*M_PI);
1318   context->phase=fmod(context->phase + ((2.0 * M_PI * DSS_SQUAREWAVE__FREQ) / discrete_current_context->sample_rate), 2.0 * M_PI);
13001319}
13011320
13021321static void dss_squarewave_reset(node_description *node)
r3115r3116
13051324   double start;
13061325
13071326   /* Establish starting phase, convert from degrees to radians */
1308   start=(DSS_SQUAREWAVE__PHASE/360.0)*(2.0*M_PI);
1327   start = (DSS_SQUAREWAVE__PHASE / 360.0) * (2.0 * M_PI);
13091328   /* Make sure its always mod 2Pi */
1310   context->phase=fmod(start,2.0*M_PI);
1329   context->phase = fmod(start, 2.0 * M_PI);
13111330
13121331   /* Step the output */
13131332   dss_squarewave_step(node);
r3115r3116
13361355{
13371356   struct dss_squarewfix_context *context = node->context;
13381357
1339   context->tLeft -= context->sampleStep;
1358   context->t_left -= context->sample_step;
13401359
13411360   /* The enable input only curtails output, phase rotation still occurs */
1342   while (context->tLeft <= 0)
1361   while (context->t_left <= 0)
13431362   {
13441363      context->flip_flop = context->flip_flop ? 0 : 1;
1345      context->tLeft += context->flip_flop ? context->tOn : context->tOff;
1364      context->t_left   += context->flip_flop ? context->t_on : context->t_off;
13461365   }
13471366
13481367   if(DSS_SQUAREWFIX__ENABLE)
13491368   {
13501369      /* Add gain and DC Bias component */
13511370
1352      context->tOff = 1.0 / DSS_SQUAREWFIX__FREQ;   /* cycle time */
1353      context->tOn = context->tOff * (DSS_SQUAREWFIX__DUTY / 100.0);
1354      context->tOff -= context->tOn;
1371      context->t_off  = 1.0 / DSS_SQUAREWFIX__FREQ;   /* cycle time */
1372      context->t_on   = context->t_off * (DSS_SQUAREWFIX__DUTY / 100.0);
1373      context->t_off -= context->t_on;
13551374
13561375      node->output[0] = (context->flip_flop ? DSS_SQUAREWFIX__AMP / 2.0 : -(DSS_SQUAREWFIX__AMP / 2.0)) + DSS_SQUAREWFIX__BIAS;
13571376   }
r3115r3116
13651384{
13661385   struct dss_squarewfix_context *context = node->context;
13671386
1368   context->sampleStep = 1.0 / discrete_current_context->sample_rate;
1369   context->flip_flop = 1;
1387   context->sample_step = 1.0 / discrete_current_context->sample_rate;
1388   context->flip_flop   = 1;
13701389
13711390   /* Do the intial time shift and convert freq to off/on times */
1372   context->tOff = 1.0 / DSS_SQUAREWFIX__FREQ;   /* cycle time */
1373   context->tLeft = DSS_SQUAREWFIX__PHASE / 360.0;   /* convert start phase to % */
1374   context->tLeft = context->tLeft - (int)context->tLeft;   /* keep % between 0 & 1 */
1375   context->tLeft = (context->tLeft < 0) ? 1.0 + context->tLeft : context->tLeft;   /* if - then flip to + phase */
1376   context->tLeft *= context->tOff;
1377   context->tOn = context->tOff * (DSS_SQUAREWFIX__DUTY / 100.0);
1378   context->tOff -= context->tOn;
1391   context->t_off   = 1.0 / DSS_SQUAREWFIX__FREQ;   /* cycle time */
1392   context->t_left  = DSS_SQUAREWFIX__PHASE / 360.0;   /* convert start phase to % */
1393   context->t_left  = context->t_left - (int)context->t_left;   /* keep % between 0 & 1 */
1394   context->t_left  = (context->t_left < 0) ? 1.0 + context->t_left : context->t_left;   /* if - then flip to + phase */
1395   context->t_left *= context->t_off;
1396   context->t_on    = context->t_off * (DSS_SQUAREWFIX__DUTY / 100.0);
1397   context->t_off  -= context->t_on;
13791398
1380   context->tLeft = -context->tLeft;
1399   context->t_left = -context->t_left;
13811400
13821401   /* toggle output and work out intial time shift */
1383   while (context->tLeft <= 0)
1402   while (context->t_left <= 0)
13841403   {
13851404      context->flip_flop = context->flip_flop ? 0 : 1;
1386      context->tLeft += context->flip_flop ? context->tOn : context->tOff;
1405      context->t_left   += context->flip_flop ? context->t_on : context->t_off;
13871406   }
13881407
13891408   /* Step the output */
r3115r3116
14181437   if(DSS_SQUAREWAVE2__ENABLE)
14191438   {
14201439      /* Establish trigger phase from time periods */
1421      context->trigger=(DSS_SQUAREWAVE2__T_OFF / (DSS_SQUAREWAVE2__T_OFF + DSS_SQUAREWAVE2__T_ON)) * (2.0 * M_PI);
1440      context->trigger = (DSS_SQUAREWAVE2__T_OFF / (DSS_SQUAREWAVE2__T_OFF + DSS_SQUAREWAVE2__T_ON)) * (2.0 * M_PI);
14221441
14231442      /* Work out the phase step based on phase/freq & sample rate */
14241443      /* The enable input only curtails output, phase rotation     */
r3115r3116
14321451      context->phase = fmod(newphase, 2.0 * M_PI);
14331452
14341453      if(context->phase>context->trigger)
1435         node->output[0]=(DSS_SQUAREWAVE2__AMP/2.0);
1454         node->output[0] = DSS_SQUAREWAVE2__AMP / 2.0;
14361455      else
1437         node->output[0]=-(DSS_SQUAREWAVE2__AMP/2.0);
1456         node->output[0] = -DSS_SQUAREWAVE2__AMP / 2.0;
14381457
14391458      /* Add DC Bias component */
14401459      node->output[0] = node->output[0] + DSS_SQUAREWAVE2__BIAS;
14411460   }
14421461   else
14431462   {
1444      node->output[0]=0;
1463      node->output[0] = 0;
14451464   }
14461465}
14471466
r3115r3116
14831502
14841503INLINE double dss_inverter_tftab(node_description *node, double x)
14851504{
1486   const discrete_inverter_osc_desc *info = node->custom;
1487   struct dss_inverter_osc_context *context = node->context;
1505   const  discrete_inverter_osc_desc *info    = node->custom;
1506   struct dss_inverter_osc_context   *context = node->context;
14881507
14891508   x = x / info->vB;
1490   if (x>0)
1491       return info->vB * exp(-context->tf_a * pow(x,context->tf_b));
1509   if (x > 0)
1510       return info->vB * exp(-context->tf_a * pow(x, context->tf_b));
14921511   else
14931512      return info->vB;
14941513}
14951514
14961515INLINE double dss_inverter_tf(node_description *node, double x)
14971516{
1498   const discrete_inverter_osc_desc *info = node->custom;
1499   struct dss_inverter_osc_context *context = node->context;
1517   const  discrete_inverter_osc_desc *info    = node->custom;
1518   struct dss_inverter_osc_context   *context = node->context;
1519
15001520   if (x < 0.0)
15011521      return info->vB;
15021522   else if (x <= info->vB)
1503      return context->tf_tab[(int)((double)(DSS_INV_TAB_SIZE-1) * x / info->vB)];
1523      return context->tf_tab[(int)((double)(DSS_INV_TAB_SIZE - 1) * x / info->vB)];
15041524   else
1505      return context->tf_tab[DSS_INV_TAB_SIZE-1];
1525      return context->tf_tab[DSS_INV_TAB_SIZE - 1];
15061526}
15071527
15081528static void dss_inverter_osc_step(node_description *node)
15091529{
1510   struct dss_inverter_osc_context *context = node->context;
1511   const discrete_inverter_osc_desc *info = node->custom;
1512   double diff,vG1,vG2, vG3, vI;
1530   struct dss_inverter_osc_context   *context = node->context;
1531   const  discrete_inverter_osc_desc *info = node->custom;
1532
1533   double diff, vG1, vG2, vG3, vI;
15131534   double vMix, rMix;
15141535
15151536   /* Get new state */
1516   vI = context->vCap + context->vG2_old;
1537   vI = context->v_cap + context->v_g2_old;
15171538   switch (info->options & DISC_OSC_INVERTER_TYPE_MASK)
15181539   {
15191540      case DISC_OSC_INVERTER_IS_TYPE1:
15201541      case DISC_OSC_INVERTER_IS_TYPE3:
1521         vG1 = dss_inverter_tf(node,vI);
1522         vG2 = dss_inverter_tf(node,vG1);
1523         vG3 = dss_inverter_tf(node,vG2);
1542         vG1 = dss_inverter_tf(node, vI);
1543         vG2 = dss_inverter_tf(node, vG1);
1544         vG3 = dss_inverter_tf(node, vG2);
15241545         break;
15251546      case DISC_OSC_INVERTER_IS_TYPE2:
15261547         vG1 = 0;
1527         vG3 = dss_inverter_tf(node,vI);
1528         vG2 = dss_inverter_tf(node,vG3);
1548         vG3 = dss_inverter_tf(node, vI);
1549         vG2 = dss_inverter_tf(node, vG3);
15291550         break;
15301551      case DISC_OSC_INVERTER_IS_TYPE4:
1531         vI = MIN(DSS_INVERTER_OSC__ENABLE, vI + 0.7);
1552         vI = MIN(DSS_INVERTER_OSC__ENABLE, vI + 0.7);
15321553         vG1 = 0;
1533         vG3 = dss_inverter_tf(node,vI);
1534         vG2 = dss_inverter_tf(node,vG3);
1554         vG3 = dss_inverter_tf(node, vI);
1555         vG2 = dss_inverter_tf(node, vG3);
15351556         break;
15361557      case DISC_OSC_INVERTER_IS_TYPE5:
1537         vI = MAX(DSS_INVERTER_OSC__ENABLE, vI - 0.7);
1558         vI = MAX(DSS_INVERTER_OSC__ENABLE, vI - 0.7);
15381559         vG1 = 0;
15391560         vG3 = dss_inverter_tf(node,vI);
15401561         vG2 = dss_inverter_tf(node,vG3);
r3115r3116
15511572         {
15521573            vI = MAX(vI, (- info->clamp));
15531574            vI = MIN(vI, info->vB + info->clamp);
1554            diff = vG3 * (context->Rp / (context->Rp + context->R1))
1555                 - (context->vCap + vG2)
1556                 + vI*(context->R1 / (context->Rp + context->R1));
1575            diff = vG3 * (context->rp / (context->rp + context->r1))
1576                 - (context->v_cap + vG2)
1577                 + vI*(context->r1 / (context->rp + context->r1));
15571578            diff = diff - diff * context->wc;
15581579         }
15591580         else
15601581         {
1561            diff = vG3 - (context->vCap + vG2);
1582            diff = vG3 - (context->v_cap + vG2);
15621583            diff = diff - diff * context->w;
15631584         }
15641585         break;
r3115r3116
15681589            vI = MAX(vI, (- info->clamp));
15691590            vI = MIN(vI, info->vB + info->clamp);
15701591         }
1571         // FIXME handle R2 = 0
1572         rMix = (context->R1 * context->R2) / (context->R1 + context->R2);
1573         vMix = rMix* ((vG3-vG2) / context->R1 + (DSS_INVERTER_OSC__MOD-vG2) / context->R2);
1592         /*  FIXME handle r2 = 0  */
1593         rMix = (context->r1 * context->r2) / (context->r1 + context->r2);
1594         vMix = rMix* ((vG3 - vG2) / context->r1 + (DSS_INVERTER_OSC__MOD-vG2) / context->r2);
15741595         if (vMix < (vI-vG2-0.7))
15751596         {
1576            rMix = 1.0/rMix + 1.0/context->Rp;
1597            rMix = 1.0 / rMix + 1.0 / context->rp;
15771598            rMix = 1.0 / rMix;
1578            vMix = rMix* ( (vG3-vG2) / context->R1 + (DSS_INVERTER_OSC__MOD-vG2) / context->R2 + (vI-0.7-vG2)/context->Rp);
1599            vMix = rMix* ( (vG3-vG2) / context->r1 + (DSS_INVERTER_OSC__MOD-vG2) / context->r2 + (vI-0.7-vG2)/context->rp);
15791600         }
1580         diff = vMix - context->vCap;
1581         diff = diff - diff * exp(-discrete_current_context->sample_time/(context->C * rMix));
1601         diff = vMix - context->v_cap;
1602         diff = diff - diff * exp(-discrete_current_context->sample_time / (context->c * rMix));
15821603         break;
15831604      case DISC_OSC_INVERTER_IS_TYPE5:
15841605         if ((info->clamp >= 0.0) && ((vI< - info->clamp) || (vI> info->vB+info->clamp)))
r3115r3116
15861607            vI = MAX(vI, (- info->clamp));
15871608            vI = MIN(vI, info->vB + info->clamp);
15881609         }
1589         // FIXME handle R2 = 0
1590         rMix = (context->R1 * context->R2) / (context->R1 + context->R2);
1591         vMix = rMix* ((vG3-vG2) / context->R1 + (DSS_INVERTER_OSC__MOD-vG2) / context->R2);
1592         if (vMix > (vI-vG2+0.7))
1610         /*  FIXME handle r2 = 0  */
1611         rMix = (context->r1 * context->r2) / (context->r1 + context->r2);
1612         vMix = rMix* ((vG3 - vG2) / context->r1 + (DSS_INVERTER_OSC__MOD-vG2) / context->r2);
1613         if (vMix > (vI -vG2 +0.7))
15931614         {
1594            rMix = 1.0/rMix + 1.0/context->Rp;
1615            rMix = 1.0 / rMix + 1.0/context->rp;
15951616            rMix = 1.0 / rMix;
1596            vMix = rMix* ( (vG3-vG2) / context->R1 + (DSS_INVERTER_OSC__MOD-vG2) / context->R2 + (vI+0.7-vG2)/context->Rp);
1617            vMix = rMix* ( (vG3 - vG2) / context->r1 + (DSS_INVERTER_OSC__MOD-vG2) / context->r2 + (vI+0.7-vG2)/context->rp);
15971618         }
1598         diff = vMix - context->vCap;
1599         diff = diff - diff * exp(-discrete_current_context->sample_time/(context->C * rMix));
1619         diff = vMix - context->v_cap;
1620         diff = diff - diff * exp(-discrete_current_context->sample_time/(context->c * rMix));
16001621         break;
16011622      default:
16021623         fatalerror("DISCRETE_INVERTER_OSC - Wrong type on NODE_%02d", node->node - NODE_00);
16031624   }
1604   context->vCap += diff;
1605   context->vG2_old = vG2;
1606   if ((info->options & DISC_OSC_INVERTER_TYPE_MASK)==DISC_OSC_INVERTER_IS_TYPE3)
1625   context->v_cap   += diff;
1626   context->v_g2_old = vG2;
1627   if ((info->options & DISC_OSC_INVERTER_TYPE_MASK) == DISC_OSC_INVERTER_IS_TYPE3)
16071628      node->output[0] = vG1;
16081629   else
16091630      node->output[0] = vG3;
r3115r3116
16131634
16141635static void dss_inverter_osc_reset(node_description *node)
16151636{
1616   struct dss_inverter_osc_context *context = node->context;
1617   const discrete_inverter_osc_desc *info = node->custom;
1637   struct dss_inverter_osc_context   *context = node->context;
1638   const  discrete_inverter_osc_desc *info    = node->custom;
1639
16181640   int i;
16191641
16201642   /* exponent */
1621   context->w = exp(-discrete_current_context->sample_time / (DSS_INVERTER_OSC__RC * DSS_INVERTER_OSC__C));
1643   context->w = exp(-discrete_current_context->sample_time / (DSS_INVERTER_OSC__RC * DSS_INVERTER_OSC__C));
16221644   context->wc = exp(-discrete_current_context->sample_time / ((DSS_INVERTER_OSC__RC * DSS_INVERTER_OSC__RP) / (DSS_INVERTER_OSC__RP + DSS_INVERTER_OSC__RC) * DSS_INVERTER_OSC__C));
1623   node->output[0] = 0;
1624   context->vCap = 0;
1625   context->vG2_old = 0;
1626   context->Rp = DSS_INVERTER_OSC__RP;
1627   context->R1 = DSS_INVERTER_OSC__RC;
1628   context->R2 = DSS_INVERTER_OSC__R2;
1629   context->C = DSS_INVERTER_OSC__C;
1645   node->output[0]   = 0;
1646   context->v_cap    = 0;
1647   context->v_g2_old = 0;
1648   context->rp   = DSS_INVERTER_OSC__RP;
1649   context->r1   = DSS_INVERTER_OSC__RC;
1650   context->r2   = DSS_INVERTER_OSC__R2;
1651   context->c    = DSS_INVERTER_OSC__C;
16301652   context->tf_b = (log(0.0 - log(info->vOutLow/info->vB)) - log(0.0 - log((info->vOutHigh/info->vB))) ) / log(info->vInRise / info->vInFall);
16311653   context->tf_a = log(0.0 - log(info->vOutLow/info->vB)) - context->tf_b * log(info->vInRise/info->vB);
16321654   context->tf_a = exp(context->tf_a);
16331655
16341656   for (i = 0; i < DSS_INV_TAB_SIZE; i++)
16351657   {
1636      context->tf_tab[i] = dss_inverter_tftab(node, (double) i / (double)(DSS_INV_TAB_SIZE-1) * info->vB);
1658      context->tf_tab[i] = dss_inverter_tftab(node, (double)i / (double)(DSS_INV_TAB_SIZE - 1) * info->vB);
16371659   }
16381660}
16391661
r3115r3116
16601682
16611683   if(DSS_TRIANGLEWAVE__ENABLE)
16621684   {
1663      node->output[0]=context->phase < M_PI ? (DSS_TRIANGLEWAVE__AMP * (context->phase / (M_PI/2.0) - 1.0))/2.0 :
1664                           (DSS_TRIANGLEWAVE__AMP * (3.0 - context->phase / (M_PI/2.0)))/2.0 ;
1685      node->output[0] = context->phase < M_PI ? (DSS_TRIANGLEWAVE__AMP * (context->phase / (M_PI / 2.0) - 1.0)) / 2.0 :
1686                           (DSS_TRIANGLEWAVE__AMP * (3.0 - context->phase / (M_PI / 2.0))) / 2.0 ;
16651687
16661688      /* Add DC Bias component */
1667      node->output[0]=node->output[0]+DSS_TRIANGLEWAVE__BIAS;
1689      node->output[0] = node->output[0] + DSS_TRIANGLEWAVE__BIAS;
16681690   }
16691691   else
16701692   {
1671      node->output[0]=0;
1693      node->output[0] = 0;
16721694   }
16731695
16741696   /* Work out the phase step based on phase/freq & sample rate */
r3115r3116
16781700   /*                    boils out to                           */
16791701   /*     phase step = (2Pi*output freq)/sample freq)           */
16801702   /* Also keep the new phasor in the 2Pi range.                */
1681   context->phase=fmod((context->phase+((2.0*M_PI*DSS_TRIANGLEWAVE__FREQ)/discrete_current_context->sample_rate)),2.0*M_PI);
1703   context->phase=fmod((context->phase + ((2.0 * M_PI * DSS_TRIANGLEWAVE__FREQ) / discrete_current_context->sample_rate)), 2.0 * M_PI);
16821704}
16831705
16841706static void dss_trianglewave_reset(node_description *node)
r3115r3116
16871709   double start;
16881710
16891711   /* Establish starting phase, convert from degrees to radians */
1690   start=(DSS_TRIANGLEWAVE__PHASE/360.0)*(2.0*M_PI);
1712   start = (DSS_TRIANGLEWAVE__PHASE / 360.0) * (2.0 * M_PI);
16911713   /* Make sure its always mod 2Pi */
1692   context->phase=fmod(start,2.0*M_PI);
1714   context->phase=fmod(start, 2.0 * M_PI);
16931715
16941716   /* Step to set the output */
16951717   dss_trianglewave_step(node);
r3115r3116
17091731
17101732static void dss_adsrenv_step(node_description *node)
17111733{
1712//  struct dss_adsr_context *context = node->context;
1734/*  struct dss_adsr_context *context = node->context; */
17131735
17141736   if(DSS_ADSR__ENABLE)
17151737   {
1716      node->output[0]=0;
1738      node->output[0] = 0;
17171739   }
17181740   else
17191741   {
1720      node->output[0]=0;
1742      node->output[0] = 0;
17211743   }
17221744}
17231745
src/emu/sound/disc_flt.c
r3115r3116
3939
4040struct dst_op_amp_filt_context
4141{
42   int      type;      // What kind of filter
43   int      is_norton;   // 1 = Norton op-amps
42   int      type;      /* What kind of filter */
43   int      is_norton;   /* 1 = Norton op-amps */
4444   double   vRef;
4545   double   vP;
4646   double   vN;
47   double   rTotal;      // All input resistance in parallel.
48   double   iFixed;      // Current supplied by r3 & r4 if used.
47   double   rTotal;      /* All input resistance in parallel. */
48   double   iFixed;      /* Current supplied by r3 & r4 if used. */
4949   double   exponentC1;
5050   double   exponentC2;
5151   double   exponentC3;
52   double   rRatio;      // divide ratio of resistance network
53   double   vC1;      // Charge on C1
54   double   vC1b;      // Charge on C1, part of C1 charge if needed
55   double   vC2;      // Charge on C2
56   double   vC3;      // Charge on C2
57   double   gain;      // Gain of the filter
52   double   rRatio;      /* divide ratio of resistance network */
53   double   vC1;      /* Charge on C1 */
54   double   vC1b;      /* Charge on C1, part of C1 charge if needed */
55   double   vC2;      /* Charge on C2 */
56   double   vC3;      /* Charge on C2 */
57   double   gain;      /* Gain of the filter */
5858   double  x1, x2;      /* x[k-1], x[k-2], previous 2 input values */
5959   double  y1, y2;      /* y[k-1], y[k-2], previous 2 output values */
6060   double  a1,a2;      /* digital filter coefficients, denominator */
r3115r3116
6464struct dst_rcdisc_context
6565{
6666   int state;
67   double t;           // time
68   double f;         // RCINTEGRATE
69   double R1;         // RCINTEGRATE
70   double R2;         // RCINTEGRATE
71   double R3;         // RCINTEGRATE
72   double C;         // RCINTEGRATE
73   double vCap;      // RCDISC_MOD
74   double vCE;         // RCINTEGRATE
67   double t;           /* time */
68   double f;         /* RCINTEGRATE */
69   double R1;         /* RCINTEGRATE */
70   double R2;         /* RCINTEGRATE */
71   double R3;         /* RCINTEGRATE */
72   double C;         /* RCINTEGRATE */
73   double vCap;      /* RCDISC_MOD */
74   double vCE;         /* RCINTEGRATE */
7575   double exponent0;
7676   double exponent1;
77   double exp_exponent0;// RCINTEGRATE
78   double exp_exponent1;// RCINTEGRATE
77   double exp_exponent0;/* RCINTEGRATE */
78   double exp_exponent1;/* RCINTEGRATE */
7979};
8080
8181struct dst_rcdisc4_context
r3115r3116
109109 * input[4]    - Voltage reference. Usually 0V.
110110 *
111111 ************************************************************************/
112#define DST_CRFILTER__ENABLE      (*(node->input[0]))
112#define DST_CRFILTER__ENABLE   (*(node->input[0]))
113113#define DST_CRFILTER__IN      (*(node->input[1]))
114114#define DST_CRFILTER__R         (*(node->input[2]))
115115#define DST_CRFILTER__C         (*(node->input[3]))
r3115r3116
135135   struct dst_rcfilter_context *context = node->context;
136136
137137   context->exponent = -1.0 / (DST_CRFILTER__R * DST_CRFILTER__C * discrete_current_context->sample_rate);
138   context->exponent = 1.0 - exp(context->exponent);
139   context->vCap = 0;
138   context->exponent =  1.0 - exp(context->exponent);
139   context->vCap   = 0;
140140   node->output[0] = DST_CRFILTER__IN;
141141}
142142
r3115r3116
186186static void dst_filter1_step(node_description *node)
187187{
188188   struct dss_filter1_context *context = node->context;
189\
189190   double gain = 1.0;
190191
191192   if (DST_FILTER1__ENABLE == 0.0)
r3115r3116
204205   struct dss_filter1_context *context = node->context;
205206
206207   calculate_filter1_coefficients(DST_FILTER1__FREQ, DST_FILTER1__TYPE, &context->a1, &context->b0, &context->b1);
207   node->output[0]=0;
208   node->output[0] = 0;
208209}
209210
210211
r3115r3116
237238
238239   /* calculate digital filter coefficents */
239240   /*w = 2.0*M_PI*fc; no pre-warping */
240   w = discrete_current_context->sample_rate*2.0*tan(M_PI*fc/discrete_current_context->sample_rate); /* pre-warping */
241   w_squared = w*w;
241   w = discrete_current_context->sample_rate * 2.0 * tan(M_PI * fc / discrete_current_context->sample_rate); /* pre-warping */
242   w_squared = w * w;
242243
243244   den = two_over_T_squared + d*w*two_over_T + w_squared;
244245
245   *a1 = 2.0*(-two_over_T_squared + w_squared)/den;
246   *a2 = (two_over_T_squared - d*w*two_over_T + w_squared)/den;
246   *a1 = 2.0 * (-two_over_T_squared + w_squared) / den;
247   *a2 = (two_over_T_squared - d * w * two_over_T + w_squared) / den;
247248
248249   if (type == DISC_FILTER_LOWPASS)
249250   {
250251      *b0 = *b2 = w_squared/den;
251      *b1 = 2.0*(*b0);
252      *b1 = 2.0 * (*b0);
252253   }
253254   else if (type == DISC_FILTER_BANDPASS)
254255   {
255      *b0 = d*w*two_over_T/den;
256      *b0 = d * w * two_over_T / den;
256257      *b1 = 0.0;
257258      *b2 = -(*b0);
258259   }
259260   else if (type == DISC_FILTER_HIGHPASS)
260261   {
261      *b0 = *b2 = two_over_T_squared/den;
262      *b1 = -2.0*(*b0);
262      *b0 = *b2 = two_over_T_squared / den;
263      *b1 = -2.0 * (*b0);
263264   }
264265   else
265266   {
r3115r3116
270271static void dst_filter2_step(node_description *node)
271272{
272273   struct dss_filter2_context *context = node->context;
274
273275   double gain = 1.0;
274276
275277   if (DST_FILTER2__ENABLE == 0.0)
r3115r3116
277279      gain = 0.0;
278280   }
279281
280   node->output[0] = -context->a1*context->y1 - context->a2*context->y2 +
281               context->b0*gain*DST_FILTER2__IN + context->b1*context->x1 + context->b2*context->x2;
282   node->output[0] = -context->a1 * context->y1 - context->a2 * context->y2 +
283               context->b0 * gain * DST_FILTER2__IN + context->b1 * context->x1 + context->b2 * context->x2;
282284
283285   context->x2 = context->x1;
284286   context->x1 = gain * DST_FILTER2__IN;
r3115r3116
293295   calculate_filter2_coefficients(DST_FILTER2__FREQ, DST_FILTER2__DAMP, DST_FILTER2__TYPE,
294296                           &context->a1, &context->a2,
295297                           &context->b0, &context->b1, &context->b2);
296   node->output[0]=0;
298   node->output[0] = 0;
297299}
298300
299301/************************************************************************
r3115r3116
315317static void dst_sallen_key_step(node_description *node)
316318{
317319   struct dss_filter2_context *context = node->context;
320
318321   double gain = 1.0;
319322
320323   if (DST_SALLEN_KEY__ENABLE == 0.0)
r3115r3116
322325      gain = 0.0;
323326   }
324327
325   node->output[0] = -context->a1*context->y1 - context->a2*context->y2 +
326               context->b0*gain*DST_SALLEN_KEY__INP0 + context->b1*context->x1 + context->b2*context->x2;
328   node->output[0] = -context->a1 * context->y1 - context->a2 * context->y2 +
329               context->b0 * gain * DST_SALLEN_KEY__INP0 + context->b1 * context->x1 + context->b2 * context->x2;
327330
328331   context->x2 = context->x1;
329332   context->x1 = gain * DST_SALLEN_KEY__INP0;
r3115r3116
333336
334337static void dst_sallen_key_reset(node_description *node)
335338{
336   struct dss_filter2_context *context = node->context;
337   const discrete_op_amp_filt_info *info = node->custom;
339   struct dss_filter2_context       *context = node->context;
340   const  discrete_op_amp_filt_info *info    = node->custom;
341
338342   double freq, q;
339343
340344   switch ((int) DST_SALLEN_KEY__TYPE)
r3115r3116
350354   calculate_filter2_coefficients(freq, 1.0 / q, DISC_FILTER_LOWPASS,
351355                           &context->a1, &context->a2,
352356                           &context->b0, &context->b1, &context->b2);
353   node->output[0]=0;
357   node->output[0] = 0;
354358}
355359
356360/************************************************************************
r3115r3116
373377
374378static void dst_op_amp_filt_step(node_description *node)
375379{
376   const discrete_op_amp_filt_info *info = node->custom;
377   struct dst_op_amp_filt_context *context = node->context;
380   const  discrete_op_amp_filt_info *info    = node->custom;
381   struct dst_op_amp_filt_context   *context = node->context;
378382
379   double i, v=0;
383   double i, v = 0;
380384
381385   if (DST_OP_AMP_FILT__ENABLE)
382386   {
r3115r3116
388392      else
389393      {
390394         /* Millman the input voltages. */
391         i = context->iFixed;
395         i = context->iFixed;
392396         i += (DST_OP_AMP_FILT__INP1 - context->vRef) / info->r1;
393397         if (info->r2 != 0)
394398            i += (DST_OP_AMP_FILT__INP2 - context->vRef) / info->r2;
r3115r3116
433437
434438         case DISC_OP_AMP_FILTER_IS_BAND_PASS_1M:
435439         case DISC_OP_AMP_FILTER_IS_BAND_PASS_1M | DISC_OP_AMP_IS_NORTON:
436            node->output[0] = -context->a1*context->y1 - context->a2*context->y2 +
437                        context->b0*v + context->b1*context->x1 + context->b2*context->x2 +
440            node->output[0] = -context->a1 * context->y1 - context->a2 * context->y2 +
441                        context->b0 * v + context->b1 * context->x1 + context->b2 * context->x2 +
438442                        context->vRef;
439443            context->x2 = context->x1;
440444            context->x1 = v;
r3115r3116
456460
457461static void dst_op_amp_filt_reset(node_description *node)
458462{
459   const discrete_op_amp_filt_info *info = node->custom;
460   struct dst_op_amp_filt_context *context = node->context;
463   const  discrete_op_amp_filt_info *info    = node->custom;
464   struct dst_op_amp_filt_context   *context = node->context;
461465
462466   /* Convert the passed filter type into an int for easy use. */
463467   context->type = (int)DST_OP_AMP_FILT__TYPE & DISC_OP_AMP_FILTER_TYPE_MASK;
r3115r3116
485489      context->vN =  info->vN;
486490
487491      /* Work out the input resistance.  It is all input and bias resistors in parallel. */
488      context->rTotal  = 1.0 / info->r1;         // There has to be an R1.  Otherwise the table is wrong.
492      context->rTotal  = 1.0 / info->r1;         /* There has to be an R1.  Otherwise the table is wrong. */
489493      if (info->r2 != 0) context->rTotal += 1.0 / info->r2;
490494      if (info->r3 != 0) context->rTotal += 1.0 / info->r3;
491495      context->rTotal = 1.0 / context->rTotal;
r3115r3116
500504   {
501505      case DISC_OP_AMP_FILTER_IS_LOW_PASS_1:
502506         context->exponentC1 = -1.0 / (info->rF * info->c1 * discrete_current_context->sample_rate);
503         context->exponentC1 = 1.0 - exp(context->exponentC1);
504         context->exponentC2 = 0;
507         context->exponentC1 =  1.0 - exp(context->exponentC1);
508         context->exponentC2 =  0;
505509         break;
506510      case DISC_OP_AMP_FILTER_IS_HIGH_PASS_1:
507511         context->exponentC1 = -1.0 / (context->rTotal * info->c1 * discrete_current_context->sample_rate);
508         context->exponentC1 = 1.0 - exp(context->exponentC1);
509         context->exponentC2 = 0;
512         context->exponentC1 =  1.0 - exp(context->exponentC1);
513         context->exponentC2 =  0;
510514         break;
511515      case DISC_OP_AMP_FILTER_IS_BAND_PASS_1:
512516         context->exponentC1 = -1.0 / (info->rF * info->c1 * discrete_current_context->sample_rate);
513         context->exponentC1 = 1.0 - exp(context->exponentC1);
517         context->exponentC1 = 1.0 - exp(context->exponentC1);
514518         context->exponentC2 = -1.0 / (context->rTotal * info->c2 * discrete_current_context->sample_rate);
515         context->exponentC2 = 1.0 - exp(context->exponentC2);
519         context->exponentC2 = 1.0 - exp(context->exponentC2);
516520         break;
517521      case DISC_OP_AMP_FILTER_IS_BAND_PASS_1M | DISC_OP_AMP_IS_NORTON:
518522         context->rTotal = 1.0 / (1.0 / info->r1 + 1.0 / info->r2);
519523      case DISC_OP_AMP_FILTER_IS_BAND_PASS_1M:
520524      {
521525         double fc = 1.0 / (2 * M_PI * sqrt(context->rTotal * info->rF * info->c1 * info->c2));
522         double d = (info->c1 + info->c2) / sqrt(info->rF / context->rTotal * info->c1 * info->c2);
526         double d = (info->c1 + info->c2) / sqrt(info->rF / context->rTotal * info->c1 * info->c2);
523527         double gain = -info->rF / context->rTotal * info->c2 / (info->c1 + info->c2);
524528
525529         calculate_filter2_coefficients(fc, d, DISC_FILTER_BANDPASS,
r3115r3116
538542      }
539543      case DISC_OP_AMP_FILTER_IS_BAND_PASS_0 | DISC_OP_AMP_IS_NORTON:
540544         context->exponentC1 = -1.0 / ((1.0 / (1.0 / info->r1 + 1.0 / (info->r2 + info->r3 + info->r4))) * info->c1 * discrete_current_context->sample_rate);
541         context->exponentC1 = 1.0 - exp(context->exponentC1);
545         context->exponentC1 = 1.0 - exp(context->exponentC1);
542546         context->exponentC2 = -1.0 / ((1.0 / (1.0 / (info->r1 + info->r2) + 1.0 / (info->r3 + info->r4))) * info->c2 * discrete_current_context->sample_rate);
543         context->exponentC2 = 1.0 - exp(context->exponentC2);
547         context->exponentC2 = 1.0 - exp(context->exponentC2);
544548         context->exponentC3 = -1.0 / ((info->r1 + info->r2 + info->r3 + info->r4) * info->c3 * discrete_current_context->sample_rate);
545         context->exponentC3 = 1.0 - exp(context->exponentC3);
549         context->exponentC3 = 1.0 - exp(context->exponentC3);
546550         break;
547551      case DISC_OP_AMP_FILTER_IS_HIGH_PASS_0 | DISC_OP_AMP_IS_NORTON:
548552         context->exponentC1 = -1.0 / (info->r1 * info->c1 * discrete_current_context->sample_rate);
549         context->exponentC1 = 1.0 - exp(context->exponentC1);
553         context->exponentC1 = 1.0 - exp(context->exponentC1);
550554         break;
551555   }
552556
r3115r3116
586590            context->state = 1;
587591            context->t = 0;
588592         }
589         node->output[0]=0;
593         node->output[0] = 0;
590594         break;
591595
592596      case 1:
r3115r3116
603607{
604608   struct dst_rcdisc_context *context = node->context;
605609
606   node->output[0]=0;
610   node->output[0] = 0;
607611
608612   context->state = 0;
609613   context->t = 0;
r3115r3116
633637
634638static void dst_rcdisc2_step(node_description *node)
635639{
636   double diff;
637640   struct dst_rcdisc_context *context = node->context;
638641
642   double diff;
643
639644   /* Works differently to other as we are always on, no enable */
640645   /* exponential based in difference between input/output   */
641646
r3115r3116
678683
679684static void dst_rcdisc3_step(node_description *node)
680685{
681   double diff;
682686   struct dst_rcdisc_context *context = node->context;
683687
688   double diff;
689
684690   /* Exponential based in difference between input/output   */
685691
686692   if(DST_RCDISC3__ENABLE)
r3115r3116
708714{
709715   struct dst_rcdisc_context *context = node->context;
710716
711   node->output[0]=0;
717   node->output[0] = 0;
712718
713719   context->state = 0;
714720   context->t = 0;
715   context->exponent0=-1.0 * DST_RCDISC3__R1 * DST_RCDISC3__C;
716   context->exponent1=-1.0 *(DST_RCDISC3__R1 * DST_RCDISC3__R2)/( DST_RCDISC3__R1 + DST_RCDISC3__R2)* DST_RCDISC3__C;
721   context->exponent0 = -1.0 * DST_RCDISC3__R1 * DST_RCDISC3__C;
722   context->exponent1 = -1.0 *(DST_RCDISC3__R1 * DST_RCDISC3__R2)/( DST_RCDISC3__R1 + DST_RCDISC3__R2)* DST_RCDISC3__C;
717723}
718724
719725
r3115r3116
742748static void dst_rcdisc4_step(node_description *node)
743749{
744750   struct dst_rcdisc4_context *context = node->context;
751
745752   int inp1 = (DST_RCDISC4__IN == 0) ? 0 : 1;
746753
747754   if (DST_RCDISC4__ENABLE == 0)
r3115r3116
767774static void  dst_rcdisc4_reset(node_description *node)
768775{
769776   struct dst_rcdisc4_context *context = node->context;
777
770778   double   v, i, r, rT;
771779
772780   context->type = 0;
r3115r3116
802810         v = DST_RCDISC4__VP - .5;   /* diode drop */
803811
804812         /* When the input is 1, both R1 & R3 are basically in parallel. */
805         r = 1.0 / (1.0 / DST_RCDISC4__R1 + 1.0 / DST_RCDISC4__R3);
813         r = 1.0 / (1.0 / DST_RCDISC4__R1 + 1.0 / DST_RCDISC4__R3);
806814         rT = DST_RCDISC4__R2 + r;
807         i = v / rT;
815         i = v / rT;
808816         context->v[1] = i * r + .5;
809817         rT = 1.0 / (1.0 / DST_RCDISC4__R2 + 1.0 / r);
810818         context->exp[1] = -1.0 / (rT * DST_RCDISC4__C1 * discrete_current_context->sample_rate);
811         context->exp[1] = 1.0 - exp(context->exp[1]);
819         context->exp[1] = 1.0 - exp(context->exp[1]);
812820
813821         /* When the input is 0, R1 is out of circuit. */
814822         rT = DST_RCDISC4__R2 + DST_RCDISC4__R3;
815         i = v / rT;
823         i = v / rT;
816824         context->v[0] = i * DST_RCDISC4__R3 + .5;
817825         rT = 1.0 / (1.0 / DST_RCDISC4__R2 + 1.0 / DST_RCDISC4__R3);
818826         context->exp[0] = -1.0 / (rT * DST_RCDISC4__C1 * discrete_current_context->sample_rate);
819         context->exp[0] = 1.0 - exp(context->exp[0]);
827         context->exp[0] = 1.0 - exp(context->exp[0]);
820828         break;
821829
822830      case 3:
r3115r3116
828836         context->v[1] = DST_RCDISC4__R2 / (r + DST_RCDISC4__R2) * (5.0 - 0.5);
829837         rT = 1.0 / ( 1.0 / r + 1.0 / DST_RCDISC4__R2);
830838         context->exp[1] = -1.0 / (rT * DST_RCDISC4__C1 * discrete_current_context->sample_rate);
831         context->exp[1] = 1.0 - exp(context->exp[1]);
839         context->exp[1] = 1.0 - exp(context->exp[1]);
832840
833841         /* When the input is 0, R1 is out of circuit. */
834842         context->v[0] = 0;
835843         context->exp[0] = -1.0 / (DST_RCDISC4__R2 * DST_RCDISC4__C1 * discrete_current_context->sample_rate);
836         context->exp[0] = 1.0 - exp(context->exp[0]);
844         context->exp[0] = 1.0 - exp(context->exp[0]);
837845         break;
838846   }
839847}
r3115r3116
855863
856864static void  dst_rcdisc5_step(node_description *node)
857865{
858   double diff,u;
859866   struct dst_rcdisc_context *context = node->context;
860867
868   double diff,u;
869
861870   /* Exponential based in difference between input/output   */
862871
863872   if(DST_RCDISC5__ENABLE)
r3115r3116
875884   }
876885   else
877886   {
878      node->output[0]=0;
887      node->output[0] = 0;
879888   }
880889}
881890
r3115r3116
883892{
884893   struct dst_rcdisc_context *context = node->context;
885894
886   node->output[0]=0;
895   node->output[0] = 0;
887896
888897   context->state = 0;
889898   context->t = 0;
890   context->exponent0=-1.0 * DST_RCDISC5__R * DST_RCDISC5__C;
899   context->exponent0 = -1.0 * DST_RCDISC5__R * DST_RCDISC5__C;
891900}
892901
893902/************************************************************************
r3115r3116
930939
931940static void  dst_rcintegrate_step(node_description *node)
932941{
933   double diff,u,iQ,iQc,iC,RG,vE;
934942   struct dst_rcdisc_context *context = node->context;
935   double dt,vP;
936943
944   double diff, u, iQ, iQc, iC, RG, vE;
945   double dt, vP;
946
937947   if(DST_RCINTEGRATE__ENABLE)
938948   {
939      u = DST_RCINTEGRATE__IN1;
949      u = DST_RCINTEGRATE__IN1;
940950      vP = DST_RCINTEGRATE__VP;
941951      dt = discrete_current_context->sample_time;
942952      if ( u-0.7  < context->vCap*context->R2/(context->R1+context->R2))
943953      {
944954         /* discharge .... */
945         diff = 0 - context->vCap;
946         iC = 0.0 - context->C / context->exponent1 * diff * context->exp_exponent1; // iC
955         diff = 0.0 - context->vCap;
956         iC   = 0.0 - context->C / context->exponent1 * diff * context->exp_exponent1; /* iC */
947957         diff = diff - (diff * context->exp_exponent1);
948958         context->vCap += diff;
949959         iQ = 0;
r3115r3116
954964      {
955965         /* charging */
956966         diff = (vP - context->vCE) * context->f - context->vCap;
957         iC = 0.0 - context->C / context->exponent0 * diff * context->exp_exponent0; // iC
967         iC   = 0.0 - context->C / context->exponent0 * diff * context->exp_exponent0; /* iC */
958968         diff = diff - (diff * context->exp_exponent0);
959969         context->vCap += diff;
960970         iQ = iC + (iC * context->R1 + context->vCap) / context->R2;
r3115r3116
964974
965975
966976      u = DST_RCINTEGRATE__IN1;
967      if (u>0.7+vE)
968         vE=u-0.7;
977      if (u > 0.7+vE)
978         vE = u-0.7;
969979      iQc = EM_IC(u - vE);
970      context->vCE = MIN(vP-0.1, vP - RG*iQc);
980      context->vCE = MIN(vP - 0.1, vP - RG * iQc);
971981
972982      /* Avoid oscillations
973983         * The method tends to largely overshoot - no wonder without
r3115r3116
975985         */
976986
977987      context->vCE = MAX(context->vCE, 0.1 );
978      context->vCE = 0.1 * context->vCE +0.9 * (vP - vE - iQ * context->R3);
988      context->vCE = 0.1 * context->vCE + 0.9 * (vP - vE - iQ * context->R3);
979989
980990      switch (context->state)
981991      {
r3115r3116
986996            node->output[0] = vE;
987997            break;
988998         case DISC_RC_INTEGRATE_TYPE3:
989            node->output[0] = MAX(0,vP - iQ * context->R3);
999            node->output[0] = MAX(0, vP - iQ * context->R3);
9901000            break;
9911001      }
9921002   }
9931003   else
9941004   {
995      node->output[0]=0;
1005      node->output[0] = 0;
9961006   }
9971007}
9981008static void dst_rcintegrate_reset(node_description *node)
9991009{
10001010   struct dst_rcdisc_context *context = node->context;
1011
10011012   double r;
10021013   double dt = discrete_current_context->sample_time;
10031014
r3115r3116
10071018   context->R1 = DST_RCINTEGRATE__R1;
10081019   context->R2 = DST_RCINTEGRATE__R2;
10091020   context->R3 = DST_RCINTEGRATE__R3;
1010   context->C = DST_RCINTEGRATE__C;
1021   context->C = DST_RCINTEGRATE__C;
10111022
10121023   context->vCap = 0;
10131024   context->vCE  = 0;
r3115r3116
10491060
10501061static void dst_rcdisc_mod_step(node_description *node)
10511062{
1052   double diff,Rc,Rc2,vCap,u,vD=0.0;
10531063   struct dst_rcdisc_context *context = node->context;
10541064
1065   double diff, Rc, Rc2, vCap, u, vD=0.0;
1066
10551067   /* Exponential based in difference between input/output   */
10561068   vCap = context->vCap;
10571069
10581070   if(DST_RCDISC_MOD__ENABLE)
10591071   {
10601072      Rc = (DST_RCDISC_MOD__IN1 > 0.5) ? DST_RCDISC_MOD__R2 : DST_RCDISC_MOD__R1 + DST_RCDISC_MOD__R2;
1061      if (Rc<1.0)
1073      if (Rc < 1.0)
10621074         Rc = 1.0;
10631075      u = (DST_RCDISC_MOD__IN1 > 0.5) ? 0 : DST_RCDISC_MOD__VP;
10641076      Rc2 = (DST_RCDISC_MOD__IN2 > 0.6) ? (DST_RCDISC_MOD__R3 * DST_RCDISC_MOD__R4 / (DST_RCDISC_MOD__R3 + DST_RCDISC_MOD__R4)) : DST_RCDISC_MOD__R4;
10651077      /* Clamp */
10661078      diff = u - vCap;
1067      vD = diff*Rc2/(Rc+Rc2);
1068      if (vD<-0.6)
1079      vD = diff * Rc2 / (Rc + Rc2);
1080      if (vD < -0.6)
10691081      {
1070         Rc2=0;
1071         diff = u + 0.6 - vCap;
1072         diff = diff - (diff * exp(0.0-discrete_current_context->sample_time / (DST_RCDISC_MOD__C*Rc)));
1082         Rc2   = 0;
1083         diff  = u + 0.6 - vCap;
1084         diff  = diff - (diff * exp(0.0 - discrete_current_context->sample_time / (DST_RCDISC_MOD__C * Rc)));
10731085         vCap += diff;
10741086         node->output[0] = (DST_RCDISC_MOD__IN2 <= 0.6) ? -0.6 : 0;
10751087      }
r3115r3116
10781090         diff = diff - (diff * exp(0.0-discrete_current_context->sample_time / (DST_RCDISC_MOD__C*(Rc+Rc2))));
10791091         vCap += diff;
10801092         /* neglecting current through R3 drawn by next node */
1081         node->output[0] = (DST_RCDISC_MOD__IN2 <= 0.6) ? (u-vCap)*DST_RCDISC_MOD__R4/(DST_RCDISC_MOD__R4+Rc) : 0;
1093         node->output[0] = (DST_RCDISC_MOD__IN2 <= 0.6) ? (u - vCap) * DST_RCDISC_MOD__R4 / (DST_RCDISC_MOD__R4 + Rc) : 0;
10821094      }
10831095      context->vCap = vCap;
10841096   }
10851097   else
10861098   {
1087      node->output[0]=0;
1099      node->output[0] = 0;
10881100   }
10891101}
10901102
r3115r3116
10921104{
10931105   struct dst_rcdisc_context *context = node->context;
10941106
1095   node->output[0]=0;
1096   context->vCap = 0;
1107   node->output[0] = 0;
1108   context->vCap   = 0;
10971109}
10981110
10991111/************************************************************************
r3115r3116
11281140   }
11291141   else
11301142   {
1131      node->output[0]=0;
1143      node->output[0] = 0;
11321144   }
11331145}
11341146
r3115r3116
11381150
11391151   context->exponent = -1.0 / (DST_RCFILTER__R * DST_RCFILTER__C * discrete_current_context->sample_rate);
11401152   context->exponent = 1.0 - exp(context->exponent);
1141   context->vCap = 0;
1153   context->vCap   = 0;
11421154   node->output[0] = 0;
11431155}
11441156
r3115r3116
11641176static void dst_rcfilter_sw_step(node_description *node)
11651177{
11661178   struct dst_rcfilter_sw_context *context = node->context;
1179
11671180   int i;
11681181   double rcexp;
11691182   int bits = (int)DST_RCFILTER_SW__SWITCH;
1170   double us=0, rs=0;
1183   double us = 0, rs = 0;
11711184
11721185   if (DST_RCFILTER_SW__ENABLE)
11731186   {
1174      for (i=0;i<4;i++)
1187      for (i = 0; i < 4; i++)
11751188      {
1176         if ( ( bits & (1<<i)) != 0)
1189         if (( bits & (1 << i)) != 0)
11771190         {
11781191            us += context->vCap[i];
11791192            rs += DST_RCFILTER_SW__R;
11801193         }
11811194      }
11821195      node->output[0] = CD4066_ON_RES / ( CD4066_ON_RES + rs) * DST_RCFILTER_SW__VIN + DST_RCFILTER_SW__R / (CD4066_ON_RES + rs)  * us;
1183      for (i=0;i<4;i++)
1196      for (i = 0; i < 4; i++)
11841197      {
1185         if ( ( bits & (1<<i)) != 0)
1198         if (( bits & (1 << i)) != 0)
11861199         {
11871200            rcexp = 1.0 - exp(-1.0 / ( CD4066_ON_RES * DST_RCFILTER_SW__C(i)) * discrete_current_context->sample_rate);
11881201            context->vCap[i] += ((node->output[0] - context->vCap[i]) * rcexp);
r3115r3116
11911204   }
11921205   else
11931206   {
1194      node->output[0]=0;
1207      node->output[0] = 0;
11951208   }
11961209}
11971210
11981211static void dst_rcfilter_sw_reset(node_description *node)
11991212{
12001213   struct dst_rcfilter_sw_context *context = node->context;
1214
12011215   int i;
12021216
1203   for (i=0;i<4;i++)
1217   for (i = 0; i < 4; i++)
12041218      context->vCap[i] = 0;
12051219   node->output[0] = 0;
12061220}
r3115r3116
12251239
12261240static void dst_rcfilterN_reset(node_description *node)
12271241{
1228//  double f=1.0/(2*M_PI* DST_RCFILTERN__R * DST_RCFILTERN__C);
1242#if 0
1243   double f=1.0/(2*M_PI* DST_RCFILTERN__R * DST_RCFILTERN__C);
12291244
1230// !!!!!!!!!!!!!! CAN'T CHEAT LIKE THIS !!!!!!!!!!!!!!!!
1231// Put this stuff in a context
1232//
1233//  node->input[2] = f;
1234//  node->input[3] = DISC_FILTER_LOWPASS;
1245/* !!!!!!!!!!!!!! CAN'T CHEAT LIKE THIS !!!!!!!!!!!!!!!! */
1246/* Put this stuff in a context */
12351247
1248   node->input[2] = f;
1249   node->input[3] = DISC_FILTER_LOWPASS;
1250
12361251   /* Use first order filter */
12371252   dst_filter1_reset(node);
1253#endif
12381254}
12391255
12401256
r3115r3116
12561272
12571273static void dst_rcdiscN_reset(node_description *node)
12581274{
1259//  double f=1.0/(2*M_PI* DST_RCDISCN__R * DST_RCDISCN__C);
1275#if 0
1276   double f = 1.0 / (2 * M_PI * DST_RCDISCN__R * DST_RCDISCN__C);
12601277
1261// !!!!!!!!!!!!!! CAN'T CHEAT LIKE THIS !!!!!!!!!!!!!!!!
1262// Put this stuff in a context
1263//
1264//  node->input[2] = f;
1265//  node->input[3] = DISC_FILTER_LOWPASS;
1278/* !!!!!!!!!!!!!! CAN'T CHEAT LIKE THIS !!!!!!!!!!!!!!!! */
1279/* Put this stuff in a context */
12661280
1281   node->input[2] = f;
1282   node->input[3] = DISC_FILTER_LOWPASS;
1283
12671284   /* Use first order filter */
12681285   dst_filter1_reset(node);
1286#endif
12691287}
12701288
12711289static void dst_rcdiscN_step(node_description *node)
12721290{
12731291   struct dss_filter1_context *context = node->context;
1292
12741293   double gain = 1.0;
12751294
12761295   if (DST_RCDISCN__ENABLE == 0.0)
r3115r3116
13211340static void dst_rcdisc2N_step(node_description *node)
13221341{
13231342   struct dss_rcdisc2_context *context = node->context;
1343
13241344   double input = ((DST_RCDISC2N__ENABLE == 0) ? DST_RCDISC2N__IN0 : DST_RCDISC2N__IN1);
13251345
13261346   if (DST_RCDISC2N__ENABLE == 0)
r3115r3116
13371357   struct dss_rcdisc2_context *context = node->context;
13381358   double f1,f2;
13391359
1340   f1=1.0/(2*M_PI* DST_RCDISC2N__R0 * DST_RCDISC2N__C);
1341   f2=1.0/(2*M_PI* DST_RCDISC2N__R1 * DST_RCDISC2N__C);
1360   f1 = 1.0 / (2 * M_PI * DST_RCDISC2N__R0 * DST_RCDISC2N__C);
1361   f2 = 1.0 / (2 * M_PI * DST_RCDISC2N__R1 * DST_RCDISC2N__C);
13421362
13431363   calculate_filter1_coefficients(f1, DISC_FILTER_LOWPASS, &context->a1_0, &context->b0_0, &context->b1_0);
13441364   calculate_filter1_coefficients(f2, DISC_FILTER_LOWPASS, &context->a1_1, &context->b0_1, &context->b1_1);
13451365
13461366   /* Initialize the object */
1347   node->output[0]=0;
1367   node->output[0] = 0;
13481368}
src/emu/ui.c
r3115r3116
1212#include "driver.h"
1313#include "osdepend.h"
1414#include "video/vector.h"
15#include "machine/laserdsc.h"
1516#include "profiler.h"
1617#include "cheat.h"
1718#include "render.h"
r3115r3116
6364
6465
6566/***************************************************************************
66    TYPE DEFINITIONS
67***************************************************************************/
68
69typedef struct _slider_state slider_state;
70struct _slider_state
71{
72   INT32         minval;            /* minimum value */
73   INT32         defval;            /* default value */
74   INT32         maxval;            /* maximum value */
75   INT32         incval;            /* increment value */
76   INT32         (*update)(running_machine *machine, INT32 newval, char *buffer, void *arg); /* callback */
77   void *         arg;            /* argument */
78};
79
80
81
82/***************************************************************************
8367    GLOBAL VARIABLES
8468***************************************************************************/
8569
r3115r3116
10892static rgb_t messagebox_backcolor;
10993
11094/* slider info */
111static slider_state slider_list[100];
112static int slider_count;
113static int slider_current;
95static slider_state *slider_list;
96static slider_state *slider_current;
11497
11598static int display_rescale_message;
11699static int allow_rescale;
r3115r3116
133116static UINT32 handler_messagebox_ok(running_machine *machine, UINT32 state);
134117static UINT32 handler_messagebox_anykey(running_machine *machine, UINT32 state);
135118static UINT32 handler_ingame(running_machine *machine, UINT32 state);
136static UINT32 handler_slider(running_machine *machine, UINT32 state);
137119static UINT32 handler_load_save(running_machine *machine, UINT32 state);
138120
139121/* slider controls */
140static void slider_init(running_machine *machine);
141static void slider_display(const char *text, int minval, int maxval, int defval, int curval);
142static void slider_draw_bar(float leftx, float topy, float width, float height, float percentage, float default_percentage);
143static INT32 slider_volume(running_machine *machine, INT32 newval, char *buffer, void *arg);
144static INT32 slider_mixervol(running_machine *machine, INT32 newval, char *buffer, void *arg);
145static INT32 slider_adjuster(running_machine *machine, INT32 newval, char *buffer, void *arg);
146static INT32 slider_overclock(running_machine *machine, INT32 newval, char *buffer, void *arg);
147static INT32 slider_refresh(running_machine *machine, INT32 newval, char *buffer, void *arg);
148static INT32 slider_brightness(running_machine *machine, INT32 newval, char *buffer, void *arg);
149static INT32 slider_contrast(running_machine *machine, INT32 newval, char *buffer, void *arg);
150static INT32 slider_gamma(running_machine *machine, INT32 newval, char *buffer, void *arg);
151static INT32 slider_xscale(running_machine *machine, INT32 newval, char *buffer, void *arg);
152static INT32 slider_yscale(running_machine *machine, INT32 newval, char *buffer, void *arg);
153static INT32 slider_xoffset(running_machine *machine, INT32 newval, char *buffer, void *arg);
154static INT32 slider_yoffset(running_machine *machine, INT32 newval, char *buffer, void *arg);
155static INT32 slider_flicker(running_machine *machine, INT32 newval, char *buffer, void *arg);
156static INT32 slider_beam(running_machine *machine, INT32 newval, char *buffer, void *arg);
122static slider_state *slider_alloc(const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg);
123static slider_state *slider_init(running_machine *machine);
124static INT32 slider_volume(running_machine *machine, void *arg, astring *string, INT32 newval);
125static INT32 slider_mixervol(running_machine *machine, void *arg, astring *string, INT32 newval);
126static INT32 slider_adjuster(running_machine *machine, void *arg, astring *string, INT32 newval);
127static INT32 slider_overclock(running_machine *machine, void *arg, astring *string, INT32 newval);
128static INT32 slider_refresh(running_machine *machine, void *arg, astring *string, INT32 newval);
129static INT32 slider_brightness(running_machine *machine, void *arg, astring *string, INT32 newval);
130static INT32 slider_contrast(running_machine *machine, void *arg, astring *string, INT32 newval);
131static INT32 slider_gamma(running_machine *machine, void *arg, astring *string, INT32 newval);
132static INT32 slider_xscale(running_machine *machine, void *arg, astring *string, INT32 newval);
133static INT32 slider_yscale(running_machine *machine, void *arg, astring *string, INT32 newval);
134static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
135static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
136static INT32 slider_overxscale(running_machine *machine, void *arg, astring *string, INT32 newval);
137static INT32 slider_overyscale(running_machine *machine, void *arg, astring *string, INT32 newval);
138static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
139static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
140static INT32 slider_flicker(running_machine *machine, void *arg, astring *string, INT32 newval);
141static INT32 slider_beam(running_machine *machine, void *arg, astring *string, INT32 newval);
157142static char *slider_get_screen_desc(const device_config *screen);
143static char *slider_get_laserdisc_desc(const device_config *screen);
158144#ifdef MAME_DEBUG
159static INT32 slider_crossscale(running_machine *machine, INT32 newval, char *buffer, void *arg);
160static INT32 slider_crossoffset(running_machine *machine, INT32 newval, char *buffer, void *arg);
145static INT32 slider_crossscale(running_machine *machine, void *arg, astring *string, INT32 newval);
146static INT32 slider_crossoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
161147#endif
162148
163149
r3115r3116
179165
180166
181167/*-------------------------------------------------
182    slider_config - configure a slider entry
183-------------------------------------------------*/
184
185INLINE void slider_config(slider_state *state, INT32 minval, INT32 defval, INT32 maxval, INT32 incval,
186                    INT32 (*update)(running_machine *, INT32, char *, void *), void *arg)
187{
188   state->minval = minval;
189   state->defval = defval;
190   state->maxval = maxval;
191   state->incval = incval;
192   state->update = update;
193   state->arg = arg;
194}
195
196
197/*-------------------------------------------------
198168    is_breakable_char - is a given unicode
199169    character a possible line break?
200170-------------------------------------------------*/
r3115r3116
335305      show_gameinfo = show_warnings = show_disclaimer = FALSE;
336306
337307   /* initialize the on-screen display system */
338   slider_init(machine);
308   slider_list = slider_current = slider_init(machine);
339309
340310   /* loop over states */
341311   ui_set_handler(handler_ingame, 0);
r3115r3116
930900}
931901
932902
933/*-------------------------------------------------
934    ui_is_slider_active - return TRUE if the slider
935    UI handler is active
936-------------------------------------------------*/
937903
938int ui_is_slider_active(void)
939{
940   return (ui_handler_callback == handler_slider);
941}
942
943
944
945904/***************************************************************************
946905    TEXT GENERATORS
947906***************************************************************************/
r3115r3116
12731232      return ui_set_handler(ui_menu_ui_handler, 0);
12741233
12751234   /* if the on-screen display isn't up and the user has toggled it, turn it on */
1276   if ((machine->debug_flags & DEBUG_FLAG_ENABLED)  == 0 && ui_input_pressed(machine, IPT_UI_ON_SCREEN_DISPLAY))
1277      return ui_set_handler(handler_slider, 0);
1235//  if ((machine->debug_flags & DEBUG_FLAG_ENABLED) == 0 && ui_input_pressed(machine, IPT_UI_ON_SCREEN_DISPLAY))
1236//      return ui_set_handler(ui_slider_ui_handler, 0);
12781237
12791238   /* handle a reset request */
12801239   if (ui_input_pressed(machine, IPT_UI_RESET_MACHINE))
r3115r3116
13921351
13931352
13941353/*-------------------------------------------------
1395    handler_slider - displays the current slider
1396    and calls the slider handler
1397-------------------------------------------------*/
1398
1399static UINT32 handler_slider(running_machine *machine, UINT32 state)
1400{
1401   slider_state *cur = &slider_list[slider_current];
1402   INT32 increment = 0, newval;
1403   char textbuf[256];
1404
1405   /* left/right control the increment */
1406   if (ui_input_pressed_repeat(machine, IPT_UI_LEFT,6))
1407      increment = -cur->incval;
1408   if (ui_input_pressed_repeat(machine, IPT_UI_RIGHT,6))
1409      increment = cur->incval;
1410
1411   /* alt goes to 1, shift goes 10x smaller, control goes 10x larger */
1412   if (increment != 0)
1413   {
1414      if (input_code_pressed(KEYCODE_LALT) || input_code_pressed(KEYCODE_RALT))
1415         increment = (increment < 0) ? -1 : 1;
1416      if (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT))
1417         increment = (increment < -10 || increment > 10) ? (increment / 10) : ((increment < 0) ? -1 : 1);
1418      if (input_code_pressed(KEYCODE_LCONTROL) || input_code_pressed(KEYCODE_RCONTROL))
1419         increment *= 10;
1420   }
1421
1422   /* determine the new value */
1423   newval = (*cur->update)(machine, 0, NULL, cur->arg) + increment;
1424
1425   /* select resets to the default value */
1426   if (ui_input_pressed(machine, IPT_UI_SELECT))
1427      newval = cur->defval;
1428
1429   /* clamp within bounds */
1430   if (newval < cur->minval)
1431      newval = cur->minval;
1432   if (newval > cur->maxval)
1433      newval = cur->maxval;
1434
1435   /* update the new data and get the text */
1436   (*cur->update)(machine, newval, textbuf, cur->arg);
1437
1438   /* display the UI */
1439   slider_display(textbuf, cur->minval, cur->maxval, cur->defval, newval);
1440
1441   /* up/down select which slider to control */
1442   if (ui_input_pressed_repeat(machine, IPT_UI_DOWN,6))
1443      slider_current = (slider_current + 1) % slider_count;
1444   if (ui_input_pressed_repeat(machine, IPT_UI_UP,6))
1445      slider_current = (slider_current + slider_count - 1) % slider_count;
1446
1447   /* the slider toggle or ESC will cancel out of our display */
1448   if (ui_input_pressed(machine, IPT_UI_ON_SCREEN_DISPLAY) || ui_input_pressed(machine, IPT_UI_CANCEL))
1449      return UI_HANDLER_CANCEL;
1450
1451   /* the menu key will take us directly to the menu */
1452   if (ui_input_pressed(machine, IPT_UI_CONFIGURE))
1453      return ui_set_handler(ui_menu_ui_handler, 0);
1454
1455   return 0;
1456}
1457
1458
1459/*-------------------------------------------------
14601354    handler_load_save - leads the user through
14611355    specifying a game to save or load
14621356-------------------------------------------------*/
r3115r3116
15311425***************************************************************************/
15321426
15331427/*-------------------------------------------------
1428    ui_get_slider_list - get the list of sliders
1429-------------------------------------------------*/
1430
1431const slider_state *ui_get_slider_list(void)
1432{
1433   return slider_list;
1434}
1435
1436
1437/*-------------------------------------------------
1438    slider_alloc - allocate a new slider entry
1439-------------------------------------------------*/
1440
1441static slider_state *slider_alloc(const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg)
1442{
1443   int size = sizeof(slider_state) + strlen(title);
1444   slider_state *state = auto_malloc(size);
1445   memset(state, 0, size);
1446
1447   state->minval = minval;
1448   state->defval = defval;
1449   state->maxval = maxval;
1450   state->incval = incval;
1451   state->update = update;
1452   state->arg = arg;
1453   strcpy(state->description, title);
1454
1455   return state;
1456}
1457
1458
1459/*-------------------------------------------------
15341460    slider_init - initialize the list of slider
15351461    controls
15361462-------------------------------------------------*/
15371463
1538static void slider_init(running_machine *machine)
1464static slider_state *slider_init(running_machine *machine)
15391465{
1540   int numscreens = video_screen_count(machine->config);
1466   const input_field_config *field;
15411467   const input_port_config *port;
1542   const input_field_config *field;
15431468   const device_config *device;
1469   slider_state *listhead = NULL;
1470   slider_state **tailptr = &listhead;
1471   astring *string = astring_alloc();
15441472   int numitems, item;
15451473
1546   slider_count = 0;
1547
15481474   /* add overall volume */
1549   slider_config(&slider_list[slider_count++], -32, 0, 0, 1, slider_volume, NULL);
1475   *tailptr = slider_alloc("Master Volume", -32, 0, 0, 1, slider_volume, NULL);
1476   tailptr = &(*tailptr)->next;
15501477
15511478   /* add per-channel volume */
15521479   numitems = sound_get_user_gain_count();
r3115r3116
15581485      if (defval > 1000)
15591486         maxval = 2 * defval;
15601487
1561      slider_config(&slider_list[slider_count++], 0, defval, maxval, 20, slider_mixervol, (void *)(FPTR)item);
1488      astring_printf(string, "%s Volume", sound_get_user_gain_name(item));
1489      *tailptr = slider_alloc(astring_c(string), 0, defval, maxval, 20, slider_mixervol, (void *)(FPTR)item);
1490      tailptr = &(*tailptr)->next;
15621491   }
15631492
15641493   /* add analog adjusters */
r3115r3116
15671496         if (field->type == IPT_ADJUSTER)
15681497         {
15691498            void *param = (void *)field;
1570            slider_config(&slider_list[slider_count++], 0, field->defvalue, 100, 1, slider_adjuster, param);
1499            *tailptr = slider_alloc(field->name, 0, field->defvalue, 100, 1, slider_adjuster, param);
1500            tailptr = &(*tailptr)->next;
15711501         }
15721502
1503   /* add CPU overclocking (cheat only) */
15731504   if (options_get_bool(mame_options(), OPTION_CHEAT))
15741505   {
1575      /* add CPU overclocking */
15761506      numitems = cpu_gettotalcpu();
15771507      for (item = 0; item < numitems; item++)
1578         slider_config(&slider_list[slider_count++], 10, 1000, 2000, 1, slider_overclock, (void *)(FPTR)item);
1508      {
1509         astring_printf(string, "Overclock CPU %s", machine->config->cpu[item].tag);
1510         *tailptr = slider_alloc(astring_c(string), 10, 1000, 2000, 1, slider_overclock, (void *)(FPTR)item);
1511         tailptr = &(*tailptr)->next;
1512      }
15791513   }
15801514
1581   for (item = 0; item < numscreens; item++)
1515   /* add screen parameters */
1516   for (device = video_screen_first(machine->config); device != NULL; device = video_screen_next(device))
15821517   {
1583      const device_config *screen = device_list_find_by_index(machine->config->devicelist, VIDEO_SCREEN, item);
1584      const screen_config *scrconfig = screen->inline_config;
1518      const screen_config *scrconfig = device->inline_config;
15851519      int defxscale = floor(scrconfig->xscale * 1000.0f + 0.5f);
15861520      int defyscale = floor(scrconfig->yscale * 1000.0f + 0.5f);
15871521      int defxoffset = floor(scrconfig->xoffset * 1000.0f + 0.5f);
15881522      int defyoffset = floor(scrconfig->yoffset * 1000.0f + 0.5f);
1589      void *param = (void *)screen;
1523      void *param = (void *)device;
15901524
15911525      /* add refresh rate tweaker */
15921526      if (options_get_bool(mame_options(), OPTION_CHEAT))
1593         slider_config(&slider_list[slider_count++], -10000, 0, 10000, 1000, slider_refresh, param);
1527      {
1528         astring_printf(string, "%s Refresh Rate", slider_get_screen_desc(device));
1529         *tailptr = slider_alloc(astring_c(string), -10000, 0, 10000, 1000, slider_refresh, param);
1530         tailptr = &(*tailptr)->next;
1531      }
15941532
15951533      /* add standard brightness/contrast/gamma controls per-screen */
1596      slider_config(&slider_list[slider_count++], 100, 1000, 2000, 10, slider_brightness, param);
1597      slider_config(&slider_list[slider_count++], 100, 1000, 2000, 50, slider_contrast, param);
1598      slider_config(&slider_list[slider_count++], 100, 1000, 3000, 50, slider_gamma, param);
1534      astring_printf(string, "%s Brightness", slider_get_screen_desc(device));
1535      *tailptr = slider_alloc(astring_c(string), 100, 1000, 2000, 10, slider_brightness, param);
1536      tailptr = &(*tailptr)->next;
1537      astring_printf(string, "%s Contrast", slider_get_screen_desc(device));
1538      *tailptr = slider_alloc(astring_c(string), 100, 1000, 2000, 50, slider_contrast, param);
1539      tailptr = &(*tailptr)->next;
1540      astring_printf(string, "%s Gamma", slider_get_screen_desc(device));
1541      *tailptr = slider_alloc(astring_c(string), 100, 1000, 3000, 50, slider_gamma, param);
1542      tailptr = &(*tailptr)->next;
15991543
16001544      /* add scale and offset controls per-screen */
1601      slider_config(&slider_list[slider_count++], 500, (defxscale == 0) ? 1000 : defxscale, 1500, 2, slider_xscale, param);
1602      slider_config(&slider_list[slider_count++], -500, defxoffset, 500, 2, slider_xoffset, param);
1603      slider_config(&slider_list[slider_count++], 500, (defyscale == 0) ? 1000 : defyscale, 1500, 2, slider_yscale, param);
1604      slider_config(&slider_list[slider_count++], -500, defyoffset, 500, 2, slider_yoffset, param);
1545      astring_printf(string, "%s Horiz Stretch", slider_get_screen_desc(device));
1546      *tailptr = slider_alloc(astring_c(string), 500, (defxscale == 0) ? 1000 : defxscale, 1500, 2, slider_xscale, param);
1547      tailptr = &(*tailptr)->next;
1548      astring_printf(string, "%s Horiz Position", slider_get_screen_desc(device));
1549      *tailptr = slider_alloc(astring_c(string), -500, defxoffset, 500, 2, slider_xoffset, param);
1550      tailptr = &(*tailptr)->next;
1551      astring_printf(string, "%s Vert Stretch", slider_get_screen_desc(device));
1552      *tailptr = slider_alloc(astring_c(string), 500, (defyscale == 0) ? 1000 : defyscale, 1500, 2, slider_yscale, param);
1553      tailptr = &(*tailptr)->next;
1554      astring_printf(string, "%s Vert Position", slider_get_screen_desc(device));
1555      *tailptr = slider_alloc(astring_c(string), -500, defyoffset, 500, 2, slider_yoffset, param);
1556      tailptr = &(*tailptr)->next;
16051557   }
16061558
1559   for (device = device_list_first(machine->config->devicelist, LASERDISC); device != NULL; device = device_list_next(device, LASERDISC))
1560   {
1561      const laserdisc_config *config = device->inline_config;
1562      if (config->overupdate != NULL)
1563      {
1564         int defxscale = floor(config->overscalex * 1000.0f + 0.5f);
1565         int defyscale = floor(config->overscaley * 1000.0f + 0.5f);
1566         int defxoffset = floor(config->overposx * 1000.0f + 0.5f);
1567         int defyoffset = floor(config->overposy * 1000.0f + 0.5f);
1568         void *param = (void *)device;
1569
1570         /* add scale and offset controls per-overlay */
1571         astring_printf(string, "%s Horiz Stretch", slider_get_laserdisc_desc(device));
1572         *tailptr = slider_alloc(astring_c(string), 500, (defxscale == 0) ? 1000 : defxscale, 1500, 2, slider_overxscale, param);
1573         tailptr = &(*tailptr)->next;
1574         astring_printf(string, "%s Horiz Position", slider_get_laserdisc_desc(device));
1575         *tailptr = slider_alloc(astring_c(string), -500, defxoffset, 500, 2, slider_overxoffset, param);
1576         tailptr = &(*tailptr)->next;
1577         astring_printf(string, "%s Vert Stretch", slider_get_laserdisc_desc(device));
1578         *tailptr = slider_alloc(astring_c(string), 500, (defyscale == 0) ? 1000 : defyscale, 1500, 2, slider_overyscale, param);
1579         tailptr = &(*tailptr)->next;
1580         astring_printf(string, "%s Vert Position", slider_get_laserdisc_desc(device));
1581         *tailptr = slider_alloc(astring_c(string), -500, defyoffset, 500, 2, slider_overyoffset, param);
1582         tailptr = &(*tailptr)->next;
1583      }
1584   }
1585
16071586   for (device = video_screen_first(machine->config); device != NULL; device = video_screen_next(device))
16081587   {
16091588      const screen_config *scrconfig = device->inline_config;
16101589      if (scrconfig->type == SCREEN_TYPE_VECTOR)
16111590      {
16121591         /* add flicker control */
1613         slider_config(&slider_list[slider_count++], 0, 0, 1000, 10, slider_flicker, NULL);
1614         slider_config(&slider_list[slider_count++], 10, 100, 1000, 10, slider_beam, NULL);
1592         *tailptr = slider_alloc("Vector Flicker", 0, 0, 1000, 10, slider_flicker, NULL);
1593         tailptr = &(*tailptr)->next;
1594         *tailptr = slider_alloc("Beam Width", 10, 100, 1000, 10, slider_beam, NULL);
1595         tailptr = &(*tailptr)->next;
16151596         break;
16161597      }
16171598   }
r3115r3116
16231604         if (field->crossaxis != CROSSHAIR_AXIS_NONE && field->player == 0)
16241605         {
16251606            void *param = (void *)field;
1626            slider_config(&slider_list[slider_count++], -3000, 1000, 3000, 100, slider_crossscale, param);
1627            slider_config(&slider_list[slider_count++], -3000, 0, 3000, 100, slider_crossoffset, param);
1607            astring_printf(string, "Crosshair Scale %s", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y");
1608            *tailptr = slider_alloc(astring_c(string), -3000, 1000, 3000, 100, slider_crossscale, param);
1609            tailptr = &(*tailptr)->next;
1610            astring_printf(string, "Crosshair Offset %s", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y");
1611            *tailptr = slider_alloc(astring_c(string), -3000, 0, 3000, 100, slider_crossoffset, param);
1612            tailptr = &(*tailptr)->next;
16281613         }
16291614#endif
1630}
16311615
1632
1633/*-------------------------------------------------
1634    slider_display - display a slider box with
1635    text
1636-------------------------------------------------*/
1637
1638static void slider_display(const char *text, int minval, int maxval, int defval, int curval)
1639{
1640   float percentage = (float)(curval - minval) / (float)(maxval - minval);
1641   float default_percentage = (float)(defval - minval) / (float)(maxval - minval);
1642   float space_width = ui_get_char_width(' ');
1643   float line_height = ui_get_line_height();
1644   float ui_width, ui_height;
1645   float text_height;
1646
1647   /* leave a spaces' worth of room along the left/right sides, and a lines' worth on the top/bottom */
1648   ui_width = 1.0f - 2.0f * space_width;
1649   ui_height = 1.0f - 2.0f * line_height;
1650
1651   /* determine the text height */
1652   ui_draw_text_full(text, 0, 0, ui_width - 2 * UI_BOX_LR_BORDER,
1653            JUSTIFY_CENTER, WRAP_WORD, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, NULL, &text_height);
1654
1655   /* add a box around the whole area */
1656   ui_draw_outlined_box(space_width,
1657                line_height + ui_height - text_height - line_height - 2 * UI_BOX_TB_BORDER,
1658                space_width + ui_width,
1659                line_height + ui_height, UI_FILLCOLOR);
1660
1661   /* draw the thermometer */
1662   slider_draw_bar(2.0f * space_width, line_height + ui_height - UI_BOX_TB_BORDER - text_height - line_height * 0.75f,
1663         ui_width - 2.0f * space_width, line_height * 0.75f, percentage, default_percentage);
1664
1665   /* draw the actual text */
1666   ui_draw_text_full(text, space_width + UI_BOX_LR_BORDER, line_height + ui_height - UI_BOX_TB_BORDER - text_height, ui_width - 2.0f * UI_BOX_LR_BORDER,
1667            JUSTIFY_CENTER, WRAP_WORD, DRAW_NORMAL, ARGB_WHITE, ARGB_BLACK, NULL, &text_height);
1616   astring_free(string);
1617   return listhead;
16681618}
16691619
16701620
16711621/*-------------------------------------------------
1672    slider_draw_bar - draw a slider thermometer
1673-------------------------------------------------*/
1674
1675static void slider_draw_bar(float leftx, float topy, float width, float height, float percentage, float default_percentage)
1676{
1677   float current_x, default_x;
1678   float bar_top, bar_bottom;
1679
1680   /* compute positions */
1681   bar_top = topy + 0.125f * height;
1682   bar_bottom = topy + 0.875f * height;
1683   default_x = leftx + width * default_percentage;
1684   current_x = leftx + width * percentage;
1685
1686   /* fill in the percentage */
1687   render_ui_add_rect(leftx, bar_top, current_x, bar_bottom, ARGB_WHITE, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
1688
1689   /* draw the top and bottom lines */
1690   render_ui_add_line(leftx, bar_top, leftx + width, bar_top, UI_LINE_WIDTH, ARGB_WHITE, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
1691   render_ui_add_line(leftx, bar_bottom, leftx + width, bar_bottom, UI_LINE_WIDTH, ARGB_WHITE, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
1692
1693   /* draw default marker */
1694   render_ui_add_line(default_x, topy, default_x, bar_top, UI_LINE_WIDTH, ARGB_WHITE, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
1695   render_ui_add_line(default_x, bar_bottom, default_x, topy + height, UI_LINE_WIDTH, ARGB_WHITE, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
1696}
1697
1698
1699/*-------------------------------------------------
17001622    slider_volume - global volume slider callback
17011623-------------------------------------------------*/
17021624
1703static INT32 slider_volume(running_machine *machine, INT32 newval, char *buffer, void *arg)
1625static INT32 slider_volume(running_machine *machine, void *arg, astring *string, INT32 newval)
17041626{
1705   if (buffer != NULL)
1706   {
1627   if (newval != SLIDER_NOCHANGE)
17071628      sound_set_attenuation(newval);
1708      sprintf(buffer, "Master Volume %3ddB", sound_get_attenuation());
1709   }
1629   if (string != NULL)
1630      astring_printf(string, "%3ddB", sound_get_attenuation());
17101631   return sound_get_attenuation();
17111632}
17121633
r3115r3116
17161637    slider callback
17171638-------------------------------------------------*/
17181639
1719static INT32 slider_mixervol(running_machine *machine, INT32 newval, char *buffer, void *arg)
1640static INT32 slider_mixervol(running_machine *machine, void *arg, astring *string, INT32 newval)
17201641{
17211642   int which = (FPTR)arg;
1722   if (buffer != NULL)
1723   {
1643   if (newval != SLIDER_NOCHANGE)
17241644      sound_set_user_gain(which, (float)newval * 0.001f);
1725      sprintf(buffer, "%s Volume %4.2f", sound_get_user_gain_name(which), sound_get_user_gain(which));
1726   }
1645   if (string != NULL)
1646      astring_printf(string, "%4.2f", sound_get_user_gain(which));
17271647   return floor(sound_get_user_gain(which) * 1000.0f + 0.5f);
17281648}
17291649
r3115r3116
17331653    callback
17341654-------------------------------------------------*/
17351655
1736static INT32 slider_adjuster(running_machine *machine, INT32 newval, char *buffer, void *arg)
1656static INT32 slider_adjuster(running_machine *machine, void *arg, astring *string, INT32 newval)
17371657{
17381658   const input_field_config *field = arg;
17391659   input_field_user_settings settings;
17401660
17411661   input_field_get_user_settings(field, &settings);
1742   if (buffer != NULL)
1662   if (newval != SLIDER_NOCHANGE)
17431663   {
17441664      settings.value = newval;
17451665      input_field_set_user_settings(field, &settings);
1746      sprintf(buffer, "%s %d%%", field->name, settings.value);
17471666   }
1667   if (string != NULL)
1668      astring_printf(string, "%d%%", settings.value);
17481669   return settings.value;
17491670}
17501671
r3115r3116
17541675    callback
17551676-------------------------------------------------*/
17561677
1757static INT32 slider_overclock(running_machine *machine, INT32 newval, char *buffer, void *arg)
1678static INT32 slider_overclock(running_machine *machine, void *arg, astring *string, INT32 newval)
17581679{
17591680   int which = (FPTR)arg;
1760   if (buffer != NULL)
1761   {
1681   if (newval != SLIDER_NOCHANGE)
17621682      cpunum_set_clockscale(machine, which, (float)newval * 0.001f);
1763      sprintf(buffer, "Overclock CPU %d %3.0f%%", which, floor(cpunum_get_clockscale(which) * 100.0f + 0.5f));
1764   }
1683   if (string != NULL)
1684      astring_printf(string, "%3.0f%%", floor(cpunum_get_clockscale(which) * 100.0f + 0.5f));
17651685   return floor(cpunum_get_clockscale(which) * 1000.0f + 0.5f);
17661686}
17671687
r3115r3116
17701690    slider_refresh - refresh rate slider callback
17711691-------------------------------------------------*/
17721692
1773static INT32 slider_refresh(running_machine *machine, INT32 newval, char *buffer, void *arg)
1693static INT32 slider_refresh(running_machine *machine, void *arg, astring *string, INT32 newval)
17741694{
17751695   const device_config *screen = arg;
17761696   const screen_config *scrconfig = screen->inline_config;
17771697   double defrefresh = ATTOSECONDS_TO_HZ(scrconfig->refresh);
17781698   double refresh;
17791699
1780   if (buffer != NULL)
1700   if (newval != SLIDER_NOCHANGE)
17811701   {
17821702      int width = video_screen_get_width(screen);
17831703      int height = video_screen_get_height(screen);
17841704      const rectangle *visarea = video_screen_get_visible_area(screen);
17851705
17861706      video_screen_configure(screen, width, height, visarea, HZ_TO_ATTOSECONDS(defrefresh + (double)newval * 0.001));
1787      sprintf(buffer, "%s Refresh Rate %.3ffps", slider_get_screen_desc(screen), ATTOSECONDS_TO_HZ(video_screen_get_frame_period(machine->primary_screen).attoseconds));
17881707   }
1708   if (string != NULL)
1709      astring_printf(string, "%.3ffps", ATTOSECONDS_TO_HZ(video_screen_get_frame_period(machine->primary_screen).attoseconds));
17891710   refresh = ATTOSECONDS_TO_HZ(video_screen_get_frame_period(machine->primary_screen).attoseconds);
17901711   return floor((refresh - defrefresh) * 1000.0f + 0.5f);
17911712}
r3115r3116
17961717    callback
17971718-------------------------------------------------*/
17981719
1799static INT32 slider_brightness(running_machine *machine, INT32 newval, char *buffer, void *arg)
1720static INT32 slider_brightness(running_machine *machine, void *arg, astring *string, INT32 newval)
18001721{
18011722   const device_config *screen = arg;
18021723   render_container *container = render_container_get_screen(screen);
18031724   render_container_user_settings settings;
18041725
18051726   render_container_get_user_settings(container, &settings);
1806   if (buffer != NULL)
1727   if (newval != SLIDER_NOCHANGE)
18071728   {
18081729      settings.brightness = (float)newval * 0.001f;
18091730      render_container_set_user_settings(container, &settings);
1810      sprintf(buffer, "%s Brightness %.3f", slider_get_screen_desc(screen), settings.brightness);
18111731   }
1732   if (string != NULL)
1733      astring_printf(string, "%.3f", settings.brightness);
18121734   return floor(settings.brightness * 1000.0f + 0.5f);
18131735}
18141736
r3115r3116
18181740    callback
18191741-------------------------------------------------*/
18201742
1821static INT32 slider_contrast(running_machine *machine, INT32 newval, char *buffer, void *arg)
1743static INT32 slider_contrast(running_machine *machine, void *arg, astring *string, INT32 newval)
18221744{
18231745   const device_config *screen = arg;
18241746   render_container *container = render_container_get_screen(screen);
18251747   render_container_user_settings settings;
18261748
18271749   render_container_get_user_settings(container, &settings);
1828   if (buffer != NULL)
1750   if (newval != SLIDER_NOCHANGE)
18291751   {
18301752      settings.contrast = (float)newval * 0.001f;
18311753      render_container_set_user_settings(container, &settings);
1832      sprintf(buffer, "%s Contrast %.3f", slider_get_screen_desc(screen), settings.contrast);
18331754   }
1755   if (string != NULL)
1756      astring_printf(string, "%.3f", settings.contrast);
18341757   return floor(settings.contrast * 1000.0f + 0.5f);
18351758}
18361759
r3115r3116
18391762    slider_gamma - screen gamma slider callback
18401763-------------------------------------------------*/
18411764
1842static INT32 slider_gamma(running_machine *machine, INT32 newval, char *buffer, void *arg)
1765static INT32 slider_gamma(running_machine *machine, void *arg, astring *string, INT32 newval)
18431766{
18441767   const device_config *screen = arg;
18451768   render_container *container = render_container_get_screen(screen);
18461769   render_container_user_settings settings;
18471770
18481771   render_container_get_user_settings(container, &settings);
1849   if (buffer != NULL)
1772   if (newval != SLIDER_NOCHANGE)
18501773   {
18511774      settings.gamma = (float)newval * 0.001f;
18521775      render_container_set_user_settings(container, &settings);
1853      sprintf(buffer, "%s Gamma %.3f", slider_get_screen_desc(screen), settings.gamma);
18541776   }
1777   if (string != NULL)
1778      astring_printf(string, "%.3f", settings.gamma);
18551779   return floor(settings.gamma * 1000.0f + 0.5f);
18561780}
18571781
r3115r3116
18611785    callback
18621786-------------------------------------------------*/
18631787
1864static INT32 slider_xscale(running_machine *machine, INT32 newval, char *buffer, void *arg)
1788static INT32 slider_xscale(running_machine *machine, void *arg, astring *string, INT32 newval)
18651789{
18661790   const device_config *screen = arg;
18671791   render_container *container = render_container_get_screen(screen);
18681792   render_container_user_settings settings;
18691793
18701794   render_container_get_user_settings(container, &settings);
1871   if (buffer != NULL)
1795   if (newval != SLIDER_NOCHANGE)
18721796   {
18731797      settings.xscale = (float)newval * 0.001f;
18741798      render_container_set_user_settings(container, &settings);
1875      sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(screen), "Horiz Stretch", settings.xscale);
18761799   }
1800   if (string != NULL)
1801      astring_printf(string, "%.3f", settings.xscale);
18771802   return floor(settings.xscale * 1000.0f + 0.5f);
18781803}
18791804
r3115r3116
18831808    callback
18841809-------------------------------------------------*/
18851810
1886static INT32 slider_yscale(running_machine *machine, INT32 newval, char *buffer, void *arg)
1811static INT32 slider_yscale(running_machine *machine, void *arg, astring *string, INT32 newval)
18871812{
18881813   const device_config *screen = arg;
18891814   render_container *container = render_container_get_screen(screen);
18901815   render_container_user_settings settings;
18911816
18921817   render_container_get_user_settings(container, &settings);
1893   if (buffer != NULL)
1818   if (newval != SLIDER_NOCHANGE)
18941819   {
18951820      settings.yscale = (float)newval * 0.001f;
18961821      render_container_set_user_settings(container, &settings);
1897      sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(screen), "Vert Stretch", settings.yscale);
18981822   }
1823   if (string != NULL)
1824      astring_printf(string, "%.3f", settings.yscale);
18991825   return floor(settings.yscale * 1000.0f + 0.5f);
19001826}
19011827
r3115r3116
19051831    slider callback
19061832-------------------------------------------------*/
19071833
1908static INT32 slider_xoffset(running_machine *machine, INT32 newval, char *buffer, void *arg)
1834static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
19091835{
19101836   const device_config *screen = arg;
19111837   render_container *container = render_container_get_screen(screen);
19121838   render_container_user_settings settings;
19131839
19141840   render_container_get_user_settings(container, &settings);
1915   if (buffer != NULL)
1841   if (newval != SLIDER_NOCHANGE)
19161842   {
19171843      settings.xoffset = (float)newval * 0.001f;
19181844      render_container_set_user_settings(container, &settings);
1919      sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(screen), "Horiz Position", settings.xoffset);
19201845   }
1846   if (string != NULL)
1847      astring_printf(string, "%.3f", settings.xoffset);
19211848   return floor(settings.xoffset * 1000.0f + 0.5f);
19221849}
19231850
r3115r3116
19271854    slider callback
19281855-------------------------------------------------*/
19291856
1930static INT32 slider_yoffset(running_machine *machine, INT32 newval, char *buffer, void *arg)
1857static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
19311858{
19321859   const device_config *screen = arg;
19331860   render_container *container = render_container_get_screen(screen);
19341861   render_container_user_settings settings;
19351862
19361863   render_container_get_user_settings(container, &settings);
1937   if (buffer != NULL)
1864   if (newval != SLIDER_NOCHANGE)
19381865   {
19391866      settings.yoffset = (float)newval * 0.001f;
19401867      render_container_set_user_settings(container, &settings);
1941      sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(screen), "Vert Position", settings.yoffset);
19421868   }
1869   if (string != NULL)
1870      astring_printf(string, "%.3f", settings.yoffset);
19431871   return floor(settings.yoffset * 1000.0f + 0.5f);
19441872}
19451873
19461874
19471875/*-------------------------------------------------
1876    slider_overxscale - screen horizontal scale slider
1877    callback
1878-------------------------------------------------*/
1879
1880static INT32 slider_overxscale(running_machine *machine, void *arg, astring *string, INT32 newval)
1881{
1882   const device_config *laserdisc = arg;
1883   laserdisc_config settings;
1884
1885   laserdisc_get_config(laserdisc, &settings);
1886   if (newval != SLIDER_NOCHANGE)
1887   {
1888      settings.overscalex = (float)newval * 0.001f;
1889      laserdisc_set_config(laserdisc, &settings);
1890   }
1891   if (string != NULL)
1892      astring_printf(string, "%.3f", settings.overscalex);
1893   return floor(settings.overscalex * 1000.0f + 0.5f);
1894}
1895
1896
1897/*-------------------------------------------------
1898    slider_overyscale - screen vertical scale slider
1899    callback
1900-------------------------------------------------*/
1901
1902static INT32 slider_overyscale(running_machine *machine, void *arg, astring *string, INT32 newval)
1903{
1904   const device_config *laserdisc = arg;
1905   laserdisc_config settings;
1906
1907   laserdisc_get_config(laserdisc, &settings);
1908   if (newval != SLIDER_NOCHANGE)
1909   {
1910      settings.overscaley = (float)newval * 0.001f;
1911      laserdisc_set_config(laserdisc, &settings);
1912   }
1913   if (string != NULL)
1914      astring_printf(string, "%.3f", settings.overscaley);
1915   return floor(settings.overscaley * 1000.0f + 0.5f);
1916}
1917
1918
1919/*-------------------------------------------------
1920    slider_overxoffset - screen horizontal position
1921    slider callback
1922-------------------------------------------------*/
1923
1924static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
1925{
1926   const device_config *laserdisc = arg;
1927   laserdisc_config settings;
1928
1929   laserdisc_get_config(laserdisc, &settings);
1930   if (newval != SLIDER_NOCHANGE)
1931   {
1932      settings.overposx = (float)newval * 0.001f;
1933      laserdisc_set_config(laserdisc, &settings);
1934   }
1935   if (string != NULL)
1936      astring_printf(string, "%.3f", settings.overposx);
1937   return floor(settings.overposx * 1000.0f + 0.5f);
1938}
1939
1940
1941/*-------------------------------------------------
1942    slider_overyoffset - screen vertical position
1943    slider callback
1944-------------------------------------------------*/
1945
1946static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
1947{
1948   const device_config *laserdisc = arg;
1949   laserdisc_config settings;
1950
1951   laserdisc_get_config(laserdisc, &settings);
1952   if (newval != SLIDER_NOCHANGE)
1953   {
1954      settings.overposy = (float)newval * 0.001f;
1955      laserdisc_set_config(laserdisc, &settings);
1956   }
1957   if (string != NULL)
1958      astring_printf(string, "%.3f", settings.overposy);
1959   return floor(settings.overposy * 1000.0f + 0.5f);
1960}
1961
1962
1963/*-------------------------------------------------
19481964    slider_flicker - vector flicker slider
19491965    callback
19501966-------------------------------------------------*/
19511967
1952static INT32 slider_flicker(running_machine *machine, INT32 newval, char *buffer, void *arg)
1968static INT32 slider_flicker(running_machine *machine, void *arg, astring *string, INT32 newval)
19531969{
1954   if (buffer != NULL)
1955   {
1970   if (newval != SLIDER_NOCHANGE)
19561971      vector_set_flicker((float)newval * 0.1f);
1957      sprintf(buffer, "Vector Flicker %1.2f", vector_get_flicker());
1958   }
1972   if (string != NULL)
1973      astring_printf(string, "%1.2f", vector_get_flicker());
19591974   return floor(vector_get_flicker() * 10.0f + 0.5f);
19601975}
19611976
r3115r3116
19651980    callback
19661981-------------------------------------------------*/
19671982
1968static INT32 slider_beam(running_machine *machine, INT32 newval, char *buffer, void *arg)
1983static INT32 slider_beam(running_machine *machine, void *arg, astring *string, INT32 newval)
19691984{
1970   if (buffer != NULL)
1971   {
1985   if (newval != SLIDER_NOCHANGE)
19721986      vector_set_beam((float)newval * 0.01f);
1973      sprintf(buffer, "%s %1.2f", "Beam Width", vector_get_beam());
1974   }
1987   if (string != NULL)
1988      astring_printf(string, "%1.2f", vector_get_beam());
19751989   return floor(vector_get_beam() * 100.0f + 0.5f);
19761990}
19771991
19781992
19791993/*-------------------------------------------------
19801994    slider_get_screen_desc - returns the
1981    description for a given screen index
1995    description for a given screen
19821996-------------------------------------------------*/
19831997
19841998static char *slider_get_screen_desc(const device_config *screen)
r3115r3116
19962010
19972011
19982012/*-------------------------------------------------
2013    slider_get_laserdisc_desc - returns the
2014    description for a given laseridsc
2015-------------------------------------------------*/
2016
2017static char *slider_get_laserdisc_desc(const device_config *laserdisc)
2018{
2019   int ldcount = device_list_items(laserdisc->machine->config->devicelist, LASERDISC);
2020   static char descbuf[256];
2021
2022   if (ldcount > 1)
2023      sprintf(descbuf, "Laserdisc '%s'", laserdisc->tag);
2024   else
2025      strcpy(descbuf, "Laserdisc");
2026
2027   return descbuf;
2028}
2029
2030
2031/*-------------------------------------------------
19992032    slider_crossscale - crosshair scale slider
20002033    callback
20012034-------------------------------------------------*/
20022035
20032036#ifdef MAME_DEBUG
2004static INT32 slider_crossscale(running_machine *machine, INT32 newval, char *buffer, void *arg)
2037static INT32 slider_crossscale(running_machine *machine, void *arg, astring *string, INT32 newval)
20052038{
20062039   input_field_config *field = arg;
20072040
2008   if (buffer != NULL)
2009   {
2041   if (newval != SLIDER_NOCHANGE)
20102042      field->crossscale = (float)newval * 0.001f;
2011      sprintf(buffer, "%s %s %1.3f", "Crosshair Scale", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y", (float)newval * 0.001f);
2012   }
2043   if (string != NULL)
2044      astring_printf(string, "%s %s %1.3f", "Crosshair Scale", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y", (float)newval * 0.001f);
20132045   return floor(field->crossscale * 1000.0f + 0.5f);
20142046}
20152047#endif
r3115r3116
20212053-------------------------------------------------*/
20222054
20232055#ifdef MAME_DEBUG
2024static INT32 slider_crossoffset(running_machine *machine, INT32 newval, char *buffer, void *arg)
2056static INT32 slider_crossoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
20252057{
20262058   input_field_config *field = arg;
20272059
2028   if (buffer != NULL)
2029   {
2060   if (newval != SLIDER_NOCHANGE)
20302061      field->crossoffset = (float)newval * 0.001f;
2031      sprintf(buffer, "%s %s %1.3f", "Crosshair Offset", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y", (float)newval * 0.001f);
2032   }
2062   if (string != NULL)
2063      astring_printf(string, "%s %s %1.3f", "Crosshair Offset", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y", (float)newval * 0.001f);
20332064   return field->crossoffset;
20342065}
20352066#endif
src/emu/ui.h
r3115r3116
6969   DRAW_OPAQUE
7070};
7171
72#define SLIDER_NOCHANGE      0x12345678
7273
7374
75
7476/***************************************************************************
77    TYPE DEFINITIONS
78***************************************************************************/
79
80typedef INT32 (*slider_update)(running_machine *machine, void *arg, astring *string, INT32 newval);
81
82typedef struct _slider_state slider_state;
83struct _slider_state
84{
85   slider_state *   next;            /* pointer to next slider */
86   slider_update   update;            /* callback */
87   void *         arg;            /* argument */
88   INT32         minval;            /* minimum value */
89   INT32         defval;            /* default value */
90   INT32         maxval;            /* maximum value */
91   INT32         incval;            /* increment value */
92   char         description[1];      /* textual description */
93};
94
95
96
97/***************************************************************************
7598    MACROS
7699***************************************************************************/
77100
r3115r3116
132155/* force the menus to display */
133156void ui_show_menu(void);
134157
135/* return true if a menu or the slider is displayed */
158/* return true if a menu is displayed */
136159int ui_is_menu_active(void);
137int ui_is_slider_active(void);
138160
139161/* print the game info string into a buffer */
140162astring *game_info_astring(running_machine *machine, astring *string);
141163
164/* get the list of sliders */
165const slider_state *ui_get_slider_list(void);
166
142167#endif   /* __USRINTRF_H__ */
src/emu/mconfig.h
r3115r3116
219219   TOKEN_UINT32_PACK1(MCONFIG_TOKEN_DEVICE_CONFIG, 8), \
220220   TOKEN_PTR(voidptr, &(_config)),
221221
222#define MDRV_DEVICE_CONFIG_DATA32(_struct, _field, _val) \
223   TOKEN_UINT32_PACK3(MCONFIG_TOKEN_DEVICE_CONFIG_DATA32, 8, sizeof(((_struct *)NULL)->_field), 6, offsetof(_struct, _field), 12), \
222#define structsizeof(_struct, _field) sizeof(((_struct *)NULL)->_field)
223
224#define MDRV_DEVICE_CONFIG_DATA32_EXPLICIT(_size, _offset, _val) \
225   TOKEN_UINT32_PACK3(MCONFIG_TOKEN_DEVICE_CONFIG_DATA32, 8, (_size), 6, (_offset), 12), \
224226   TOKEN_UINT32((UINT32)(_val)),
225227
226#define MDRV_DEVICE_CONFIG_DATA64(_struct, _field, _val) \
227   TOKEN_UINT32_PACK3(MCONFIG_TOKEN_DEVICE_CONFIG_DATA64, 8, sizeof(((_struct *)NULL)->_field), 6, offsetof(_struct, _field), 12), \
228#define MDRV_DEVICE_CONFIG_DATA32(_struct, _field, _val) \
229   MDRV_DEVICE_CONFIG_DATA32_EXPLICIT(structsizeof(_struct, _field), offsetof(_struct, _field), _val)
230
231#define MDRV_DEVICE_CONFIG_DATA32_ARRAY(_struct, _field, _index, _val) \
232   MDRV_DEVICE_CONFIG_DATA32_EXPLICIT(structsizeof(_struct, _field[0]), offsetof(_struct, _field) + (_index) * structsizeof(_struct, _field[0]), _val)
233
234#define MDRV_DEVICE_CONFIG_DATA32_ARRAY_MEMBER(_struct, _field, _index, _memstruct, _member, _val) \
235   MDRV_DEVICE_CONFIG_DATA32_EXPLICIT(structsizeof(_memstruct, _member), offsetof(_struct, _field) + (_index) * structsizeof(_struct, _field[0]) + offsetof(_memstruct, _member), _val)
236
237#define MDRV_DEVICE_CONFIG_DATA64_EXPLICIT(_size, _offset, _val) \
238   TOKEN_UINT32_PACK3(MCONFIG_TOKEN_DEVICE_CONFIG_DATA64, 8, (_size), 6, (_offset), 12), \
228239   TOKEN_UINT64((UINT64)(_val)),
229240
241#define MDRV_DEVICE_CONFIG_DATA64(_struct, _field, _val) \
242   MDRV_DEVICE_CONFIG_DATA64_EXPLICIT(structsizeof(_struct, _field), offsetof(_struct, _field), _val)
243
244#define MDRV_DEVICE_CONFIG_DATA64_ARRAY(_struct, _field, _index, _val) \
245   MDRV_DEVICE_CONFIG_DATA64_EXPLICIT(structsizeof(_struct, _field[0]), offsetof(_struct, _field) + (_index) * structsizeof(_struct, _field[0]), _val)
246
247#define MDRV_DEVICE_CONFIG_DATA64_ARRAY_MEMBER(_struct, _field, _index, _memstruct, _member, _val) \
248   MDRV_DEVICE_CONFIG_DATA64_EXPLICIT(structsizeof(_memstruct, _member), offsetof(_struct, _field) + (_index) * structsizeof(_struct, _field[0]) + offsetof(_memstruct, _member), _val)
249
230250#define MDRV_DEVICE_CONFIG_DATAFP32(_struct, _field, _val, _fixbits) \
231   TOKEN_UINT32_PACK4(MCONFIG_TOKEN_DEVICE_CONFIG_DATAFP32, 8, sizeof(((_struct *)NULL)->_field), 6, _fixbits, 6, offsetof(_struct, _field), 12), \
251   TOKEN_UINT32_PACK4(MCONFIG_TOKEN_DEVICE_CONFIG_DATAFP32, 8, structsizeof(_struct, _field), 6, _fixbits, 6, offsetof(_struct, _field), 12), \
232252   TOKEN_UINT32((INT32)((float)(_val) * (float)(1 << (_fixbits)))),
233253
234254#define MDRV_DEVICE_CONFIG_DATAFP64(_struct, _field, _val, _fixbits) \
235   TOKEN_UINT32_PACK4(MCONFIG_TOKEN_DEVICE_CONFIG_DATAFP64, 8, sizeof(((_struct *)NULL)->_field), 6, _fixbits, 6, offsetof(_struct, _field), 12), \
255   TOKEN_UINT32_PACK4(MCONFIG_TOKEN_DEVICE_CONFIG_DATAFP64, 8, structsizeof(_struct, _field), 6, _fixbits, 6, offsetof(_struct, _field), 12), \
236256   TOKEN_UINT64((INT64)((float)(_val) * (float)((UINT64)1 << (_fixbits)))),
237257
238258#ifdef PTR64
259#define MDRV_DEVICE_CONFIG_DATAPTR_EXPLICIT(_struct, _size, _offset) MDRV_DEVICE_CONFIG_DATA64_EXPLICIT(_struct, _size, _offset)
239260#define MDRV_DEVICE_CONFIG_DATAPTR(_struct, _field, _val) MDRV_DEVICE_CONFIG_DATA64(_struct, _field, _val)
261#define MDRV_DEVICE_CONFIG_DATAPTR_ARRAY(_struct, _field, _index, _val) MDRV_DEVICE_CONFIG_DATA64_ARRAY(_struct, _field, _index, _val)
262#define MDRV_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(_struct, _field, _index, _memstruct, _member, _val) MDRV_DEVICE_CONFIG_DATA64_ARRAY_MEMBER(_struct, _field, _index, _memstruct, _member, _val)
240263#else
264#define MDRV_DEVICE_CONFIG_DATAPTR_EXPLICIT(_struct, _size, _offset) MDRV_DEVICE_CONFIG_DATA32_EXPLICIT(_struct, _size, _offset)
241265#define MDRV_DEVICE_CONFIG_DATAPTR(_struct, _field, _val) MDRV_DEVICE_CONFIG_DATA32(_struct, _field, _val)
266#define MDRV_DEVICE_CONFIG_DATAPTR_ARRAY(_struct, _field, _index, _val) MDRV_DEVICE_CONFIG_DATA32_ARRAY(_struct, _field, _index, _val)
267#define MDRV_DEVICE_CONFIG_DATAPTR_ARRAY_MEMBER(_struct, _field, _index, _memstruct, _member, _val) MDRV_DEVICE_CONFIG_DATA32_ARRAY_MEMBER(_struct, _field, _index, _memstruct, _member, _val)
242268#endif
243269
244270
src/emu/drivers/xtal.h
r3115r3116
5454   XTAL_3_6864MHz     = 3686400,      /* CPS3 */
5555   XTAL_4MHz          = 4000000,
5656   XTAL_4_224MHz      = 4224000,      /* Used to drive OKI M6295 chips, usually with /4 divider */
57   XTAL_4_41MHz      = 4410000,      /* Pioneer PR-8210 ldplayer */
5758   XTAL_4_43361MHz      = 4433610,      /* Cidelsa Draco */
5859   XTAL_4_433619MHz   = 4433619,      /* PAL color subcarrier */
5960   XTAL_4_9152MHz      = 4915200,
src/emu/romload.c
r3115r3116
10041004         err = open_disk_image(Machine->gamedrv, romp, &chd.origfile, &chd.origchd);
10051005         if (err != CHDERR_NONE)
10061006         {
1007            if (err == CHDERR_UNSUPPORTED_VERSION)
1008               sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s UNSUPPORTED CHD VERSION\n", astring_c(filename));
1009            else
1007            if (err == CHDERR_FILE_NOT_FOUND)
10101008               sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s NOT FOUND\n", astring_c(filename));
1009            else
1010               sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s CHD ERROR: %s\n", astring_c(filename), chd_error_string(err));
10111011
10121012            /* if this is NO_DUMP, keep going, though the system may not be able to handle it */
10131013            if (hash_data_has_info(ROM_GETHASHDATA(romp), HASH_INFO_NO_DUMP) || DISK_ISOPTIONAL(romp))
r3115r3116
10431043            err = open_disk_diff(Machine->gamedrv, romp, chd.origchd, &chd.difffile, &chd.diffchd);
10441044            if (err != CHDERR_NONE)
10451045            {
1046               if (err == CHDERR_UNSUPPORTED_VERSION)
1047                  sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s UNSUPPORTED CHD VERSION\n", astring_c(filename));
1048               else
1049                  sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s: CAN'T OPEN DIFF FILE\n", astring_c(filename));
1046               sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s DIFF CHD ERROR: %s\n", astring_c(filename), chd_error_string(err));
10501047               romdata->errors++;
10511048               continue;
10521049            }
src/lib/util/aviio.c
r3115r3116
17191719   UINT32 written;
17201720
17211721   /* if we are getting too big, split the RIFF */
1722   /* note that we ignore writes before the current RIFF base, as those are assumed to be
1723       overwrites of a chunk from the previous RIFF */
17221724   if ((file->riffbase == 0 && file->writeoffs + length + compute_idx1_size(file) >= MAX_RIFF_SIZE) ||
1723      file->writeoffs + length - file->riffbase >= MAX_RIFF_SIZE)
1725      (file->writeoffs >= file->riffbase && file->writeoffs + length - file->riffbase >= MAX_RIFF_SIZE))
17241726   {
17251727      /* close the movi list */
17261728      avierr = chunk_close(file);
src/mess/mess.mak
r3115r3116
7575#CPUS += V60
7676#CPUS += V70
7777CPUS += I8035
78#CPUS += I8041
79CPUS += I8048
80#CPUS += I8648
81#CPUS += I8748
82#CPUS += MB8884
7883CPUS += I8039
79CPUS += I8048
84#CPUS += I8049
8085CPUS += I8749
8186#CPUS += N7751
82#CPUS += MB8884
8387#CPUS += M58715
8488CPUS += I8X41
8589CPUS += I8051
src/ldplayer/ldplayer.mak
r3115r3116
2222# specify required CPU cores (none)
2323#-------------------------------------------------
2424
25CPUS += I8049
2526
2627
28
2729#-------------------------------------------------
2830# specify required sound cores
2931#-------------------------------------------------
src/ldplayer/ldpdriv.c
r3115r3116
3939#else   /* DRIVER_RECURSIVE */
4040
4141   DRIVER( ldv1000 )   /* Pioneer LD-V1000 */
42   DRIVER( pr8210 )   /* Pioneer PR-8210 */
4243
4344#endif   /* DRIVER_RECURSIVE */
src/ldplayer/ldplayer.c
r3115r3116
1111
1212#include "driver.h"
1313#include "uimenu.h"
14#include "cpu/mcs48/mcs48.h"
1415#include "machine/laserdsc.h"
1516#include <ctype.h>
1617
1718
19#define TEST_PR8210_ROM      0
20
21
22
23/*************************************
24 *
25 *  Constants
26 *
27 *************************************/
28
29enum
30{
31   CMD_SCAN_REVERSE,
32   CMD_SCAN_REVERSE_END,
33   CMD_STEP_REVERSE,
34   CMD_SCAN_FORWARD,
35   CMD_SCAN_FORWARD_END,
36   CMD_STEP_FORWARD,
37   CMD_PLAY,
38   CMD_PAUSE,
39   CMD_DISPLAY_ON,
40   CMD_DISPLAY_OFF,
41   CMD_0,
42   CMD_1,
43   CMD_2,
44   CMD_3,
45   CMD_4,
46   CMD_5,
47   CMD_6,
48   CMD_7,
49   CMD_8,
50   CMD_9,
51   CMD_SEARCH
52};
53
54
55
56/*************************************
57 *
58 *  Globals
59 *
60 *************************************/
61
1862static astring *filename;
1963
2064static input_port_value last_controls;
2165static UINT8 playing;
2266static UINT8 displaying;
2367
68static UINT8 pr8210_last_was_number;
69static emu_timer *pr8210_bit_timer;
70static UINT32 pr8210_command_buffer_in, pr8210_command_buffer_out;
71static UINT8 pr8210_command_buffer[10];
2472
73static void (*execute_command)(const device_config *laserdisc, int command);
2574
75#if TEST_PR8210_ROM
76
77static UINT8 pia[0x100];
78static UINT8 pr8210_porta;
79static UINT8 pr8210_portb;
80static UINT8 pr8210_pia_porta;
81static UINT8 pr8210_pia_portb;
82
83#endif
84
85
86
2687/*************************************
2788 *
2889 *  Timers and sync
r3115r3116
3192
3293static void process_commands(const device_config *laserdisc)
3394{
34   static const UINT8 digits[10] = { 0x3f, 0x0f, 0x8f, 0x4f, 0x2f, 0xaf, 0x6f, 0x1f, 0x9f, 0x5f };
3595   input_port_value controls = input_port_read(laserdisc->machine, "controls");
3696    int number;
3797
r3115r3116
3999   if (!(last_controls & 0x01) && (controls & 0x01))
40100   {
41101      if (playing)
42         laserdisc_data_w(laserdisc, 0xf8);
102         (*execute_command)(laserdisc, CMD_SCAN_REVERSE);
43103      else
44         laserdisc_data_w(laserdisc, 0xfe);
104         (*execute_command)(laserdisc, CMD_STEP_REVERSE);
45105   }
46106   else if ((last_controls & 0x01) && !(controls & 0x01))
47107   {
48108      if (playing)
49         laserdisc_data_w(laserdisc, 0xfd);
109         (*execute_command)(laserdisc, CMD_SCAN_REVERSE_END);
50110   }
51111
52112   /* scan/step forwards */
53113   if (!(last_controls & 0x02) && (controls & 0x02))
54114   {
55115      if (playing)
56         laserdisc_data_w(laserdisc, 0xf0);
116         (*execute_command)(laserdisc, CMD_SCAN_FORWARD);
57117      else
58         laserdisc_data_w(laserdisc, 0xf6);
118         (*execute_command)(laserdisc, CMD_STEP_FORWARD);
59119   }
60120   else if ((last_controls & 0x02) && !(controls & 0x02))
61121   {
62122      if (playing)
63         laserdisc_data_w(laserdisc, 0xfd);
123         (*execute_command)(laserdisc, CMD_SCAN_FORWARD_END);
64124   }
65125
66126   /* play/pause */
67127   if (!(last_controls & 0x10) && (controls & 0x10))
68128   {
69129      playing = !playing;
70      laserdisc_data_w(laserdisc, playing ? 0xfd : 0xa0);
130      (*execute_command)(laserdisc, playing ? CMD_PLAY : CMD_PAUSE);
71131   }
72132
73133   /* toggle display */
74134   if (!(last_controls & 0x20) && (controls & 0x20))
75135   {
76136      displaying = !displaying;
77      laserdisc_data_w(laserdisc, digits[displaying]);
78      laserdisc_data_w(laserdisc, 0xf1);
137      (*execute_command)(laserdisc, displaying ? CMD_DISPLAY_ON : CMD_DISPLAY_OFF);
79138   }
80139
81140   /* numbers */
82141   for (number = 0; number < 10; number++)
83142      if (!(last_controls & (0x100 << number)) && (controls & (0x100 << number)))
84         laserdisc_data_w(laserdisc, digits[number]);
143         (*execute_command)(laserdisc, CMD_0 + number);
85144
86145   /* enter */
87146   if (!(last_controls & 0x40000) && (controls & 0x40000))
88   {
89      playing = FALSE;
90      laserdisc_data_w(laserdisc, 0xf7);
91   }
147      (*execute_command)(laserdisc, CMD_SEARCH);
92148
93149   last_controls = controls;
94150}
r3115r3116
125181   const device_config *laserdisc = device_list_first(machine->config->devicelist, LASERDISC);
126182
127183   /* start playing */
128   laserdisc_data_w(laserdisc, 0xfd);
184   (*execute_command)(laserdisc, CMD_PLAY);
129185   playing = TRUE;
130186   displaying = FALSE;
131187}
r3115r3116
144200
145201/*************************************
146202 *
203 *  PR-8210 implementation
204 *
205 *************************************/
206
207INLINE void pr8210_add_command(UINT8 command)
208{
209   pr8210_command_buffer[pr8210_command_buffer_in++ % ARRAY_LENGTH(pr8210_command_buffer)] = (command & 0x1f) | 0x20;
210   pr8210_command_buffer[pr8210_command_buffer_in++ % ARRAY_LENGTH(pr8210_command_buffer)] = (command & 0x1f) | 0x20;
211   pr8210_command_buffer[pr8210_command_buffer_in++ % ARRAY_LENGTH(pr8210_command_buffer)] = 0x00 | 0x20;
212}
213
214
215static TIMER_CALLBACK( pr8210_bit_off_callback )
216{
217   const device_config *laserdisc = ptr;
218
219   /* deassert the control line */
220   laserdisc_line_w(laserdisc, LASERDISC_LINE_CONTROL, CLEAR_LINE);
221}
222
223
224static TIMER_CALLBACK( pr8210_bit_callback )
225{
226   attotime duration = ATTOTIME_IN_MSEC(30);
227   const device_config *laserdisc = ptr;
228   UINT8 bitsleft = param >> 16;
229   UINT8 data = param;
230
231   /* if we have bits, process */
232   if (bitsleft != 0)
233   {
234      /* assert the line and set a timer for deassertion */
235         laserdisc_line_w(laserdisc, LASERDISC_LINE_CONTROL, ASSERT_LINE);
236      timer_set(ATTOTIME_IN_USEC(250), ptr, 0, pr8210_bit_off_callback);
237
238      /* space 0 bits apart by 1msec, and 1 bits by 2msec */
239      duration = attotime_mul(ATTOTIME_IN_MSEC(1), (data & 0x80) ? 2 : 1);
240      data <<= 1;
241      bitsleft--;
242   }
243
244   /* if we're out of bits, queue up the next command */
245   else if (bitsleft == 0 && pr8210_command_buffer_in != pr8210_command_buffer_out)
246   {
247      data = pr8210_command_buffer[pr8210_command_buffer_out++ % ARRAY_LENGTH(pr8210_command_buffer)];
248#if TEST_PR8210_ROM
249      pr8210_pia_porta = BITSWAP8(data, 0,1,2,3,4,5,6,7);
250#else
251      bitsleft = 12;
252#endif
253   }
254   timer_adjust_oneshot(pr8210_bit_timer, duration, (bitsleft << 16) | data);
255}
256
257
258static MACHINE_START( pr8210 )
259{
260   const device_config *laserdisc = device_list_first(machine->config->devicelist, LASERDISC);
261   MACHINE_START_CALL(ldplayer);
262   pr8210_bit_timer = timer_alloc(pr8210_bit_callback, (void *)laserdisc);
263}
264
265
266static MACHINE_RESET( pr8210 )
267{
268   MACHINE_RESET_CALL(ldplayer);
269   timer_adjust_oneshot(pr8210_bit_timer, attotime_zero, 0);
270}
271
272
273static void pr8210_execute(const device_config *laserdisc, int command)
274{
275   static const UINT8 digits[10] = { 0x01, 0x11, 0x09, 0x19, 0x05, 0x15, 0x0d, 0x1d, 0x03, 0x13 };
276   int prev_was_number = pr8210_last_was_number;
277
278   pr8210_last_was_number = FALSE;
279   switch (command)
280   {
281      case CMD_SCAN_REVERSE:
282         pr8210_add_command(0x1c);
283         playing = TRUE;
284         break;
285
286      case CMD_SCAN_REVERSE_END:
287         pr8210_add_command(0x14);
288         playing = TRUE;
289         break;
290
291      case CMD_STEP_REVERSE:
292         pr8210_add_command(0x12);
293         playing = FALSE;
294         break;
295
296      case CMD_SCAN_FORWARD:
297         pr8210_add_command(0x08);
298         playing = TRUE;
299         break;
300
301      case CMD_SCAN_FORWARD_END:
302         pr8210_add_command(0x14);
303         playing = TRUE;
304         break;
305
306      case CMD_STEP_FORWARD:
307         pr8210_add_command(0x04);
308         playing = FALSE;
309         break;
310
311      case CMD_PLAY:
312         pr8210_add_command(0x14);
313         playing = TRUE;
314         break;
315
316      case CMD_PAUSE:
317         pr8210_add_command(0x0a);
318         playing = FALSE;
319         break;
320
321      case CMD_DISPLAY_ON:
322//          pr8210_add_command(digits[1]);
323//          pr8210_add_command(0xf1);
324         break;
325
326      case CMD_DISPLAY_OFF:
327//          pr8210_add_command(digits[0]);
328//          pr8210_add_command(0xf1);
329         break;
330
331      case CMD_0:
332      case CMD_1:
333      case CMD_2:
334      case CMD_3:
335      case CMD_4:
336      case CMD_5:
337      case CMD_6:
338      case CMD_7:
339      case CMD_8:
340      case CMD_9:
341         if (!prev_was_number)
342            pr8210_add_command(0x1a);
343         pr8210_add_command(digits[command - CMD_0]);
344         pr8210_last_was_number = TRUE;
345         break;
346
347      case CMD_SEARCH:
348         pr8210_add_command(0x1a);
349         playing = FALSE;
350         break;
351   }
352}
353
354
355
356/*************************************
357 *
358 *  LD-V1000 implementation
359 *
360 *************************************/
361
362static void ldv1000_execute(const device_config *laserdisc, int command)
363{
364   static const UINT8 digits[10] = { 0x3f, 0x0f, 0x8f, 0x4f, 0x2f, 0xaf, 0x6f, 0x1f, 0x9f, 0x5f };
365   switch (command)
366   {
367      case CMD_SCAN_REVERSE:
368         laserdisc_data_w(laserdisc, 0xf8);
369         playing = TRUE;
370         break;
371
372      case CMD_SCAN_REVERSE_END:
373         laserdisc_data_w(laserdisc, 0xfd);
374         playing = TRUE;
375         break;
376
377      case CMD_STEP_REVERSE:
378         laserdisc_data_w(laserdisc, 0xfe);
379         playing = FALSE;
380         break;
381
382      case CMD_SCAN_FORWARD:
383         laserdisc_data_w(laserdisc, 0xf0);
384         playing = TRUE;
385         break;
386
387      case CMD_SCAN_FORWARD_END:
388         laserdisc_data_w(laserdisc, 0xfd);
389         playing = TRUE;
390         break;
391
392      case CMD_STEP_FORWARD:
393         laserdisc_data_w(laserdisc, 0xf6);
394         playing = FALSE;
395         break;
396
397      case CMD_PLAY:
398         laserdisc_data_w(laserdisc, 0xfd);
399         playing = TRUE;
400         break;
401
402      case CMD_PAUSE:
403         laserdisc_data_w(laserdisc, 0xa0);
404         playing = FALSE;
405         break;
406
407      case CMD_DISPLAY_ON:
408         laserdisc_data_w(laserdisc, digits[1]);
409         laserdisc_data_w(laserdisc, 0xf1);
410         break;
411
412      case CMD_DISPLAY_OFF:
413         laserdisc_data_w(laserdisc, digits[0]);
414         laserdisc_data_w(laserdisc, 0xf1);
415         break;
416
417      case CMD_0:
418      case CMD_1:
419      case CMD_2:
420      case CMD_3:
421      case CMD_4:
422      case CMD_5:
423      case CMD_6:
424      case CMD_7:
425      case CMD_8:
426      case CMD_9:
427         laserdisc_data_w(laserdisc, digits[command - CMD_0]);
428         break;
429
430      case CMD_SEARCH:
431         laserdisc_data_w(laserdisc, 0xf7);
432         playing = FALSE;
433         break;
434   }
435}
436
437
438
439/*************************************
440 *
147441 *  Port definitions
148442 *
149443 *************************************/
r3115r3116
173467
174468/*************************************
175469 *
470 *  Test PR-8210 ROM emulation
471 *
472 *************************************/
473
474#if TEST_PR8210_ROM
475
476static READ8_HANDLER( pr8210_pia_r )
477{
478   UINT8 result = pia[offset];
479   switch (offset)
480   {
481      case 0xa0:
482//          printf("%03X:pia_r(%02X) = %02X\n", activecpu_get_pc(), offset, pr8210_pia_porta);
483         result = pr8210_pia_porta;
484         pr8210_pia_porta = 0;
485         break;
486
487      default:
488         printf("%03X:pia_r(%02X)\n", activecpu_get_pc(), offset);
489         break;
490   }
491   return result;
492}
493
494static WRITE8_HANDLER( pr8210_pia_w )
495{
496   /*
497       $22-26 (R) = read and copied to memory $23-27
498       $23 (R) = something compared against $F4
499       $22-26 (W) = SRCH. text
500       $27-2B (W) = FRAME/CHAP. text
501       $2C-30 (W) = frame or chapter number
502       $40 (W) = $CF at initialization, tracked by ($78)
503       $60 (W) = port B output, tracked by ($77)
504           $80 = n/c
505           $40 = (out) LED3
506           $20 = (out) LED2
507           $10 = (out) LED1
508                    123 -> LHL = Play
509                        -> HLL = Slow fwd
510                        -> LLL = Slow rev
511                        -> HHL = Still
512                        -> LLH = Pause
513                        -> HHH = all off
514           $08 = (out) CAV LED
515           $04 = (out) CLV LED
516           $02 = (out) A2 LED/AUDIO 2
517           $01 = (out) A1 LED/AUDIO 1
518       $80 (W) = 0 or 1
519       $A0 (R) = port A input
520       $C0 (R) = stored to ($2E)
521       $E0 (R) = stored to ($2F)
522    */
523   if (pia[offset] != data)
524   {
525      switch (offset)
526      {
527         case 0x60:
528            printf("%03X:pia_w(%02X) = %02X (PORT B LEDS:", activecpu_get_pc(), offset, data);
529            if (!(data & 0x01)) printf(" AUDIO1");
530            if (!(data & 0x02)) printf(" AUDIO2");
531            if (!(data & 0x04)) printf(" CLV");
532            if (!(data & 0x08)) printf(" CAV");
533            printf(" LED123=%c%c%c", (data & 0x10) ? 'H' : 'L', (data & 0x20) ? 'H' : 'L', (data & 0x40) ? 'H' : 'L');
534            if (!(data & 0x80)) printf(" ???");
535            printf(")\n");
536            pr8210_pia_portb = data;
537            break;
538
539         default:
540            printf("%03X:pia_w(%02X) = %02X\n", activecpu_get_pc(), offset, data);
541            break;
542      }
543      pia[offset] = data;
544   }
545}
546
547static READ8_HANDLER( pr8210_bus_r )
548{
549   /*
550       $80 = n/c
551       $40 = (in) slide pot interrupt source (slider position limit detector, inside and outside)
552       $20 = n/c
553       $10 = (in) /FOCUS LOCK
554       $08 = (in) /SPDL LOCK
555       $04 = (in) SIZE 8/12
556       $02 = (in) FG via op-amp (spindle motor stop detector)
557       $01 = (in) SLOW TIMER OUT
558    */
559   offs_t pc = activecpu_get_pc();
560   if (pc != 0x11c)
561      printf("%03X:bus_r\n", pc);
562
563   /* loop at beginning waits for $40=0, $02=1 */
564   return 0xff & ~0x40 & ~0x04;
565}
566
567static WRITE8_HANDLER( pr8210_porta_w )
568{
569   /*
570       $80 = (out) SCAN C (F/R)
571       $40 = (out) AUDIO SQ
572       $20 = (out) VIDEO SQ
573       $10 = (out) /SPDL ON
574       $08 = (out) /FOCUS ON
575       $04 = (out) SCAN B (L/H)
576       $02 = (out) SCAN A (/SCAN)
577       $01 = (out) JUMP TRG (jump back trigger, clock on high->low)
578    */
579   if (data != pr8210_porta)
580   {
581      printf("%03X:porta_w = %02X", activecpu_get_pc(), data);
582      if (!(data & 0x01)) printf(" JUMPTRG");
583      if (!(data & 0x02))
584      {
585         printf(" SCAN:%c:%c", (data & 0x80) ? 'F' : 'R', (data & 0x04) ? 'L' : 'H');
586      }
587      if (!(data & 0x08)) printf(" /FOCUSON");
588      if (!(data & 0x10)) printf(" /SPDLON");
589      if (data & 0x20) printf(" VIDEOSQ");
590      if (data & 0x40) printf(" AUDIOSQ");
591      printf("\n");
592      pr8210_porta = data;
593   }
594}
595
596static WRITE8_HANDLER( pr8210_portb_w )
597{
598   /*
599       $80 = (out) /CS on PIA
600       $40 = (out) 0 to self-generate IRQ
601       $20 = (out) SLOW TRG
602       $10 = (out) STANDBY LED
603       $08 = (out) TP2
604       $04 = (out) TP1
605       $02 = (out) ???
606       $01 = (out) LASER ON
607    */
608   cputag_set_input_line(machine, "pr8210", 0, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
609   if ((data & 0x7f) != (pr8210_portb & 0x7f))
610   {
611      printf("%03X:portb_w = %02X", activecpu_get_pc(), data);
612      if (!(data & 0x01)) printf(" LASERON");
613      if (!(data & 0x02)) printf(" ???");
614      if (!(data & 0x04)) printf(" TP1");
615      if (!(data & 0x08)) printf(" TP2");
616      if (!(data & 0x10)) printf(" STANDBYLED");
617      if (!(data & 0x20)) printf(" SLOWTRG");
618      if (!(data & 0x40)) printf(" IRQGEN");
619//      if (data & 0x80) printf(" PIASEL");
620      printf("\n");
621      pr8210_portb = data;
622   }
623}
624
625
626static ADDRESS_MAP_START( pr8210_portmap, ADDRESS_SPACE_IO, 8 )
627   AM_RANGE(0x00, 0xff) AM_READWRITE(pr8210_pia_r, pr8210_pia_w)
628   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(pr8210_bus_r)
629   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(pr8210_porta_w)
630   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(pr8210_portb_w)
631ADDRESS_MAP_END
632
633#endif
634
635
636
637/*************************************
638 *
176639 *  Machine drivers
177640 *
178641 *************************************/
r3115r3116
204667MACHINE_DRIVER_END
205668
206669
670static MACHINE_DRIVER_START( pr8210 )
671   MDRV_IMPORT_FROM(ldplayer_ntsc)
672   MDRV_MACHINE_START(pr8210)
673   MDRV_MACHINE_RESET(pr8210)
674   MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR8210)
207675
676#if TEST_PR8210_ROM
677   MDRV_CPU_ADD("pr8210", I8049, XTAL_4_41MHz)
678   MDRV_CPU_IO_MAP(pr8210_portmap,0)
679#endif
680MACHINE_DRIVER_END
681
682
683
208684/*************************************
209685 *
210686 *  ROM definitions
r3115r3116
216692ROM_END
217693
218694
695ROM_START( pr8210 )
696   DISK_REGION( "laserdisc" )
219697
698#if TEST_PR8210_ROM
699   ROM_REGION( 0x800, "pr8210", 0 )
700   ROM_LOAD( "pr-8210_mcu_ud6005a.bin", 0x000, 0x800, CRC(120fa83b) SHA1(b514326ca1f52d6d89056868f9d17eabd4e3f31d) )
701#endif
702ROM_END
703
704
705
220706/*************************************
221707 *
222708 *  Driver initialization
r3115r3116
286772
287773
288774
775static DRIVER_INIT( ldv1000 ) { execute_command = ldv1000_execute; DRIVER_INIT_CALL(ldplayer); }
776static DRIVER_INIT( pr8210 )  { execute_command = pr8210_execute; DRIVER_INIT_CALL(ldplayer); }
777
778
779
289780/*************************************
290781 *
291782 *  Game drivers
292783 *
293784 *************************************/
294785
295GAME( 2008, ldv1000, 0, ldv1000, ldplayer, ldplayer, ROT0, "MAME", "LDV-1000 Simulator", 0 )
786GAME( 2008, ldv1000, 0, ldv1000, ldplayer, ldv1000, ROT0, "MAME", "Pioneer LDV-1000 Simulator", 0 )
787GAME( 2008, pr8210,  0, pr8210,  ldplayer, pr8210,  ROT0, "MAME", "Pioneer PR-8210 Simulator", 0 )
docs/messnew.txt
r3115r3116
3131
3232Source Changes:
3333----------------
34(none)
34- The core is based on MAME 0.127u1.  This incorporates all features of the
35  update to this core.  [MAME team]
3536
3637
3738

Previous 15994 Revisions Next


© 1998-2018 The MESS Team