Previous 15994 Revisions Next

r7357 Sunday 14th February, 2010 at 22:44:05 UTC by Nathan Woods
Updated to MAME 0.136u3 core
[ROOT]makefile
[docs]messnew.txt
[src/emu]debugger.c driver.h emu.mak emuopts.c emuopts.h inptport.c mame.c mame.h render.c render.h ui.c uiinput.c uiinput.h uimenu.c validity.c video.c
[src/emu/cpu]cpu.mak
[src/emu/cpu/am29000]am29000.c
[src/emu/cpu/apexc]apexcdsm.c
[src/emu/cpu/i386]i386op16.c i386op32.c
[src/emu/cpu/mcs48]mcs48.h
[src/emu/cpu/mn10200]mn10200.c* mn10200.h* mn102dis.c*
[src/emu/debug]debugcpu.c
[src/emu/debugint]debugint.c* debugint.h*
[src/emu/drivers]xtal.h
[src/emu/layout]vertical.lay
[src/emu/machine]i8255a.c
[src/emu/sound]segapcm.c sound.mak zsg2.c* zsg2.h*
[src/emu/video]hd63484.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]8080bw.c dkong.c taito_zm.c* taito_zm.h*
[src/mame/drivers]1945kiii.c 2mindril.c 8080bw.c acefruit.c actfancr.c adp.c aerofgt.c airbustr.c aladbl.c albazc.c alg.c alpha68k.c appoooh.c arabian.c aristmk5.c arkanoid.c asterix.c asteroid.c astinvad.c astrocde.c astrocorp.c astrof.c asuka.c atarig1.c atetris.c backfire.c badlands.c bagman.c balsente.c battlnts.c bestleag.c bfm_sc1.c bfm_sc2.c bfmsys85.c bigevglf.c bishi.c bishjan.c bladestl.c blockade.c blockout.c bloodbro.c bombjack.c canyon.c carjmbre.c carpolo.c cave.c cball.c ccastles.c cclimber.c champbas.c chinagat.c cidelsa.c cliffhgr.c cojag.c commando.c cps1.c crbaloon.c crimfght.c crshrace.c cshooter.c cvs.c cyberbal.c dambustr.c darkhors.c dassault.c ddenlovr.c ddragon.c ddragon3.c ddribble.c* dec0.c dec8.c decocass.c destroyr.c dkong.c docastle.c dooyong.c espial.c esripsys.c exidy.c exprraid.c fastfred.c finalizr.c firebeat.c firetrap.c flkatck.c freekick.c funkybee.c funkyjet.c funworld.c fuukifg2.c gaelco2.c galaxian.c galaxold.c galpanic.c gamecstl.c gaplus.c gng.c goldstar.c gticlub.c gunpey.c gunsmoke.c harddriv.c hornet.c hshavoc.c hyperspt.c igs009.c irobot.c itech32.c itech8.c jackie.c kingobox.c klax.c konamigx.c kyugo.c lethal.c lwings.c megadriv.c megaplay.c megasys1.c megatech.c micro3d.c model2.c mrdo.c namcos11.c naomi.c neogeo.c neptunp2.c* nwk-tr.c pachifev.c puckpkmn.c raiden.c sangho.c segac2.c segae.c segahang.c segamsys.c segaorun.c segas16a.c segas16b.c segas18.c segas24.c segaxbd.c segaybd.c seibuspi.c sigmab52.c* snesb.c spiders.c ssf2md.c ssgbl.c subsino.c system16.c taito_l.c taitogn.c toaplan1.c topshoot.c vamphalf.c wrally.c zn.c zr107.c
[src/mame/includes]cclimber.h cyberbal.h ddribble.h* dec8.h dkong.h genesis.h megadriv.h* mw8080bw.h naomi.h segamsys.h* segas16.h* system16.h
[src/mame/layout]tisub.lay*
[src/mame/machine]cclimber.c dc.c decocass.c decocass.h naomi.c naomibd.c s16fd.c segaic16.c segaic16.h segas24.c snes.c
[src/mame/video]8080bw.c cps1.c cyberbal.c ddribble.c* dec8.c dkong.c genesis.c gticlub.c hng64.c konamiic.c konicdev.c megasys1.c rungun.c segahang.c segaorun.c segas16a.c segas16b.c segas18.c segaxbd.c segaybd.c snes.c system16.c
[src/mess]mess.mak
[src/osd]osdcore.h
[src/osd/sdl]README_SDL13.txt dview.c input.c osdsdl.h sdl.mak sdldir.c sdlfile.c sdlmain.c sdlos_macosx.c sdlos_os2.c sdlos_unix.c sdlos_win32.c texcopy.c video.c window.c
[src/osd/windows]video.c window.c winmain.c

src/mame/audio/8080bw.c
r7356r7357
10571057/* Much more work needs to be done       */
10581058/*****************************************/
10591059
1060WRITE8_HANDLER( schasrcv_sh_port_1_w )
1060WRITE8_HANDLER( schasercv_sh_port_1_w )
10611061{
10621062
10631063   /* bit 2 = 2nd speedup
r7356r7357
10731073   state->port_1_last_extra = data;
10741074}
10751075
1076WRITE8_HANDLER( schasrcv_sh_port_2_w )
1076WRITE8_HANDLER( schasercv_sh_port_2_w )
10771077{
10781078   mw8080bw_state *state = (mw8080bw_state *)space->machine->driver_data;
10791079
src/mame/audio/dkong.c
r7356r7357
11401140        { 0x0000, 0x007a, 0x018b, 0x0320, 0x036c, 0x03c4, 0x041c, 0x0520, 0x063e }
11411141    and related samples interface
11421142
1143    static const char *const radarsc1_sample_names[] =
1143    static const char *const radarscp1_sample_names[] =
11441144    {
1145        "*radarsc1",
1145        "*radarscp1",
11461146        "10.wav",
11471147        "12.wav",
11481148        "14.wav",
r7356r7357
11551155        0
11561156    };
11571157
1158    static const samples_interface radarsc1_samples_interface =
1158    static const samples_interface radarscp1_samples_interface =
11591159    {
11601160        8,
1161        radarsc1_sample_names
1161        radarscp1_sample_names
11621162    };
11631163
11641164*/
r7356r7357
12591259   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4)
12601260ADDRESS_MAP_END
12611261
1262static ADDRESS_MAP_START( radarsc1_sound_io_map, ADDRESS_SPACE_IO, 8 )
1262static ADDRESS_MAP_START( radarscp1_sound_io_map, ADDRESS_SPACE_IO, 8 )
12631263   AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_DEVREAD("ls175.3d", latch8_r)
12641264   AM_RANGE(0x00, 0xff) AM_DEVWRITE("discrete", dkong_p1_w) /* DAC here */
12651265   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_LATCH8_READ("virtual_p1")
r7356r7357
13201320   MDRV_LATCH8_DISCRETE_NODE("discrete", 7, DS_SOUND7_INP)
13211321
13221322   /*   If P2.Bit7 -> is apparently an external signal decay or other output control
1323     *   If P2.Bit6 -> activates the external compressed sample ROM (not radarsc1)
1324     *   If P2.Bit5 -> Signal ANSN ==> Grid enable (radarsc1)
1323     *   If P2.Bit6 -> activates the external compressed sample ROM (not radarscp1)
1324     *   If P2.Bit5 -> Signal ANSN ==> Grid enable (radarscp1)
13251325     *   If P2.Bit4 -> status code to main cpu
13261326     *   P2.Bit2-0  -> select the 256 byte bank for external ROM
13271327     */
r7356r7357
13521352MACHINE_DRIVER_END
13531353
13541354
1355MACHINE_DRIVER_START( radarsc1_audio )
1355MACHINE_DRIVER_START( radarscp1_audio )
13561356
13571357   MDRV_IMPORT_FROM( radarscp_audio )
13581358   MDRV_CPU_MODIFY("soundcpu")
1359   MDRV_CPU_IO_MAP(radarsc1_sound_io_map)
1359   MDRV_CPU_IO_MAP(radarscp1_sound_io_map)
13601360
13611361   /* virtual_p2 is not read -see memory map-, all bits are output bits */
13621362   MDRV_LATCH8_ADD( "virtual_p1" )   /* virtual latch for port A */
src/mame/audio/taito_zm.c
r0r7357
1/***************************************************************************
2
3    Taito Zoom ZSG-2 sound board
4    Includes: MN10200 CPU, ZOOM ZSG-2 audio chip, TMS57002 DASP
5    By Olivier Galibert.
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
12#include "emu.h"
13#include "cpu/mn10200/mn10200.h"
14#include "cpu/tms57002/tms57002.h"
15#include "audio/taito_zm.h"
16#include "sound/zsg2.h"
17
18static ADDRESS_MAP_START(taitozoom_map, ADDRESS_SPACE_PROGRAM, 16)
19   AM_RANGE(0x080000, 0x0fffff) AM_ROM AM_REGION("mn10200", 0)
20   AM_RANGE(0x400000, 0x40ffff) AM_RAM
21   AM_RANGE(0x800000, 0x800fff) AM_DEVREADWRITE("zsg2", zsg2_r, zsg2_w)
22   AM_RANGE(0xe00000, 0xe000ff) AM_RAM   // main CPU comms?
23   AM_RANGE(0xc00000, 0xc00001) AM_RAM   // TMS57002 comms
24ADDRESS_MAP_END
25
26static UINT8 tms_ctrl;
27
28static READ8_HANDLER(tms_ctrl_r)
29{
30   return tms_ctrl;
31}
32
33static WRITE8_HANDLER(tms_ctrl_w)
34{
35#if 0
36   tms57002_reset_w(data & 4);
37   tms57002_cload_w(data & 2);
38   tms57002_pload_w(data & 1);
39#endif
40
41   tms_ctrl = data;
42}
43
44static ADDRESS_MAP_START(taitozoom_io_map, ADDRESS_SPACE_IO, 8)
45   AM_RANGE(MN10200_PORT1, MN10200_PORT1) AM_READWRITE(tms_ctrl_r, tms_ctrl_w)
46ADDRESS_MAP_END
47
48static const zsg2_interface zsg2_taito_config =
49{
50   "zsg2"   /* sample region */
51};
52
53MACHINE_DRIVER_START( taito_zoom_sound )
54   MDRV_CPU_ADD("mn10200", MN10200, 25000000/2)
55   MDRV_CPU_PROGRAM_MAP(taitozoom_map)
56   MDRV_CPU_IO_MAP(taitozoom_io_map)
57
58   // we assume the parent machine has created lspeaker/rspeaker
59   MDRV_SOUND_ADD("zsg2", ZSG2, 25000000/2)
60   MDRV_SOUND_CONFIG(zsg2_taito_config)
61   MDRV_SOUND_ROUTE(0, "lspeaker", 1.0)
62   MDRV_SOUND_ROUTE(1, "rspeaker", 1.0)
63MACHINE_DRIVER_END
src/mame/audio/taito_zm.h
src/mame/machine/s16fd.c
r7356r7357
1212#include "cpu/m68000/m68000.h"
1313#include "machine/fd1094.h"
1414#include "machine/fddebug.h"
15#include "includes/system16.h"
15#include "includes/segas16.h"
1616
1717
1818#define CACHE_ENTRIES   8
src/mame/machine/naomi.c
r7356r7357
99
1010UINT64 *naomi_ram64;
1111int jvsboard_type;
12UINT16 actel_id;
1213
1314static READ64_HANDLER( naomi_bios_idle_skip_r )
1415{
r7356r7357
2526{
2627   memory_install_read64_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc2ad238, 0xc2ad23f, 0, 0, naomi_bios_idle_skip_r); // rev e bios
2728   jvsboard_type = JVSBD_DEFAULT;
29   actel_id = 0xffff;
2830}
2931
3032DRIVER_INIT(naomi_mp)
3133{
3234   memory_install_read64_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc2ad238, 0xc2ad23f, 0, 0, naomi_bios_idle_skip_r); // rev e bios
3335   jvsboard_type = JVSBD_MAHJONG;
36   actel_id = 0xffff;
3437}
3538
3639static READ64_HANDLER( naomigd_ggxxsla_idle_skip_r )
r7356r7357
7881   memory_install_read64_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc18d6c8, 0xc18d6cf, 0, 0, naomigd_ggxxrl_idle_skip_r);
7982   DRIVER_INIT_CALL(naomi);
8083}
84
85DRIVER_INIT( qmegamis )
86{
87   DRIVER_INIT_CALL(naomi);
88   actel_id = 0; //FIXME: correct value
89}
90
91DRIVER_INIT( mvsc2 )
92{
93   DRIVER_INIT_CALL(naomi);
94   actel_id = 0; //FIXME: correct value
95}
96
97DRIVER_INIT( gram2000 )
98{
99   DRIVER_INIT_CALL(naomi);
100   actel_id = 0; //FIXME: correct value
101}
102
103DRIVER_INIT( vf4evoct )
104{
105//  DRIVER_INIT_CALL(naomi2);
106   actel_id = 0; //FIXME: correct value
107}
src/mame/machine/decocass.c
r7356r7357
15701570   state->type3_swap = TYPE3_SWAP_56;
15711571}
15721572
1573MACHINE_RESET( cgraplp2 )
1573MACHINE_RESET( cgraplop2 )
15741574{
15751575   decocass_state *state = (decocass_state *)machine->driver_data;
15761576   decocass_reset_common(machine);
src/mame/machine/decocass.h
r7356r7357
149149extern MACHINE_RESET( cburnrub );
150150extern MACHINE_RESET( cbtime );
151151extern MACHINE_RESET( cgraplop );
152extern MACHINE_RESET( cgraplp2 );
152extern MACHINE_RESET( cgraplop2 );
153153extern MACHINE_RESET( clapapa );
154154extern MACHINE_RESET( cfghtice );
155155extern MACHINE_RESET( cprobowl );
src/mame/machine/segas24.c
r7356r7357
11#include "emu.h"
2#include "includes/system16.h"
32#include "includes/segas24.h"
43
54/* system24temp_ functions / variables are from shared rewrite files,
src/mame/machine/dc.c
r7356r7357
303303   maple0x86data2[pos+20]=8; // bits per channel
304304   maple0x86data2[pos+21]=0;
305305   //4 rotary
306   maple0x86data2[pos+22]=0;
306   maple0x86data2[pos+22]=4;
307   maple0x86data2[pos+23]=4; // channels
308   maple0x86data2[pos+24]=8; // bits per channel
307309   //5 keyboard
308310   //6 (touch?) screen
309311   //7 card reader
r7356r7357
617619               {
618620                  if (port > 0)
619621                     buff[0]=0xffffffff;
622//                      printf("MAPLE: command %02x\n", command);
620623                  switch (command)
621624                  {
622625                     case 1:
r7356r7357
696699                           jvs_address = (buff[1] >> 16) & 0xff; // slave address
697700                           jvs_command = buff[2] & 0xff; // jvs command
698701                           #if DEBUG_MAPLE
699                           printf("MAPLE: sent jvs command %x\n", jvs_command);
702                           printf("MAPLE: sent jvs command %x to address %x\n", jvs_command, jvs_address);
700703                           #endif
701704                           //buff[1] = 0xe4e3e2e1;
702705                           ddtdata.length = 0;//2;
src/mame/machine/segaic16.c
r7356r7357
88#include "segaic16.h"
99#include "video/resnet.h"
1010#include "machine/fd1089.h"
11#include "includes/system16.h"
11#include "includes/segas16.h"      // needed for fd1094 calls
1212
1313
1414/*************************************
r7356r7357
4040};
4141
4242
43struct multiply_chip
44{
45   UINT16   regs[4];
46};
47
48
49struct divide_chip
50{
51   UINT16   regs[8];
52};
53
54
55struct compare_timer_chip
56{
57   UINT16   regs[16];
58   UINT16   counter;
59   UINT8   bit;
60   void   (*sound_w)(running_machine *, UINT8);
61   void   (*timer_ack)(running_machine *);
62};
63
64
65
6643/*************************************
6744 *
6845 *  Statics
r7356r7357
7047 *************************************/
7148
7249static struct memory_mapper_chip memory_mapper;
73static struct multiply_chip multiply[3];
74static struct divide_chip divide[3];
75static struct compare_timer_chip compare_timer[2];
7650
7751
78
7952/*************************************
8053 *
8154 *  Prototypes
r7356r7357
8558static void update_memory_mapping(running_machine *machine, struct memory_mapper_chip *chip, int decrypt);
8659
8760
88
8961/*************************************
9062 *
9163 *  Misc helpers
r7356r7357
137109
138110   /* create the initial regions */
139111   update_memory_mapping(cpu->machine, chip, 0);
112
113   state_save_register_item_array(cpu->machine, "segaic16_mapper", NULL, 0, chip->regs);
140114}
141115
142
143116void segaic16_memory_mapper_reset(running_machine *machine)
144117{
145118   struct memory_mapper_chip *chip = &memory_mapper;
r7356r7357
420393}
421394
422395
423
424396/*************************************
425397 *
426 *  Multiply chip
398 *  Multiply chip - 315-5248
427399 *
428400 *************************************/
429401
430static UINT16 multiply_r(int which, offs_t offset, UINT16 mem_mask)
402typedef struct _ic_315_5248_state ic_315_5248_state ;
403struct _ic_315_5248_state
431404{
405   UINT16   regs[4];
406};
407
408/*****************************************************************************
409    INLINE FUNCTIONS
410*****************************************************************************/
411
412INLINE ic_315_5248_state *_315_5248_get_safe_token( running_device *device )
413{
414   assert(device != NULL);
415   assert(device->token != NULL);
416   assert(device->type == _315_5248);
417
418   return (ic_315_5248_state *)device->token;
419}
420
421/*****************************************************************************
422    IMPLEMENTATION
423*****************************************************************************/
424
425READ16_DEVICE_HANDLER ( segaic16_multiply_r )
426{
427   ic_315_5248_state *ic_315_5248 = _315_5248_get_safe_token(device);
428
432429   offset &= 3;
433430   switch (offset)
434431   {
435      case 0:   return multiply[which].regs[0];
436      case 1:   return multiply[which].regs[1];
437      case 2:   return ((INT16)multiply[which].regs[0] * (INT16)multiply[which].regs[1]) >> 16;
438      case 3:   return ((INT16)multiply[which].regs[0] * (INT16)multiply[which].regs[1]) & 0xffff;
432      case 0:   return ic_315_5248->regs[0];
433      case 1:   return ic_315_5248->regs[1];
434      case 2:   return ((INT16)ic_315_5248->regs[0] * (INT16)ic_315_5248->regs[1]) >> 16;
435      case 3:   return ((INT16)ic_315_5248->regs[0] * (INT16)ic_315_5248->regs[1]) & 0xffff;
439436   }
440437   return 0xffff;
441438}
442439
443440
444static void multiply_w(int which, offs_t offset, UINT16 data, UINT16 mem_mask)
441WRITE16_DEVICE_HANDLER( segaic16_multiply_w )
445442{
443   ic_315_5248_state *ic_315_5248 = _315_5248_get_safe_token(device);
444
446445   offset &= 3;
447446   switch (offset)
448447   {
449      case 0:   COMBINE_DATA(&multiply[which].regs[0]);   break;
450      case 1:   COMBINE_DATA(&multiply[which].regs[1]);   break;
451      case 2:   COMBINE_DATA(&multiply[which].regs[0]);   break;
452      case 3:   COMBINE_DATA(&multiply[which].regs[1]);   break;
448      case 0:   COMBINE_DATA(&ic_315_5248->regs[0]);   break;
449      case 1:   COMBINE_DATA(&ic_315_5248->regs[1]);   break;
450      case 2:   COMBINE_DATA(&ic_315_5248->regs[0]);   break;
451      case 3:   COMBINE_DATA(&ic_315_5248->regs[1]);   break;
453452   }
454453}
455454
455/*****************************************************************************
456    DEVICE INTERFACE
457*****************************************************************************/
456458
457READ16_HANDLER( segaic16_multiply_0_r )  { return multiply_r(0, offset, mem_mask); }
458READ16_HANDLER( segaic16_multiply_1_r )  { return multiply_r(1, offset, mem_mask); }
459READ16_HANDLER( segaic16_multiply_2_r )  { return multiply_r(2, offset, mem_mask); }
460WRITE16_HANDLER( segaic16_multiply_0_w ) { multiply_w(0, offset, data, mem_mask); }
461WRITE16_HANDLER( segaic16_multiply_1_w ) { multiply_w(1, offset, data, mem_mask); }
462WRITE16_HANDLER( segaic16_multiply_2_w ) { multiply_w(2, offset, data, mem_mask); }
459static DEVICE_START( ic_315_5248 )
460{
461   ic_315_5248_state *ic_315_5248 = _315_5248_get_safe_token(device);
463462
463   state_save_register_device_item_array(device, 0, ic_315_5248->regs);
464}
464465
466static DEVICE_RESET( ic_315_5248 )
467{
468   ic_315_5248_state *ic_315_5248 = _315_5248_get_safe_token(device);
469   int i;
465470
471   for (i = 0; i < 4; i++)
472      ic_315_5248->regs[i] = 0;
473}
474
466475/*************************************
467476 *
468 *  Divide chip
477 *  Divide chip - 315-5249
469478 *
470479 *************************************/
471480
472static void update_divide(int which, int mode)
481typedef struct _ic_315_5249_state ic_315_5249_state ;
482struct _ic_315_5249_state
473483{
484   UINT16   regs[8];
485};
486
487/*****************************************************************************
488    INLINE FUNCTIONS
489*****************************************************************************/
490
491INLINE ic_315_5249_state *_315_5249_get_safe_token( running_device *device )
492{
493   assert(device != NULL);
494   assert(device->token != NULL);
495   assert(device->type == _315_5249);
496
497   return (ic_315_5249_state *)device->token;
498}
499
500/*****************************************************************************
501    IMPLEMENTATION
502*****************************************************************************/
503
504static void update_divide( running_device *device, int mode )
505{
506   ic_315_5249_state *ic_315_5249 = _315_5249_get_safe_token(device);
507
474508   /* clear the flags by default */
475   divide[which].regs[6] = 0;
509   ic_315_5249->regs[6] = 0;
476510
477511   /* if mode 0, store quotient/remainder */
478512   if (mode == 0)
479513   {
480      INT32 dividend = (INT32)((divide[which].regs[0] << 16) | divide[which].regs[1]);
481      INT32 divisor = (INT16)divide[which].regs[2];
514      INT32 dividend = (INT32)((ic_315_5249->regs[0] << 16) | ic_315_5249->regs[1]);
515      INT32 divisor = (INT16)ic_315_5249->regs[2];
482516      INT32 quotient, remainder;
483517
484518      /* perform signed divide */
485519      if (divisor == 0)
486520      {
487521         quotient = dividend;//((INT32)(dividend ^ divisor) < 0) ? 0x8000 : 0x7fff;
488         divide[which].regs[6] |= 0x4000;
522         ic_315_5249->regs[6] |= 0x4000;
489523      }
490524      else
491525         quotient = dividend / divisor;
526
492527      remainder = dividend - quotient * divisor;
493528
494529      /* clamp to 16-bit signed */
495530      if (quotient < -32768)
496531      {
497532         quotient = -32768;
498         divide[which].regs[6] |= 0x8000;
533         ic_315_5249->regs[6] |= 0x8000;
499534      }
500535      else if (quotient > 32767)
501536      {
502537         quotient = 32767;
503         divide[which].regs[6] |= 0x8000;
538         ic_315_5249->regs[6] |= 0x8000;
504539      }
505540
506541      /* store quotient and remainder */
507      divide[which].regs[4] = quotient;
508      divide[which].regs[5] = remainder;
542      ic_315_5249->regs[4] = quotient;
543      ic_315_5249->regs[5] = remainder;
509544   }
510545
511546   /* if mode 1, store 32-bit quotient */
512547   else
513548   {
514      UINT32 dividend = (UINT32)((divide[which].regs[0] << 16) | divide[which].regs[1]);
515      UINT32 divisor = (UINT16)divide[which].regs[2];
549      UINT32 dividend = (UINT32)((ic_315_5249->regs[0] << 16) | ic_315_5249->regs[1]);
550      UINT32 divisor = (UINT16)ic_315_5249->regs[2];
516551      UINT32 quotient;
517552
518553      /* perform unsigned divide */
519554      if (divisor == 0)
520555      {
521556         quotient = dividend;//0x7fffffff;
522         divide[which].regs[6] |= 0x4000;
557         ic_315_5249->regs[6] |= 0x4000;
523558      }
524559      else
525560         quotient = dividend / divisor;
526561
527562      /* store 32-bit quotient */
528      divide[which].regs[4] = quotient >> 16;
529      divide[which].regs[5] = quotient & 0xffff;
563      ic_315_5249->regs[4] = quotient >> 16;
564      ic_315_5249->regs[5] = quotient & 0xffff;
530565   }
531566}
532567
533static UINT16 divide_r(int which, offs_t offset, UINT16 mem_mask)
568READ16_DEVICE_HANDLER ( segaic16_divide_r )
534569{
570   ic_315_5249_state *ic_315_5249 = _315_5249_get_safe_token(device);
571
535572   /* 8 effective read registers */
536573   offset &= 7;
537574   switch (offset)
538575   {
539      case 0:   return divide[which].regs[0];   /* dividend high */
540      case 1:   return divide[which].regs[1];   /* dividend low */
541      case 2:   return divide[which].regs[2];   /* divisor */
542      case 4: return divide[which].regs[4];   /* quotient (mode 0) or quotient high (mode 1) */
543      case 5:   return divide[which].regs[5];   /* remainder (mode 0) or quotient low (mode 1) */
544      case 6: return divide[which].regs[6];   /* flags */
576      case 0:   return ic_315_5249->regs[0];   /* dividend high */
577      case 1:   return ic_315_5249->regs[1];   /* dividend low */
578      case 2:   return ic_315_5249->regs[2];   /* divisor */
579      case 4:    return ic_315_5249->regs[4];   /* quotient (mode 0) or quotient high (mode 1) */
580      case 5:   return ic_315_5249->regs[5];   /* remainder (mode 0) or quotient low (mode 1) */
581      case 6:    return ic_315_5249->regs[6];   /* flags */
545582   }
583
546584   return 0xffff;
547585}
548586
549587
550static void divide_w(const address_space *space, int which, offs_t offset, UINT16 data, UINT16 mem_mask)
588WRITE16_DEVICE_HANDLER( segaic16_divide_w )
551589{
590   ic_315_5249_state *ic_315_5249 = _315_5249_get_safe_token(device);
552591   int a4 = offset & 8;
553592   int a3 = offset & 4;
554593
555   if (LOG_DIVIDE) logerror("%s:divide%d_w(%X) = %04X\n", cpuexec_describe_context(space->machine), which, offset, data);
594   if (LOG_DIVIDE) logerror("divide_w(%X) = %04X\n", offset, data);
556595
557596   /* only 4 effective write registers */
558597   offset &= 3;
559598   switch (offset)
560599   {
561      case 0:   COMBINE_DATA(&divide[which].regs[0]); break;   /* dividend high */
562      case 1:   COMBINE_DATA(&divide[which].regs[1]); break;   /* dividend low */
563      case 2:   COMBINE_DATA(&divide[which].regs[2]); break;   /* divisor/trigger */
600      case 0:   COMBINE_DATA(&ic_315_5249->regs[0]); break;   /* dividend high */
601      case 1:   COMBINE_DATA(&ic_315_5249->regs[1]); break;   /* dividend low */
602      case 2:   COMBINE_DATA(&ic_315_5249->regs[2]); break;   /* divisor/trigger */
564603      case 3:   break;
565604   }
566605
567606   /* if a4 line is high, divide, using a3 as the mode */
568   if (a4) update_divide(which, a3);
607   if (a4) update_divide(device, a3);
569608}
570609
610/*****************************************************************************
611    DEVICE INTERFACE
612*****************************************************************************/
571613
572READ16_HANDLER( segaic16_divide_0_r )  { return divide_r(0, offset, mem_mask); }
573READ16_HANDLER( segaic16_divide_1_r )  { return divide_r(1, offset, mem_mask); }
574READ16_HANDLER( segaic16_divide_2_r )  { return divide_r(2, offset, mem_mask); }
575WRITE16_HANDLER( segaic16_divide_0_w ) { divide_w(space, 0, offset, data, mem_mask); }
576WRITE16_HANDLER( segaic16_divide_1_w ) { divide_w(space, 1, offset, data, mem_mask); }
577WRITE16_HANDLER( segaic16_divide_2_w ) { divide_w(space, 2, offset, data, mem_mask); }
614static DEVICE_START( ic_315_5249 )
615{
616   ic_315_5249_state *ic_315_5249 = _315_5249_get_safe_token(device);
578617
618   state_save_register_device_item_array(device, 0, ic_315_5249->regs);
619}
579620
621static DEVICE_RESET( ic_315_5249 )
622{
623   ic_315_5249_state *ic_315_5249 = _315_5249_get_safe_token(device);
624   int i;
580625
626   for (i = 0; i < 8; i++)
627      ic_315_5249->regs[i] = 0;
628}
629
581630/*************************************
582631 *
583 *  Compare/timer chip
632 *  Compare/timer chip - 315-5250
584633 *
585634 *************************************/
586635
587void segaic16_compare_timer_init(int which, void (*sound_write_callback)(running_machine *, UINT8), void (*timer_ack_callback)(running_machine *))
636typedef struct _ic_315_5250_state ic_315_5250_state ;
637struct _ic_315_5250_state
588638{
589   memset(&compare_timer[which], 0, sizeof(compare_timer[which]));
590   compare_timer[which].sound_w = sound_write_callback;
591   compare_timer[which].timer_ack = timer_ack_callback;
639   UINT16   regs[16];
640   UINT16   counter;
641   UINT8         bit;
642   _315_5250_sound_callback       sound_w;
643   _315_5250_timer_ack_callback   timer_ack;
644};
645
646/*****************************************************************************
647    INLINE FUNCTIONS
648*****************************************************************************/
649
650INLINE ic_315_5250_state *_315_5250_get_safe_token( running_device *device )
651{
652   assert(device != NULL);
653   assert(device->token != NULL);
654   assert(device->type == _315_5250);
655
656   return (ic_315_5250_state *)device->token;
592657}
593658
659INLINE const ic_315_5250_interface *_315_5250_get_interface( running_device *device )
660{
661   assert(device != NULL);
662   assert((device->type == _315_5250));
663   return (const ic_315_5250_interface *) device->baseconfig().static_config;
664}
594665
595int segaic16_compare_timer_clock(int which)
666/*****************************************************************************
667    IMPLEMENTATION
668*****************************************************************************/
669
670int segaic16_compare_timer_clock( running_device *device )
596671{
597   int old_counter = compare_timer[which].counter;
672   ic_315_5250_state *ic_315_5250 = _315_5250_get_safe_token(device);
673   int old_counter = ic_315_5250->counter;
598674   int result = 0;
599675
600676   /* if we're enabled, clock the upcounter */
601   if (compare_timer[which].regs[10] & 1)
602      compare_timer[which].counter++;
677   if (ic_315_5250->regs[10] & 1)
678      ic_315_5250->counter++;
603679
604680   /* regardless of the enable, a value of 0xfff will generate the IRQ */
605681   if (old_counter == 0xfff)
606682   {
607683      result = 1;
608      compare_timer[which].counter = compare_timer[which].regs[8] & 0xfff;
684      ic_315_5250->counter = ic_315_5250->regs[8] & 0xfff;
609685   }
610686   return result;
611687}
612688
613689
614static void update_compare(int which, int update_history)
690static void update_compare( running_device *device, int update_history )
615691{
616   int bound1 = (INT16)compare_timer[which].regs[0];
617   int bound2 = (INT16)compare_timer[which].regs[1];
618   int value = (INT16)compare_timer[which].regs[2];
692   ic_315_5250_state *ic_315_5250 = _315_5250_get_safe_token(device);
693   int bound1 = (INT16)ic_315_5250->regs[0];
694   int bound2 = (INT16)ic_315_5250->regs[1];
695   int value = (INT16)ic_315_5250->regs[2];
619696   int min = (bound1 < bound2) ? bound1 : bound2;
620697   int max = (bound1 > bound2) ? bound1 : bound2;
621698
622699   if (value < min)
623700   {
624      compare_timer[which].regs[7] = min;
625      compare_timer[which].regs[3] = 0x8000;
701      ic_315_5250->regs[7] = min;
702      ic_315_5250->regs[3] = 0x8000;
626703   }
627704   else if (value > max)
628705   {
629      compare_timer[which].regs[7] = max;
630      compare_timer[which].regs[3] = 0x4000;
706      ic_315_5250->regs[7] = max;
707      ic_315_5250->regs[3] = 0x4000;
631708   }
632709   else
633710   {
634      compare_timer[which].regs[7] = value;
635      compare_timer[which].regs[3] = 0x0000;
711      ic_315_5250->regs[7] = value;
712      ic_315_5250->regs[3] = 0x0000;
636713   }
637714
638715   if (update_history)
639      compare_timer[which].regs[4] |= (compare_timer[which].regs[3] == 0) << compare_timer[which].bit++;
716      ic_315_5250->regs[4] |= (ic_315_5250->regs[3] == 0) << ic_315_5250->bit++;
640717}
641718
642719
643static void timer_interrupt_ack(running_machine *machine, int which)
720static void timer_interrupt_ack( running_device *device )
644721{
645   if (compare_timer[which].timer_ack)
646      (*compare_timer[which].timer_ack)(machine);
722   ic_315_5250_state *ic_315_5250 = _315_5250_get_safe_token(device);
723
724   if (ic_315_5250->timer_ack)
725      (*ic_315_5250->timer_ack)(device->machine);
647726}
648727
649728
650static UINT16 compare_timer_r(const address_space *space, int which, offs_t offset, UINT16 mem_mask)
729READ16_DEVICE_HANDLER ( segaic16_compare_timer_r )
651730{
731   ic_315_5250_state *ic_315_5250 = _315_5250_get_safe_token(device);
732
652733   offset &= 0xf;
653   if (LOG_COMPARE) logerror("%s:compare%d_r(%X) = %04X\n", cpuexec_describe_context(space->machine), which, offset, compare_timer[which].regs[offset]);
734   if (LOG_COMPARE) logerror("compare_r(%X) = %04X\n", offset, ic_315_5250->regs[offset]);
654735   switch (offset)
655736   {
656      case 0x0:   return compare_timer[which].regs[0];
657      case 0x1:   return compare_timer[which].regs[1];
658      case 0x2:   return compare_timer[which].regs[2];
659      case 0x3:   return compare_timer[which].regs[3];
660      case 0x4:   return compare_timer[which].regs[4];
661      case 0x5:   return compare_timer[which].regs[1];
662      case 0x6:   return compare_timer[which].regs[2];
663      case 0x7:   return compare_timer[which].regs[7];
737      case 0x0:   return ic_315_5250->regs[0];
738      case 0x1:   return ic_315_5250->regs[1];
739      case 0x2:   return ic_315_5250->regs[2];
740      case 0x3:   return ic_315_5250->regs[3];
741      case 0x4:   return ic_315_5250->regs[4];
742      case 0x5:   return ic_315_5250->regs[1];
743      case 0x6:   return ic_315_5250->regs[2];
744      case 0x7:   return ic_315_5250->regs[7];
664745      case 0x9:
665      case 0xd:   timer_interrupt_ack(space->machine, which); break;
746      case 0xd:   timer_interrupt_ack(device); break;
666747   }
667748   return 0xffff;
668749}
669750
670751
671static void compare_timer_w(const address_space *space, int which, offs_t offset, UINT16 data, UINT16 mem_mask)
752WRITE16_DEVICE_HANDLER ( segaic16_compare_timer_w )
672753{
754   ic_315_5250_state *ic_315_5250 = _315_5250_get_safe_token(device);
755
673756   offset &= 0xf;
674   if (LOG_COMPARE) logerror("%s:compare%d_w(%X) = %04X\n", cpuexec_describe_context(space->machine), which, offset, data);
757   if (LOG_COMPARE) logerror("compare_w(%X) = %04X\n", offset, data);
675758   switch (offset)
676759   {
677      case 0x0:   COMBINE_DATA(&compare_timer[which].regs[0]); update_compare(which, 0); break;
678      case 0x1:   COMBINE_DATA(&compare_timer[which].regs[1]); update_compare(which, 0); break;
679      case 0x2:   COMBINE_DATA(&compare_timer[which].regs[2]); update_compare(which, 1); break;
680      case 0x4:   compare_timer[which].regs[4] = 0; compare_timer[which].bit = 0; break;
681      case 0x6:   COMBINE_DATA(&compare_timer[which].regs[2]); update_compare(which, 0); break;
760      case 0x0:   COMBINE_DATA(&ic_315_5250->regs[0]); update_compare(device, 0); break;
761      case 0x1:   COMBINE_DATA(&ic_315_5250->regs[1]); update_compare(device, 0); break;
762      case 0x2:   COMBINE_DATA(&ic_315_5250->regs[2]); update_compare(device, 1); break;
763      case 0x4:   ic_315_5250->regs[4] = 0; ic_315_5250->bit = 0; break;
764      case 0x6:   COMBINE_DATA(&ic_315_5250->regs[2]); update_compare(device, 0); break;
682765      case 0x8:
683      case 0xc:   COMBINE_DATA(&compare_timer[which].regs[8]); break;
766      case 0xc:   COMBINE_DATA(&ic_315_5250->regs[8]); break;
684767      case 0x9:
685      case 0xd:   timer_interrupt_ack(space->machine, which); break;
768      case 0xd:   timer_interrupt_ack(device); break;
686769      case 0xa:
687      case 0xe:   COMBINE_DATA(&compare_timer[which].regs[10]); break;
770      case 0xe:   COMBINE_DATA(&ic_315_5250->regs[10]); break;
688771      case 0xb:
689772      case 0xf:
690         COMBINE_DATA(&compare_timer[which].regs[11]);
691         if (compare_timer[which].sound_w)
692            (*compare_timer[which].sound_w)(space->machine, compare_timer[which].regs[11]);
773         COMBINE_DATA(&ic_315_5250->regs[11]);
774         if (ic_315_5250->sound_w)
775            (*ic_315_5250->sound_w)(device->machine, ic_315_5250->regs[11]);
693776         break;
694777   }
695778}
696779
780/*****************************************************************************
781    DEVICE INTERFACE
782*****************************************************************************/
697783
698READ16_HANDLER( segaic16_compare_timer_0_r )  { return compare_timer_r(space, 0, offset, mem_mask); }
699READ16_HANDLER( segaic16_compare_timer_1_r )  { return compare_timer_r(space, 1, offset, mem_mask); }
700WRITE16_HANDLER( segaic16_compare_timer_0_w ) { compare_timer_w(space, 0, offset, data, mem_mask); }
701WRITE16_HANDLER( segaic16_compare_timer_1_w ) { compare_timer_w(space, 1, offset, data, mem_mask); }
784static DEVICE_START( ic_315_5250 )
785{
786   ic_315_5250_state *ic_315_5250 = _315_5250_get_safe_token(device);
787   const ic_315_5250_interface *intf = _315_5250_get_interface(device);
788
789   ic_315_5250->sound_w = intf->sound_write_callback;
790   ic_315_5250->timer_ack = intf->timer_ack_callback;
791
792   state_save_register_device_item(device, 0, ic_315_5250->counter);
793   state_save_register_device_item(device, 0, ic_315_5250->bit);
794   state_save_register_device_item_array(device, 0, ic_315_5250->regs);
795}
796
797static DEVICE_RESET( ic_315_5250 )
798{
799   ic_315_5250_state *ic_315_5250 = _315_5250_get_safe_token(device);
800
801   memset(&ic_315_5250, 0, sizeof(ic_315_5250));
802}
803
804
805
806DEVICE_GET_INFO( ic_315_5248 )
807{
808   switch (state)
809   {
810      /* --- the following bits of info are returned as 64-bit signed integers --- */
811      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(ic_315_5248_state);               break;
812      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_VIDEO;               break;
813
814      /* --- the following bits of info are returned as pointers to data or functions --- */
815      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(ic_315_5248);      break;
816      case DEVINFO_FCT_STOP:               /* Nothing */                           break;
817      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(ic_315_5248);      break;
818
819      /* --- the following bits of info are returned as NULL-terminated strings --- */
820      case DEVINFO_STR_NAME:               strcpy(info->s, "Sega 315-5248");            break;
821      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Sega Custom IC");               break;
822      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
823      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
824      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright MAME Team");         break;
825   }
826}
827
828DEVICE_GET_INFO( ic_315_5249 )
829{
830   switch (state)
831   {
832      /* --- the following bits of info are returned as 64-bit signed integers --- */
833      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(ic_315_5249_state);               break;
834      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_VIDEO;               break;
835
836      /* --- the following bits of info are returned as pointers to data or functions --- */
837      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(ic_315_5249);      break;
838      case DEVINFO_FCT_STOP:               /* Nothing */                           break;
839      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(ic_315_5249);      break;
840
841      /* --- the following bits of info are returned as NULL-terminated strings --- */
842      case DEVINFO_STR_NAME:               strcpy(info->s, "Sega 315-5249");            break;
843      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Sega Custom IC");               break;
844      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
845      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
846      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright MAME Team");         break;
847   }
848}
849
850DEVICE_GET_INFO( ic_315_5250 )
851{
852   switch (state)
853   {
854      /* --- the following bits of info are returned as 64-bit signed integers --- */
855      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(ic_315_5250_state);               break;
856      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_VIDEO;               break;
857
858      /* --- the following bits of info are returned as pointers to data or functions --- */
859      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(ic_315_5250);      break;
860      case DEVINFO_FCT_STOP:               /* Nothing */                           break;
861      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(ic_315_5250);      break;
862
863      /* --- the following bits of info are returned as NULL-terminated strings --- */
864      case DEVINFO_STR_NAME:               strcpy(info->s, "Sega 315-5250");            break;
865      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Sega Custom IC");               break;
866      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
867      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
868      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright MAME Team");         break;
869   }
870}
src/mame/machine/segaic16.h
r7356r7357
3333READ16_HANDLER( segaic16_memory_mapper_lsb_r );
3434WRITE16_HANDLER( segaic16_memory_mapper_lsb_w );
3535
36/*** Sega 16-bit Devices ***/
37
38#include "devcb.h"
39
40/***************************************************************************
41    TYPE DEFINITIONS
42***************************************************************************/
43
44typedef void (*_315_5250_sound_callback)(running_machine *, UINT8);
45typedef void (*_315_5250_timer_ack_callback)(running_machine *);
46
47typedef struct _ic_315_5250_interface ic_315_5250_interface;
48struct _ic_315_5250_interface
49{
50   _315_5250_sound_callback          sound_write_callback;
51   _315_5250_timer_ack_callback      timer_ack_callback;
52};
53
54
55/***************************************************************************
56    FUNCTION PROTOTYPES
57***************************************************************************/
58
59DEVICE_GET_INFO( ic_315_5248 );
60DEVICE_GET_INFO( ic_315_5249 );
61DEVICE_GET_INFO( ic_315_5250 );
62
63/***************************************************************************
64    DEVICE CONFIGURATION MACROS
65***************************************************************************/
66
67#define _315_5248 DEVICE_GET_INFO_NAME( ic_315_5248 )
68
69#define MDRV_315_5248_ADD(_tag) \
70   MDRV_DEVICE_ADD(_tag, _315_5248, 0)
71
72#define _315_5249 DEVICE_GET_INFO_NAME( ic_315_5249 )
73
74#define MDRV_315_5249_ADD(_tag) \
75   MDRV_DEVICE_ADD(_tag, _315_5249, 0)
76
77#define _315_5250 DEVICE_GET_INFO_NAME( ic_315_5250 )
78
79#define MDRV_315_5250_ADD(_tag, _interface) \
80   MDRV_DEVICE_ADD(_tag, _315_5250, 0) \
81   MDRV_DEVICE_CONFIG(_interface)
82
83
84/***************************************************************************
85    DEVICE I/O FUNCTIONS
86***************************************************************************/
87
3688/* multiply chip */
37READ16_HANDLER( segaic16_multiply_0_r );
38READ16_HANDLER( segaic16_multiply_1_r );
39READ16_HANDLER( segaic16_multiply_2_r );
40WRITE16_HANDLER( segaic16_multiply_0_w );
41WRITE16_HANDLER( segaic16_multiply_1_w );
42WRITE16_HANDLER( segaic16_multiply_2_w );
89READ16_DEVICE_HANDLER( segaic16_multiply_r );
90WRITE16_DEVICE_HANDLER( segaic16_multiply_w );
4391
4492/* divide chip */
45READ16_HANDLER( segaic16_divide_0_r );
46READ16_HANDLER( segaic16_divide_1_r );
47READ16_HANDLER( segaic16_divide_2_r );
48WRITE16_HANDLER( segaic16_divide_0_w );
49WRITE16_HANDLER( segaic16_divide_1_w );
50WRITE16_HANDLER( segaic16_divide_2_w );
93READ16_DEVICE_HANDLER( segaic16_divide_r );
94WRITE16_DEVICE_HANDLER( segaic16_divide_w );
5195
5296/* compare/timer chip */
53void segaic16_compare_timer_init(int which, void (*sound_write_callback)(running_machine *, UINT8), void (*timer_ack_callback)(running_machine *));
54int segaic16_compare_timer_clock(int which);
55READ16_HANDLER( segaic16_compare_timer_0_r );
56READ16_HANDLER( segaic16_compare_timer_1_r );
57WRITE16_HANDLER( segaic16_compare_timer_0_w );
58WRITE16_HANDLER( segaic16_compare_timer_1_w );
59
97int segaic16_compare_timer_clock( running_device *device );
98READ16_DEVICE_HANDLER( segaic16_compare_timer_r );
99WRITE16_DEVICE_HANDLER( segaic16_compare_timer_w );
src/mame/machine/snes.c
r7356r7357
15891589   else if (snes_cart.mode & 5)                     /* Mode 20 & 22 */
15901590   {
15911591      if ((address < 0x8000) && (snes_cart.mode == SNES_MODE_20)) //FIXME: check this
1592      {   
1592      {
15931593         value = 0xff;                     /* Reserved */
1594         //value =  snes_ram[0x200000 + ((offset & ~0x8000) | 0x8000)];   // is this hack still needed?   /* Reserved */
1594         //value =  snes_ram[0x200000 + ((offset & ~0x8000) | 0x8000)];  // is this hack still needed?   /* Reserved */
15951595      }
15961596      else
15971597         value = snes_ram[0x400000 + offset];
src/mame/machine/naomibd.c
r7356r7357
458458
459459      return ret;
460460   }
461   else if ((offset == 2) && ACCESSING_BITS_32_63)
462   {
463      //  Actel FPGA ID, used on some games for a "special" ROM test.
464
465      return (UINT64)actel_id << 32;
466   }
461467   else if ((offset == 7) && ACCESSING_BITS_32_47)
462468   {
463469      // 5f703c
src/mame/machine/cclimber.c
r7356r7357
5151   cclimber_decode(machine, convtable);
5252}
5353
54void cclimbrj_decode(running_machine *machine)
54void cclimberj_decode(running_machine *machine)
5555{
5656   static const UINT8 convtable[8][16] =
5757   {
r7356r7357
6868   cclimber_decode(machine, convtable);
6969}
7070
71DRIVER_INIT( cclimbrj )
71DRIVER_INIT( cclimberj )
7272{
73   cclimbrj_decode(machine);
73   cclimberj_decode(machine);
7474}
7575
7676void mshuttle_decode(running_machine *machine)
src/mame/mamedriv.c
r7356r7357
372372   DRIVER( cannonb2 )   /* (c) 1985 TV Game Gruenberg */
373373   DRIVER( cannonb3 )   /* (c) 1985 Soft */
374374   DRIVER( ckongb )   /* bootleg */
375   DRIVER( bagmanf )   /* bootleg on Falcon FCK-00 (Falcon Crazy Kong) PCB */
375376
376377   /* Nichibutsu games */
377378   DRIVER( gomoku )   /* (c) 1981 */
r7356r7357
12091210   DRIVER( sblast2b )   /* bootleg */
12101211   DRIVER( iron )      /* bootleg */
12111212   DRIVER( endless )   /* bootleg */
1213   DRIVER( denseib )   /* bootleg */
12121214
1215
12131216   /* Midway 8080 b/w games */
12141217   DRIVER( seawolf )   /* 596 [1976] */
12151218   DRIVER( gunfight )   /* 597 [1975] */
r7356r7357
14371440   DRIVER( minigolf2 )   /* (c) 1985 */
14381441   DRIVER( toggle )   /* (c) 1985 */
14391442   DRIVER( nametune )   /* (c) 1986 */
1443   DRIVER( nametune2 )   /* (c) 1986 */
14401444   DRIVER( nstocker )   /* (c) 1986 */
14411445   DRIVER( nstocker2 )   /* (c) 1986 */
14421446   DRIVER( sfootbal )   /* (c) 1986 */
r7356r7357
22472251   DRIVER( outzonea )   /* TP-O18 (c) 1990 Toaplan */
22482252   DRIVER( outzoneb )   /* TP-O18 (c) 1990 Toaplan */
22492253   DRIVER( outzonec )   /* TP-O18 (c) 1990 Toaplan */
2254   DRIVER( outzoned )   /* TP-O18 (c) 1990 Toaplan */
22502255   DRIVER( vimana )   /* TP-O19 (c) 1991 Toaplan (+ Tecmo license when set to Japan) */
22512256   DRIVER( vimana1 )   /* TP-O19 (c) 1991 Toaplan (+ Tecmo license when set to Japan)  */
22522257   DRIVER( vimanan )   /* TP-O19 (c) 1991 Toaplan (+ Nova Apparate GMBH & Co license) */
r7356r7357
24872492   DRIVER( gnga )      /*  9/1985 (c) 1985 */
24882493   DRIVER( gngbl )      /* bootleg */
24892494   DRIVER( gngblita )   /* bootleg */
2495   DRIVER( gngc )      /*  9/1985 (c) 1985 */
24902496   DRIVER( gngt )      /*  9/1985 (c) 1985 */
24912497   DRIVER( makaimur )   /*  9/1985 (c) 1985 */
24922498   DRIVER( makaimurc )   /*  9/1985 (c) 1985 */
r7356r7357
26962702   DRIVER( qad )      /* 01/07/1992 (c) 1992 (US)    */
26972703   DRIVER( qadj )      /* 21/09/1994 (c) 1994 (Japan) */
26982704   DRIVER( qtono2 )   /* 23/01/1995 (c) 1995 (Japan) */
2699   DRIVER( pang3 )      /* 11/05/1995 (c) 1995 Mitchell (Euro) not listed on Capcom's site */
2705   DRIVER( pang3 )      /* 01/06/1995 (c) 1995 Mitchell (Euro) not listed on Capcom's site */
2706   DRIVER( pang3n )   /* 11/05/1995 (c) 1995 Mitchell (Euro) not listed on Capcom's site */
27002707   DRIVER( pang3j )   /* 11/05/1995 (c) 1995 Mitchell (Japan) not listed on Capcom's site */
27012708   DRIVER( megaman )   /* 06/10/1995 (c) 1995 (Asia)  */
27022709   DRIVER( rockmanj )   /* 22/09/1995 (c) 1995 (Japan) */
r7356r7357
30293036   DRIVER( glpracr3 )   /* Gallop Racer 3 (JAPAN) */
30303037   DRIVER( flamegun )   /* Flame Gunner (USA) */
30313038   DRIVER( flamegunj )   /* Flame Gunner (JAPAN) */
3039   DRIVER( lpadv )      /* Logic Pro Adventure (JAPAN) */
30323040   DRIVER( tblkkuzu )   /* The Block Kuzushi (JAPAN) */
30333041   DRIVER( 1on1gov )   /* 1 on 1 Government (JAPAN) */
30343042   DRIVER( tecmowcm )   /* Tecmo World Cup Millenium (JAPAN) */
r7356r7357
41924200   DRIVER( rchase2 )   /* 1995.06 Rail Chase 2 (Arcade TV Game List - P.104, Left, 12 from top) */
41934201   DRIVER( indy500 )   /* 1995.07 Indy 500 */
41944202   DRIVER( indy500d )
4203   DRIVER( indy500to )
41954204   DRIVER( skytargt )   /* 1995.10 Sky Target */
41964205   DRIVER( fvipers )   /* 1995.11 Fighting Vipers */
41974206   DRIVER( von )      /* 1996.01 Dennou Senki Virtual-On */
r7356r7357
44914500   DRIVER( capsnk )   /* 2000.09 Capcom vs. SNK Millenium Fight 2000 */
44924501   DRIVER( gram2000 )   /* 2000.09 Giant Gram 2000 Zen Nippon Pro-wres 3 */
44934502                  /* 2000.09 Nittere Shiki! Mirai Yosou Studio */
4494                  /* 2000.10 Crackin' DJ */
4503   DRIVER( crackndj )   /* 2000.10 Crackin' DJ */
44954504   DRIVER( cspike )   /* 2000.10 Gun Spike */
44964505                  /* 2000.10 Sega Strike Fighter */
44974506   DRIVER( deathcox )   /* 2000.10 Death Crimson OX */
r7356r7357
49024911   DRIVER( gekitsui )   /* (c) 1985 Data East Corporation (Japan) */
49034912   DRIVER( tryout )   /* (c) 1985 Data East Corporation (Japan) */
49044913   DRIVER( firetrap )   /* (c) 1986 Data East USA (US) */
4905   DRIVER( firetpbl )   /* bootleg */
4914   DRIVER( firetrapbl )   /* bootleg */
49064915   DRIVER( metlclsh )   /* (c) 1985 Data East */
49074916   DRIVER( chanbara )   /* (c) 1985 Data East */
49084917   DRIVER( brkthru )   /* (c) 1986 Data East USA (US) */
r7356r7357
54985507   DRIVER( asterix )   /* GX068 (c) 1992 (World) */
54995508   DRIVER( asterixeac )   /* GX068 (c) 1992 (World) */
55005509   DRIVER( asterixeaa )   /* GX068 (c) 1992 (World) */
5510   DRIVER( asterixaad )   /* GX068 (c) 1992 (Asia) */
55015511   DRIVER( asterixj )   /* GX068 (c) 1992 (Japan) */
55025512   DRIVER( gijoe )      /* GX069 (c) 1991 (World) */
55035513   DRIVER( gijoeu )   /* GX069 (c) 1991 (US) */
r7356r7357
55755585   DRIVER( le2j )      /* 1994.06 GX312 (Japan) */
55765586   DRIVER( puzldama )   /* 1994.07 GX315 (Japan) */
55775587   DRIVER( gokuparo )   /* 1994.04 GX321 (Japan) */
5578   DRIVER( fantjour )   /* 1994.?? GX321 (US?) */
5588   DRIVER( fantjour )   /* 1994.?? GX321 (Euro) */
5589   DRIVER( fantjoura )   /* 1994.?? GX321 (Asia) */
55795590   DRIVER( dragoona )   /* 1995.?? GX417 (Asia) */
55805591   DRIVER( dragoonj )   /* 1995.08 GX417 (Japan) */
55815592   DRIVER( tbyahhoo )   /* 1995.04 GX424 (Japan) */
r7356r7357
61896200   DRIVER( area51a )   /* 136105           (c) 1995 */
61906201   DRIVER( fishfren )   /* (proto)          (c) 1995 */
61916202   DRIVER( freezeat )   /* (proto)          (c) 1996 */
6192   DRIVER( freezejp )   /* (proto)          (c) 1996 */
6193   DRIVER( freezea2 )   /* (proto)          (c) 1996 */
6194   DRIVER( freezea3 )   /* (proto)          (c) 1996 */
6195   DRIVER( freezea4 )   /* (proto)          (c) 1996 */
6196   DRIVER( freezea5 )   /* (proto)          (c) 1996 */
6197   DRIVER( freezea6 )   /* (proto)          (c) 1996 */
6203   DRIVER( freezeatjp )   /* (proto)          (c) 1996 */
6204   DRIVER( freezeat2 )   /* (proto)          (c) 1996 */
6205   DRIVER( freezeat3 )   /* (proto)          (c) 1996 */
6206   DRIVER( freezeat4 )   /* (proto)          (c) 1996 */
6207   DRIVER( freezeat5 )   /* (proto)          (c) 1996 */
6208   DRIVER( freezeat6 )   /* (proto)          (c) 1996 */
61986209   DRIVER( area51mx )   /* 136105           (c) 1998 */
61996210   DRIVER( a51mxr3k )   /*     ??           (c) 1998 */
62006211   DRIVER( maxforce )   /*     ??           (c) 1996 */
r7356r7357
71287139   DRIVER( raidena )   /* (c) 1990 Seibu Kaihatsu */
71297140   DRIVER( raidenk )   /* (c) 1990 Seibu Kaihatsu + IBL Corporation license */
71307141   DRIVER( raident )   /* (c) 1990 Seibu Kaihatsu + Liang HWA Electronics license */
7142   DRIVER( raidenu )   /* (c) 1990 Seibu Kaihatsu + Fabtek license */
71317143   DRIVER( sdgndmps )   /* (c) Banpresto / Bandai (Japan) */
71327144   DRIVER( dcon )      /* (c) 1992 Success */
71337145   DRIVER( sengokmj )   /* (c) 1991 Sigma */
r7356r7357
73117323   DRIVER( monkelf )   /* bootleg */
73127324   DRIVER( edf )      /* (c) 1991 */
73137325   DRIVER( edfu )      /* (c) 1991 */
7326   DRIVER( edfbl )      /* (c) 1991 */
73147327   DRIVER( 64street )   /* (c) 1991 */
73157328   DRIVER( 64streetj )   /* (c) 1991 (Japan) */
73167329   DRIVER( soldam )   /* (c) 1992 */
r7356r7357
81508163   DRIVER( mjtensin )   /* "100" 1995 Dynax */
81518164   DRIVER( nettoqc )   /* "103" (c) 1995 Nakanihon */
81528165   DRIVER( majrjhdx )   /* "105" 1996 Dynax */
8153   DRIVER( ddenlvrj )   /* "113" (c) 1995 Dynax */
8154   DRIVER( ddenlvrk )   /* "113" (c) 1995 Dynax */
8155   DRIVER( ddenlovr )   /* "113" (c) 1996 Dynax */
8156   DRIVER( ddenlovb )   /* bootleg */
8166   DRIVER( ddenlovj )   /* "113" (c) 1995 Dynax (Japan) */
8167   DRIVER( ddenlovrk )   /* "113" (c) 1995 Dynax (Korea) */
8168   DRIVER( ddenlovr )   /* "113" (c) 1996 Dynax (Hong Kong) */
8169   DRIVER( ddenlovrb )   /* bootleg */
81578170   DRIVER( hanakanz )   /* "507" 1996 Dynax */
81588171   DRIVER( akamaru )   /* "501" 1996 Dynax */
81598172   DRIVER( sryudens )   /* "502" 1996 Dynax / Face */
r7356r7357
81878200   DRIVER( r2dtank )   /* (c) 1980 Sigma Ent. Inc. */
81888201   DRIVER( spiders )   /* (c) 1981 Sigma Ent. Inc. */
81898202   DRIVER( spiders2 )   /* (c) 1981 Sigma Ent. Inc. */
8203   DRIVER( spiders3 )   /* (c) 1981 Sigma Ent. Inc. */
81908204   DRIVER( spinner )   /* bootleg */
81918205   DRIVER( sub )      /* (c) 1985 Sigma Ent. Inc. */
81928206
8207   /* Sigma B52 */
8208   DRIVER( jwildb52 )   /* (c) 199? Sigma */
8209   DRIVER( jwildb52a )   /* (c) 199? Sigma */
8210   DRIVER( jwildb52h )   /* (c) 199? Sigma */
8211
81938212   /* IGS games ( www.igs.com.tw ) */
81948213   DRIVER( goldstar )   /* (c) 198? IGS */
81958214   DRIVER( goldstbl )   /* (c) 198? IGS */
r7356r7357
83838402   DRIVER( pbillrd )   /* (c) 1987 Nihon System */
83848403   DRIVER( pbillrds )   /* (c) 1988 Nihon System (+ optional Sega) */
83858404   DRIVER( freekick )   /* (c) 1988 Nihon System (+ optional Sega) */
8386   DRIVER( freekckb )   /* (c) 1987 bootleg */
8387   DRIVER( freekcb2 )   /* (c) 1987 bootleg */
8405   DRIVER( freekickb )   /* (c) 1987 bootleg */
8406   DRIVER( freekickb2 )   /* (c) 1987 bootleg */
83888407   DRIVER( countrun )   /* (c) 1988 Nihon System (+ optional Sega) */
8389   DRIVER( countrnb )   /* (c) 1988 bootleg */
8390   DRIVER( countrb2 )   /* (c) 1988 bootleg */
8408   DRIVER( countrunb )   /* (c) 1988 bootleg */
8409   DRIVER( countrunb2 )   /* (c) 1988 bootleg */
83918410
83928411   /* Alba games */
83938412   DRIVER( rmhaihai )   /* (c) 1985 Alba */
r7356r7357
89808999   DRIVER( laserbasa )   /* (c) 1981 Amstar/HOEI */
89819000   DRIVER( futflash )   /* (c) 1981 HOEI (Arcade TV Game List - P.96, Right, 18 from top) */
89829001   DRIVER( turbosub )   /* (c) 1985 Entertainment Sciences */
8983   DRIVER( turbosb7 )   /* (c) 1985 Entertainment Sciences */
8984   DRIVER( turbosb6 )   /* (c) 1985 Entertainment Sciences */
9002   DRIVER( turbosub7 )   /* (c) 1985 Entertainment Sciences */
9003   DRIVER( turbosub6 )   /* (c) 1985 Entertainment Sciences */
89859004   DRIVER( pipeline )   /* (c) 1990 Daehyun Electronics */
89869005   DRIVER( ttchamp )
89879006   DRIVER( ttchampa )
r7356r7357
90369055   DRIVER( vegasfst )   /* (c) 1993 Soft Design */
90379056   DRIVER( vegasfte )   /* (c) 1993 Soft Design */
90389057   DRIVER( jolyjokr )   /* (c) 198? Impera */
9039   DRIVER( jolyjkra )   /* (c) 198? Impera */
9058   DRIVER( jolyjokra )   /* (c) 198? Impera */
90409059   DRIVER( jokercrd )   /* (c) 1993 Vesely Svet */
90419060   DRIVER( mongolnw )   /* 199? bootleg */
90429061   DRIVER( soccernw )   /* 199? bootleg */
r7356r7357
91069125   DRIVER( tattack )   /* (c) 198? Shonan */
91079126   DRIVER( mosaicf2 )   /* (c) 1999 F2 System */
91089127   DRIVER( finalgdr )   /* (c) 2001 Semicom */
9128   DRIVER( mrkicker )   /* (c) 2001 Semicom */
91099129   DRIVER( wyvernwg )   /* (c) 2001 Semicom / Game Vision */
91109130   DRIVER( rbmk )      /* (c) 1995 GMS */
91119131   DRIVER( go2000 )   /* (c) 2000 SA */
r7356r7357
91159135   DRIVER( victor5 )   /* (c) 1990 Subsino */
91169136   DRIVER( victor21 )   /* (c) 1990 Subsino */
91179137   DRIVER( crsbingo )   /* (c) 1991 Subsino */
9138   DRIVER( tisub )      /* (c) 1991 Subsino */
91189139   DRIVER( sharkpy )   /* (c) 1993 Subsino */
91199140   DRIVER( sharkpya )   /* (c) 1993 Subsino */
91209141   DRIVER( smoto20 )   /* (c) 1996 Subsino */
r7356r7357
92359256
92369257   DRIVER( altair )   /* (c) 1981 Cidelsa */
92379258   DRIVER( destryer )   /* (c) 1981 Cidelsa */
9238   DRIVER( destryea )   /* (c) 1981 Cidelsa */
9259   DRIVER( destryera )   /* (c) 1981 Cidelsa */
92399260   DRIVER( draco )      /* (c) 1981 Cidelsa */
92409261   DRIVER( rockduck )   /* (c) 1983 Datel SAS */
92419262   DRIVER( tetriskr )   /* (c) 1988? bootleg */
r7356r7357
93959416   /* Astro Corp. */
93969417   DRIVER( showhand )   /* (c) 1999? Astro Corp. */
93979418   DRIVER( showhanc )   /* (c) 1999? Astro Corp. */
9419   DRIVER( skilldrp )   /* (c) 2002  Astro Corp. */
93989420
93999421   /* Dyna */
94009422   DRIVER( ncb3 )      /* (c) 199? Dyna Electronics */
r7356r7357
94999521   DRIVER( kkojnoli )   /* 198? south korean hack */
95009522   DRIVER( wcat3 )
95019523   DRIVER( mtonic )   /* 198? (c) Tonic */
9524   DRIVER( magical )   /* 198? (c) Micro Manufacturing Ltd. */
95029525
95039526   DRIVER( sfbonus )   /* (c) 2003 Amcoe - Skill Fruit Bonus */
95049527   DRIVER( sfbonusd1 )   /* (c) 2003 Amcoe */
r7356r7357
998210005   DRIVER( am_mg3 )   /* (c) Amatic 2000 */
998310006
998410007   DRIVER( pinkiri8 )
10008   DRIVER( neptunp2 )
998510009
998610010#endif   /* DRIVER_RECURSIVE */
src/mame/includes/naomi.h
r7356r7357
2525extern DRIVER_INIT( ggxxsla );
2626extern DRIVER_INIT( ggxxrl );
2727extern DRIVER_INIT( ggxx );
28
29extern DRIVER_INIT( gram2000 );
30extern DRIVER_INIT( mvsc2 );
31extern DRIVER_INIT( qmegamis );
32
33extern DRIVER_INIT( vf4evoct );
34
2835extern UINT64 *naomi_ram64;
2936
3037extern int jvsboard_type;
38extern UINT16 actel_id;
src/mame/includes/megadriv.h
r0r7357
1#define MASTER_CLOCK_NTSC 53693175
2#define MASTER_CLOCK_PAL  53203424
3#define SEGACD_CLOCK      12500000
4
5
6extern DRIVER_INIT( megadriv_c2 );
7extern DRIVER_INIT( megadrie );
8extern DRIVER_INIT( megadriv );
9extern DRIVER_INIT( megadrij );
10extern DRIVER_INIT( _32x );
11extern DRIVER_INIT( mpnew );
12
13INPUT_PORTS_EXTERN( md_common );
14INPUT_PORTS_EXTERN( megadriv );
15INPUT_PORTS_EXTERN( aladbl );
16INPUT_PORTS_EXTERN( megadri6 );
17INPUT_PORTS_EXTERN( ssf2ghw );
18INPUT_PORTS_EXTERN( megdsvp );
19
20MACHINE_DRIVER_EXTERN( megadriv_timers );
21
22MACHINE_DRIVER_EXTERN( megdsvppal );
23MACHINE_DRIVER_EXTERN( megadriv );
24MACHINE_DRIVER_EXTERN( megadpal );
25MACHINE_DRIVER_EXTERN( megdsvp );
26MACHINE_DRIVER_EXTERN( genesis_32x );
27MACHINE_DRIVER_EXTERN( genesis_32x_pal );
28MACHINE_DRIVER_EXTERN( genesis_scd );
29MACHINE_DRIVER_EXTERN( genesis_32x_scd );
30MACHINE_DRIVER_EXTERN( md_bootleg );   // for topshoot.c & hshavoc.c
31
32extern UINT16* megadriv_backupram;
33extern int megadriv_backupram_length;
34extern UINT16* megadrive_ram;
35extern UINT8 megatech_bios_port_cc_dc_r(running_machine *machine, int offset, int ctrl);
36extern void megadriv_stop_scanline_timer(void);
37
38void megatech_set_megadrive_z80_as_megadrive_z80(running_machine *machine, const char* tag);
39
40extern READ16_HANDLER( megadriv_vdp_r );
41extern WRITE16_HANDLER( megadriv_vdp_w );
42
43/* These handlers are needed by megaplay.c */
44extern READ16_HANDLER( megadriv_68k_io_read );
45extern WRITE16_HANDLER( megadriv_68k_io_write );
46
47/* These handlers are needed by puckpkmn.c for his memory map */
48extern READ8_DEVICE_HANDLER( megadriv_68k_YM2612_read);
49extern WRITE8_DEVICE_HANDLER( megadriv_68k_YM2612_write);
50
51/* These are needed to create external input handlers (see e.g. MESS) */
52/* Regs are also used by Megaplay! */
53extern UINT8 (*megadrive_io_read_data_port_ptr)(running_machine *machine, int offset);
54extern void (*megadrive_io_write_data_port_ptr)(running_machine *machine, int offset, UINT16 data);
55extern UINT8 megadrive_io_data_regs[3];
56extern UINT8 megadrive_io_ctrl_regs[3];
57
58MACHINE_START( megadriv );
59MACHINE_RESET( megadriv );
60VIDEO_START( megadriv );
61VIDEO_UPDATE( megadriv );
62VIDEO_EOF( megadriv );
63
64
65extern UINT16* megadrive_vdp_palette_lookup;
66extern UINT16* megadrive_vdp_palette_lookup_sprite; // for C2
67extern UINT16* megadrive_vdp_palette_lookup_shadow;
68extern UINT16* megadrive_vdp_palette_lookup_highlight;
69
70extern int segac2_bg_pal_lookup[4];
71extern int segac2_sp_pal_lookup[4];
72
73extern int genvdp_use_cram;
74extern int genesis_always_irq6;
75extern int genesis_other_hacks;
76
77
78/* Megaplay - Megatech specific */
79/* It might be possible to move the following structs in the drivers */
80
81#define MP_ROM  0x10
82#define MP_GAME 0
83
84struct _mplay_bios   /* once all the regs are saved in this structure, it would be better to reorganize it a bit... */
85{
86   UINT32 bios_mode;  // determines whether ROM banks or Game data
87                           // is to read from 0x8000-0xffff
88
89   UINT32 bios_bank; // ROM bank selection
90   UINT16 game_banksel;  // Game bank selection
91   UINT32 readpos;  // serial bank selection position (9-bit)
92   UINT32 mp_bios_bank_addr;
93
94   UINT32 bios_width;  // determines the way the game info ROM is read
95   UINT8 bios_ctrl[6];
96   UINT8 bios_6600;
97   UINT8 bios_6403;
98   UINT8 bios_6404;
99};
100
101extern struct _mplay_bios mplay_bios;   // defined in megaplay.c
102
103struct _mtech_bios   /* once all the regs are saved in this structure, it would be better to reorganize it a bit... */
104{
105   UINT8 mt_cart_select_reg;
106   UINT32 bios_port_ctrl;
107   int current_game_is_sms; // is the current game SMS based (running on genesis z80, in VDP compatibility mode)
108   UINT32 bios_ctrl_inputs;
109   UINT8 bios_ctrl[6];
110
111   int mt_bank_bank_pos;
112   int mt_bank_partial;
113   int mt_bank_addr;
114};
src/mame/includes/ddribble.h
r0r7357
1/***************************************************************************
2
3    Double Dribble
4
5***************************************************************************/
6
7typedef struct _ddribble_state ddribble_state;
8struct _ddribble_state
9{
10   /* memory pointers */
11   UINT8 *     sharedram;
12   UINT8 *     snd_sharedram;
13   UINT8 *     spriteram_1;
14   UINT8 *     spriteram_2;
15   UINT8 *     bg_videoram;
16   UINT8 *     fg_videoram;
17   UINT8 *     paletteram;
18
19   /* video-related */
20   tilemap_t     *fg_tilemap,*bg_tilemap;
21   int         vregs[2][5];
22   int         charbank[2];
23
24   /* misc */
25   int         int_enable_0, int_enable_1;
26
27   /* devices */
28   running_device *filter1;
29   running_device *filter2;
30   running_device *filter3;
31};
32
33/*----------- defined in video/ddribble.c -----------*/
34
35WRITE8_HANDLER( ddribble_fg_videoram_w );
36WRITE8_HANDLER( ddribble_bg_videoram_w );
37WRITE8_HANDLER( K005885_0_w );
38WRITE8_HANDLER( K005885_1_w );
39
40PALETTE_INIT( ddribble );
41VIDEO_START( ddribble );
42VIDEO_UPDATE( ddribble );
src/mame/includes/cclimber.h
r7356r7357
55
66
77DRIVER_INIT( cclimber );
8DRIVER_INIT( cclimbrj );
9void cclimbrj_decode(running_machine *machine);
8DRIVER_INIT( cclimberj );
9void cclimberj_decode(running_machine *machine);
1010void mshuttle_decode(running_machine *machine);
1111DRIVER_INIT( cannonb );
1212DRIVER_INIT( cannonb2 );
src/mame/includes/segamsys.h
r0r7357
1/* System E stuff */
2
3enum sms_mapper
4{
5   MAPPER_STANDARD = 0,
6   MAPPER_CODEMASTERS = 1
7};
8
9ADDRESS_MAP_EXTERN( sms_io_map, 8 );
10
11extern VIDEO_UPDATE(megatech_bios);
12extern VIDEO_UPDATE(megaplay_bios);
13extern VIDEO_UPDATE(megatech_md_sms);
14extern DRIVER_INIT( megatech_bios );
15extern DRIVER_INIT( hazemd_segasyse );
16extern MACHINE_RESET(megatech_bios);
17extern MACHINE_RESET(megatech_md_sms);
18extern VIDEO_EOF(megatech_bios);
19extern VIDEO_EOF(megatech_md_sms);
20
21extern READ8_HANDLER( sms_vcounter_r );
22extern READ8_HANDLER( sms_vdp_data_r );
23extern WRITE8_HANDLER( sms_vdp_data_w );
24extern READ8_HANDLER( sms_vdp_ctrl_r );
25extern WRITE8_HANDLER( sms_vdp_ctrl_w );
26
27extern void init_for_megadrive(running_machine *machine);
28extern void segae_md_sms_stop_scanline_timer(void);
29
30
31extern READ8_HANDLER( md_sms_vdp_vcounter_r );
32extern READ8_HANDLER( md_sms_vdp_data_r );
33extern WRITE8_HANDLER( md_sms_vdp_data_w );
34extern READ8_HANDLER( md_sms_vdp_ctrl_r );
35extern WRITE8_HANDLER( md_sms_vdp_ctrl_w );
36
37extern VIDEO_START(sms);
38extern VIDEO_EOF(sms);
39extern MACHINE_RESET(sms);
40extern READ8_HANDLER( sms_vdp_2_data_r );
41extern WRITE8_HANDLER( sms_vdp_2_data_w );
42extern READ8_HANDLER( sms_vdp_2_ctrl_r );
43extern WRITE8_HANDLER( sms_vdp_2_ctrl_w );
44extern VIDEO_EOF(systeme);
45extern VIDEO_UPDATE(systeme);
46extern MACHINE_RESET(systeme);
47extern UINT8* sms_mainram;
48extern UINT8* vdp2_vram_bank0;
49extern UINT8* vdp2_vram_bank1;
50extern UINT8* vdp1_vram_bank0;
51extern UINT8* vdp1_vram_bank1;
52extern void segae_set_vram_banks(UINT8 data);
53READ8_HANDLER( sms_ioport_gg00_r );
54void init_extra_gg_ports(running_machine* machine, const char* tag);
55READ8_HANDLER (megatech_sms_ioport_dc_r);
56READ8_HANDLER (megatech_sms_ioport_dd_r);
57READ8_HANDLER( smsgg_backupram_r );
58WRITE8_HANDLER( smsgg_backupram_w );
59extern void megatech_set_genz80_as_sms_standard_map(running_machine *machine, const char* tag, int mapper);
60MACHINE_DRIVER_EXTERN(sms);
61extern DRIVER_INIT(sms);
62extern DRIVER_INIT(smspal);
63extern DRIVER_INIT(smscm);
64extern DRIVER_INIT( smsgg );
65
66INPUT_PORTS_EXTERN(sms);
67INPUT_PORTS_EXTERN(gamegear);
68extern UINT8* smsgg_backupram;
69
70
71
72
73
src/mame/includes/dkong.h
r7356r7357
195195
196196PALETTE_INIT( dkong2b );
197197PALETTE_INIT( radarscp );
198PALETTE_INIT( radarsc1 );
198PALETTE_INIT( radarscp1 );
199199PALETTE_INIT( dkong3 );
200200
201201VIDEO_START( dkong );
r7356r7357
211211MACHINE_DRIVER_EXTERN( dkong2b_audio );
212212MACHINE_DRIVER_EXTERN( dkongjr_audio );
213213MACHINE_DRIVER_EXTERN( dkong3_audio );
214MACHINE_DRIVER_EXTERN( radarsc1_audio );
214MACHINE_DRIVER_EXTERN( radarscp1_audio );
215215
src/mame/includes/system16.h
r7356r7357
1/******************** NEW STUFF *******************/
21
3#include "video/segaic16.h"
4#include "sound/upd7759.h"
2// later, this might be merged with segas1x_state in segas16.h
53
6/*----------- defined in video/segahang.c -----------*/
4typedef struct _segas1x_bootleg_state segas1x_bootleg_state;
5struct _segas1x_bootleg_state
6{
7   UINT16 *    bg0_tileram;
8   UINT16 *    bg1_tileram;
9   UINT16 *    textram;
10   UINT16 *    tileram;
711
8VIDEO_START( hangon );
9VIDEO_START( sharrier );
10VIDEO_UPDATE( hangon );
12   UINT16 coinctrl;
1113
12/*----------- defined in video/segas16a.c -----------*/
14   /* game specific */
15   int passht4b_io1_val;
16   int passht4b_io2_val;
17   int passht4b_io3_val;
1318
14VIDEO_START( system16a );
15VIDEO_UPDATE( system16a );
19   int beautyb_unkx;
1620
17/*----------- defined in video/segas16b.c -----------*/
21   int shinobl_kludge;
1822
19VIDEO_START( system16b );
20VIDEO_START( timscanr );
21VIDEO_UPDATE( system16b );
23   UINT16* goldnaxeb2_fgpage;
24   UINT16* goldnaxeb2_bgpage;
2225
23/*----------- defined in video/segas18.c -----------*/
26   int eswat_tilebank0;
2427
25VIDEO_START( system18 );
26VIDEO_UPDATE( system18 );
2728
28void system18_set_grayscale(running_machine *machine, int enable);
29void system18_set_vdp_enable(running_machine *machine, int eanble);
30void system18_set_vdp_mixing(running_machine *machine, int mixing);
29   /* video-related */
30   tilemap_t *background, *foreground, *text_layer;
31   tilemap_t *background2, *foreground2;
32   tilemap_t *bg_tilemaps[2];
33   tilemap_t *text_tilemap;
34   double weights[2][3][6];
3135
32/*----------- defined in video/segaorun.c -----------*/
36   int spritebank_type;
37   int back_yscroll;
38   int fore_yscroll;
39   int text_yscroll;
40   int sprite_xoffs;
3341
34VIDEO_START( outrun );
35VIDEO_START( shangon );
36VIDEO_UPDATE( outrun );
37VIDEO_UPDATE( shangon );
42   int bg1_trans; // alien syn + sys18
3843
39/*----------- defined in video/segaxbd.c -----------*/
44   int tile_bank1;
45   int tile_bank0;
46   int bg_page[4];
47   int fg_page[4];
4048
41VIDEO_START( xboard );
42VIDEO_UPDATE( xboard );
43void xboard_set_road_priority(int priority);
49   UINT16 datsu_page[4];
4450
45/*----------- defined in video/segaybd.c -----------*/
51   int bg2_page[4];
52   int fg2_page[4];
4653
47VIDEO_START( yboard );
48VIDEO_UPDATE( yboard );
54   int old_bg_page[4],old_fg_page[4], old_tile_bank1, old_tile_bank0;
55   int old_bg2_page[4], old_fg2_page[4];
4956
57   int bg_scrollx, bg_scrolly;
58   int fg_scrollx, fg_scrolly;
59   UINT16 tilemapselect;
5060
51/*----------- defined in machine/s16fd.c -----------*/
61   int textlayer_lo_min;
62   int textlayer_lo_max;
63   int textlayer_hi_min;
64   int textlayer_hi_max;
5265
53void *fd1094_get_decrypted_base(void);
54void fd1094_machine_init(running_device *device);
55void fd1094_driver_init(running_machine *machine, const char* tag, void (*set_decrypted)(running_machine *, UINT8 *));
66   int tilebank_switch;
5667
57/*----------- defined in machine/system16.c -----------*/
5868
59/* sound */
60extern const upd7759_interface sys16_upd7759_interface;
69   /* sound-related */
70   int sample_buffer;
71   int sample_select;
6172
62extern int sys18_sound_info[4*2];
73   UINT8 *soundbank_ptr;      /* Pointer to currently selected portion of ROM */
6374
64typedef struct _sys16_patch sys16_patch;
65struct _sys16_patch
66{
67   offs_t offset;
68   UINT8 data;
69};
75   /* sys18 */
76   UINT8 *sound_bank;
77   UINT16 *splittab_bg_x;
78   UINT16 *splittab_bg_y;
79   UINT16 *splittab_fg_x;
80   UINT16 *splittab_fg_y;
81   int     sound_info[4*2];
82   int     refreshenable;
83   int     system18;
7084
71extern void sys16_patch_code( running_machine *machine, const sys16_patch *patch, int count );
85   UINT8 *decrypted_region;   // goldnaxeb1 & bayrouteb1
7286
73extern MACHINE_RESET( sys16_onetime );
87   /* devices */
88   running_device *maincpu;
89   running_device *soundcpu;
90};
7491
75GFXDECODE_EXTERN( sys16 );
76
7792/*----------- defined in video/system16.c -----------*/
7893
79extern VIDEO_START( system16a_bootleg );
80extern VIDEO_START( system16a_bootleg_wb3bl );
81extern VIDEO_START( system16a_bootleg_shinobi );
82extern VIDEO_START( system16a_bootleg_passsht );
83extern VIDEO_UPDATE( system16a_bootleg );
84extern VIDEO_UPDATE( system16a_bootleg_passht4b );
85extern WRITE16_HANDLER( system16a_bootleg_tilemapselect_w );
86extern WRITE16_HANDLER( system16a_bootleg_bgscrolly_w );
87extern WRITE16_HANDLER( system16a_bootleg_bgscrollx_w );
88extern WRITE16_HANDLER( system16a_bootleg_fgscrolly_w );
89extern WRITE16_HANDLER( system16a_bootleg_fgscrollx_w );
90extern UINT16* system16a_bootleg_bg0_tileram;
91extern UINT16* system16a_bootleg_bg1_tileram;
94extern VIDEO_START( s16a_bootleg );
95extern VIDEO_START( s16a_bootleg_wb3bl );
96extern VIDEO_START( s16a_bootleg_shinobi );
97extern VIDEO_START( s16a_bootleg_passsht );
98extern VIDEO_UPDATE( s16a_bootleg );
99extern VIDEO_UPDATE( s16a_bootleg_passht4b );
100extern WRITE16_HANDLER( s16a_bootleg_tilemapselect_w );
101extern WRITE16_HANDLER( s16a_bootleg_bgscrolly_w );
102extern WRITE16_HANDLER( s16a_bootleg_bgscrollx_w );
103extern WRITE16_HANDLER( s16a_bootleg_fgscrolly_w );
104extern WRITE16_HANDLER( s16a_bootleg_fgscrollx_w );
92105
93106/* video hardware */
94107extern WRITE16_HANDLER( sys16_tileram_w );
r7356r7357
101114/* system18 video hardware */
102115extern VIDEO_START( system18old );
103116extern VIDEO_UPDATE( system18old );
104
105extern UINT16 *sys16_tileram;
106extern UINT16 *sys16_textram;
107extern UINT16 *sys16_spriteram;
108
109extern int sys16_sh_shadowpal;
110extern int sys16_MaxShadowColors;
111
112/* video driver constants (vary with game) */
113extern int sys16_sprxoffset;
114extern int sys16_bgxoffset;
115extern int sys16_fgxoffset;
116extern const int *sys16_obj_bank;
117extern int sys16_textlayer_lo_min;
118extern int sys16_textlayer_lo_max;
119extern int sys16_textlayer_hi_min;
120extern int sys16_textlayer_hi_max;
121extern int sys16_bg1_trans;
122extern int sys16_bg_priority_mode;
123extern int sys16_fg_priority_mode;
124extern int sys16_bg_priority_value;
125extern int sys16_fg_priority_value;
126extern int sys16_tilebank_switch;
127extern int sys16_rowscroll_scroll;
128extern int shinobl_kludge;
129
130/* video driver registers */
131extern int sys16_refreshenable;
132extern int sys16_tile_bank0;
133extern int sys16_tile_bank1;
134extern int sys16_bg_scrollx, sys16_bg_scrolly;
135extern int sys16_bg_page[4];
136extern int sys16_fg_scrollx, sys16_fg_scrolly;
137extern int sys16_fg_page[4];
138
139extern int sys16_bg2_page[4];
140extern int sys16_fg2_page[4];
141
142extern int sys18_bg2_active;
143extern int sys18_fg2_active;
144extern UINT16 *sys18_splittab_bg_x;
145extern UINT16 *sys18_splittab_bg_y;
146extern UINT16 *sys18_splittab_fg_x;
147extern UINT16 *sys18_splittab_fg_y;
148
src/mame/includes/mw8080bw.h
r7356r7357
280280WRITE8_HANDLER( lupin3_sh_port_1_w );
281281WRITE8_HANDLER( lupin3_sh_port_2_w );
282282
283WRITE8_HANDLER( schasrcv_sh_port_1_w );
284WRITE8_HANDLER( schasrcv_sh_port_2_w );
283WRITE8_HANDLER( schasercv_sh_port_1_w );
284WRITE8_HANDLER( schasercv_sh_port_2_w );
285285
286286WRITE8_HANDLER( yosakdon_sh_port_1_w );
287287WRITE8_HANDLER( yosakdon_sh_port_2_w );
r7356r7357
309309VIDEO_UPDATE( invadpt2 );
310310VIDEO_UPDATE( ballbomb );
311311VIDEO_UPDATE( schaser );
312VIDEO_UPDATE( schasrcv );
312VIDEO_UPDATE( schasercv );
313313VIDEO_UPDATE( rollingc );
314314VIDEO_UPDATE( polaris );
315315VIDEO_UPDATE( lupin3 );
src/mame/includes/cyberbal.h
r7356r7357
5555WRITE16_HANDLER( cyberbal_paletteram_1_w );
5656
5757VIDEO_START( cyberbal );
58VIDEO_START( cyberb2p );
58VIDEO_START( cyberbal2p );
5959VIDEO_UPDATE( cyberbal );
6060
6161void cyberbal_scanline_update(running_device *screen, int scanline);
src/mame/includes/segas16.h
r0r7357
1
2typedef struct _segas1x_state segas1x_state;
3struct _segas1x_state
4{
5   /* memory pointers */
6//  UINT16 *  workram;  // this is used in the nvram handler, hence it cannot be added here
7//  UINT16 *  paletteram;   // this is used in the segaic16 mapper, hence it cannot be added here (yet)
8//  UINT16 *  tileram_0;    // this is used in the segaic16 mapper, hence it cannot be added here (yet)
9//  UINT16 *  textram_0;    // this is used in the segaic16 mapper, hence it cannot be added here (yet)
10//  UINT16 *  spriteram_0;  // this is used in the segaic16 mapper, hence it cannot be added here (yet)
11
12   /* misc video */
13   UINT8 road_priority;      // segaxbd
14   bitmap_t *tmp_bitmap;      // segaybd & segas18
15   UINT8 grayscale_enable;      // segas18
16   UINT8 vdp_enable;         // segas18
17   UINT8 vdp_mixing;         // segas18
18
19   /* misc common */
20   UINT8 rom_board;         // segas16b
21   UINT8 mj_input_num;      // segas16a & segas16b
22   UINT8 mj_last_val;      // segas16b
23   UINT8 adc_select;         // segahang & segaorun
24   UINT8 timer_irq_state;      // segaxbd & segaybd
25   UINT8 vblank_irq_state;      // segaorun, segaxbd & segaybd
26   UINT8 misc_io_data[0x10];   // system18 & segaybd
27
28   void (*i8751_vblank_hook)(running_machine *machine);
29   const UINT8 *i8751_initial_config;
30
31   read16_space_func custom_io_r;
32   write16_space_func custom_io_w;
33
34   /* misc system 16b */
35   UINT8 atomicp_sound_divisor;
36   UINT8 atomicp_sound_count;
37   UINT8 disable_screen_blanking;
38   UINT8 hwc_input_value;
39
40
41   /* misc system 16a */
42   UINT8 video_control;
43   UINT8 mcu_control;
44   UINT8 n7751_command;
45   UINT32 n7751_rom_address;
46   UINT8 last_buttons1;
47   UINT8 last_buttons2;
48   int read_port;
49
50   void (*lamp_changed_w)(running_machine *machine, UINT8 changed, UINT8 newval);
51
52   /* misc system 18 */
53   UINT8 mcu_data;
54
55   UINT8 wwally_last_x[3], wwally_last_y[3];
56   UINT8 lghost_value, lghost_select;
57
58   /* misc segaorun */
59   UINT8 irq2_state;
60   const UINT8 *custom_map;
61
62   /* misc yboard */
63   UINT8 analog_data[4];
64   int irq2_scanline;
65
66   /* misc xboard */
67   UINT8 iochip_regs[2][8];
68   UINT8 iochip_force_input;
69
70   UINT8 (*iochip_custom_io_r[2])(offs_t offset, UINT8 portdata);   // currently unused
71   void (*iochip_custom_io_w[2])(offs_t offset, UINT8 data);   // currently unused
72
73   UINT8 adc_reverse[8];
74
75   UINT8 gprider_hack;
76   UINT16 *loffire_sync;
77
78
79   /* devices */
80   running_device *maincpu;
81   running_device *soundcpu;
82   running_device *subcpu;
83   running_device *subx;
84   running_device *suby;
85   running_device *mcu;
86   running_device *ymsnd;
87   running_device *ppi8255;
88   running_device *n7751;
89   running_device *ppi8255_1;
90   running_device *ppi8255_2;
91   running_device *interrupt_timer;
92   running_device *_315_5248_1;
93   running_device *_315_5250_1;
94   running_device *_315_5250_2;
95};
96
97
98/*----------- defined in video/segahang.c -----------*/
99
100VIDEO_START( hangon );
101VIDEO_START( sharrier );
102VIDEO_UPDATE( hangon );
103
104/*----------- defined in video/segas16a.c -----------*/
105
106VIDEO_START( system16a );
107VIDEO_UPDATE( system16a );
108
109/*----------- defined in video/segas16b.c -----------*/
110
111VIDEO_START( system16b );
112VIDEO_START( timscanr );
113VIDEO_UPDATE( system16b );
114
115/*----------- defined in video/segas18.c -----------*/
116
117VIDEO_START( system18 );
118VIDEO_UPDATE( system18 );
119
120void system18_set_grayscale(running_machine *machine, int enable);
121void system18_set_vdp_enable(running_machine *machine, int eanble);
122void system18_set_vdp_mixing(running_machine *machine, int mixing);
123
124/*----------- defined in video/segaorun.c -----------*/
125
126VIDEO_START( outrun );
127VIDEO_START( shangon );
128VIDEO_UPDATE( outrun );
129VIDEO_UPDATE( shangon );
130
131/*----------- defined in video/segaxbd.c -----------*/
132
133VIDEO_START( xboard );
134VIDEO_UPDATE( xboard );
135
136/*----------- defined in video/segaybd.c -----------*/
137
138VIDEO_START( yboard );
139VIDEO_UPDATE( yboard );
140
141
142/*----------- defined in machine/s16fd.c -----------*/
143
144void *fd1094_get_decrypted_base(void);
145void fd1094_machine_init(running_device *device);
146void fd1094_driver_init(running_machine *machine, const char* tag, void (*set_decrypted)(running_machine *, UINT8 *));
src/mame/includes/dec8.h
r7356r7357
4242VIDEO_UPDATE( srdarwin );
4343VIDEO_UPDATE( gondo );
4444VIDEO_UPDATE( garyoret );
45VIDEO_UPDATE( lastmiss );
45VIDEO_UPDATE( lastmisn );
4646VIDEO_UPDATE( shackled );
4747VIDEO_UPDATE( oscar );
4848VIDEO_START( cobracom );
4949VIDEO_START( oscar );
5050VIDEO_START( ghostb );
51VIDEO_START( lastmiss );
51VIDEO_START( lastmisn );
5252VIDEO_START( shackled );
5353VIDEO_START( srdarwin );
5454VIDEO_START( gondo );
r7356r7357
6565WRITE8_HANDLER( srdarwin_control_w );
6666WRITE8_HANDLER( gondo_scroll_w );
6767WRITE8_HANDLER( shackled_control_w );
68WRITE8_HANDLER( lastmiss_control_w );
69WRITE8_HANDLER( lastmiss_scrollx_w );
70WRITE8_HANDLER( lastmiss_scrolly_w );
68WRITE8_HANDLER( lastmisn_control_w );
69WRITE8_HANDLER( lastmisn_scrollx_w );
70WRITE8_HANDLER( lastmisn_scrolly_w );
7171WRITE8_HANDLER( dec8_videoram_w );
src/mame/includes/genesis.h
r7356r7357
22
33/*----------- defined in video/genesis.c -----------*/
44
5extern UINT8      genesis_vdp_regs[];
6extern UINT16      genesis_bg_pal_lookup[];
7extern UINT16      genesis_sp_pal_lookup[];
8
9VIDEO_START( genesis );
10
11VIDEO_UPDATE( genesis );
12
135void system18_vdp_start(running_machine *machine);
146void system18_vdp_update(bitmap_t *bitmap, const rectangle *cliprect);
157
src/mame/mame.mak
r7356r7357
120120CPUS += Z8
121121CPUS += I8008
122122CPUS += SCMP
123CPUS += MN10200
123124
124
125125#-------------------------------------------------
126126# specify available sound cores; some of these are
127127# only for MESS and so aren't included
r7356r7357
220220SOUNDS += DIGITALKER
221221SOUNDS += CDP1863
222222SOUNDS += CDP1864
223SOUNDS += ZSG2
223224
224
225225#-------------------------------------------------
226226# this is the list of driver libraries that
227227# comprise MAME plus mamedriv.o which contains
r7356r7357
774774   $(DRIVERS)/contra.o $(VIDEO)/contra.o \
775775   $(DRIVERS)/crimfght.o $(VIDEO)/crimfght.o \
776776   $(DRIVERS)/dbz.o $(VIDEO)/dbz.o \
777   $(DRIVERS)/ddrible.o $(VIDEO)/ddrible.o \
777   $(DRIVERS)/ddribble.o $(VIDEO)/ddribble.o \
778778   $(DRIVERS)/djmain.o $(VIDEO)/djmain.o \
779779   $(DRIVERS)/fastfred.o $(VIDEO)/fastfred.o \
780780   $(DRIVERS)/fastlane.o $(VIDEO)/fastlane.o \
r7356r7357
11421142   $(DRIVERS)/stv.o $(DRIVERS)/stvinit.o $(MACHINE)/stvprot.o $(MACHINE)/stvcd.o \
11431143   $(DRIVERS)/suprloco.o $(VIDEO)/suprloco.o \
11441144   $(DRIVERS)/system1.o $(VIDEO)/system1.o \
1145   $(DRIVERS)/system16.o $(MACHINE)/system16.o $(VIDEO)/system16.o $(VIDEO)/sys16spr.o \
1145   $(DRIVERS)/system16.o $(VIDEO)/system16.o \
11461146   $(DRIVERS)/timetrv.o \
11471147   $(DRIVERS)/topshoot.o \
11481148   $(DRIVERS)/turbo.o $(AUDIO)/turbo.o $(VIDEO)/turbo.o \
r7356r7357
12091209$(MAMEOBJ)/sigma.a: \
12101210   $(DRIVERS)/nyny.o \
12111211   $(DRIVERS)/r2dtank.o \
1212   $(DRIVERS)/sigmab52.o \
12121213   $(DRIVERS)/spiders.o $(AUDIO)/spiders.o \
12131214   $(DRIVERS)/sub.o \
12141215
r7356r7357
13311332   $(AUDIO)/t5182.o \
13321333   $(MACHINE)/taitoio.o \
13331334   $(VIDEO)/taitoic.o \
1335   $(AUDIO)/taito_zm.o \
13341336
13351337$(MAMEOBJ)/tatsumi.a: \
13361338   $(DRIVERS)/kingdrby.o \
r7356r7357
15801582   $(DRIVERS)/multfish.o \
15811583   $(DRIVERS)/murogem.o \
15821584   $(DRIVERS)/murogmbl.o \
1585   $(DRIVERS)/neptunp2.o \
15831586   $(DRIVERS)/news.o $(VIDEO)/news.o \
15841587   $(DRIVERS)/norautp.o  $(AUDIO)/norautp.o \
15851588   $(DRIVERS)/oneshot.o $(VIDEO)/oneshot.o \
r7356r7357
18101813
18111814$(DRIVERS)/subsino.o:   $(LAYOUT)/victor5.lh \
18121815                  $(LAYOUT)/victor21.lh \
1816                  $(LAYOUT)/tisub.lh \
18131817                  $(LAYOUT)/crsbingo.lh \
18141818                  $(LAYOUT)/sharkpy.lh \
18151819                  $(LAYOUT)/smoto.lh
src/mame/video/rungun.c
r7356r7357
1717static TILE_GET_INFO( ttl_get_tile_info )
1818{
1919   rungun_state *state = (rungun_state *)machine->driver_data;
20   UINT32 *lvram = (UINT32 *)state->ttl_vram;
20   UINT8 *lvram = (UINT8 *)state->ttl_vram;
2121   int attr, code;
2222
23   code = (lvram[tile_index] >> 16) & 0xffff;
24   code |= (lvram[tile_index] & 0x0f) << 8;   /* tile "bank" */
25   attr = ((lvram[tile_index] & 0xf0) >> 4);   /* palette */
23   attr = (lvram[BYTE_XOR_LE(tile_index<<2)] & 0xf0) >> 4;
24   code = ((lvram[BYTE_XOR_LE(tile_index<<2)] & 0x0f) << 8) | (lvram[BYTE_XOR_LE((tile_index<<2)+2)]);
2625
2726   SET_TILE_INFO(state->ttl_gfx_index, code, attr, 0);
2827}
src/mame/video/segaxbd.c
r7356r7357
55***************************************************************************/
66
77#include "emu.h"
8#include "segaic16.h"
9#include "includes/system16.h"
8#include "video/segaic16.h"
9#include "includes/segas16.h"
1010
1111
12
1312/*************************************
1413 *
15 *  Statics
16 *
17 *************************************/
18
19static UINT8 road_priority;
20
21
22
23/*************************************
24 *
2514 *  Video startup
2615 *
2716 *************************************/
r7356r7357
4231}
4332
4433
45
4634/*************************************
4735 *
48 *  Miscellaneous setters
49 *
50 *************************************/
51
52void xboard_set_road_priority(int priority)
53{
54   /* this is only set at init time */
55   road_priority = priority;
56}
57
58
59
60/*************************************
61 *
6236 *  Video update
6337 *
6438 *************************************/
6539
6640VIDEO_UPDATE( xboard )
6741{
42   segas1x_state *state = (segas1x_state *)screen->machine->driver_data;
43
6844   /* if no drawing is happening, fill with black and get out */
6945   if (!segaic16_display_enable)
7046   {
r7356r7357
7753
7854   /* draw the low priority road layer */
7955   segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
80   if (road_priority == 0)
56   if (state->road_priority == 0)
8157      segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
8258
8359   /* draw background */
r7356r7357
8965   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
9066
9167   /* draw the high priority road */
92   if (road_priority == 1)
68   if (state->road_priority == 1)
9369      segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);
9470
9571   /* text layer */
src/mame/video/ddribble.c
r0r7357
1/***************************************************************************
2
3  video.c
4
5  Functions to emulate the video hardware of the machine.
6
7***************************************************************************/
8
9#include "emu.h"
10#include "includes/ddribble.h"
11
12
13PALETTE_INIT( ddribble )
14{
15   int i;
16
17   /* allocate the colortable */
18   machine->colortable = colortable_alloc(machine, 0x40);
19
20   for (i = 0x10; i < 0x40; i++)
21      colortable_entry_set_value(machine->colortable, i, i);
22
23   /* sprite #2 uses pens 0x00-0x0f */
24   for (i = 0x40; i < 0x140; i++)
25   {
26      UINT8 ctabentry = color_prom[i - 0x40] & 0x0f;
27      colortable_entry_set_value(machine->colortable, i, ctabentry);
28   }
29}
30
31
32static void set_pens( running_machine *machine )
33{
34   ddribble_state *state = (ddribble_state *)machine->driver_data;
35   int i;
36
37   for (i = 0x00; i < 0x80; i += 2)
38   {
39      UINT16 data = state->paletteram[i | 1] | (state->paletteram[i] << 8);
40
41      rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
42      colortable_palette_set_color(machine->colortable, i >> 1, color);
43   }
44}
45
46
47WRITE8_HANDLER( K005885_0_w )
48{
49   ddribble_state *state = (ddribble_state *)space->machine->driver_data;
50   switch (offset)
51   {
52      case 0x03:   /* char bank selection for set 1 */
53         if ((data & 0x03) != state->charbank[0])
54         {
55            state->charbank[0] = data & 0x03;
56            tilemap_mark_all_tiles_dirty(state->fg_tilemap);
57         }
58         break;
59      case 0x04:   /* IRQ control, flipscreen */
60         state->int_enable_0 = data & 0x02;
61         break;
62   }
63   state->vregs[0][offset] = data;
64}
65
66WRITE8_HANDLER( K005885_1_w )
67{
68   ddribble_state *state = (ddribble_state *)space->machine->driver_data;
69   switch (offset)
70   {
71      case 0x03:   /* char bank selection for set 2 */
72         if ((data & 0x03) != state->charbank[1])
73         {
74            state->charbank[1] = data & 0x03;
75            tilemap_mark_all_tiles_dirty(state->bg_tilemap);
76         }
77         break;
78      case 0x04:   /* IRQ control, flipscreen */
79         state->int_enable_1 = data & 0x02;
80         break;
81   }
82   state->vregs[1][offset] = data;
83}
84
85/***************************************************************************
86
87    Callbacks for the TileMap code
88
89***************************************************************************/
90
91static TILEMAP_MAPPER( tilemap_scan )
92{
93   /* logical (col,row) -> memory offset */
94   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 6);   /* skip 0x400 */
95}
96
97static TILE_GET_INFO( get_fg_tile_info )
98{
99   ddribble_state *state = (ddribble_state *)machine->driver_data;
100   UINT8 attr = state->fg_videoram[tile_index];
101   int num = state->fg_videoram[tile_index + 0x400] + ((attr & 0xc0) << 2) + ((attr & 0x20) << 5) + ((state->charbank[0] & 2) << 10);
102   SET_TILE_INFO(
103         0,
104         num,
105         0,
106         TILE_FLIPYX((attr & 0x30) >> 4));
107}
108
109static TILE_GET_INFO( get_bg_tile_info )
110{
111   ddribble_state *state = (ddribble_state *)machine->driver_data;
112   UINT8 attr = state->bg_videoram[tile_index];
113   int num = state->bg_videoram[tile_index + 0x400] + ((attr & 0xc0) << 2) + ((attr & 0x20) << 5) + (state->charbank[1] << 11);
114   SET_TILE_INFO(
115         1,
116         num,
117         0,
118         TILE_FLIPYX((attr & 0x30) >> 4));
119}
120
121/***************************************************************************
122
123    Start the video hardware emulation.
124
125***************************************************************************/
126
127VIDEO_START( ddribble )
128{
129   ddribble_state *state = (ddribble_state *)machine->driver_data;
130
131   state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan, 8, 8, 64, 32);
132   state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan, 8, 8, 64, 32);
133
134   tilemap_set_transparent_pen(state->fg_tilemap, 0);
135}
136
137/***************************************************************************
138
139    Memory handlers
140
141***************************************************************************/
142
143WRITE8_HANDLER( ddribble_fg_videoram_w )
144{
145   ddribble_state *state = (ddribble_state *)space->machine->driver_data;
146   state->fg_videoram[offset] = data;
147   tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0xbff);
148}
149
150WRITE8_HANDLER( ddribble_bg_videoram_w )
151{
152   ddribble_state *state = (ddribble_state *)space->machine->driver_data;
153   state->bg_videoram[offset] = data;
154   tilemap_mark_tile_dirty(state->bg_tilemap, offset & 0xbff);
155}
156
157/***************************************************************************
158
159    Double Dribble sprites
160
161Each sprite has 5 bytes:
162byte #0:    sprite number
163byte #1:
164    bits 0..2:  sprite bank #
165    bit 3:      not used?
166    bits 4..7:  sprite color
167byte #2:    y position
168byte #3:    x position
169byte #4:    attributes
170    bit 0:      x position (high bit)
171    bit 1:      ???
172    bits 2..4:  sprite size
173    bit 5:      flip x
174    bit 6:      flip y
175    bit 7:      unused?
176
177***************************************************************************/
178
179static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8* source, int lenght, int gfxset, int flipscreen )
180{
181   gfx_element *gfx = machine->gfx[gfxset];
182   const UINT8 *finish = source + lenght;
183
184   while (source < finish)
185   {
186      int number = source[0] | ((source[1] & 0x07) << 8);   /* sprite number */
187      int attr = source[4];                        /* attributes */
188      int sx = source[3] | ((attr & 0x01) << 8);         /* vertical position */
189      int sy = source[2];                           /* horizontal position */
190      int flipx = attr & 0x20;                     /* flip x */
191      int flipy = attr & 0x40;                     /* flip y */
192      int color = (source[1] & 0xf0) >> 4;            /* color */
193      int width, height;
194
195      if (flipscreen)
196      {
197         flipx = !flipx;
198         flipy = !flipy;
199         sx = 240 - sx;
200         sy = 240 - sy;
201
202         if ((attr & 0x1c) == 0x10)
203         {   /* ???. needed for some sprites in flipped mode */
204            sx -= 0x10;
205            sy -= 0x10;
206         }
207      }
208
209      switch (attr & 0x1c)
210      {
211         case 0x10:   /* 32x32 */
212            width = height = 2; number &= (~3); break;
213         case 0x08:   /* 16x32 */
214            width = 1; height = 2; number &= (~2); break;
215         case 0x04:   /* 32x16 */
216            width = 2; height = 1; number &= (~1); break;
217         /* the hardware allow more sprite sizes, but ddribble doesn't use them */
218         default:   /* 16x16 */
219            width = height = 1; break;
220      }
221
222      {
223         static const int x_offset[2] = { 0x00, 0x01 };
224         static const int y_offset[2] = { 0x00, 0x02 };
225         int x, y, ex, ey;
226
227         for (y = 0; y < height; y++)
228         {
229            for (x = 0; x < width; x++)
230            {
231               ex = flipx ? (width - 1 - x) : x;
232               ey = flipy ? (height - 1 - y) : y;
233
234               drawgfx_transpen(bitmap,cliprect,
235                  gfx,
236                  (number)+x_offset[ex]+y_offset[ey],
237                  color,
238                  flipx, flipy,
239                  sx+x*16,sy+y*16, 0);
240            }
241         }
242      }
243      source += 5;
244   }
245}
246
247/***************************************************************************
248
249    Display Refresh
250
251***************************************************************************/
252
253VIDEO_UPDATE( ddribble )
254{
255   ddribble_state *state = (ddribble_state *)screen->machine->driver_data;
256   set_pens(screen->machine);
257
258   tilemap_set_flip(state->fg_tilemap, (state->vregs[0][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
259   tilemap_set_flip(state->bg_tilemap, (state->vregs[1][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
260
261   /* set scroll registers */
262   tilemap_set_scrollx(state->fg_tilemap, 0, state->vregs[0][1] | ((state->vregs[0][2] & 0x01) << 8));
263   tilemap_set_scrollx(state->bg_tilemap, 0, state->vregs[1][1] | ((state->vregs[1][2] & 0x01) << 8));
264   tilemap_set_scrolly(state->fg_tilemap, 0, state->vregs[0][0]);
265   tilemap_set_scrolly(state->bg_tilemap, 0, state->vregs[1][0]);
266
267   tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
268   draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_1, 0x07d, 2, state->vregs[0][4] & 0x08);
269   draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_2, 0x140, 3, state->vregs[1][4] & 0x08);
270   tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
271   return 0;
272}
src/mame/video/segaybd.c
r7356r7357
55***************************************************************************/
66
77#include "emu.h"
8#include "segaic16.h"
9#include "includes/system16.h"
8#include "video/segaic16.h"
9#include "includes/segas16.h"
1010
1111
12
1312/*************************************
1413 *
15 *  Statics
16 *
17 *************************************/
18
19static bitmap_t *yboard_bitmap;
20
21
22
23/*************************************
24 *
2514 *  Video startup
2615 *
2716 *************************************/
2817
2918VIDEO_START( yboard )
3019{
20   segas1x_state *state = (segas1x_state *)machine->driver_data;
21
3122   /* compute palette info */
3223   segaic16_palette_init(0x2000);
3324
3425   /* allocate a bitmap for the yboard layer */
35   yboard_bitmap = auto_bitmap_alloc(machine, 512, 512, BITMAP_FORMAT_INDEXED16);
26   state->tmp_bitmap = auto_bitmap_alloc(machine, 512, 512, BITMAP_FORMAT_INDEXED16);
3627
3728   /* initialize the sprites */
3829   segaic16_sprites_init(machine, 0, SEGAIC16_SPRITES_YBOARD_16B, 0x800, 0);
r7356r7357
4031
4132   /* initialize the rotation layer */
4233   segaic16_rotate_init(machine, 0, SEGAIC16_ROTATE_YBOARD, 0x000);
34
35   state_save_register_global_bitmap(machine, state->tmp_bitmap);
4336}
4437
4538
r7356r7357
5245
5346VIDEO_UPDATE( yboard )
5447{
48   segas1x_state *state = (segas1x_state *)screen->machine->driver_data;
5549   rectangle yboard_clip;
5650
5751   /* if no drawing is happening, fill with black and get out */
r7356r7357
6458   /* draw the yboard sprites */
6559   yboard_clip.min_x = yboard_clip.min_y = 0;
6660   yboard_clip.max_x = yboard_clip.max_y = 511;
67   segaic16_sprites_draw(screen, yboard_bitmap, &yboard_clip, 1);
61   segaic16_sprites_draw(screen, state->tmp_bitmap, &yboard_clip, 1);
6862
6963   /* apply rotation */
70   segaic16_rotate_draw(screen->machine, 0, bitmap, cliprect, yboard_bitmap);
64   segaic16_rotate_draw(screen->machine, 0, bitmap, cliprect, state->tmp_bitmap);
7165
7266   /* draw the 16B sprites */
7367   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
src/mame/video/segaorun.c
r7356r7357
55***************************************************************************/
66
77#include "emu.h"
8#include "segaic16.h"
9#include "includes/system16.h"
8#include "video/segaic16.h"
9#include "includes/segas16.h"
1010
1111
1212
src/mame/video/gticlub.c
r7356r7357
22#include "cpu/sharc/sharc.h"
33#include "machine/konppc.h"
44#include "video/poly.h"
5#include "gticlub.h"
5#include "video/konicdev.h"
6#include "video/gticlub.h"
67
78
89typedef struct _poly_extra_data poly_extra_data;
r7356r7357
1617   int texture_mirror_y;
1718};
1819
19
20// defined in drivers/nwk-tr.c
21int K001604_vh_start(running_machine *machine, int chip);
22void K001604_draw_front_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect);
23void K001604_draw_back_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect);
24
2520extern UINT8 gticlub_led_reg0;
2621extern UINT8 gticlub_led_reg1;
2722
2823
29
3024/*****************************************************************************/
3125/* Konami K001006 Custom 3D Texel Renderer chip (KS10081) */
3226
r7356r7357
981975
982976   K001006_init(machine);
983977   K001005_init(machine);
984   K001604_vh_start(machine, 0);
985978}
986979
987980VIDEO_UPDATE( gticlub )
988981{
989   K001604_draw_back_layer(0, bitmap, cliprect);
982   running_device *k001604 = devtag_get_device(screen->machine, "k001604_1");
990983
984   k001604_draw_back_layer(k001604, bitmap, cliprect);
985
991986   K001005_draw(bitmap, cliprect);
992987
993   K001604_draw_front_layer(0, bitmap, cliprect);
988   k001604_draw_front_layer(k001604, bitmap, cliprect);
994989
995990   tick++;
996991   if( tick >= 5 ) {
src/mame/video/dkong.c
r7356r7357
140140};
141141
142142/*
143    radarsc1 interface
143    radarscp1 interface
144144
145145    All outputs are open-collector. They are followed by inverters which
146146    drive the resistor network. All outputs are routed through a complimentary
147147    darlington.
148148*/
149149
150static const res_net_info radarsc1_net_info =
150static const res_net_info radarscp1_net_info =
151151{
152152   RES_NET_VCC_5V | RES_NET_VBIAS_5V | RES_NET_VIN_TTL_OUT | RES_NET_MONITOR_SANYO_EZV20,
153153   {
r7356r7357
332332   state->color_codes = color_prom;   /* we'll need it later */
333333}
334334
335PALETTE_INIT( radarsc1 )
335PALETTE_INIT( radarscp1 )
336336{
337337   dkong_state *state = (dkong_state *)machine->driver_data;
338338   int i;
r7356r7357
342342   {
343343
344344      /* red component */
345      r = compute_res_net( color_prom[512], 0, &radarsc1_net_info );
345      r = compute_res_net( color_prom[512], 0, &radarscp1_net_info );
346346      /* green component */
347      g = compute_res_net( color_prom[256], 1, &radarsc1_net_info );
347      g = compute_res_net( color_prom[256], 1, &radarscp1_net_info );
348348      /* blue component */
349      b = compute_res_net( color_prom[0], 2, &radarsc1_net_info );
349      b = compute_res_net( color_prom[0], 2, &radarscp1_net_info );
350350
351351      palette_set_color_rgb(machine,i,r,g,b);
352352      color_prom++;
r7356r7357
357357   for (i=0;i<256;i++)
358358      if ( (i & 0x03) == 0x00 )  /*  NOR => CS=1 => Tristate => real black */
359359      {
360         r = compute_res_net( 0, 0, &radarsc1_net_info );
361         g = compute_res_net( 0, 1, &radarsc1_net_info );
362         b = compute_res_net( 0, 2, &radarsc1_net_info );
360         r = compute_res_net( 0, 0, &radarscp1_net_info );
361         g = compute_res_net( 0, 1, &radarscp1_net_info );
362         b = compute_res_net( 0, 2, &radarscp1_net_info );
363363         palette_set_color_rgb(machine,i,r,g,b);
364364      }
365365
r7356r7357
456456   SET_TILE_INFO(0, code, color, 0);
457457}
458458
459static TILE_GET_INFO( radarsc1_bg_tile_info )
459static TILE_GET_INFO( radarscp1_bg_tile_info )
460460{
461461   dkong_state *state = (dkong_state *)machine->driver_data;
462462   int code = state->video_ram[tile_index] + 256 * state->gfx_bank;
r7356r7357
960960         tilemap_set_scrolldx(state->bg_tilemap, 0, 128);
961961         break;
962962      case HARDWARE_TRS01:
963         state->bg_tilemap = tilemap_create(machine, radarsc1_bg_tile_info, tilemap_scan_rows,  8, 8, 32, 32);
963         state->bg_tilemap = tilemap_create(machine, radarscp1_bg_tile_info, tilemap_scan_rows,  8, 8, 32, 32);
964964         tilemap_set_scrolldx(state->bg_tilemap, 0, 128);
965965
966966         state->bg_bits = video_screen_auto_bitmap_alloc(machine->primary_screen);
src/mame/video/system16.c
r7356r7357
2929#include "video/resnet.h"
3030#include "video/segaic16.h"
3131
32static int system16_bootleg_spritebank_type;
33static int system16_bootleg_back_tilemap_yscroll = 0;
34static int system16_bootleg_fore_tilemap_yscroll = 0;
35static int system16_bootleg_text_tilemap_yscroll = 0;
36static int system16_bootleg_sprite_xoffs = 0;
3732
38/* A config table for per-game offsets and bank types */
39struct system15_bootleg_config
33static void setup_system16_bootleg_spritebanking( running_machine* machine )
4034{
41   const char *name;             /* game driver name */
42   int spritebank_type;
43   int back_tilemap_yscroll;
44   int fore_tilemap_yscroll;
45   int text_tilemap_yscroll;
46   int sprite_xoffs;
47};
35   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
4836
49
50static const struct system15_bootleg_config config_table[] =
51{
52   /* 16A bootlegs */
53   { "shinobld",       1, 0,0,0,    117 },
54   { "passshtb",       1, 3,0,0,    117 },
55   { "passht4b",       1, 0,0,0,    117 },
56   { "wb3bbl",         1, 2,2,0,    117 },
57
58   /* 16B bootlegs */
59   { "bayrouteb1",     0, 0,0,0,    107 },
60   { "bayrouteb2",     0, 0,0,0,    107 },
61   { "goldnaxeb1",     1, 0,0,0,    121 },
62   { "goldnaxeb2",     1, 0,0,0,    121 },
63   { "tturfbl",        0, 0,0,0,    107 },
64   { "dduxbl",         0, 0,0,0,    112 },
65   { "eswatbl",        1, 0,0,0,    124 },
66   { "fpointbl",       0, 2,2,0,    107 },
67   { "fpointbj",       0, 2,2,0,    107 },
68   { "tetrisbl",       0, 0,0,0,    112 },
69
70   /* 18 bootlegs */
71   { "astormbl",       1, 0,0,0,    107 },
72   { "astormb2",       1, 0,0,0,    107 },
73   { "mwalkbl",        1, 0,0,0,    107 },
74   { "shdancbl",       1, 0,0,0,    107 },
75
76   /* Tetris-based hardware */
77   { "beautyb",        0, 0,0,0,    112 },
78   { "iqpipe",         0, 0,0,0,    112 },
79
80
81
82   { NULL, 0 }   // end of table
83};
84
85
86
87
88static void setup_system16_bootleg_video(running_machine* machine)
89{
90   const char *gamename = machine->gamedrv->name;
91   const struct system15_bootleg_config *k = &config_table[0];
92   int found = 0;
93   while (k->name)
37   if (state->spritebank_type == 1)
9438   {
95      if (strcmp(k->name, gamename) == 0)
96      {
97         system16_bootleg_spritebank_type = k->spritebank_type;
98         system16_bootleg_back_tilemap_yscroll = k->back_tilemap_yscroll;
99         system16_bootleg_fore_tilemap_yscroll = k->fore_tilemap_yscroll;
100         system16_bootleg_text_tilemap_yscroll = k->text_tilemap_yscroll;
101         system16_bootleg_sprite_xoffs = k->sprite_xoffs;
102         found = 1;
103         break;
104      }
105      ++k;
106   }
107
108   if (!found) fatalerror("system16 bootleg not in system15_bootleg_config config_table[]!\n");
109}
110
111static void setup_system16_bootleg_spritebanking(running_machine* machine)
112{
113
114   if (system16_bootleg_spritebank_type == 1)
115   {
11639      static const UINT8 default_banklist[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
11740      int i;
11841      for (i = 0; i < 16; i++)
r7356r7357
13053}
13154
13255
133UINT16* system16a_bootleg_bg0_tileram;
134UINT16* system16a_bootleg_bg1_tileram;
135
136UINT16 *sys16_tileram;
137UINT16 *sys16_textram;
138UINT16 *sys16_spriteram;
139
140static int num_sprites;
141
14256#define MAXCOLOURS 0x2000 /* 8192 */
14357
144int sys16_sh_shadowpal;
145int sys16_MaxShadowColors;
14658
147/* video driver constants (potentially different for each game) */
148const int *sys16_obj_bank;
149int sys16_sprxoffset;
150int sys16_bgxoffset;
151int sys16_fgxoffset;
152int sys16_textlayer_lo_min;
153int sys16_textlayer_lo_max;
154int sys16_textlayer_hi_min;
155int sys16_textlayer_hi_max;
156int sys16_bg1_trans; // alien syn + sys18
157int sys16_bg_priority_mode;
158int sys16_fg_priority_mode;
159int sys16_bg_priority_value;
160int sys16_fg_priority_value;
161static int sys16_18_mode;
162int sys16_tilebank_switch;
163int sys16_rowscroll_scroll;
164int shinobl_kludge;
165
166/* video registers */
167int sys16_tile_bank1;
168int sys16_tile_bank0;
169int sys16_refreshenable;
170
171int sys16_bg_scrollx, sys16_bg_scrolly;
172int sys16_fg_scrollx, sys16_fg_scrolly;
173
174int sys16_bg_page[4];
175int sys16_bg2_page[4];
176int sys16_fg_page[4];
177int sys16_fg2_page[4];
178
179int sys18_bg2_active;
180int sys18_fg2_active;
181UINT16 *sys18_splittab_bg_x;
182UINT16 *sys18_splittab_bg_y;
183UINT16 *sys18_splittab_fg_x;
184UINT16 *sys18_splittab_fg_y;
185
186static tilemap_t *background, *foreground, *text_layer;
187static tilemap_t *background2, *foreground2;
188static int old_bg_page[4],old_fg_page[4], old_tile_bank1, old_tile_bank0;
189static int old_bg2_page[4],old_fg2_page[4];
190
191
192// doesn't use te page system
193#if 0
194
195//static UINT8 bg0_page[4];
196//static UINT8 bg1_page[4];
197
198static TILE_GET_INFO( get_system16b_bootleg_tile_info0 )
199{
200   /* TILEMAP_MAPPER can't be dynamic, so we do the page lookup here */
201   int data, tile_number;
202   int page = 0;
203
204   if (tile_index & 0x0040)
205      page+=1;
206
207   if (tile_index & 0x1000)
208      page+=2;
209
210   tile_index = ((tile_index & 0x03f) >> 0) |
211             ((tile_index & 0xf80) >> 1);
212
213   tile_index += bg0_page[page] * 0x800;
214
215   data = sys16_tileram[tile_index];
216   tile_number = data&0xfff;
217
218   SET_TILE_INFO(
219         0,
220         tile_number,
221         (data>>6)&0x7f,
222         0);
223}
224
225static TILE_GET_INFO( get_system16b_bootleg_tile_info1 )
226{
227   /* TILEMAP_MAPPER can't be dynamic, so we do the page lookup here */
228   int data, tile_number;
229   int page = 0;
230
231   if (tile_index & 0x0040)
232      page+=1;
233
234   if (tile_index & 0x1000)
235      page+=2;
236
237   tile_index = ((tile_index & 0x03f) >> 0) |
238             ((tile_index & 0xf80) >> 1);
239
240   tile_index += bg1_page[page] * 0x800;
241
242   data = sys16_tileram[tile_index];
243   tile_number = data&0xfff;
244
245   SET_TILE_INFO(
246         0,
247         tile_number,
248         (data>>6)&0x7f,
249         0);
250}
251#endif
252
253
25459/***************************************************************************/
25560
256
257/***************************************************************************/
258
25961static TILEMAP_MAPPER( sys16_bg_map )
26062{
26163   int page = 0;
262   if( row<32 ){ /* top */
263      if( col<64 ) page = 0; else page = 1;
64   if (row < 32)
65   {
66      /* top */
67      if (col < 64)
68         page = 0;
69      else
70         page = 1;
26471   }
265   else { /* bottom */
266      if( col<64 ) page = 2; else page = 3;
72   else
73   {
74      /* bottom */
75      if (col < 64)
76         page = 2;
77      else
78         page = 3;
26779   }
268   row = row%32;
269   col = col%64;
270   return page*64*32+row*64+col;
80
81   row = row % 32;
82   col = col % 64;
83   return page * 64 * 32 + row * 64 + col;
27184}
27285
27386static TILEMAP_MAPPER( sys16_text_map )
27487{
275   return row*64+col+(64-40);
88   return row * 64 + col + (64 - 40);
27689}
27790
278/***************************************************************************/
27991
28092/*
28193    Color generation details
r7356r7357
296108
297109static const int resistances_normal[6] = {3900, 2000, 1000, 1000/2, 1000/4, 0};
298110static const int resistances_sh[6] = {3900, 2000, 1000, 1000/2, 1000/4, 470};
299static double weights[2][3][6];
300111
301112#ifdef UNUSED_CODE
302113WRITE16_HANDLER( sys16_paletteram_w )
303114{
115   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
304116   UINT16 newword;
305   COMBINE_DATA( &space->machine->generic.paletteram.u16[offset] );
117
118   COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
306119   newword = space->machine->generic.paletteram.u16[offset];
307120
308121   /*  sBGR BBBB GGGG RRRR */
r7356r7357
326139      int b4 = (newword >> 11) & 1;
327140
328141      /* Normal colors */
329      r = combine_6_weights(weights[0][0], r0, r1, r2, r3, r4, 0);
330      g = combine_6_weights(weights[0][1], g0, g1, g2, g3, g4, 0);
331      b = combine_6_weights(weights[0][2], b0, b1, b2, b3, b4, 0);
142      r = combine_6_weights(state->weights[0][0], r0, r1, r2, r3, r4, 0);
143      g = combine_6_weights(state->weights[0][1], g0, g1, g2, g3, g4, 0);
144      b = combine_6_weights(state->weights[0][2], b0, b1, b2, b3, b4, 0);
332145
333146      /* Shadow colors */
334      rs = combine_6_weights(weights[1][0], r0, r1, r2, r3, r4, 0);
335      gs = combine_6_weights(weights[1][1], g0, g1, g2, g3, g4, 0);
336      bs = combine_6_weights(weights[1][2], b0, b1, b2, b3, b4, 0);
147      rs = combine_6_weights(state->weights[1][0], r0, r1, r2, r3, r4, 0);
148      gs = combine_6_weights(state->weights[1][1], g0, g1, g2, g3, g4, 0);
149      bs = combine_6_weights(state->weights[1][2], b0, b1, b2, b3, b4, 0);
337150
338151      /* Highlight colors */
339      rh = combine_6_weights(weights[1][0], r0, r1, r2, r3, r4, 1);
340      gh = combine_6_weights(weights[1][1], g0, g1, g2, g3, g4, 1);
341      bh = combine_6_weights(weights[1][2], b0, b1, b2, b3, b4, 1);
152      rh = combine_6_weights(state->weights[1][0], r0, r1, r2, r3, r4, 1);
153      gh = combine_6_weights(state->weights[1][1], g0, g1, g2, g3, g4, 1);
154      bh = combine_6_weights(state->weights[1][2], b0, b1, b2, b3, b4, 1);
342155
343      palette_set_color( space->machine, offset, MAKE_RGB(r, g, b) );
156      palette_set_color(space->machine, offset, MAKE_RGB(r, g, b) );
344157
345      palette_set_color( space->machine, offset+space->machine->config->total_colors/2,MAKE_RGB(rs,gs,bs));
158      palette_set_color(space->machine, offset + space->machine->config->total_colors/2, MAKE_RGB(rs,gs,bs));
346159   }
347160}
348161#endif
349162
350static void update_page( void ){
163static void update_page( running_machine *machine )
164{
165   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
351166   int all_dirty = 0;
352   int i,offset;
353   if( old_tile_bank1 != sys16_tile_bank1 ){
167   int i, offset;
168
169   if (state->old_tile_bank1 != state->tile_bank1)
170   {
354171      all_dirty = 1;
355      old_tile_bank1 = sys16_tile_bank1;
172      state->old_tile_bank1 = state->tile_bank1;
356173   }
357   if( old_tile_bank0 != sys16_tile_bank0 ){
174
175   if (state->old_tile_bank0 != state->tile_bank0)
176   {
358177      all_dirty = 1;
359      old_tile_bank0 = sys16_tile_bank0;
360      tilemap_mark_all_tiles_dirty( text_layer );
178      state->old_tile_bank0 = state->tile_bank0;
179      tilemap_mark_all_tiles_dirty(state->text_layer);
361180   }
362   if( all_dirty ){
363      tilemap_mark_all_tiles_dirty( background );
364      tilemap_mark_all_tiles_dirty( foreground );
365      if( sys16_18_mode ){
366         tilemap_mark_all_tiles_dirty( background2 );
367         tilemap_mark_all_tiles_dirty( foreground2 );
181
182   if (all_dirty)
183   {
184      tilemap_mark_all_tiles_dirty(state->background);
185      tilemap_mark_all_tiles_dirty(state->foreground);
186
187      if (state->system18)
188      {
189         tilemap_mark_all_tiles_dirty(state->background2);
190         tilemap_mark_all_tiles_dirty(state->foreground2);
368191      }
369192   }
370193   else {
371      for(i=0;i<4;i++){
372         int page0 = 64*32*i;
373         if( old_bg_page[i]!=sys16_bg_page[i] ){
374            old_bg_page[i] = sys16_bg_page[i];
375            for( offset = page0; offset<page0+64*32; offset++ ){
376               tilemap_mark_tile_dirty( background, offset );
194      for (i = 0; i < 4; i++)
195      {
196         int page0 = 64 * 32 * i;
197         if (state->old_bg_page[i] != state->bg_page[i])
198         {
199            state->old_bg_page[i] = state->bg_page[i];
200            for (offset = page0; offset < page0 + 64 * 32; offset++)
201            {
202               tilemap_mark_tile_dirty(state->background, offset);
377203            }
378204         }
379         if( old_fg_page[i]!=sys16_fg_page[i] ){
380            old_fg_page[i] = sys16_fg_page[i];
381            for( offset = page0; offset<page0+64*32; offset++ ){
382               tilemap_mark_tile_dirty( foreground, offset );
205
206         if (state->old_fg_page[i] != state->fg_page[i])
207         {
208            state->old_fg_page[i] = state->fg_page[i];
209            for (offset = page0; offset < page0 + 64 * 32; offset++)
210            {
211               tilemap_mark_tile_dirty(state->foreground, offset);
383212            }
384213         }
385         if( sys16_18_mode ){
386            if( old_bg2_page[i]!=sys16_bg2_page[i] ){
387               old_bg2_page[i] = sys16_bg2_page[i];
388               for( offset = page0; offset<page0+64*32; offset++ ){
389                  tilemap_mark_tile_dirty( background2, offset );
214
215         if (state->system18)
216         {
217            if (state->old_bg2_page[i] != state->bg2_page[i])
218            {
219               state->old_bg2_page[i] = state->bg2_page[i];
220               for (offset = page0; offset < page0 + 64 * 32; offset++)
221               {
222                  tilemap_mark_tile_dirty(state->background2, offset);
390223               }
391224            }
392            if( old_fg2_page[i]!=sys16_fg2_page[i] ){
393               old_fg2_page[i] = sys16_fg2_page[i];
394               for( offset = page0; offset<page0+64*32; offset++ ){
395                  tilemap_mark_tile_dirty( foreground2, offset );
225
226            if (state->old_fg2_page[i] != state->fg2_page[i])
227            {
228               state->old_fg2_page[i] = state->fg2_page[i];
229               for (offset = page0; offset < page0 + 64 * 32; offset++)
230               {
231                  tilemap_mark_tile_dirty(state->foreground2, offset);
396232               }
397233            }
398234         }
r7356r7357
400236   }
401237}
402238
403static TILE_GET_INFO( get_bg_tile_info ){
404   const UINT16 *source = 64*32*sys16_bg_page[tile_index/(64*32)] + sys16_tileram;
239static TILE_GET_INFO( get_bg_tile_info )
240{
241   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
242   const UINT16 *source = 64 * 32 * state->bg_page[tile_index / (64 * 32)] + state->tileram;
405243   int data = source[tile_index%(64*32)];
406   int tile_number = (data&0xfff) + 0x1000*((data&sys16_tilebank_switch)?sys16_tile_bank1:sys16_tile_bank0);
244   int tile_number = (data & 0xfff) + 0x1000 * ((data & state->tilebank_switch) ? state->tile_bank1 : state->tile_bank0);
407245
408246   SET_TILE_INFO(
409247         0,
410248         tile_number,
411         (data>>6)&0x7f,
249         (data >> 6) & 0x7f,
412250         0);
413251}
414252
415static TILE_GET_INFO( get_fg_tile_info ){
416   const UINT16 *source = 64*32*sys16_fg_page[tile_index/(64*32)] + sys16_tileram;
417   int data = source[tile_index%(64*32)];
418   int tile_number = (data&0xfff) + 0x1000*((data&sys16_tilebank_switch)?sys16_tile_bank1:sys16_tile_bank0);
253static TILE_GET_INFO( get_fg_tile_info )
254{
255   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
256   const UINT16 *source = 64 * 32 * state->fg_page[tile_index / (64 * 32)] + state->tileram;
257   int data = source[tile_index % (64 * 32)];
258   int tile_number = (data & 0xfff) + 0x1000 * ((data & state->tilebank_switch) ? state->tile_bank1 : state->tile_bank0);
419259
420260   SET_TILE_INFO(
421261         0,
422262         tile_number,
423         (data>>6)&0x7f,
263         (data >> 6) & 0x7f,
424264         0);
425265}
426266
427static TILE_GET_INFO( get_bg2_tile_info ){
428   const UINT16 *source = 64*32*sys16_bg2_page[tile_index/(64*32)] + sys16_tileram;
429   int data = source[tile_index%(64*32)];
430   int tile_number = (data&0xfff) + 0x1000*((data&0x1000)?sys16_tile_bank1:sys16_tile_bank0);
267static TILE_GET_INFO( get_bg2_tile_info )
268{
269   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
270   const UINT16 *source = 64 * 32 * state->bg2_page[tile_index / (64 * 32)] + state->tileram;
271   int data = source[tile_index % (64 * 32)];
272   int tile_number = (data & 0xfff) + 0x1000 * ((data & 0x1000) ? state->tile_bank1 : state->tile_bank0);
431273
432274   SET_TILE_INFO(
433275         0,
434276         tile_number,
435         (data>>6)&0x7f,
277         (data >> 6) & 0x7f,
436278         0);
437279}
438280
439static TILE_GET_INFO( get_fg2_tile_info ){
440   const UINT16 *source = 64*32*sys16_fg2_page[tile_index/(64*32)] + sys16_tileram;
441   int data = source[tile_index%(64*32)];
442   int tile_number = (data&0xfff) + 0x1000*((data&0x1000)?sys16_tile_bank1:sys16_tile_bank0);
281static TILE_GET_INFO( get_fg2_tile_info )
282{
283   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
284   const UINT16 *source = 64 * 32 * state->fg2_page[tile_index / (64 * 32)] + state->tileram;
285   int data = source[tile_index % (64 * 32)];
286   int tile_number = (data & 0xfff) + 0x1000 * ((data & 0x1000) ? state->tile_bank1 : state->tile_bank0);
443287
444288   SET_TILE_INFO(
445289         0,
446290         tile_number,
447         (data>>6)&0x7f,
291         (data >> 6) & 0x7f,
448292         0);
449293}
450294
451WRITE16_HANDLER( sys16_tileram_w ){
452   UINT16 oldword = sys16_tileram[offset];
453   COMBINE_DATA( &sys16_tileram[offset] );
454   if( oldword != sys16_tileram[offset] ){
455      int page = offset/(64*32);
456      offset = offset%(64*32);
295WRITE16_HANDLER( sys16_tileram_w )
296{
297   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
298   UINT16 oldword = state->tileram[offset];
457299
458      if( sys16_bg_page[0]==page ) tilemap_mark_tile_dirty( background, offset+64*32*0 );
459      if( sys16_bg_page[1]==page ) tilemap_mark_tile_dirty( background, offset+64*32*1 );
460      if( sys16_bg_page[2]==page ) tilemap_mark_tile_dirty( background, offset+64*32*2 );
461      if( sys16_bg_page[3]==page ) tilemap_mark_tile_dirty( background, offset+64*32*3 );
300   COMBINE_DATA(&state->tileram[offset]);
462301
463      if( sys16_fg_page[0]==page ) tilemap_mark_tile_dirty( foreground, offset+64*32*0 );
464      if( sys16_fg_page[1]==page ) tilemap_mark_tile_dirty( foreground, offset+64*32*1 );
465      if( sys16_fg_page[2]==page ) tilemap_mark_tile_dirty( foreground, offset+64*32*2 );
466      if( sys16_fg_page[3]==page ) tilemap_mark_tile_dirty( foreground, offset+64*32*3 );
302   if (oldword != state->tileram[offset])
303   {
304      int page = offset / (64 * 32);
305      offset = offset % (64 * 32);
467306
468      if( sys16_18_mode ){
469         if( sys16_bg2_page[0]==page ) tilemap_mark_tile_dirty( background2, offset+64*32*0 );
470         if( sys16_bg2_page[1]==page ) tilemap_mark_tile_dirty( background2, offset+64*32*1 );
471         if( sys16_bg2_page[2]==page ) tilemap_mark_tile_dirty( background2, offset+64*32*2 );
472         if( sys16_bg2_page[3]==page ) tilemap_mark_tile_dirty( background2, offset+64*32*3 );
307      if (state->bg_page[0] == page) tilemap_mark_tile_dirty(state->background, offset + 64 * 32 * 0);
308      if (state->bg_page[1] == page) tilemap_mark_tile_dirty(state->background, offset + 64 * 32 * 1);
309      if (state->bg_page[2] == page) tilemap_mark_tile_dirty(state->background, offset + 64 * 32 * 2);
310      if (state->bg_page[3] == page) tilemap_mark_tile_dirty(state->background, offset + 64 * 32 * 3);
473311
474         if( sys16_fg2_page[0]==page ) tilemap_mark_tile_dirty( foreground2, offset+64*32*0 );
475         if( sys16_fg2_page[1]==page ) tilemap_mark_tile_dirty( foreground2, offset+64*32*1 );
476         if( sys16_fg2_page[2]==page ) tilemap_mark_tile_dirty( foreground2, offset+64*32*2 );
477         if( sys16_fg2_page[3]==page ) tilemap_mark_tile_dirty( foreground2, offset+64*32*3 );
312      if (state->fg_page[0] == page) tilemap_mark_tile_dirty(state->foreground, offset + 64 * 32 * 0);
313      if (state->fg_page[1] == page) tilemap_mark_tile_dirty(state->foreground, offset + 64 * 32 * 1);
314      if (state->fg_page[2] == page) tilemap_mark_tile_dirty(state->foreground, offset + 64 * 32 * 2);
315      if (state->fg_page[3] == page) tilemap_mark_tile_dirty(state->foreground, offset + 64 * 32 * 3);
316
317      if (state->system18)
318      {
319         if (state->bg2_page[0] == page) tilemap_mark_tile_dirty(state->background2, offset + 64 * 32 * 0);
320         if (state->bg2_page[1] == page) tilemap_mark_tile_dirty(state->background2, offset + 64 * 32 * 1);
321         if (state->bg2_page[2] == page) tilemap_mark_tile_dirty(state->background2, offset + 64 * 32 * 2);
322         if (state->bg2_page[3] == page) tilemap_mark_tile_dirty(state->background2, offset + 64 * 32 * 3);
323
324         if (state->fg2_page[0] == page) tilemap_mark_tile_dirty(state->foreground2, offset + 64 * 32 * 0);
325         if (state->fg2_page[1] == page) tilemap_mark_tile_dirty(state->foreground2, offset + 64 * 32 * 1);
326         if (state->fg2_page[2] == page) tilemap_mark_tile_dirty(state->foreground2, offset + 64 * 32 * 2);
327         if (state->fg2_page[3] == page) tilemap_mark_tile_dirty(state->foreground2, offset + 64 * 32 * 3);
478328      }
479329   }
480330}
481331
482332/***************************************************************************/
483333
484static TILE_GET_INFO( get_text_tile_info ){
485   const UINT16 *source = sys16_textram;
334static TILE_GET_INFO( get_text_tile_info )
335{
336   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
337   const UINT16 *source = state->textram;
486338   int tile_number = source[tile_index];
487339   int pri = tile_number >> 8;
488340
489   if (!shinobl_kludge)
341   if (!state->shinobl_kludge)
490342   {
491343      SET_TILE_INFO(
492344            0,
493            (tile_number&0x1ff) + sys16_tile_bank0 * 0x1000,
494            (tile_number>>9)%8,
345            (tile_number & 0x1ff) + state->tile_bank0 * 0x1000,
346            (tile_number >> 9) % 8,
495347            0);
496348   }
497349   else
498350   {
499351      SET_TILE_INFO(
500352            0,
501            (tile_number&0xff)  + sys16_tile_bank0 * 0x1000,
502            (tile_number>>8)%8,
353            (tile_number & 0xff)  + state->tile_bank0 * 0x1000,
354            (tile_number >> 8) % 8,
503355            0);
504356   }
505357
506   if(pri>=sys16_textlayer_lo_min && pri<=sys16_textlayer_lo_max)
358   if (pri >= state->textlayer_lo_min && pri <= state->textlayer_lo_max)
507359      tileinfo->category = 1;
508   if(pri>=sys16_textlayer_hi_min && pri<=sys16_textlayer_hi_max)
360   if (pri >= state->textlayer_hi_min && pri <= state->textlayer_hi_max)
509361      tileinfo->category = 0;
510362}
511363
512WRITE16_HANDLER( sys16_textram_w ){
513   COMBINE_DATA( &sys16_textram[offset] );
514   tilemap_mark_tile_dirty( text_layer, offset );
364WRITE16_HANDLER( sys16_textram_w )
365{
366   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
367
368   COMBINE_DATA(&state->textram[offset]);
369   tilemap_mark_tile_dirty(state->text_layer, offset);
515370}
516371
517372/***************************************************************************/
518373
519374VIDEO_START( system16 )
520375{
521   setup_system16_bootleg_video(machine);
376   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
522377
523378   /* Normal colors */
524379   compute_resistor_weights(0, 255, -1.0,
525      6, resistances_normal, weights[0][0], 0, 0,
526      6, resistances_normal, weights[0][1], 0, 0,
527      6, resistances_normal, weights[0][2], 0, 0
380      6, resistances_normal, state->weights[0][0], 0, 0,
381      6, resistances_normal, state->weights[0][1], 0, 0,
382      6, resistances_normal, state->weights[0][2], 0, 0
528383      );
529384
530385   /* Shadow/Highlight colors */
531386   compute_resistor_weights(0, 255, -1.0,
532      6, resistances_sh, weights[1][0], 0, 0,
533      6, resistances_sh, weights[1][1], 0, 0,
534      6, resistances_sh, weights[1][2], 0, 0
387      6, resistances_sh, state->weights[1][0], 0, 0,
388      6, resistances_sh, state->weights[1][1], 0, 0,
389      6, resistances_sh, state->weights[1][2], 0, 0
535390      );
536391
537   if( !sys16_bg1_trans )
538      background = tilemap_create(machine,
539         get_bg_tile_info,
540         sys16_bg_map,
541
392   if (!state->bg1_trans)
393      state->background = tilemap_create(machine, get_bg_tile_info, sys16_bg_map,
542394         8,8,
543395         64*2,32*2 );
544396   else
545      background = tilemap_create(machine,
546         get_bg_tile_info,
547         sys16_bg_map,
548
397      state->background = tilemap_create(machine, get_bg_tile_info, sys16_bg_map,
549398         8,8,
550399         64*2,32*2 );
551400
552   foreground = tilemap_create(machine,
553      get_fg_tile_info,
554      sys16_bg_map,
555
401   state->foreground = tilemap_create(machine, get_fg_tile_info, sys16_bg_map,
556402      8,8,
557403      64*2,32*2 );
558404
559   text_layer = tilemap_create(machine,
560      get_text_tile_info,
561      sys16_text_map,
562
405   state->text_layer = tilemap_create(machine, get_text_tile_info, sys16_text_map,
563406      8,8,
564407      40,28 );
565408
566   num_sprites = 128*2; /* only 128 for most games; aburner uses 256 */
567
568409   {
569      if(sys16_bg1_trans) tilemap_set_transparent_pen( background, 0 );
570      tilemap_set_transparent_pen( foreground, 0 );
571      tilemap_set_transparent_pen( text_layer, 0 );
410      if (state->bg1_trans) tilemap_set_transparent_pen(state->background, 0);
411      tilemap_set_transparent_pen(state->foreground, 0);
412      tilemap_set_transparent_pen(state->text_layer, 0);
572413
573      sys16_tile_bank0 = 0;
574      sys16_tile_bank1 = 1;
414      state->tile_bank0 = 0;
415      state->tile_bank1 = 1;
575416
576      sys16_fg_scrollx = 0;
577      sys16_fg_scrolly = 0;
417      state->fg_scrollx = 0;
418      state->fg_scrolly = 0;
578419
579      sys16_bg_scrollx = 0;
580      sys16_bg_scrolly = 0;
420      state->bg_scrollx = 0;
421      state->bg_scrolly = 0;
581422
582      sys16_refreshenable = 1;
423      state->refreshenable = 1;
583424
584425      /* common defaults */
426      state->tilebank_switch = 0x1000;
585427
586      sys16_bgxoffset = 0;
587      sys16_bg_priority_mode=0;
588      sys16_fg_priority_mode=0;
589      sys16_tilebank_switch=0x1000;
590
591428      // Defaults for sys16 games
592      sys16_textlayer_lo_min=0;
593      sys16_textlayer_lo_max=0x7f;
594      sys16_textlayer_hi_min=0x80;
595      sys16_textlayer_hi_max=0xff;
429      state->textlayer_lo_min = 0;
430      state->textlayer_lo_max = 0x7f;
431      state->textlayer_hi_min = 0x80;
432      state->textlayer_hi_max = 0xff;
596433
597      sys16_18_mode=0;
434      state->system18 = 0;
598435   }
599436
600437   segaic16_palette_init(0x800);
601   segaic16_sprites_init(machine, 0, SEGAIC16_SPRITES_16B, 0x400,system16_bootleg_sprite_xoffs);
438   segaic16_sprites_init(machine, 0, SEGAIC16_SPRITES_16B, 0x400, state->sprite_xoffs);
602439   setup_system16_bootleg_spritebanking(machine);
603440
604441
r7356r7357
606443
607444VIDEO_START( system18old )
608445{
446   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
447
609448   VIDEO_START_CALL(system16);
610449
611   sys16_bg1_trans=1;
450   state->bg1_trans = 1;
612451
613   background2 = tilemap_create(machine,
614      get_bg2_tile_info,
615      sys16_bg_map,
616
452   state->background2 = tilemap_create(machine, get_bg2_tile_info, sys16_bg_map,
617453      8,8,
618454      64*2,32*2 );
619455
620   foreground2 = tilemap_create(machine,
621      get_fg2_tile_info,
622      sys16_bg_map,
623
456   state->foreground2 = tilemap_create(machine, get_fg2_tile_info, sys16_bg_map,
624457      8,8,
625458      64*2,32*2 );
626459
460   tilemap_set_transparent_pen(state->foreground2, 0);
627461
628   tilemap_set_transparent_pen( foreground2, 0 );
462   if (state->splittab_fg_x)
463   {
464      tilemap_set_scroll_rows(state->foreground , 64);
465      tilemap_set_scroll_rows(state->foreground2 , 64);
466   }
629467
630   if(sys18_splittab_fg_x){
631      tilemap_set_scroll_rows( foreground , 64 );
632      tilemap_set_scroll_rows( foreground2 , 64 );
468   if (state->splittab_bg_x)
469   {
470      tilemap_set_scroll_rows(state->background , 64);
471      tilemap_set_scroll_rows(state->background2 , 64);
633472   }
634   if(sys18_splittab_bg_x){
635      tilemap_set_scroll_rows( background , 64 );
636      tilemap_set_scroll_rows( background2 , 64 );
637   }
638473
639   sys16_textlayer_lo_min=0;
640   sys16_textlayer_lo_max=0x1f;
641   sys16_textlayer_hi_min=0x20;
642   sys16_textlayer_hi_max=0xff;
474   state->textlayer_lo_min = 0;
475   state->textlayer_lo_max = 0x1f;
476   state->textlayer_hi_min = 0x20;
477   state->textlayer_hi_max = 0xff;
643478
644   sys16_18_mode=1;
645   sys16_bg_priority_mode=3;
646   sys16_fg_priority_mode=3;
647   sys16_bg_priority_value=0x1800;
648   sys16_fg_priority_value=0x2000;
649
650
479   state->system18 = 1;
651480}
652481
653482
r7356r7357
668497
669498*****************************************************************************************/
670499
671static tilemap_t *system16a_bootleg_bg_tilemaps[2];
672static tilemap_t *system16a_bootleg_text_tilemap;
673static UINT16 system16a_bootleg_tilemapselect;
674500
675
676static int system16a_bootleg_bgscrolly;
677static int system16a_bootleg_bgscrollx;
678static int system16a_bootleg_fgscrolly;
679static int system16a_bootleg_fgscrollx;
680
681static TILE_GET_INFO( get_system16a_bootleg_tile_infotxt )
501static TILE_GET_INFO( get_s16a_bootleg_tile_infotxt )
682502{
503   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
683504   int data, tile_number;
684505
685   data = sys16_textram[tile_index];
686   tile_number = data&0x1ff;
506   data = state->textram[tile_index];
507   tile_number = data & 0x1ff;
687508
688
689
690
691509   SET_TILE_INFO(
692510         0,
693511         tile_number,
694         ((data>>9)&0x7),
512         ((data >> 9) & 0x7),
695513         0);
696514}
697515
698static TILE_GET_INFO( get_system16a_bootleg_tile_info0 )
516static TILE_GET_INFO( get_s16a_bootleg_tile_info0 )
699517{
518   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
700519   int data, tile_number;
701520
702   data = system16a_bootleg_bg0_tileram[tile_index];
703   tile_number = data&0x1fff;
521   data = state->bg0_tileram[tile_index];
522   tile_number = data & 0x1fff;
704523
705524
706525   SET_TILE_INFO(
707526         0,
708527         tile_number,
709         (data>>6)&0x7f,
528         (data >> 6) & 0x7f,
710529         0);
711530}
712531
713static TILE_GET_INFO( get_system16a_bootleg_tile_info1 )
532static TILE_GET_INFO( get_s16a_bootleg_tile_info1 )
714533{
534   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
715535   int data, tile_number;
716536
717   data = system16a_bootleg_bg1_tileram[tile_index];
718   tile_number = data&0x1fff;
537   data = state->bg1_tileram[tile_index];
538   tile_number = data & 0x1fff;
719539
720540   SET_TILE_INFO(
721541         0,
722542         tile_number,
723         (data>>6)&0x7f,
543         (data >> 6) & 0x7f,
724544         0);
725545}
726546
727WRITE16_HANDLER( system16a_bootleg_bgscrolly_w )
547WRITE16_HANDLER( s16a_bootleg_bgscrolly_w )
728548{
729   system16a_bootleg_bgscrolly = data;
549   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
550   state->bg_scrolly = data;
730551}
731552
732WRITE16_HANDLER( system16a_bootleg_bgscrollx_w )
553WRITE16_HANDLER( s16a_bootleg_bgscrollx_w )
733554{
734   system16a_bootleg_bgscrollx = data;
555   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
556   state->bg_scrollx = data;
735557}
736558
737WRITE16_HANDLER( system16a_bootleg_fgscrolly_w )
559WRITE16_HANDLER( s16a_bootleg_fgscrolly_w )
738560{
739   system16a_bootleg_fgscrolly = data;
561   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
562   state->fg_scrolly = data;
740563}
741564
742WRITE16_HANDLER( system16a_bootleg_fgscrollx_w )
565WRITE16_HANDLER( s16a_bootleg_fgscrollx_w )
743566{
744   system16a_bootleg_fgscrollx = data;
567   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
568   state->fg_scrollx = data;
745569}
746570
747WRITE16_HANDLER( system16a_bootleg_tilemapselect_w )
571WRITE16_HANDLER( s16a_bootleg_tilemapselect_w )
748572{
749   COMBINE_DATA(&system16a_bootleg_tilemapselect);
750   //printf("system16a_bootleg_tilemapselect %04x\n", system16a_bootleg_tilemapselect);
573   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
574
575   COMBINE_DATA(&state->tilemapselect);
576   //printf("system16 bootleg tilemapselect %04x\n", state->tilemapselect);
751577}
752578
753579
754
755VIDEO_START( system16a_bootleg )
580VIDEO_START( s16a_bootleg )
756581{
757   setup_system16_bootleg_video(machine);
582   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
758583
759584   /* Normal colors */
760585   compute_resistor_weights(0, 255, -1.0,
761      6, resistances_normal, weights[0][0], 0, 0,
762      6, resistances_normal, weights[0][1], 0, 0,
763      6, resistances_normal, weights[0][2], 0, 0
586      6, resistances_normal, state->weights[0][0], 0, 0,
587      6, resistances_normal, state->weights[0][1], 0, 0,
588      6, resistances_normal, state->weights[0][2], 0, 0
764589      );
765590
766591   /* Shadow/Highlight colors */
767592   compute_resistor_weights(0, 255, -1.0,
768      6, resistances_sh, weights[1][0], 0, 0,
769      6, resistances_sh, weights[1][1], 0, 0,
770      6, resistances_sh, weights[1][2], 0, 0
593      6, resistances_sh, state->weights[1][0], 0, 0,
594      6, resistances_sh, state->weights[1][1], 0, 0,
595      6, resistances_sh, state->weights[1][2], 0, 0
771596      );
772597
773598
774599
775   system16a_bootleg_text_tilemap = tilemap_create(machine, get_system16a_bootleg_tile_infotxt, tilemap_scan_rows, 8,8, 64,32 );
600   state->text_tilemap = tilemap_create(machine, get_s16a_bootleg_tile_infotxt, tilemap_scan_rows, 8,8, 64,32 );
776601
777602   // the system16a bootlegs have simple tilemaps instead of the paged system
778   system16a_bootleg_bg_tilemaps[0] = tilemap_create(machine, get_system16a_bootleg_tile_info0, tilemap_scan_rows, 8,8, 64,32 );
779   system16a_bootleg_bg_tilemaps[1] = tilemap_create(machine, get_system16a_bootleg_tile_info1, tilemap_scan_rows, 8,8, 64,32 );
603   state->bg_tilemaps[0] = tilemap_create(machine, get_s16a_bootleg_tile_info0, tilemap_scan_rows, 8,8, 64,32 );
604   state->bg_tilemaps[1] = tilemap_create(machine, get_s16a_bootleg_tile_info1, tilemap_scan_rows, 8,8, 64,32 );
780605
781   tilemap_set_transparent_pen( system16a_bootleg_text_tilemap, 0 );
782   tilemap_set_transparent_pen( system16a_bootleg_bg_tilemaps[0], 0 );
783   tilemap_set_transparent_pen( system16a_bootleg_bg_tilemaps[1], 0 );
606   tilemap_set_transparent_pen(state->text_tilemap, 0);
607   tilemap_set_transparent_pen(state->bg_tilemaps[0], 0);
608   tilemap_set_transparent_pen(state->bg_tilemaps[1], 0);
784609
785610   segaic16_palette_init(0x800);
786611
787612}
788613
789VIDEO_START( system16a_bootleg_wb3bl )
614VIDEO_START( s16a_bootleg_wb3bl )
790615{
791   VIDEO_START_CALL(system16a_bootleg);
792   segaic16_sprites_init(machine, 0, SEGAIC16_SPRITES_16A_BOOTLEG_WB3BL, 0x400, system16_bootleg_sprite_xoffs);
616   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
617
618   VIDEO_START_CALL(s16a_bootleg);
619   segaic16_sprites_init(machine, 0, SEGAIC16_SPRITES_16A_BOOTLEG_WB3BL, 0x400, state->sprite_xoffs);
793620   setup_system16_bootleg_spritebanking(machine);
794621}
795622
796VIDEO_START( system16a_bootleg_shinobi )
623VIDEO_START( s16a_bootleg_shinobi )
797624{
798   VIDEO_START_CALL(system16a_bootleg);
799   segaic16_sprites_init(machine, 0, SEGAIC16_SPRITES_16A_BOOTLEG_SHINOBLD, 0x400, system16_bootleg_sprite_xoffs);
625   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
626
627   VIDEO_START_CALL(s16a_bootleg);
628   segaic16_sprites_init(machine, 0, SEGAIC16_SPRITES_16A_BOOTLEG_SHINOBLD, 0x400, state->sprite_xoffs);
800629   setup_system16_bootleg_spritebanking(machine);
801630}
802631
803VIDEO_START( system16a_bootleg_passsht )
632VIDEO_START( s16a_bootleg_passsht )
804633{
805   VIDEO_START_CALL(system16a_bootleg);
806   segaic16_sprites_init(machine, 0, SEGAIC16_SPRITES_16A_BOOTLEG_PASSHTBL, 0x400, system16_bootleg_sprite_xoffs);
634   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
635
636   VIDEO_START_CALL(s16a_bootleg);
637   segaic16_sprites_init(machine, 0, SEGAIC16_SPRITES_16A_BOOTLEG_PASSHTBL, 0x400, state->sprite_xoffs);
807638   setup_system16_bootleg_spritebanking(machine);
808639}
809640
810641// Passing Shot (2 player), Shinobi (Datsu), Wonderboy 3
811VIDEO_UPDATE( system16a_bootleg )
642VIDEO_UPDATE( s16a_bootleg )
812643{
813   int offset_txtx, offset_txty, offset_bg1x, offset_bg1y, offset_bg0x, offset_bg0y;
644   segas1x_bootleg_state *state = (segas1x_bootleg_state *)screen->machine->driver_data;
814645
815646   // passing shot
816   offset_txtx = 192;
817   offset_txty = 0;
818   offset_bg1x = 190;
819   offset_bg1y = 0;
820   offset_bg0x = 187;
821   offset_bg0y = 0;
647   int offset_txtx = 192;
648   int offset_txty = 0;
649   int offset_bg1x = 190;
650   int offset_bg1y = 0;
651   int offset_bg0x = 187;
652   int offset_bg0y = 0;
822653
823   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
654   bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
824655
825656   // I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better
826   tilemap_mark_all_tiles_dirty (system16a_bootleg_bg_tilemaps[0]);
827   tilemap_mark_all_tiles_dirty (system16a_bootleg_bg_tilemaps[1]);
828   tilemap_mark_all_tiles_dirty (system16a_bootleg_text_tilemap);
657   tilemap_mark_all_tiles_dirty(state->bg_tilemaps[0]);
658   tilemap_mark_all_tiles_dirty(state->bg_tilemaps[1]);
659   tilemap_mark_all_tiles_dirty(state->text_tilemap);
829660
830   tilemap_set_scrollx( system16a_bootleg_text_tilemap, 0, offset_txtx );
831   tilemap_set_scrolly( system16a_bootleg_text_tilemap, 0, offset_txty );
661   tilemap_set_scrollx(state->text_tilemap, 0, offset_txtx);
662   tilemap_set_scrolly(state->text_tilemap, 0, offset_txty);
832663
833   if ((system16a_bootleg_tilemapselect&0xff) == 0x12)
664   if ((state->tilemapselect & 0xff) == 0x12)
834665   {
835      tilemap_set_scrollx( system16a_bootleg_bg_tilemaps[1], 0, system16a_bootleg_bgscrollx+offset_bg1x );
836      tilemap_set_scrolly( system16a_bootleg_bg_tilemaps[1], 0, system16a_bootleg_bgscrolly+offset_bg1y+system16_bootleg_back_tilemap_yscroll );
837      tilemap_set_scrollx( system16a_bootleg_bg_tilemaps[0], 0, system16a_bootleg_fgscrollx+offset_bg0x );
838      tilemap_set_scrolly( system16a_bootleg_bg_tilemaps[0], 0, system16a_bootleg_fgscrolly+offset_bg0y+system16_bootleg_fore_tilemap_yscroll );
666      tilemap_set_scrollx(state->bg_tilemaps[1], 0, state->bg_scrollx + offset_bg1x);
667      tilemap_set_scrolly(state->bg_tilemaps[1], 0, state->bg_scrolly + offset_bg1y + state->back_yscroll);
668      tilemap_set_scrollx(state->bg_tilemaps[0], 0, state->fg_scrollx + offset_bg0x);
669      tilemap_set_scrolly(state->bg_tilemaps[0], 0, state->fg_scrolly + offset_bg0y + state->fore_yscroll);
839670
840      tilemap_draw( bitmap,cliprect, system16a_bootleg_bg_tilemaps[0], TILEMAP_DRAW_OPAQUE, 0 );
841      tilemap_draw( bitmap,cliprect, system16a_bootleg_bg_tilemaps[1], 0, 0 );
671      tilemap_draw(bitmap, cliprect, state->bg_tilemaps[0], TILEMAP_DRAW_OPAQUE, 0);
672      tilemap_draw(bitmap, cliprect, state->bg_tilemaps[1], 0, 0);
842673
843      tilemap_set_scrolly( system16a_bootleg_text_tilemap, 0, system16_bootleg_text_tilemap_yscroll );
674      tilemap_set_scrolly(state->text_tilemap, 0, state->text_yscroll);
844675
845      tilemap_draw( bitmap,cliprect, system16a_bootleg_text_tilemap, 0, 0 );
676      tilemap_draw(bitmap, cliprect, state->text_tilemap, 0, 0);
846677   }
847   else if ((system16a_bootleg_tilemapselect&0xff) == 0x21)
678   else if ((state->tilemapselect & 0xff) == 0x21)
848679   {
849      tilemap_set_scrollx( system16a_bootleg_bg_tilemaps[0], 0, system16a_bootleg_bgscrollx+187 );
850      tilemap_set_scrolly( system16a_bootleg_bg_tilemaps[0], 0, system16a_bootleg_bgscrolly+system16_bootleg_back_tilemap_yscroll );
851      tilemap_set_scrollx( system16a_bootleg_bg_tilemaps[1], 0, system16a_bootleg_fgscrollx+187 );
852      tilemap_set_scrolly( system16a_bootleg_bg_tilemaps[1], 0, system16a_bootleg_fgscrolly+1+system16_bootleg_fore_tilemap_yscroll );
680      tilemap_set_scrollx(state->bg_tilemaps[0], 0, state->bg_scrollx + 187 );
681      tilemap_set_scrolly(state->bg_tilemaps[0], 0, state->bg_scrolly + state->back_yscroll );
682      tilemap_set_scrollx(state->bg_tilemaps[1], 0, state->fg_scrollx + 187 );
683      tilemap_set_scrolly(state->bg_tilemaps[1], 0, state->fg_scrolly + 1 + state->fore_yscroll );
853684
854      tilemap_draw( bitmap,cliprect, system16a_bootleg_bg_tilemaps[1], TILEMAP_DRAW_OPAQUE, 0 );
855      tilemap_draw( bitmap,cliprect, system16a_bootleg_bg_tilemaps[0], 0, 0 );
685      tilemap_draw(bitmap, cliprect, state->bg_tilemaps[1], TILEMAP_DRAW_OPAQUE, 0);
686      tilemap_draw(bitmap, cliprect, state->bg_tilemaps[0], 0, 0);
856687
857      tilemap_set_scrolly( system16a_bootleg_text_tilemap, 0, system16_bootleg_text_tilemap_yscroll );
688      tilemap_set_scrolly(state->text_tilemap, 0, state->text_yscroll);
858689
859      tilemap_draw( bitmap,cliprect, system16a_bootleg_text_tilemap, 0, 0 );
690      tilemap_draw(bitmap, cliprect, state->text_tilemap, 0, 0);
860691   }
861692
862693   /* draw the sprites */
r7356r7357
866697}
867698
868699/* The Passing Shot 4 Player bootleg has weird scroll registers (different offsets, ^0x7 xor) */
869VIDEO_UPDATE( system16a_bootleg_passht4b )
700VIDEO_UPDATE( s16a_bootleg_passht4b )
870701{
871   int offset_txtx, offset_txty, offset_bg1x, offset_bg1y, offset_bg0x, offset_bg0y;
702   segas1x_bootleg_state *state = (segas1x_bootleg_state *)screen->machine->driver_data;
872703
873704   // passing shot
874   offset_txtx = 192;
875   offset_txty = 0;
876   offset_bg1x = 3;
877   offset_bg1y = 32;
878   offset_bg0x = 5;
879   offset_bg0y = 32;
705   int offset_txtx = 192;
706   int offset_txty = 0;
707   int offset_bg1x = 3;
708   int offset_bg1y = 32;
709   int offset_bg0x = 5;
710   int offset_bg0y = 32;
880711
881   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
712   bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
882713
883714   // I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better
884   tilemap_mark_all_tiles_dirty (system16a_bootleg_bg_tilemaps[0]);
885   tilemap_mark_all_tiles_dirty (system16a_bootleg_bg_tilemaps[1]);
886   tilemap_mark_all_tiles_dirty (system16a_bootleg_text_tilemap);
715   tilemap_mark_all_tiles_dirty(state->bg_tilemaps[0]);
716   tilemap_mark_all_tiles_dirty(state->bg_tilemaps[1]);
717   tilemap_mark_all_tiles_dirty(state->text_tilemap);
887718
888   tilemap_set_scrollx( system16a_bootleg_text_tilemap, 0, offset_txtx );
889   tilemap_set_scrolly( system16a_bootleg_text_tilemap, 0, offset_txty );
719   tilemap_set_scrollx(state->text_tilemap, 0, offset_txtx);
720   tilemap_set_scrolly(state->text_tilemap, 0, offset_txty);
890721
891   if ((system16a_bootleg_tilemapselect&0xff) == 0x12)
722   if ((state->tilemapselect & 0xff) == 0x12)
892723   {
893      tilemap_set_scrollx( system16a_bootleg_bg_tilemaps[1], 0, (system16a_bootleg_bgscrollx^0x7)+offset_bg1x );
894      tilemap_set_scrolly( system16a_bootleg_bg_tilemaps[1], 0, system16a_bootleg_bgscrolly+offset_bg1y );
895      tilemap_set_scrollx( system16a_bootleg_bg_tilemaps[0], 0, (system16a_bootleg_fgscrollx^0x7)+offset_bg0x );
896      tilemap_set_scrolly( system16a_bootleg_bg_tilemaps[0], 0, system16a_bootleg_fgscrolly+offset_bg0y );
724      tilemap_set_scrollx(state->bg_tilemaps[1], 0, (state->bg_scrollx ^ 0x7) + offset_bg1x);
725      tilemap_set_scrolly(state->bg_tilemaps[1], 0, state->bg_scrolly + offset_bg1y);
726      tilemap_set_scrollx(state->bg_tilemaps[0], 0, (state->fg_scrollx ^ 0x7) + offset_bg0x);
727      tilemap_set_scrolly(state->bg_tilemaps[0], 0, state->fg_scrolly + offset_bg0y);
897728
898      tilemap_draw( bitmap,cliprect, system16a_bootleg_bg_tilemaps[0], TILEMAP_DRAW_OPAQUE, 0 );
899      tilemap_draw( bitmap,cliprect, system16a_bootleg_bg_tilemaps[1], 0, 0 );
900      tilemap_draw( bitmap,cliprect, system16a_bootleg_text_tilemap, 0, 0 );
729      tilemap_draw(bitmap, cliprect, state->bg_tilemaps[0], TILEMAP_DRAW_OPAQUE, 0);
730      tilemap_draw(bitmap, cliprect, state->bg_tilemaps[1], 0, 0);
731      tilemap_draw(bitmap, cliprect, state->text_tilemap, 0, 0);
901732   }
902733
903734   /* draw the sprites */
r7356r7357
911742
912743VIDEO_UPDATE( system16 )
913744{
914   if (!sys16_refreshenable)
745   segas1x_bootleg_state *state = (segas1x_bootleg_state *)screen->machine->driver_data;
746
747   if (!state->refreshenable)
915748   {
916749      bitmap_fill(bitmap, cliprect, 0);
917750      return 0;
918751   }
919752
920   update_page();
753   update_page(screen->machine);
921754
922   bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
755   bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
923756
924   tilemap_set_scrollx( background, 0, -320-sys16_bg_scrollx+sys16_bgxoffset );
925   tilemap_set_scrolly( background, 0, -256+sys16_bg_scrolly+system16_bootleg_back_tilemap_yscroll );
926   tilemap_set_scrollx( foreground, 0, -320-sys16_fg_scrollx+sys16_fgxoffset );
927   tilemap_set_scrolly( foreground, 0, -256+sys16_fg_scrolly+system16_bootleg_fore_tilemap_yscroll );
757   tilemap_set_scrollx(state->background, 0, -320 - state->bg_scrollx);
758   tilemap_set_scrolly(state->background, 0, -256 + state->bg_scrolly + state->back_yscroll);
759   tilemap_set_scrollx(state->foreground, 0, -320 - state->fg_scrollx);
760   tilemap_set_scrolly(state->foreground, 0, -256 + state->fg_scrolly + state->fore_yscroll);
928761
929   tilemap_set_scrollx( text_layer, 0, 0 );
930   tilemap_set_scrolly( text_layer, 0, 0+system16_bootleg_text_tilemap_yscroll );
762   tilemap_set_scrollx(state->text_layer, 0, 0);
763   tilemap_set_scrolly(state->text_layer, 0, 0 + state->text_yscroll);
931764
932   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE, 0x00 );
933
934765   /* Background */
766   tilemap_draw(bitmap, cliprect, state->background, TILEMAP_DRAW_OPAQUE, 0x00);
935767
936   if(sys16_bg_priority_mode)
937   {
938      tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE | 1, 0x00 );
939   }
940
941   if( sys16_bg_priority_mode==2 )
942   {
943      tilemap_draw( bitmap,cliprect, background, 1, 0x01 );// body slam (& wrestwar??)
944   }
945   else if ( sys16_bg_priority_mode==1 )
946   {
947      tilemap_draw( bitmap,cliprect, background, 1, 0x03 );// alien syndrome / aurail
948   }
949
950768   /* Foreground */
769   tilemap_draw(bitmap, cliprect, state->foreground, 0, 0x03);
770   tilemap_draw(bitmap, cliprect, state->foreground, 1, 0x07);
951771
952   tilemap_draw( bitmap,cliprect, foreground, 0, 0x03 );
953   tilemap_draw( bitmap,cliprect, foreground, 1, 0x07 );
954772
955
956773   /* Text Layer */
957
958   if( sys16_textlayer_lo_max!=0 )
774   if (state->textlayer_lo_max != 0)
959775   {
960      tilemap_draw( bitmap,cliprect, text_layer, 1, 7 );// needed for Body Slam
776      tilemap_draw(bitmap, cliprect, state->text_layer, 1, 7);// needed for Body Slam
961777   }
962778
963   tilemap_draw( bitmap,cliprect, text_layer, 0, 0xf );
779   tilemap_draw(bitmap, cliprect, state->text_layer, 0, 0xf);
964780
965   //draw_sprites(screen->machine, bitmap,cliprect,0 );
781   //draw_sprites(screen->machine, bitmap, cliprect,0);
966782
967783   /* draw the sprites */
968784   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
r7356r7357
972788
973789VIDEO_UPDATE( system18old )
974790{
975   if (!sys16_refreshenable)
791   segas1x_bootleg_state *state = (segas1x_bootleg_state *)screen->machine->driver_data;
792
793   if (!state->refreshenable)
976794   {
977      bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
795      bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
978796      return 0;
979797   }
980798
981   update_page();
799   update_page(screen->machine);
982800
983   bitmap_fill(screen->machine->priority_bitmap,NULL,0);
984   if(sys18_bg2_active)
985      tilemap_draw( bitmap,cliprect, background2, 0, 0 );
986   else
987      bitmap_fill(bitmap,cliprect,0);
801   bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
988802
989   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE, 0 );
990   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE | 1, 0 );   //??
991   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE | 2, 0 );   //??
992   tilemap_draw( bitmap,cliprect, background, 1, 0x1 );
993   tilemap_draw( bitmap,cliprect, background, 2, 0x3 );
803   bitmap_fill(bitmap,cliprect,0);
994804
995   if(sys18_fg2_active)
996   {
997      tilemap_draw( bitmap,cliprect, foreground2, 0, 0x3 );
998   }
805   tilemap_draw(bitmap, cliprect, state->background, TILEMAP_DRAW_OPAQUE, 0);
806   tilemap_draw(bitmap, cliprect, state->background, TILEMAP_DRAW_OPAQUE | 1, 0);   //??
807   tilemap_draw(bitmap, cliprect, state->background, TILEMAP_DRAW_OPAQUE | 2, 0);   //??
808   tilemap_draw(bitmap, cliprect, state->background, 1, 0x1);
809   tilemap_draw(bitmap, cliprect, state->background, 2, 0x3);
999810
1000   tilemap_draw( bitmap,cliprect, foreground, 0, 0x3 );
811   tilemap_draw(bitmap, cliprect, state->foreground, 0, 0x3);
812   tilemap_draw(bitmap, cliprect, state->foreground, 1, 0x7);
1001813
1002   if(sys18_fg2_active)
1003   {
1004      tilemap_draw( bitmap,cliprect, foreground2, 1, 0x7 );
1005   }
814   tilemap_draw(bitmap, cliprect, state->text_layer, 1, 0x7);
815   tilemap_draw(bitmap, cliprect, state->text_layer, 0, 0xf);
1006816
1007   tilemap_draw( bitmap,cliprect, foreground, 1, 0x7 );
1008
1009   tilemap_draw( bitmap,cliprect, text_layer, 1, 0x7 );
1010   tilemap_draw( bitmap,cliprect, text_layer, 0, 0xf );
1011
1012817   /* draw the sprites */
1013818   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
1014819
src/mame/video/cps1.c
r7356r7357
13101310   {"rockmanj", CPS_B_21_DEF, mapper_RCM63B },
13111311   {"pnickj",   CPS_B_21_DEF, mapper_pnickj },
13121312   {"pang3",    CPS_B_21_DEF, mapper_pang3 },   /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */
1313   {"pang3j",   CPS_B_21_DEF, mapper_pang3 },   /* EEPROM port is among the CPS registers (handled by DRIVER_INIT) */
1313   {"pang3n",   CPS_B_21_DEF, mapper_pang3 },   /* ^^ */
1314   {"pang3j",   CPS_B_21_DEF, mapper_pang3 },   /* ^^ */
13141315   #ifdef MESS
13151316   {"sfzch",    CPS_B_21_DEF, mapper_sfzch },
13161317   #endif
src/mame/video/snes.c
r7356r7357
158158
159159      if (snes_ppu.sub_add_mode) /* SNES_SUBSCREEN*/
160160      {
161         switch (snes_ppu.color_modes & 0x80)
161         if ((snes_ppu.color_modes & 0x80) == 0x00)
162162         {
163         case 0x00:   /* add */
163            /* add */
164164            r = (*colour & 0x1f) + (scanlines[SNES_SUBSCREEN].buffer[offset] & 0x1f);
165165            g = ((*colour & 0x3e0) >> 5) + ((scanlines[SNES_SUBSCREEN].buffer[offset] & 0x3e0) >> 5);
166166            b = ((*colour & 0x7c00) >> 10) + ((scanlines[SNES_SUBSCREEN].buffer[offset] & 0x7c00) >> 10);
167167            clip_max = 1;
168            break;
169         case 0x80:   /* sub */
168         }
169         else
170         {
171            /* 0x80 sub */
170172            r = (*colour & 0x1f) - (scanlines[SNES_SUBSCREEN].buffer[offset] & 0x1f);
171173            g = ((*colour & 0x3e0) >> 5) - ((scanlines[SNES_SUBSCREEN].buffer[offset] & 0x3e0) >> 5);
172174            b = ((*colour & 0x7c00) >> 10) - ((scanlines[SNES_SUBSCREEN].buffer[offset] & 0x7c00) >> 10);
173175            if (r > 0x1f) r = 0;
174176            if (g > 0x1f) g = 0;
175177            if (b > 0x1f) b = 0;
176            break;
177178         }
178179         /* only halve if the color is not the back colour */
179180         if ((snes_ppu.color_modes & 0x40) && (scanlines[SNES_SUBSCREEN].buffer[offset] != snes_cgram[FIXED_COLOUR]))
r7356r7357
185186      }
186187      else /* Fixed colour */
187188      {
188         switch (snes_ppu.color_modes & 0x80)
189         if ((snes_ppu.color_modes & 0x80) == 0x00)
189190         {
190         case 0x00:   /* add */
191            /* add */
191192            r = (*colour & 0x1f) + (snes_cgram[FIXED_COLOUR] & 0x1f);
192193            g = ((*colour & 0x3e0) >> 5) + ((snes_cgram[FIXED_COLOUR] & 0x3e0) >> 5);
193194            b = ((*colour & 0x7c00) >> 10) + ((snes_cgram[FIXED_COLOUR] & 0x7c00) >> 10);
194195            clip_max = 1;
195            break;
196         case 0x80:   /* sub */
196         }
197         else
198         {
199            /* 0x80: sub */
197200            r = (*colour & 0x1f) - (snes_cgram[FIXED_COLOUR] & 0x1f);
198201            g = ((*colour & 0x3e0) >> 5) - ((snes_cgram[FIXED_COLOUR] & 0x3e0) >> 5);
199202            b = ((*colour & 0x7c00) >> 10) - ((snes_cgram[FIXED_COLOUR] & 0x7c00) >> 10);
200203            if (r > 0x1f) r = 0;
201204            if (g > 0x1f) g = 0;
202205            if (b > 0x1f) b = 0;
203            break;
204206         }
205207         /* halve if necessary */
206208         if (snes_ppu.color_modes & 0x40)
src/mame/video/8080bw.c
r7356r7357
218218}
219219
220220
221VIDEO_UPDATE( schasrcv )
221VIDEO_UPDATE( schasercv )
222222{
223223   mw8080bw_state *state = (mw8080bw_state *)screen->machine->driver_data;
224224   pen_t pens[NUM_PENS];
src/mame/video/konamiic.c
r7356r7357
308308control registers
309309000:          scroll x (low 8 bits)
310310001: -------x scroll x (high bit)
311     ------x- enable rowscroll? (combasc)
311     ------x- enable rowscroll? (combatsc)
312312     ----x--- this probably selects an alternate screen layout used in combat
313313              school where tilemap #2 is overlayed on front and doesn't scroll.
314314              The 32 lines of the front layer can be individually turned on or
r7356r7357
332332     --x----- might be sprite / tilemap priority (0 = sprites have priority)
333333              (combat school, contra, haunted castle(0/1), labyrunr)
334334     -x------ Chops away the leftmost and rightmost columns, switching the
335              visible area from 256 to 240 pixels. This is used by combasc on
335              visible area from 256 to 240 pixels. This is used by combatsc on
336336              the scrolling stages, and by labyrunr on the title screen.
337337              At first I thought that this enabled an extra bank of 0x40
338              sprites, needed by combasc, but labyrunr proves that this is not
338              sprites, needed by combatsc, but labyrunr proves that this is not
339339              the case
340340     x------- unknown (contra)
341341004: ----xxxx bits 9-12 of the tile code. Only the bits enabled by the following
r7356r7357
355355              same ones indexed by register 005). Note that an attribute bit
356356              can therefore be used at the same time to be BOTH a tile code bit
357357              and an additional effect.
358     -------x bit 3 of attribute is bit 3 of color (combasc, fastlane, flkatck)
358     -------x bit 3 of attribute is bit 3 of color (combatsc, fastlane, flkatck)
359359     ------x- bit 4 of attribute is tile flip X (assumption - no game uses this)
360360     -----x-- bit 5 of attribute is tile flip Y (flkatck)
361     ----x--- bit 6 of attribute is tile priority over sprites (combasc, hcastle,
361     ----x--- bit 6 of attribute is tile priority over sprites (combatsc, hcastle,
362362              labyrunr)
363363              Note that hcastle sets this bit for layer 0, and bit 6 of the
364364              attribute is also used as bit 12 of the tile code, however that
365365              bit is ALWAYS set throughout the game.
366              combasc uses the bit in the "graduation" scene during attract mode,
366              combatsc uses the bit in the "graduation" scene during attract mode,
367367              to place soldiers behind the stand.
368368              Use in labyrunr has not been investigated yet.
369369     --xx---- palette bank (both tiles and sprites, see contra)
r7356r7357
13331333   }
13341334   else   /* all others */
13351335   {
1336      //num = (K007121_ctrlram[chip][0x03] & 0x40) ? 0x80 : 0x40; /* WRONG!!! (needed by combasc)  */
1337      num = 0x40; // Combasc writes 70 sprites to VRAM at peak but the chip only processes the first 64.
1336      //num = (K007121_ctrlram[chip][0x03] & 0x40) ? 0x80 : 0x40; /* WRONG!!! (needed by combatsc)  */
1337      num = 0x40; // combatsc writes 70 sprites to VRAM at peak but the chip only processes the first 64.
13381338
13391339      inc = 5;
13401340      offs[0] = 0x00;
src/mame/video/cyberbal.c
r7356r7357
191191}
192192
193193
194VIDEO_START( cyberb2p )
194VIDEO_START( cyberbal2p )
195195{
196196   video_start_cyberbal_common(machine, 1);
197197
src/mame/video/konicdev.c
r7356r7357
308308control registers
309309000:          scroll x (low 8 bits)
310310001: -------x scroll x (high bit)
311     ------x- enable rowscroll? (combasc)
311     ------x- enable rowscroll? (combatsc)
312312     ----x--- this probably selects an alternate screen layout used in combat
313313              school where tilemap #2 is overlayed on front and doesn't scroll.
314314              The 32 lines of the front layer can be individually turned on or
r7356r7357
332332     --x----- might be sprite / tilemap priority (0 = sprites have priority)
333333              (combat school, contra, haunted castle(0/1), labyrunr)
334334     -x------ Chops away the leftmost and rightmost columns, switching the
335              visible area from 256 to 240 pixels. This is used by combasc on
335              visible area from 256 to 240 pixels. This is used by combatsc on
336336              the scrolling stages, and by labyrunr on the title screen.
337337              At first I thought that this enabled an extra bank of 0x40
338              sprites, needed by combasc, but labyrunr proves that this is not
338              sprites, needed by combatsc, but labyrunr proves that this is not
339339              the case
340340     x------- unknown (contra)
341341004: ----xxxx bits 9-12 of the tile code. Only the bits enabled by the following
r7356r7357
355355              same ones indexed by register 005). Note that an attribute bit
356356              can therefore be used at the same time to be BOTH a tile code bit
357357              and an additional effect.
358     -------x bit 3 of attribute is bit 3 of color (combasc, fastlane, flkatck)
358     -------x bit 3 of attribute is bit 3 of color (combatsc, fastlane, flkatck)
359359     ------x- bit 4 of attribute is tile flip X (assumption - no game uses this)
360360     -----x-- bit 5 of attribute is tile flip Y (flkatck)
361     ----x--- bit 6 of attribute is tile priority over sprites (combasc, hcastle,
361     ----x--- bit 6 of attribute is tile priority over sprites (combatsc, hcastle,
362362              labyrunr)
363363              Note that hcastle sets this bit for layer 0, and bit 6 of the
364364              attribute is also used as bit 12 of the tile code, however that
365365              bit is ALWAYS set throughout the game.
366              combasc uses the bit in the "graduation" scene during attract mode,
366              combatsc uses the bit in the "graduation" scene during attract mode,
367367              to place soldiers behind the stand.
368368              Use in labyrunr has not been investigated yet.
369369     --xx---- palette bank (both tiles and sprites, see contra)
r7356r7357
14551455   }
14561456   else   /* all others */
14571457   {
1458      //num = (k007121->ctrlram[0x03] & 0x40) ? 0x80 : 0x40; /* WRONG!!! (needed by combasc)  */
1459      num = 0x40; // Combasc writes 70 sprites to VRAM at peak but the chip only processes the first 64.
1458      //num = (k007121->ctrlram[0x03] & 0x40) ? 0x80 : 0x40; /* WRONG!!! (needed by combatsc)  */
1459      num = 0x40; // combatsc writes 70 sprites to VRAM at peak but the chip only processes the first 64.
14601460
14611461      inc = 5;
14621462      offs[0] = 0x00;
r7356r7357
1012210122}
1012310123
1012410124
10125// from drivers/nwk-tr
10126
1012710125/***************************************************************************/
1012810126/*                                                                         */
1012910127/*                                  001604                                 */
r7356r7357
1034110339
1034210340READ32_DEVICE_HANDLER( k001604_tile_r )
1034310341{
10344//  int chip = get_cgboard_id();
1034510342   k001604_state *k001604 = k001604_get_safe_token(device);
1034610343
1034710344   return k001604->tile_ram[offset];
r7356r7357
1034910346
1035010347READ32_DEVICE_HANDLER( k001604_char_r )
1035110348{
10352//  int chip = get_cgboard_id();
1035310349   k001604_state *k001604 = k001604_get_safe_token(device);
1035410350
1035510351   int set, bank;
r7356r7357
1036710363   return k001604->char_ram[addr];
1036810364}
1036910365
10366READ32_DEVICE_HANDLER( k001604_reg_r )
10367{
10368   k001604_state *k001604 = k001604_get_safe_token(device);
10369
10370   switch (offset)
10371   {
10372      case 0x54/4:   return mame_rand(device->machine) << 16; break;
10373      case 0x5c/4:   return mame_rand(device->machine) << 16 | mame_rand(device->machine); break;
10374   }
10375
10376   return k001604->reg[offset];
10377}
10378
1037010379WRITE32_DEVICE_HANDLER( k001604_tile_w )
1037110380{
10372//  int chip = get_cgboard_id();
1037310381   k001604_state *k001604 = k001604_get_safe_token(device);
1037410382
1037510383   int x, y;
r7356r7357
1042210430
1042310431WRITE32_DEVICE_HANDLER( k001604_char_w )
1042410432{
10425//  int chip = get_cgboard_id();
1042610433   k001604_state *k001604 = k001604_get_safe_token(device);
1042710434
1042810435   int set, bank;
r7356r7357
1044510452
1044610453WRITE32_DEVICE_HANDLER( k001604_reg_w )
1044710454{
10448//  int chip = get_cgboard_id();
1044910455   k001604_state *k001604 = k001604_get_safe_token(device);
1045010456
1045110457   COMBINE_DATA(k001604->reg + offset);
r7356r7357
1046510471   }
1046610472}
1046710473
10468READ32_DEVICE_HANDLER( k001604_reg_r )
10469{
10470//  int chip = get_cgboard_id();
10471   k001604_state *k001604 = k001604_get_safe_token(device);
1047210474
10473   switch (offset)
10474   {
10475      case 0x54/4:   return mame_rand(device->machine) << 16; break;
10476      case 0x5c/4:   return mame_rand(device->machine) << 16 | mame_rand(device->machine); break;
10477   }
10478
10479   return k001604->reg[offset];
10480}
10481
10482
1048310475/*****************************************************************************
1048410476    DEVICE INTERFACE
1048510477*****************************************************************************/
r7356r7357
1066810660
1066910661READ32_DEVICE_HANDLER( k037122_sram_r )
1067010662{
10671//  int chip = get_cgboard_id();
1067210663   k037122_state *k037122 = k037122_get_safe_token(device);
1067310664
1067410665   return k037122->tile_ram[offset];
r7356r7357
1067610667
1067710668WRITE32_DEVICE_HANDLER( k037122_sram_w )
1067810669{
10679//  int chip = get_cgboard_id();
1068010670   k037122_state *k037122 = k037122_get_safe_token(device);
1068110671
1068210672   COMBINE_DATA(k037122->tile_ram + offset);
r7356r7357
1071610706
1071710707READ32_DEVICE_HANDLER( k037122_char_r )
1071810708{
10719//  int chip = get_cgboard_id();
1072010709   k037122_state *k037122 = k037122_get_safe_token(device);
1072110710   int bank = k037122->reg[0x30 / 4] & 0x7;
1072210711
r7356r7357
1072510714
1072610715WRITE32_DEVICE_HANDLER( k037122_char_w )
1072710716{
10728//  int chip = get_cgboard_id();
1072910717   k037122_state *k037122 = k037122_get_safe_token(device);
1073010718   int bank = k037122->reg[0x30 / 4] & 0x7;
1073110719   UINT32 addr = offset + (bank * (0x40000/4));
r7356r7357
1073610724
1073710725READ32_DEVICE_HANDLER( k037122_reg_r )
1073810726{
10739//  int chip = get_cgboard_id();
1074010727   k037122_state *k037122 = k037122_get_safe_token(device);
1074110728
1074210729   switch (offset)
r7356r7357
1075110738
1075210739WRITE32_DEVICE_HANDLER( k037122_reg_w )
1075310740{
10754//  int chip = get_cgboard_id();
1075510741   k037122_state *k037122 = k037122_get_safe_token(device);
1075610742
1075710743   COMBINE_DATA(k037122->reg + offset);
src/mame/video/segas16a.c
r7356r7357
55***************************************************************************/
66
77#include "emu.h"
8#include "segaic16.h"
9#include "includes/system16.h"
8#include "video/segaic16.h"
9#include "includes/segas16.h"
1010
1111
1212
src/mame/video/segahang.c
r7356r7357
55***************************************************************************/
66
77#include "emu.h"
8#include "segaic16.h"
9#include "includes/system16.h"
8#include "video/segaic16.h"
9#include "includes/segas16.h"
1010
1111
1212
src/mame/video/hng64.c
r7356r7357
11101110   }
11111111
11121112   // xrally's pink tilemaps make me think this is a tilemap enable bit.
1113   // pretty much every other game makes me think otherwise.
1113   // fatfurwa makes me think otherwise.
11141114   //if (!(tileregs & 0x0040)) return;
11151115
11161116   // set the transmask so our manual copy is correct
r7356r7357
16801680   INT8 texIndex;            // Which texture to draw from (0x00-0x0f)
16811681   INT8 texType;            // How to index into the texture
16821682   UINT32 palOffset;         // The base offset where this object's palette starts.
1683   UINT32 palPageSize;         // The size of the palette page that is being pointed to.
16831684
16841685   UINT32 debugColor;         // Will go away someday.  Used to explicitly color polygons for debugging.
16851686};
r7356r7357
18951896   struct polygon lastPoly = { 0 };
18961897   const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
18971898
1898
18991899   /////////////////
19001900   // HEADER INFO //
19011901   /////////////////
r7356r7357
19491949    // [20] - ???? always 0 ????
19501950    //////////////////////////////////////////////*/
19511951
1952   // Debug - ajg
1953   //UINT32 tdColor = 0xff000000;
1954   //if (packet[1] & 0x1000)   tdColor |= 0x00ff0000;
1955   //if (packet[1] & 0x2000)   tdColor |= 0x0000ff00;
1956   //if (packet[1] & 0x4000)   tdColor |= 0x000000ff;
1957   //if (packet[1] & 0x8000)   tdColor |= 0xffffffff;
1958
19591952   // 3d ROM Offset
19601953   UINT16* threeDRoms = (UINT16*)(memory_region(machine, "verts"));
19611954   UINT32  threeDOffset = (((UINT32)packet[2]) << 16) | ((UINT32)packet[3]);
r7356r7357
19681961      return;
19691962   }
19701963
1971   /*
1964/*
19721965    // Debug - ajg
19731966    printf("%08x : ", threeDOffset*3*2);
19741967    for (int k = 0; k < 7*3; k++)
r7356r7357
19771970        if ((k % 3) == 2) printf(" ");
19781971    }
19791972    printf("\n");
1980    }
1981    */
1973*/
19821974
19831975   // There are 4 hunks per address.
19841976   address[0] = threeDPointer[0];
r7356r7357
20152007   address[2] |= (megaOffset << 16);
20162008   address[3] |= (megaOffset << 16);
20172009
2010   // Debug - ajg
2011   //UINT32 tdColor = 0xff000000;
2012   //if (threeDPointer[14] & 0x0002) tdColor |= 0x00ff0000;
2013   //if (threeDPointer[14] & 0x0001) tdColor |= 0x0000ff00;
2014   //if (threeDPointer[14] & 0x0000) tdColor |= 0x000000ff;
2015
20182016   /* For all 4 polygon chunks */
20192017   for (int k = 0; k < 4; k++)
20202018   {
r7356r7357
20552053         //break;
20562054
20572055         // TEXTURE
2058         /* The current thought is there may be more than just high & low res texture types, so I'm keeping texType as a UINT8. */
2056         /* There may be more than just high & low res texture types, so I'm keeping texType as a UINT8. */
20592057         if (chunkOffset[1] & 0x1000) polys[*numPolys].texType = 0x1;
20602058         else                   polys[*numPolys].texType = 0x0;
20612059
r7356r7357
20642062
20652063         // PALETTE
20662064         polys[*numPolys].palOffset = 0;
2065         polys[*numPolys].palPageSize = 0x100;
20672066
2068         /* FIXME: This really isn't correct - commenting out this line fixes the palette in roadedge snk intro */
2067         /* FIXME: This isn't correct.
2068                      Buriki & Xrally need this line.  Roads Edge needs it removed.
2069                      So instead we're looking for a bit that is on for XRally & Buriki, but noone else. */
20692070         if (hng64_3dregs[0x00/4] & 0x2000)
20702071         {
20712072            polys[*numPolys].palOffset += 0x800;
20722073         }
20732074
2074         // Apply the dynamic palette offset if its flag is set, otherwise use the fixed one from the ROM
2075         //UINT16 explicitPaletteValue0 = ((chunkOffset[?] & 0x????) >> ?) * 0x800;
2076         UINT16 explicitPaletteValue1 = ((chunkOffset[1] & 0x0f00) >> 8) * 0x080;
2077         UINT16 explicitPaletteValue2 = ((chunkOffset[1] & 0x00f0) >> 4) * 0x008;
2078
2079         // The presence of 0x00f0 *probably* sets 0x10-sized palette addressing.
2080         if (explicitPaletteValue2) polys[*numPolys].palPageSize = 0x10;
2081
2082         // Apply the dynamic palette offset if its flag is set, otherwise stick with the fixed one
20752083         if ((packet[1] & 0x0100))
20762084         {
2077            polys[*numPolys].palOffset += paletteState3d * 0x80;
2078            /* TODO: Does the explicit palette bit do anything when the dynamic palette flag is on? */
2079         }
2080         else
2081         {
2082            UINT8 explicitPaletteValue = (chunkOffset[1] & 0x0f00) >> 8;
2083            polys[*numPolys].palOffset += explicitPaletteValue * 0x80;
2084         }
2085            explicitPaletteValue1 = paletteState3d * 0x80;
2086            explicitPaletteValue2 = 0;      // This is probably hiding somewhere in operation 0011
2087            }
20852088
2089         polys[*numPolys].palOffset += (explicitPaletteValue1 + explicitPaletteValue2);
2090
2091
2092
20862093         UINT8 chunkLength = 0;
20872094         switch(chunkType)
20882095         {
r7356r7357
21192126               polys[*numPolys].vert[m].normal[1] = uToF(chunkOffset[10 + (9*m)] );
21202127               polys[*numPolys].vert[m].normal[2] = uToF(chunkOffset[11 + (9*m)] );
21212128               polys[*numPolys].vert[m].normal[3] = 0.0f;
2122
2123               // !!! DUMB !!!
2124               polys[*numPolys].vert[m].light[0] = polys[*numPolys].vert[m].texCoords[0] * 255.0f;
2125               polys[*numPolys].vert[m].light[1] = polys[*numPolys].vert[m].texCoords[1] * 255.0f;
2126               polys[*numPolys].vert[m].light[2] = polys[*numPolys].vert[m].texCoords[2] * 255.0f;
21272129            }
21282130
21292131            // Redundantly called, but it works...
r7356r7357
21592161               polys[*numPolys].vert[m].normal[1] = uToF(chunkOffset[22]);
21602162               polys[*numPolys].vert[m].normal[2] = uToF(chunkOffset[23]);
21612163               polys[*numPolys].vert[m].normal[3] = 0.0f;
2162
2163               // !!! DUMB !!!
2164               polys[*numPolys].vert[m].light[0] = polys[*numPolys].vert[m].texCoords[0] * 255.0f;
2165               polys[*numPolys].vert[m].light[1] = polys[*numPolys].vert[m].texCoords[1] * 255.0f;
2166               polys[*numPolys].vert[m].light[2] = polys[*numPolys].vert[m].texCoords[2] * 255.0f;
21672164            }
21682165
21692166            // Redundantly called, but it works...
r7356r7357
22032200            polys[*numPolys].vert[0].normal[2] = uToF(chunkOffset[11]);
22042201            polys[*numPolys].vert[0].normal[3] = 0.0f;
22052202
2206            polys[*numPolys].vert[0].light[0] = polys[*numPolys].vert[0].texCoords[0] * 255.0f;
2207            polys[*numPolys].vert[0].light[1] = polys[*numPolys].vert[0].texCoords[1] * 255.0f;
2208            polys[*numPolys].vert[0].light[2] = polys[*numPolys].vert[0].texCoords[2] * 255.0f;
2209
22102203            polys[*numPolys].faceNormal[0] = uToF(chunkOffset[12]);
22112204            polys[*numPolys].faceNormal[1] = uToF(chunkOffset[13]);
22122205            polys[*numPolys].faceNormal[2] = uToF(chunkOffset[14]);
r7356r7357
22382231            polys[*numPolys].vert[0].texCoords[2] = 0.0f;
22392232            polys[*numPolys].vert[0].texCoords[3] = 1.0f;
22402233
2241            // !!! DUMB !!!
2242            polys[*numPolys].vert[0].light[0] = polys[*numPolys].vert[0].texCoords[0] * 255.0f;
2243            polys[*numPolys].vert[0].light[1] = polys[*numPolys].vert[0].texCoords[1] * 255.0f;
2244            polys[*numPolys].vert[0].light[2] = polys[*numPolys].vert[0].texCoords[2] * 255.0f;
2245
22462234            // This normal could be right, but I'm not entirely sure - there is no normal in the 18 bytes!
22472235            polys[*numPolys].vert[0].normal[0] = lastPoly.faceNormal[0];
22482236            polys[*numPolys].vert[0].normal[1] = lastPoly.faceNormal[1];
r7356r7357
28482836/**     Output: none                                                **/
28492837/*********************************************************************/
28502838INLINE void FillSmoothTexPCHorizontalLine(running_machine *machine,
2851                                int textureType, int palOffset, int texIndex, int debugColor,
2839                                int textureType, int palOffset, int palPageSize,
2840                                int texIndex, int debugColor,
28522841                                int x_start, int x_end, int y, float z_start, float z_delta,
28532842                                float w_start, float w_delta, float r_start, float r_delta,
28542843                                float g_start, float g_delta, float b_start, float b_delta,
r7356r7357
28592848
28602849   UINT8 paletteEntry = 0;
28612850   float t_coord, s_coord;
2862   const UINT8 *textureOffset;
28632851   const UINT8 *gfx = memory_region(machine, "textures");
2852   const UINT8 *textureOffset = &gfx[texIndex * 1024 * 1024];
28642853
2865   if (texIndex >= 0)
2866      textureOffset = &gfx[texIndex * 1024 * 1024];
2867   else
2868      textureOffset = 0x00;
2869
28702854   for (; x_start <= x_end; x_start++)
28712855   {
28722856      if (z_start < (*db))
r7356r7357
28752859         t_coord = t_start / w_start;
28762860         s_coord = s_start / w_start;
28772861
2878         // DEBUG COLOR MODE
2879         if (debugColor != 0x00000000)
2862         if ((debugColor & 0xff000000) == 0x01000000)
28802863         {
2864            // UV COLOR MODE
2865            *cb = MAKE_ARGB(255, (UINT8)(s_coord*255.0f), (UINT8)(t_coord*255.0f), (UINT8)(0));
2866            *db = z_start;
2867         }
2868         else if ((debugColor & 0xff000000) == 0x02000000)
2869         {
2870            // Lit
2871            *cb = MAKE_ARGB(255, (UINT8)(r_start/w_start), (UINT8)(g_start/w_start), (UINT8)(b_start/w_start));
2872            *db = z_start;
2873         }
2874         else if ((debugColor & 0xff000000) == 0xff000000)
2875         {
2876            // DEBUG COLOR MODE
28812877            *cb = debugColor;
28822878            *db = z_start;
28832879         }
2884         else if (texIndex >= 0)
2880         else
28852881         {
28862882            // TEXTURED
28872883            if (textureType == 0x0)
r7356r7357
28922888            // Naieve Alpha Implementation (?) - don't draw if you're at texture index 0...
28932889            if (paletteEntry != 0)
28942890            {
2891               paletteEntry %= palPageSize;
2892
28952893               // Greyscale texture test.
28962894               // *cb = MAKE_ARGB(255, (UINT8)paletteEntry, (UINT8)paletteEntry, (UINT8)paletteEntry);
28972895               *cb = machine->pens[palOffset + paletteEntry];
28982896               *db = z_start;
28992897            }
29002898         }
2901         else
2902         {
2903            // UNTEXTURED
2904            *cb = MAKE_ARGB(255, (UINT8)(r_start/w_start), (UINT8)(g_start/w_start), (UINT8)(b_start/w_start));
2905            *db = z_start;
2906         }
29072899      }
29082900      db++;
29092901      cb++;
r7356r7357
29512943                                 float A[4], float B[4], float C[4],
29522944                                 float Ca[3], float Cb[3], float Cc[3], // PER-VERTEX RGB COLORS
29532945                                 float Ta[2], float Tb[2], float Tc[2], // PER-VERTEX (S,T) TEX-COORDS
2954                                 int textureType, int palOffset, int texIndex, int debugColor)
2946                                 int textureType, int palOffset, int palPageSize,
2947                                 int texIndex, int debugColor)
29552948{
29562949   // Get our order of points by increasing y-coord
29572950   float *p_min = ((A[1] <= B[1]) && (A[1] <= C[1])) ? A : ((B[1] <= A[1]) && (B[1] <= C[1])) ? B : C;
r7356r7357
31423135
31433136      // Pass the horizontal line to the filler, this could be put in the routine
31443137      // then interpolate for the next values of x and z
3145      FillSmoothTexPCHorizontalLine(machine, textureType, palOffset, texIndex, debugColor,
3138      FillSmoothTexPCHorizontalLine(machine, textureType, palOffset, palPageSize, texIndex, debugColor,
31463139         x_start, x_end, y_min, z_interp_x, z_delta_x, w_interp_x, w_delta_x,
31473140         r_interp_x, r_delta_x, g_interp_x, g_delta_x, b_interp_x, b_delta_x,
31483141         s_interp_x, s_delta_x, t_interp_x, t_delta_x);
r7356r7357
32223215
32233216      // Pass the horizontal line to the filler, this could be put in the routine
32243217      // then interpolate for the next values of x and z
3225      FillSmoothTexPCHorizontalLine(machine, textureType, palOffset, texIndex, debugColor,
3218      FillSmoothTexPCHorizontalLine(machine, textureType, palOffset, palPageSize, texIndex, debugColor,
32263219         x_start, x_end, y_mid, z_interp_x, z_delta_x, w_interp_x, w_delta_x,
32273220         r_interp_x, r_delta_x, g_interp_x, g_delta_x, b_interp_x, b_delta_x,
32283221         s_interp_x, s_delta_x, t_interp_x, t_delta_x);
r7356r7357
32583251                              p->vert[0].clipCoords, p->vert[j].clipCoords, p->vert[j+1].clipCoords,
32593252                              p->vert[0].light,      p->vert[j].light,      p->vert[j+1].light,
32603253                              p->vert[0].texCoords,  p->vert[j].texCoords,  p->vert[j+1].texCoords,
3261                              p->texType, p->palOffset, p->texIndex, p->debugColor);
3262
3254                              p->texType, p->palOffset, p->palPageSize,
3255                              p->texIndex, p->debugColor);
32633256   }
32643257}
32653258
src/mame/video/segas16b.c
r7356r7357
55***************************************************************************/
66
77#include "emu.h"
8#include "segaic16.h"
9#include "includes/system16.h"
8#include "video/segaic16.h"
9#include "includes/segas16.h"
1010
1111
1212
src/mame/video/megasys1.c
r7356r7357
455455      case 0x100/2   :   megasys1_sprite_flag = new_data;      break;
456456
457457      case 0x300/2   :   megasys1_screen_flag = new_data;
458                     if (new_data & 0x10)
459                        cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE);
460                     else
461                        cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, CLEAR_LINE);
458                     if (devtag_get_device(space->machine, "soundcpu"))
459                     {
460                        if (new_data & 0x10)
461                           cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE);
462                        else
463                           cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, CLEAR_LINE);
464                     }
462465                     break;
463466
464467      case 0x308/2   :   soundlatch_word_w(space,0,new_data,0xffff);
src/mame/video/dec8.c
r7356r7357
182182    }
183183}
184184
185WRITE8_HANDLER( lastmiss_control_w )
185WRITE8_HANDLER( lastmisn_control_w )
186186{
187187   dec8_state *state = (dec8_state *)space->machine->driver_data;
188188
r7356r7357
215215   state->scroll2[2] = (data >> 6) & 1;
216216}
217217
218WRITE8_HANDLER( lastmiss_scrollx_w )
218WRITE8_HANDLER( lastmisn_scrollx_w )
219219{
220220   dec8_state *state = (dec8_state *)space->machine->driver_data;
221221   state->scroll2[1] = data;
222222}
223223
224WRITE8_HANDLER( lastmiss_scrolly_w )
224WRITE8_HANDLER( lastmisn_scrolly_w )
225225{
226226   dec8_state *state = (dec8_state *)space->machine->driver_data;
227227   state->scroll2[3] = data;
r7356r7357
640640
641641/******************************************************************************/
642642
643VIDEO_UPDATE( lastmiss )
643VIDEO_UPDATE( lastmisn )
644644{
645645   dec8_state *state = (dec8_state *)screen->machine->driver_data;
646646   tilemap_set_scrollx(state->pf0_tilemap, 0, ((state->scroll2[0] << 8)+ state->scroll2[1]));
r7356r7357
667667   return 0;
668668}
669669
670static TILEMAP_MAPPER( lastmiss_scan_rows )
670static TILEMAP_MAPPER( lastmisn_scan_rows )
671671{
672672   /* logical (col,row) -> memory offset */
673673   return ((col & 0x0f) + ((row & 0x0f) << 4)) + ((col & 0x10) << 4) + ((row & 0x10) << 5);
674674}
675675
676static TILE_GET_INFO( get_lastmiss_tile_info )
676static TILE_GET_INFO( get_lastmisn_tile_info )
677677{
678678   dec8_state *state = (dec8_state *)machine->driver_data;
679679   int offs = tile_index * 2;
r7356r7357
692692         0);
693693}
694694
695static TILE_GET_INFO( get_lastmiss_fix_tile_info )
695static TILE_GET_INFO( get_lastmisn_fix_tile_info )
696696{
697697   dec8_state *state = (dec8_state *)machine->driver_data;
698698   int offs = tile_index << 1;
r7356r7357
706706         0);
707707}
708708
709VIDEO_START( lastmiss )
709VIDEO_START( lastmisn )
710710{
711711   dec8_state *state = (dec8_state *)machine->driver_data;
712   state->pf0_tilemap = tilemap_create(machine, get_lastmiss_tile_info, lastmiss_scan_rows, 16, 16, 32, 32);
713   state->fix_tilemap = tilemap_create(machine, get_lastmiss_fix_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
712   state->pf0_tilemap = tilemap_create(machine, get_lastmisn_tile_info, lastmisn_scan_rows, 16, 16, 32, 32);
713   state->fix_tilemap = tilemap_create(machine, get_lastmisn_fix_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
714714
715715   tilemap_set_transparent_pen(state->fix_tilemap, 0);
716716   state->game_uses_priority = 0;
r7356r7357
719719VIDEO_START( shackled )
720720{
721721   dec8_state *state = (dec8_state *)machine->driver_data;
722   state->pf0_tilemap = tilemap_create(machine, get_lastmiss_tile_info, lastmiss_scan_rows, 16, 16, 32, 32);
723   state->fix_tilemap = tilemap_create(machine, get_lastmiss_fix_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
722   state->pf0_tilemap = tilemap_create(machine, get_lastmisn_tile_info, lastmisn_scan_rows, 16, 16, 32, 32);
723   state->fix_tilemap = tilemap_create(machine, get_lastmisn_fix_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
724724
725725   tilemap_set_transparent_pen(state->fix_tilemap, 0);
726726   tilemap_set_transmask(state->pf0_tilemap, 0, 0x000f, 0xfff0); /* Bottom 12 pens */
src/mame/video/genesis.c
r7356r7357
11/***********************************************************************************************
22
3    Sega System C/C2 Driver
4    -----------------------
5    Version 0.54 - 02 Feb 2003
6    (for changes see drivers\segac2.c)
3    Old Genesis VDP emulation still used by System 18
4    -------------------------------------------------
75
6    (originally used for Sega System C/C2 Driver, source version 0.54 - 02 Feb 2003)
7
88***********************************************************************************************/
99
1010#include "emu.h"
1111#include "sound/sn76496.h"
12
1312#include "includes/genesis.h"
1413
15
1614static running_device *genesis_screen;
1715
1816
r7356r7357
195193   state_save_register_global(screen->machine, window_vpos);
196194}
197195
198VIDEO_START(genesis)
199{
200   start_genesis_vdp(machine->primary_screen);
201}
202196
203
204VIDEO_START( segac2 )
205{
206   start_genesis_vdp(machine->primary_screen);
207
208   /* C2 has separate sprite/background palettes */
209   genesis_sp_pal_lookup[0] = 0x100;
210   genesis_sp_pal_lookup[1] = 0x110;
211   genesis_sp_pal_lookup[2] = 0x120;
212   genesis_sp_pal_lookup[3] = 0x130;
213}
214
215
216
217
218
219
220197void system18_vdp_start(running_machine *machine)
221198{
222199   start_genesis_vdp(machine->primary_screen);
r7356r7357
243220
244221******************************************************************************/
245222
246/* set the display enable bit */
247void segac2_enable_display(running_machine *machine, int enable)
248{
249   video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen));
250   display_enable = enable;
251}
252
253
254VIDEO_UPDATE( genesis )
255{
256   int y;
257
258   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
259      drawline(BITMAP_ADDR16(bitmap, y, 0), y, 0);
260   return 0;
261}
262
263
264VIDEO_UPDATE( segac2 )
265{
266   if (!display_enable)
267      bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
268   else
269      VIDEO_UPDATE_CALL(genesis);
270   return 0;
271}
272
273
274
275
276/* megaplay, draws either Genesis or SMS (single screen display) */
277
278/* core refresh: computes the final screen */
279#if 0
280VIDEO_UPDATE( megaplay )
281{
282   int y;
283
284
285   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
286      drawline(BITMAP_ADDR16(bitmap, y, 0), y, 0);
287
288   //VIDEO_UPDATE_CALL(megaplay_normal);
289
290   return 0;
291}
292#endif
293
294223void system18_vdp_update( bitmap_t *bitmap, const rectangle *cliprect )
295224{
296225   int y;
src/mame/video/segas18.c
r7356r7357
55***************************************************************************/
66
77#include "emu.h"
8#include "segaic16.h"
8#include "video/segaic16.h"
99#include "includes/genesis.h"
10#include "includes/system16.h"
10#include "includes/segas16.h"
1111
1212
1313
r7356r7357
2020#define DEBUG_VDP            (0)
2121
2222
23
2423/*************************************
2524 *
26 *  Statics
27 *
28 *************************************/
29
30static bitmap_t *tempbitmap;
31
32static UINT8 grayscale_enable;
33static UINT8 vdp_enable;
34static UINT8 vdp_mixing;
35
36
37
38/*************************************
39 *
4025 *  Video startup
4126 *
4227 *************************************/
4328
4429VIDEO_START( system18 )
4530{
31   segas1x_state *state = (segas1x_state *)machine->driver_data;
4632   int width, height;
4733
48   tempbitmap = NULL;
49   grayscale_enable = 0;
50   vdp_enable = 0;
51   vdp_mixing = 0;
34   state->grayscale_enable = 0;
35   state->vdp_enable = 0;
36   state->vdp_mixing = 0;
5237
5338   /* compute palette info */
5439   segaic16_palette_init(0x800);
r7356r7357
6550   /* create a temp bitmap to draw the VDP data into */
6651   width = video_screen_get_width(machine->primary_screen);
6752   height = video_screen_get_height(machine->primary_screen);
68   tempbitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
53   state->tmp_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
54
55
56   state_save_register_global(machine, state->grayscale_enable);
57   state_save_register_global(machine, state->vdp_enable);
58   state_save_register_global(machine, state->vdp_mixing);
59   state_save_register_global_bitmap(machine, state->tmp_bitmap);
6960}
7061
7162
r7356r7357
7869
7970void system18_set_grayscale(running_machine *machine, int enable)
8071{
72   segas1x_state *state = (segas1x_state *)machine->driver_data;
73
8174   enable = (enable != 0);
82   if (enable != grayscale_enable)
75   if (enable != state->grayscale_enable)
8376   {
8477      video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen));
85      grayscale_enable = enable;
78      state->grayscale_enable = enable;
8679//      mame_printf_debug("Grayscale = %02X\n", enable);
8780   }
8881}
r7356r7357
9083
9184void system18_set_vdp_enable(running_machine *machine, int enable)
9285{
86   segas1x_state *state = (segas1x_state *)machine->driver_data;
87
9388   enable = (enable != 0);
94   if (enable != vdp_enable)
89   if (enable != state->vdp_enable)
9590   {
9691      video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen));
97      vdp_enable = enable;
92      state->vdp_enable = enable;
9893#if DEBUG_VDP
9994      mame_printf_debug("VDP enable = %02X\n", enable);
10095#endif
r7356r7357
10499
105100void system18_set_vdp_mixing(running_machine *machine, int mixing)
106101{
107   if (mixing != vdp_mixing)
102   segas1x_state *state = (segas1x_state *)machine->driver_data;
103
104   if (mixing != state->vdp_mixing)
108105   {
109106      video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen));
110      vdp_mixing = mixing;
107      state->vdp_mixing = mixing;
111108#if DEBUG_VDP
112109      mame_printf_debug("VDP mixing = %02X\n", mixing);
113110#endif
r7356r7357
124121
125122static void draw_vdp(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int priority)
126123{
124   segas1x_state *state = (segas1x_state *)screen->machine->driver_data;
127125   int x, y;
128126   bitmap_t *priority_bitmap = screen->machine->priority_bitmap;
129127
130128   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
131129   {
132      UINT16 *src = BITMAP_ADDR16(tempbitmap, y, 0);
130      UINT16 *src = BITMAP_ADDR16(state->tmp_bitmap, y, 0);
133131      UINT16 *dst = BITMAP_ADDR16(bitmap, y, 0);
134132      UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
135133
r7356r7357
155153
156154VIDEO_UPDATE( system18 )
157155{
156   segas1x_state *state = (segas1x_state *)screen->machine->driver_data;
158157   int vdppri, vdplayer;
159158
160159/*
r7356r7357
188187        cltchitr: layer = 1 or 2 or 3, pri = 0x02 or 0x04 or 0x08
189188        mwalk:    layer = 3, pri = 0x04 or 0x08
190189*/
191   vdplayer = (vdp_mixing >> 1) & 3;
192   vdppri = (vdp_mixing & 1) ? (1 << vdplayer) : 0;
190   vdplayer = (state->vdp_mixing >> 1) & 3;
191   vdppri = (state->vdp_mixing & 1) ? (1 << vdplayer) : 0;
193192
194193#if DEBUG_VDP
195194   if (input_code_pressed(screen->machine, KEYCODE_Q)) vdplayer = 0;
r7356r7357
210209      return 0;
211210   }
212211
213   /* if the VDP is enabled, update our tempbitmap */
214   if (vdp_enable)
215      system18_vdp_update(tempbitmap, cliprect);
212   /* if the VDP is enabled, update our tmp_bitmap */
213   if (state->vdp_enable)
214      system18_vdp_update(state->tmp_bitmap, cliprect);
216215
217216   /* reset priorities */
218217   bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
r7356r7357
220219   /* draw background opaquely first, not setting any priorities */
221220   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
222221   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
223   if (vdp_enable && vdplayer == 0) draw_vdp(screen, bitmap, cliprect, vdppri);
222   if (state->vdp_enable && vdplayer == 0) draw_vdp(screen, bitmap, cliprect, vdppri);
224223
225224   /* draw background again to draw non-transparent pixels over the VDP and set the priority */
226225   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
227226   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
228   if (vdp_enable && vdplayer == 1) draw_vdp(screen, bitmap, cliprect, vdppri);
227   if (state->vdp_enable && vdplayer == 1) draw_vdp(screen, bitmap, cliprect, vdppri);
229228
230229   /* draw foreground */
231230   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
232231   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
233   if (vdp_enable && vdplayer == 2) draw_vdp(screen, bitmap, cliprect, vdppri);
232   if (state->vdp_enable && vdplayer == 2) draw_vdp(screen, bitmap, cliprect, vdppri);
234233
235234   /* text layer */
236235   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
237236   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
238   if (vdp_enable && vdplayer == 3) draw_vdp(screen, bitmap, cliprect, vdppri);
237   if (state->vdp_enable && vdplayer == 3) draw_vdp(screen, bitmap, cliprect, vdppri);
239238
240239   /* draw the sprites */
241240   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
242241
243242#if DEBUG_VDP
244   if (vdp_enable && input_code_pressed(screen->machine, KEYCODE_V))
243   if (state->vdp_enable && input_code_pressed(screen->machine, KEYCODE_V))
245244   {
246245      bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
247246      update_system18_vdp(bitmap, cliprect);
r7356r7357
249248   if (vdp_enable && input_code_pressed(screen->machine, KEYCODE_B))
250249   {
251250      FILE *f = fopen("vdp.bin", "w");
252      fwrite(tempbitmap->base, 1, tempbitmap->rowpixels * (tempbitmap->bpp / 8) * tempbitmap->height, f);
251      fwrite(state->tmp_bitmap->base, 1, state->tmp_bitmap->rowpixels * (state->tmp_bitmap->bpp / 8) * state->tmp_bitmap->height, f);
253252      fclose(f);
254253   }
255254#endif
src/mame/layout/tisub.lay
r0r7357
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="hold1" defstate="0">
4      <rect state="1">
5         <color red="1.0" green="0.0" blue="0.0" />
6      </rect>
7      <rect state="0">
8         <color red="0.3" green="0.0" blue="0.0" />
9      </rect>
10      <text string="HOLD 1">
11         <color red="0.0" green="0.0" blue="0.0" />
12         <bounds x="0" y="0.2" width="1" height="0.6" />
13      </text>
14   </element>
15
16   <element name="hold2" defstate="0">
17      <rect state="1">
18         <color red="1.0" green="0.0" blue="0.0" />
19      </rect>
20      <rect state="0">
21         <color red="0.3" green="0.0" blue="0.0" />
22      </rect>
23      <text string="HOLD 2">
24         <color red="0.0" green="0.0" blue="0.0" />
25         <bounds x="0" y="0.1" width="1" height="0.4" />
26      </text>
27      <text string="BIG">
28         <color red="0.0" green="0.0" blue="0.0" />
29         <bounds x="0" y="0.5" width="1" height="0.4" />
30      </text>
31   </element>
32
33   <element name="hold3" defstate="0">
34      <rect state="1">
35         <color red="1.0" green="0.0" blue="0.0" />
36      </rect>
37      <rect state="0">
38         <color red="0.3" green="0.0" blue="0.0" />
39      </rect>
40      <text string="HOLD 3">
41         <color red="0.0" green="0.0" blue="0.0" />
42         <bounds x="0" y="0.1" width="1" height="0.4" />
43      </text>
44      <text string="SMALL">
45         <color red="0.0" green="0.0" blue="0.0" />
46         <bounds x="0" y="0.5" width="1" height="0.4" />
47      </text>
48   </element>
49
50   <element name="bet" defstate="0">
51      <rect state="1">
52         <color red="0.0" green="1.0" blue="0.0" />
53      </rect>
54      <rect state="0">
55         <color red="0.0" green="0.3" blue="0.0" />
56      </rect>
57      <text string="BET">
58         <color red="0.0" green="0.0" blue="0.0" />
59         <bounds x="0" y="0.2" width="1" height="0.6" />
60      </text>
61   </element>
62
63   <element name="start" defstate="0">
64      <rect state="1">
65         <color red="0.0" green="1.0" blue="0.0" />
66      </rect>
67      <rect state="0">
68         <color red="0.0" green="0.3" blue="0.0" />
69      </rect>
70      <text string="START">
71         <color red="0.0" green="0.0" blue="0.0" />
72         <bounds x="0" y="0.1" width="1" height="0.4" />
73      </text>
74      <text string="TAKE">
75         <color red="0.0" green="0.0" blue="0.0" />
76         <bounds x="0" y="0.5" width="1" height="0.4" />
77      </text>
78   </element>
79
80   <element name="double" defstate="0">
81      <rect state="1">
82         <color red="1.0" green="1.0" blue="0.0" />
83      </rect>
84      <rect state="0">
85         <color red="0.3" green="0.2" blue="0.0" />
86      </rect>
87      <text string="DOUBLE">
88         <color red="0.0" green="0.0" blue="0.0" />
89         <bounds x="0" y="0.1" width="1" height="0.4" />
90      </text>
91      <text string="INFO">
92         <color red="0.0" green="0.0" blue="0.0" />
93         <bounds x="0" y="0.5" width="1" height="0.4" />
94      </text>
95   </element>
96
97   <element name="start" defstate="0">
98      <rect state="1">
99         <color red="0.0" green="1.0" blue="0.0" />
100      </rect>
101      <rect state="0">
102         <color red="0.0" green="0.3" blue="0.0" />
103      </rect>
104      <text string="START">
105         <color red="0.0" green="0.0" blue="0.0" />
106         <bounds x="0" y="0.1" width="1" height="0.4" />
107      </text>
108      <text string="TAKE">
109         <color red="0.0" green="0.0" blue="0.0" />
110         <bounds x="0" y="0.5" width="1" height="0.4" />
111      </text>
112   </element>
113
114   <element name="unknown" defstate="0">
115      <rect state="1">
116         <color red="0.0" green="0.0" blue="0.0" />
117      </rect>
118      <rect state="0">
119         <color red="0.0" green="0.0" blue="0.0" />
120      </rect>
121   </element>
122
123   <view name="Button Lamps">
124      <screen index="0">
125         <bounds left="0" top="0" right="4" bottom="3" />
126      </screen>
127      <bezel name="lamp0" element="hold1">
128         <bounds x="2.20" y="3.13" width="0.50" height="0.24" />
129      </bezel>
130      <bezel name="lamp1" element="hold2">
131         <bounds x="2.80" y="3.13" width="0.50" height="0.24" />
132      </bezel>
133      <bezel name="lamp2" element="unknown">
134         <bounds x="0" y="3.13" width="0.0" height="0.0" />
135      </bezel>
136      <bezel name="lamp3" element="bet">
137         <bounds x="0.10" y="3.13" width="0.50" height="0.24" />
138      </bezel>
139      <bezel name="lamp4" element="double">
140         <bounds x="1.30" y="3.13" width="0.50" height="0.24" />
141      </bezel>
142      <bezel name="lamp5" element="start">
143         <bounds x="0.70" y="3.13" width="0.50" height="0.24" />
144      </bezel>
145      <bezel name="lamp6" element="hold3">
146         <bounds x="3.40" y="3.13" width="0.50" height="0.24" />
147      </bezel>
148      <bezel name="lamp7" element="unknown">
149         <bounds x="0" y="3.13" width="0.0" height="0.0" />
150      </bezel>
151   </view>
152</mamelayout>
src/mame/drivers/docastle.c
r7356r7357
118118  dip switch reading will fail if the main CPU is running at the nominally correct
119119  4MHz speed. This is kludge by slighly lowering the speed to 3.98MHz.
120120- the dorunrun attract mode sequence is also very timing sensitive. The behaviour
121  of the "dorunru2" set, verified on the real board, with all dips in the OFF
121  of the "dorunrun2" set, verified on the real board, with all dips in the OFF
122122  position (easiest difficulty setting), should be, for the first 12 rounds of
123123  demo play:
124124  1) Mr do moves right. Kills all monsters and a letter 'E'.
r7356r7357
137137  Small changes to the CPU speed alter the demo timing and can cause the above
138138  sequence not to work (e.g. Mr Do might not fill all monsters at once on the
139139  first round). The 3.98MHz speed makes the sequence work.
140  Note that this only works in the dorunru2 set. The dorunrun set works slightly
140  Note that this only works in the dorunrun2 set. The dorunrun set works slightly
141141  differently, however it hasn't been compared with the real board so it might be
142142  right.
143143- unknown ports 0 and 2
r7356r7357
609609
610610   /* basic machine hardware */
611611//  MDRV_CPU_ADD("maincpu", Z80, 4000000)  // 4 MHz
612   MDRV_CPU_ADD("maincpu", Z80, 3980000)   // make dip switches work in docastle and dorunrun and fix dorunru2 attract sequence
612   MDRV_CPU_ADD("maincpu", Z80, 3980000)   // make dip switches work in docastle and dorunrun and fix dorunrun2 attract sequence
613613   MDRV_CPU_PROGRAM_MAP(docastle_map)
614614   MDRV_CPU_IO_MAP(docastle_io_map)
615615   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
src/mame/drivers/bfm_sc1.c
r7356r7357
14041404
14051405/////////////////////////////////////////////////////////////////////////////////////
14061406
1407//    year, name,     parent,   machine,            input,            init,    monitor, company,       fullname,                                    flags
1408GAME( 1988, m_lotsse, 0,        scorpion1,         scorpion1,        lotse,   0,       "BFM/ELAM",    "Lotus SE (Dutch)",                     GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
1409GAME( 1988, m_roulet, 0,        scorpion1,         scorpion1,        rou029,   0,       "BFM/ELAM",    "Roulette (Dutch, Game Card 39-360-129?)",   GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
1410GAME( 1990, m_clattr, 0,        scorpion1_nec_uk,   clatt,           clatt,   0,       "BFM",         "Club attraction (UK, Game Card 39-370-196)",GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
1407GAME( 1988, m_lotsse, 0,        scorpion1,    scorpion1,  lotse,   0,       "BFM/ELAM",    "Lotus SE (Dutch)", GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
1408GAME( 1988, m_roulet, 0,        scorpion1,    scorpion1,  rou029,   0,       "BFM/ELAM",    "Roulette (Dutch, Game Card 39-360-129?)", GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
1409GAME( 1990, m_clattr, 0,        scorpion1_nec_uk,clatt,        clatt,   0,       "BFM",         "Club attraction (UK, Game Card 39-370-196)", GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
14111410
14121411//Adder
1413GAME( 1996, m_tppokr, 0,        scorpion1_adder2,   toppoker,        toppoker,   0,       "BFM/ELAM",    "Toppoker (Dutch, Game Card 95-750-899)",   GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
1412GAME( 1996, m_tppokr, 0,        scorpion1_adder2,toppoker,  toppoker,   0,       "BFM/ELAM",    "Toppoker (Dutch, Game Card 95-750-899)", GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
src/mame/drivers/segaxbd.c
r7356r7357
233233
234234#include "emu.h"
235235#include "cpu/z80/z80.h"
236#include "includes/system16.h"
236#include "includes/segas16.h"
237237#include "cpu/m68000/m68000.h"
238238#include "machine/segaic16.h"
239239#include "sound/2151intf.h"
240240#include "sound/segapcm.h"
241#include "video/segaic16.h"
241242
242243
243244#define MASTER_CLOCK         50000000
r7356r7357
251252 *
252253 *************************************/
253254
254static UINT8 iochip_regs[2][8];
255static UINT8 iochip_force_input;
256static UINT8 (*iochip_custom_io_r[2])(offs_t offset, UINT8 portdata);
257static void (*iochip_custom_io_w[2])(offs_t offset, UINT8 data);
258
259static UINT8 adc_reverse[8];
260
261static UINT8 vblank_irq_state;
262static UINT8 timer_irq_state;
263static UINT8 gprider_hack;
264
265255static UINT16 *backupram1, *backupram2;
266256
267
268
269257/*************************************
270258 *
271259 *  Configuration
r7356r7357
274262
275263static void xboard_generic_init(running_machine *machine)
276264{
265   segas1x_state *state = (segas1x_state *)machine->driver_data;
266
277267   /* init the FD1094 */
278268   fd1094_driver_init(machine, "maincpu", NULL);
279269
280270   /* set the default road priority */
281   xboard_set_road_priority(1);
271   state->road_priority = 1;
282272
283273   /* reset the custom handlers and other pointers */
284   memset(iochip_custom_io_r, 0, sizeof(iochip_custom_io_r));
285   memset(iochip_custom_io_w, 0, sizeof(iochip_custom_io_w));
286   memset(adc_reverse, 0, sizeof(adc_reverse));
274   memset(state->iochip_custom_io_r, 0, sizeof(state->iochip_custom_io_r));
275   memset(state->iochip_custom_io_w, 0, sizeof(state->iochip_custom_io_w));
276   memset(state->adc_reverse, 0, sizeof(state->adc_reverse));
287277
288   gprider_hack = 0;
278   state->gprider_hack = 0;
279
280   state->maincpu = devtag_get_device(machine, "maincpu");
281   state->soundcpu = devtag_get_device(machine, "soundcpu");
282   state->subcpu = devtag_get_device(machine, "sub");
283   state->_315_5250_1 = devtag_get_device(machine, "5250_main");
284
285   state_save_register_global(machine, state->iochip_force_input);
286   state_save_register_global(machine, state->vblank_irq_state);
287   state_save_register_global(machine, state->timer_irq_state);
288   state_save_register_global(machine, state->gprider_hack);
289   state_save_register_global_array(machine, state->iochip_regs[0]);
290   state_save_register_global_array(machine, state->iochip_regs[1]);
291   state_save_register_global_array(machine, state->adc_reverse);
289292}
290293
291294
r7356r7357
298301
299302static void update_main_irqs(running_machine *machine)
300303{
304   segas1x_state *state = (segas1x_state *)machine->driver_data;
301305   int irq = 0;
302306
303   if (timer_irq_state)
307   if (state->timer_irq_state)
304308      irq |= 2;
305309   else
306      cputag_set_input_line(machine, "maincpu", 2, CLEAR_LINE);
310      cpu_set_input_line(state->maincpu, 2, CLEAR_LINE);
307311
308   if (vblank_irq_state)
312   if (state->vblank_irq_state)
309313      irq |= 4;
310314   else
311      cputag_set_input_line(machine, "maincpu", 4, CLEAR_LINE);
315      cpu_set_input_line(state->maincpu, 4, CLEAR_LINE);
312316
313   if (gprider_hack && irq > 4)
317   if (state->gprider_hack && irq > 4)
314318      irq = 4;
315319
316320   if (!(irq==6))
317      cputag_set_input_line(machine, "maincpu", 6, CLEAR_LINE);
321      cpu_set_input_line(state->maincpu, 6, CLEAR_LINE);
318322
319323   if (irq)
320324   {
321      cputag_set_input_line(machine, "maincpu", irq, ASSERT_LINE);
325      cpu_set_input_line(state->maincpu, irq, ASSERT_LINE);
322326      cpuexec_boost_interleave(machine, attotime_zero, ATTOTIME_IN_USEC(100));
323327   }
324328}
r7356r7357
326330
327331static TIMER_CALLBACK( scanline_callback )
328332{
333   segas1x_state *state = (segas1x_state *)machine->driver_data;
334
329335   int scanline = param;
330336   int next_scanline = (scanline + 2) % 262;
331337   int update = 0;
332338
333339   /* clock the timer and set the IRQ if something happened */
334   if ((scanline % 2) != 0 && segaic16_compare_timer_clock(0))
335      timer_irq_state = update = 1;
340   if ((scanline % 2) != 0 && segaic16_compare_timer_clock(state->_315_5250_1))
341      state->timer_irq_state = update = 1;
336342
337343   /* set VBLANK on scanline 223 */
338344   if (scanline == 223)
339345   {
340      vblank_irq_state = update = 1;
341      cputag_set_input_line(machine, "sub", 4, ASSERT_LINE);
346      state->vblank_irq_state = update = 1;
347      cpu_set_input_line(state->subcpu, 4, ASSERT_LINE);
342348      next_scanline = scanline + 1;
343349   }
344350
345351   /* clear VBLANK on scanline 224 */
346352   else if (scanline == 224)
347353   {
348      vblank_irq_state = 0;
354      state->vblank_irq_state = 0;
349355      update = 1;
350      cputag_set_input_line(machine, "sub", 4, CLEAR_LINE);
356      cpu_set_input_line(state->subcpu, 4, CLEAR_LINE);
351357      next_scanline = scanline + 1;
352358   }
353359
r7356r7357
362368
363369static void timer_ack_callback(running_machine *machine)
364370{
371   segas1x_state *state = (segas1x_state *)machine->driver_data;
372
365373   /* clear the timer IRQ */
366   timer_irq_state = 0;
374   state->timer_irq_state = 0;
367375   update_main_irqs(machine);
368376}
369377
r7356r7357
377385
378386static TIMER_CALLBACK( delayed_sound_data_w )
379387{
380   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
388   segas1x_state *state = (segas1x_state *)machine->driver_data;
389   const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
381390
382391   soundlatch_w(space, 0, param);
383   cputag_set_input_line(machine, "soundcpu", INPUT_LINE_NMI, ASSERT_LINE);
392   cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, ASSERT_LINE);
384393}
385394
386395
r7356r7357
392401
393402static void sound_cpu_irq(running_device *device, int state)
394403{
395   cputag_set_input_line(device->machine, "soundcpu", 0, state);
404   segas1x_state *driver = (segas1x_state *)device->machine->driver_data;
405
406   cpu_set_input_line(driver->soundcpu, 0, state);
396407}
397408
398409
399410static READ8_HANDLER( sound_data_r )
400411{
401   cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, CLEAR_LINE);
412   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
413
414   cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, CLEAR_LINE);
402415   return soundlatch_r(space, offset);
403416}
404417
r7356r7357
412425
413426static void xboard_reset(running_device *device)
414427{
415   cputag_set_input_line(device->machine, "sub", INPUT_LINE_RESET, PULSE_LINE);
428   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
429
430   cpu_set_input_line(state->subcpu, INPUT_LINE_RESET, PULSE_LINE);
416431   cpuexec_boost_interleave(device->machine, attotime_zero, ATTOTIME_IN_USEC(100));
417432}
418433
r7356r7357
425440   /* hook the RESET line, which resets CPU #1 */
426441   m68k_set_reset_callback(devtag_get_device(machine, "maincpu"), xboard_reset);
427442
428   /* set up the compare/timer chip */
429   segaic16_compare_timer_init(0, sound_data_w, timer_ack_callback);
430   segaic16_compare_timer_init(1, NULL, NULL);
431
432443   /* start timers to track interrupts */
433444   timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, 1, 0), NULL, 1, scanline_callback);
434445}
r7356r7357
443454
444455static READ16_HANDLER( adc_r )
445456{
457   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
446458   static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7" };
447   int which = (iochip_regs[0][2] >> 2) & 7;
459   int which = (state->iochip_regs[0][2] >> 2) & 7;
448460
449461   /* on the write, latch the selected input port and stash the value */
450462   int value = input_port_read_safe(space->machine, ports[which], 0x0010);
451463
452464   /* reverse some port values */
453   if (adc_reverse[which])
465   if (state->adc_reverse[which])
454466      value = 255 - value;
455467
456468   /* return the previously latched value */
r7356r7357
463475}
464476
465477
466INLINE UINT16 iochip_r(int which, int port, int inputval)
478INLINE UINT16 iochip_r(running_machine *machine, int which, int port, int inputval)
467479{
468   UINT16 result = iochip_regs[which][port];
480   segas1x_state *state = (segas1x_state *)machine->driver_data;
481   UINT16 result = state->iochip_regs[which][port];
469482
470483   /* if there's custom I/O, do that to get the input value */
471   if (iochip_custom_io_r[which])
472      inputval = (*iochip_custom_io_r[which])(port, inputval);
484   if (state->iochip_custom_io_r[which])
485      inputval = (*state->iochip_custom_io_r[which])(port, inputval);
473486
474487   /* for ports 0-3, the direction is controlled 4 bits at a time by register 6 */
475488   if (port <= 3)
476489   {
477      if (iochip_force_input || ((iochip_regs[which][6] >> (2*port+0)) & 1))
490      if (state->iochip_force_input || ((state->iochip_regs[which][6] >> (2 * port + 0)) & 1))
478491         result = (result & ~0x0f) | (inputval & 0x0f);
479      if (iochip_force_input || ((iochip_regs[which][6] >> (2*port+1)) & 1))
492      if (state->iochip_force_input || ((state->iochip_regs[which][6] >> (2 * port + 1)) & 1))
480493         result = (result & ~0xf0) | (inputval & 0xf0);
481494   }
482495
483496   /* for port 4, the direction is controlled 1 bit at a time by register 7 */
484497   else
485498   {
486      if ((iochip_regs[which][7] >> 0) & 1)
499      if ((state->iochip_regs[which][7] >> 0) & 1)
487500         result = (result & ~0x01) | (inputval & 0x01);
488      if ((iochip_regs[which][7] >> 1) & 1)
501      if ((state->iochip_regs[which][7] >> 1) & 1)
489502         result = (result & ~0x02) | (inputval & 0x02);
490      if ((iochip_regs[which][7] >> 2) & 1)
503      if ((state->iochip_regs[which][7] >> 2) & 1)
491504         result = (result & ~0x04) | (inputval & 0x04);
492      if ((iochip_regs[which][7] >> 3) & 1)
505      if ((state->iochip_regs[which][7] >> 3) & 1)
493506         result = (result & ~0x08) | (inputval & 0x08);
494507      result &= 0x0f;
495508   }
r7356r7357
507520                D6: /INTR of ADC0804
508521                D5-D0: CN C pin 24-19 (switch state 0= open, 1= closed)
509522            */
510         return iochip_r(0, 0, input_port_read(space->machine, "IO0PORTA"));
523         return iochip_r(space->machine, 0, 0, input_port_read(space->machine, "IO0PORTA"));
511524
512525      case 1:
513526         /* I/O port: CN C pins 17,15,13,11,9,7,5,3 */
514         return iochip_r(0, 1, input_port_read(space->machine, "IO0PORTB"));
527         return iochip_r(space->machine, 0, 1, input_port_read(space->machine, "IO0PORTB"));
515528
516529      case 2:
517530         /* Output port */
518         return iochip_r(0, 2, 0);
531         return iochip_r(space->machine, 0, 2, 0);
519532
520533      case 3:
521534         /* Output port */
522         return iochip_r(0, 3, 0);
535         return iochip_r(space->machine, 0, 3, 0);
523536
524537      case 4:
525538         /* Unused */
526         return iochip_r(0, 4, 0);
539         return iochip_r(space->machine, 0, 4, 0);
527540   }
528541
529542   /* everything else returns 0 */
r7356r7357
533546
534547static WRITE16_HANDLER( iochip_0_w )
535548{
549   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
536550   UINT8 oldval;
537551
538552   /* access is via the low 8 bits */
r7356r7357
542556   data &= 0xff;
543557
544558   /* swap in the new value and remember the previous value */
545   oldval = iochip_regs[0][offset];
546   iochip_regs[0][offset] = data;
559   oldval = state->iochip_regs[0][offset];
560   state->iochip_regs[0][offset] = data;
547561
548562   /* certain offsets have common effects */
549563   switch (offset)
r7356r7357
559573            */
560574         if (((oldval ^ data) & 0x40) && !(data & 0x40)) watchdog_reset_w(space,0,0);
561575         segaic16_set_display_enable(space->machine, data & 0x20);
562         cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
576         cpu_set_input_line(state->soundcpu, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
563577         return;
564578
565579      case 3:
r7356r7357
582596   {
583597      case 0:
584598         /* Input port: switches, CN D pin A1-8 (switch state 1= open, 0= closed) */
585         return iochip_r(1, 0, input_port_read(space->machine, "IO1PORTA"));
599         return iochip_r(space->machine, 1, 0, input_port_read(space->machine, "IO1PORTA"));
586600
587601      case 1:
588602         /* Input port: switches, CN D pin A9-16 (switch state 1= open, 0= closed) */
589         return iochip_r(1, 1, input_port_read(space->machine, "IO1PORTB"));
603         return iochip_r(space->machine, 1, 1, input_port_read(space->machine, "IO1PORTB"));
590604
591605      case 2:
592606         /* Input port: DIP switches (1= off, 0= on) */
593         return iochip_r(1, 2, input_port_read(space->machine, "IO1PORTC"));
607         return iochip_r(space->machine, 1, 2, input_port_read(space->machine, "IO1PORTC"));
594608
595609      case 3:
596610         /* Input port: DIP switches (1= off, 0= on) */
597         return iochip_r(1, 3, input_port_read(space->machine, "IO1PORTD"));
611         return iochip_r(space->machine, 1, 3, input_port_read(space->machine, "IO1PORTD"));
598612
599613      case 4:
600614         /* Unused */
601         return iochip_r(1, 4, 0);
615         return iochip_r(space->machine, 1, 4, 0);
602616   }
603617
604618   /* everything else returns 0 */
r7356r7357
608622
609623static WRITE16_HANDLER( iochip_1_w )
610624{
625   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
626
611627   /* access is via the low 8 bits */
612628   if (!ACCESSING_BITS_0_7)
613629      return;
r7356r7357
615631   data &= 0xff;
616632
617633   /* swap in the new value and remember the previous value */
618   iochip_regs[1][offset] = data;
634   state->iochip_regs[1][offset] = data;
619635
620636   if (offset <= 4)
621637      logerror("I/O chip 1, port %c write = %02X\n", 'A' + offset, data);
r7356r7357
642658
643659static WRITE16_HANDLER( aburner2_iochip_0_D_w )
644660{
661   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
662
645663   /* access is via the low 8 bits */
646664   if (!ACCESSING_BITS_0_7)
647665      return;
648666
649   iochip_regs[0][3] = data;
667   state->iochip_regs[0][3] = data;
650668
651669   output_set_lamp_value(2, (data >> 1) & 0x01);   /* altitude warning lamp */
652670   output_set_led_value(0, (data >> 2) & 0x01);   /* start lamp */
r7356r7357
664682 *
665683 *************************************/
666684
667static UINT16 *loffire_sync;
668
669685static WRITE16_HANDLER( loffire_sync0_w )
670686{
671   COMBINE_DATA(&loffire_sync[offset]);
687   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
688
689   COMBINE_DATA(&state->loffire_sync[offset]);
672690   cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(10));
673691}
674692
r7356r7357
730748   AM_RANGE(0x0a0000, 0x0a3fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE("share2") AM_BASE(&backupram2)
731749   AM_RANGE(0x0c0000, 0x0cffff) AM_RAM_WRITE(segaic16_tileram_0_w) AM_BASE(&segaic16_tileram_0)
732750   AM_RANGE(0x0d0000, 0x0d0fff) AM_MIRROR(0x00f000) AM_RAM_WRITE(segaic16_textram_0_w) AM_BASE(&segaic16_textram_0)
733   AM_RANGE(0x0e0000, 0x0e0007) AM_MIRROR(0x003ff8) AM_READWRITE(segaic16_multiply_0_r, segaic16_multiply_0_w)
734   AM_RANGE(0x0e4000, 0x0e401f) AM_MIRROR(0x003fe0) AM_READWRITE(segaic16_divide_0_r, segaic16_divide_0_w)
735   AM_RANGE(0x0e8000, 0x0e801f) AM_MIRROR(0x003fe0) AM_READWRITE(segaic16_compare_timer_0_r, segaic16_compare_timer_0_w)
751   AM_RANGE(0x0e0000, 0x0e0007) AM_MIRROR(0x003ff8) AM_DEVREADWRITE("5248_main", segaic16_multiply_r, segaic16_multiply_w)
752   AM_RANGE(0x0e4000, 0x0e401f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("5249_main", segaic16_divide_r, segaic16_divide_w)
753   AM_RANGE(0x0e8000, 0x0e801f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("5250_main", segaic16_compare_timer_r, segaic16_compare_timer_w)
736754   AM_RANGE(0x100000, 0x100fff) AM_MIRROR(0x00f000) AM_RAM AM_BASE(&segaic16_spriteram_0)
737755   AM_RANGE(0x110000, 0x11ffff) AM_WRITE(segaic16_sprites_draw_0_w)
738756   AM_RANGE(0x120000, 0x123fff) AM_MIRROR(0x00c000) AM_RAM_WRITE(segaic16_paletteram_w) AM_BASE(&segaic16_paletteram)
r7356r7357
743761   AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("sub", 0x00000)
744762   AM_RANGE(0x280000, 0x283fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE("share3")
745763   AM_RANGE(0x2a0000, 0x2a3fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE("share4")
746   AM_RANGE(0x2e0000, 0x2e0007) AM_MIRROR(0x003ff8) AM_READWRITE(segaic16_multiply_1_r, segaic16_multiply_1_w)
747   AM_RANGE(0x2e4000, 0x2e401f) AM_MIRROR(0x003fe0) AM_READWRITE(segaic16_divide_1_r, segaic16_divide_1_w)
748   AM_RANGE(0x2e8000, 0x2e800f) AM_MIRROR(0x003ff0) AM_READWRITE(segaic16_compare_timer_1_r, segaic16_compare_timer_1_w)
764   AM_RANGE(0x2e0000, 0x2e0007) AM_MIRROR(0x003ff8) AM_DEVREADWRITE("5248_subx", segaic16_multiply_r, segaic16_multiply_w)
765   AM_RANGE(0x2e4000, 0x2e401f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("5249_subx", segaic16_divide_r, segaic16_divide_w)
766   AM_RANGE(0x2e8000, 0x2e800f) AM_MIRROR(0x003ff0) AM_DEVREADWRITE("5250_subx", segaic16_compare_timer_r, segaic16_compare_timer_w)
749767   AM_RANGE(0x2ec000, 0x2ecfff) AM_MIRROR(0x001000) AM_RAM AM_SHARE("share5") AM_BASE(&segaic16_roadram_0)
750768   AM_RANGE(0x2ee000, 0x2effff) AM_READWRITE(segaic16_road_control_0_r, segaic16_road_control_0_w)
751769//  AM_RANGE(0x2f0000, 0x2f3fff) AM_READWRITE(excs_r, excs_w)
r7356r7357
767785   AM_RANGE(0x000000, 0x07ffff) AM_ROM
768786   AM_RANGE(0x080000, 0x083fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE("share3")
769787   AM_RANGE(0x0a0000, 0x0a3fff) AM_MIRROR(0x01c000) AM_RAM AM_SHARE("share4")
770   AM_RANGE(0x0e0000, 0x0e0007) AM_MIRROR(0x003ff8) AM_READWRITE(segaic16_multiply_1_r, segaic16_multiply_1_w)
771   AM_RANGE(0x0e4000, 0x0e401f) AM_MIRROR(0x003fe0) AM_READWRITE(segaic16_divide_1_r, segaic16_divide_1_w)
772   AM_RANGE(0x0e8000, 0x0e800f) AM_MIRROR(0x003ff0) AM_READWRITE(segaic16_compare_timer_1_r, segaic16_compare_timer_1_w)
788   AM_RANGE(0x0e0000, 0x0e0007) AM_MIRROR(0x003ff8) AM_DEVREADWRITE("5248_subx", segaic16_multiply_r, segaic16_multiply_w)
789   AM_RANGE(0x0e4000, 0x0e401f) AM_MIRROR(0x003fe0) AM_DEVREADWRITE("5249_subx", segaic16_divide_r, segaic16_divide_w)
790   AM_RANGE(0x0e8000, 0x0e800f) AM_MIRROR(0x003ff0) AM_DEVREADWRITE("5250_subx", segaic16_compare_timer_r, segaic16_compare_timer_w)
773791   AM_RANGE(0x0ec000, 0x0ecfff) AM_MIRROR(0x001000) AM_RAM AM_SHARE("share5")
774792   AM_RANGE(0x0ee000, 0x0effff) AM_READWRITE(segaic16_road_control_0_r, segaic16_road_control_0_w)
775793//  AM_RANGE(0x0f0000, 0x0f3fff) AM_READWRITE(excs_r, excs_w)
r7356r7357
13351353 *
13361354 *************************************/
13371355
1356static const ic_315_5250_interface segaxb_5250_1_intf =
1357{
1358   sound_data_w, timer_ack_callback
1359};
1360
1361static const ic_315_5250_interface segaxb_5250_2_intf =
1362{
1363   NULL, NULL
1364};
1365
13381366static MACHINE_DRIVER_START( xboard )
13391367
1368   /* driver data */
1369   MDRV_DRIVER_DATA(segas1x_state)
1370
13401371   /* basic machine hardware */
13411372   MDRV_CPU_ADD("maincpu", M68000, MASTER_CLOCK/4)
13421373   MDRV_CPU_PROGRAM_MAP(main_map)
r7356r7357
13521383   MDRV_NVRAM_HANDLER(xboard)
13531384   MDRV_QUANTUM_TIME(HZ(6000))
13541385
1386   MDRV_315_5248_ADD("5248_main")
1387   MDRV_315_5248_ADD("5248_subx")
1388   MDRV_315_5249_ADD("5249_main")
1389   MDRV_315_5249_ADD("5249_subx")
1390   MDRV_315_5250_ADD("5250_main", segaxb_5250_1_intf)
1391   MDRV_315_5250_ADD("5250_subx", segaxb_5250_2_intf)
1392
13551393   /* video hardware */
13561394   MDRV_GFXDECODE(segaxbd)
13571395   MDRV_PALETTE_LENGTH(8192*3)
r7356r7357
28082846
28092847static DRIVER_INIT( aburner2 )
28102848{
2849   segas1x_state *state = (segas1x_state *)machine->driver_data;
2850
28112851   xboard_generic_init(machine);
2812   xboard_set_road_priority(0);
28132852
2853   state->road_priority = 0;
2854
28142855   memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x140006, 0x140007, 0, 0x00fff0, aburner2_iochip_0_D_w);
28152856}
28162857
28172858
28182859static DRIVER_INIT( aburner )
28192860{
2861   segas1x_state *state = (segas1x_state *)machine->driver_data;
2862
28202863   xboard_generic_init(machine);
2821   xboard_set_road_priority(0);
2864
2865   state->road_priority = 0;
28222866}
28232867
28242868
28252869static DRIVER_INIT( loffire )
28262870{
2871   segas1x_state *state = (segas1x_state *)machine->driver_data;
2872
28272873   xboard_generic_init(machine);
2828   adc_reverse[1] = adc_reverse[3] = 1;
2874   state->adc_reverse[1] = state->adc_reverse[3] = 1;
28292875
28302876   /* install extra synchronization on core shared memory */
2831   loffire_sync = memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x29c000, 0x29c011, 0, 0, loffire_sync0_w);
2877   state->loffire_sync = memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x29c000, 0x29c011, 0, 0, loffire_sync0_w);
28322878}
28332879
28342880
r7356r7357
28412887
28422888static DRIVER_INIT( gprider )
28432889{
2890   segas1x_state *state = (segas1x_state *)machine->driver_data;
2891
28442892   xboard_generic_init(machine);
2845   gprider_hack = 1;
2893   state->gprider_hack = 1;
28462894}
28472895
28482896
src/mame/drivers/arabian.c
r7356r7357
7272#include "sound/ay8910.h"
7373
7474/* constants */
75#define MAIN_OSC      12000000
75#define MAIN_OSC      XTAL_12MHz
7676
7777
7878/*************************************
src/mame/drivers/hornet.c
r7356r7357
311311#include "cpu/m68000/m68000.h"
312312#include "cpu/powerpc/ppc.h"
313313#include "cpu/sharc/sharc.h"
314#include "machine/adc1213x.h"
314315#include "machine/eeprom.h"
316#include "machine/k033906.h"
315317#include "machine/konppc.h"
316#include "video/voodoo.h"
317318#include "machine/timekpr.h"
318319#include "sound/rf5c400.h"
319#include "rendlay.h"
320#include "machine/adc1213x.h"
321320#include "sound/k056800.h"
322#include "machine/k033906.h"
321#include "video/voodoo.h"
322#include "video/konicdev.h"
323#include "rendlay.h"
323324
324325static UINT8 led_reg0, led_reg1;
325326static UINT32 *workram;
r7356r7357
328329static UINT32 jvs_sdata_ptr = 0;
329330
330331
331/* K037122 Tilemap chip (move to konamiic.c ?) */
332
333#define MAX_K037122_CHIPS   2
334
335static UINT32 *K037122_tile_ram[MAX_K037122_CHIPS];
336static UINT32 *K037122_char_ram[MAX_K037122_CHIPS];
337static int K037122_gfx_index[MAX_K037122_CHIPS];
338static tilemap_t *K037122_layer[MAX_K037122_CHIPS][2];
339static UINT32 *K037122_reg[MAX_K037122_CHIPS];
340
341#define K037122_NUM_TILES      16384
342
343static const gfx_layout K037122_char_layout =
332static READ32_HANDLER( hornet_k037122_sram_r )
344333{
345   8, 8,
346   K037122_NUM_TILES,
347   8,
348   { 0,1,2,3,4,5,6,7 },
349   { 1*16, 0*16, 3*16, 2*16, 5*16, 4*16, 7*16, 6*16 },
350   { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128 },
351   8*128
352};
353
354static TILE_GET_INFO( K037122_0_tile_info_layer0 )
355{
356   UINT32 val = K037122_tile_ram[0][tile_index + (0x8000/4)];
357   int color = (val >> 17) & 0x1f;
358   int tile = val & 0x3fff;
359   int flags = 0;
360
361   if (val & 0x400000)
362      flags |= TILE_FLIPX;
363   if (val & 0x800000)
364      flags |= TILE_FLIPY;
365
366   SET_TILE_INFO(K037122_gfx_index[0], tile, color, flags);
334   running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1");
335   return k037122_sram_r(k037122, offset, mem_mask);
367336}
368337
369static TILE_GET_INFO( K037122_0_tile_info_layer1 )
338static WRITE32_HANDLER( hornet_k037122_sram_w )
370339{
371   UINT32 val = K037122_tile_ram[0][tile_index];
372   int color = (val >> 17) & 0x1f;
373   int tile = val & 0x3fff;
374   int flags = 0;
375
376   if (val & 0x400000)
377      flags |= TILE_FLIPX;
378   if (val & 0x800000)
379      flags |= TILE_FLIPY;
380
381   SET_TILE_INFO(K037122_gfx_index[0], tile, color, flags);
340   running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1");
341   k037122_sram_w(k037122, offset, data, mem_mask);
382342}
383343
384static TILE_GET_INFO( K037122_1_tile_info_layer0 )
385{
386   UINT32 val = K037122_tile_ram[1][tile_index + (0x8000/4)];
387   int color = (val >> 17) & 0x1f;
388   int tile = val & 0x3fff;
389   int flags = 0;
390344
391   if (val & 0x400000)
392      flags |= TILE_FLIPX;
393   if (val & 0x800000)
394      flags |= TILE_FLIPY;
395
396   SET_TILE_INFO(K037122_gfx_index[1], tile, color, flags);
397}
398
399static TILE_GET_INFO( K037122_1_tile_info_layer1 )
345static READ32_HANDLER( hornet_k037122_char_r )
400346{
401   UINT32 val = K037122_tile_ram[1][tile_index];
402   int color = (val >> 17) & 0x1f;
403   int tile = val & 0x3fff;
404   int flags = 0;
405
406   if (val & 0x400000)
407      flags |= TILE_FLIPX;
408   if (val & 0x800000)
409      flags |= TILE_FLIPY;
410
411   SET_TILE_INFO(K037122_gfx_index[1], tile, color, flags);
347   running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1");
348   return k037122_char_r(k037122, offset, mem_mask);
412349}
413350
414static int K037122_vh_start(running_machine *machine, int chip)
351static WRITE32_HANDLER( hornet_k037122_char_w )
415352{
416   for(K037122_gfx_index[chip] = 0; K037122_gfx_index[chip] < MAX_GFX_ELEMENTS; K037122_gfx_index[chip]++)
417      if (machine->gfx[K037122_gfx_index[chip]] == 0)
418         break;
419   if(K037122_gfx_index[chip] == MAX_GFX_ELEMENTS)
420      return 1;
421
422   K037122_char_ram[chip] = auto_alloc_array(machine, UINT32, 0x200000/4);
423
424   K037122_tile_ram[chip] = auto_alloc_array(machine, UINT32, 0x20000/4);
425
426   K037122_reg[chip] = auto_alloc_array(machine, UINT32, 0x400/4);
427
428   if (chip == 0)
429   {
430      K037122_layer[chip][0] = tilemap_create(machine, K037122_0_tile_info_layer0, tilemap_scan_rows, 8, 8, 256, 64);
431      K037122_layer[chip][1] = tilemap_create(machine, K037122_0_tile_info_layer1, tilemap_scan_rows, 8, 8, 128, 64);
432   }
433   else
434   {
435      K037122_layer[chip][0] = tilemap_create(machine, K037122_1_tile_info_layer0, tilemap_scan_rows, 8, 8, 256, 64);
436      K037122_layer[chip][1] = tilemap_create(machine, K037122_1_tile_info_layer1, tilemap_scan_rows, 8, 8, 128, 64);
437   }
438
439   tilemap_set_transparent_pen(K037122_layer[chip][0], 0);
440   tilemap_set_transparent_pen(K037122_layer[chip][1], 0);
441
442   memset(K037122_char_ram[chip], 0, 0x200000);
443   memset(K037122_tile_ram[chip], 0, 0x20000);
444   memset(K037122_reg[chip], 0, 0x400);
445
446   machine->gfx[K037122_gfx_index[chip]] = gfx_element_alloc(machine, &K037122_char_layout, (UINT8*)K037122_char_ram[chip], machine->config->total_colors / 16, 0);
447
448   state_save_register_item_pointer(machine, "K037122", NULL, chip, K037122_reg[chip], 0x400/sizeof(K037122_reg[chip][0]));
449   state_save_register_item_pointer(machine, "K037122", NULL, chip, K037122_char_ram[chip], 0x200000/sizeof(K037122_char_ram[chip][0]));
450   state_save_register_item_pointer(machine, "K037122", NULL, chip, K037122_tile_ram[chip], 0x20000/sizeof(K037122_tile_ram[chip][0]));
451
452   return 0;
353   running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1");
354   k037122_char_w(k037122, offset, data, mem_mask);
453355}
454356
455static void K037122_tile_draw(running_machine *machine, int chip, bitmap_t *bitmap, const rectangle *cliprect)
357static READ32_HANDLER( hornet_k037122_reg_r )
456358{
457   const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
458
459   if (K037122_reg[chip][0xc] & 0x10000)
460   {
461      tilemap_set_scrolldx(K037122_layer[chip][1], visarea->min_x, visarea->min_x);
462      tilemap_set_scrolldy(K037122_layer[chip][1], visarea->min_y, visarea->min_y);
463      tilemap_draw(bitmap, cliprect, K037122_layer[chip][1], 0,0);
464   }
465   else
466   {
467      tilemap_set_scrolldx(K037122_layer[chip][0], visarea->min_x, visarea->min_x);
468      tilemap_set_scrolldy(K037122_layer[chip][0], visarea->min_y, visarea->min_y);
469      tilemap_draw(bitmap, cliprect, K037122_layer[chip][0], 0,0);
470   }
359   running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1");
360   return k037122_reg_r(k037122, offset, mem_mask);
471361}
472362
473static void update_palette_color(running_machine *machine, int chip, UINT32 palette_base, int color)
363static WRITE32_HANDLER( hornet_k037122_reg_w )
474364{
475   UINT32 data = K037122_tile_ram[chip][(palette_base/4) + color];
476   palette_set_color_rgb(machine, color, pal5bit(data >> 6), pal6bit(data >> 0), pal5bit(data >> 11));
365   running_device *k037122 = devtag_get_device(space->machine, get_cgboard_id() ? "k037122_2" : "k037122_1");
366   k037122_reg_w(k037122, offset, data, mem_mask);
477367}
478368
479static READ32_HANDLER(K037122_sram_r)
480{
481   int chip = get_cgboard_id();
482
483   return K037122_tile_ram[chip][offset];
484}
485
486static WRITE32_HANDLER(K037122_sram_w)
487{
488   int chip = get_cgboard_id();
489
490   COMBINE_DATA(K037122_tile_ram[chip] + offset);
491
492   if (K037122_reg[chip][0xc] & 0x10000)
493   {
494      if (offset < 0x8000/4)
495      {
496         tilemap_mark_tile_dirty(K037122_layer[chip][1], offset);
497      }
498      else if (offset >= 0x8000/4 && offset < 0x18000/4)
499      {
500         tilemap_mark_tile_dirty(K037122_layer[chip][0], offset - (0x8000/4));
501      }
502      else if (offset >= 0x18000/4)
503      {
504         update_palette_color(space->machine, chip, 0x18000, offset - (0x18000/4));
505      }
506   }
507   else
508   {
509      if (offset < 0x8000/4)
510      {
511         update_palette_color(space->machine, chip, 0, offset);
512      }
513      else if (offset >= 0x8000/4 && offset < 0x18000/4)
514      {
515         tilemap_mark_tile_dirty(K037122_layer[chip][0], offset - (0x8000/4));
516      }
517      else if (offset >= 0x18000/4)
518      {
519         tilemap_mark_tile_dirty(K037122_layer[chip][1], offset - (0x18000/4));
520      }
521   }
522}
523
524
525static READ32_HANDLER(K037122_char_r)
526{
527   int chip = get_cgboard_id();
528
529   UINT32 addr;
530   int bank = K037122_reg[chip][0x30/4] & 0x7;
531
532   addr = offset + (bank * (0x40000/4));
533
534   return K037122_char_ram[chip][addr];
535}
536
537static WRITE32_HANDLER(K037122_char_w)
538{
539   int chip = get_cgboard_id();
540
541   UINT32 addr;
542   int bank = K037122_reg[chip][0x30/4] & 0x7;
543
544   addr = offset + (bank * (0x40000/4));
545
546   COMBINE_DATA(K037122_char_ram[chip] + addr);
547   gfx_element_mark_dirty(space->machine->gfx[K037122_gfx_index[chip]], addr / 32);
548}
549
550static READ32_HANDLER(K037122_reg_r)
551{
552   int chip = get_cgboard_id();
553
554   switch (offset)
555   {
556      case 0x14/4:
557      {
558         return 0x000003fa;
559      }
560   }
561   return K037122_reg[chip][offset];
562}
563
564static WRITE32_HANDLER(K037122_reg_w)
565{
566   int chip = get_cgboard_id();
567
568   COMBINE_DATA( K037122_reg[chip] + offset );
569}
570
571369static void voodoo_vblank_0(running_device *device, int param)
572370{
573371   cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE);
r7356r7357
578376   cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ1, ASSERT_LINE);
579377}
580378
581static VIDEO_START( hornet )
582{
583   K037122_vh_start(machine, 0);
584}
585
586static VIDEO_START( hornet_2board )
587{
588   K037122_vh_start(machine, 0);
589   K037122_vh_start(machine, 1);
590}
591
592
593379static VIDEO_UPDATE( hornet )
594380{
595381   running_device *voodoo = devtag_get_device(screen->machine, "voodoo0");
382   running_device *k037122 = devtag_get_device(screen->machine, "k037122_1");
596383
597384   voodoo_update(voodoo, bitmap, cliprect);
598385
599   K037122_tile_draw(screen->machine, 0, bitmap, cliprect);
386   k037122_tile_draw(k037122, bitmap, cliprect);
600387
601388   draw_7segment_led(bitmap, 3, 3, led_reg0);
602389   draw_7segment_led(bitmap, 9, 3, led_reg1);
r7356r7357
607394{
608395   if (strcmp(screen->tag, "lscreen") == 0)
609396   {
397      running_device *k037122 = devtag_get_device(screen->machine, "k037122_1");
610398      running_device *voodoo = devtag_get_device(screen->machine, "voodoo0");
611399      voodoo_update(voodoo, bitmap, cliprect);
612400
613401      /* TODO: tilemaps per screen */
614      K037122_tile_draw(screen->machine, 0, bitmap, cliprect);
402      k037122_tile_draw(k037122, bitmap, cliprect);
615403   }
616404   else if (strcmp(screen->tag, "rscreen") == 0)
617405   {
406      running_device *k037122 = devtag_get_device(screen->machine, "k037122_2");
618407      running_device *voodoo = devtag_get_device(screen->machine, "voodoo1");
619408      voodoo_update(voodoo, bitmap, cliprect);
620409
621410      /* TODO: tilemaps per screen */
622      K037122_tile_draw(screen->machine, 1, bitmap, cliprect);
411      k037122_tile_draw(k037122, bitmap, cliprect);
623412   }
624413
625414   draw_7segment_led(bitmap, 3, 3, led_reg0);
r7356r7357
798587
799588static ADDRESS_MAP_START( hornet_map, ADDRESS_SPACE_PROGRAM, 32 )
800589   AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_BASE(&workram)      /* Work RAM */
801   AM_RANGE(0x74000000, 0x740000ff) AM_READWRITE(K037122_reg_r, K037122_reg_w)
802   AM_RANGE(0x74020000, 0x7403ffff) AM_READWRITE(K037122_sram_r, K037122_sram_w)
803   AM_RANGE(0x74040000, 0x7407ffff) AM_READWRITE(K037122_char_r, K037122_char_w)
590   AM_RANGE(0x74000000, 0x740000ff) AM_READWRITE(hornet_k037122_reg_r, hornet_k037122_reg_w)
591   AM_RANGE(0x74020000, 0x7403ffff) AM_READWRITE(hornet_k037122_sram_r, hornet_k037122_sram_w)
592   AM_RANGE(0x74040000, 0x7407ffff) AM_READWRITE(hornet_k037122_char_r, hornet_k037122_char_w)
804593   AM_RANGE(0x74080000, 0x7408000f) AM_READWRITE(gun_r, gun_w)
805594   AM_RANGE(0x78000000, 0x7800ffff) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc)
806595   AM_RANGE(0x780c0000, 0x780c0003) AM_READWRITE(cgboard_dsp_comm_r_ppc, cgboard_dsp_comm_w_ppc)
r7356r7357
1111900   "voodoo1"
1112901};
1113902
903static const k037122_interface hornet_k037122_intf =
904{
905   "screen", 0
906};
907
908static const k037122_interface hornet_k037122_intf_l =
909{
910   "lscreen", 0
911};
912
913static const k037122_interface hornet_k037122_intf_r =
914{
915   "rscreen", 1
916};
917
1114918static MACHINE_DRIVER_START( hornet )
1115919
1116920   /* basic machine hardware */
r7356r7357
1147951
1148952   MDRV_PALETTE_LENGTH(65536)
1149953
1150   MDRV_VIDEO_START(hornet)
1151954   MDRV_VIDEO_UPDATE(hornet)
1152955
956   MDRV_K037122_ADD("k037122_1", hornet_k037122_intf)
957
1153958   MDRV_K056800_ADD("k056800", hornet_k056800_interface)
1154959
1155960   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r7356r7357
1191996
1192997   MDRV_MACHINE_RESET(hornet_2board)
1193998
1194   MDRV_VIDEO_START(hornet_2board)
1195999   MDRV_VIDEO_UPDATE(hornet_2board)
11961000
1001   MDRV_DEVICE_REMOVE("k037122_1")
1002   MDRV_K037122_ADD("k037122_1", hornet_k037122_intf_l)
1003   MDRV_K037122_ADD("k037122_2", hornet_k037122_intf_r)
1004
11971005   MDRV_DEVICE_REMOVE("voodoo0")
11981006   MDRV_3DFX_VOODOO_1_ADD("voodoo0", STD_VOODOO_1_CLOCK, 2, "lscreen")
11991007   MDRV_3DFX_VOODOO_CPU("dsp")
src/mame/drivers/ccastles.c
r7356r7357
418418INPUT_PORTS_END
419419
420420
421static INPUT_PORTS_START( ccastlej )
421static INPUT_PORTS_START( ccastlesj )
422422   PORT_INCLUDE(ccastles)
423423
424424   PORT_MODIFY("LETA0")
r7356r7357
698698 *
699699 *************************************/
700700
701GAME( 1983, ccastles, 0,        ccastles, ccastles, 0, ROT0, "Atari", "Crystal Castles (version 4)", GAME_SUPPORTS_SAVE )
701GAME( 1983, ccastles, 0,        ccastles, ccastles, 0, ROT0, "Atari", "Crystal Castles (version 4)", GAME_SUPPORTS_SAVE )
702702GAME( 1983, ccastlesg, ccastles, ccastles, ccastles, 0, ROT0, "Atari", "Crystal Castles (version 3, German)", GAME_SUPPORTS_SAVE )
703703GAME( 1983, ccastlesp, ccastles, ccastles, ccastles, 0, ROT0, "Atari", "Crystal Castles (version 3, Spanish)", GAME_SUPPORTS_SAVE )
704704GAME( 1983, ccastlesf, ccastles, ccastles, ccastles, 0, ROT0, "Atari", "Crystal Castles (version 3, French)", GAME_SUPPORTS_SAVE )
705705GAME( 1983, ccastles3, ccastles, ccastles, ccastles, 0, ROT0, "Atari", "Crystal Castles (version 3)", GAME_SUPPORTS_SAVE )
706706GAME( 1983, ccastles2, ccastles, ccastles, ccastles, 0, ROT0, "Atari", "Crystal Castles (version 2)", GAME_SUPPORTS_SAVE )
707707GAME( 1983, ccastles1, ccastles, ccastles, ccastles, 0, ROT0, "Atari", "Crystal Castles (version 1)", GAME_SUPPORTS_SAVE )
708GAME( 1983, ccastlesj, ccastles, ccastles, ccastlej, 0, ROT0, "Atari", "Crystal Castles (joystick version)", GAME_SUPPORTS_SAVE )
708GAME( 1983, ccastlesj, ccastles, ccastles, ccastlesj,0, ROT0, "Atari", "Crystal Castles (joystick version)", GAME_SUPPORTS_SAVE )
src/mame/drivers/ddragon3.c
r7356r7357
437437   PORT_BIT( 0xfc00, IP_ACTIVE_LOW, IPT_UNUSED )
438438INPUT_PORTS_END
439439
440static INPUT_PORTS_START( ddrago3b )
440static INPUT_PORTS_START( ddragon3b )
441441   PORT_INCLUDE( ctribe )
442442
443443   PORT_MODIFY("IN0")
r7356r7357
630630   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.50)
631631MACHINE_DRIVER_END
632632
633static MACHINE_DRIVER_START( ddrago3b )
633static MACHINE_DRIVER_START( ddragon3b )
634634   MDRV_IMPORT_FROM(ddragon3)
635635
636636   MDRV_CPU_MODIFY("maincpu")
r7356r7357
10141014GAME( 1990, ddragon3, 0,        ddragon3, ddragon3, 0, ROT0, "Technos Japan", "Double Dragon 3 - The Rosetta Stone (US)", GAME_SUPPORTS_SAVE )
10151015GAME( 1990, ddragon3j,ddragon3, ddragon3, ddragon3, 0, ROT0, "Technos Japan", "Double Dragon 3 - The Rosetta Stone (Japan)", GAME_SUPPORTS_SAVE )
10161016GAME( 1990, ddragon3p,ddragon3, ddragon3, ddragon3, 0, ROT0, "Technos Japan", "Double Dragon 3 - The Rosetta Stone (prototype)", GAME_SUPPORTS_SAVE )
1017GAME( 1990, ddragon3b,ddragon3, ddrago3b, ddrago3b, 0, ROT0, "bootleg", "Double Dragon 3 - The Rosetta Stone (bootleg)", GAME_SUPPORTS_SAVE )
1017GAME( 1990, ddragon3b,ddragon3, ddragon3b,ddragon3b,0, ROT0, "bootleg", "Double Dragon 3 - The Rosetta Stone (bootleg)", GAME_SUPPORTS_SAVE )
10181018GAME( 1990, ctribe,   0,        ctribe,   ctribe,   0, ROT0, "Technos Japan", "The Combatribes (US)", GAME_SUPPORTS_SAVE )
10191019GAME( 1990, ctribe1,  ctribe,   ctribe,   ctribe,   0, ROT0, "Technos Japan", "The Combatribes (US Set 1?)", GAME_SUPPORTS_SAVE )
10201020GAME( 1990, ctribej,  ctribe,   ctribe,   ctribe,   0, ROT0, "Technos Japan", "The Combatribes (Japan)", GAME_SUPPORTS_SAVE )
src/mame/drivers/gaplus.c
r7356r7357
144144
145145- Add 62XX custom to machine/namcoio.c (though it's quite different from 56XX and 58XX).
146146
147- Is the spirte generator the same as Phozon? This isn't clear yet. They are
147- Is the sprite generator the same as Phozon? This isn't clear yet. They are
148148  very similar, especially in the way the size flags are layed out.
149149
150150***************************************************************************/
src/mame/drivers/carpolo.c
r7356r7357
233233static MACHINE_DRIVER_START( carpolo )
234234
235235   /* basic machine hardware */
236   MDRV_CPU_ADD("maincpu", M6502,11289000/12)      /* 940.75 kHz */
236   MDRV_CPU_ADD("maincpu", M6502, XTAL_11_289MHz/12)      /* 940.75 kHz */
237237   MDRV_CPU_PROGRAM_MAP(main_map)
238238   MDRV_CPU_VBLANK_INT("screen", carpolo_timer_interrupt)   /* this not strictly VBLANK,
239239                                                       but it's supposed to happen 60
src/mame/drivers/flkatck.c
r7356r7357
305305
306306
307307
308GAME( 1987, mx5000,  0,     flkatck, flkatck, 0, ROT90, "Konami", "MX5000", GAME_SUPPORTS_SAVE )
308GAME( 1987, mx5000,  0,     flkatck, flkatck, 0, ROT90, "Konami", "MX5000", GAME_SUPPORTS_SAVE )
309309GAME( 1987, flkatck, mx5000, flkatck, flkatck, 0, ROT90, "Konami", "Flak Attack (Japan)", GAME_SUPPORTS_SAVE )
src/mame/drivers/zn.c
r7356r7357
2424#include "sound/qsound.h"
2525#include "sound/psx.h"
2626#include "sound/ymf271.h"
27#include "audio/taito_zm.h"
2728
2829#define VERBOSE_LEVEL ( 0 )
2930
r7356r7357
7980static const UINT8 mg04[ 8 ] = { 0xf0, 0xe1, 0x81, 0x82, 0xfa, 0x04, 0x3c, 0xc0 };
8081static const UINT8 mg05[ 8 ] = { 0x80, 0xc2, 0x38, 0xf9, 0xfd, 0x0c, 0x10, 0xe0 }; /* brute forced */
8182static const UINT8 mg06[ 8 ] = { 0xc0, 0xe2, 0xe1, 0xfd, 0x04, 0x78, 0x70, 0xf0 };
83static const UINT8 mg07[ 8 ] = { 0xe0, 0xc2, 0x38, 0xf9, 0xfd, 0x0c, 0x70, 0x80 };
8284static const UINT8 mg08[ 8 ] = { 0xf0, 0xfa, 0xf9, 0xc1, 0x20, 0x1c, 0x7c, 0x80 };
8385static const UINT8 mg09[ 8 ] = { 0xf0, 0x03, 0xe2, 0x18, 0x78, 0x7c, 0x3c, 0xc0 }; /* brute forced */
8486static const UINT8 mg10[ 8 ] = { 0xfc, 0xf2, 0x30, 0xc1, 0xf9, 0x78, 0x60, 0xe0 };
r7356r7357
156158   { "doapp",    mg01, mg05 }, /* OK */
157159   { "flamegun", mg01, mg06 }, /* OK */
158160   { "flamegunj",mg01, mg06 }, /* OK */
161   { "lpadv",    mg01, mg07 },
159162   { "glpracr3", mg01, mg08 },
160163   { "tondemo",  mg01, mg09 }, /* OK */
161164   { "1on1gov",  mg01, mg10 }, /* OK */
r7356r7357
13221325   }
13231326}
13241327
1328
13251329static MACHINE_DRIVER_START( coh1000tb )
13261330   MDRV_IMPORT_FROM( zn1_2mb_vram )
13271331
r7356r7357
13291333   MDRV_NVRAM_HANDLER( coh1000tb )
13301334
13311335   MDRV_MB3773_ADD("mb3773")
1336
1337   MDRV_IMPORT_FROM( taito_zoom_sound )
13321338MACHINE_DRIVER_END
13331339
13341340/*
r7356r7357
36973703   ROM_LOAD( "fb0b.326",              0x3000000, 0x400000, CRC(ad78ec79) SHA1(7e37a90a64c70f2c0024eaf30e1e4e028c0d858e) )
36983704ROM_END
36993705
3706ROM_START( lpadv )
3707   TPS_BIOS
3708
3709   ROM_REGION32_LE( 0xc00000, "user2", 0 )
3710        ROM_LOAD16_BYTE( "lp_3.u0119",   0x000001, 0x100000, CRC(18cade44) SHA1(8a44156224c77c51f4f6ca61a0168e48dfcc6eda) )
3711        ROM_LOAD16_BYTE( "lp_4.u0120",   0x000000, 0x100000, CRC(12fffc02) SHA1(3294b65e4a0bbf501785565dd0c1f36f9bcea969) )
3712        ROM_LOAD( "rp00.u0216",   0x400000, 0x400000, CRC(d759d0d4) SHA1(47b009a5dfa81611276b1376bdab44dfad597e85) )
3713        ROM_LOAD( "rp01.u0217",   0x800000, 0x400000, CRC(5be576e1) SHA1(e24a96d179016d6d65205079874b35500760a642) )
3714ROM_END
3715
37003716ROM_START( mfjump )
37013717   TPS_BIOS
37023718
r7356r7357
38073823   ROM_LOAD( "e25-02.2",            0x0800000, 0x400000, CRC(8e8b4c82) SHA1(55c9d4d3a08fc3226a75ab3a674be433af83e289) )
38083824   ROM_LOAD( "e25-03.12",           0x0c00000, 0x400000, CRC(43b1c085) SHA1(6e53550e9be0d2f415fc6b4f3b8a71185c5370b2) )
38093825
3810   ROM_REGION( 0x080000, "cpu1", 0 )
3826   ROM_REGION( 0x080000, "mn10200", 0 )
38113827   ROM_LOAD( "e25-10.14",    0x0000000, 0x080000, CRC(2b2ad1b1) SHA1(6d064d0b6805d43ce42929ac8f5645b56384f53c) )
38123828
3813   ROM_REGION( 0x600000, "unknown", 0 )
3829   ROM_REGION( 0x600000, "zsg1", 0 )
38143830   ROM_LOAD( "e25-04.27",    0x0000000, 0x400000, CRC(09a66d35) SHA1(f0df24bc9bfc9eb0f5150dc035c19fc5b8a39bf9) )
38153831   ROM_LOAD( "e25-05.28",    0x0040000, 0x200000, CRC(3fb57636) SHA1(aa38bfac11ecf10fd55143cf4525a2a529be8bb6) )
38163832ROM_END
r7356r7357
38253841   ROM_LOAD( "e25-02.2",            0x0800000, 0x400000, CRC(8e8b4c82) SHA1(55c9d4d3a08fc3226a75ab3a674be433af83e289) )
38263842   ROM_LOAD( "e25-03.12",           0x0c00000, 0x400000, CRC(43b1c085) SHA1(6e53550e9be0d2f415fc6b4f3b8a71185c5370b2) )
38273843
3828   ROM_REGION( 0x080000, "cpu1", 0 )
3844   ROM_REGION( 0x080000, "mn10200", 0 )
38293845   ROM_LOAD( "e25-10.14",    0x0000000, 0x080000, CRC(2b2ad1b1) SHA1(6d064d0b6805d43ce42929ac8f5645b56384f53c) )
38303846
3831   ROM_REGION( 0x600000, "unknown", 0 )
3847   ROM_REGION( 0x600000, "zsg1", 0 )
38323848   ROM_LOAD( "e25-04.27",    0x0000000, 0x400000, CRC(09a66d35) SHA1(f0df24bc9bfc9eb0f5150dc035c19fc5b8a39bf9) )
38333849   ROM_LOAD( "e25-05.28",    0x0040000, 0x200000, CRC(3fb57636) SHA1(aa38bfac11ecf10fd55143cf4525a2a529be8bb6) )
38343850ROM_END
r7356r7357
38433859   ROM_LOAD( "e25-02.2",            0x0800000, 0x400000, CRC(8e8b4c82) SHA1(55c9d4d3a08fc3226a75ab3a674be433af83e289) )
38443860   ROM_LOAD( "e25-03.12",           0x0c00000, 0x400000, CRC(43b1c085) SHA1(6e53550e9be0d2f415fc6b4f3b8a71185c5370b2) )
38453861
3846   ROM_REGION( 0x080000, "cpu1", 0 )
3862   ROM_REGION( 0x080000, "mn10200", 0 )
38473863   ROM_LOAD( "e25-10.14",    0x0000000, 0x080000, CRC(2b2ad1b1) SHA1(6d064d0b6805d43ce42929ac8f5645b56384f53c) )
38483864
3849   ROM_REGION( 0x600000, "unknown", 0 )
3865   ROM_REGION( 0x600000, "zsg1", 0 )
38503866   ROM_LOAD( "e25-04.27",    0x0000000, 0x400000, CRC(09a66d35) SHA1(f0df24bc9bfc9eb0f5150dc035c19fc5b8a39bf9) )
38513867   ROM_LOAD( "e25-05.28",    0x0040000, 0x200000, CRC(3fb57636) SHA1(aa38bfac11ecf10fd55143cf4525a2a529be8bb6) )
38523868ROM_END
r7356r7357
38613877   ROM_LOAD( "e39-02.2",            0x0800000, 0x400000, CRC(a47aab5d) SHA1(64b58e47035ad9d8d6dcaf475cbcc3ad85f4d82f) )
38623878   ROM_LOAD( "e39-03.12",           0x0c00000, 0x400000, CRC(a883b6a5) SHA1(b8d00d944c90f8cd9c2b076688f4c68b2e6d557a) )
38633879
3864   ROM_REGION( 0x080000, "cpu1", 0 )
3880   ROM_REGION( 0x080000, "mn10200", 0 )
38653881   ROM_LOAD( "e39-07.14",    0x0000000, 0x080000, CRC(2252c7c1) SHA1(92b9908e0d87cad6587f1acc0eef69eaae8c6a98) )
38663882
3867   ROM_REGION( 0x400000, "unknown", 0 )
3883   ROM_REGION( 0x400000, "zsg1", 0 )
38683884   ROM_LOAD( "e39-04.27",    0x0000000, 0x400000, CRC(6ee35e68) SHA1(fdfe63203d8cecf84cb869039fb893d5b63cdd67) )
38693885ROM_END
38703886
r7356r7357
38783894   ROM_LOAD( "e39-02.2",            0x0800000, 0x400000, CRC(a47aab5d) SHA1(64b58e47035ad9d8d6dcaf475cbcc3ad85f4d82f) )
38793895   ROM_LOAD( "e39-03.12",           0x0c00000, 0x400000, CRC(a883b6a5) SHA1(b8d00d944c90f8cd9c2b076688f4c68b2e6d557a) )
38803896
3881   ROM_REGION( 0x080000, "cpu1", 0 )
3897   ROM_REGION( 0x080000, "mn10200", 0 )
38823898   ROM_LOAD( "e39-07.14",    0x0000000, 0x080000, CRC(2252c7c1) SHA1(92b9908e0d87cad6587f1acc0eef69eaae8c6a98) )
38833899
3884   ROM_REGION( 0x400000, "unknown", 0 )
3900   ROM_REGION( 0x400000, "zsg1", 0 )
38853901   ROM_LOAD( "e39-04.27",    0x0000000, 0x400000, CRC(6ee35e68) SHA1(fdfe63203d8cecf84cb869039fb893d5b63cdd67) )
38863902ROM_END
38873903
r7356r7357
38953911   ROM_LOAD( "e39-02.2",            0x0800000, 0x400000, CRC(a47aab5d) SHA1(64b58e47035ad9d8d6dcaf475cbcc3ad85f4d82f) )
38963912   ROM_LOAD( "e39-03.12",           0x0c00000, 0x400000, CRC(a883b6a5) SHA1(b8d00d944c90f8cd9c2b076688f4c68b2e6d557a) )
38973913
3898   ROM_REGION( 0x080000, "cpu1", 0 )
3914   ROM_REGION( 0x080000, "mn10200", 0 )
38993915   ROM_LOAD( "e39-07.14",    0x0000000, 0x080000, CRC(2252c7c1) SHA1(92b9908e0d87cad6587f1acc0eef69eaae8c6a98) )
39003916
3901   ROM_REGION( 0x400000, "unknown", 0 )
3917   ROM_REGION( 0x400000, "zsg1", 0 )
39023918   ROM_LOAD( "e39-04.27",    0x0000000, 0x400000, CRC(6ee35e68) SHA1(fdfe63203d8cecf84cb869039fb893d5b63cdd67) )
39033919ROM_END
39043920
r7356r7357
40024018   ROM_LOAD( "e24-02.1",            0x0400000, 0x400000, CRC(9f70950d) SHA1(b3e4f925a61ae2e5dd4cc5d7ec3030a0d5c2c04d) )
40034019   ROM_LOAD( "e24-03.2",            0x0800000, 0x400000, CRC(6c1f0a5d) SHA1(1aac37a7ff23e54021a4cec18c9bb93242337180) )
40044020
4005   ROM_REGION( 0x080000, "cpu1", 0 )
4021   ROM_REGION16_LE( 0x080000, "mn10200", 0 )
40064022   ROM_LOAD( "e24-09.14",    0x0000000, 0x080000, CRC(808589e1) SHA1(46ada4c6d68c2462186a0b962abb435ee740c0ba) )
40074023
4008   ROM_REGION( 0x400000, "unknown", 0 )
4024   ROM_REGION( 0x400000, "zsg1", 0 )
40094025   ROM_LOAD( "e24-04.27",    0x0000000, 0x400000, CRC(f403493a) SHA1(3e49fd2a060a3893e26f14cc3cf47c4ba91e17d4) )
40104026ROM_END
40114027
r7356r7357
40184034   ROM_LOAD( "e24-02.1",            0x0400000, 0x400000, CRC(9f70950d) SHA1(b3e4f925a61ae2e5dd4cc5d7ec3030a0d5c2c04d) )
40194035   ROM_LOAD( "e24-03.2",            0x0800000, 0x400000, CRC(6c1f0a5d) SHA1(1aac37a7ff23e54021a4cec18c9bb93242337180) )
40204036
4021   ROM_REGION( 0x080000, "cpu1", 0 )
4037   ROM_REGION( 0x080000, "mn10200", 0 )
40224038   ROM_LOAD( "e24-09.14",    0x0000000, 0x080000, CRC(808589e1) SHA1(46ada4c6d68c2462186a0b962abb435ee740c0ba) )
40234039
4024   ROM_REGION( 0x400000, "unknown", 0 )
4040   ROM_REGION( 0x400000, "zsg1", 0 )
40254041   ROM_LOAD( "e24-04.27",    0x0000000, 0x400000, CRC(f403493a) SHA1(3e49fd2a060a3893e26f14cc3cf47c4ba91e17d4) )
40264042ROM_END
40274043
r7356r7357
44714487GAME( 1999, glpracr3,  tps,      coh1002m, zn, coh1002m, ROT0, "Tecmo", "Gallop Racer 3 (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44724488GAME( 1999, flamegun,  tps,      coh1002m, zn, coh1002m, ROT0, "GAPS Inc.", "Flame Gunner", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44734489GAME( 1999, flamegunj, flamegun, coh1002m, zn, coh1002m, ROT0, "GAPS Inc.", "Flame Gunner (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4490GAME( 1999, lpadv,     tps,      coh1002m, zn, coh1002m, ROT0, "Amuse World", "Logic Pro Adventure (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44744491GAME( 2000, tblkkuzu,  tps,      coh1002m, zn, coh1002m, ROT0, "Tamsoft/D3 Publisher", "The Block Kuzushi (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44754492GAME( 2000, 1on1gov,   tps,      coh1002m, zn, coh1002m, ROT0, "Tecmo", "1 on 1 Government (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
44764493GAME( 2000, tecmowcm,  tps,      coh1002m, zn, coh1002m, ROT0, "Tecmo", "Tecmo World Cup Millennium (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
src/mame/drivers/balsente.c
r7356r7357
766766INPUT_PORTS_END
767767
768768
769static INPUT_PORTS_START( minigol2 )
769static INPUT_PORTS_START( minigolf2 )
770770   PORT_INCLUDE( minigolf )
771771
772772   PORT_MODIFY("SWH")
r7356r7357
17481748    MOTHERBOARD_PALS
17491749ROM_END
17501750
1751ROM_START( nametune2 )
1752   ROM_REGION( 0x70000, "maincpu", 0 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
1753   ROM_LOAD( "nmetneur_ab_01.u8a",   0x10000, 0x4000, CRC(4044891d) SHA1(4e1e7cb9846939e03b035b95ba04f62a78719bb2) )
1754   ROM_CONTINUE(                     0x40000, 0x4000 )
1755   ROM_LOAD( "nmetneur_ab_23.u7a",   0x14000, 0x4000, CRC(df3454bc) SHA1(82faf87ca8974629e546b6854718908721b64ad0) )
1756   ROM_CONTINUE(                     0x44000, 0x4000 )
1757   ROM_LOAD( "nmetneur_ab_45.u6a",   0x18000, 0x4000, CRC(fb4050b0) SHA1(a4d185e02aa08e886b90454f681f49de3de76f86) )
1758   ROM_CONTINUE(                     0x48000, 0x4000 )
1759   ROM_LOAD( "nmetneur_ab_67.u5a",   0x1c000, 0x4000, CRC(276a28f4) SHA1(cceeb9c05ff72cfe86ab55555055cf8195d3ea16) )
1760   ROM_CONTINUE(                     0x4c000, 0x4000 )
1761   ROM_LOAD( "nmetneur_cd_01.u4a",   0x20000, 0x4000, CRC(88bed028) SHA1(69c83ba07f34dd1d45f432e2ed6a50e2d13c4acb) )
1762   ROM_CONTINUE(                     0x50000, 0x4000 )
1763   ROM_LOAD( "nmetneur_cd_23.u3a",   0x24000, 0x4000, CRC(38c63308) SHA1(1a26642cbe91ebc96444eb05fa1454c9175d370c) )
1764   ROM_CONTINUE(                     0x54000, 0x4000 )
1765   ROM_LOAD( "nmetneur_cd_45.u2a",   0x28000, 0x4000, CRC(d19a3671) SHA1(b68010ad235175c73258f64f9a64b37b2a06efdc) )
1766   ROM_CONTINUE(                     0x58000, 0x4000 )
1767   ROM_LOAD( "nmetneur_cd_6_ef.u1a", 0x2c000, 0x4000, CRC(e73c7cda) SHA1(c6f751923d0c7930db2e173f680674759f94c8bb) )
1768   ROM_CONTINUE(                     0x5c000, 0x4000 )
17511769
1770   ROM_REGION( 0x10000, "audiocpu", 0 )      /* 64k for Z80 */
1771   ROM_LOAD( "sentesnd",  0x00000, 0x2000, CRC(4dd0a525) SHA1(f0c447adc5b67917851a9df978df851247e75c43) )
1772
1773   ROM_REGION( 0x10000, "gfx1", 0 )      /* up to 64k of sprites */
1774   ROM_LOAD( "nmetneur_gr_0.u3c", 0x00000, 0x8000, CRC(a0121b80) SHA1(ba38e9b738baac85fa33ae3751d02cb223fa3e65) )
1775
1776    ROM_REGION( 0x00001, "cart_pals", 0) /* PAL's located on the cartridge */
1777    ROM_LOAD( "pal16r8.u7c", 0x0000, 0x0001, NO_DUMP )  /* PAL16R8ANC */
1778
1779    MOTHERBOARD_PALS
1780ROM_END
1781
17521782/*
17531783    Night Stocker
17541784
r7356r7357
20802110static DRIVER_INIT( triviaes ) { expand_roms(machine, EXPAND_NONE | SWAP_HALVES); config_shooter_adc(machine, FALSE, 0 /* noanalog */); }
20812111static DRIVER_INIT( gimeabrk ) { expand_roms(machine, EXPAND_ALL);  config_shooter_adc(machine, FALSE, 1); }
20822112static DRIVER_INIT( minigolf ) { expand_roms(machine, EXPAND_NONE); config_shooter_adc(machine, FALSE, 2); }
2083static DRIVER_INIT( minigol2 ) { expand_roms(machine, 0x0c);        config_shooter_adc(machine, FALSE, 2); }
2113static DRIVER_INIT( minigolf2 ) { expand_roms(machine, 0x0c);        config_shooter_adc(machine, FALSE, 2); }
20842114static DRIVER_INIT( toggle )   { expand_roms(machine, EXPAND_ALL);  config_shooter_adc(machine, FALSE, 0 /* noanalog */); }
20852115static DRIVER_INIT( nametune )
20862116{
r7356r7357
21552185GAMEL(1984, stocker,  0,        balsente, stocker,  stocker,  ROT0, "Bally/Sente",  "Stocker", GAME_SUPPORTS_SAVE, layout_stocker )
21562186GAME( 1985, gimeabrk, 0,        balsente, gimeabrk, gimeabrk, ROT0, "Bally/Sente",  "Gimme A Break", GAME_SUPPORTS_SAVE )
21572187GAME( 1985, minigolf, 0,        balsente, minigolf, minigolf, ROT0, "Bally/Sente",  "Mini Golf (set 1)", GAME_SUPPORTS_SAVE )
2158GAME( 1985, minigolf2,minigolf, balsente, minigol2, minigol2, ROT0, "Bally/Sente",  "Mini Golf (set 2)", GAME_SUPPORTS_SAVE )
2188GAME( 1985, minigolf2,minigolf, balsente, minigolf2,minigolf2,ROT0, "Bally/Sente",  "Mini Golf (set 2)", GAME_SUPPORTS_SAVE )
21592189
21602190/* Board: Unknown (Baby Boomer Edition uses 006-8025-01-0B Rev B board.  Do the rest use it too? */
21612191GAME( 1984, triviag1, 0,        balsente, triviag1, triviag1, ROT0, "Bally/Sente",  "Trivial Pursuit (Genus I) (set 1)", GAME_SUPPORTS_SAVE )
r7356r7357
21682198GAME( 1985, toggle,   0,        balsente, toggle,   toggle,   ROT0, "Bally/Sente",  "Toggle (prototype)", GAME_SUPPORTS_SAVE )
21692199GAME( 1986, nametune, 0,        balsente, nametune, nametune, ROT0, "Bally/Sente",  "Name That Tune", GAME_SUPPORTS_SAVE )
21702200
2201/* Board: 006-8030-01-0A Rev A */
2202GAME( 1986, nametune2,nametune, balsente, nametune, nametune, ROT0, "Bally/Sente",  "Name That Tune (3-23-86)", GAME_SUPPORTS_SAVE )
2203
21712204/* Board: 006-8027-01-0B Rev B */
21722205GAME( 1986, nstocker, 0,        balsente, nstocker, nstocker, ROT0, "Bally/Sente",  "Night Stocker (set 1)", GAME_SUPPORTS_SAVE )
21732206GAME( 1986, nstocker2,nstocker, balsente, nstocker, nstocker, ROT0, "Bally/Sente",  "Night Stocker (set 2)", GAME_SUPPORTS_SAVE )
src/mame/drivers/ddribble.c
r0r7357
1/***************************************************************************
2
3    Double Dribble (GX690) (c) Konami 1986
4
5    Driver by Manuel Abadia <manu@teleline.es>
6
7    2008-08
8    Dip locations and suggested settings verified with US manual.
9
10***************************************************************************/
11
12#include "emu.h"
13#include "cpu/m6809/m6809.h"
14#include "sound/2203intf.h"
15#include "sound/vlm5030.h"
16#include "sound/flt_rc.h"
17#include "includes/konamipt.h"
18#include "includes/ddribble.h"
19
20
21static INTERRUPT_GEN( ddribble_interrupt_0 )
22{
23   ddribble_state *state = (ddribble_state *)device->machine->driver_data;
24   if (state->int_enable_0)
25      cpu_set_input_line(device, M6809_FIRQ_LINE, HOLD_LINE);
26}
27
28static INTERRUPT_GEN( ddribble_interrupt_1 )
29{
30   ddribble_state *state = (ddribble_state *)device->machine->driver_data;
31   if (state->int_enable_1)
32      cpu_set_input_line(device, M6809_FIRQ_LINE, HOLD_LINE);
33}
34
35
36static WRITE8_HANDLER( ddribble_bankswitch_w )
37{
38   memory_set_bank(space->machine, "bank1", data & 0x0f);
39}
40
41
42static READ8_HANDLER( ddribble_sharedram_r )
43{
44   ddribble_state *state = (ddribble_state *)space->machine->driver_data;
45   return state->sharedram[offset];
46}
47
48static WRITE8_HANDLER( ddribble_sharedram_w )
49{
50   ddribble_state *state = (ddribble_state *)space->machine->driver_data;
51   state->sharedram[offset] = data;
52}
53
54static READ8_HANDLER( ddribble_snd_sharedram_r )
55{
56   ddribble_state *state = (ddribble_state *)space->machine->driver_data;
57   return state->snd_sharedram[offset];
58}
59
60static WRITE8_HANDLER( ddribble_snd_sharedram_w )
61{
62   ddribble_state *state = (ddribble_state *)space->machine->driver_data;
63   state->snd_sharedram[offset] = data;
64}
65
66static WRITE8_HANDLER( ddribble_coin_counter_w )
67{
68   /* b4-b7: unused */
69   /* b2-b3: unknown */
70   /* b1: coin counter 2 */
71   /* b0: coin counter 1 */
72   coin_counter_w(space->machine, 0,(data) & 0x01);
73   coin_counter_w(space->machine, 1,(data >> 1) & 0x01);
74}
75
76static READ8_DEVICE_HANDLER( ddribble_vlm5030_busy_r )
77{
78   return mame_rand(device->machine); /* patch */
79   /* FIXME: remove ? */
80#if 0
81   if (vlm5030_bsy(device)) return 1;
82   else return 0;
83#endif
84}
85
86static WRITE8_DEVICE_HANDLER( ddribble_vlm5030_ctrl_w )
87{
88   ddribble_state *state = (ddribble_state *)device->machine->driver_data;
89   UINT8 *SPEECH_ROM = memory_region(device->machine, "vlm");
90
91   /* b7 : vlm data bus OE   */
92
93   /* b6 : VLM5030-RST       */
94   vlm5030_rst(device, data & 0x40 ? 1 : 0);
95
96   /* b5 : VLM5030-ST        */
97   vlm5030_st(device, data & 0x20 ? 1 : 0);
98
99   /* b4 : VLM5300-VCU       */
100   vlm5030_vcu(device, data & 0x10 ? 1 : 0);
101
102   /* b3 : ROM bank select   */
103   vlm5030_set_rom(device, &SPEECH_ROM[data & 0x08 ? 0x10000 : 0]);
104
105   /* b2 : SSG-C rc filter enable */
106   filter_rc_set_RC(state->filter3, FLT_RC_LOWPASS, 1000, 2200, 1000, data & 0x04 ? CAP_N(150) : 0); /* YM2203-SSG-C */
107
108   /* b1 : SSG-B rc filter enable */
109   filter_rc_set_RC(state->filter2, FLT_RC_LOWPASS, 1000, 2200, 1000, data & 0x02 ? CAP_N(150) : 0); /* YM2203-SSG-B */
110
111   /* b0 : SSG-A rc filter enable */
112   filter_rc_set_RC(state->filter1, FLT_RC_LOWPASS, 1000, 2200, 1000, data & 0x01 ? CAP_N(150) : 0); /* YM2203-SSG-A */
113}
114
115
116static ADDRESS_MAP_START( cpu0_map, ADDRESS_SPACE_PROGRAM, 8 )
117   AM_RANGE(0x0000, 0x0004) AM_WRITE(K005885_0_w)                                    /* video registers (005885 #1) */
118   AM_RANGE(0x0800, 0x0804) AM_WRITE(K005885_1_w)                                    /* video registers (005885 #2) */
119   AM_RANGE(0x1800, 0x187f) AM_RAM AM_BASE_MEMBER(ddribble_state, paletteram)                              /* palette */
120   AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(ddribble_fg_videoram_w) AM_BASE_MEMBER(ddribble_state, fg_videoram)   /* Video RAM 1 */
121   AM_RANGE(0x3000, 0x3fff) AM_RAM AM_BASE_MEMBER(ddribble_state, spriteram_1)                        /* Object RAM 1 */
122   AM_RANGE(0x4000, 0x5fff) AM_RAM AM_BASE_MEMBER(ddribble_state, sharedram)                           /* shared RAM with CPU #1 */
123   AM_RANGE(0x6000, 0x6fff) AM_RAM_WRITE(ddribble_bg_videoram_w) AM_BASE_MEMBER(ddribble_state, bg_videoram)   /* Video RAM 2 */
124   AM_RANGE(0x7000, 0x7fff) AM_RAM AM_BASE_MEMBER(ddribble_state, spriteram_2)                        /* Object RAM 2 */
125   AM_RANGE(0x8000, 0x8000) AM_WRITE(ddribble_bankswitch_w)                              /* bankswitch control */
126   AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1")                                          /* banked ROM */
127   AM_RANGE(0xa000, 0xffff) AM_ROM                                                /* ROM */
128ADDRESS_MAP_END
129
130static ADDRESS_MAP_START( cpu1_map, ADDRESS_SPACE_PROGRAM, 8 )
131   AM_RANGE(0x0000, 0x1fff) AM_READWRITE(ddribble_sharedram_r, ddribble_sharedram_w)         /* shared RAM with CPU #0 */
132   AM_RANGE(0x2000, 0x27ff) AM_READWRITE(ddribble_snd_sharedram_r, ddribble_snd_sharedram_w)   /* shared RAM with CPU #2 */
133   AM_RANGE(0x2800, 0x2800) AM_READ_PORT("DSW1")
134   AM_RANGE(0x2801, 0x2801) AM_READ_PORT("P1")
135   AM_RANGE(0x2802, 0x2802) AM_READ_PORT("P2")
136   AM_RANGE(0x2803, 0x2803) AM_READ_PORT("SYSTEM")                                 /* coinsw & start */
137   AM_RANGE(0x2c00, 0x2c00) AM_READ_PORT("DSW2")
138   AM_RANGE(0x3000, 0x3000) AM_READ_PORT("DSW3")
139   AM_RANGE(0x3400, 0x3400) AM_WRITE(ddribble_coin_counter_w)                        /* coin counters */
140   AM_RANGE(0x3c00, 0x3c00) AM_WRITE(watchdog_reset_w)                              /* watchdog reset */
141   AM_RANGE(0x8000, 0xffff) AM_ROM                                             /* ROM */
142ADDRESS_MAP_END
143
144static ADDRESS_MAP_START( cpu2_map, ADDRESS_SPACE_PROGRAM, 8 )
145   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE_MEMBER(ddribble_state, snd_sharedram)      /* shared RAM with CPU #1 */
146   AM_RANGE(0x1000, 0x1001) AM_DEVREADWRITE("ymsnd", ym2203_r, ym2203_w)   /* YM2203 */
147   AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("vlm", vlm5030_data_w)         /* Speech data */
148   AM_RANGE(0x8000, 0xffff) AM_ROM                              /* ROM */
149ADDRESS_MAP_END
150
151static INPUT_PORTS_START( ddribble )
152   PORT_START("P1")
153   KONAMI8_B132(1)
154   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
155
156   PORT_START("P2")
157   KONAMI8_B132(2)
158   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
159
160   PORT_START("SYSTEM")
161   KONAMI8_SYSTEM_UNK
162
163   PORT_START("DSW1")
164   KONAMI_COINAGE_ALT_LOC(SW1)
165
166   PORT_START("DSW2")
167   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "SW2:1" )   /* Manual says it's Unused */
168   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW2:2" )   /* Manual says it's Unused */
169   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
170   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
171   PORT_DIPSETTING(   0x04, DEF_STR( Cocktail ) )
172   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW2:4" )   /* Manual says it's Unused */
173   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW2:5" )   /* Manual says it's Unused */
174   PORT_DIPNAME( 0x60, 0x20, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7")
175   PORT_DIPSETTING(   0x60, DEF_STR( Easy ) )
176   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
177   PORT_DIPSETTING(   0x20, DEF_STR( Hard ) )
178   PORT_DIPSETTING(   0x00, DEF_STR( Hardest ) )
179   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8")
180   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
181   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
182
183   PORT_START("DSW3")
184   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW3:1")
185   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
186   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
187   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW3:2" )   /* Manual says it's Unused */
188   PORT_SERVICE_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW3:3" )
189   PORT_DIPNAME( 0x08, 0x08, "Allow vs match with 1 Credit" ) PORT_DIPLOCATION("SW3:4")
190   PORT_DIPSETTING(   0x08, DEF_STR( Off ) )
191   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
192   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
193   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
194   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
195   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
196INPUT_PORTS_END
197
198
199
200static const gfx_layout charlayout =
201{
202   8,8,
203   RGN_FRAC(1,2),
204   4,
205   { 0, 1, 2, 3 },
206   { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 },
207   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
208   32*8
209};
210
211static const gfx_layout spritelayout =
212{
213   16,16,
214   RGN_FRAC(1,2),
215   4,
216   { 0, 1, 2, 3 },
217   { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
218         32*8+0*4, 32*8+1*4, 32*8+2*4, 32*8+3*4, 32*8+4*4, 32*8+5*4, 32*8+6*4, 32*8+7*4 },
219   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
220         16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 },
221   32*32
222};
223
224static GFXDECODE_START( ddribble )
225   GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout,    48,  1 )   /* colors 48-63 */
226   GFXDECODE_ENTRY( "gfx2", 0x00000, charlayout,    16,  1 )   /* colors 16-31 */
227   GFXDECODE_ENTRY( "gfx1", 0x20000, spritelayout,  32,  1 )   /* colors 32-47 */
228   GFXDECODE_ENTRY( "gfx2", 0x40000, spritelayout,  64, 16 )   /* colors  0-15 but using lookup table */
229GFXDECODE_END
230
231static const ym2203_interface ym2203_config =
232{
233   {
234      AY8910_LEGACY_OUTPUT,
235      AY8910_DEFAULT_LOADS,
236      DEVCB_NULL,
237      DEVCB_DEVICE_HANDLER("vlm", ddribble_vlm5030_busy_r),
238      DEVCB_DEVICE_HANDLER("vlm", ddribble_vlm5030_ctrl_w),
239      DEVCB_NULL
240   },
241   NULL
242};
243
244static const vlm5030_interface vlm5030_config =
245{
246   0x10000     /* memory size 64Kbyte * 2 bank */
247};
248
249
250
251static MACHINE_START( ddribble )
252{
253   ddribble_state *state = (ddribble_state *)machine->driver_data;
254   UINT8 *ROM = memory_region(machine, "maincpu");
255   memory_configure_bank(machine, "bank1", 0, 5, &ROM[0x10000], 0x2000);
256
257   state->filter1 = devtag_get_device(machine, "filter1");
258   state->filter2 = devtag_get_device(machine, "filter2");
259   state->filter3 = devtag_get_device(machine, "filter3");
260
261   state_save_register_global(machine, state->int_enable_0);
262   state_save_register_global(machine, state->int_enable_1);
263   state_save_register_global_array(machine, state->vregs[0]);
264   state_save_register_global_array(machine, state->vregs[1]);
265   state_save_register_global_array(machine, state->charbank);
266}
267
268static MACHINE_RESET( ddribble )
269{
270   ddribble_state *state = (ddribble_state *)machine->driver_data;
271   int i;
272
273   for (i = 0; i < 5; i++)
274   {
275      state->vregs[0][i] = 0;
276      state->vregs[1][i] = 0;
277   }
278
279   state->int_enable_0 = 0;
280   state->int_enable_1 = 0;
281   state->charbank[0] = 0;
282   state->charbank[1] = 0;
283}
284
285static MACHINE_DRIVER_START( ddribble )
286
287   /* driver data */
288   MDRV_DRIVER_DATA(ddribble_state)
289
290   /* basic machine hardware */
291   MDRV_CPU_ADD("maincpu", M6809,   XTAL_18_432MHz/12)   /* verified on pcb */
292   MDRV_CPU_PROGRAM_MAP(cpu0_map)
293   MDRV_CPU_VBLANK_INT("screen", ddribble_interrupt_0)
294
295   MDRV_CPU_ADD("cpu1", M6809,   XTAL_18_432MHz/12)   /* verified on pcb */
296   MDRV_CPU_PROGRAM_MAP(cpu1_map)
297   MDRV_CPU_VBLANK_INT("screen", ddribble_interrupt_1)
298
299   MDRV_CPU_ADD("cpu2", M6809,   XTAL_18_432MHz/12)   /* verified on pcb */
300   MDRV_CPU_PROGRAM_MAP(cpu2_map)
301
302   MDRV_QUANTUM_TIME(HZ(6000))   /* we need heavy synch */
303
304   MDRV_MACHINE_START(ddribble)
305   MDRV_MACHINE_RESET(ddribble)
306
307   /* video hardware */
308   MDRV_SCREEN_ADD("screen", RASTER)
309   MDRV_SCREEN_REFRESH_RATE(60)
310   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
311   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
312   MDRV_SCREEN_SIZE(32*8, 32*8)
313   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
314/*  MDRV_SCREEN_SIZE(64*8, 32*8)
315    MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1) */
316
317   MDRV_GFXDECODE(ddribble)
318   MDRV_PALETTE_LENGTH(64 + 256)
319
320   MDRV_PALETTE_INIT(ddribble)
321   MDRV_VIDEO_START(ddribble)
322   MDRV_VIDEO_UPDATE(ddribble)
323
324   /* sound hardware */
325   MDRV_SPEAKER_STANDARD_MONO("mono")
326
327   MDRV_SOUND_ADD("ymsnd", YM2203, XTAL_3_579545MHz) /* verified on pcb */
328   MDRV_SOUND_CONFIG(ym2203_config)
329   MDRV_SOUND_ROUTE(0, "filter1", 0.25)
330   MDRV_SOUND_ROUTE(1, "filter2", 0.25)
331   MDRV_SOUND_ROUTE(2, "filter3", 0.25)
332   MDRV_SOUND_ROUTE(3, "mono", 0.25)
333
334   MDRV_SOUND_ADD("vlm", VLM5030, XTAL_3_579545MHz) /* verified on pcb */
335   MDRV_SOUND_CONFIG(vlm5030_config)
336   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
337
338   MDRV_SOUND_ADD("filter1", FILTER_RC, 0)
339   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
340   MDRV_SOUND_ADD("filter2", FILTER_RC, 0)
341   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
342   MDRV_SOUND_ADD("filter3", FILTER_RC, 0)
343   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
344MACHINE_DRIVER_END
345
346
347ROM_START( ddribble )
348   ROM_REGION( 0x1a000, "maincpu", 0 ) /* 64K CPU #0 + 40K for Banked ROMS */
349   ROM_LOAD( "690c03.bin",   0x10000, 0x0a000, CRC(07975a58) SHA1(96fd1b2348bbdf560067d8ee3cd4c0514e263d7a) )
350   ROM_CONTINUE(         0x0a000, 0x06000 )
351
352   ROM_REGION( 0x10000, "cpu1", 0 ) /* 64 for the CPU #1 */
353   ROM_LOAD( "690c02.bin", 0x08000, 0x08000, CRC(f07c030a) SHA1(db96a10f8bb657bf285266db9e775fa6af82f38c) )
354
355   ROM_REGION( 0x10000, "cpu2", 0 )   /* 64k for the SOUND CPU */
356   ROM_LOAD( "690b01.bin", 0x08000, 0x08000, CRC(806b8453) SHA1(3184772c5e5181438a17ac72129070bf164b2965) )
357
358   ROM_REGION( 0x40000, "gfx1", 0 )
359   ROM_LOAD16_BYTE( "690a05.bin",   0x00000, 0x20000, CRC(6a816d0d) SHA1(73f2527d5f2b9d51b784be36e07e0d0c566a28d9) )   /* characters & objects */
360   ROM_LOAD16_BYTE( "690a06.bin",   0x00001, 0x20000, CRC(46300cd0) SHA1(07197a546fff452a41575fcd481da64ac6bf601e) )
361
362   ROM_REGION( 0x80000, "gfx2", 0 )
363   ROM_LOAD16_BYTE( "690a10.bin", 0x00000, 0x20000, CRC(61efa222) SHA1(bd7b993ad1c06d8f6ac29fbc07c4a987abe1ab42) )   /* characters */
364   ROM_LOAD16_BYTE( "690a09.bin", 0x00001, 0x20000, CRC(ab682186) SHA1(a28982835042a07354557e1539b097cdf93fc466) )
365   ROM_LOAD16_BYTE( "690a08.bin", 0x40000, 0x20000, CRC(9a889944) SHA1(ca96815aefb1e336bd2288841b00a5c21cacf90f) )   /* objects */
366   ROM_LOAD16_BYTE( "690a07.bin", 0x40001, 0x20000, CRC(faf81b3f) SHA1(0bd647b4cdd3f2209472e303fd22eedd5533d1b1) )
367
368   ROM_REGION( 0x0100, "proms", 0 )
369   ROM_LOAD( "690a11.i15", 0x0000, 0x0100, CRC(f34617ad) SHA1(79ceba6fe204472a5a659641ac4f14bb1f0ee3f6) )   /* sprite lookup table */
370
371   ROM_REGION( 0x20000, "vlm", 0 )   /* 128k for the VLM5030 data */
372   ROM_LOAD( "690a04.bin", 0x00000, 0x20000, CRC(1bfeb763) SHA1(f3e9acb2a7a9b4c8dee6838c1344a7a65c27ff77) )
373
374   ROM_REGION( 0x0100, "plds", 0 )
375   ROM_LOAD( "pal10l8-007553.bin", 0x0000, 0x002c, CRC(0ae5a161) SHA1(87571addf434b332019ea0e22372eb24b4fd0197) )
376ROM_END
377
378
379GAME( 1986, ddribble, 0, ddribble, ddribble, 0, ROT0, "Konami", "Double Dribble", GAME_SUPPORTS_SAVE )
src/mame/drivers/bestleag.c
r7356r7357
22
33Best League (c) 1993
44
5A Big Striker Italian bootleg (made by Playmark?) running on a different hardware, and with
6Italian Serie A teams instead of the national teams.
5A Big Striker Italian bootleg (made by Playmark?) running on a different hardware.
76
87driver by David Haywood & Angelo Salese
98
r7356r7357
158157   return 0;
159158}
160159
160static VIDEO_UPDATE(bestleaw)
161{
162   tilemap_set_scrollx(bg_tilemap,0,bestleag_vregs[0x08/2]);
163   tilemap_set_scrolly(bg_tilemap,0,bestleag_vregs[0x0a/2]);
164   tilemap_set_scrollx(tx_tilemap,0,bestleag_vregs[0x00/2]);
165   tilemap_set_scrolly(tx_tilemap,0,bestleag_vregs[0x02/2]);
166   tilemap_set_scrollx(fg_tilemap,0,bestleag_vregs[0x04/2]);
167   tilemap_set_scrolly(fg_tilemap,0,bestleag_vregs[0x06/2]);
168
169   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
170   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
171   draw_sprites(screen->machine,bitmap,cliprect);
172   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
173   return 0;
174}
175
161176static WRITE16_HANDLER( bestleag_txram_w )
162177{
163178   bestleag_txram[offset] = data;
r7356r7357
317332   MDRV_CPU_PROGRAM_MAP(bestleag_map)
318333   MDRV_CPU_VBLANK_INT("screen", irq6_line_hold)
319334
320
321335   MDRV_SCREEN_ADD("screen", RASTER)
322336   MDRV_SCREEN_REFRESH_RATE(60)
323337   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
r7356r7357
339353   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
340354MACHINE_DRIVER_END
341355
356static MACHINE_DRIVER_START( bestleaw )
357   MDRV_IMPORT_FROM(bestleag)
358
359   MDRV_VIDEO_UPDATE(bestleaw)
360MACHINE_DRIVER_END
361
362
342363/* Rom Loading */
343364
344365ROM_START( bestleag )
r7356r7357
358379   ROM_LOAD( "29_27c010.u84", 0x040000, 0x20000, CRC(7ea4e22d) SHA1(3c7f05dfd1c5889bfcbc14d08026e2a484870216) )
359380   ROM_LOAD( "30_27c010.u83", 0x060000, 0x20000, CRC(283d9ba6) SHA1(6054853f76907a4a0f89ad5aa02dde9d3d4ff196) )
360381
361   ROM_REGION( 0x80000, "user1", 0 ) /* Samples */
382   ROM_REGION( 0x80000, "oki_rom", 0 ) /* Samples */
362383   ROM_LOAD( "20_27c040.u16", 0x00000, 0x80000, CRC(e152138e) SHA1(9d41b61b98414e1d5804b5a9edf4acb4c5f31615) )
363384
364385   ROM_REGION( 0xc0000, "oki", 0 )
365   ROM_COPY( "user1", 0x000000, 0x000000, 0x020000)
366   ROM_COPY( "user1", 0x020000, 0x020000, 0x020000)
367   ROM_COPY( "user1", 0x000000, 0x040000, 0x020000)
368   ROM_COPY( "user1", 0x040000, 0x060000, 0x020000)
369   ROM_COPY( "user1", 0x000000, 0x080000, 0x020000)
370   ROM_COPY( "user1", 0x060000, 0x0a0000, 0x020000)
386   ROM_COPY( "oki_rom", 0x000000, 0x000000, 0x020000)
387   ROM_COPY( "oki_rom", 0x020000, 0x020000, 0x020000)
388   ROM_COPY( "oki_rom", 0x000000, 0x040000, 0x020000)
389   ROM_COPY( "oki_rom", 0x040000, 0x060000, 0x020000)
390   ROM_COPY( "oki_rom", 0x000000, 0x080000, 0x020000)
391   ROM_COPY( "oki_rom", 0x060000, 0x0a0000, 0x020000)
371392ROM_END
372393
373394ROM_START( bestleaw )
r7356r7357
387408   ROM_LOAD( "29_27c010.u84", 0x040000, 0x20000, CRC(7ea4e22d) SHA1(3c7f05dfd1c5889bfcbc14d08026e2a484870216) )
388409   ROM_LOAD( "30_27c010.u83", 0x060000, 0x20000, CRC(283d9ba6) SHA1(6054853f76907a4a0f89ad5aa02dde9d3d4ff196) )
389410
390   ROM_REGION( 0x80000, "user1", 0 ) /* Samples */
411   ROM_REGION( 0x80000, "oki_rom", 0 ) /* Samples */
391412   ROM_LOAD( "20_27c040.u16", 0x00000, 0x80000, CRC(e152138e) SHA1(9d41b61b98414e1d5804b5a9edf4acb4c5f31615) )
392413
393414   ROM_REGION( 0xc0000, "oki", 0 )
394   ROM_COPY( "user1", 0x000000, 0x000000, 0x020000)
395   ROM_COPY( "user1", 0x020000, 0x020000, 0x020000)
396   ROM_COPY( "user1", 0x000000, 0x040000, 0x020000)
397   ROM_COPY( "user1", 0x040000, 0x060000, 0x020000)
398   ROM_COPY( "user1", 0x000000, 0x080000, 0x020000)
399   ROM_COPY( "user1", 0x060000, 0x0a0000, 0x020000)
415   ROM_COPY( "oki_rom", 0x000000, 0x000000, 0x020000)
416   ROM_COPY( "oki_rom", 0x020000, 0x020000, 0x020000)
417   ROM_COPY( "oki_rom", 0x000000, 0x040000, 0x020000)
418   ROM_COPY( "oki_rom", 0x040000, 0x060000, 0x020000)
419   ROM_COPY( "oki_rom", 0x000000, 0x080000, 0x020000)
420   ROM_COPY( "oki_rom", 0x060000, 0x0a0000, 0x020000)
400421
401422   ROM_REGION( 0x2000, "plds", 0 )
402423   ROM_LOAD( "85c060.bin",            0x0000, 0x032f, CRC(537100ac) SHA1(3d5e9013e3cba660671f02e78c233c866dad2e53) )
403424   ROM_LOAD( "gal16v8-25hb1.u182",    0x0200, 0x0117, NO_DUMP ) /* Protected */
404425   ROM_LOAD( "gal16v8-25hb1.u183",    0x0400, 0x0117, NO_DUMP ) /* Protected */
405426   ROM_LOAD( "gal16v8-25hb1.u58",     0x0800, 0x0117, NO_DUMP ) /* Protected */
406      ROM_LOAD( "palce20v8h-15pc-4.u38", 0x1000, 0x0157, NO_DUMP ) /* Protected */
427   ROM_LOAD( "palce20v8h-15pc-4.u38", 0x1000, 0x0157, NO_DUMP ) /* Protected */
407428ROM_END
408429
409430/* GAME drivers */
410431
411GAME( 1993, bestleag, bigstrik, bestleag, bestleag, 0, ROT0, "bootleg", "Best League", 0 )
412GAME( 1993, bestleaw, bigstrik, bestleag, bestleag, 0, ROT0, "bootleg", "Best League (World)", GAME_IMPERFECT_GRAPHICS )
432GAME( 1993, bestleag, bigstrik, bestleag, bestleag, 0, ROT0, "bootleg", "Best League (bootleg of Big Striker, Italian Serie A)", 0 )
433GAME( 1993, bestleaw, bigstrik, bestleaw, bestleag, 0, ROT0, "bootleg", "Best League (bootleg of Big Striker, World Cup)", 0 )
413434
src/mame/drivers/fastfred.c
r7356r7357
996996GAME( 1983, jumpcoast,jumpcoas, jumpcoas, jumpcoas, jumpcoas, ROT90, "Taito", "Jump Coaster (Taito)", 0 )
997997GAME( 1983, boggy84,  0,        jumpcoas, boggy84,  boggy84,  ROT90, "bootleg", "Boggy '84", 0 )
998998GAME( 1986, redrobin, 0,        fastfred, redrobin, flyboyb,  ROT90, "Elettronolo", "Red Robin", 0 )
999GAME( 1984, imago,     0,      imago,    imago,    imago,    ROT90, "Acom", "Imago (cocktail set)", 0 )
1000GAME( 1983, imagoa,     imago,   imago,    imagoa,   imago,    ROT90, "Acom", "Imago (no cocktail set)", 0 )
999GAME( 1984, imago,    0,   imago,    imago,    imago,    ROT90, "Acom", "Imago (cocktail set)", 0 )
1000GAME( 1983, imagoa,   imago,   imago,    imagoa,   imago,    ROT90, "Acom", "Imago (no cocktail set)", 0 )
src/mame/drivers/lwings.c
r7356r7357
335335   AM_RANGE(0xf802, 0xf803) AM_WRITE(lwings_bg1_scrolly_w)
336336   AM_RANGE(0xf804, 0xf804) AM_WRITE(trojan_bg2_scrollx_w)
337337   AM_RANGE(0xf805, 0xf805) AM_WRITE(trojan_bg2_image_w)
338   AM_RANGE(0xf808, 0xf808) AM_READ_PORT("SERVICE")
338   AM_RANGE(0xf808, 0xf808) AM_READ_PORT("SERVICE") AM_WRITENOP //watchdog
339339   AM_RANGE(0xf809, 0xf809) AM_READ_PORT("P1")
340340   AM_RANGE(0xf80a, 0xf80a) AM_READ_PORT("P2")
341341   AM_RANGE(0xf80b, 0xf80b) AM_READ_PORT("DSWA")
342342   AM_RANGE(0xf80c, 0xf80c) AM_READ_PORT("DSWB") AM_WRITE(soundlatch_w)
343   AM_RANGE(0xf80d, 0xf80d) AM_WRITE(watchdog_reset_w)
343   AM_RANGE(0xf80d, 0xf80d) AM_WRITE(soundlatch2_w)
344344   AM_RANGE(0xf80e, 0xf80e) AM_WRITE(lwings_bankswitch_w)
345345ADDRESS_MAP_END
346346
r7356r7357
367367
368368static ADDRESS_MAP_START( trojan_adpcm_io_map, ADDRESS_SPACE_IO, 8 )
369369   ADDRESS_MAP_GLOBAL_MASK(0xff)
370   AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r)
370   AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_r)
371371   AM_RANGE(0x01, 0x01) AM_DEVWRITE("5205", msm5205_w)
372372ADDRESS_MAP_END
373373
src/mame/drivers/segaybd.c
r7356r7357
2424
2525#include "emu.h"
2626#include "cpu/z80/z80.h"
27#include "includes/system16.h"
27#include "includes/segas16.h"
2828#include "cpu/m68000/m68000.h"
2929#include "machine/segaic16.h"
3030#include "sound/2151intf.h"
3131#include "sound/segapcm.h"
32#include "video/segaic16.h"
3233
3334#include "pdrift.lh"
3435
r7356r7357
4748 *
4849 *************************************/
4950
50static UINT8 misc_io_data[0x10];
51static UINT8 analog_data[4];
52
53static UINT8 vblank_irq_state;
54static UINT8 timer_irq_state;
55
5651static UINT16 *backupram;
5752
58static running_device *interrupt_timer;
59
60
61
6253/*************************************
6354 *
6455 *  Configuration
6556 *
6657 *************************************/
6758
68static void yboard_generic_init(void)
59static void yboard_generic_init( running_machine *machine )
6960{
61   segas1x_state *state = (segas1x_state *)machine->driver_data;
62
7063   /* reset globals */
71   vblank_irq_state = 0;
72   timer_irq_state = 0;
64   state->vblank_irq_state = 0;
65   state->timer_irq_state = 0;
7366}
7467
7568
r7356r7357
8275
8376static void update_main_irqs(running_machine *machine)
8477{
85   cputag_set_input_line(machine, "maincpu", 2, timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
86   cputag_set_input_line(machine, "subx", 2, timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
87   cputag_set_input_line(machine, "suby", 2, timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
88   cputag_set_input_line(machine, "maincpu", 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
89   cputag_set_input_line(machine, "subx", 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
90   cputag_set_input_line(machine, "suby", 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
91   cputag_set_input_line(machine, "maincpu", 6, timer_irq_state && vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
92   cputag_set_input_line(machine, "subx", 6, timer_irq_state && vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
93   cputag_set_input_line(machine, "suby", 6, timer_irq_state && vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
78   segas1x_state *state = (segas1x_state *)machine->driver_data;
9479
95   if(timer_irq_state || vblank_irq_state)
80   cpu_set_input_line(state->maincpu, 2, state->timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
81   cpu_set_input_line(state->subx, 2, state->timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
82   cpu_set_input_line(state->suby, 2, state->timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
83   cpu_set_input_line(state->maincpu, 4, state->vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
84   cpu_set_input_line(state->subx, 4, state->vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
85   cpu_set_input_line(state->suby, 4, state->vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
86   cpu_set_input_line(state->maincpu, 6, state->timer_irq_state && state->vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
87   cpu_set_input_line(state->subx, 6, state->timer_irq_state && state->vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
88   cpu_set_input_line(state->suby, 6, state->timer_irq_state && state->vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
89
90   if (state->timer_irq_state || state->vblank_irq_state)
9691      cpuexec_boost_interleave(machine, attotime_zero, ATTOTIME_IN_USEC(50));
9792}
9893
r7356r7357
131126        150-200 = ok
132127*/
133128
134static int irq2_scanline = 170;
135
136129static TIMER_DEVICE_CALLBACK( scanline_callback )
137130{
131   segas1x_state *state = (segas1x_state *)timer->machine->driver_data;
138132   int scanline = param;
139133
140134   /* on scanline 'irq2_scanline' generate an IRQ2 */
141   if (scanline == irq2_scanline)
135   if (scanline == state->irq2_scanline)
142136   {
143      timer_irq_state = 1;
144      scanline = irq2_scanline + 1;
137      state->timer_irq_state = 1;
138      scanline = state->irq2_scanline + 1;
145139   }
146140
147141   /* on scanline 'irq2_scanline' + 1, clear the IRQ2 */
148   else if (scanline == irq2_scanline + 1)
142   else if (scanline == state->irq2_scanline + 1)
149143   {
150      timer_irq_state = 0;
144      state->timer_irq_state = 0;
151145      scanline = 223;
152146   }
153147
154148   /* on scanline 223 generate VBLANK for all CPUs */
155149   else if (scanline == 223)
156150   {
157      vblank_irq_state = 1;
151      state->vblank_irq_state = 1;
158152      scanline = 224;
159153   }
160154
161155   /* on scanline 224 we turn it off */
162156   else if (scanline == 224)
163157   {
164      vblank_irq_state = 0;
165      scanline = irq2_scanline;
158      state->vblank_irq_state = 0;
159      scanline = state->irq2_scanline;
166160   }
167161
168162   /* update IRQs on the main CPU */
169163   update_main_irqs(timer->machine);
170164
171165   /* come back at the next appropriate scanline */
172   timer_device_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(timer->machine->primary_screen, scanline, 0), scanline);
166   timer_device_adjust_oneshot(state->interrupt_timer, video_screen_get_time_until_pos(timer->machine->primary_screen, scanline, 0), scanline);
173167
174168#if TWEAK_IRQ2_SCANLINE
175169   if (scanline == 223)
176170   {
177      int old = irq2_scanline;
171      int old = state->irq2_scanline;
178172
179173      /* Q = -10 scanlines, W = -1 scanline, E = +1 scanline, R = +10 scanlines */
180      if (input_code_pressed(timer->machine, KEYCODE_Q)) { while (input_code_pressed(timer->machine, KEYCODE_Q)) ; irq2_scanline -= 10; }
181      if (input_code_pressed(timer->machine, KEYCODE_W)) { while (input_code_pressed(timer->machine, KEYCODE_W)) ; irq2_scanline -= 1; }
182      if (input_code_pressed(timer->machine, KEYCODE_E)) { while (input_code_pressed(timer->machine, KEYCODE_E)) ; irq2_scanline += 1; }
183      if (input_code_pressed(timer->machine, KEYCODE_R)) { while (input_code_pressed(timer->machine, KEYCODE_R)) ; irq2_scanline += 10; }
184      if (old != irq2_scanline)
185         popmessage("scanline = %d", irq2_scanline);
174      if (input_code_pressed(timer->machine, KEYCODE_Q)) { while (input_code_pressed(timer->machine, KEYCODE_Q)) ; state->irq2_scanline -= 10; }
175      if (input_code_pressed(timer->machine, KEYCODE_W)) { while (input_code_pressed(timer->machine, KEYCODE_W)) ; state->irq2_scanline -= 1; }
176      if (input_code_pressed(timer->machine, KEYCODE_E)) { while (input_code_pressed(timer->machine, KEYCODE_E)) ; state->irq2_scanline += 1; }
177      if (input_code_pressed(timer->machine, KEYCODE_R)) { while (input_code_pressed(timer->machine, KEYCODE_R)) ; state->irq2_scanline += 10; }
178      if (old != state->irq2_scanline)
179         popmessage("scanline = %d", state->irq2_scanline);
186180   }
187181#endif
188182}
r7356r7357
190184
191185static MACHINE_START( yboard )
192186{
193   state_save_register_global_array(machine, misc_io_data);
194   state_save_register_global_array(machine, analog_data);
195   state_save_register_global(machine, vblank_irq_state);
196   state_save_register_global(machine, timer_irq_state);
187   segas1x_state *state = (segas1x_state *)machine->driver_data;
188
189   state->maincpu = devtag_get_device(machine, "maincpu");
190   state->soundcpu = devtag_get_device(machine, "soundcpu");
191   state->subx = devtag_get_device(machine, "subx");
192   state->suby = devtag_get_device(machine, "suby");
193
194   state_save_register_global(machine, state->vblank_irq_state);
195   state_save_register_global(machine, state->timer_irq_state);
196   state_save_register_global(machine, state->irq2_scanline);
197   state_save_register_global_array(machine, state->misc_io_data);
198   state_save_register_global_array(machine, state->analog_data);
197199}
198200
199201
200202static MACHINE_RESET( yboard )
201203{
202    interrupt_timer = devtag_get_device(machine, "int_timer");
203    timer_device_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 223, 0), 223);
204   segas1x_state *state = (segas1x_state *)machine->driver_data;
205
206   state->irq2_scanline = 170;
207
208   state->interrupt_timer = devtag_get_device(machine, "int_timer");
209   timer_device_adjust_oneshot(state->interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 223, 0), 223);
204210}
205211
206212
r7356r7357
213219
214220static void sound_cpu_irq(running_device *device, int state)
215221{
216   cputag_set_input_line(device->machine, "soundcpu", 0, state);
222   segas1x_state *driver = (segas1x_state *)device->machine->driver_data;
223
224   cpu_set_input_line(driver->soundcpu, 0, state);
217225}
218226
219227
220228static TIMER_CALLBACK( delayed_sound_data_w )
221229{
222   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
230   segas1x_state *state = (segas1x_state *)machine->driver_data;
231   const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
223232
224233   soundlatch_w(space, 0, param);
225   cputag_set_input_line(machine, "soundcpu", INPUT_LINE_NMI, ASSERT_LINE);
234   cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, ASSERT_LINE);
226235}
227236
228237
r7356r7357
235244
236245static READ8_HANDLER( sound_data_r )
237246{
238   cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, CLEAR_LINE);
239   return soundlatch_r(space,offset);
247   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
248   cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, CLEAR_LINE);
249   return soundlatch_r(space, offset);
240250}
241251
242252
r7356r7357
249259
250260static READ16_HANDLER( io_chip_r )
251261{
262   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
252263   static const char *const portnames[] = { "P1", "GENERAL", "PORTC", "PORTD", "PORTE", "DSW", "COINAGE", "PORTH" };
253264   offset &= 0x1f/2;
254265
r7356r7357
264275      case 0x0c/2:
265276      case 0x0e/2:
266277         /* if the port is configured as an output, return the last thing written */
267         if (misc_io_data[0x1e/2] & (1 << offset))
268            return misc_io_data[offset];
278         if (state->misc_io_data[0x1e/2] & (1 << offset))
279            return state->misc_io_data[offset];
269280
270281         /* otherwise, return an input port */
271282         return input_port_read(space->machine, portnames[offset]);
r7356r7357
283294      /* CNT register & mirror */
284295      case 0x18/2:
285296      case 0x1c/2:
286         return misc_io_data[0x1c/2];
297         return state->misc_io_data[0x1c/2];
287298
288299      /* port direction register & mirror */
289300      case 0x1a/2:
290301      case 0x1e/2:
291         return misc_io_data[0x1e/2];
302         return state->misc_io_data[0x1e/2];
292303   }
293304   return 0xffff;
294305}
r7356r7357
296307
297308static WRITE16_HANDLER( io_chip_w )
298309{
310   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
299311   UINT8 old;
300312
301313   /* generic implementation */
302314   offset &= 0x1f/2;
303   old = misc_io_data[offset];
304   misc_io_data[offset] = data;
315   old = state->misc_io_data[offset];
316   state->misc_io_data[offset] = data;
305317
306318   switch (offset)
307319   {
r7356r7357
326338                D1-D0 = ADC0-1
327339            */
328340         segaic16_set_display_enable(space->machine, data & 0x80);
329         if (((old ^ data) & 0x20) && !(data & 0x20)) watchdog_reset_w(space,0,0);
330         cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
331         cputag_set_input_line(space->machine, "subx", INPUT_LINE_RESET, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
332         cputag_set_input_line(space->machine, "suby", INPUT_LINE_RESET, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
341         if (((old ^ data) & 0x20) && !(data & 0x20)) watchdog_reset_w(space, 0, 0);
342         cpu_set_input_line(state->soundcpu, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
343         cpu_set_input_line(state->subx, INPUT_LINE_RESET, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
344         cpu_set_input_line(state->suby, INPUT_LINE_RESET, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
333345         break;
334346
335347      /* mute */
r7356r7357
355367
356368static READ16_HANDLER( analog_r )
357369{
370   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
358371   int result = 0xff;
359372   if (ACCESSING_BITS_0_7)
360373   {
361      result = analog_data[offset & 3] & 0x80;
362      analog_data[offset & 3] <<= 1;
374      result = state->analog_data[offset & 3] & 0x80;
375      state->analog_data[offset & 3] <<= 1;
363376   }
364377   return result;
365378}
r7356r7357
367380
368381static WRITE16_HANDLER( analog_w )
369382{
383   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
370384   static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6" };
371   int selected = ((offset & 3) == 3) ? (3 + (misc_io_data[0x08/2] & 3)) : (offset & 3);
385   int selected = ((offset & 3) == 3) ? (3 + (state->misc_io_data[0x08/2] & 3)) : (offset & 3);
372386   int value = input_port_read_safe(space->machine, ports[selected], 0xff);
373   analog_data[offset & 3] = value;
387   state->analog_data[offset & 3] = value;
374388}
375389
376390
r7356r7357
401415   ADDRESS_MAP_UNMAP_HIGH
402416   ADDRESS_MAP_GLOBAL_MASK(0x1fffff)
403417   AM_RANGE(0x000000, 0x07ffff) AM_ROM
404   AM_RANGE(0x080000, 0x080007) AM_MIRROR(0x001ff8) AM_READWRITE(segaic16_multiply_0_r, segaic16_multiply_0_w)
418   AM_RANGE(0x080000, 0x080007) AM_MIRROR(0x001ff8) AM_DEVREADWRITE("5248_main", segaic16_multiply_r, segaic16_multiply_w)
405419   AM_RANGE(0x082000, 0x083fff) AM_WRITE(sound_data_w)
406   AM_RANGE(0x084000, 0x08401f) AM_MIRROR(0x001fe0) AM_READWRITE(segaic16_divide_0_r, segaic16_divide_0_w)
420   AM_RANGE(0x084000, 0x08401f) AM_MIRROR(0x001fe0) AM_DEVREADWRITE("5249_main", segaic16_divide_r, segaic16_divide_w)
407421//  AM_RANGE(0x086000, 0x087fff) /DEA0
408422   AM_RANGE(0x0c0000, 0x0cffff) AM_RAM AM_SHARE("share1")
409423   AM_RANGE(0x100000, 0x10001f) AM_READWRITE(io_chip_r, io_chip_w)
r7356r7357
423437   ADDRESS_MAP_UNMAP_HIGH
424438   ADDRESS_MAP_GLOBAL_MASK(0x1fffff)
425439   AM_RANGE(0x000000, 0x03ffff) AM_ROM
426   AM_RANGE(0x080000, 0x080007) AM_MIRROR(0x001ff8) AM_READWRITE(segaic16_multiply_1_r, segaic16_multiply_1_w)
427   AM_RANGE(0x084000, 0x08401f) AM_MIRROR(0x001fe0) AM_READWRITE(segaic16_divide_1_r, segaic16_divide_1_w)
440   AM_RANGE(0x080000, 0x080007) AM_MIRROR(0x001ff8) AM_DEVREADWRITE("5248_subx", segaic16_multiply_r, segaic16_multiply_w)
441   AM_RANGE(0x084000, 0x08401f) AM_MIRROR(0x001fe0) AM_DEVREADWRITE("5249_subx", segaic16_divide_r, segaic16_divide_w)
428442   AM_RANGE(0x0c0000, 0x0cffff) AM_RAM AM_SHARE("share1")
429443   AM_RANGE(0x180000, 0x18ffff) AM_RAM AM_BASE(&segaic16_spriteram_1)
430444   AM_RANGE(0x1f8000, 0x1fbfff) AM_RAM
r7356r7357
436450   ADDRESS_MAP_UNMAP_HIGH
437451   ADDRESS_MAP_GLOBAL_MASK(0x1fffff)
438452   AM_RANGE(0x000000, 0x03ffff) AM_ROM
439   AM_RANGE(0x080000, 0x080007) AM_MIRROR(0x001ff8) AM_READWRITE(segaic16_multiply_2_r, segaic16_multiply_2_w)
440   AM_RANGE(0x084000, 0x08401f) AM_MIRROR(0x001fe0) AM_READWRITE(segaic16_divide_2_r, segaic16_divide_2_w)
453   AM_RANGE(0x080000, 0x080007) AM_MIRROR(0x001ff8) AM_DEVREADWRITE("5248_suby", segaic16_multiply_r, segaic16_multiply_w)
454   AM_RANGE(0x084000, 0x08401f) AM_MIRROR(0x001fe0) AM_DEVREADWRITE("5249_suby", segaic16_divide_r, segaic16_divide_w)
441455   AM_RANGE(0x0c0000, 0x0cffff) AM_RAM AM_SHARE("share1")
442456   AM_RANGE(0x180000, 0x1807ff) AM_MIRROR(0x007800) AM_RAM AM_BASE(&segaic16_rotateram_0)
443457   AM_RANGE(0x188000, 0x188fff) AM_MIRROR(0x007000) AM_RAM AM_BASE(&segaic16_spriteram_0)
r7356r7357
970984
971985static MACHINE_DRIVER_START( yboard )
972986
987   /* driver data */
988   MDRV_DRIVER_DATA(segas1x_state)
989
973990   /* basic machine hardware */
974991   MDRV_CPU_ADD("maincpu", M68000, MASTER_CLOCK/4)
975992   MDRV_CPU_PROGRAM_MAP(main_map)
r7356r7357
9891006   MDRV_NVRAM_HANDLER(yboard)
9901007   MDRV_QUANTUM_TIME(HZ(6000))
9911008
992    MDRV_TIMER_ADD("int_timer", scanline_callback)
1009   MDRV_TIMER_ADD("int_timer", scanline_callback)
9931010
1011   MDRV_315_5248_ADD("5248_main")
1012   MDRV_315_5248_ADD("5248_subx")
1013   MDRV_315_5248_ADD("5248_suby")
1014   MDRV_315_5249_ADD("5249_main")
1015   MDRV_315_5249_ADD("5249_subx")
1016   MDRV_315_5249_ADD("5249_suby")
1017
9941018   /* video hardware */
9951019   MDRV_SCREEN_ADD("screen", RASTER)
9961020   MDRV_SCREEN_REFRESH_RATE(60)
r7356r7357
18141838
18151839static DRIVER_INIT( generic_yboard )
18161840{
1817   yboard_generic_init();
1841   yboard_generic_init(machine);
18181842}
18191843
18201844
src/mame/drivers/cclimber.c
r7356r7357
482482INPUT_PORTS_END
483483
484484/* Same as 'cclimber' but correct "Bonus Life" Dip Switch */
485static INPUT_PORTS_START( cclimbrj )
485static INPUT_PORTS_START( cclimberj )
486486   PORT_INCLUDE( cclimber )
487487
488488   PORT_MODIFY("DSW")
r7356r7357
16421642   /* no samples */
16431643ROM_END
16441644
1645/*This dump is a mess.  11n and 11k seem to be bad dumps, the second half should probably be sprite data
1645/*This dump was a mess.  11n and 11k seem to be bad dumps, the second half should probably be sprite data
16461646  Comparing to set 2 11l and 11h are unnecessary, and are actually from Le Bagnard(set1), as is 5m.
1647  5n ID'd as unknown, but it also is from bagnard with some patches.*/
1647  5n ID'd as unknown, but it also is from bagnard with some patches. */
16481648ROM_START( cannonb )
16491649   ROM_REGION( 0x11000, "maincpu", 0 )
16501650   ROM_LOAD( "canballs.5d", 0x10000, 0x1000, CRC(43ad0d16) SHA1(682f1ee15e41bb5a161287536bb97704c0d3be9c) ) /* only this one ROM is encrypted */
r7356r7357
16751675   ROM_LOAD( "canballs.5s",  0x0000, 0x1000, CRC(5f0bcdfb) SHA1(7f79bf6de117348f606696ed7ea1937bbf926612) )
16761676   ROM_LOAD( "canballs.5p",  0x1000, 0x1000, CRC(9003ffbd) SHA1(fd016056aabc23957643f37230f03842294f795e) )
16771677
1678   ROM_REGION( 0x6000, "unused", 0 )   /* unused roms, don't seem to belong to this game, can probably remove them later */
1679   ROM_LOAD( "canballs.5m",  0x0000, 0x1000, CRC(4f0088ab) SHA1(a8009f5b8517ba4d84fbc483b199f2514f24eae8) ) // patched 'le bagnard' cod rom
1680   ROM_LOAD( "canballs.5n",  0x1000, 0x1000, CRC(91570033) SHA1(7cd7fe9541da36c3919324bc65e6db1d1ca635e0) ) // ?
1681   ROM_LOAD( "canballs.11l", 0x2000, 0x1000, CRC(060b044c) SHA1(3121f07adb661663a2303085eea1b662968f8f98) ) // 'le bagnard gfx'
1682   ROM_LOAD( "canballs.11h", 0x3000, 0x1000, CRC(8043bc1a) SHA1(bd2f3dfe26cf8d987d9ecaa41eac4bdc4e16a692) ) // 'le bagnard gfx'
1678   ROM_REGION( 0x6000, "unused", ROMREGION_ERASEFF )   /* unused roms, don't seem to belong to this game - they come from the bagman on crazy kong conversion, see below */
1679   //ROM_LOAD( "canballs.5m",  0x0000, 0x1000, CRC(4f0088ab) SHA1(a8009f5b8517ba4d84fbc483b199f2514f24eae8) ) // patched 'le bagnard' cod rom
1680   //ROM_LOAD( "canballs.5n",  0x1000, 0x1000, CRC(91570033) SHA1(7cd7fe9541da36c3919324bc65e6db1d1ca635e0) ) // ?
1681   //ROM_LOAD( "canballs.11l", 0x2000, 0x1000, CRC(060b044c) SHA1(3121f07adb661663a2303085eea1b662968f8f98) ) // 'le bagnard gfx'
1682   //ROM_LOAD( "canballs.11h", 0x3000, 0x1000, CRC(8043bc1a) SHA1(bd2f3dfe26cf8d987d9ecaa41eac4bdc4e16a692) ) // 'le bagnard gfx'
16831683   ROM_LOAD( "canballs.11n", 0x4000, 0x1000, CRC(a95b8e03) SHA1(e78125023e1af6de292292b875b45401b2173ca9) ) // probably just bad dump (missing sprite data)
16841684   ROM_LOAD( "canballs.11k", 0x5000, 0x1000, CRC(dbbe8263) SHA1(efe4bba25a03261bc8309e6d83d5600def875b0c) ) // probably just bad dump (missing sprite data)
16851685ROM_END
r7356r7357
17461746   ROM_LOAD( "ck13 pos r5  2532.bin",  0x1000, 0x1000, CRC(9003ffbd) SHA1(fd016056aabc23957643f37230f03842294f795e) )
17471747ROM_END
17481748
1749
1750/* PCB FCK-00 (Falcon Crazy Kong) + Daughterboard
1751   running Bagman
1752
1753   there are a lot of wire-mods on this board, it's possible that it's been hacked to work more like
1754   an original bagman board, a lot of the roms are the same
1755
1756   this set also explains why the cannonball set above contained a number of bagman roms, it was clearly
1757   a half-converted board.
1758
1759*/
1760ROM_START( bagmanf )
1761   ROM_REGION( 0x11000, "maincpu", 0 )
1762   ROM_LOAD( "01.d5.bin",  0x0000, 0x1000, CRC(e0156191) SHA1(bb5f16d49fbe48f3bac118acd1fea51ec4bc5355) )
1763   ROM_LOAD( "02.f5.bin",  0x1000, 0x1000, CRC(7b758982) SHA1(c8460023b43fed4aca9c6b987faea334832c5e30) )
1764   ROM_LOAD( "03.h5.bin",  0x2000, 0x1000, CRC(302a077b) SHA1(916c4a6ea1e631cc72bdb91ff9d263dcbaf08bb2) )
1765   ROM_LOAD( "04.k5.bin",  0x3000, 0x1000, CRC(b704d761) SHA1(60f5f84a7c43ef50cf8ea81d566a3b23ca4f57c4) )
1766   ROM_LOAD( "05.l5.bin",  0x4000, 0x1000, CRC(4f0088ab) SHA1(a8009f5b8517ba4d84fbc483b199f2514f24eae8) )
1767   ROM_LOAD( "2732 05 pos dboard.bin",  0x5000, 0x1000, CRC(91570033) SHA1(7cd7fe9541da36c3919324bc65e6db1d1ca635e0) )
1768
1769   ROM_REGION( 0x4000, "gfx1", 0 )
1770   ROM_LOAD( "09.l11.bin", 0x0000, 0x0800, CRC(060b044c) SHA1(3121f07adb661663a2303085eea1b662968f8f98) )
1771   /* 0x0800-0x0fff - empty */
1772   ROM_CONTINUE(           0x1000, 0x0800 )
1773   /* 0x1800-0x0fff - empty */
1774   ROM_LOAD( "11.h11.bin", 0x2000, 0x0800, CRC(8043bc1a) SHA1(bd2f3dfe26cf8d987d9ecaa41eac4bdc4e16a692) )
1775   /* 0x2800-0x0fff - empty */
1776   ROM_CONTINUE(           0x3000, 0x0800 )
1777   /* 0x3800-0x0fff - empty */
1778
1779   ROM_REGION( 0x2000, "gfx2", 0 )
1780   ROM_LOAD( "10.n11.bin",   0x0000, 0x1000, CRC(c680ef04) SHA1(79406bc786374abfcd9f548268c445b5c8d8858d) )
1781   ROM_LOAD( "12.k11.bin",   0x1000, 0x1000, CRC(4a0a6b55) SHA1(955f8bd4bd9b0fc3c6c359c25ba543ba26c04cbd) )
1782
1783   ROM_REGION( 0x0060, "proms", 0 )
1784   ROM_LOAD( "v6",      0x0000, 0x0020, CRC(b3fc1505) SHA1(5b94adde0428a26b815c7eb9b3f3716470d349c7) )
1785   ROM_LOAD( "u6",      0x0020, 0x0020, CRC(26aada9e) SHA1(f59645e606ea4f0dd0fc4ea47dd03f526c534941) )
1786   ROM_LOAD( "t6",      0x0040, 0x0020, CRC(676b3166) SHA1(29b9434cd34d43ea5664e436e2a24b54f8d88aac) )
1787
1788   /* as well as one of the program roms, the daughterboard contains the speech hardware + roms */
1789   ROM_REGION( 0x0020, "proms2", 0 )
1790   ROM_LOAD( "daughterboard.prom",  0x0000, 0x0020, CRC(c58a4f6a) SHA1(35ef244b3e94032df2610aa594ea5670b91e1449) ) /*state machine driving TMS5110*/
1791
1792   ROM_REGION( 0x2000, "speech", 0 ) /* data for the TMS5110 speech chip */
1793   ROM_LOAD( "2732 07 pos dboard.bin",   0x0000, 0x1000, CRC(2e0057ff) SHA1(33e3ffa6418f86864eb81e5e9bda4bf540c143a6) )
1794   ROM_LOAD( "2732 08 pos dboard.bin",   0x1000, 0x1000, CRC(b2120edd) SHA1(52b89dbcc749b084331fa82b13d0876e911fce52) )
1795
1796   ROM_REGION( 0x2000, "samples", ROMREGION_ERASE00 )   /* samples */
1797   /* unpopulated */
1798ROM_END
1799
1800
17491801ROM_START( swimmer )
17501802   ROM_REGION( 0x10000, "maincpu", 0 )
17511803   ROM_LOAD( "sw1",          0x0000, 0x1000, CRC(f12481e7) SHA1(4e8ee509043fd57ec1579594f0b2c543f270bead) )
r7356r7357
19892041
19902042
19912043GAME( 1980, cclimber, 0,        cclimber, cclimber, cclimber, ROT0,   "Nichibutsu", "Crazy Climber (US)", 0 )
1992GAME( 1980, cclimberj,cclimber, cclimber, cclimbrj, cclimbrj, ROT0,   "Nichibutsu", "Crazy Climber (Japan)", 0 )
1993GAME( 1980, ccboot,   cclimber, cclimber, cclimber, cclimbrj, ROT0,   "bootleg", "Crazy Climber (bootleg set 1)", 0 )
1994GAME( 1980, ccboot2,  cclimber, cclimber, cclimber, cclimbrj, ROT0,   "bootleg", "Crazy Climber (bootleg set 2)", 0 )
2044GAME( 1980, cclimberj,cclimber, cclimber, cclimberj,cclimberj,ROT0,   "Nichibutsu", "Crazy Climber (Japan)", 0 )
2045GAME( 1980, ccboot,   cclimber, cclimber, cclimber, cclimberj,ROT0,   "bootleg", "Crazy Climber (bootleg set 1)", 0 )
2046GAME( 1980, ccboot2,  cclimber, cclimber, cclimber, cclimberj,ROT0,   "bootleg", "Crazy Climber (bootleg set 2)", 0 )
19952047GAME( 1981, ckong,    0,        cclimber, ckong,    0,        ROT270, "Falcon", "Crazy Kong Part II (set 1)", 0 )
19962048GAME( 1981, ckonga,   ckong,    cclimber, ckong,    0,        ROT270, "Falcon", "Crazy Kong Part II (set 2)", 0 )
19972049GAME( 1981, ckong2j,  ckong,    cclimber, ckong,    0,        ROT270, "Falcon", "Crazy Kong Part II (Japan)", 0 )
r7356r7357
20012053GAME( 1981, bigkong,  ckong,    cclimber, ckong,    0,        ROT270, "bootleg", "Big Kong", 0 )
20022054GAME( 1981, monkeyd,  ckong,    cclimber, ckong,    0,        ROT270, "bootleg", "Monkey Donkey", 0 )
20032055GAME( 198?, ckongb,   ckong,    cclimber, ckongb,   ckongb,   ROT270, "bootleg", "Crazy Kong Part II (alternative levels)", 0 )
2056GAME( 1981, bagmanf,  bagman,   cclimber, ckong,    0,        ROT270, "bootleg", "Bagman (bootleg on Crazy Kong hardware)", GAME_NOT_WORKING )
20042057GAME( 1981, rpatrol,  0,        cclimber, rpatrol,  0,        ROT0,   "Orca", "River Patrol (Orca)", 0 )
20052058GAME( 1981, rpatrolb, rpatrol,  cclimber, rpatrol,  0,        ROT0,   "bootleg", "River Patrol (bootleg)", 0 )
20062059GAME( 1981, silvland, rpatrol,  cclimber, rpatrol,  0,        ROT0,   "Falcon", "Silver Land", 0 )
src/mame/drivers/ddenlovr.c
r7356r7357
8181
8282- quiz365 protection
8383
84- ddenlvrj, akamaru: the elapsed time text in the "game information" screen
84- ddenlovj, akamaru: the elapsed time text in the "game information" screen
8585  is all wrong (RTC/interrupts related).
8686
8787- sryudens: Transparency problems (Test->Option->Gal, Bonus Game during Demo mode).
r7356r7357
16251625ADDRESS_MAP_END
16261626
16271627
1628static UINT16 *ddenlvrj_dsw_sel;
1628static UINT16 *ddenlovj_dsw_sel;
16291629
1630static READ16_HANDLER( ddenlvrj_dsw_r )
1630static READ16_HANDLER( ddenlovj_dsw_r )
16311631{
16321632   UINT16 dsw = 0;
1633   if ((~*ddenlvrj_dsw_sel) & 0x01)   dsw |= input_port_read(space->machine, "DSW1");
1634   if ((~*ddenlvrj_dsw_sel) & 0x02)   dsw |= input_port_read(space->machine, "DSW2");
1635   if ((~*ddenlvrj_dsw_sel) & 0x04)   dsw |= input_port_read(space->machine, "DSW3");
1633   if ((~*ddenlovj_dsw_sel) & 0x01)   dsw |= input_port_read(space->machine, "DSW1");
1634   if ((~*ddenlovj_dsw_sel) & 0x02)   dsw |= input_port_read(space->machine, "DSW2");
1635   if ((~*ddenlovj_dsw_sel) & 0x04)   dsw |= input_port_read(space->machine, "DSW3");
16361636   return dsw;
16371637}
16381638
1639static WRITE16_HANDLER( ddenlvrj_coincounter_w )
1639static WRITE16_HANDLER( ddenlovj_coincounter_w )
16401640{
16411641   if (ACCESSING_BITS_0_7)
16421642   {
r7356r7357
16461646   }
16471647}
16481648
1649static CUSTOM_INPUT( ddenlvrj_blitter_r )
1649static CUSTOM_INPUT( ddenlovj_blitter_r )
16501650{
16511651   return ddenlovr_blitter_irq_flag ? 0x03 : 0x00;      // bit 4 = 1 -> blitter busy
16521652}
16531653
1654static ADDRESS_MAP_START( ddenlvrj_map, ADDRESS_SPACE_PROGRAM, 16 )
1654static ADDRESS_MAP_START( ddenlovj_map, ADDRESS_SPACE_PROGRAM, 16 )
16551655   AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
16561656
16571657   AM_RANGE(0x200000, 0x2003ff) AM_WRITE(ddenlovr_palette_w)                     // Palette
r7356r7357
16731673   AM_RANGE(0x300180, 0x300181) AM_READ_PORT("P1")
16741674   AM_RANGE(0x300182, 0x300183) AM_READ_PORT("P2")
16751675   AM_RANGE(0x300184, 0x300185) AM_READ_PORT("SYSTEM")
1676   AM_RANGE(0x300186, 0x300187) AM_READ(ddenlvrj_dsw_r)                        // DSW
1677   AM_RANGE(0x300188, 0x300189) AM_WRITE(ddenlvrj_coincounter_w)                  // Coin Counters
1678   AM_RANGE(0x30018a, 0x30018b) AM_WRITEONLY AM_BASE(&ddenlvrj_dsw_sel)         // DSW select
1676   AM_RANGE(0x300186, 0x300187) AM_READ(ddenlovj_dsw_r)                        // DSW
1677   AM_RANGE(0x300188, 0x300189) AM_WRITE(ddenlovj_coincounter_w)                  // Coin Counters
1678   AM_RANGE(0x30018a, 0x30018b) AM_WRITEONLY AM_BASE(&ddenlovj_dsw_sel)         // DSW select
16791679   AM_RANGE(0x30018c, 0x30018d) AM_DEVWRITE("oki", ddenlovr_oki_bank_w)
16801680   AM_RANGE(0x3001ca, 0x3001cb) AM_WRITE(ddenlovr_blitter_irq_ack_w)               // Blitter irq acknowledge
16811681   AM_RANGE(0x300240, 0x300241) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff)// Sound
r7356r7357
16831683ADDRESS_MAP_END
16841684
16851685
1686static UINT16 *ddenlvrk_protection1, *ddenlvrk_protection2;
1687static READ16_HANDLER( ddenlvrk_protection1_r )
1686static UINT16 *ddenlovrk_protection1, *ddenlovrk_protection2;
1687static READ16_HANDLER( ddenlovrk_protection1_r )
16881688{
1689   switch(*ddenlvrk_protection1)
1689   switch(*ddenlovrk_protection1)
16901690   {
16911691      case 0x007e:   return 0x00aa;
16921692   }
1693   return *ddenlvrk_protection1;
1693   return *ddenlovrk_protection1;
16941694}
16951695
1696static READ16_HANDLER( ddenlvrk_protection2_r )
1696static READ16_HANDLER( ddenlovrk_protection2_r )
16971697{
1698   switch(*ddenlvrk_protection1)
1698   switch(*ddenlovrk_protection1)
16991699   {
1700      case 0x0000:   return *ddenlvrk_protection2;
1700      case 0x0000:   return *ddenlovrk_protection2;
17011701   }
17021702   return 0x80;
17031703}
1704static WRITE16_HANDLER( ddenlvrk_protection2_w )
1704static WRITE16_HANDLER( ddenlovrk_protection2_w )
17051705{
1706   COMBINE_DATA( ddenlvrk_protection2 );
1707   okim6295_set_bank_base(devtag_get_device(space->machine, "oki"), ((*ddenlvrk_protection2)&0x7) * 0x40000);
1706   COMBINE_DATA( ddenlovrk_protection2 );
1707   okim6295_set_bank_base(devtag_get_device(space->machine, "oki"), ((*ddenlovrk_protection2)&0x7) * 0x40000);
17081708}
17091709
1710static ADDRESS_MAP_START( ddenlvrk_map, ADDRESS_SPACE_PROGRAM, 16 )
1710static ADDRESS_MAP_START( ddenlovrk_map, ADDRESS_SPACE_PROGRAM, 16 )
17111711   AM_RANGE(0x000000, 0x07ffff) AM_ROM                                          // ROM
17121712
1713   AM_RANGE(0x100000, 0x100001) AM_RAM_READ(ddenlvrk_protection1_r)                     AM_BASE(&ddenlvrk_protection1)
1714   AM_RANGE(0x200000, 0x200001) AM_READWRITE(ddenlvrk_protection2_r, ddenlvrk_protection2_w)   AM_BASE(&ddenlvrk_protection2)
1713   AM_RANGE(0x100000, 0x100001) AM_RAM_READ(ddenlovrk_protection1_r)                     AM_BASE(&ddenlovrk_protection1)
1714   AM_RANGE(0x200000, 0x200001) AM_READWRITE(ddenlovrk_protection2_r, ddenlovrk_protection2_w)   AM_BASE(&ddenlovrk_protection2)
17151715
17161716   AM_RANGE(0xd00000, 0xd003ff) AM_WRITE(ddenlovr_palette_w)                        // Palette
17171717//  AM_RANGE(0xd01000, 0xd017ff) AM_RAM                                                    // ? B0 on startup, then 00
r7356r7357
35083508
35093509
35103510
3511static INPUT_PORTS_START( ddenlvrj )
3511static INPUT_PORTS_START( ddenlovj )
35123512   PORT_START("P1")
35133513   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
35143514   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
r7356r7357
35353535   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
35363536   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1)   /* Test */
35373537   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL )   // blitter busy flag
3538   PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ddenlvrj_blitter_r, NULL)   // blitter irq flag? (bit 5) & RTC (bit 6)
3538   PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ddenlovj_blitter_r, NULL)   // blitter irq flag? (bit 5) & RTC (bit 6)
35393539   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL )
35403540
35413541   PORT_START("DSW1")
r7356r7357
73767376   MDRV_MSM6242_ADD("rtc")
73777377MACHINE_DRIVER_END
73787378
7379static MACHINE_DRIVER_START( ddenlvrj )
7379static MACHINE_DRIVER_START( ddenlovj )
73807380
73817381   /* basic machine hardware */
73827382   MDRV_IMPORT_FROM(ddenlovr)
73837383   MDRV_CPU_MODIFY("maincpu")
7384   MDRV_CPU_PROGRAM_MAP(ddenlvrj_map)
7384   MDRV_CPU_PROGRAM_MAP(ddenlovj_map)
73857385MACHINE_DRIVER_END
73867386
7387static MACHINE_DRIVER_START( ddenlvrk )
7387static MACHINE_DRIVER_START( ddenlovrk )
73887388   MDRV_IMPORT_FROM(ddenlovr)
73897389   MDRV_CPU_MODIFY("maincpu")
7390   MDRV_CPU_PROGRAM_MAP(ddenlvrk_map)
7390   MDRV_CPU_PROGRAM_MAP(ddenlovrk_map)
73917391MACHINE_DRIVER_END
73927392
73937393static MACHINE_DRIVER_START( akamaru )
r7356r7357
84598459
84608460***************************************************************************/
84618461
8462ROM_START( ddenlvrj )
8462ROM_START( ddenlovj )
84638463   ROM_REGION( 0x080000, "maincpu", 0 )      /* 68000 Code */
84648464   ROM_LOAD16_BYTE( "1124.2d", 0x000000, 0x040000, CRC(6a9ec557) SHA1(e1512601910a9d06e16a20e10ab7acc96a0819bd) )
84658465   ROM_LOAD16_BYTE( "1123.2h", 0x000001, 0x040000, CRC(d41cbed0) SHA1(5c80f6a6cf15518120f664a0446355e80eeb2a0f) )
r7356r7357
85308530
85318531***************************************************************************/
85328532
8533ROM_START( ddenlvrk )
8533ROM_START( ddenlovrk )
85348534   ROM_REGION( 0x080000, "maincpu", 0 )      /* 68000 Code */
85358535   ROM_LOAD16_BYTE( "rom.1a", 0x000000, 0x40000, CRC(868c45f8) SHA1(023ceaa30cfa03470ef005c8b739a85ae9764e15) )
85368536   ROM_LOAD16_BYTE( "rom.1b", 0x000001, 0x40000, CRC(4fab3c90) SHA1(61a756a3ccae39f3a649371116b9d940d3b1b852) )
r7356r7357
86188618      HSync 15.30kHz
86198619      VSync 60Hz
86208620*/
8621ROM_START( ddenlovb )
8621ROM_START( ddenlovrb )
86228622   ROM_REGION( 0x080000, "maincpu", 0 )      /* 68000 Code */
86238623   ROM_LOAD16_BYTE( "rom2", 0x000000, 0x040000, CRC(cabdf78f) SHA1(789d4754c7b84964ee317b8a618f26a417f50bcc) )
86248624   ROM_LOAD16_BYTE( "rom3", 0x000001, 0x040000, CRC(36f8d05e) SHA1(78f75175541ebf377f5375ea30d80ea91f380971) )
r7356r7357
97719771GAME( 1995, hgokou,   0,        hgokou,   hgokou,   0,        ROT0, "Dynax (Alba licence)",                      "Hanafuda Hana Gokou (Japan)",                                     GAME_NO_COCKTAIL )
97729772GAME( 1995, mjdchuka, 0,        mjchuuka, mjchuuka, 0,        ROT0, "Dynax",                                       "Mahjong The Dai Chuuka Ken (China, v. D111)",                     GAME_NO_COCKTAIL )
97739773GAME( 1995, nettoqc,  0,        nettoqc,  nettoqc,  0,        ROT0, "Nakanihon",                                   "Nettoh Quiz Champion (Japan)",                                    GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
9774GAME( 1995, ddenlvrj, 0,        ddenlvrj, ddenlvrj, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 - Shiro Kuro Tsukeyo! (Japan)",              GAME_NO_COCKTAIL )
9775GAME( 1995, ddenlvrk, ddenlvrj, ddenlvrk, ddenlovr, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 - Heukbaeg-euro Jeonghaja (Korea)",          GAME_NO_COCKTAIL )
9776GAME( 1995, ddenlovb, ddenlvrj, ddenlovr, ddenlovr, 0,        ROT0, "[Dynax] (bootleg)",                           "Don Den Lover Vol. 1 - Heukbaeg-euro Jeonghaja (Korea, bootleg)", GAME_NO_COCKTAIL )
9777GAME( 1996, ddenlovr, ddenlvrj, ddenlovr, ddenlovr, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 (Hong Kong)",                                GAME_NO_COCKTAIL )
9774GAME( 1995, ddenlovj, 0,        ddenlovj, ddenlovj, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 - Shiro Kuro Tsukeyo! (Japan)",              GAME_NO_COCKTAIL )
9775GAME( 1995, ddenlovrk,ddenlovj, ddenlovrk,ddenlovr, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 - Heukbaeg-euro Jeonghaja (Korea)",          GAME_NO_COCKTAIL )
9776GAME( 1995, ddenlovrb,ddenlovj, ddenlovr, ddenlovr, 0,        ROT0, "[Dynax] (bootleg)",                           "Don Den Lover Vol. 1 - Heukbaeg-euro Jeonghaja (Korea, bootleg)", GAME_NO_COCKTAIL )
9777GAME( 1996, ddenlovr, ddenlovj, ddenlovr, ddenlovr, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 (Hong Kong)",                                GAME_NO_COCKTAIL )
97789778GAME( 1996, hanakanz, 0,        hanakanz, hanakanz, 0,        ROT0, "Dynax",                                       "Hana Kanzashi (Japan)",                                           GAME_NO_COCKTAIL )
97799779GAME( 1996, akamaru,  0,        akamaru,  akamaru,  0,        ROT0, "Dynax (Nakanihon licence)",                   "Panel & Variety Akamaru Q Jousyou Dont-R",                        GAME_NO_COCKTAIL )
97809780GAME( 1996, sryudens, 0,        sryudens, sryudens, 0,        ROT0, "Dynax / Face",                                "Mahjong Seiryu Densetsu (Japan, NM502)",                          GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/chinagat.c
r7356r7357
188188   memory_set_bank(space->machine, "bank4", data & 0x07);   // shall we check (data & 7) < 6 (# of banks)?
189189}
190190
191static READ8_HANDLER( saiyugb1_mcu_command_r )
191static READ8_HANDLER( saiyugoub1_mcu_command_r )
192192{
193193   ddragon_state *state = (ddragon_state *)space->machine->driver_data;
194194#if 0
r7356r7357
200200   return state->mcu_command;
201201}
202202
203static WRITE8_HANDLER( saiyugb1_mcu_command_w )
203static WRITE8_HANDLER( saiyugoub1_mcu_command_w )
204204{
205205   ddragon_state *state = (ddragon_state *)space->machine->driver_data;
206206   state->mcu_command = data;
r7356r7357
212212#endif
213213}
214214
215static WRITE8_HANDLER( saiyugb1_adpcm_rom_addr_w )
215static WRITE8_HANDLER( saiyugoub1_adpcm_rom_addr_w )
216216{
217217   ddragon_state *state = (ddragon_state *)space->machine->driver_data;
218218   /* i8748 Port 1 write */
219219   state->i8748_P1 = data;
220220}
221221
222static WRITE8_DEVICE_HANDLER( saiyugb1_adpcm_control_w )
222static WRITE8_DEVICE_HANDLER( saiyugoub1_adpcm_control_w )
223223{
224224   ddragon_state *state = (ddragon_state *)device->machine->driver_data;
225225
226226   /* i8748 Port 2 write */
227   UINT8 *saiyugb1_adpcm_rom = memory_region(device->machine, "adpcm");
227   UINT8 *saiyugoub1_adpcm_rom = memory_region(device->machine, "adpcm");
228228
229229   if (data & 0x80)   /* Reset m5205 and disable ADPCM ROM outputs */
230230   {
r7356r7357
251251
252252      state->adpcm_addr = ((state->adpcm_addr & 0x07fff) | (data & 0x70 << 11));
253253
254      state->pcm_nibble = saiyugb1_adpcm_rom[state->adpcm_addr & 0x3ffff];
254      state->pcm_nibble = saiyugoub1_adpcm_rom[state->adpcm_addr & 0x3ffff];
255255
256256      state->pcm_nibble = (state->pcm_nibble >> state->pcm_shift) & 0x0f;
257257
r7356r7357
267267   state->i8748_P2 = data;
268268}
269269
270static WRITE8_DEVICE_HANDLER( saiyugb1_m5205_clk_w )
270static WRITE8_DEVICE_HANDLER( saiyugoub1_m5205_clk_w )
271271{
272272   /* i8748 T0 output clk mode */
273273   /* This signal goes through a divide by 8 counter */
r7356r7357
288288#endif
289289}
290290
291static READ8_HANDLER( saiyugb1_m5205_irq_r )
291static READ8_HANDLER( saiyugoub1_m5205_irq_r )
292292{
293293   ddragon_state *state = (ddragon_state *)space->machine->driver_data;
294294   if (state->adpcm_sound_irq)
r7356r7357
299299   return 0;
300300}
301301
302static void saiyugb1_m5205_irq_w( running_device *device )
302static void saiyugoub1_m5205_irq_w( running_device *device )
303303{
304304   ddragon_state *state = (ddragon_state *)device->machine->driver_data;
305305   state->adpcm_sound_irq = 1;
r7356r7357
362362   AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_r)
363363ADDRESS_MAP_END
364364
365static ADDRESS_MAP_START( saiyugb1_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
365static ADDRESS_MAP_START( saiyugoub1_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
366366   AM_RANGE(0x0000, 0x7fff) AM_ROM
367367   AM_RANGE(0x8000, 0x87ff) AM_RAM
368368   AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("ymsnd", ym2151_r, ym2151_w)
369   AM_RANGE(0x9800, 0x9800) AM_WRITE(saiyugb1_mcu_command_w)
369   AM_RANGE(0x9800, 0x9800) AM_WRITE(saiyugoub1_mcu_command_w)
370370   AM_RANGE(0xA000, 0xA000) AM_READ(soundlatch_r)
371371ADDRESS_MAP_END
372372
r7356r7357
376376ADDRESS_MAP_END
377377
378378static ADDRESS_MAP_START( i8748_portmap, ADDRESS_SPACE_IO, 8 )
379   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(saiyugb1_mcu_command_r)
380   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_DEVWRITE("adpcm", saiyugb1_m5205_clk_w)      /* Drives the clock on the m5205 at 1/8 of this frequency */
381   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(saiyugb1_m5205_irq_r)
382   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(saiyugb1_adpcm_rom_addr_w)
383   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_DEVWRITE("adpcm", saiyugb1_adpcm_control_w)
379   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(saiyugoub1_mcu_command_r)
380   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_DEVWRITE("adpcm", saiyugoub1_m5205_clk_w)      /* Drives the clock on the m5205 at 1/8 of this frequency */
381   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(saiyugoub1_m5205_irq_r)
382   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(saiyugoub1_adpcm_rom_addr_w)
383   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_DEVWRITE("adpcm", saiyugoub1_adpcm_control_w)
384384ADDRESS_MAP_END
385385
386386
r7356r7357
506506/* This on the bootleg board, instead of the m6295 */
507507static const msm5205_interface msm5205_config =
508508{
509   saiyugb1_m5205_irq_w,   /* Interrupt function */
509   saiyugoub1_m5205_irq_w,   /* Interrupt function */
510510   MSM5205_S64_4B         /* vclk input mode (6030Hz, 4-bit) */
511511};
512512
r7356r7357
613613   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
614614MACHINE_DRIVER_END
615615
616static MACHINE_DRIVER_START( saiyugb1 )
616static MACHINE_DRIVER_START( saiyugoub1 )
617617
618618   /* driver data */
619619   MDRV_DRIVER_DATA(ddragon_state)
r7356r7357
627627   MDRV_CPU_PROGRAM_MAP(sub_map)
628628
629629   MDRV_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)      /* 3.579545 MHz oscillator */
630   MDRV_CPU_PROGRAM_MAP(saiyugb1_sound_map)
630   MDRV_CPU_PROGRAM_MAP(saiyugoub1_sound_map)
631631
632632   MDRV_CPU_ADD("mcu", I8748, 9263750)      /* 9.263750 MHz oscillator, divided by 3*5 internally */
633633   MDRV_CPU_PROGRAM_MAP(i8748_map)
r7356r7357
662662   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
663663MACHINE_DRIVER_END
664664
665static MACHINE_DRIVER_START( saiyugb2 )
665static MACHINE_DRIVER_START( saiyugoub2 )
666666
667667   /* driver data */
668668   MDRV_DRIVER_DATA(ddragon_state)
r7356r7357
938938
939939
940940/*   ( YEAR  NAME      PARENT    MACHINE   INPUT     INIT    MONITOR COMPANY    FULLNAME     FLAGS ) */
941GAME( 1988, chinagat,   0,        chinagat, chinagat, chinagat, ROT0, "[Technos Japan] (Taito Romstar license)", "China Gate (US)", GAME_SUPPORTS_SAVE )
942GAME( 1988, saiyugou,   chinagat, chinagat, chinagat, chinagat, ROT0, "Technos Japan", "Sai Yu Gou Ma Roku (Japan)", GAME_SUPPORTS_SAVE )
943GAME( 1988, saiyugoub1, chinagat, saiyugb1, chinagat, chinagat, ROT0, "bootleg", "Sai Yu Gou Ma Roku (Japan bootleg 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
944GAME( 1988, saiyugoub2, chinagat, saiyugb2, chinagat, chinagat, ROT0, "bootleg", "Sai Yu Gou Ma Roku (Japan bootleg 2)", GAME_SUPPORTS_SAVE )
941GAME( 1988, chinagat,   0,        chinagat,   chinagat, chinagat, ROT0, "[Technos Japan] (Taito Romstar license)", "China Gate (US)", GAME_SUPPORTS_SAVE )
942GAME( 1988, saiyugou,   chinagat, chinagat,   chinagat, chinagat, ROT0, "Technos Japan", "Sai Yu Gou Ma Roku (Japan)", GAME_SUPPORTS_SAVE )
943GAME( 1988, saiyugoub1, chinagat, saiyugoub1, chinagat, chinagat, ROT0, "bootleg", "Sai Yu Gou Ma Roku (Japan bootleg 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
944GAME( 1988, saiyugoub2, chinagat, saiyugoub2, chinagat, chinagat, ROT0, "bootleg", "Sai Yu Gou Ma Roku (Japan bootleg 2)", GAME_SUPPORTS_SAVE )
src/mame/drivers/aladbl.c
r7356r7357
11#include "emu.h"
2#include "megadriv.h"
2#include "includes/megadriv.h"
33
44/*
55
r7356r7357
154154   ROM_CONTINUE(            0x300000, 0x040000)
155155ROM_END
156156
157static INPUT_PORTS_START(mk3ghw)
158   PORT_INCLUDE( md_common )
157159
160   PORT_MODIFY("PAD1")      /* Joypad 1 (3 button + start) NOT READ DIRECTLY */
161   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // a
162   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // b
163   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) // c
164   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) // start
165
166   PORT_MODIFY("PAD2")      /* Joypad 2 (3 button + start) NOT READ DIRECTLY - not used */
167   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
168
169   PORT_START("IN0")
170   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
171   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1)
172   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coinage ) )
173   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
174   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
175   PORT_BIT( 0xf8, 0x00, IPT_UNUSED )
176
177   PORT_START("IN1")
178   PORT_DIPUNKNOWN( 0x01, 0x00 )
179   PORT_DIPUNKNOWN( 0x02, 0x00 )
180   PORT_DIPUNKNOWN( 0x04, 0x00 )
181   PORT_DIPUNKNOWN( 0x08, 0x00 )
182   PORT_DIPUNKNOWN( 0x10, 0x00 )
183   PORT_DIPUNKNOWN( 0x20, 0x00 )
184   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
185   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
186   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
187   PORT_DIPUNKNOWN( 0x80, 0x00 )
188INPUT_PORTS_END
189
158190// this should be correct, the areas of the rom that differ to the original
159191// after this decode look like intentional changes
160192static DRIVER_INIT( mk3ghw )
r7356r7357
191223      }
192224   }
193225
194   // boot vectors don't seem to be valid...
195   // these are from the original, but I don't seem right for this either
226   // boot vectors don't seem to be valid, so they are patched...
196227   ROM[1] = 0x01;
197228   ROM[0] = 0x00;
198229   ROM[3] = 0x00;
r7356r7357
200231   ROM[5] = 0x00;
201232   ROM[4] = 0x00;
202233   ROM[7] = 0x02;
203   ROM[6] = 0x00;
234   ROM[6] = 0x10;
204235
236   memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770070, 0x770071, 0, 0, "IN0");
237   memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770072, 0x770073, 0, 0, "IN1");
205238}
206239
207240
r7356r7357
238271}
239272
240273GAME( 1993, aladbl ,  0,   megadriv,    aladbl,       aladbl,  ROT0,   "bootleg / Sega", "Aladdin (bootleg of Japanese Megadrive version)", 0)
241GAME( 1996, mk3ghw ,  0,   megadriv,    aladbl,       mk3ghw,  ROT0,   "bootleg / Midway", "Mortal Kombat 3 (bootleg of Megadrive version)", GAME_NOT_WORKING)
274GAME( 1996, mk3ghw ,  0,   megadriv,    mk3ghw,       mk3ghw,  ROT0,   "bootleg / Midway", "Mortal Kombat 3 (bootleg of Megadrive version)", 0)
src/mame/drivers/model2.c
r7356r7357
33163316   ROM_LOAD("mpr-21280.sd4", 0x0600000, 0x200000, CRC(aa548124) SHA1(a94adfe16b5c3236746451c181ccd3e1c27432f4) )
33173317ROM_END
33183318
3319ROM_START( indy500 ) /* Defaults to Twin (Stand Alone) Cab version.  2 credits to start - Can be set to Deluxe setting in service mode */
3319ROM_START( indy500 ) /* Defaults to Twin (Stand Alone) Cab version.  2 credits to start - Can be set to Deluxe setting in service mode, Sega ID# 834-12362 */
33203320   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
3321   ROM_LOAD32_WORD("epr-18254a.15", 0x000000, 0x080000, CRC(ad0f1fc5) SHA1(0bff35fc1d892aaffbf1a3965bf3109c54839f4b) )
3322   ROM_LOAD32_WORD("epr-18255a.16", 0x000002, 0x080000, CRC(784daab8) SHA1(299e87f8ec7bdefa6f94f4ab65e29e91f290611e) )
3321   ROM_LOAD32_WORD("epr-18598a.15", 0x000000, 0x080000, CRC(3cdcac0f) SHA1(2f616e363f4d246fece309e81325e5e3c4e9d9f8) ) /* Higher rom numbers indicate a newer version */
3322   ROM_LOAD32_WORD("epr-18599a.16", 0x000002, 0x080000, CRC(32bde9a2) SHA1(0982952ab3c5b035f37beb9304ac950c0e78aea8) ) /* Different attract mode... what else??? */
33233323
33243324   ROM_REGION32_LE( 0x2000000, "user1", 0 ) // Data
33253325   ROM_LOAD32_WORD("mpr-18237.11",    0x0000000, 0x400000, CRC(37e4255a) SHA1(3ee69a5b9364048dfab242773d97f3af430845b7) )
33263326   ROM_LOAD32_WORD("mpr-18238.12",    0x0000002, 0x400000, CRC(bf837bac) SHA1(6624417b65f15f20427bc42c27283f10342c76b5) )
33273327   ROM_LOAD32_WORD("mpr-18239.9",     0x0800000, 0x400000, CRC(9a2db86e) SHA1(0b81f6037657af7d96ed5e9bfef407d87cbcc294) )
33283328   ROM_LOAD32_WORD("mpr-18240.10",    0x0800002, 0x400000, CRC(ab46a35f) SHA1(67da857db7155a858a1fa575b6c50f4be3c9ab7c) )
3329   ROM_LOAD32_WORD("epr-18389.7",     0x1000000, 0x080000, CRC(d22ea019) SHA1(ef10bb0ffcb1bbcf4672bb5f705a27679a793764) )
3330   ROM_LOAD32_WORD("epr-18390.8",     0x1000002, 0x080000, CRC(38e796e5) SHA1(b23cfe45c363d616a65decd57aeb8ae61d5370e9) )
3329   ROM_LOAD32_WORD("epr-18596.7",     0x1000000, 0x080000, CRC(8be1a5cd) SHA1(56ed21234c6494d95b4efda6c3374199c5ac65db) )
3330   ROM_LOAD32_WORD("epr-18597.8",     0x1000002, 0x080000, CRC(44824e38) SHA1(f0fb0d73c1e72ce77c3931d436c54c034d2107a8) )
33313331   ROM_COPY( "user1", 0x1000000, 0x1100000, 0x100000 )
33323332   ROM_COPY( "user1", 0x1000000, 0x1200000, 0x100000 )
33333333   ROM_COPY( "user1", 0x1000000, 0x1300000, 0x100000 )
r7356r7357
33593359   ROM_LOAD32_WORD("mpr-18231.25", 0x000002, 0x400000, CRC(673d5338) SHA1(ce592857496ccc0a51efb377cf7cccc000b4296b) )
33603360
33613361   ROM_REGION( 0x100000, "audiocpu", 0 ) // Sound program
3362   ROM_LOAD16_WORD_SWAP("epr-18391.31", 0x080000,  0x40000, CRC(79579b72) SHA1(36fed8a9eeb34968b2852ea8fc9198427f0d27c6) )
3362   ROM_LOAD16_WORD_SWAP("epr-18600.31", 0x080000,  0x40000, CRC(269ee4a0) SHA1(8ebabfcd27d634ff0bead0a1f138efc8708575e7) )
33633363
33643364   ROM_REGION( 0x800000, "scsp", 0 ) // Samples
33653365   ROM_LOAD("mpr-18241.32", 0x0000000, 0x200000, CRC(3a380ae1) SHA1(114113325e9e5262af8750c05089f24818943cde) )
r7356r7357
34203420   ROM_LOAD("mpr-18244.35", 0x0600000, 0x200000, CRC(bfa75beb) SHA1(fec89260d887e90ee9c2803e2eaf937cf9bfa10b) )
34213421ROM_END
34223422
3423ROM_START( indy500to ) /* Defaults to Twin (Stand Alone) Cab version.  2 credits to start - Can be set to Deluxe setting in service mode */
3424   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
3425   ROM_LOAD32_WORD("epr-18254a.15", 0x000000, 0x080000, CRC(ad0f1fc5) SHA1(0bff35fc1d892aaffbf1a3965bf3109c54839f4b) )
3426   ROM_LOAD32_WORD("epr-18255a.16", 0x000002, 0x080000, CRC(784daab8) SHA1(299e87f8ec7bdefa6f94f4ab65e29e91f290611e) )
3427
3428   ROM_REGION32_LE( 0x2000000, "user1", 0 ) // Data
3429   ROM_LOAD32_WORD("mpr-18237.11",    0x0000000, 0x400000, CRC(37e4255a) SHA1(3ee69a5b9364048dfab242773d97f3af430845b7) )
3430   ROM_LOAD32_WORD("mpr-18238.12",    0x0000002, 0x400000, CRC(bf837bac) SHA1(6624417b65f15f20427bc42c27283f10342c76b5) )
3431   ROM_LOAD32_WORD("mpr-18239.9",     0x0800000, 0x400000, CRC(9a2db86e) SHA1(0b81f6037657af7d96ed5e9bfef407d87cbcc294) )
3432   ROM_LOAD32_WORD("mpr-18240.10",    0x0800002, 0x400000, CRC(ab46a35f) SHA1(67da857db7155a858a1fa575b6c50f4be3c9ab7c) )
3433   ROM_LOAD32_WORD("epr-18389.7",     0x1000000, 0x080000, CRC(d22ea019) SHA1(ef10bb0ffcb1bbcf4672bb5f705a27679a793764) )
3434   ROM_LOAD32_WORD("epr-18390.8",     0x1000002, 0x080000, CRC(38e796e5) SHA1(b23cfe45c363d616a65decd57aeb8ae61d5370e9) )
3435   ROM_COPY( "user1", 0x1000000, 0x1100000, 0x100000 )
3436   ROM_COPY( "user1", 0x1000000, 0x1200000, 0x100000 )
3437   ROM_COPY( "user1", 0x1000000, 0x1300000, 0x100000 )
3438   ROM_COPY( "user1", 0x1000000, 0x1400000, 0x100000 )
3439   ROM_COPY( "user1", 0x1000000, 0x1500000, 0x100000 )
3440   ROM_COPY( "user1", 0x1000000, 0x1600000, 0x100000 )
3441   ROM_COPY( "user1", 0x1000000, 0x1700000, 0x100000 )
3442   ROM_COPY( "user1", 0x1000000, 0x1800000, 0x100000 )
3443   ROM_COPY( "user1", 0x1000000, 0x1900000, 0x100000 )
3444   ROM_COPY( "user1", 0x1000000, 0x1a00000, 0x100000 )
3445   ROM_COPY( "user1", 0x1000000, 0x1b00000, 0x100000 )
3446   ROM_COPY( "user1", 0x1000000, 0x1c00000, 0x100000 )
3447   ROM_COPY( "user1", 0x1000000, 0x1d00000, 0x100000 )
3448   ROM_COPY( "user1", 0x1000000, 0x1e00000, 0x100000 )
3449   ROM_COPY( "user1", 0x1000000, 0x1f00000, 0x100000 )
3450
3451   ROM_REGION( 0x800000, "user5", 0 ) // Coprocessor Data ROM
3452   ROM_LOAD32_WORD("epr-18249.29", 0x000000, 0x080000, CRC(a399f023) SHA1(8b453313c16d935701ed7dbf71c1607c40aede63) )
3453   ROM_LOAD32_WORD("epr-18250.30", 0x000002, 0x080000, CRC(7479ad52) SHA1(d453e25709cd5970cd21bdc8b4785bc8eb5a50d7) )
3454
3455   ROM_REGION( 0x1000000, "user2", 0 ) // Models
3456   ROM_LOAD32_WORD("mpr-18233.17", 0x000000, 0x400000, CRC(48a024d3) SHA1(501c6ab969713187025331942f922cb0e8efa69a) )
3457   ROM_LOAD32_WORD("mpr-18234.21", 0x000002, 0x400000, CRC(1178bfc8) SHA1(4a9982fdce08f9d375371763dd5287e8485c24b1) )
3458   ROM_LOAD32_WORD("mpr-18235.18", 0x800000, 0x400000, CRC(e7d70d59) SHA1(6081739c15a634d5cc7680a4fc7decead93540ed) )
3459   ROM_LOAD32_WORD("mpr-18236.22", 0x800002, 0x400000, CRC(6ca29e0e) SHA1(5de8b569d2a91047836f4a251c21db82fd7841c9) )
3460
3461   ROM_REGION( 0x800000, "user3", 0 ) // Textures
3462   ROM_LOAD32_WORD("mpr-18232.27", 0x000000, 0x400000, CRC(f962347d) SHA1(79f07ee6b821724294ca9e7a079cb33249102508) )
3463   ROM_LOAD32_WORD("mpr-18231.25", 0x000002, 0x400000, CRC(673d5338) SHA1(ce592857496ccc0a51efb377cf7cccc000b4296b) )
3464
3465   ROM_REGION( 0x100000, "audiocpu", 0 ) // Sound program
3466   ROM_LOAD16_WORD_SWAP("epr-18391.31", 0x080000,  0x40000, CRC(79579b72) SHA1(36fed8a9eeb34968b2852ea8fc9198427f0d27c6) )
3467
3468   ROM_REGION( 0x800000, "scsp", 0 ) // Samples
3469   ROM_LOAD("mpr-18241.32", 0x0000000, 0x200000, CRC(3a380ae1) SHA1(114113325e9e5262af8750c05089f24818943cde) )
3470   ROM_LOAD("mpr-18242.33", 0x0200000, 0x200000, CRC(1cc3deae) SHA1(5c9cb8ce43a909b25b4e734c6a4ffd786f4dde31) )
3471   ROM_LOAD("mpr-18243.34", 0x0400000, 0x200000, CRC(a00a0053) SHA1(9c24fbcd0318c7e195dd153d6ba05e8c1e052968) )
3472   ROM_LOAD("mpr-18244.35", 0x0600000, 0x200000, CRC(bfa75beb) SHA1(fec89260d887e90ee9c2803e2eaf937cf9bfa10b) )
3473ROM_END
3474
34233475ROM_START( waverunr ) /* Wave Runner Revision A (Japan), Model 2C */
34243476   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
34253477   ROM_LOAD32_WORD("epr-19282a.15", 0x000000, 0x080000, CRC(5df58604) SHA1(a136bb80746f37450be51f98ca60791b4022035d) )
r7356r7357
46064658GAME( 1994, vstrikero,vstriker, model2b, model2, 0,       ROT0, "Sega", "Virtua Striker", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
46074659GAME( 1995, fvipers,         0, model2b, model2, 0,       ROT0, "Sega", "Fighting Vipers (Revision D)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
46084660GAME( 1995, gunblade,        0, model2b, model2, 0,       ROT0, "Sega", "Gunblade NY (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4609GAME( 1995, indy500,         0, model2b, model2, 0,       ROT0, "Sega", "INDY 500 Twin (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4661GAME( 1995, indy500,         0, model2b, model2, 0,       ROT0, "Sega", "INDY 500 Twin (Revision A, Newer)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
46104662GAME( 1995, indy500d,  indy500, model2b, model2, 0,       ROT0, "Sega", "INDY 500 Deluxe (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
4663GAME( 1995, indy500to, indy500, model2b, model2, 0,       ROT0, "Sega", "INDY 500 Twin (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
46114664GAME( 1996, schamp,          0, model2b, model2, 0,       ROT0, "Sega", "Sonic Championship", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
46124665GAME( 1996, sfight,     schamp, model2b, model2, 0,       ROT0, "Sega", "Sonic The Fighters", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
46134666GAME( 1996, lastbrnx,        0, model2b, model2, 0,       ROT0, "Sega", "Last Bronx (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/hyperspt.c
r7356r7357
583583GAME( 1984, hypersptb, hyperspt, hypersptb, hyperspt, hyperspt, ROT0,  "bootleg", "Hyper Sports (bootleg)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // has ADPCM vis MSM5205 instead of VLM
584584GAME( 1984, hpolym84,  hyperspt, hyperspt,  hyperspt, hyperspt, ROT0,  "Konami",  "Hyper Olympic '84", GAME_SUPPORTS_SAVE )
585585GAME( 1984, roadf,     0,        roadf,     roadf,    hyperspt, ROT90, "Konami",  "Road Fighter (set 1)", GAME_SUPPORTS_SAVE )
586GAME( 1984, roadf2,    roadf,      roadf,     roadf,    hyperspt, ROT90, "Konami",  "Road Fighter (set 2)", GAME_SUPPORTS_SAVE )
586GAME( 1984, roadf2,    roadf,    roadf,     roadf,    hyperspt, ROT90, "Konami",  "Road Fighter (set 2)", GAME_SUPPORTS_SAVE )
src/mame/drivers/sigmab52.c
r0r7357
1/******************************************************************************
2
3  SIGMA B52 SYSTEM.
4  -----------------
5
6  Driver by Roberto Fresca.
7
8
9  Games running on this hardware:
10
11  * Joker's Wild (B52 system, set 1),        199?, Sigma.
12  * Joker's Wild (B52 system, set 2),        199?, Sigma.
13  * Joker's Wild (B52 system, Harrah's GFX), 199?, Sigma.
14
15
16  The HD63484 ACRTC support is a bit hacky and incomplete,
17  due to its preliminary emulation state.
18
19
20*******************************************************************************
21
22  Hardware Notes:
23  ---------------
24
25  CPU:
26
27  - 2x MC68B09CP         ; 6809 CPU @ 2 MHz, from Motorola.
28  - 1x HD63484P8 @ 8MHz  ; Advanced CRT controller (ACRTC), from Hitachi Semiconductor.
29
30  RAM devices:
31
32  - 8x TC51832ASPL-10    ; 32K x 8-bit CMOS Pseudo Static RAM.
33  - 1x HM62256ALP-10     ; 32K x 8-bit High Speed CMOS Static RAM.
34  - 1x HM6264ALP-10      ; 8K x 8-bit High Speed CMOS Static RAM.
35
36  ROM devices:
37
38  - 1x 64K main program ROM.
39  - 4x 64K graphics ROM.
40  - 1x 32K sound program ROM.
41  - 1x 256 bytes bipolar PROM.
42
43  Sound device:
44
45  - 1x YM3812            ; Sound IC, from Yamaha.
46
47  Other:
48
49  - 2x EF68B40P          ; Frequency clock 2 MHz Programmable Timer, from SGS-Thomson Microelectronics.
50  - 1x EF68B50P          ; Asynchronous Communications Interface Adapter (ACIA, 2 MHz), from SGS-Thomson Microelectronics.
51
52  - 1x Xtal @ 18 MHz.
53  - 1x Xtal @ 8 MHz.
54  - 1x Xtal @ 3.579545 MHz.
55
56
57  Silkscreened on main PCB:
58
59  "SIGMA GAME INC."
60  "VIDEO PCB 340016"
61  "REV. A"
62
63  Silkscreened on daughterboard:
64
65  "SIGMA GAMES   340003"
66  "BILL VALID BOARD"
67
68
69  - Seems that you can set the node (01-32) for a network.
70  - Cards graphics from set 2 have the Harrah's Casino logo.
71
72
73*******************************************************************************
74
75
76  *** Game Notes ***
77
78  Nothing yet...
79
80
81*******************************************************************************
82
83  ---------------------------------
84  ***  Memory Map (preliminary) ***
85  ---------------------------------
86
87  0x0000 - 0x3FFF    ; RAM.
88  0xF730 - 0xF731    ; ACRTC.
89  0xF740 - 0xF746    ; I/O.
90
91  Sound:
92
93  0x8000 - 0xFFFF    ; ROM space.
94
95
96*******************************************************************************
97
98
99  DRIVER UPDATES:
100
101
102  [2010-02-04]
103
104  - Initial release.
105  - Pre-defined Xtals.
106  - Started a preliminary memory map.
107  - Hooked both CPUs.
108  - Preliminary ACRTC support.
109  - Added technical notes.
110
111
112  TODO:
113
114  - GFX decode.
115  - Improve memory map.
116  - Color decode.
117  - Sound support.
118  - Inputs.
119
120
121*******************************************************************************/
122
123
124#define MAIN_CLOCK   XTAL_18MHz
125#define SEC_CLOCK   XTAL_8MHz
126#define AUX_CLOCK   XTAL_3_579545MHz
127
128#include "emu.h"
129#include "cpu/m6809/m6809.h"
130#include "machine/6850acia.h"
131#include "sound/3812intf.h"
132#include "video/hd63484.h"
133
134
135
136/*************************
137*     Video Hardware     *
138*************************/
139
140
141static VIDEO_START( jwildb52 )
142{
143
144}
145
146
147static VIDEO_UPDATE( jwildb52 )
148{
149   running_device *hd63484 = devtag_get_device(screen->machine, "hd63484");
150
151   int x, y, b, src;
152
153   b = ((hd63484_regs_r(hd63484, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, 0xce/2, 0xffff);
154
155//save vram to file
156#if 0
157   if (input_code_pressed_once(screen->machine, KEYCODE_Q))
158   {
159      FILE *p = fopen("vram.bin", "wb");
160      fwrite(&HD63484_ram[0], 1, 0x40000 * 4, p);
161      fclose(p);
162   }
163#endif
164//copied form other acrtc based games
165
166   for (y = 0; y < 480; y++)
167   {
168      for (x = 0; x < (hd63484_regs_r(hd63484, 0xca/2, 0xffff) & 0x0fff) * 4; x += 4)
169      {
170
171         src = hd63484_ram_r(hd63484, b & (HD63484_RAM_SIZE - 1), 0xffff);
172
173         *BITMAP_ADDR16(bitmap, y, x    ) = ((src & 0x000f) >>  0) << 0;
174         *BITMAP_ADDR16(bitmap, y, x + 1) = ((src & 0x00f0) >>  4) << 0;
175         *BITMAP_ADDR16(bitmap, y, x + 2) = ((src & 0x0f00) >>  8) << 0;
176         *BITMAP_ADDR16(bitmap, y, x + 3) = ((src & 0xf000) >> 12) << 0;
177         b++;
178      }
179   }
180
181if (!input_code_pressed(screen->machine, KEYCODE_O))
182   if ((hd63484_regs_r(hd63484, 0x06/2, 0xffff) & 0x0300) == 0x0300)
183   {
184      int sy = (hd63484_regs_r(hd63484, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(hd63484, 0x88/2, 0xffff) >> 8);
185      int h = hd63484_regs_r(hd63484, 0x96/2, 0xffff) & 0x0fff;
186      int sx = ((hd63484_regs_r(hd63484, 0x92/2, 0xffff) >> 8) - (hd63484_regs_r(hd63484, 0x84/2, 0xffff) >> 8)) * 4;
187      int w = (hd63484_regs_r(hd63484, 0x92/2, 0xffff) & 0xff) * 2;
188      if (sx < 0) sx = 0;   // not sure about this (shangha2 title screen)
189
190      b = (((hd63484_regs_r(hd63484, 0xdc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, 0xde/2, 0xffff));
191
192
193      for (y = sy; y <= sy + h && y < 480; y++)
194      {
195         for (x = 0; x < (hd63484_regs_r(hd63484, 0xca/2, 0xffff) & 0x0fff)* 4; x += 4)
196         {
197               src = hd63484_ram_r(hd63484, b & (HD63484_RAM_SIZE - 1), 0xffff);
198
199            if (x <= w && x + sx >= 0 && x + sx < (hd63484_regs_r(hd63484, 0xca/2, 0xffff) & 0x0fff) * 4)
200               {
201                  *BITMAP_ADDR16(bitmap, y, x + sx    ) = ((src & 0x000f) >>  0) << 0;
202                  *BITMAP_ADDR16(bitmap, y, x + sx + 1) = ((src & 0x00f0) >>  4) << 0;
203                  *BITMAP_ADDR16(bitmap, y, x + sx + 2) = ((src & 0x0f00) >>  8) << 0;
204                  *BITMAP_ADDR16(bitmap, y, x + sx + 3) = ((src & 0xf000) >> 12) << 0;
205               }
206            b++;
207         }
208      }
209   }
210
211   return 0;
212}
213
214
215static PALETTE_INIT( jwildb52 )
216{
217
218}
219
220
221/*************************
222*      ACRTC Access      *
223*************************/
224
225static WRITE8_HANDLER(acrtc_w)
226{
227   static int latch=0;
228   static unsigned int acrtc_data=0;
229   running_device *hd63484 = devtag_get_device(space->machine, "hd63484");
230   if(!offset)
231   {
232      //address select
233      hd63484_address_w(hd63484, 0, data, 0x00ff);
234      latch = 0;
235   }
236   else
237   {
238      if(!latch)
239      {
240         acrtc_data = data;
241
242      }
243
244      else
245      {
246         acrtc_data <<= 8;
247         acrtc_data |= data;
248
249         hd63484_data_w(hd63484, 0, acrtc_data, 0xffff);
250      }
251
252      latch ^= 1;
253   }
254}
255
256static READ8_HANDLER(acrtc_r)
257{
258   if(offset&1)
259   {
260      running_device *hd63484 = devtag_get_device(space->machine, "hd63484");
261      return hd63484_data_r(hd63484, 0, 0xff);
262   }
263
264   else
265   {
266      return 0x7b; //fake status read (instead HD63484_status_r(space, 0, 0xff); )
267   }
268}
269
270
271/*************************
272*      Misc Handlers     *
273*************************/
274
275static READ8_HANDLER(unk_f700_r)
276{
277   return 0x7f;
278}
279
280static WRITE8_HANDLER(unk_f710_w)
281{
282   memory_set_bankptr(space->machine, "bank1" ,&memory_region(space->machine, "maincpu")[0x10000 + ((data&0x80)?0x4000:0x0000)]);
283}
284
285static READ8_HANDLER(unk_f721_r)
286{
287   return 0x04;   // test is stuck. feeding bit3 the error message appear...
288}
289
290
291/*************************
292*      Memory Maps       *
293*************************/
294
295static ADDRESS_MAP_START( jwildb52_map, ADDRESS_SPACE_PROGRAM, 8 )
296   AM_RANGE(0x0000, 0x3fff) AM_RAM
297   AM_RANGE(0x4000, 0x7fff) AM_RAMBANK("bank1")
298
299   AM_RANGE(0x8000, 0xf6ff) AM_RAMBANK("bank3")
300
301   AM_RANGE(0xf700, 0xf700) AM_READ(unk_f700_r)
302   AM_RANGE(0xf710, 0xf710) AM_WRITE(unk_f710_w)
303   AM_RANGE(0xf721, 0xf721) AM_READ(unk_f721_r)
304
305   //AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("hd63484", hd63484_status_r, hd63484_address_w)
306   //AM_RANGE(0x02, 0x03) AM_DEVREADWRITE("hd63484", hd63484_data_r, hd63484_data_w)
307
308   AM_RANGE(0xf730, 0xf731) AM_READWRITE(acrtc_r, acrtc_w)
309   AM_RANGE(0xf740, 0xf740) AM_READ_PORT("IN0")
310   AM_RANGE(0xf741, 0xf741) AM_READ_PORT("IN1")   // random checks to active high to go further with the test.
311   AM_RANGE(0xf742, 0xf742) AM_READ_PORT("IN2")
312   AM_RANGE(0xf743, 0xf743) AM_READ_PORT("DSW1")
313   AM_RANGE(0xf744, 0xf744) AM_READ_PORT("DSW2")
314   AM_RANGE(0xf745, 0xf745) AM_READ_PORT("DSW3")
315   AM_RANGE(0xf746, 0xf746) AM_READ_PORT("DSW4")
316   AM_RANGE(0xf800, 0xffff) AM_RAMBANK("bank2")
317ADDRESS_MAP_END
318
319/* Unknown R/W:
320
321  F700  W
322  F701 R
323
324  F726 RW
325  F727 RW
326
327  F747 R
328
329  F750  W
330
331  F7D4  W
332  F7D5  W
333
334  F7E6 RW
335  F7E7 RW
336
337*/
338
339static ADDRESS_MAP_START( sound_prog_map, ADDRESS_SPACE_PROGRAM, 8 )
340   AM_RANGE(0x8000, 0xffff) AM_ROM
341ADDRESS_MAP_END
342
343/* Unknown R/W:
344
345
346*/
347
348
349/*************************
350*      Input Ports       *
351*************************/
352
353static INPUT_PORTS_START( jwildb52 )
354   PORT_START("IN0")
355   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_1) PORT_NAME("IN0-1")
356   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_2) PORT_NAME("IN0-2")
357   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_3) PORT_NAME("IN0-3")
358   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4) PORT_NAME("IN0-4")
359   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_5) PORT_NAME("IN0-5")
360   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_6) PORT_NAME("IN0-6")
361   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_7) PORT_NAME("IN0-7")
362   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_8) PORT_NAME("IN0-8")
363
364   PORT_START("IN1")
365   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_9) PORT_NAME("IN1-1")   // keys Q & O are used for debugging purposes.
366   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_W) PORT_NAME("IN1-2")
367   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_E) PORT_NAME("IN1-3")   // pressing this one the message "PLEASE SET #10 IN D/S-2 ON" appear. Only SW4-8 seems to has effect.
368   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_R) PORT_NAME("IN1-4")
369   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_T) PORT_NAME("IN1-5")
370   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Y) PORT_NAME("IN1-6")
371   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_U) PORT_NAME("IN1-7")
372   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I) PORT_NAME("IN1-8")
373
374   PORT_START("IN2")
375   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("IN2-1")
376   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S) PORT_NAME("IN2-2")
377   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D) PORT_NAME("IN2-3")
378   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F) PORT_NAME("IN2-4")
379   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_G) PORT_NAME("IN2-5")
380   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_H) PORT_NAME("IN2-6")
381   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J) PORT_NAME("IN2-7")
382   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K) PORT_NAME("IN2-8")
383
384   PORT_START("IN3")
385   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z) PORT_NAME("IN3-1")
386   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_X) PORT_NAME("IN3-2")
387   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C) PORT_NAME("IN3-3")
388   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_V) PORT_NAME("IN3-4")
389   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_B) PORT_NAME("IN3-5")
390   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_N) PORT_NAME("IN3-6")
391   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M) PORT_NAME("IN3-7")
392   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L) PORT_NAME("IN3-8")
393
394   PORT_START("IN4")
395   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("IN4-1")
396   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("IN4-2")
397   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("IN4-3")
398   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("IN4-4")
399   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("IN4-5")
400   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("IN4-6")
401   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("IN4-7")
402   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("IN4-8")
403
404   PORT_START("DSW1")
405   PORT_DIPNAME( 0x01, 0x01, "DSW1 - #01" )   PORT_DIPLOCATION("SW1:1")
406   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
407   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
408   PORT_DIPNAME( 0x02, 0x02, "DSW1 - #02" )   PORT_DIPLOCATION("SW1:2")
409   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
410   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
411   PORT_DIPNAME( 0x04, 0x04, "DSW1 - #04" )   PORT_DIPLOCATION("SW1:3")
412   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
413   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
414   PORT_DIPNAME( 0x08, 0x08, "DSW1 - #08" )   PORT_DIPLOCATION("SW1:4")
415   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
416   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
417   PORT_DIPNAME( 0x10, 0x10, "DSW1 - #10" )   PORT_DIPLOCATION("SW1:5")
418   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
419   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
420   PORT_DIPNAME( 0x20, 0x20, "DSW1 - #20" )   PORT_DIPLOCATION("SW1:6")
421   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
422   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
423   PORT_DIPNAME( 0x40, 0x40, "DSW1 - #40" )   PORT_DIPLOCATION("SW1:7")
424   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
425   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
426   PORT_DIPNAME( 0x80, 0x80, "DSW1 - #80" )   PORT_DIPLOCATION("SW1:8")
427   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
428   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
429
430   PORT_START("DSW2")
431   PORT_DIPNAME( 0x01, 0x01, "DSW2 - #01" )   PORT_DIPLOCATION("SW2:1")
432   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
433   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
434   PORT_DIPNAME( 0x02, 0x02, "DSW2 - #02" )   PORT_DIPLOCATION("SW2:2")
435   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
436   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
437   PORT_DIPNAME( 0x04, 0x04, "DSW2 - #04" )   PORT_DIPLOCATION("SW2:3")
438   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
439   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
440   PORT_DIPNAME( 0x08, 0x08, "DSW2 - #08" )   PORT_DIPLOCATION("SW2:4")
441   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
442   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
443   PORT_DIPNAME( 0x10, 0x10, "DSW2 - #10" )   PORT_DIPLOCATION("SW2:5")
444   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
445   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
446   PORT_DIPNAME( 0x20, 0x20, "DSW2 - #20" )   PORT_DIPLOCATION("SW2:6")
447   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
448   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
449   PORT_DIPNAME( 0x40, 0x40, "DSW2 - #40" )   PORT_DIPLOCATION("SW2:7")
450   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
451   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
452   PORT_DIPNAME( 0x80, 0x80, "DSW2 - #80" )   PORT_DIPLOCATION("SW2:8")
453   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
454   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
455
456   PORT_START("DSW3")
457   PORT_DIPNAME( 0x01, 0x01, "DSW3 - #01" )   PORT_DIPLOCATION("SW3:1")
458   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
459   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
460   PORT_DIPNAME( 0x02, 0x02, "DSW3 - #02" )   PORT_DIPLOCATION("SW3:2")
461   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
462   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
463   PORT_DIPNAME( 0x04, 0x04, "DSW3 - #04" )   PORT_DIPLOCATION("SW3:3")
464   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
465   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
466   PORT_DIPNAME( 0x08, 0x08, "DSW3 - #08" )   PORT_DIPLOCATION("SW3:4")
467   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
468   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
469   PORT_DIPNAME( 0x10, 0x10, "DSW3 - #10" )   PORT_DIPLOCATION("SW3:5")
470   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
471   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
472   PORT_DIPNAME( 0x20, 0x20, "DSW3 - #20" )   PORT_DIPLOCATION("SW3:6")
473   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
474   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
475   PORT_DIPNAME( 0x40, 0x40, "DSW3 - #40" )   PORT_DIPLOCATION("SW3:7")
476   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
477   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
478   PORT_DIPNAME( 0x80, 0x80, "DSW3 - #80" )   PORT_DIPLOCATION("SW3:8")
479   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
480   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
481
482
483   PORT_START("DSW4")
484   PORT_DIPNAME( 0x01, 0x01, "DSW4 - #01" )   PORT_DIPLOCATION("SW4:1")
485   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
486   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
487   PORT_DIPNAME( 0x02, 0x02, "DSW4 - #02" )   PORT_DIPLOCATION("SW4:2")
488   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
489   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
490   PORT_DIPNAME( 0x04, 0x04, "DSW4 - #04" )   PORT_DIPLOCATION("SW4:3")
491   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
492   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
493   PORT_DIPNAME( 0x08, 0x08, "DSW4 - #08" )   PORT_DIPLOCATION("SW4:4")
494   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
495   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
496   PORT_DIPNAME( 0x10, 0x10, "DSW4 - #10" )   PORT_DIPLOCATION("SW4:5")
497   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
498   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
499   PORT_DIPNAME( 0x20, 0x20, "DSW4 - #20" )   PORT_DIPLOCATION("SW4:6")
500   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
501   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
502   PORT_DIPNAME( 0x40, 0x40, "DSW4 - #40" )   PORT_DIPLOCATION("SW4:7")
503   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
504   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
505   PORT_DIPNAME( 0x80, 0x80, "DSW4 - #80" )   PORT_DIPLOCATION("SW4:8")
506   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
507   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
508
509INPUT_PORTS_END
510
511
512/******************************
513*   Interrupts Gen (to fix)   *
514******************************/
515
516static INTERRUPT_GEN( timer_irq )
517{
518   generic_pulse_irq_line(device, M6809_IRQ_LINE);
519}
520
521
522/*************************
523*     Machine Start      *
524*************************/
525
526static MACHINE_START(jwildb52)
527{
528   memory_set_bankptr(machine, "bank1", &memory_region(machine, "maincpu")[0x10000 + 0x0000]);
529
530   memory_set_bankptr(machine, "bank2", &memory_region(machine, "maincpu")[0x10000 + 0xf800]);
531
532   memory_set_bankptr(machine, "bank3", &memory_region(machine, "maincpu")[0x10000 + 0x8000]);
533
534/*
535
536  ACRTC memory:
537
538  00000-3ffff = RAM
539  40000-7ffff = ROM
540  80000-bffff = unused
541  c0000-fffff = unused
542
543*/
544
545   {
546      UINT16 *rom = (UINT16*)memory_region(machine, "gfx1");
547      int i;
548
549      running_device *hd63484 = devtag_get_device(machine, "hd63484");
550
551      for(i = 0; i < 0x40000/2; ++i)
552      {
553         hd63484_ram_w(hd63484, i + 0x40000/2, rom[i], 0xffff);
554      }
555   }
556}
557
558static const hd63484_interface jwildb52_hd63484_intf = { 1 };
559
560
561/*************************
562*    Machine Drivers     *
563*************************/
564
565static MACHINE_DRIVER_START( jwildb52 )
566
567   /* basic machine hardware */
568   MDRV_CPU_ADD("maincpu", M6809, MAIN_CLOCK/9)   /* 2 MHz */
569   MDRV_CPU_PROGRAM_MAP(jwildb52_map)
570   MDRV_CPU_VBLANK_INT("screen", timer_irq)   /* Fix me */
571
572#if 0
573   MDRV_CPU_ADD("audiocpu", M6809, MAIN_CLOCK/9)   /* 2 MHz */
574   MDRV_CPU_PROGRAM_MAP(sound_prog_map)
575   //temporary teh same int as for main cpu
576   MDRV_CPU_PERIODIC_INT(timer_irq, 1000)         /* Fix me */
577#endif
578
579   MDRV_MACHINE_START(jwildb52)
580
581   MDRV_SCREEN_ADD("screen", RASTER)
582   MDRV_SCREEN_REFRESH_RATE(30)
583   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
584   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
585   MDRV_SCREEN_SIZE(1024, 1024)
586   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 384-1)
587
588   MDRV_HD63484_ADD("hd63484", jwildb52_hd63484_intf)
589
590   MDRV_PALETTE_INIT(jwildb52)
591   MDRV_PALETTE_LENGTH(256)
592
593   MDRV_VIDEO_START(jwildb52)
594   MDRV_VIDEO_UPDATE(jwildb52)
595
596MACHINE_DRIVER_END
597
598
599/*************************
600*        Rom Load        *
601*************************/
602
603ROM_START( jwildb52 )
604   ROM_REGION( 0x20000, "maincpu", 0 )
605   ROM_LOAD( "poker.ic95", 0x10000, 0x10000, CRC(07eb9007) SHA1(ee814c40c6d8c9ea9e5246cae0cfa2c30f2976ed) )
606
607   ROM_REGION( 0x40000, "gfx1", 0 )
608   ROM_LOAD32_BYTE( "cards_2001-1.ic45", 0x00002, 0x10000, CRC(7664455e) SHA1(c9f129060e63b9ac9058ab94208846e4dc578ead) )
609   ROM_LOAD32_BYTE( "cards_2001-2.ic46", 0x00000, 0x10000, CRC(c1455d64) SHA1(ddb576ba471b5d2faa415ec425615cf5f9d87911) )
610   ROM_LOAD32_BYTE( "cards_2001-3.ic47", 0x00001, 0x10000, CRC(cb2ece6e) SHA1(f2b6949085fe395d0fdd16322a880ec87e2efd50) )
611   ROM_LOAD32_BYTE( "cards_2001-4.ic48", 0x00003, 0x10000, CRC(8131d236) SHA1(8984aa1f2af70df41973b61df17f184796a2ffe9) )
612
613   ROM_REGION( 0x10000, "audiocpu", 0 )
614   ROM_LOAD( "sound-01-00.43",   0x8000, 0x8000, CRC(2712d44c) SHA1(295526b27676cd97cbf111d47305d63c2b3ea50d) )
615
616   ROM_REGION( 0x0100, "proms", 0 )
617   ROM_LOAD( "mb7118.41", 0x0000, 0x0100, CRC(b362f9e2) SHA1(3963b40389ed6584e4cd96ab48849552857d99af) )
618ROM_END
619
620
621ROM_START( jwildb52a )
622   ROM_REGION( 0x20000, "maincpu", 0 )
623   ROM_LOAD( "sigm_wrk.bin", 0x10000, 0x10000, CRC(15c83c6c) SHA1(7a05bd94ea8b1ad051fbe6580a6550d4bb47dd15) )
624
625   /* No gfx & sound dumps. Using the ones from parent set for now... */
626
627   ROM_REGION( 0x40000, "gfx1", 0 )
628   ROM_LOAD32_BYTE( "cards_2001-1.ic45", 0x00002, 0x10000, BAD_DUMP CRC(7664455e) SHA1(c9f129060e63b9ac9058ab94208846e4dc578ead) )
629   ROM_LOAD32_BYTE( "cards_2001-2.ic46", 0x00000, 0x10000, BAD_DUMP CRC(c1455d64) SHA1(ddb576ba471b5d2faa415ec425615cf5f9d87911) )
630   ROM_LOAD32_BYTE( "cards_2001-3.ic47", 0x00001, 0x10000, BAD_DUMP CRC(cb2ece6e) SHA1(f2b6949085fe395d0fdd16322a880ec87e2efd50) )
631   ROM_LOAD32_BYTE( "cards_2001-4.ic48", 0x00003, 0x10000, BAD_DUMP CRC(8131d236) SHA1(8984aa1f2af70df41973b61df17f184796a2ffe9) )
632
633   ROM_REGION( 0x10000, "audiocpu", 0 )
634   ROM_LOAD( "sound-01-00.43",   0x8000, 0x8000, BAD_DUMP CRC(2712d44c) SHA1(295526b27676cd97cbf111d47305d63c2b3ea50d) )
635
636   ROM_REGION( 0x0100, "proms", 0 )
637   ROM_LOAD( "mb7118.41", 0x0000, 0x0100, BAD_DUMP CRC(b362f9e2) SHA1(3963b40389ed6584e4cd96ab48849552857d99af) )
638ROM_END
639
640
641ROM_START( jwildb52h )
642   ROM_REGION( 0x20000, "maincpu", 0 )
643   ROM_LOAD( "jokers_wild_ver_xxx.ic95", 0x10000, 0x10000, CRC(07eb9007) SHA1(ee814c40c6d8c9ea9e5246cae0cfa2c30f2976ed) )
644
645   ROM_REGION( 0x40000, "gfx1", 0 )
646   ROM_LOAD32_BYTE( "2006-1_harrahs.ic45", 0x00002, 0x10000, CRC(6e6871dc) SHA1(5dfc99c808c06ec34838324181988d4550c1ed1a) )
647   ROM_LOAD32_BYTE( "2006-2_harrahs.ic46", 0x00000, 0x10000, CRC(1039c62d) SHA1(11f0dbcbbff5f6e9028a0305f7e16a0654be40d4) )
648   ROM_LOAD32_BYTE( "2006-3_harrahs.ic47", 0x00001, 0x10000, CRC(d66af95a) SHA1(70bba1aeea9221541b82642045ce8ecf26e1d08c) )
649   ROM_LOAD32_BYTE( "2006-4_harrahs.ic48", 0x00003, 0x10000, CRC(2bf196cb) SHA1(686ca0dd84c48f51efee5349ea3db65531dd4a52) )
650
651   ROM_REGION( 0x10000, "audiocpu", 0 )
652   ROM_LOAD( "poker-01-00.43", 0x8000, 0x8000, CRC(2712d44c) SHA1(295526b27676cd97cbf111d47305d63c2b3ea50d) )
653
654   ROM_REGION( 0x0100, "proms", 0 )
655   ROM_LOAD( "mb7118.41", 0x0000, 0x0100, CRC(b362f9e2) SHA1(3963b40389ed6584e4cd96ab48849552857d99af) )
656ROM_END
657
658
659/*************************
660*      Driver Init       *
661*************************/
662
663static DRIVER_INIT(jwildb52)
664{
665   //HD63484_start(machine);
666}
667
668
669/*************************
670*      Game Drivers      *
671*************************/
672
673/*    YEAR  NAME       PARENT    MACHINE   INPUT     INIT      ROT    COMPANY  FULLNAME                                  FLAGS */
674GAME( 199?, jwildb52,  0,        jwildb52, jwildb52, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, set 1)",        GAME_NO_SOUND | GAME_NOT_WORKING )
675GAME( 199?, jwildb52a, jwildb52, jwildb52, jwildb52, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, set 2)",        GAME_NO_SOUND | GAME_NOT_WORKING )
676GAME( 199?, jwildb52h, jwildb52, jwildb52, jwildb52, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, Harrah's GFX)", GAME_NO_SOUND | GAME_NOT_WORKING )
src/mame/drivers/adp.c
r7356r7357
208208
209209   state_save_register_global(machine, state->mux_data);
210210   state_save_register_global(machine, state->register_active);
211
212   /*
213        ACRTC memory:
214
215        00000-3ffff = RAM
216        40000-7ffff = ROM
217        80000-bffff = unused
218        c0000-fffff = unused
219    */
220
221   // hack to handle acrt rom
222   {
223      UINT16 *rom = (UINT16*)memory_region(machine, "gfx1");
224      int i;
225
226      running_device *hd63484 = devtag_get_device(machine, "hd63484");
227
228      for(i = 0; i < 0x40000/2; ++i)
229      {
230         hd63484_ram_w(hd63484, i + 0x00000/2, rom[i], 0xffff);
231         hd63484_ram_w(hd63484, i + 0x40000/2, rom[i], 0xffff);
232         hd63484_ram_w(hd63484, i + 0x80000/2, rom[i], 0xffff);
233         hd63484_ram_w(hd63484, i + 0xc0000/2, rom[i], 0xffff);
234      }
235   }
211236}
212237
213238static MACHINE_RESET( skattv )
r7356r7357
257282
258283static VIDEO_START(adp)
259284{
260//  adp_state *state = (adp_state *)machine->driver_data;
261//  UINT32 i;
262//  UINT16 *prgrom = (UINT16*)memory_region(machine, "maincpu");
263285
264//  for (i = 0; i < 0x70000; i++)
265//      hd63484_ram_w(state->hd63484, 0x90000 + i, prgrom[i]);
266
267286}
268287
269288static VIDEO_UPDATE( adp )
r7356r7357
272291   int x, y, b, src;
273292
274293   b = ((hd63484_regs_r(state->hd63484, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(state->hd63484, 0xce/2, 0xffff);
275#if
294#if 1
276295   if (input_code_pressed(screen->machine, KEYCODE_M)) b = 0;
277   if (input_code_pressed(screen->machine, KEYCODE_Q)) b += 0x060 * 280 * 1;
278   if (input_code_pressed(screen->machine, KEYCODE_W)) b += 0x060 * 280 * 2;
279   if (input_code_pressed(screen->machine, KEYCODE_E)) b += 0x060 * 280 * 3;
280   if (input_code_pressed(screen->machine, KEYCODE_R)) b += 0x060 * 280 * 4;
281   if (input_code_pressed(screen->machine, KEYCODE_T)) b += 0x060 * 280 * 5;
282   if (input_code_pressed(screen->machine, KEYCODE_Y)) b += 0x060 * 280 * 6;
283   if (input_code_pressed(screen->machine, KEYCODE_U)) b += 0x060 * 280 * 7;
284   if (input_code_pressed(screen->machine, KEYCODE_I)) b += 0x060 * 280 * 8;
285   if (input_code_pressed(screen->machine, KEYCODE_A)) b += 0x060 * 280 * 9;
286   if (input_code_pressed(screen->machine, KEYCODE_S)) b += 0x060 * 280 * 10;
287   if (input_code_pressed(screen->machine, KEYCODE_D)) b += 0x060 * 280 * 11;
288   if (input_code_pressed(screen->machine, KEYCODE_F)) b += 0x060 * 280 * 12;
289   if (input_code_pressed(screen->machine, KEYCODE_G)) b += 0x060 * 280 * 13;
290   if (input_code_pressed(screen->machine, KEYCODE_H)) b += 0x060 * 280 * 14;
291   if (input_code_pressed(screen->machine, KEYCODE_J)) b += 0x060 * 280 * 15;
292   if (input_code_pressed(screen->machine, KEYCODE_K)) b += 0x060 * 280 * 16;
293   if (input_code_pressed(screen->machine, KEYCODE_Z)) b += 0x060 * 280 * 17;
294   if (input_code_pressed(screen->machine, KEYCODE_X)) b += 0x060 * 280 * 18;
295   if (input_code_pressed(screen->machine, KEYCODE_C)) b += 0x060 * 280 * 19;
296   if (input_code_pressed(screen->machine, KEYCODE_V)) b += 0x060 * 280 * 20;
297   if (input_code_pressed(screen->machine, KEYCODE_B)) b += 0x060 * 280 * 21;
298   if (input_code_pressed(screen->machine, KEYCODE_N)) b += 0x060 * 280 * 22;
296   if (input_code_pressed(screen->machine, KEYCODE_Q)) b += 0x2000 * 1;
297   if (input_code_pressed(screen->machine, KEYCODE_W)) b += 0x2000 * 2;
298   if (input_code_pressed(screen->machine, KEYCODE_E)) b += 0x2000 * 3;
299   if (input_code_pressed(screen->machine, KEYCODE_R)) b += 0x2000 * 4;
300   if (input_code_pressed(screen->machine, KEYCODE_T)) b += 0x2000 * 5;
301   if (input_code_pressed(screen->machine, KEYCODE_Y)) b += 0x2000 * 6;
302   if (input_code_pressed(screen->machine, KEYCODE_U)) b += 0x2000 * 7;
303   if (input_code_pressed(screen->machine, KEYCODE_I)) b += 0x2000 * 8;
304   if (input_code_pressed(screen->machine, KEYCODE_A)) b += 0x2000 * 9;
305   if (input_code_pressed(screen->machine, KEYCODE_S)) b += 0x2000 * 10;
306   if (input_code_pressed(screen->machine, KEYCODE_D)) b += 0x2000 * 11;
307   if (input_code_pressed(screen->machine, KEYCODE_F)) b += 0x2000 * 12;
308   if (input_code_pressed(screen->machine, KEYCODE_G)) b += 0x2000 * 13;
309   if (input_code_pressed(screen->machine, KEYCODE_H)) b += 0x2000 * 14;
310   if (input_code_pressed(screen->machine, KEYCODE_J)) b += 0x2000 * 15;
311   if (input_code_pressed(screen->machine, KEYCODE_K)) b += 0x2000 * 16;
312   if (input_code_pressed(screen->machine, KEYCODE_Z)) b += 0x2000 * 17;
313   if (input_code_pressed(screen->machine, KEYCODE_X)) b += 0x2000 * 18;
314   if (input_code_pressed(screen->machine, KEYCODE_C)) b += 0x2000 * 19;
315   if (input_code_pressed(screen->machine, KEYCODE_V)) b += 0x2000 * 20;
316   if (input_code_pressed(screen->machine, KEYCODE_B)) b += 0x2000 * 21;
317   if (input_code_pressed(screen->machine, KEYCODE_N)) b += 0x2000 * 22;
299318#endif
300319   for (y = 0;y < 280;y++)
301320   {
r7356r7357
310329         b++;
311330      }
312331   }
313if (!input_code_pressed(screen->machine, KEYCODE_O))
332if (!input_code_pressed(screen->machine, KEYCODE_O)) // debug: toggle window
314333   if ((hd63484_regs_r(state->hd63484, 0x06/2, 0xffff) & 0x0300) == 0x0300)
315334   {
316335      int sy = (hd63484_regs_r(state->hd63484, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(state->hd63484, 0x88/2, 0xffff) >> 8);
r7356r7357
364383      case 0x0b: value = input_port_read(space->machine, "x11"); break;
365384      case 0x0c: value = input_port_read(space->machine, "x12"); break;
366385      case 0x0d: value = input_port_read(space->machine, "x13"); break;
367      case 0x0e: value = input_port_read(space->machine, "x14"); break;
368      case 0x0f: value = input_port_read(space->machine, "x15"); break;
386      case 0x0e: value = input_port_read(space->machine, "1P_START"); break;
387      case 0x0f: value = input_port_read(space->machine, "1P_COIN"); break;
369388   }
370389
371390   state->mux_data++;
372391   state->mux_data &= 0xf;
373
374   return value;
392/*
393    switch (mame_rand(space->machine) & 3)
394    {
395        case 0:
396            return 0;
397        case 1:
398            return 0xffff;
399        default:
400            return mame_rand(space->machine) & 0xffff;
401    }
402*/
403   return value | (mame_rand(space->machine) & 0x0000);
375404}
376405
377406/*???*/
r7356r7357
571600   PORT_DIPSETTING(     0x0004, DEF_STR( Off ) )
572601   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
573602   PORT_BIT( 0xfffb, IP_ACTIVE_LOW,  IPT_UNUSED  )
574   PORT_START("x14") //button 4
575   PORT_DIPNAME( 0x0004,0x0004, "SW14" )
576   PORT_DIPSETTING(     0x0004, DEF_STR( Off ) )
577   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
603   PORT_START("1P_START")
604   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
578605   PORT_BIT( 0xfffb, IP_ACTIVE_LOW,  IPT_UNUSED  )
579   PORT_START("x15")
580   PORT_DIPNAME( 0x0004,0x0004, "SW15" )
581   PORT_DIPSETTING(     0x0004, DEF_STR( Off ) )
582   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
606   PORT_START("1P_COIN")
607   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 )
583608   PORT_BIT( 0xfffb, IP_ACTIVE_LOW,  IPT_UNUSED  )
584609INPUT_PORTS_END
585610
r7356r7357
732757   ROM_LOAD16_BYTE( "quick_jack_index_a.2.u6.bin", 0x00001, 0x10000, CRC(210cb89b) SHA1(8eac60d40b60e845f9c02fee6c447f125ba5d1ab) )
733758
734759   ROM_REGION( 0x40000, "gfx1", 0 )
735   ROM_LOAD16_BYTE( "quick_jack_video_inde_a.1.u2.bin", 0x00000, 0x20000, CRC(73c27fc6) SHA1(12429bc0009b7754e08d2b6a5e1cd8251ab66e2d) )
736   ROM_LOAD16_BYTE( "quick_jack_video_inde_a.2.u6.bin", 0x00001, 0x20000, CRC(61d55be2) SHA1(bc17dc91fd1ef0f862eb0d7dbbbfa354a8403eb8) )
760   ROM_LOAD16_BYTE( "quick_jack_video_inde_a.1.u2.bin", 0x00001, 0x20000, CRC(73c27fc6) SHA1(12429bc0009b7754e08d2b6a5e1cd8251ab66e2d) )
761   ROM_LOAD16_BYTE( "quick_jack_video_inde_a.2.u6.bin", 0x00000, 0x20000, CRC(61d55be2) SHA1(bc17dc91fd1ef0f862eb0d7dbbbfa354a8403eb8) )
737762ROM_END
738763
739764ROM_START( skattv )
r7356r7357
742767   ROM_LOAD16_BYTE( "f2_ii.bin", 0x00001, 0x20000, CRC(0db1d2d5) SHA1(a29b0299352e0b2b713caf02aa7978f2a4b34e37) )
743768
744769   ROM_REGION( 0x40000, "gfx1", 0 )
745   ROM_LOAD16_BYTE( "f1_i.bin", 0x00000, 0x20000, CRC(4869a889) SHA1(ad9f3fcdfd3630f9ad5b93a9d2738de9fc3514d3) )
746   ROM_LOAD16_BYTE( "f1_ii.bin", 0x00001, 0x20000, CRC(17681537) SHA1(133685854b2080aaa3d0cced0287bc454d1f3bfc) )
770   ROM_LOAD16_BYTE( "f1_i.bin", 0x00001, 0x20000, CRC(4869a889) SHA1(ad9f3fcdfd3630f9ad5b93a9d2738de9fc3514d3) )
771   ROM_LOAD16_BYTE( "f1_ii.bin", 0x00000, 0x20000, CRC(17681537) SHA1(133685854b2080aaa3d0cced0287bc454d1f3bfc) )
747772ROM_END
748773
749774ROM_START( skattva )
r7356r7357
752777   ROM_LOAD16_BYTE( "skat_tv_version_ts3.2.u6.bin", 0x00001, 0x20000, CRC(4f927832) SHA1(bbe013005fd00dd42d12939eab5c80ec44a54b71) )
753778
754779   ROM_REGION( 0x40000, "gfx1", 0 )
755   ROM_LOAD16_BYTE( "skat_tv_videoprom_t2.1.u2.bin", 0x00000, 0x20000, CRC(de6f275b) SHA1(0c396fa4d1975c8ccc4967d330b368c0697d2124) )
756   ROM_LOAD16_BYTE( "skat_tv_videoprom_t2.2.u5.bin", 0x00001, 0x20000, CRC(af3e60f9) SHA1(c88976ea42cf29a092fdee18377b32ffe91e9f33) )
780   ROM_LOAD16_BYTE( "skat_tv_videoprom_t2.1.u2.bin", 0x00001, 0x20000, CRC(de6f275b) SHA1(0c396fa4d1975c8ccc4967d330b368c0697d2124) )
781   ROM_LOAD16_BYTE( "skat_tv_videoprom_t2.2.u5.bin", 0x00000, 0x20000, CRC(af3e60f9) SHA1(c88976ea42cf29a092fdee18377b32ffe91e9f33) )
757782ROM_END
758783
759784ROM_START( backgamn )
r7356r7357
762787   ROM_LOAD16_BYTE( "b_f2_ii.bin", 0x00001, 0x10000, CRC(8e0ee50c) SHA1(2a05c337db1131b873646aa4109593636ebaa356) )
763788
764789   ROM_REGION( 0x40000, "gfx1", 0 )
765   ROM_LOAD16_BYTE( "b_f1_i.bin", 0x00000, 0x20000, NO_DUMP )
766   ROM_LOAD16_BYTE( "b_f1_ii.bin", 0x00001, 0x20000, NO_DUMP )
790   ROM_LOAD16_BYTE( "b_f1_i.bin", 0x00001, 0x20000, NO_DUMP )
791   ROM_LOAD16_BYTE( "b_f1_ii.bin", 0x00000, 0x20000, NO_DUMP )
767792ROM_END
768793
769794ROM_START( fashiong )
r7356r7357
772797   ROM_LOAD16_BYTE( "fashion_gambler_s6_ii.bin", 0x00001, 0x80000, CRC(5a2466d1) SHA1(c113a2295beed2011c70887a1f2fcdec00b055cb) )
773798
774799   ROM_REGION( 0x100000, "gfx1", 0 )
775   ROM_LOAD16_BYTE( "fashion_gambler_video_s2_i.bin", 0x00000, 0x80000, CRC(d1ee9133) SHA1(e5fdfa303a3317f8f5fbdc03438ee97415afff4b) )
776   ROM_LOAD16_BYTE( "fashion_gambler_video_s2_ii.bin", 0x00001, 0x80000, CRC(07b1e722) SHA1(594cbe9edfea6b04a4e49d1c1594f1c3afeadef5) )
800   ROM_LOAD16_BYTE( "fashion_gambler_video_s2_i.bin", 0x00001, 0x80000, CRC(d1ee9133) SHA1(e5fdfa303a3317f8f5fbdc03438ee97415afff4b) )
801   ROM_LOAD16_BYTE( "fashion_gambler_video_s2_ii.bin", 0x00000, 0x80000, CRC(07b1e722) SHA1(594cbe9edfea6b04a4e49d1c1594f1c3afeadef5) )
777802
778803   ROM_REGION( 0x4000, "user1", 0 )
779804   //nvram - 16 bit
r7356r7357
787812   ROM_LOAD16_BYTE( "fldl_f6_2.bin", 0x00000, 0x80000, CRC(93bf1a4b) SHA1(5b4353feba1e0d4402cd26f4855e3803e6be43b9) )
788813
789814   ROM_REGION( 0x100000, "gfx1", 0 )
790   ROM_LOAD16_BYTE( "flv_f1_i.bin", 0x00000, 0x80000, CRC(286fccdc) SHA1(dd23deda625e486a7cfe1f3268731d10053a96e9) )
791   ROM_LOAD16_BYTE( "flv_f1_ii.bin", 0x00001, 0x80000, CRC(2aa904e6) SHA1(864530b136dd488d619cc95f48e7dce8d93d88e0) )
815   ROM_LOAD16_BYTE( "flv_f1_i.bin", 0x00001, 0x80000, CRC(286fccdc) SHA1(dd23deda625e486a7cfe1f3268731d10053a96e9) )
816   ROM_LOAD16_BYTE( "flv_f1_ii.bin", 0x00000, 0x80000, CRC(2aa904e6) SHA1(864530b136dd488d619cc95f48e7dce8d93d88e0) )
792817ROM_END
793818
794819ROM_START( fstation )
r7356r7357
797822   ROM_LOAD16_BYTE( "spielekoffer_9_sp_fun_station_f1.ii", 0x00001, 0x80000, CRC(a972184d) SHA1(1849e71e696039f07b7b67c4172c7999e81664c3) )
798823
799824   ROM_REGION( 0x100000, "gfx1", 0 )
800   ROM_LOAD16_BYTE( "spielekoffer_video_9_sp_f1.i", 0x00000, 0x80000, CRC(b6eb971e) SHA1(14e3272c66a82db0f77123974eea28f308209b1b) )
801   ROM_LOAD16_BYTE( "spielekoffer_video_9_sp_f1.ii", 0x00001, 0x80000, CRC(64138dcb) SHA1(1b629915cba32f8f6164ae5075c175b522b4a323) )
825   ROM_LOAD16_BYTE( "spielekoffer_video_9_sp_f1.i", 0x00001, 0x80000, CRC(b6eb971e) SHA1(14e3272c66a82db0f77123974eea28f308209b1b) )
826   ROM_LOAD16_BYTE( "spielekoffer_video_9_sp_f1.ii", 0x00000, 0x80000, CRC(64138dcb) SHA1(1b629915cba32f8f6164ae5075c175b522b4a323) )
802827ROM_END
803828
804829
src/mame/drivers/snesb.c
r7356r7357
99    - Final Fight 2
1010    - Sonic Blast Man 2
1111    - Iron (bootleg of Iron Commando)
12    - Ghost Chaser Densei
1213
1314    Not dumped:
1415    - Final Fight 3
r7356r7357
2021 - kiinstb -   fix gfx glitches, missing texts
2122
2223
23
2424  Final Fight 2 PCB layout:
2525  ------------------------
2626
r7356r7357
245245}
246246
247247
248/* Denseib */
248249
250static READ8_HANDLER(denseib_770071_r)
251{
252   return input_port_read(space->machine, "DSW1");
253}
249254
255static READ8_HANDLER(denseib_770079_r)
256{
257   return input_port_read(space->machine, "COIN");
258}
259
260
261
250262static ADDRESS_MAP_START( snesb_map, ADDRESS_SPACE_PROGRAM, 8)
251263   AM_RANGE(0x000000, 0x2fffff) AM_READWRITE(snes_r_bank1, snes_w_bank1)   /* I/O and ROM (repeats for each bank) */
252264   AM_RANGE(0x300000, 0x3fffff) AM_READWRITE(snes_r_bank2, snes_w_bank2)   /* I/O and ROM (repeats for each bank) */
r7356r7357
343355   PORT_DIPSETTING(   0x0, DEF_STR( No )  )
344356   PORT_DIPSETTING(   0x1, DEF_STR( Yes ) )
345357
346#ifdef MAME_DEBUG
358#ifdef SNES_LAYER_DEBUG
347359   PORT_START("DEBUG1")   /* IN 9 : debug switches */
348360   PORT_DIPNAME( 0x3, 0x0, "Browse tiles" )
349361   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
r7356r7357
447459   PORT_DIPSETTING(   0x0, DEF_STR( No )  )
448460   PORT_DIPSETTING(   0x1, DEF_STR( Yes ) )
449461
450#ifdef MAME_DEBUG
462#ifdef SNES_LAYER_DEBUG
451463   PORT_START("DEBUG1")   /* IN 9 : debug switches */
452464   PORT_DIPNAME( 0x3, 0x0, "Browse tiles" )
453465   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
r7356r7357
573585   PORT_DIPSETTING(   0x0, DEF_STR( No )  )
574586   PORT_DIPSETTING(   0x1, DEF_STR( Yes ) )
575587
576#ifdef MAME_DEBUG
588#ifdef SNES_LAYER_DEBUG
577589   PORT_START("DEBUG1")   /* IN 9 : debug switches */
578590   PORT_DIPNAME( 0x3, 0x0, "Browse tiles" )
579591   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
r7356r7357
685697   PORT_DIPSETTING(   0x0, DEF_STR( No )  )
686698   PORT_DIPSETTING(   0x1, DEF_STR( Yes ) )
687699
688#ifdef MAME_DEBUG
700#ifdef SNES_LAYER_DEBUG
689701   PORT_START("DEBUG1")   /* IN 9 : debug switches */
690702   PORT_DIPNAME( 0x3, 0x0, "Browse tiles" )
691703   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
r7356r7357
740752
741753INPUT_PORTS_END
742754
755static INPUT_PORTS_START( denseib )
756   PORT_START("PAD1L")      /* IN 0 : Joypad 1 - L */
757   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button A") PORT_PLAYER(1)
758   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Button X") PORT_PLAYER(1)
759   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P1 Button L") PORT_PLAYER(1)
760   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P1 Button R") PORT_PLAYER(1)
761   PORT_START("PAD1H")      /* IN 1 : Joypad 1 - H */
762   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Button B") PORT_PLAYER(1)
763   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Button Y") PORT_PLAYER(1)
764   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("P1 Select")
765   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("P1 Start")
766   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
767   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
768   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
769   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
743770
771   PORT_START("PAD2L")      /* IN 2 : Joypad 2 - L */
772   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Button A") PORT_PLAYER(2)
773   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P2 Button X") PORT_PLAYER(2)
774   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P2 Button L") PORT_PLAYER(2)
775   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P2 Button R") PORT_PLAYER(2)
776   PORT_START("PAD2H")      /* IN 3 : Joypad 2 - H */
777   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Button B") PORT_PLAYER(2)
778   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Button Y") PORT_PLAYER(2)
779   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_NAME("P2 Select")
780   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("P2 Start")
781   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
782   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
783   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
784   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
785
786   PORT_START("PAD3L")      /* IN 4 : Joypad 3 - L */
787   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P3 Button A") PORT_PLAYER(3)
788   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P3 Button X") PORT_PLAYER(3)
789   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P3 Button L") PORT_PLAYER(3)
790   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P3 Button R") PORT_PLAYER(3)
791   PORT_START("PAD3H")      /* IN 5 : Joypad 3 - H */
792   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 Button B") PORT_PLAYER(3)
793   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 Button Y") PORT_PLAYER(3)
794   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE3 ) PORT_NAME("P3 Select")
795   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START3 ) PORT_NAME("P3 Start")
796   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
797   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
798   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
799   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
800
801   PORT_START("PAD4L")      /* IN 6 : Joypad 4 - L */
802   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P4 Button A") PORT_PLAYER(4)
803   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P4 Button X") PORT_PLAYER(4)
804   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P4 Button L") PORT_PLAYER(4)
805   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P4 Button R") PORT_PLAYER(4)
806   PORT_START("PAD4H")      /* IN 7 : Joypad 4 - H */
807   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 Button B") PORT_PLAYER(4)
808   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 Button Y") PORT_PLAYER(4)
809   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE4 ) PORT_NAME("P4 Select")
810   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START4 ) PORT_NAME("P4 Start")
811   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
812   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
813   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
814   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
815
816   PORT_START("INTERNAL")      /* IN 8 : Internal switches */
817   PORT_DIPNAME( 0x1, 0x1, "Enforce 32 sprites/line" )
818   PORT_DIPSETTING(   0x0, DEF_STR( No )  )
819   PORT_DIPSETTING(   0x1, DEF_STR( Yes ) )
820
821#ifdef SNES_LAYER_DEBUG
822   PORT_START("DEBUG1")   /* IN 9 : debug switches */
823   PORT_DIPNAME( 0x3, 0x0, "Browse tiles" )
824   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
825   PORT_DIPSETTING(   0x1, "2bpl"  )
826   PORT_DIPSETTING(   0x2, "4bpl"  )
827   PORT_DIPSETTING(   0x3, "8bpl"  )
828   PORT_DIPNAME( 0xc, 0x0, "Browse maps" )
829   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
830   PORT_DIPSETTING(   0x4, "2bpl"  )
831   PORT_DIPSETTING(   0x8, "4bpl"  )
832   PORT_DIPSETTING(   0xc, "8bpl"  )
833
834   PORT_START("DEBUG2")   /* IN 10 : debug switches */
835   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle BG 1") PORT_PLAYER(2)
836   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Toggle BG 2") PORT_PLAYER(2)
837   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Toggle BG 3") PORT_PLAYER(2)
838   PORT_BIT( 0x8, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Toggle BG 4") PORT_PLAYER(2)
839   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle Objects") PORT_PLAYER(3)
840   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Toggle Main/Sub") PORT_PLAYER(3)
841   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Toggle Back col") PORT_PLAYER(3)
842   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Toggle Windows") PORT_PLAYER(3)
843
844   PORT_START("DEBUG3")   /* IN 11 : debug input */
845   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Pal prev")
846   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Pal next")
847   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle Transparency") PORT_PLAYER(4)
848#endif
849
850   PORT_START("DSW1")   /* IN 12 : dip-switches */
851   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:1" )
852   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" )
853   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:3" )
854   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:4" )
855   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:5" )
856   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" )
857   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" )
858   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" )
859
860   PORT_START("COIN")   /* IN 14 : coins */
861   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
862   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
863
864INPUT_PORTS_END
865
866
744867static MACHINE_DRIVER_START( kinstb )
745868   /* basic machine hardware */
746869   MDRV_CPU_ADD("maincpu", G65816, 3580000)   /* 2.68Mhz, also 3.58Mhz */
r7356r7357
9381061   DRIVER_INIT_CALL(snes);
9391062}
9401063
1064static DRIVER_INIT( denseib )
1065{
9411066
1067   UINT8 *rom = memory_region(machine, "user3");
1068
1069   INT32 i;
1070   for(i=0;i<0x200000;i++)
1071   {
1072      rom[i]=rom[i]^0xff;
1073      switch(i>>16)
1074      {
1075         case 0x00: rom[i]=BITSWAP8(rom[i],1,7,0,6,3,4,5,2); break;
1076         case 0x01: rom[i]=BITSWAP8(rom[i],3,4,7,2,0,6,5,1); break;
1077         case 0x02: rom[i]=BITSWAP8(rom[i],5,4,2,1,7,0,6,3); break;
1078         case 0x03: rom[i]=BITSWAP8(rom[i],0,1,3,7,2,6,5,4); break;
1079
1080         default:   rom[i]=BITSWAP8(rom[i],4,5,1,0,2,3,7,6); break;
1081      }
1082   }
1083
1084    /*  boot vector */
1085    rom[0xfffc]=0x40;
1086    rom[0xfffd]=0xf7;
1087
1088   /* extra inputs */
1089   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770071, 0x770071, 0, 0, denseib_770071_r);
1090    memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770079, 0x770079, 0, 0, denseib_770079_r);
1091
1092
1093   DRIVER_INIT_CALL(snes_hirom);
1094}
1095
1096
9421097ROM_START( kinstb )
9431098   ROM_REGION( 0x400000, "user3", 0 )
9441099   ROM_LOAD( "1.u14", 0x000000, 0x100000, CRC(70889919) SHA1(1451714cbdacb7f6ced2bc7afa478ad7264cf3b7) )
r7356r7357
10341189
10351190ROM_END
10361191
1192ROM_START( denseib )
1193   ROM_REGION( 0x200000, "user3", ROMREGION_ERASEFF )
1194   ROM_LOAD( "dj.u14", 0x000000, 0x0080000, CRC(487ded13) SHA1(624edce30fe2f2d750bcb49c609ceb511b2279b1) )
1195   ROM_LOAD( "dj.u15", 0x080000, 0x0080000, CRC(5932a440) SHA1(6048372268a097b08d9f56ad30f083267d798165) )
1196   ROM_LOAD( "dj.u16", 0x100000, 0x0080000, CRC(7cb71fd7) SHA1(7673e9dcaabe804e2d637e67eabca1683dad4245) )
1197   ROM_LOAD( "dj.u17", 0x180000, 0x0080000, CRC(de29dd89) SHA1(441aefbc7ee64515ee66431ef504e76dc8dc5ca3) )
1198
1199   ROM_REGION(0x100,           "user5", 0)
1200   ROM_LOAD("spc700.rom", 0, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) )
1201
1202   ROM_REGION(0x800,           "user6", ROMREGION_ERASEFF)
1203ROM_END
1204
1205
10371206GAME( 199?, kinstb,       0,     kinstb,        kinstb,    kinstb,      ROT0, "bootleg",   "Killer Instinct (SNES bootleg)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
10381207GAME( 1996, ffight2b,     0,     kinstb,        ffight2b,  ffight2b,   ROT0, "bootleg",   "Final Fight 2 (SNES bootleg)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
10391208GAME( 1997, sblast2b,     0,     kinstb,        sblast2b,  sblast2b,   ROT0, "bootleg",   "Sonic Blast Man 2 Special Turbo (SNES bootleg)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS)
10401209GAME( 1996, iron,         0,     kinstb,        iron,      iron,      ROT0, "bootleg",   "Iron (SNES bootleg)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
1210GAME( 1996, denseib,      0,     kinstb,        denseib,   denseib,   ROT0, "bootleg",   "Ghost Chaser Densei (SNES bootleg)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
10411211GAME( 1996, endless,      0,     kinstb,        iron,      endless,    ROT0, "bootleg",   "Gundam Wing: Endless Duel (SNES bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/crbaloon.c
r7356r7357
438438 *
439439 *************************************/
440440
441GAME( 1980, crbaloon, 0,      crbaloon, crbaloon, 0, ROT90, "Taito Corporation", "Crazy Balloon (set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
441GAME( 1980, crbaloon, 0,        crbaloon, crbaloon, 0, ROT90, "Taito Corporation", "Crazy Balloon (set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
442442GAME( 1980, crbaloon2,crbaloon, crbaloon, crbaloon, 0, ROT90, "Taito Corporation", "Crazy Balloon (set 2)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/funkybee.c
r7356r7357
4646  - Possible "Lives" settings : 3, 4, 5 or 6 (code at 0x0501)
4747  - Bonus life routine at 0x2d03 (test on DSW bit 6)
4848
491b) 'funkbeeb'
491b) 'funkybeeb'
5050
5151  - Removal of ORCA copyright on title screen (text at 0x0e9a).
5252    However, high scores table remains unchanged.
r7356r7357
6464    but "Bonus Life" settings depend on the starting number of lives.
6565    DSW bit 6 has no effect because of this.
6666
672a) 'skylance'
672a) 'skylancre'
6868
6969  - Possible "Lives" settings : 3, 4, 5 or 6 (code at 0x0601)
7070  - Bonus life routine at 0x1f28 (test on DSW bit 6)
r7356r7357
160160   PORT_DIPSETTING(   0x80, DEF_STR( Cocktail ) )
161161INPUT_PORTS_END
162162
163static INPUT_PORTS_START( funkbeeb )
163static INPUT_PORTS_START( funkybeeb )
164164   PORT_INCLUDE(funkybee)
165165
166166   PORT_MODIFY("DSW")
r7356r7357
219219   PORT_DIPSETTING(   0x80, DEF_STR( Cocktail ) )
220220INPUT_PORTS_END
221221
222static INPUT_PORTS_START( skylance )
222static INPUT_PORTS_START( skylancre )
223223   PORT_INCLUDE(skylancr)
224224
225225   PORT_MODIFY("DSW")
r7356r7357
436436ROM_END
437437
438438GAME( 1982, funkybee,  0,        funkybee, funkybee, 0, ROT90, "Orca",                           "Funky Bee",                            GAME_SUPPORTS_SAVE )
439GAME( 1982, funkybeeb, funkybee, funkybee, funkbeeb, 0, ROT90, "bootleg",                        "Funky Bee (bootleg, harder)",          GAME_SUPPORTS_SAVE )
439GAME( 1982, funkybeeb, funkybee, funkybee, funkybeeb,0, ROT90, "bootleg",                        "Funky Bee (bootleg, harder)",          GAME_SUPPORTS_SAVE )
440440GAME( 1983, skylancr,  0,        funkybee, skylancr, 0, ROT90, "Orca",                           "Sky Lancer",                           GAME_SUPPORTS_SAVE )
441GAME( 1983, skylancre, skylancr, funkybee, skylance, 0, ROT90, "Orca (Esco Trading Co license)", "Sky Lancer (Esco Trading Co license)", GAME_SUPPORTS_SAVE )
441GAME( 1983, skylancre, skylancr, funkybee, skylancre,0, ROT90, "Orca (Esco Trading Co license)", "Sky Lancer (Esco Trading Co license)", GAME_SUPPORTS_SAVE )
src/mame/drivers/freekick.c
r7356r7357
182182   AM_RANGE(0xfc03, 0xfc03) AM_DEVWRITE("sn4", sn76496_w)
183183ADDRESS_MAP_END
184184
185static ADDRESS_MAP_START( freekckb_map, ADDRESS_SPACE_PROGRAM, 8 )
185static ADDRESS_MAP_START( freekickb_map, ADDRESS_SPACE_PROGRAM, 8 )
186186   AM_RANGE(0x0000, 0xcfff) AM_ROM
187187   AM_RANGE(0xd000, 0xdfff) AM_RAM
188188   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(freek_videoram_w) AM_BASE_MEMBER(freekick_state, videoram)   // tilemap
r7356r7357
236236   AM_RANGE(0x05, 0x05) AM_WRITE(oigas_5_w)
237237ADDRESS_MAP_END
238238
239static ADDRESS_MAP_START( freekckb_io_map, ADDRESS_SPACE_IO, 8 )
239static ADDRESS_MAP_START( freekickb_io_map, ADDRESS_SPACE_IO, 8 )
240240   ADDRESS_MAP_GLOBAL_MASK(0xff)
241241   AM_RANGE(0xff, 0xff) AM_READWRITE(freekick_ff_r, freekick_ff_w)
242242ADDRESS_MAP_END
r7356r7357
689689   MDRV_MACHINE_RESET(freekick)
690690MACHINE_DRIVER_END
691691
692static MACHINE_DRIVER_START( freekckb )
692static MACHINE_DRIVER_START( freekickb )
693693   MDRV_IMPORT_FROM(base)
694694
695695   MDRV_CPU_MODIFY("maincpu")
696   MDRV_CPU_PROGRAM_MAP(freekckb_map)
697   MDRV_CPU_IO_MAP(freekckb_io_map)
696   MDRV_CPU_PROGRAM_MAP(freekickb_map)
697   MDRV_CPU_IO_MAP(freekickb_io_map)
698698
699699   MDRV_MACHINE_START(freekick)
700700   MDRV_MACHINE_RESET(freekick)
r7356r7357
825825   ROM_LOAD( "24s10n.7h", 0x0500, 0x0100, CRC(a507f941) SHA1(97619959ee4c366cb010525636ab5eefe5a3127a) )
826826ROM_END
827827
828ROM_START( freekckb )
828ROM_START( freekickb )
829829   ROM_REGION( 0x10000, "maincpu", 0 ) /* Z80 Code */
830830   ROM_LOAD( "freekbl8.q7", 0x00000, 0x10000, CRC(4208cfe5) SHA1(21628cbe8a217fbae30a6c24c9cc4c790fe45d65) ) // this was on the bootleg, would normally be battery backed inside cpu?
831831
r7356r7357
851851   ROM_LOAD( "24s10n.7h", 0x0500, 0x0100, CRC(a507f941) SHA1(97619959ee4c366cb010525636ab5eefe5a3127a) )
852852ROM_END
853853
854ROM_START( freekcb2 )
854ROM_START( freekickb2 )
855855   ROM_REGION( 0x10000, "maincpu", 0 ) /* Z80 Code */
856856   ROM_LOAD( "15.bin", 0x00000, 0x10000, CRC(6569f2b0) SHA1(9306e316e6ae659bae3759a12a4e445b555a8893) ) // this was on the bootleg, would normally be battery backed inside cpu?
857857
r7356r7357
914914   ROM_LOAD( "24s10n.7h", 0x0500, 0x0100, CRC(c77d0077) SHA1(4cbbf625ad5e45d00ca6aebe9566538ff0a3348d) )
915915ROM_END
916916
917ROM_START( countrb2 )
917ROM_START( countrunb2 )
918918   ROM_REGION( 0x10000, "maincpu", 0 ) /* Z80 Code */
919919   ROM_LOAD( "crunbl.8", 0x00000, 0x10000, CRC(318f95d9) SHA1(f2386b9d26d1bc98728aad9e257363b381043dc9) ) // encrypted? bad? its strange anyway
920920
r7356r7357
943943   ROM_LOAD( "24s10n.7h", 0x0500, 0x0100, CRC(c77d0077) SHA1(4cbbf625ad5e45d00ca6aebe9566538ff0a3348d) )
944944ROM_END
945945
946ROM_START( countrnb )
946ROM_START( countrunb )
947947   ROM_REGION( 0x10000, "maincpu", 0 ) /* Z80 Code */
948948   ROM_LOAD( "rom_cpu.bin", 0x00000, 0x10000, CRC(f65639ae) SHA1(faa81607858d49559098c887ac847722df955a76) )
949949
r7356r7357
11341134 *  Game driver(s)
11351135 *
11361136 *************************************/
1137/*    YEAR  NAME      PARENT    MACHINE   INPUT     INIT      ROT     COMPANY   FULLNAME        FLAGS  */
1138GAME( 1986, gigas,    0,        gigas,    gigas,    gigas,    ROT270, "Sega", "Gigas (MC-8123, 317-5002)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1139GAME( 1986, gigasb,   gigas,    gigas,    gigas,    gigasb,   ROT270, "bootleg", "Gigas (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
1140GAME( 1986, oigas,    gigas ,   oigas,    gigas,    gigasb,   ROT270, "bootleg", "Oigas (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
1141GAME( 1986, gigasm2b, 0,        gigas,    gigasm2,  gigasb,   ROT270, "bootleg", "Gigas Mark II (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
1142GAME( 1987, pbillrd,  0,        pbillrd,  pbillrd,  0,        ROT0,   "Nihon System", "Perfect Billiard", GAME_SUPPORTS_SAVE )
1143GAME( 1987, pbillrds, pbillrd,  pbillrd,  pbillrd,  pbillrds, ROT0,   "Nihon System", "Perfect Billiard (MC-8123, 317-0030)", GAME_SUPPORTS_SAVE )
1144GAME( 1987, freekick, 0,        freekckb, freekck,  0,        ROT270, "Nihon System (Sega license)", "Free Kick", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1145GAME( 1987, freekckb, freekick, freekckb, freekck,  0,        ROT270, "bootleg", "Free Kick (bootleg set 1)", GAME_SUPPORTS_SAVE )
1146GAME( 1987, freekcb2, freekick, freekckb, freekck,  0,        ROT270, "bootleg", "Free Kick (bootleg set 2)", GAME_SUPPORTS_SAVE )
1147GAME( 1988, countrun, 0,        freekckb, countrun, 0,        ROT0,   "Nihon System (Sega license)", "Counter Run", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1148GAME( 1988, countrnb, countrun, freekckb, countrun, 0,        ROT0,   "bootleg", "Counter Run (bootleg set 1)", GAME_SUPPORTS_SAVE )
1149GAME( 1988, countrb2, countrun, freekckb, countrun, 0,        ROT0,   "bootleg", "Counter Run (bootleg set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1137/*    YEAR  NAME       PARENT    MACHINE    INPUT     INIT      ROT     COMPANY   FULLNAME        FLAGS  */
1138GAME( 1986, gigas,     0,        gigas,     gigas,    gigas,    ROT270, "Sega", "Gigas (MC-8123, 317-5002)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1139GAME( 1986, gigasb,    gigas,    gigas,     gigas,    gigasb,   ROT270, "bootleg", "Gigas (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
1140GAME( 1986, oigas,     gigas ,   oigas,     gigas,    gigasb,   ROT270, "bootleg", "Oigas (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
1141GAME( 1986, gigasm2b,  0,        gigas,     gigasm2,  gigasb,   ROT270, "bootleg", "Gigas Mark II (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
1142GAME( 1987, pbillrd,   0,        pbillrd,   pbillrd,  0,        ROT0,   "Nihon System", "Perfect Billiard", GAME_SUPPORTS_SAVE )
1143GAME( 1987, pbillrds,  pbillrd,  pbillrd,   pbillrd,  pbillrds, ROT0,   "Nihon System", "Perfect Billiard (MC-8123, 317-0030)", GAME_SUPPORTS_SAVE )
1144GAME( 1987, freekick,  0,        freekickb, freekck,  0,        ROT270, "Nihon System (Sega license)", "Free Kick", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1145GAME( 1987, freekickb, freekick, freekickb, freekck,  0,        ROT270, "bootleg", "Free Kick (bootleg set 1)", GAME_SUPPORTS_SAVE )
1146GAME( 1987, freekickb2,freekick, freekickb, freekck,  0,        ROT270, "bootleg", "Free Kick (bootleg set 2)", GAME_SUPPORTS_SAVE )
1147GAME( 1988, countrun,  0,        freekickb, countrun, 0,        ROT0,   "Nihon System (Sega license)", "Counter Run", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1148GAME( 1988, countrunb, countrun, freekickb, countrun, 0,        ROT0,   "bootleg", "Counter Run (bootleg set 1)", GAME_SUPPORTS_SAVE )
1149GAME( 1988, countrunb2,countrun, freekickb, countrun, 0,        ROT0,   "bootleg", "Counter Run (bootleg set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
11501150
src/mame/drivers/hshavoc.c
r7356r7357
3939#include "cpu/m68000/m68000.h"
4040#include "sound/2612intf.h"
4141#include "sound/sn76496.h"
42#include "includes/megadriv.h"
4243
43#include "megadriv.h"
44
4544static INPUT_PORTS_START( hshavoc )
4645   PORT_START("IN0")   /* 16bit */
4746   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unknown ) )
src/mame/drivers/neptunp2.c
r0r7357
1/***************************************************************************
2
3    Neptune's Pearls (c) Unidesa?
4
5    skeleton driver, can't do much without gfx roms anyway.
6
7***************************************************************************/
8
9#include "emu.h"
10#include "cpu/i86/i86.h"
11
12static VIDEO_START( neptunp2 )
13{
14
15}
16
17static VIDEO_UPDATE( neptunp2 )
18{
19   return 0;
20}
21
22static READ8_HANDLER( test_r )
23{
24   return mame_rand(space->machine);
25}
26
27static ADDRESS_MAP_START( neptunp2_map, ADDRESS_SPACE_PROGRAM, 8 )
28   AM_RANGE(0x00000, 0xbffff) AM_ROM
29   AM_RANGE(0xe0000, 0xeffff) AM_RAM
30
31   AM_RANGE(0xd0000, 0xd7fff) AM_RAM //videoram
32   AM_RANGE(0xdb004, 0xdb007) AM_RAM
33   AM_RANGE(0xdb00c, 0xdb00f) AM_RAM
34
35   AM_RANGE(0xff806, 0xff806) AM_READ(test_r)
36   AM_RANGE(0xff810, 0xff810) AM_READ(test_r)
37   AM_RANGE(0xff812, 0xff812) AM_READ(test_r)
38
39   AM_RANGE(0xff980, 0xff980) AM_WRITENOP
40
41   AM_RANGE(0xffff0, 0xfffff) AM_ROM
42ADDRESS_MAP_END
43
44static ADDRESS_MAP_START( neptunp2_io, ADDRESS_SPACE_IO, 8 )
45ADDRESS_MAP_END
46
47
48static INPUT_PORTS_START( neptunp2 )
49
50INPUT_PORTS_END
51
52#if 0
53static const gfx_layout charlayout =
54{
55   8,8,   /* 8*8 characters */
56   RGN_FRAC(1,3),   /* 1024 characters */
57   3,   /* 3 bits per pixel */
58   { RGN_FRAC(1,3), RGN_FRAC(2,3), RGN_FRAC(0,3) },   /* the bitplanes are separated */
59   { 0, 1, 2, 3, 4, 5, 6, 7 },
60   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
61   8*8   /* every char takes 8 consecutive bytes */
62};
63#endif
64
65static GFXDECODE_START( neptunp2 )
66//  GFXDECODE_ENTRY( "gfx1", 0, charlayout,     0, 8 )
67GFXDECODE_END
68
69static MACHINE_DRIVER_START( neptunp2 )
70
71   /* basic machine hardware */
72   MDRV_CPU_ADD("maincpu",I80188,20000000) // N80C188-20 AMD
73   MDRV_CPU_PROGRAM_MAP(neptunp2_map)
74   MDRV_CPU_IO_MAP(neptunp2_io)
75//  MDRV_CPU_VBLANK_INT("screen",irq0_line_hold)
76
77   /* video hardware */
78   MDRV_SCREEN_ADD("screen", RASTER)
79   MDRV_SCREEN_REFRESH_RATE(60)
80   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
81   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
82   MDRV_SCREEN_SIZE(32*8, 32*8)
83   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
84   MDRV_GFXDECODE(neptunp2)
85   MDRV_PALETTE_LENGTH(512)
86
87   MDRV_VIDEO_START(neptunp2)
88   MDRV_VIDEO_UPDATE(neptunp2)
89
90   /* sound hardware */
91   MDRV_SPEAKER_STANDARD_MONO("mono")
92
93MACHINE_DRIVER_END
94
95/***************************************************************************
96
97  Game driver(s)
98
99***************************************************************************/
100
101ROM_START( neptunp2 )
102   ROM_REGION( 0x100000, "maincpu", 0 )
103   ROM_LOAD( "u2.bin",   0x000000, 0x100000, CRC(4fbb06d1) SHA1(6490cd3b96b3b61f48fcb843772bd787605ab76f) )
104
105   ROM_REGION( 0x100000, "prg_data", 0 ) //dunno how this maps ...
106   ROM_LOAD( "u3.bin",   0x000000, 0x100000, CRC(3c1746e2) SHA1(a7fd59f5397ce1653848e15f16399b537f3a1ea7) )
107
108   ROM_REGION( 0x200000, "oki", 0 )
109   ROM_LOAD( "u14.bin",  0x000000, 0x100000, CRC(a2de1156) SHA1(58b325b720057e8d7105fe3a87ac2c0109afad84) )
110   ROM_LOAD( "u15.bin",  0x100000, 0x100000, CRC(8de6d4de) SHA1(121e7507ef57074bc7ad0bf69556f26c84c4e236) )
111
112   ROM_REGION( 0x10000, "gfx", 0 )
113   ROM_LOAD( "flash_roms", 0x00000, 0x10000, NO_DUMP )
114ROM_END
115
116GAME( 199?, neptunp2,  0,   neptunp2, neptunp2,  0, ROT0, "Unidesa?", "Neptune's Pearls 2", GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/drivers/commando.c
r7356r7357
3838****************************************************************************
3939
4040Note : there is an ingame typo bug that doesn't display the bonus life values
41       correctly on the title screen in 'commando', 'commandj' and 'spaceinv'.
41       correctly on the title screen in 'commando', 'commandoj' and 'spaceinv'.
4242
4343***************************************************************************/
4444
r7356r7357
155155   PORT_DIPSETTING(    0xc0, DEF_STR( Cocktail ) )
156156INPUT_PORTS_END
157157
158static INPUT_PORTS_START( commandu )
158static INPUT_PORTS_START( commandou )
159159   PORT_INCLUDE(commando)
160160
161161   PORT_MODIFY("DSW2")
r7356r7357
403403
404404ROM_START( commandob )
405405   ROM_REGION( 2*0x10000, "maincpu", 0 )   /* 64k for code + 64k for decrypted opcodes */
406   ROM_LOAD( "commandb_04_9m_27256.bin",  0x0000, 0x8000, CRC(348a7654) SHA1(f3668c47c154a9c7d7afeabb0259c9bc56e847ac) )
406   ROM_LOAD( "commandob_04_9m_27256.bin",  0x0000, 0x8000, CRC(348a7654) SHA1(f3668c47c154a9c7d7afeabb0259c9bc56e847ac) )
407407   ROM_LOAD( "cm03.8m",  0x8000, 0x4000, CRC(35486542) SHA1(531a85c9e03970ce037be84f2240c2df6f6e3ec1) )
408408
409409   ROM_REGION( 0x10000, "audiocpu", 0 )
r7356r7357
442442           and the CPU1 (a Z80 compatible NEC D780C-1). This sub-board is plugged on what seems to be
443443           a ROM socket. */
444444   ROM_REGION( 0x0200, "plds", 0 )
445   ROM_LOAD( "commandb_pal16l8a.bin", 0x0000, 0x0104, NO_DUMP ) /* I Didn't try to dump it... */
445   ROM_LOAD( "commandob_pal16l8a.bin", 0x0000, 0x0104, NO_DUMP ) /* I Didn't try to dump it... */
446446ROM_END
447447
448448ROM_START( sinvasn )
r7356r7357
561561/* Game Drivers */
562562
563563GAME( 1985, commando,  0,        commando, commando, commando, ROT270, "Capcom", "Commando (World)", GAME_SUPPORTS_SAVE )
564GAME( 1985, commandou, commando, commando, commandu, commando, ROT270, "Capcom (Data East USA license)", "Commando (US)", GAME_SUPPORTS_SAVE )
564GAME( 1985, commandou, commando, commando, commandou,commando, ROT270, "Capcom (Data East USA license)", "Commando (US)", GAME_SUPPORTS_SAVE )
565565GAME( 1985, commandoj, commando, commando, commando, commando, ROT270, "Capcom", "Senjou no Ookami", GAME_SUPPORTS_SAVE )
566566GAME( 1985, commandob, commando, commando, commando, spaceinv, ROT270, "bootleg", "Commando (bootleg)", GAME_SUPPORTS_SAVE )
567567GAME( 1985, sinvasn,   commando, commando, commando, commando, ROT270, "Capcom", "Space Invasion (Europe)", GAME_SUPPORTS_SAVE )
src/mame/drivers/gng.c
r7356r7357
519519   ROM_LOAD( "gg-pal10l8.bin",  0x0000, 0x002c, CRC(87f1b7e0) SHA1(b719c3be7bd4a02660bb0887f752e9769cbd37d2) )
520520ROM_END
521521
522ROM_START( gngc )
523   ROM_REGION( 0x18000, "maincpu", 0 )
524   ROM_LOAD( "mm_c_04",    0x04000, 0x4000, CRC(4f94130f) SHA1(6863fee3c97c76ba314ccbada7efacb6783e7d32) )
525   ROM_LOAD( "mm_c_03",    0x08000, 0x8000, CRC(1def138a) SHA1(d29e12082c4d5c06a9910b3500ef66242cdec905) )
526   ROM_LOAD( "mm_c_05",    0x10000, 0x8000, CRC(ed28e86e) SHA1(064871918547a56be330c6994d4db2c9932e14db) )
527
528   ROM_REGION( 0x10000, "audiocpu", 0 )
529   ROM_LOAD( "gg2.bin",      0x0000, 0x8000, CRC(615f5b6f) SHA1(7ef9ec5c2072e21c787a6bbf700033f50c759c1d) )
530
531   ROM_REGION( 0x04000, "gfx1", 0 )
532   ROM_LOAD( "gg1.bin",      0x00000, 0x4000, CRC(ecfccf07) SHA1(0a1518e19a2e0a4cc3dde4b9568202ea911b5ece) ) /* characters */
533
534   ROM_REGION( 0x18000, "gfx2", 0 )
535   ROM_LOAD( "gg11.bin",     0x00000, 0x4000, CRC(ddd56fa9) SHA1(f9d77eee5e2738b7e83ba02fcc55dd480391479f) ) /* tiles 0-1 Plane 1*/
536   ROM_LOAD( "gg10.bin",     0x04000, 0x4000, CRC(7302529d) SHA1(8434c994cc55d2586641f3b90b6b15fd65dfb67c) ) /* tiles 2-3 Plane 1*/
537   ROM_LOAD( "gg9.bin",      0x08000, 0x4000, CRC(20035bda) SHA1(bbb1fba0eb19471f66d29526fa8423ccb047bd63) ) /* tiles 0-1 Plane 2*/
538   ROM_LOAD( "gg8.bin",      0x0c000, 0x4000, CRC(f12ba271) SHA1(1c42fa02cb27b35d10c3f7f036005e747f9f6b79) ) /* tiles 2-3 Plane 2*/
539   ROM_LOAD( "gg7.bin",      0x10000, 0x4000, CRC(e525207d) SHA1(1947f159189b3a53f1251d8653b6e7c65c91fc3c) ) /* tiles 0-1 Plane 3*/
540   ROM_LOAD( "gg6.bin",      0x14000, 0x4000, CRC(2d77e9b2) SHA1(944da1ce29a18bf0fc8deff78bceacba0bf23a07) ) /* tiles 2-3 Plane 3*/
541
542   ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASEFF )
543   ROM_LOAD( "gg17.bin",     0x00000, 0x4000, CRC(93e50a8f) SHA1(42d367f57bb2fdf60a0445ac1533da99cfeaa617) ) /* sprites 0 Plane 1-2 */
544   ROM_LOAD( "gg16.bin",     0x04000, 0x4000, CRC(06d7e5ca) SHA1(9e06012bcd82f98fad43de666ef9a75979d940ab) ) /* sprites 1 Plane 1-2 */
545   ROM_LOAD( "gg15.bin",     0x08000, 0x4000, CRC(bc1fe02d) SHA1(e3a1421d465b87148ffa94f5673b2307f0246afe) ) /* sprites 2 Plane 1-2 */
546   ROM_LOAD( "gg14.bin",     0x10000, 0x4000, CRC(6aaf12f9) SHA1(207a7407288182a4f3eddaea634c6a6452131182) ) /* sprites 0 Plane 3-4 */
547   ROM_LOAD( "gg13.bin",     0x14000, 0x4000, CRC(e80c3fca) SHA1(cb641c25bb04b970b2cbeca41adb792bbe142fb5) ) /* sprites 1 Plane 3-4 */
548   ROM_LOAD( "gg12.bin",     0x18000, 0x4000, CRC(7780a925) SHA1(3f129ca6d695548b659955fe538584bd9ac2ff17) ) /* sprites 2 Plane 3-4 */
549
550   ROM_REGION( 0x0200, "proms", 0 )
551   ROM_LOAD( "tbp24s10.14k", 0x0000, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) )  /* video timing (not used) */
552   ROM_LOAD( "63s141.2e",    0x0100, 0x0100, CRC(4a1285a4) SHA1(5018c3950b675af58db499e2883ecbc55419b491) )  /* priority (not used) */
553ROM_END
554
555
522556ROM_START( gngt )
523557   ROM_REGION( 0x18000, "maincpu", 0 )
524558   ROM_LOAD( "mm04",         0x04000, 0x4000, CRC(652406f6) SHA1(3b2bafd31f670ea26c568c48f3bd00597e5a2ed6) ) /* 4000-5fff is page 4 */
r7356r7357
699733GAME( 1985, gnga,      gng, gng, gng,      0,       ROT0, "Capcom", "Ghosts'n Goblins (World? set 2)", GAME_SUPPORTS_SAVE )
700734GAME( 1985, gngbl,     gng, gng, gng,      0,       ROT0, "Capcom", "Ghosts'n Goblins (bootleg with Cross)", GAME_SUPPORTS_SAVE )
701735GAME( 1985, gngblita,  gng, gng, gng,      0,       ROT0, "Capcom", "Ghosts'n Goblins (Italian bootleg, harder)", GAME_SUPPORTS_SAVE )
736GAME( 1985, gngc,      gng, gng, gng,      0,       ROT0, "Capcom", "Ghosts'n Goblins (World? set 3)", GAME_SUPPORTS_SAVE ) // rev c?
702737GAME( 1985, gngt,      gng, gng, gng,      0,       ROT0, "Capcom (Taito America license)", "Ghosts'n Goblins (US)", GAME_SUPPORTS_SAVE )
703738GAME( 1985, makaimur,  gng, gng, makaimur, 0,       ROT0, "Capcom", "Makai-Mura (Japan)", GAME_SUPPORTS_SAVE )
704739GAME( 1985, makaimurc, gng, gng, makaimur, 0,       ROT0, "Capcom", "Makai-Mura (Japan Revision C)", GAME_SUPPORTS_SAVE )
src/mame/drivers/gunsmoke.c
r7356r7357
3939    You can enter 3 chars for your initials.
4040
4141
422) 'gunsmokj'
422) 'gunsmokej'
4343
4444  - Japan version (but English text though).
4545    You can enter 8 chars for your initials.
4646
4747
483) 'gunsmoku'
483) 'gunsmokeu'
4949
5050  - US version licenced to Romstar.
5151    You can enter 3 chars for your initials.
5252
5353
544) 'gunsmoka'
544) 'gunsmokeua'
5555
5656  - US version licenced to Romstar.
5757    You can enter 3 chars for your initials.
r7356r7357
209209   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
210210INPUT_PORTS_END
211211
212static INPUT_PORTS_START( gunsmoka )
212static INPUT_PORTS_START( gunsmokeua )
213213   PORT_INCLUDE(gunsmoke)
214214
215215   // Same as 'gunsmoke', but "Lives" Dip Switch instead of "Demonstration" Dip Switch
r7356r7357
539539
540540/* Game Drivers */
541541
542GAME( 1985, gunsmoke, 0,        gunsmoke, gunsmoke, 0, ROT270, "Capcom", "Gun.Smoke (World)", GAME_SUPPORTS_SAVE )
543GAME( 1985, gunsmokej, gunsmoke, gunsmoke, gunsmoke, 0, ROT270, "Capcom", "Gun.Smoke (Japan)", GAME_SUPPORTS_SAVE )
544GAME( 1985, gunsmokeu, gunsmoke, gunsmoke, gunsmoke, 0, ROT270, "Capcom (Romstar license)", "Gun.Smoke (US set 1)", GAME_SUPPORTS_SAVE )
545GAME( 1986, gunsmokeua, gunsmoke, gunsmoke, gunsmoka, 0, ROT270, "Capcom (Romstar license)", "Gun.Smoke (US set 2)", GAME_SUPPORTS_SAVE )
542GAME( 1985, gunsmoke,  0,        gunsmoke, gunsmoke,  0, ROT270, "Capcom", "Gun.Smoke (World)", GAME_SUPPORTS_SAVE )
543GAME( 1985, gunsmokej, gunsmoke, gunsmoke, gunsmoke,  0, ROT270, "Capcom", "Gun.Smoke (Japan)", GAME_SUPPORTS_SAVE )
544GAME( 1985, gunsmokeu, gunsmoke, gunsmoke, gunsmoke,  0, ROT270, "Capcom (Romstar license)", "Gun.Smoke (US set 1)", GAME_SUPPORTS_SAVE )
545GAME( 1986, gunsmokeua,gunsmoke, gunsmoke, gunsmokeua,0, ROT270, "Capcom (Romstar license)", "Gun.Smoke (US set 2)", GAME_SUPPORTS_SAVE )
src/mame/drivers/ssf2md.c
r7356r7357
11#include "emu.h"
2#include "megadriv.h"
2#include "includes/megadriv.h"
33
44ROM_START( ssf2ghw )
55   ROM_REGION( 0x1400000, "maincpu", 0 ) /* 68000 Code */
src/mame/drivers/naomi.c
r7356r7357
30663066
30673067   ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF)
30683068   ROM_LOAD("epr-23377.ic11",        0x0000000, 0x0400000, CRC(4ca3149c) SHA1(9d25fc659658b416202b033754669be2f3abcdbe) )
3069   /* ic1 empty? test mode reports a bad result. */
3069   /* Test mode returns IC1 as bad dump, it looks like that is data provided by the Actel A54SX32 FPGA present on board
3070       and mirrored there.  Provided as documentation until we know more about it. */
3071   ROM_LOAD("gram2000.ic1",          0x0800000, 0x0800000, CRC(4a86556a) SHA1(61100dc84c95dd47d9f61c7cc52ea25579b90632) )
30703072   ROM_LOAD32_WORD("mpr-23357.ic17", 0x1000000, 0x0800000, CRC(eaf77487) SHA1(bdfc4666a6724441c11b31d89fa30c4bd11cbdd1) ) //ic 2
30713073   ROM_LOAD32_WORD("mpr-23358.ic18", 0x1000002, 0x0800000, CRC(96819a5b) SHA1(e28c9d7b0579ab5d6116401b49f30dc8e4961618) ) //ic 3
30723074   ROM_LOAD32_WORD("mpr-23359.ic19", 0x2000000, 0x0800000, CRC(757b9e89) SHA1(b131af1cbcb4fcebb7081b208acc86841192ff14) ) //ic 4
r7356r7357
30893091   ROM_LOAD32_WORD("mpr-23376.ic36", 0xa000002, 0x0800000, CRC(e09cb473) SHA1(c3ec980f1a56142a0e06bae9594d6038acf0690d) ) //ic 21
30903092ROM_END
30913093
3094ROM_START( crackndj )
3095   ROM_REGION( 0x200000, "maincpu", 0)
3096   NAOMI_BIOS
3097   NAOMI_DEFAULT_EEPROM
3098
3099   ROM_REGION( 0xa800000, "user1", ROMREGION_ERASEFF)
3100        ROM_LOAD( "epr-23450.ic22", 0x0000000, 0x400000, CRC(ba0ee505) SHA1(7777f532ace9032a25fc949316c07bd70dd03851) )
3101        ROM_LOAD( "mpr-23525.ic1",  0x0800000, 0x1000000, CRC(01996526) SHA1(1080305424989593e606f8195d295e0fb822ae43) )
3102        ROM_LOAD( "mpr-23526.ic2",  0x1800000, 0x1000000, CRC(d7a0d52e) SHA1(64a03c6da70c64fc62dbb0f9a4b0fb35de59c72f) )
3103        ROM_LOAD( "mpr-23527.ic3",  0x2800000, 0x1000000, CRC(9361afd9) SHA1(fee55341b623cc1928d8f95acd53e20759db725f) )
3104        ROM_LOAD( "mpr-23528.ic4",  0x3800000, 0x1000000, CRC(e40b7970) SHA1(6467463994f2b4535f822357ff2c8ca2dd4450c8) )
3105        ROM_LOAD( "mpr-23529.ic5",  0x4800000, 0x1000000, CRC(5920e6e5) SHA1(eec207dba99ca541f2abc98674e8dcaef506af3b) )
3106        ROM_LOAD( "mpr-23530.ic6",  0x5800000, 0x1000000, CRC(2bb0aefc) SHA1(8e5e90a4b8780411a41f14f1ca16dd049aefcd4b) )
3107        ROM_LOAD( "mpr-23531.ic7",  0x6800000, 0x1000000, CRC(43592459) SHA1(1b69ce3c54ad2c054ea72547afba6ef55a2daf63) )
3108        ROM_LOAD( "mpr-23532.ic8",  0x7800000, 0x1000000, CRC(bbcddeee) SHA1(8649da1411e404953d5ebd4e459d407eb79b61b1) )
3109        ROM_LOAD( "mpr-23533.ic9",  0x8800000, 0x1000000, CRC(fc909c00) SHA1(9cf22a97ea272c4586f3942aefdb803bd0e6ede7) )
3110        ROM_LOAD( "mpr-23534.ic10", 0x9800000, 0x1000000, CRC(62ed85b6) SHA1(b88336bc6115c92a839981cb0c0d0a67b1f7eda5) )
3111ROM_END
3112
30923113/*
30933114SYSTEMID: NAOMI
30943115JAP: GUILTY GEAR X
r7356r7357
45434564/* Complete Dumps */
45444565/* 840-xxxxx (Sega games)*/
45454566/* 0001C */ GAME( 1998, dybbnao,  naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Dynamite Baseball NAOMI (JPN)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4567/* 0002C */ GAME( 1999, crzytaxi, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Crazy Taxi (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45464568/* 0003C */ GAME( 1999, zombrvn,  naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Zombie Revenge (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45474569/* 0007C */ GAME( 1999, ggram2,   naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Giant Gram (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45484570/* 0010C */ GAME( 1999, vs2_2k,   naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Virtua Striker 2 Ver. 2000 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45494571/* 0011C */ GAME( 1999, toyfight, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Toy Fighter", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4572/* 0013C */ GAME( 1999, jambo,    naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Jambo! Safari (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45504573/* 0015C */ GAME( 1999, vtennis,  naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Power Smash (JPN) / Virtua Tennis (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4551/* ????? */ GAME( 1999, sgtetris, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Sega Tetris", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45524574/* 0016C */ GAME( 1999, derbyoc,  naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Derby Owners Club (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45534575/* 0017C */ GAME( 1999, otrigger, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "OutTrigger (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4576/* 0018C */ GAME( 1999, sgtetris, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Sega Tetris", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45544577/* 0019C */ GAME( 1999, dybb99,   naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Dynamite Baseball '99 (JPN) / World Series '99 (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45554578/* 00??C */ GAME( 1999, smlg99,   naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Super Major League '99", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45564579/* 0020C */ GAME( 1999, samba,    naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Samba De Amigo (JPN)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4557/* 0083C */ GAME( 1999, derbyoc2, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Derby Owners Club II (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4558/* ????? */ GAME( 1999, crzytaxi, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",      "Crazy Taxi (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4559/* ????? */ GAME( 1999, jambo,    naomi,    naomi,    naomi,    naomi, ROT0, "Sega",      "Jambo! Safari (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45604580/* 0021C */ GAME( 2000, virnba,   naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Virtua NBA (JPN, USA, EXP, KOR, AUS)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45614581/* 0021C */ GAME( 2000, virnbao,  virnba,   naomi,    naomi,    naomi, ROT0, "Sega",            "Virtua NBA (JPN, USA, EXP, KOR, AUS) (original)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45624582/* 0026C */ GAME( 2000, totd,     naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "The Typing of the Dead (JPN, USA, EXP, KOR, AUS)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4563/* ????? */ GAME( 2000, 18wheelr, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "18 Wheeler (JPN)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45644583/* 0027C */ GAME( 2000, smarinef, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Sega Marine Fishing", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4565/* 0030C */ GAME( 2000, qmegamis, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Quiz Ah Megamisama (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4566/* 0039C */ GAME( 2000, gram2000, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Giant Gram 2000 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4584/* 0030C */ GAME( 2000, qmegamis, naomi,    naomi,    naomi,    qmegamis, ROT0, "Sega",            "Quiz Ah Megamisama (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4585/* 0037C */ GAME( 2000, 18wheelr, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "18 Wheeler (JPN)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4586/* 0039C */ GAME( 2000, gram2000, naomi,    naomi,    naomi,    gram2000, ROT0, "Sega",            "Giant Gram 2000 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45674587/* 0040C */ GAME( 2000, wwfroyal, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "WWF Royal Rumble (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45684588/* 0041C */ GAME( 2000, slasho,   naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Slashout (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4589/* 0043C */ GAME( 2000, crackndj, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Crackin' DJ", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45694590/* 0044C */ GAME( 2001, csmash,   naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Cosmic Smash (JPN, USA, EXP, KOR, AUS) (rev. A)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45704591/* 0044C */ GAME( 2001, csmasho,  csmash,   naomi,    naomi,    naomi, ROT0, "Sega",            "Cosmic Smash (JPN, USA, EXP, KOR, AUS) (original)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4592/* 0083C */ GAME( 2001, derbyoc2, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Derby Owners Club II (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4593/* 0084C */ GAME( 2001, vtenis2c, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Power Smash 2 / Virtua Tennis 2 (cartridge)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4594/* 0098C */ GAME( 2001, shootopl, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Shootout Pool", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45714595/* 0128C */ GAME( 2001, shootpl,  naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Shootout Pool (JPN, USA, KOR, AUS) / Shootout Pool Prize (EXP)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4572/* 0???? */ GAME( 2001, shootopl, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Shootout Pool", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4573/* 0???? */ GAME( 2001, vtenis2c, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Power Smash 2 / Virtua Tennis 2 (cartridge)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45744596
45754597/* 841-xxxxx ("Licensed by Sega" games)*/
45764598/* 0001C */ GAME( 1999, pstone,   naomi,    naomi,    naomi,    naomi,    ROT0, "Capcom",          "Power Stone (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
r7356r7357
45794601/* 0003C */ GAME( 2000, doa2m,    doa2,     naomi,    naomi,    naomi,    ROT0, "Tecmo",           "Dead or Alive 2 Millennium (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45804602/* 0004C */ GAME( 1999, shangril, naomi,    naomi,    naomi_mp, naomi_mp, ROT0, "Marvelous Ent.",  "Dengen Tenshi Taisen Janshi Shangri-la (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45814603/* 0005C */ GAME( 1999, spawn,    naomi,    naomi,    naomi,    naomi,    ROT0, "Capcom",          "Spawn (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4582/* 0007C */ GAME( 2000, mvsc2,    naomi,    naomi,    naomi,    naomi,    ROT0, "Capcom",          "Marvel vs. Capcom 2 (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4604/* 0007C */ GAME( 2000, mvsc2,    naomi,    naomi,    naomi,    mvsc2,    ROT0, "Capcom",          "Marvel vs. Capcom 2 (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45834605/* 0008C */ GAME( 2000, pstone2,  naomi,    naomi,    naomi,    naomi,    ROT0, "Capcom",          "Power Stone 2 (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45844606/* 0011C */ GAME( 2000, capsnk,   naomi,    naomi,    naomi,    naomi, ROT0, "Capcom / SNK",    "Capcom Vs. SNK Millennium Fight 2000 (000904 JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
45854607/* 0011C */ GAME( 2000, capsnka,  capsnk,    naomi,    naomi,    naomi, ROT0, "Capcom / SNK",    "Capcom Vs. SNK Millennium Fight 2000 (000804 JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
r7356r7357
59836005GAME( 2001, vstrik3c, naomi2,  naomi,    naomi,    0,  ROT0,  "Sega",          "Virtua Striker 3 (Cart) (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
59846006GAME( 2001, wldrider, naomi2,  naomi,    naomi,    0,  ROT0,  "Sega",          "Wild Riders (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
59856007GAME( 2001, vf4cart,  naomi2,  naomi,    naomi,    0,  ROT0,  "Sega",          "Virtua Fighter 4 (Cartridge)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
5986GAME( 2001, vf4evoct,  naomi2,  naomi,   naomi,    0,  ROT0,  "Sega",          "Virtua Fighter 4 Evolution (Cartridge)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
6008GAME( 2001, vf4evoct,  naomi2,  naomi,   naomi,    vf4evoct,  ROT0,  "Sega",          "Virtua Fighter 4 Evolution (Cartridge)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
59876009GAME( 2002, clubkrte, naomi2,  naomi,    naomi,    0,  ROT0,  "Sega",          "Club Kart: European Session", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
59886010
59896011/* GDS-xxxx (Sega first party games) */
src/mame/drivers/asteroid.c
r7356r7357
358358INPUT_PORTS_END
359359
360360
361static INPUT_PORTS_START( asteroib )
361static INPUT_PORTS_START( asteroidb )
362362   PORT_INCLUDE( asteroid )
363363
364364   PORT_MODIFY("IN0")
r7356r7357
920920 *
921921 *************************************/
922922
923static DRIVER_INIT( asteroib )
923static DRIVER_INIT( asteroidb )
924924{
925925   memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2000, 0x2000, 0, 0, "IN0");
926926   memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2003, 0x2003, 0, 0, "HS");
r7356r7357
943943GAME( 1979, asteroid, 0,        asteroid, asteroid, 0,        ROT0, "Atari",   "Asteroids (rev 4)",        GAME_SUPPORTS_SAVE )
944944GAME( 1979, asteroid2,asteroid, asteroid, asteroid, 0,        ROT0, "Atari",   "Asteroids (rev 2)",        GAME_SUPPORTS_SAVE )
945945GAME( 1979, asteroid1,asteroid, asteroid, asteroid, 0,        ROT0, "Atari",   "Asteroids (rev 1)",        GAME_SUPPORTS_SAVE )
946GAME( 1979, asteroidb,asteroid, asteroid, asteroib, asteroib, ROT0, "bootleg", "Asteroids (bootleg on Lunar Lander hardware)", GAME_SUPPORTS_SAVE )
946GAME( 1979, asteroidb,asteroid, asteroid, asteroidb,asteroidb,ROT0, "bootleg", "Asteroids (bootleg on Lunar Lander hardware)", GAME_SUPPORTS_SAVE )
947947GAME( 1979, asterock, asteroid, asterock, asterock, asterock, ROT0, "Sidam",   "Asterock",                 GAME_SUPPORTS_SAVE )
948948GAME( 1979, meteorts, asteroid, asteroid, asteroid, 0,        ROT0, "VGG",     "Meteorites",               GAME_SUPPORTS_SAVE )
949949GAME( 1980, meteorho, asteroid, asteroid, asteroid, 0,        ROT0, "Hoei",    "Meteor",                   GAME_SUPPORTS_SAVE )
src/mame/drivers/megatech.c
r7356r7357
9292#include "sound/sn76496.h"
9393#include "rendlay.h"
9494
95#include "segamsys.h"
96#include "megadriv.h"
95#include "includes/segamsys.h"
96#include "includes/megadriv.h"
9797
9898static struct _mtech_bios mtech_bios;
9999
src/mame/drivers/vamphalf.c
r7356r7357
1919    Mission Craft              (c) 2000 Sun                (version 2.4)
2020    Final Godori               (c) 2001 SemiCom            (version 2.20.5915)
2121    Wyvern Wings               (c) 2001 SemiCom
22    Mr. Kicker                 (c) 2001 SemiCom
2223    Age Of Heroes - Silkroad 2 (c) 2001 Unico              (v0.63 - 2001/02/07)
2324
2425 Real games bugs:
r7356r7357
12691270+---------------------------------------------+
12701271|                     +------+                |
12711272|            YM3012   |  U7  |                |
1272|                     +------+                |
1273| VR1                 +------+                |
12731274|            YM2151   M6295                   |
12741275|                                             |
12751276|            +-----+      MEM1l  +----------+ |
r7356r7357
12961297ROM1 & U7 are 27C040
12971298ROML00 & ROMH00 are MX 29F1610MC flashroms
12981299ROM0, ROML01 & ROMH01 are unpopulated
1299YM2151, YM3012 & M6295 badged as BS901, BS902 U6295
1300YM2151, YM3012 & M6295 badged as BS901, BS902 & U6295
13001301CRAM are MCM6206BAEJ15
13011302DRAM are KM416C1204AJ-6
13021303MEM are MCM6206BAEJ15
r7356r7357
13041305
13051306SW1 is the reset button
13061307SW2 is the setup button
1308VR1 is the volume adjust pot
13071309
13081310*/
13091311
r7356r7357
13351337ROM_END
13361338
13371339/*
1340
1341Mr. Kicker (c) SemiCom
1342
1343SEMICOM-003b
1344
1345+---------------------------------------------+
1346|                     +------+                |
1347|            YM3012   |  U7  |                |
1348| VR1                 +------+                |
1349|            YM2151   M6295                   |
1350|                                             |
1351|            +-----+      MEM1l  +----------+ |
1352|            |CRAM2|             |QuickLogic| |
1353|            +-----+             | QL12X16B | |
1354|            +-----+             | XPL84C   | |
1355|  +-------+ |CRAM2|      MEM1U  |          | |
1356|J | DRAM1 | +-----+             +----------+ |
1357|A +-------+ +----------+ MEM3                |
1358|M +-------+ |          |        +----------+ |
1359|M | DRAM2 | |HyperStone| MEM7   |QuickLogic| |
1360|A +-------+ |  E1-32T  |        | QL12X16B | |
1361|            |          | MEM6   | XPL84C   | |
1362|     PAL    +----------+        |          | |
1363|                         MEM2   +----------+ |
1364|SW1 SW2       61L256S                        |
1365|        ROM0*  +--------+ +--------+  28MHz  |
1366|        ROM1   | ROML00 | | ROMH00 |  +-----+|
1367|               +--------+ +--------+  |93C46||
1368|   50MHz         ROML01*    ROMH01*   +-----+|
1369|                                             |
1370+---------------------------------------------+
1371
1372ROM1 & U7 are 27C040
1373ROML00 & ROMH00 are MX 29F1610MC flashroms
1374ROM0, ROML01 & ROMH01 are unpopulated
1375YM2151, YM3012 & M6295 badged as U6651, U6612 & AD-65
1376CRAM are MCM6206BAEJ15
1377DRAM are KM416C1204AJ-6
1378MEM are MCM6206BAEJ15
137961L256S - 32K x 8 bit High Speed CMOS SRAM (game's so called "Backup Data")
1380
1381SW1 is the reset button
1382SW2 is the setup button
1383VR1 is the volume adjust pot
1384
1385*/
1386
1387ROM_START( mrkicker )
1388   ROM_REGION32_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */
1389   /* rom0 empty */
1390   ROM_LOAD( "2-semicom.rom1", 0x080000, 0x080000, CRC(d3da29ca) SHA1(b843c650096a1c6d50f99e354ec0c93eb4406c5b) )
1391
1392   ROM_REGION( 0x800000, "gfx1", 0 )  /* gfx data */
1393   ROM_LOAD32_WORD( "roml00", 0x000000, 0x200000, CRC(c677aac3) SHA1(356073a29260e8e6c29dd12b2113b30140c6108c) )
1394   ROM_LOAD32_WORD( "romh00", 0x000002, 0x200000, CRC(b6337d4a) SHA1(2f46e2933af7fd0f71083900d5e6e4f602ab4c66) )
1395   /* roml01 empty */
1396   /* romh01 empty */
1397
1398   ROM_REGION( 0x080000, "user2", 0 ) /* Oki Samples */
1399   ROM_LOAD( "at27c040.u7", 0x000000, 0x080000, CRC(e8141fcd) SHA1(256fd1987030e0a1df0a66a228c1fea996cda686) ) /* Mask ROM */
1400
1401   /* $00000-$20000 stays the same in all sound banks, */
1402   /* the second half of the bank is what gets switched */
1403   ROM_REGION( 0x100000, "oki", 0 ) /* Samples */
1404   ROM_COPY( "user2", 0x000000, 0x000000, 0x020000)
1405   ROM_COPY( "user2", 0x000000, 0x020000, 0x020000)
1406   ROM_COPY( "user2", 0x000000, 0x040000, 0x020000)
1407   ROM_COPY( "user2", 0x020000, 0x060000, 0x020000)
1408   ROM_COPY( "user2", 0x000000, 0x080000, 0x020000)
1409   ROM_COPY( "user2", 0x040000, 0x0a0000, 0x020000)
1410   ROM_COPY( "user2", 0x000000, 0x0c0000, 0x020000)
1411   ROM_COPY( "user2", 0x060000, 0x0e0000, 0x020000)
1412ROM_END
1413
1414/*
13381415Age Of Heroes - Silkroad 2
13391416Unico, 2001
13401417
r7356r7357
16821759   semicom_prot_data[1] = 3;
16831760}
16841761
1762static DRIVER_INIT( mrkicker )
1763{
1764   finalgdr_backupram_bank = 1;
1765   finalgdr_backupram = auto_alloc_array(machine, UINT8, 0x80*0x100);
1766//  memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x005e874, 0x005e877, 0, 0, mrkicker_speedup_r );
1767
1768   palshift = 0;
1769   flip_bit = 1; //?
1770
1771   semicom_prot_idx = 8;
1772   semicom_prot_data[0] = 2;
1773   semicom_prot_data[1] = 3;
1774}
1775
16851776static DRIVER_INIT( dquizgo2 )
16861777{
16871778   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x00cde70, 0x00cde73, 0, 0, dquizgo2_speedup_r );
r7356r7357
17171808GAME( 2000, dquizgo2, 0,        coolmini, common,   dquizgo2, ROT0,   "SemiCom",           "Date Quiz Go Go Episode 2" , 0)
17181809GAME( 2000, misncrft, 0,        misncrft, common,   misncrft, ROT90,  "Sun",               "Mission Craft (version 2.4)", GAME_NO_SOUND )
17191810GAME( 2001, finalgdr, 0,        finalgdr, finalgdr, finalgdr, ROT0,   "SemiCom",           "Final Godori (Korea, version 2.20.5915)", 0 )
1811GAME( 2001, mrkicker, 0,        finalgdr, finalgdr, mrkicker, ROT0,   "SemiCom",           "Mr. Kicker", 0 )
17201812GAME( 2001, wyvernwg, 0,        wyvernwg, common,   wyvernwg, ROT270, "SemiCom (Game Vision License)", "Wyvern Wings", GAME_NO_SOUND )
17211813GAME( 2001, aoh,      0,        aoh,      aoh,      aoh,      ROT0,   "Unico",             "Age Of Heroes - Silkroad 2 (v0.63 - 2001/02/07)", 0 )
src/mame/drivers/bishi.c
r7356r7357
526526ROM_END
527527
528528
529GAME( 1996, bishi,    0,      bishi, bishi, 0, ROT0, "Konami", "Bishi Bashi Championship Mini Game Senshuken (ver JAA, 3 Players)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
529GAME( 1996, bishi,    0,      bishi, bishi,   0, ROT0, "Konami", "Bishi Bashi Championship Mini Game Senshuken (ver JAA, 3 Players)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
530530GAME( 1998, sbishi,   0,      bishi, bishi2p, 0, ROT0, "Konami", "Super Bishi Bashi Championship (ver JAA, 2 Players)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
531GAME( 1998, sbishik,  sbishi, bishi, bishi, 0, ROT0, "Konami", "Super Bishi Bashi Championship (ver KAA, 3 Players)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
531GAME( 1998, sbishik,  sbishi, bishi, bishi,   0, ROT0, "Konami", "Super Bishi Bashi Championship (ver KAA, 3 Players)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
src/mame/drivers/raiden.c
r7356r7357
8181
8282/************************* Alternate board set ************************/
8383
84static ADDRESS_MAP_START( alt_map, ADDRESS_SPACE_PROGRAM, 16 )
84static ADDRESS_MAP_START( alt_main_map, ADDRESS_SPACE_PROGRAM, 16 )
8585   AM_RANGE(0x00000, 0x06fff) AM_RAM
8686   AM_RANGE(0x07000, 0x07fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
8787   AM_RANGE(0x08000, 0x08fff) AM_RAM AM_SHARE("share1") AM_BASE(&raiden_shared_ram)
r7356r7357
9696
9797/******************************************************************************/
9898
99static ADDRESS_MAP_START( raidenu_main_map, ADDRESS_SPACE_PROGRAM, 16 )
100   AM_RANGE(0x00000, 0x06fff) AM_RAM
101   AM_RANGE(0x07000, 0x07fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
102   AM_RANGE(0x08000, 0x08035) AM_WRITEONLY AM_BASE(&raiden_scroll_ram)
103   AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE("share1") AM_BASE(&raiden_shared_ram)
104   AM_RANGE(0x0b000, 0x0b001) AM_READ_PORT("P1_P2")
105   AM_RANGE(0x0b002, 0x0b003) AM_READ_PORT("DSW")
106   AM_RANGE(0x0b000, 0x0b007) AM_WRITE(raidena_control_w)
107   AM_RANGE(0x0c000, 0x0c7ff) AM_WRITE(raiden_text_w) AM_BASE_GENERIC(videoram)
108   AM_RANGE(0x0d000, 0x0d00d) AM_READWRITE(seibu_main_word_r, seibu_main_word_w)
109   AM_RANGE(0xa0000, 0xfffff) AM_ROM
110ADDRESS_MAP_END
111
112
113static ADDRESS_MAP_START( raidenu_sub_map, ADDRESS_SPACE_PROGRAM, 16 )
114   AM_RANGE(0x00000, 0x05fff) AM_RAM
115   AM_RANGE(0x06000, 0x067ff) AM_RAM_WRITE(raiden_background_w) AM_BASE(&raiden_back_data)
116   AM_RANGE(0x06800, 0x06fff) AM_RAM_WRITE(raiden_foreground_w) AM_BASE(&raiden_fore_data)
117   AM_RANGE(0x07000, 0x07fff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
118   AM_RANGE(0x08000, 0x08fff) AM_RAM AM_SHARE("share1")
119   //AM_RANGE(0x07ffe, 0x0afff) AM_WRITENOP
120   AM_RANGE(0xc0000, 0xfffff) AM_ROM
121ADDRESS_MAP_END
122
123/*****************************************************************************/
124
99125static INPUT_PORTS_START( raiden )
100126   SEIBU_COIN_INPUTS   /* coin inputs read through sound cpu */
101127
r7356r7357
270296   SEIBU_SOUND_SYSTEM_YM3812_RAIDEN_INTERFACE(XTAL_14_31818MHz/4,XTAL_12MHz/12) // frequency and pin 7 verified (pin set in audio\seibu.h)
271297MACHINE_DRIVER_END
272298
273
274299static MACHINE_DRIVER_START( raidena )
275300
276   /* basic machine hardware */
277   MDRV_CPU_ADD("maincpu", V30,XTAL_20MHz/2) /* NEC V30 CPU, 20MHz verified on pcb */
278   MDRV_CPU_PROGRAM_MAP(alt_map)
279   MDRV_CPU_VBLANK_INT("screen", raiden_interrupt)
301   MDRV_IMPORT_FROM( raiden )
302   MDRV_CPU_MODIFY("maincpu")
303   MDRV_CPU_PROGRAM_MAP(alt_main_map)
280304
281   MDRV_CPU_ADD("sub", V30,XTAL_20MHz/2) /* NEC V30 CPU, 20MHz verified on pcb */
282   MDRV_CPU_PROGRAM_MAP(sub_map)
283   MDRV_CPU_VBLANK_INT("screen", raiden_interrupt)
305   MDRV_VIDEO_START(raidena)
306MACHINE_DRIVER_END
284307
285   SEIBU_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) /* verified on pcb */
308static MACHINE_DRIVER_START( raidenu )
309   MDRV_IMPORT_FROM( raiden )
286310
287   MDRV_QUANTUM_TIME(HZ(7200))
311   MDRV_CPU_MODIFY("maincpu")
312   MDRV_CPU_PROGRAM_MAP(raidenu_main_map)
288313
289   MDRV_MACHINE_RESET(seibu_sound)
314   MDRV_CPU_MODIFY("sub")
315   MDRV_CPU_PROGRAM_MAP(raidenu_sub_map)
290316
291   /* video hardware */
292   MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
293
294   MDRV_SCREEN_ADD("screen", RASTER)
295   MDRV_SCREEN_REFRESH_RATE(59.60)    /* verified on pcb */
296   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
297   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
298   MDRV_SCREEN_SIZE(32*8, 32*8)
299   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
300
301   MDRV_GFXDECODE(raiden)
302   MDRV_PALETTE_LENGTH(2048)
303
304317   MDRV_VIDEO_START(raidena)
305   MDRV_VIDEO_EOF(raiden)
306   MDRV_VIDEO_UPDATE(raiden)
307
308   /* sound hardware */
309   SEIBU_SOUND_SYSTEM_YM3812_RAIDEN_INTERFACE(XTAL_14_31818MHz/4,XTAL_12MHz/12) /* frequency and pin 7 verified on pcb */
310318MACHINE_DRIVER_END
311319
320
312321/***************************************************************************/
313322
314323ROM_START( raiden )
r7356r7357
447456   ROM_LOAD( "rai7.bin", 0x00000, 0x10000, CRC(8f927822) SHA1(592f2719f2c448c3b4b239eeaec078b411e12dbb) )
448457ROM_END
449458
459
460ROM_START( raidenu )
461   ROM_REGION( 0x100000, "maincpu", 0 ) /* v30 main cpu */
462   ROM_LOAD16_BYTE( "1.c8",     0x0a0000, 0x10000, CRC(a4b12785) SHA1(446314e82ce01315cb3e3d1f323eaa2ad6fb48dd) )
463   ROM_LOAD16_BYTE( "2.c7",     0x0a0001, 0x10000, CRC(17640bd5) SHA1(5bbc99900426b1a072b52537ae9a50220c378a0d) )
464   ROM_LOAD16_BYTE( "3dd.e8",   0x0c0000, 0x20000, CRC(b6f3bad2) SHA1(214474ab9fa65e2716155b77d7825951cc98148a) )
465   ROM_LOAD16_BYTE( "4dd.e7",   0x0c0001, 0x20000, CRC(d294dfc1) SHA1(03606ddfa35d5cb34c447fa370495e1fbb0cad0e) )
466
467   ROM_REGION( 0x100000, "sub", 0 ) /* v30 sub cpu */
468   ROM_LOAD16_BYTE( "5.p8",   0x0c0000, 0x20000, CRC(15c1cf45) SHA1(daac732a1d3e8f36fa665f984e05651cbca74fef) )
469   ROM_LOAD16_BYTE( "6.p7",   0x0c0001, 0x20000, CRC(261c381b) SHA1(64a9e0ea9abcba6287829cf4abb806362b62c806) )
470
471   ROM_REGION( 0x20000, "audiocpu", 0 ) /* 64k code for sound Z80 */
472   ROM_LOAD( "8.w8",   0x000000, 0x08000, CRC(105b9c11) SHA1(eb142806f8410d584d914b91207361a15ab18e6f) )
473   ROM_CONTINUE(                 0x10000, 0x08000 )
474   ROM_COPY( "audiocpu", 0,      0x18000, 0x08000 )
475
476   ROM_REGION( 0x010000, "gfx1", 0 )
477   ROM_LOAD( "9.u016",     0x00000, 0x08000, CRC(1922b25e) SHA1(da27122dd1c43770e7385ad602ef397c64d2f754) ) /* chars */
478   ROM_LOAD( "10.u017",    0x08000, 0x08000, CRC(5f90786a) SHA1(4f63b07c6afbcf5196a433f3356bef984fe303ef) )
479
480   ROM_REGION( 0x080000, "gfx2", 0 )
481   ROM_LOAD( "sei420.u011", 0x00000, 0x80000, CRC(da151f0b) SHA1(02682497caf5f058331f18c652471829fa08d54f) ) /* tiles */
482
483   ROM_REGION( 0x080000, "gfx3", 0 )
484   ROM_LOAD( "sei430.u013", 0x00000, 0x80000, CRC(ac1f57ac) SHA1(1de926a0db73b99904ef119ac816c53d1551156a) ) /* tiles */
485
486   ROM_REGION( 0x090000, "gfx4", 0 )
487   ROM_LOAD( "sei440.u012",  0x00000, 0x80000, CRC(946d7bde) SHA1(30e8755c2b1ca8bff6278710b8422b51f75eec10) ) /* sprites */
488
489   ROM_REGION( 0x40000, "oki", 0 )    /* ADPCM samples */
490   ROM_LOAD( "7.x10", 0x00000, 0x10000, CRC(2051263e) SHA1(dff96caa11adf619360d88704e3af8427ddfe524) )
491ROM_END
492
493
450494/***************************************************************************/
451495
452/* Spin the sub-cpu if it is waiting on the master cpu */
496
497
498/* this used to be needed to stop the collisions from breaking (high interleave didn't help), is it still required? */
499//#define SYNC_HACK
500
501#ifdef SYNC_HACK
453502static READ16_HANDLER( sub_cpu_spin_r )
454503{
455504   int pc=cpu_get_pc(space->cpu);
456505   int ret=raiden_shared_ram[0x4];
457506
507   // main set
458508   if (pc==0xfcde6 && ret!=0x40)
459509      cpu_spin(space->cpu);
460510
461   return ret;
462}
463
464static READ16_HANDLER( sub_cpu_spina_r )
465{
466   int pc=cpu_get_pc(space->cpu);
467   int ret=raiden_shared_ram[0x4];
468
511   // alt sets
469512   if (pc==0xfcde8 && ret!=0x40)
470513      cpu_spin(space->cpu);
471514
472515   return ret;
473516}
517#endif
474518
475519static DRIVER_INIT( raiden )
476520{
521#ifdef SYNC_HACK
477522   memory_install_read16_handler(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x4008, 0x4009, 0, 0, sub_cpu_spin_r);
523#endif
478524}
479525
480static void memory_patcha(running_machine *machine)
526static DRIVER_INIT( raidenu )
481527{
482   memory_install_read16_handler(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x4008, 0x4009, 0, 0, sub_cpu_spina_r);
528   DRIVER_INIT_CALL(raiden);
529   seibu_sound_decrypt(machine,"audiocpu",0x20000);
483530}
484531
485532/* This is based on code by Niclas Karlsson Mate, who figured out the
r7356r7357
487534bit-swapping */
488535static void common_decrypt(running_machine *machine)
489536{
537
490538   UINT16 *RAM = (UINT16 *)memory_region(machine, "maincpu");
491539   int i;
492540
r7356r7357
513561
514562static DRIVER_INIT( raidenk )
515563{
516   memory_patcha(machine);
564   DRIVER_INIT_CALL(raiden);
517565   common_decrypt(machine);
518566}
519567
520568static DRIVER_INIT( raidena )
521569{
522   memory_patcha(machine);
570   DRIVER_INIT_CALL(raiden);
523571   common_decrypt(machine);
524572   seibu_sound_decrypt(machine,"audiocpu",0x20000);
525573}
526574
575
576
527577/***************************************************************************/
528578
529GAME( 1990, raiden,  0,      raiden,  raiden, raiden,  ROT270, "Seibu Kaihatsu", "Raiden", 0 )
579GAME( 1990, raiden,  0,      raiden,  raiden, raiden,  ROT270, "Seibu Kaihatsu", "Raiden", 0 ) // main/sub/sound not encrypted
580GAME( 1990, raidenu, raiden, raidenu, raiden, raidenu, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US, SEI8904 + SEI9008 PCBs)", 0 ) // main/sub not encrypted
530581GAME( 1990, raidena, raiden, raidena, raiden, raidena, ROT270, "Seibu Kaihatsu", "Raiden (Alternate Hardware)", 0 )
531GAME( 1990, raidenk, raiden, raidena, raiden, raidenk, ROT270, "Seibu Kaihatsu (IBL Corporation license)", "Raiden (Korea)", 0 )
582GAME( 1990, raidenk, raiden, raidena, raiden, raidenk, ROT270, "Seibu Kaihatsu (IBL Corporation license)", "Raiden (Korea)", 0 ) // sound not encrypted
532583GAME( 1990, raident, raiden, raidena, raiden, raidena, ROT270, "Seibu Kaihatsu (Liang HWA Electronics license)", "Raiden (Taiwan)", 0 )
src/mame/drivers/bloodbro.c
r7356r7357
5555    entering the initials (code at 0x004a1e, 0x014bb0 and 0x014c84)
5656
5757
582) 'bloodbra'
582) 'bloodbroa'
5959
6060  - When "Starting Coin" Dip Switch is set to "x2", you need 2 coins to start
6161    a game (but 1 coin to join), then 1 coin to continue.
src/mame/drivers/carjmbre.c
r7356r7357
2828
2929Notes:
3030
31- sound cpu speed chosen from coin error countdown, 1.536 MHz is too fast
32  as it loses synchronisation with the onscreen timer
33
3431- some sprite glitches from sprite number/colour changes happening on
3532  different frames, possibly original behaviour. eg cars changing colour
3633  just before exploding, animals displaying as the wrong sprite for one
r7356r7357
120117   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
121118
122119   PORT_START("DSW")
123   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
120   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )  PORT_DIPLOCATION("SW1:1,2")
124121   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
125122   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
126123   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
127124   PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
128   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Coin_B ) )
125   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Coin_B ) )  PORT_DIPLOCATION("SW1:3")
129126   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
130127   PORT_DIPSETTING(    0x04, DEF_STR( 1C_6C ) )
131   PORT_DIPNAME( 0x18, 0x00, DEF_STR( Lives ) )
128   PORT_DIPNAME( 0x18, 0x00, DEF_STR( Lives ) )  PORT_DIPLOCATION("SW1:4,5")
132129   PORT_DIPSETTING(    0x00, "3" )
133130   PORT_DIPSETTING(    0x08, "4" )
134131   PORT_DIPSETTING(    0x10, "5" )
135132   PORT_DIPSETTING(    0x18, "250 (Cheat)")
136   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )
133   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )  PORT_DIPLOCATION("SW1:6")
137134   PORT_DIPSETTING(    0x00, "10k, then every 100k" )
138135   PORT_DIPSETTING(    0x20, "20k, then every 100k" )
139   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) )
136   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) )  PORT_DIPLOCATION("SW1:7")
140137   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
141138   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
142   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
139   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )  PORT_DIPLOCATION("SW1:8")
143140   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
144141   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
145142INPUT_PORTS_END
r7356r7357
198195   MDRV_DRIVER_DATA(carjmbre_state)
199196
200197   /* basic machine hardware */
201   MDRV_CPU_ADD("maincpu", Z80,18432000/6)
198   MDRV_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6)
202199   MDRV_CPU_PROGRAM_MAP(carjmbre_map)
203200   MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse)
204201
205202   MDRV_MACHINE_RESET(carjmbre)
206203
207   MDRV_CPU_ADD("audiocpu", Z80, 1500000)
204   MDRV_CPU_ADD("audiocpu", Z80, XTAL_18_432MHz/6/2)
208205   MDRV_CPU_PROGRAM_MAP(carjmbre_sound_map)
209206   MDRV_CPU_IO_MAP(carjmbre_sound_io_map)
210207   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
r7356r7357
227224   /* sound hardware */
228225   MDRV_SPEAKER_STANDARD_MONO("mono")
229226
230   MDRV_SOUND_ADD("ay1", AY8910, 1500000)
227   MDRV_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/6/2)
231228   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12)
232229
233   MDRV_SOUND_ADD("ay2", AY8910, 1500000)
230   MDRV_SOUND_ADD("ay2", AY8910, XTAL_18_432MHz/6/2)
234231   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12)
235232MACHINE_DRIVER_END
236233
src/mame/drivers/mrdo.c
r7356r7357
11/***************************************************************************
22
33Mr Do!
4
54driver by Nicola Salmoria
65
6Updated 02/2010 with proper XTAL values thanks to Oliver_A
77
8Video clock: XTAL = 20 MHz
9Horizontal video frequency: HSYNC = XTAL/4/312 = 16.02564103 kHz
10Video frequency: VSYNC = HSYNC/262 = 61.1665688 Hz
11VBlank duration: 1/VSYNC * (70/262) = 4368 us
8PCB Model: 8201
9Main Clock: XTAL = 8.2 MHz
10Video clock: XTAL = 19.6 MHz
1211
12Horizontal video frequency: HSYNC = XTAL/4/312 = 15.7051282051 kHz
13Video frequency: VSYNC = HSYNC/262 = 59.94323742 Hz
14VBlank duration: 1/VSYNC * (70/262) = 4457 us
15
16
17The manual for this model clearly shows above values in 'Misc' parts listings.
18There's a chance that certain bootlegs might have the different 8/20 MHz XTALS.
19
1320***************************************************************************/
1421
1522#include "emu.h"
1623#include "cpu/z80/z80.h"
1724#include "sound/sn76496.h"
1825
19#define MAIN_CLOCK      XTAL_8MHz
20#define VIDEO_CLOCK      XTAL_20MHz
26#define MAIN_CLOCK      XTAL_8_2MHz
27#define VIDEO_CLOCK      XTAL_19_6MHz
2128
2229
2330extern UINT8 *mrdo_bgvideoram,*mrdo_fgvideoram;
r7356r7357
170177static MACHINE_DRIVER_START( mrdo )
171178
172179   /* basic machine hardware */
173   MDRV_CPU_ADD("maincpu", Z80, MAIN_CLOCK/2)   /* 4 MHz */
180   MDRV_CPU_ADD("maincpu", Z80, MAIN_CLOCK/2)   /* Verified */
174181   MDRV_CPU_PROGRAM_MAP(main_map)
175182   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
176183
r7356r7357
189196   /* sound hardware */
190197   MDRV_SPEAKER_STANDARD_MONO("mono")
191198
192   MDRV_SOUND_ADD("sn1", SN76489, MAIN_CLOCK/2)
199   MDRV_SOUND_ADD("sn1", SN76489, MAIN_CLOCK/2)   /* Verified */
193200   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
194201
195   MDRV_SOUND_ADD("sn2", SN76489, MAIN_CLOCK/2)
202   MDRV_SOUND_ADD("sn2", SN76489, MAIN_CLOCK/2)   /* Verified */
196203   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
197204MACHINE_DRIVER_END
198205
src/mame/drivers/canyon.c
r7356r7357
240240   MDRV_DRIVER_DATA(canyon_state)
241241
242242   /* basic machine hardware */
243   MDRV_CPU_ADD("maincpu", M6502, 12096000 / 16)
243   MDRV_CPU_ADD("maincpu", M6502, XTAL_12_096MHz / 16)
244244   MDRV_CPU_PROGRAM_MAP(main_map)
245245   MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse)
246246   MDRV_WATCHDOG_VBLANK_INIT(8)
src/mame/drivers/topshoot.c
r7356r7357
118118*/
119119
120120#include "emu.h"
121#include "megadriv.h"
121#include "includes/megadriv.h"
122122
123123static INPUT_PORTS_START( topshoot ) /* Top Shooter Input Ports */
124124   PORT_START("IN0")
src/mame/drivers/dassault.c
r7356r7357
9999      * BUTTON2n : "nuke"
100100
101101
1023) 'dassaul4'
1023) 'dassault4'
103103
104104  - always 4 players :
105105
r7356r7357
422422   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
423423INPUT_PORTS_END
424424
425static INPUT_PORTS_START( dassaul4 )
425static INPUT_PORTS_START( dassault4 )
426426   PORT_INCLUDE( common )
427427
428428   PORT_MODIFY("P1_P2")
r7356r7357
848848
849849GAME( 1991, thndzone, 0,        dassault, thndzone, thndzone, ROT0, "Data East Corporation", "Thunder Zone (World)", 0 )
850850GAME( 1991, dassault, thndzone, dassault, dassault, dassault, ROT0, "Data East Corporation", "Desert Assault (US)", 0 )
851GAME( 1991, dassault4,thndzone, dassault, dassaul4, dassault, ROT0, "Data East Corporation", "Desert Assault (US 4 Players)", 0 )
851GAME( 1991, dassault4,thndzone, dassault, dassault4,dassault, ROT0, "Data East Corporation", "Desert Assault (US 4 Players)", 0 )
src/mame/drivers/dambustr.c
r7356r7357
882008-08
99Dip locations verified with manual
1010
11
12Stephh's notes (based on the games Z80 code and some tests) :
13
141) 'dambustr'
15
16  - This seems to be a bugfixed version as only the 3 "fire" buttons are
17    tested while entering the initials (code at 0x1e59).
18  - The "Initials Reset" button only affects the initials, not the scores !
19  - The "Disable Background Collision" Dip Switch only prevents you to lose
20    "lives" if you touch the background : you can still be hit by enemies'
21    bullets and be stalled if speed is too low.
22  - There is a setting which is only available in the "test mode", it's the
23    maximum game time. If you don't set it, the game considers it's illimited
24    time (full doesn't decrease). But once you set it to a value, it is not
25    possible to turn the value back to 0 even by reseting the game.
26  - If you go too far without dying, background becomes complete garbage,
27    but it then appears again correctly. Is there a bad dumped ROM or is
28    emulation bugged somewhere ? Verification against real PCB is needed !
29
302) 'dambustra'
31
32  - There is sort of bug at 0x1e59 : you can't enter a letter in the
33    initials screen while pressing one of the system buttons (SERVICE,
34    "Initials Reset", START1 or START2), and even COIN2.
35    This is because 8 bytes are checked instead of 3 in 'dambustr'.
36  - Same as 'dambustr' otherwise.
37
383) 'dambustruk'
39
40  - This set is based on 'dambustr' as there is no initials bug (code at 0x1e0f).
41  - The differences with 'dambustr' are :
42      * coinage for 2nd slot
43      * currency and price (but it's still 2 credits to start a game)
44      * score is divided by 10
45
1146***************************************************************************/
1247
1348
r7356r7357
67102   AM_RANGE(0xf800, 0xffff) AM_READ(watchdog_reset_r)
68103ADDRESS_MAP_END
69104
105
106/* verified from Z80 code */
70107static INPUT_PORTS_START( dambustr )
71108   PORT_START("IN0")
72109   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )
73110   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
74111   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 )
75112   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
76   PORT_DIPNAME( 0x20, 0x00, "Clear Swear Words" )
77   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
78   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
79   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
113   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Initials Reset") PORT_CODE(KEYCODE_0)
114   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_HIGH )
80115   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 )
81116
82117   PORT_START("IN1")
83   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
84   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
118   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 )
119   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 )
85120   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
86   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
87   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
88   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
89   PORT_DIPNAME( 0x40, 0x00, "2nd Coin Counter" ) PORT_DIPLOCATION("SW:!1")
90   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
91   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
92   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:!2")
93   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
94   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
121   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_4WAY
122   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY
123   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY
124   PORT_DIPNAME( 0x40, 0x40, "Coin Counters" ) PORT_DIPLOCATION("SW:!1")
125   PORT_DIPSETTING(    0x00, "1" )
126   PORT_DIPSETTING(    0x40, "2" )
127   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:!2")
128   PORT_DIPSETTING(    0x80, DEF_STR( 1C_1C ) )   PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x00)
129   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )   PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x00)
130   PORT_DIPSETTING(    0x80, "A 1/1  B 1/2" )     PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x40)
131   PORT_DIPSETTING(    0x00, "A 1/2  B 1/6" )     PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x40)
95132
96133   PORT_START("DSW")
97134   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW:!3,!4")
98135   PORT_DIPSETTING(    0x00, "3" )
99   PORT_DIPSETTING(    0x01, "4" )
100   PORT_DIPSETTING(    0x02, "5" )
136   PORT_DIPSETTING(    0x02, "4" )
137   PORT_DIPSETTING(    0x01, "5" )
101138   PORT_DIPSETTING(    0x03, "6" )
102   PORT_DIPNAME( 0x04, 0x00, "Game Test Mode" ) PORT_DIPLOCATION("SW:!5") /* Manual says must be OFF */
139   PORT_DIPNAME( 0x04, 0x00, "Disable Background Collision (Cheat)" ) PORT_DIPLOCATION("SW:!5") /* see notes - manual says must be OFF */
103140   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
104141   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
105   PORT_DIPNAME( 0x08, 0x00, "Union Jack" ) PORT_DIPLOCATION("SW:!6")
142   PORT_DIPNAME( 0x08, 0x00, "Union Jack Flag" ) PORT_DIPLOCATION("SW:!6")
106143   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
107144   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
145   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
108146INPUT_PORTS_END
109147
148/* verified from Z80 code */
149static INPUT_PORTS_START( dambustruk )
150   PORT_INCLUDE(dambustr)
110151
152   PORT_MODIFY("IN1")
153   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:!2")
154   PORT_DIPSETTING(    0x80, DEF_STR( 1C_1C ) )   PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x00)
155   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )   PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x00)
156   PORT_DIPSETTING(    0x80, "A 1/1  B 1/6" )     PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x40)
157   PORT_DIPSETTING(    0x00, "A 1/2  B 1/12" )    PORT_CONDITION("IN1", 0x40, PORTCOND_EQUALS, 0x40)
158INPUT_PORTS_END
159
160
111161static const gfx_layout dambustr_charlayout =
112162{
113163   8,8,
r7356r7357
295345ROM_END
296346
297347
298GAME( 1981, dambustr,  0,        dambustr, dambustr, dambustr, ROT90, "South West Research", "Dambusters (US, set 1)", 0 )
299GAME( 1981, dambustra, dambustr, dambustr, dambustr, dambustr, ROT90, "South West Research", "Dambusters (US, set 2)", 0 )
300GAME( 1981, dambustruk,dambustr, dambustr, dambustr, dambustr, ROT90, "South West Research", "Dambusters (UK)", 0 )
348GAME( 1981, dambustr,   0,        dambustr, dambustr,   dambustr, ROT90, "South West Research", "Dambusters (US, set 1)", 0 )
349GAME( 1981, dambustra,  dambustr, dambustr, dambustr,   dambustr, ROT90, "South West Research", "Dambusters (US, set 2)", 0 )
350GAME( 1981, dambustruk, dambustr, dambustr, dambustruk, dambustr, ROT90, "South West Research", "Dambusters (UK)", 0 )
src/mame/drivers/segamsys.c
r7356r7357
1414#include "sound/sn76496.h"
1515#include "machine/mc8123.h"
1616#include "machine/segacrpt.h"
17#include "segamsys.h"
17#include "includes/segamsys.h"
1818
1919
2020//static UINT8* sms_rom;
src/mame/drivers/megaplay.c
r7356r7357
5454#include "sound/sn76496.h"
5555
5656#include "deprecat.h"
57#include "megadriv.h"
58#include "segamsys.h"
57#include "includes/megadriv.h"
58#include "includes/segamsys.h"
5959
6060#define MASTER_CLOCK      53693100
6161
src/mame/drivers/segae.c
r7356r7357
298298#include "sound/sn76496.h"
299299#include "machine/mc8123.h"
300300#include "machine/segacrpt.h"
301#include "segamsys.h"
301#include "includes/segamsys.h"
302302
303303/****************************************************************************************
304304 Memory Maps
src/mame/drivers/atarig1.c
r7356r7357
147147}
148148
149149
150static STATE_POSTLOAD( pitfighb_state_postload )
150static STATE_POSTLOAD( pitfightb_state_postload )
151151{
152152   atarig1_state *state = (atarig1_state *)machine->driver_data;
153153   int bank = state->bslapstic_bank;
r7356r7357
156156}
157157
158158
159static READ16_HANDLER( pitfighb_cheap_slapstic_r )
159static READ16_HANDLER( pitfightb_cheap_slapstic_r )
160160{
161161   atarig1_state *state = (atarig1_state *)space->machine->driver_data;
162162   int result = state->bslapstic_base[offset & 0xfff];
r7356r7357
184184}
185185
186186
187static void pitfighb_cheap_slapstic_init(running_machine *machine)
187static void pitfightb_cheap_slapstic_init(running_machine *machine)
188188{
189189   atarig1_state *state = (atarig1_state *)machine->driver_data;
190190
191191   /* install a read handler */
192   state->bslapstic_base = memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x038000, 0x03ffff, 0, 0, pitfighb_cheap_slapstic_r);
192   state->bslapstic_base = memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x038000, 0x03ffff, 0, 0, pitfightb_cheap_slapstic_r);
193193
194194   /* allocate memory for a copy of bank 0 */
195195   state->bslapstic_bank0 = auto_alloc_array(machine, UINT8, 0x2000);
r7356r7357
314314INPUT_PORTS_END
315315
316316
317static INPUT_PORTS_START( pitfighj )
317static INPUT_PORTS_START( pitfightj )
318318   PORT_START("IN0")      /* fc0000 */
319319   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
320320   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
r7356r7357
10781078   state->atarigen.eeprom_default = NULL;
10791079   if (slapstic == -1)
10801080   {
1081      pitfighb_cheap_slapstic_init(machine);
1081      pitfightb_cheap_slapstic_init(machine);
10821082      state_save_register_global(machine, state->bslapstic_bank);
10831083      state_save_register_global(machine, state->bslapstic_primed);
1084      state_save_register_postload(machine, pitfighb_state_postload, NULL);
1084      state_save_register_postload(machine, pitfightb_state_postload, NULL);
10851085   }
10861086   else if (slapstic != 0)
10871087      atarigen_slapstic_init(devtag_get_device(machine, "maincpu"), slapstic_base, 0, slapstic);
r7356r7357
10931093static DRIVER_INIT( hydra )    { init_g1_common(machine, 0x078000, 116, 0); }
10941094static DRIVER_INIT( hydrap )   { init_g1_common(machine, 0x000000,   0, 0); }
10951095
1096static DRIVER_INIT( pitfigh7 ) { init_g1_common(machine, 0x038000, 112, 2); }
1096static DRIVER_INIT( pitfight7 ) { init_g1_common(machine, 0x038000, 112, 2); }
10971097static DRIVER_INIT( pitfight ) { init_g1_common(machine, 0x038000, 111, 1); }
1098static DRIVER_INIT( pitfighj ) { init_g1_common(machine, 0x038000, 113, 1); }
1099static DRIVER_INIT( pitfighb ) { init_g1_common(machine, 0x038000,  -1, 1); }
1098static DRIVER_INIT( pitfightj ) { init_g1_common(machine, 0x038000, 113, 1); }
1099static DRIVER_INIT( pitfightb ) { init_g1_common(machine, 0x038000,  -1, 1); }
11001100
11011101
11021102/*************************************
r7356r7357
11091109GAME( 1990, hydrap,   hydra,    atarig1, hydra,    hydrap,   ROT0, "Atari Games", "Hydra (prototype 5/14/90)", GAME_SUPPORTS_SAVE )
11101110GAME( 1990, hydrap2,  hydra,    atarig1, hydra,    hydrap,   ROT0, "Atari Games", "Hydra (prototype 5/25/90)", GAME_SUPPORTS_SAVE )
11111111
1112GAME( 1990, pitfight,  0,        atarig1, pitfight, pitfigh7, ROT0, "Atari Games", "Pit Fighter (rev 7)", GAME_SUPPORTS_SAVE )
1113GAME( 1990, pitfight6, pitfight, atarig1, pitfight, pitfighj, ROT0, "Atari Games", "Pit Fighter (rev 6)", GAME_SUPPORTS_SAVE )
1114GAME( 1990, pitfight5, pitfight, atarig1, pitfight, pitfigh7, ROT0, "Atari Games", "Pit Fighter (rev 5)", GAME_SUPPORTS_SAVE )
1112GAME( 1990, pitfight,  0,        atarig1, pitfight, pitfight7,ROT0, "Atari Games", "Pit Fighter (rev 7)", GAME_SUPPORTS_SAVE )
1113GAME( 1990, pitfight6, pitfight, atarig1, pitfight, pitfightj,ROT0, "Atari Games", "Pit Fighter (rev 6)", GAME_SUPPORTS_SAVE )
1114GAME( 1990, pitfight5, pitfight, atarig1, pitfight, pitfight7,ROT0, "Atari Games", "Pit Fighter (rev 5)", GAME_SUPPORTS_SAVE )
11151115GAME( 1990, pitfight4, pitfight, atarig1, pitfight, pitfight, ROT0, "Atari Games", "Pit Fighter (rev 4)", GAME_SUPPORTS_SAVE )
11161116GAME( 1990, pitfight3, pitfight, atarig1, pitfight, pitfight, ROT0, "Atari Games", "Pit Fighter (rev 3)", GAME_SUPPORTS_SAVE )
1117GAME( 1990, pitfightj, pitfight, atarig1, pitfighj, pitfighj, ROT0, "Atari Games", "Pit Fighter (Japan, 2 players)", GAME_SUPPORTS_SAVE )
1118GAME( 1990, pitfightb, pitfight, atarig1, pitfight, pitfighb, ROT0, "Atari Games", "Pit Fighter (bootleg)", GAME_SUPPORTS_SAVE )
1117GAME( 1990, pitfightj, pitfight, atarig1, pitfightj,pitfightj,ROT0, "Atari Games", "Pit Fighter (Japan, 2 players)", GAME_SUPPORTS_SAVE )
1118GAME( 1990, pitfightb, pitfight, atarig1, pitfight, pitfightb,ROT0, "Atari Games", "Pit Fighter (bootleg)", GAME_SUPPORTS_SAVE )
src/mame/drivers/albazc.c
r7356r7357
44TODO:
55- colour decoding might not be perfect
66- Background color should be green, but current handling might be wrong.
7- some unknown sprite attributes, sprite flipping in flip screen needed
7- some unknown sprite attributes
88- don't know what to do when the jackpot is displayed (missing controls ?)
99- according to the board pic, there should be one more 4-switches dip
1010  switch bank, and probably some NVRAM because there's a battery.
r7356r7357
2121   UINT8 *  spriteram1;
2222   UINT8 *  spriteram2;
2323   UINT8 *  spriteram3;
24   UINT8 flip_bit;
2425};
2526
2627
r7356r7357
6162      int sx = state->spriteram1[i + 0x200] | ((state->spriteram2[i + 0x200] & 0x07) << 8);
6263      int sy = 242 - state->spriteram3[i];
6364
64      if (flip_screen_get(machine))
65      if (state->flip_bit)
6566      {
6667         sy = 242 - sy;
6768         flipx = !flipx;
r7356r7357
123124   // unused
124125}
125126
127static WRITE8_HANDLER( albazc_vregs_w )
128{
129   albazc_state *state = (albazc_state *)space->machine->driver_data;
130
131   #ifdef UNUSED_FUNCTION
132   {
133      static UINT8 x[5];
134      x[offset] = data;
135      popmessage("%02x %02x %02x %02x %02x",x[0],x[1],x[2],x[3],x[4]);
136   }
137   #endif
138
139   if(offset == 0)
140   {
141      /* core bug with this? */
142      //flip_screen_set(space->machine, (data & 0x40) >> 6);
143      state->flip_bit = (data & 0x40) >> 6;
144   }
145}
146
126147/* main cpu */
127148
128149static ADDRESS_MAP_START( hanaroku_map, ADDRESS_SPACE_PROGRAM, 8 )
r7356r7357
131152   AM_RANGE(0x9000, 0x97ff) AM_RAM AM_BASE_MEMBER(albazc_state, spriteram2)
132153   AM_RANGE(0xa000, 0xa1ff) AM_RAM AM_BASE_MEMBER(albazc_state, spriteram3)
133154   AM_RANGE(0xa200, 0xa2ff) AM_WRITENOP   // ??? written once during P.O.S.T.
134   AM_RANGE(0xa300, 0xa304) AM_WRITENOP   // ???
155   AM_RANGE(0xa300, 0xa304) AM_WRITE(albazc_vregs_w)   // ???
135156   AM_RANGE(0xb000, 0xb000) AM_WRITENOP   // ??? always 0x40
136157   AM_RANGE(0xc000, 0xc3ff) AM_RAM         // main ram
137158   AM_RANGE(0xc400, 0xc4ff) AM_RAM         // ???
r7356r7357
260281   /* sound hardware */
261282   MDRV_SPEAKER_STANDARD_MONO("mono")
262283
263   MDRV_SOUND_ADD("aysnd", AY8910, 1500000)
284   MDRV_SOUND_ADD("aysnd", AY8910, 1500000) /* ? MHz */
264285   MDRV_SOUND_CONFIG(ay8910_config)
265286   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
266287MACHINE_DRIVER_END
r7356r7357
282303ROM_END
283304
284305
285GAME( 1988, hanaroku, 0,        hanaroku, hanaroku, 0, ROT0, "Alba", "Hanaroku", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
306GAME( 1988, hanaroku, 0,        hanaroku, hanaroku, 0, ROT0, "Alba", "Hanaroku", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
src/mame/drivers/micro3d.c
r7356r7357
563563GAME( 1991, f15se,    0,     micro3d, f15se,    micro3d, ROT0, "Microprose Games Inc.", "F-15 Strike Eagle (rev. 2.2 02/25/91)", GAME_IMPERFECT_SOUND )
564564GAME( 1991, f15se21 , f15se, micro3d, f15se,    micro3d, ROT0, "Microprose Games Inc.", "F-15 Strike Eagle (rev. 2.1 02/04/91)", GAME_IMPERFECT_SOUND )
565565GAME( 1992, botss,    0,     micro3d, botss,    micro3d, ROT0, "Microprose Games Inc.", "Battle of the Solar System (rev. 1.1)", GAME_IMPERFECT_SOUND )
566GAME( 1992, tankbatl, 0,     micro3d, tankbatl, micro3d, ROT0, "Microprose Games Inc.", "Tank Battle (prototype rev. 4/21/92 )", GAME_IMPERFECT_SOUND )
566GAME( 1992, tankbatl, 0,     micro3d, tankbatl, micro3d, ROT0, "Microprose Games Inc.", "Tank Battle (prototype rev. 4/21/92)", GAME_IMPERFECT_SOUND )
src/mame/drivers/cyberbal.c
r7356r7357
7474}
7575
7676
77static void cyberb2p_update_interrupts(running_machine *machine)
77static void cyberbal2p_update_interrupts(running_machine *machine)
7878{
7979   cyberbal_state *state = (cyberbal_state *)machine->driver_data;
8080   cputag_set_input_line(machine, "maincpu", 1, state->atarigen.video_int_state ? ASSERT_LINE : CLEAR_LINE);
r7356r7357
8282}
8383
8484
85static MACHINE_RESET( cyberb2p )
85static MACHINE_RESET( cyberbal2p )
8686{
8787   cyberbal_state *state = (cyberbal_state *)machine->driver_data;
8888
8989   atarigen_eeprom_reset(&state->atarigen);
90   atarigen_interrupt_reset(&state->atarigen, cyberb2p_update_interrupts);
90   atarigen_interrupt_reset(&state->atarigen, cyberbal2p_update_interrupts);
9191   atarigen_scanline_timer_reset(machine->primary_screen, cyberbal_scanline_update, 8);
9292   atarijsa_reset();
9393}
r7356r7357
247247 *
248248 *************************************/
249249
250static ADDRESS_MAP_START( cyberb2p_map, ADDRESS_SPACE_PROGRAM, 16 )
250static ADDRESS_MAP_START( cyberbal2p_map, ADDRESS_SPACE_PROGRAM, 16 )
251251   AM_RANGE(0x000000, 0x07ffff) AM_ROM
252252   AM_RANGE(0xfc0000, 0xfc0003) AM_READ_PORT("IN0")
253253   AM_RANGE(0xfc2000, 0xfc2003) AM_READ_PORT("IN1")
r7356r7357
326326INPUT_PORTS_END
327327
328328
329static INPUT_PORTS_START( cyberb2p )
329static INPUT_PORTS_START( cyberbal2p )
330330   PORT_START("IN0")      /* fc0000 */
331331   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
332332   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
r7356r7357
490490MACHINE_DRIVER_END
491491
492492
493static MACHINE_DRIVER_START( cyberb2p )
493static MACHINE_DRIVER_START( cyberbal2p )
494494   MDRV_DRIVER_DATA(cyberbal_state)
495495
496496   /* basic machine hardware */
497497   MDRV_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2)
498   MDRV_CPU_PROGRAM_MAP(cyberb2p_map)
498   MDRV_CPU_PROGRAM_MAP(cyberbal2p_map)
499499   MDRV_CPU_VBLANK_INT("screen", atarigen_video_int_gen)
500500
501501   MDRV_MACHINE_START(cyberbal)
502   MDRV_MACHINE_RESET(cyberb2p)
502   MDRV_MACHINE_RESET(cyberbal2p)
503503   MDRV_NVRAM_HANDLER(atarigen)
504504
505505   /* video hardware */
r7356r7357
513513   /* the board uses an SOS-2 chip to generate video signals */
514514   MDRV_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz, 456*2, 0, 336*2, 262, 0, 240)
515515
516   MDRV_VIDEO_START(cyberb2p)
516   MDRV_VIDEO_START(cyberbal2p)
517517   MDRV_VIDEO_UPDATE(cyberbal)
518518
519519   /* sound hardware */
r7356r7357
10031003}
10041004
10051005
1006static DRIVER_INIT( cyberbt )
1006static DRIVER_INIT( cyberbalt )
10071007{
10081008   cyberbal_state *state = (cyberbal_state *)machine->driver_data;
10091009   state->atarigen.eeprom_default = default_eeprom;
r7356r7357
10111011}
10121012
10131013
1014static DRIVER_INIT( cyberb2p )
1014static DRIVER_INIT( cyberbal2p )
10151015{
10161016   cyberbal_state *state = (cyberbal_state *)machine->driver_data;
10171017   state->atarigen.eeprom_default = default_eeprom;
r7356r7357
10301030GAMEL(1988, cyberbal2, cyberbal, cyberbal, cyberbal, cyberbal, ROT0, "Atari Games", "Cyberball (rev 2)", 0, layout_dualhsxs )
10311031GAMEL(1988, cyberbalp, cyberbal, cyberbal, cyberbal, cyberbal, ROT0, "Atari Games", "Cyberball (prototype)", 0, layout_dualhsxs )
10321032
1033GAME( 1989, cyberbal2p,  cyberbal, cyberb2p, cyberb2p, cyberb2p, ROT0, "Atari Games", "Cyberball 2072 (2 player, rev 4)", 0 )
1034GAME( 1989, cyberbal2p3, cyberbal, cyberb2p, cyberb2p, cyberb2p, ROT0, "Atari Games", "Cyberball 2072 (2 player, rev 3)", 0 )
1035GAME( 1989, cyberbal2p2, cyberbal, cyberb2p, cyberb2p, cyberb2p, ROT0, "Atari Games", "Cyberball 2072 (2 player, rev 2)", 0 )
1036GAME( 1989, cyberbal2p1, cyberbal, cyberb2p, cyberb2p, cyberb2p, ROT0, "Atari Games", "Cyberball 2072 (2 player, rev 1)", 0 )
1033GAME( 1989, cyberbal2p,  cyberbal, cyberbal2p, cyberbal2p, cyberbal2p, ROT0, "Atari Games", "Cyberball 2072 (2 player, rev 4)", 0 )
1034GAME( 1989, cyberbal2p3, cyberbal, cyberbal2p, cyberbal2p, cyberbal2p, ROT0, "Atari Games", "Cyberball 2072 (2 player, rev 3)", 0 )
1035GAME( 1989, cyberbal2p2, cyberbal, cyberbal2p, cyberbal2p, cyberbal2p, ROT0, "Atari Games", "Cyberball 2072 (2 player, rev 2)", 0 )
1036GAME( 1989, cyberbal2p1, cyberbal, cyberbal2p, cyberbal2p, cyberbal2p, ROT0, "Atari Games", "Cyberball 2072 (2 player, rev 1)", 0 )
10371037
1038GAMEL(1989, cyberbalt,  cyberbal, cyberbal, cyberbal, cyberbt,  ROT0, "Atari Games", "Tournament Cyberball 2072 (rev 2)", 0, layout_dualhsxs )
1039GAMEL(1989, cyberbalt1, cyberbal, cyberbal, cyberbal, cyberbt,  ROT0, "Atari Games", "Tournament Cyberball 2072 (rev 1)", 0, layout_dualhsxs )
1038GAMEL(1989, cyberbalt,  cyberbal, cyberbal, cyberbal, cyberbalt,  ROT0, "Atari Games", "Tournament Cyberball 2072 (rev 2)", 0, layout_dualhsxs )
1039GAMEL(1989, cyberbalt1, cyberbal, cyberbal, cyberbal, cyberbalt,  ROT0, "Atari Games", "Tournament Cyberball 2072 (rev 1)", 0, layout_dualhsxs )
10401040
src/mame/drivers/1945kiii.c
r7356r7357
3838    M6295 clocks : 1.000MHz (both), sample rate = 1000000 / 132
3939           VSync : 60Hz
4040
41
42SAVE STATE (lee@lmservers.com):
43No code changes required to support save state
441945kiii uses the 68000 and OKIM6295 which both support save state.
45The rationale for saving/not saving are as follows:
46
47static UINT16* k3_spriteram_1;  Saved via reference to AM_BASE
48static UINT16* k3_spriteram_2;  Saved via reference to AM_BASE
49static UINT16* k3_bgram;        Saved via reference to AM_BASE
50static tilemap_t *k3_bg_tilemap;  Saved due to tilemap supporting save
51
52There are no static local variables.
53
5441*/
5542
5643#include "emu.h"
src/mame/drivers/badlands.c
r7356r7357
633633
634634*/
635635
636static READ16_HANDLER( badlandb_unk_r )
636static READ16_HANDLER( badlandsb_unk_r )
637637{
638638
639639   return 0xffff;
r7356r7357
643643   AM_RANGE(0x000000, 0x03ffff) AM_ROM
644644
645645
646   AM_RANGE(0x400008, 0x400009) AM_READ(badlandb_unk_r )
647   AM_RANGE(0x4000fe, 0x4000ff) AM_READ(badlandb_unk_r )
646   AM_RANGE(0x400008, 0x400009) AM_READ(badlandsb_unk_r )
647   AM_RANGE(0x4000fe, 0x4000ff) AM_READ(badlandsb_unk_r )
648648
649   AM_RANGE(0xfc0000, 0xfc0001) AM_READ(badlandb_unk_r )
649   AM_RANGE(0xfc0000, 0xfc0001) AM_READ(badlandsb_unk_r )
650650
651   AM_RANGE(0xfe4000, 0xfe4001) AM_READ(badlandb_unk_r )
652   AM_RANGE(0xfe4004, 0xfe4005) AM_READ(badlandb_unk_r )
653   AM_RANGE(0xfe4006, 0xfe4007) AM_READ(badlandb_unk_r )
651   AM_RANGE(0xfe4000, 0xfe4001) AM_READ(badlandsb_unk_r )
652   AM_RANGE(0xfe4004, 0xfe4005) AM_READ(badlandsb_unk_r )
653   AM_RANGE(0xfe4006, 0xfe4007) AM_READ(badlandsb_unk_r )
654654
655655
656656   AM_RANGE(0xfd0000, 0xfd1fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE_SIZE_MEMBER(badlands_state, atarigen.eeprom, atarigen.eeprom_size)
r7356r7357
677677   8*8
678678};
679679
680static GFXDECODE_START( badlandb )
680static GFXDECODE_START( badlandsb )
681681   GFXDECODE_ENTRY( "gfx1", 0, pflayout_bootleg,    0, 8 )
682682   GFXDECODE_ENTRY( "gfx2", 0, molayout,  128, 8 )
683683GFXDECODE_END
r7356r7357
700700
701701
702702
703static MACHINE_RESET( badlandb )
703static MACHINE_RESET( badlandsb )
704704{
705705   badlands_state *state = (badlands_state *)machine->driver_data;
706706//  state->pedal_value[0] = state->pedal_value[1] = 0x80;
r7356r7357
713713//  memcpy(state->bank_base, &state->bank_source_data[0x0000], 0x1000);
714714}
715715
716static MACHINE_DRIVER_START( badlandb )
716static MACHINE_DRIVER_START( badlandsb )
717717   MDRV_DRIVER_DATA(badlands_state)
718718
719719   /* basic machine hardware */
r7356r7357
725725//  MDRV_CPU_PROGRAM_MAP(bootleg_soundmap)
726726
727727   MDRV_MACHINE_START(badlands)
728   MDRV_MACHINE_RESET(badlandb)
728   MDRV_MACHINE_RESET(badlandsb)
729729   MDRV_NVRAM_HANDLER(atarigen)
730730
731731   /* video hardware */
732732   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
733   MDRV_GFXDECODE(badlandb)
733   MDRV_GFXDECODE(badlandsb)
734734   MDRV_PALETTE_LENGTH(256)
735735
736736   MDRV_SCREEN_ADD("screen", RASTER)
r7356r7357
785785ROM_END
786786
787787
788GAME( 1989, badlandsb, badlands, badlandb, badlands, 0, ROT0, "[Atari Games] (Playmark bootleg)", "Bad Lands (bootleg)", GAME_NOT_WORKING )
788GAME( 1989, badlandsb, badlands, badlandsb, badlands, 0, ROT0, "[Atari Games] (Playmark bootleg)", "Bad Lands (bootleg)", GAME_NOT_WORKING )
src/mame/drivers/astinvad.c
r7356r7357
533533   PORT_DIPSETTING(    0xff, DEF_STR( Cocktail ) )
534534INPUT_PORTS_END
535535
536static INPUT_PORTS_START( spaceinj )
536static INPUT_PORTS_START( spaceintj )
537537   PORT_INCLUDE( spaceint )
538538
539539   PORT_MODIFY("IN1")
r7356r7357
776776GAME( 19??, kosmokil, kamikaze, kamikaze, kamikaze, kamikaze, ROT270, "bootleg",            "Kosmo Killer",  GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // says >BEM< Mi Italy but it looks hacked in, dif revision of game tho.
777777GAME( 1979, spcking2, 0,        spcking2, spcking2, spcking2, ROT270, "Konami",             "Space King 2",  GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
778778GAME( 1980, spaceint, 0,        spaceint, spaceint, 0,        ROT90,  "Shoei",              "Space Intruder", GAME_IMPERFECT_SOUND | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
779GAME( 1980, spaceintj,spaceint, spaceint, spaceinj, 0,        ROT90,  "Shoei",              "Space Intruder (Japan)", GAME_IMPERFECT_SOUND | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
779GAME( 1980, spaceintj,spaceint, spaceint, spaceintj,0,        ROT90,  "Shoei",              "Space Intruder (Japan)", GAME_IMPERFECT_SOUND | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
src/mame/drivers/segas16a.c
r7356r7357
147147#include "cpu/z80/z80.h"
148148#include "cpu/m68000/m68000.h"
149149#include "cpu/mcs51/mcs51.h"
150#include "includes/system16.h"
150#include "includes/segas16.h"
151151#include "machine/8255ppi.h"
152152#include "machine/fd1089.h"
153153#include "machine/i8243.h"
154154#include "cpu/mcs48/mcs48.h"
155155#include "sound/dac.h"
156156#include "sound/2151intf.h"
157#include "video/segaic16.h"
157158
158159
159160/*************************************
r7356r7357
164165
165166static UINT16 *workram;
166167
167static UINT8 video_control;
168static UINT8 mcu_control;
169static UINT8 mj_input_num;
170168
171static read16_space_func custom_io_r;
172static write16_space_func custom_io_w;
173static void (*lamp_changed_w)(UINT8 changed, UINT8 newval);
174static void (*i8751_vblank_hook)(running_machine *machine);
175
176static UINT8 n7751_command;
177static UINT32 n7751_rom_address;
178
179
180
181169/*************************************
182170 *
183171 *  Prototypes
r7356r7357
218206
219207static void system16a_generic_init(running_machine *machine)
220208{
221   /* call the generic init */
222   MACHINE_RESET_CALL(sys16_onetime);
209   segas1x_state *state = (segas1x_state *)machine->driver_data;
223210
224211   /* init the FD1094 */
225212   fd1094_driver_init(machine, "maincpu", NULL);
226213
227214   /* reset the custom handlers and other pointers */
228   custom_io_r = NULL;
229   custom_io_w = NULL;
230   lamp_changed_w = NULL;
231   i8751_vblank_hook = NULL;
215   state->custom_io_r = NULL;
216   state->custom_io_w = NULL;
217   state->lamp_changed_w = NULL;
218   state->i8751_vblank_hook = NULL;
219
220   state->maincpu = devtag_get_device(machine, "maincpu");
221   state->soundcpu = devtag_get_device(machine, "soundcpu");
222   state->mcu = devtag_get_device(machine, "mcu");
223   state->ymsnd = devtag_get_device(machine, "ymsnd");
224   state->ppi8255 = devtag_get_device(machine, "ppi8255");
225   state->n7751 = devtag_get_device(machine, "n7751");
232226}
233227
234228
235229static TIMER_CALLBACK( suspend_i8751 )
236230{
237   cputag_suspend(machine, "mcu", SUSPEND_REASON_DISABLE, 1);
231   segas1x_state *state = (segas1x_state *)machine->driver_data;
232   cpu_suspend(state->mcu, SUSPEND_REASON_DISABLE, 1);
238233}
239234
240235
r7356r7357
247242
248243static MACHINE_START( system16a )
249244{
250   state_save_register_global(machine, video_control);
251   state_save_register_global(machine, mcu_control);
252   state_save_register_global(machine, mj_input_num);
245   segas1x_state *state = (segas1x_state *)machine->driver_data;
253246
254   state_save_register_global(machine, n7751_command);
255   state_save_register_global(machine, n7751_rom_address);
247   state_save_register_global(machine, state->video_control);
248   state_save_register_global(machine, state->mcu_control);
249   state_save_register_global(machine, state->n7751_command);
250   state_save_register_global(machine, state->n7751_rom_address);
251   state_save_register_global(machine, state->mj_input_num);
252   state_save_register_global(machine, state->last_buttons1);
253   state_save_register_global(machine, state->last_buttons2);
254   state_save_register_global(machine, state->read_port);
256255}
257256
258257
259258static MACHINE_RESET( system16a )
260259{
260   segas1x_state *state = (segas1x_state *)machine->driver_data;
261
261262   fd1094_machine_init(devtag_get_device(machine, "maincpu"));
262263
263264   /* if we have a fake i8751 handler, disable the actual 8751 */
264   if (i8751_vblank_hook != NULL)
265   if (state->i8751_vblank_hook != NULL)
265266      timer_call_after_resynch(machine, NULL, 0, suspend_i8751);
266267
267   mcu_control = 0x00;
268   state->mcu_control = 0x00;
268269}
269270
270271
r7356r7357
277278
278279static TIMER_CALLBACK( delayed_ppi8255_w )
279280{
280   ppi8255_w(devtag_get_device(machine, "ppi8255"), param >> 8, param & 0xff);
281   segas1x_state *state = (segas1x_state *)machine->driver_data;
282   ppi8255_w(state->ppi8255, param >> 8, param & 0xff);
281283}
282284
283285
284286static READ16_HANDLER( standard_io_r )
285287{
288   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
286289   offset &= 0x3fff/2;
287290   switch (offset & (0x3000/2))
288291   {
289292      case 0x0000/2:
290         return ppi8255_r(devtag_get_device(space->machine, "ppi8255"), offset & 3);
293         return ppi8255_r(state->ppi8255, offset & 3);
291294
292295      case 0x1000/2:
293296      {
r7356r7357
321324
322325static READ16_HANDLER( misc_io_r )
323326{
324   if (custom_io_r)
325      return (*custom_io_r)(space, offset, mem_mask);
327   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
328
329   if (state->custom_io_r)
330      return (*state->custom_io_r)(space, offset, mem_mask);
326331   else
327332      return standard_io_r(space, offset, mem_mask);
328333}
r7356r7357
330335
331336static WRITE16_HANDLER( misc_io_w )
332337{
333   if (custom_io_w)
334      (*custom_io_w)(space, offset, data, mem_mask);
338   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
339
340   if (state->custom_io_w)
341      (*state->custom_io_w)(space, offset, data, mem_mask);
335342   else
336343      standard_io_w(space, offset, data, mem_mask);
337344}
r7356r7357
358365        D1 : Coin meter #2
359366        D0 : Coin meter #1
360367    */
361   running_device *mcu = devtag_get_device(device->machine, "mcu");
362368
363   if (((video_control ^ data) & 0x0c) && lamp_changed_w)
364      (*lamp_changed_w)(video_control ^ data, data);
365   video_control = data;
369   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
366370
371   if (((state->video_control ^ data) & 0x0c) && state->lamp_changed_w)
372      (*state->lamp_changed_w)(device->machine, state->video_control ^ data, data);
373   state->video_control = data;
374
367375   segaic16_tilemap_set_flip(device->machine, 0, data & 0x80);
368376   segaic16_sprites_set_flip(device->machine, 0, data & 0x80);
369377
370   if (mcu != NULL)
371      cpu_set_input_line(mcu, MCS51_INT1_LINE, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
378   if (state->mcu != NULL)
379      cpu_set_input_line(state->mcu, MCS51_INT1_LINE, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
372380
373381   segaic16_set_display_enable(device->machine, data & 0x10);
374382   set_led_status(device->machine, 1, data & 0x08);
r7356r7357
401409             0= Sound is disabled
402410             1= sound is enabled
403411    */
404   cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
412   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
413
414   cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
405415   segaic16_tilemap_set_colscroll(device->machine, 0, ~data & 0x04);
406416   segaic16_tilemap_set_rowscroll(device->machine, 0, ~data & 0x02);
407417}
r7356r7357
416426
417427static READ8_HANDLER( sound_data_r )
418428{
429   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
430
419431   /* assert ACK */
420   ppi8255_set_port_c(devtag_get_device(space->machine, "ppi8255"), 0x00);
432   ppi8255_set_port_c(state->ppi8255, 0x00);
421433   return soundlatch_r(space, offset);
422434}
423435
r7356r7357
434446        D1    = /CS for ROM 0
435447        D0    = A14 line to ROMs
436448    */
449   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
450
437451   int numroms = memory_region_length(space->machine, "n7751data") / 0x8000;
438   n7751_rom_address &= 0x3fff;
439   n7751_rom_address |= (data & 0x01) << 14;
440   if (!(data & 0x02) && numroms >= 1) n7751_rom_address |= 0x00000;
441   if (!(data & 0x04) && numroms >= 2) n7751_rom_address |= 0x08000;
442   if (!(data & 0x08) && numroms >= 3) n7751_rom_address |= 0x10000;
443   if (!(data & 0x10) && numroms >= 4) n7751_rom_address |= 0x18000;
444   n7751_command = data >> 5;
452   state->n7751_rom_address &= 0x3fff;
453   state->n7751_rom_address |= (data & 0x01) << 14;
454   if (!(data & 0x02) && numroms >= 1) state->n7751_rom_address |= 0x00000;
455   if (!(data & 0x04) && numroms >= 2) state->n7751_rom_address |= 0x08000;
456   if (!(data & 0x08) && numroms >= 3) state->n7751_rom_address |= 0x10000;
457   if (!(data & 0x10) && numroms >= 4) state->n7751_rom_address |= 0x18000;
458   state->n7751_command = data >> 5;
445459}
446460
447461
r7356r7357
453467        D1 = /RESET line on 7751
454468        D0 = /IRQ line on 7751
455469    */
456   cputag_set_input_line(device->machine, "n7751", INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
457   cputag_set_input_line(device->machine, "n7751", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
470   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
471
472   cpu_set_input_line(state->n7751, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
473   cpu_set_input_line(state->n7751, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
458474   cpuexec_boost_interleave(device->machine, attotime_zero, ATTOTIME_IN_USEC(100));
459475}
460476
r7356r7357
465481   /* P5 - address lines 4-7 */
466482   /* P6 - address lines 8-11 */
467483   /* P7 - address lines 12-13 */
484   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
485
468486   int mask = (0xf << (4 * offset)) & 0x3fff;
469487   int newdata = (data << (4 * offset)) & mask;
470   n7751_rom_address = (n7751_rom_address & ~mask) | newdata;
488   state->n7751_rom_address = (state->n7751_rom_address & ~mask) | newdata;
471489}
472490
473491
474492static READ8_HANDLER( n7751_rom_r )
475493{
476494   /* read from BUS */
477   return memory_region(space->machine, "n7751data")[n7751_rom_address];
495   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
496   return memory_region(space->machine, "n7751data")[state->n7751_rom_address];
478497}
479498
480499
r7356r7357
482501{
483502   /* read from P2 - 8255's PC0-2 connects to 7751's S0-2 (P24-P26 on an 8048) */
484503   /* bit 0x80 is an alternate way to control the sample on/off; doesn't appear to be used */
485   return 0x80 | ((n7751_command & 0x07) << 4) | (i8243_p2_r(device, offset) & 0x0f);
504   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
505   return 0x80 | ((state->n7751_command & 0x07) << 4) | (i8243_p2_r(device, offset) & 0x0f);
486506}
487507
488508
r7356r7357
513533static INTERRUPT_GEN( i8751_main_cpu_vblank )
514534{
515535   /* if we have a fake 8751 handler, call it on VBLANK */
516   if (i8751_vblank_hook != NULL)
517      (*i8751_vblank_hook)(device->machine);
536   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
537
538   if (state->i8751_vblank_hook != NULL)
539      (*state->i8751_vblank_hook)(device->machine);
518540}
519541
520542
r7356r7357
527549
528550static void dumpmtmt_i8751_sim(running_machine *machine)
529551{
552   segas1x_state *state = (segas1x_state *)machine->driver_data;
530553   UINT8 flag = workram[0x200/2] >> 8;
531554   UINT8 tick = workram[0x200/2] & 0xff;
532555   UINT8 sec = workram[0x202/2] >> 8;
533556   UINT8 min = workram[0x202/2] & 0xff;
534557
535558   /* signal a VBLANK to the main CPU */
536   cputag_set_input_line(machine, "maincpu", 4, HOLD_LINE);
559   cpu_set_input_line(state->maincpu, 4, HOLD_LINE);
537560
538561   /* out of time? set the flag */
539562   if (tick == 0 && sec == 0 && min == 0)
r7356r7357
572595
573596static void quartet_i8751_sim(running_machine *machine)
574597{
575   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
598   segas1x_state *state = (segas1x_state *)machine->driver_data;
599   const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
576600
577601   /* signal a VBLANK to the main CPU */
578   cputag_set_input_line(machine, "maincpu", 4, HOLD_LINE);
602   cpu_set_input_line(state->maincpu, 4, HOLD_LINE);
579603
580604   /* X scroll values */
581605   segaic16_textram_0_w(space, 0xff8/2, workram[0x0d14/2], 0xffff);
r7356r7357
596620
597621static READ16_HANDLER( aceattaa_custom_io_r )
598622{
623   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
624
599625   switch (offset & (0x3000/2))
600626   {
601627      case 0x1000/2:
r7356r7357
603629         {
604630            case 0x01:
605631            {
606               switch (video_control & 0xf)
632               switch (state->video_control & 0xf)
607633               {
608634                  case 0x00: return input_port_read(space->machine, "P1");
609635                  case 0x04: return input_port_read(space->machine, "ANALOGX1");
r7356r7357
618644
619645            case 0x03:
620646            {
621               switch (video_control & 0xf)
647               switch (state->video_control & 0xf)
622648               {
623649                  case 0x00: return input_port_read(space->machine, "P2");
624650                  case 0x04: return input_port_read(space->machine, "ANALOGX2");
r7356r7357
644670
645671static READ16_HANDLER( mjleague_custom_io_r )
646672{
673   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
674
647675   switch (offset & (0x3000/2))
648676   {
649677      case 0x1000/2:
r7356r7357
654682            case 0:
655683            {
656684               UINT8 buttons = input_port_read(space->machine, "SERVICE");
657               UINT8 analog1 = input_port_read(space->machine, (video_control & 4) ? "ANALOGY1" : "ANALOGX1");
658               UINT8 analog2 = input_port_read(space->machine, (video_control & 4) ? "ANALOGY2" : "ANALOGX2");
685               UINT8 analog1 = input_port_read(space->machine, (state->video_control & 4) ? "ANALOGY1" : "ANALOGX1");
686               UINT8 analog2 = input_port_read(space->machine, (state->video_control & 4) ? "ANALOGY2" : "ANALOGX2");
659687               buttons |= (analog1 & 0x80) >> 1;
660688               buttons |= (analog2 & 0x80);
661689               return buttons;
r7356r7357
666694            case 1:
667695            {
668696               UINT8 buttons = input_port_read(space->machine, "BUTTONS1");
669               UINT8 analog = input_port_read(space->machine, (video_control & 4) ? "ANALOGY1" : "ANALOGX1");
697               UINT8 analog = input_port_read(space->machine, (state->video_control & 4) ? "ANALOGY1" : "ANALOGX1");
670698               return (buttons & 0x80) | (analog & 0x7f);
671699            }
672700
673701            /* offset 2 contains either the batting control or the "stance" button state */
674702            case 2:
675703            {
676               if (video_control & 4)
704               if (state->video_control & 4)
677705                  return (input_port_read(space->machine, "ANALOGZ1") >> 4) | (input_port_read(space->machine, "ANALOGZ2") & 0xf0);
678706               else
679707               {
680                  static UINT8 last_buttons1 = 0;
681                  static UINT8 last_buttons2 = 0;
682708                  UINT8 buttons1 = input_port_read(space->machine, "BUTTONS1");
683709                  UINT8 buttons2 = input_port_read(space->machine, "BUTTONS2");
684710
685711                  if (!(buttons1 & 0x01))
686                     last_buttons1 = 0;
712                     state->last_buttons1 = 0;
687713                  else if (!(buttons1 & 0x02))
688                     last_buttons1 = 1;
714                     state->last_buttons1 = 1;
689715                  else if (!(buttons1 & 0x04))
690                     last_buttons1 = 2;
716                     state->last_buttons1 = 2;
691717                  else if (!(buttons1 & 0x08))
692                     last_buttons1 = 3;
718                     state->last_buttons1 = 3;
693719
694720                  if (!(buttons2 & 0x01))
695                     last_buttons2 = 0;
721                     state->last_buttons2 = 0;
696722                  else if (!(buttons2 & 0x02))
697                     last_buttons2 = 1;
723                     state->last_buttons2 = 1;
698724                  else if (!(buttons2 & 0x04))
699                     last_buttons2 = 2;
725                     state->last_buttons2 = 2;
700726                  else if (!(buttons2 & 0x08))
701                     last_buttons2 = 3;
727                     state->last_buttons2 = 3;
702728
703                  return last_buttons1 | (last_buttons2 << 4);
729                  return state->last_buttons1 | (state->last_buttons2 << 4);
704730               }
705731            }
706732
r7356r7357
709735            case 3:
710736            {
711737               UINT8 buttons = input_port_read(space->machine, "BUTTONS2");
712               UINT8 analog = input_port_read(space->machine, (video_control & 4) ? "ANALOGY2" : "ANALOGX2");
738               UINT8 analog = input_port_read(space->machine, (state->video_control & 4) ? "ANALOGY2" : "ANALOGX2");
713739               return (buttons & 0x80) | (analog & 0x7f);
714740            }
715741         }
r7356r7357
728754
729755static READ16_HANDLER( passsht16a_custom_io_r )
730756{
731   static int read_port = 0;
757   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
758
732759   switch (offset & (0x3000/2))
733760   {
734761      case 0x1000/2:
735762         switch (offset & 3)
736763         {
737764            case 0:
738               read_port = 0;
765               state->read_port = 0;
739766               break;
740767
741768            case 1:
742               switch ((read_port++)&3)
769               switch ((state->read_port++) & 3)
743770               {
744771                  case 0: return input_port_read(space->machine, "P1");
745772                  case 1: return input_port_read(space->machine, "P2");
r7356r7357
764791
765792static READ16_HANDLER( sdi_custom_io_r )
766793{
794   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
795
767796   switch (offset & (0x3000/2))
768797   {
769798      case 0x1000/2:
770799         switch (offset & 3)
771800         {
772            case 1:   return input_port_read(space->machine, (video_control & 4) ? "ANALOGY1" : "ANALOGX1");
773            case 3:   return input_port_read(space->machine, (video_control & 4) ? "ANALOGY2" : "ANALOGX2");
801            case 1:   return input_port_read(space->machine, (state->video_control & 4) ? "ANALOGY1" : "ANALOGX1");
802            case 3:   return input_port_read(space->machine, (state->video_control & 4) ? "ANALOGY2" : "ANALOGX2");
774803         }
775804         break;
776805   }
r7356r7357
787816
788817static READ16_HANDLER( sjryuko_custom_io_r )
789818{
819   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
820
790821   static const char *const portname[] = { "MJ0", "MJ1", "MJ2", "MJ3", "MJ4", "MJ5" };
791822   switch (offset & (0x3000/2))
792823   {
r7356r7357
794825         switch (offset & 3)
795826         {
796827            case 1:
797               if (input_port_read_safe(space->machine, portname[mj_input_num], 0xff) != 0xff)
798                  return 0xff & ~(1 << mj_input_num);
828               if (input_port_read_safe(space->machine, portname[state->mj_input_num], 0xff) != 0xff)
829                  return 0xff & ~(1 << state->mj_input_num);
799830               return 0xff;
800831
801832            case 2:
802               return input_port_read_safe(space->machine, portname[mj_input_num], 0xff);
833               return input_port_read_safe(space->machine, portname[state->mj_input_num], 0xff);
803834         }
804835         break;
805836   }
r7356r7357
807838}
808839
809840
810static void sjryuko_lamp_changed_w(UINT8 changed, UINT8 newval)
841static void sjryuko_lamp_changed_w(running_machine *machine, UINT8 changed, UINT8 newval)
811842{
843   segas1x_state *state = (segas1x_state *)machine->driver_data;
844
812845   if ((changed & 4) && (newval & 4))
813      mj_input_num = (mj_input_num + 1) % 6;
846      state->mj_input_num = (state->mj_input_num + 1) % 6;
814847}
815848
816849
r7356r7357
823856
824857INLINE UINT8 maincpu_byte_r(running_machine *machine, offs_t offset)
825858{
826   return memory_read_byte(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), offset);
859   segas1x_state *state = (segas1x_state *)machine->driver_data;
860   return memory_read_byte(cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM), offset);
827861}
828862
829863
830864INLINE void maincpu_byte_w(running_machine *machine, offs_t offset, UINT8 data)
831865{
832   memory_write_byte(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), offset, data);
866   segas1x_state *state = (segas1x_state *)machine->driver_data;
867   memory_write_byte(cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM), offset, data);
833868}
834869
835870
836871static WRITE8_HANDLER( mcu_control_w )
837872{
838   running_device *maincpu = devtag_get_device(space->machine, "maincpu");
873   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
839874   int irqline;
840875
841   cpu_set_input_line(maincpu, INPUT_LINE_RESET, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
876   cpu_set_input_line(state->maincpu, INPUT_LINE_RESET, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
842877   for (irqline = 1; irqline <= 7; irqline++)
843      cpu_set_input_line(maincpu, irqline, ((~data & 7) == irqline) ? ASSERT_LINE : CLEAR_LINE);
878      cpu_set_input_line(state->maincpu, irqline, ((~data & 7) == irqline) ? ASSERT_LINE : CLEAR_LINE);
844879
845880   if (data & 0x40)
846881      segaic16_set_display_enable(space->machine, 1);
847882
848   if ((mcu_control ^ data) & 0x40)
883   if ((state->mcu_control ^ data) & 0x40)
849884      cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(10));
850885
851   mcu_control = data;
886   state->mcu_control = data;
852887}
853888
854889
r7356r7357
862897        1.11 0... = checksum #1
863898        1.11 1... = checksum #2
864899    */
865   switch ((mcu_control >> 3) & 7)
900   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
901
902   switch ((state->mcu_control >> 3) & 7)
866903   {
867904      case 0:
868905         if (offset >= 0x4000 && offset < 0x8000)
r7356r7357
871908            maincpu_byte_w(space->machine, 0xc40001 ^ (offset & 0x3fff), data);
872909         else
873910            logerror("%03X: MCU movx write mode %02X offset %04X = %02X\n",
874                   cpu_get_pc(space->cpu), mcu_control, offset, data);
911                   cpu_get_pc(space->cpu), state->mcu_control, offset, data);
875912         break;
876913
877914      case 1:
r7356r7357
879916            maincpu_byte_w(space->machine, 0x410001 ^ (offset & 0xfff), data);
880917         else
881918            logerror("%03X: MCU movx write mode %02X offset %04X = %02X\n",
882                   cpu_get_pc(space->cpu), mcu_control, offset, data);
919                   cpu_get_pc(space->cpu), state->mcu_control, offset, data);
883920         break;
884921
885922      case 3:
r7356r7357
893930
894931      default:
895932         logerror("%03X: MCU movx write mode %02X offset %04X = %02X\n",
896                cpu_get_pc(space->cpu), mcu_control, offset, data);
933                cpu_get_pc(space->cpu), state->mcu_control, offset, data);
897934         break;
898935   }
899936}
r7356r7357
901938
902939static READ8_HANDLER( mcu_io_r )
903940{
904   switch ((mcu_control >> 3) & 7)
941   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
942
943   switch ((state->mcu_control >> 3) & 7)
905944   {
906945      case 0:
907946         if (offset >= 0x0000 && offset < 0x3fff)
r7356r7357
911950         else if (offset >= 0x8000 && offset < 0xc000)
912951            return maincpu_byte_r(space->machine, 0xc40001 ^ (offset & 0x3fff));
913952         logerror("%03X: MCU movx read mode %02X offset %04X\n",
914                cpu_get_pc(space->cpu), mcu_control, offset);
953                cpu_get_pc(space->cpu), state->mcu_control, offset);
915954         return 0xff;
916955
917956      case 1:
918957         if (offset >= 0x8000 && offset < 0x9000)
919958            return maincpu_byte_r(space->machine, 0x410001 ^ (offset & 0xfff));
920959         logerror("%03X: MCU movx read mode %02X offset %04X\n",
921                cpu_get_pc(space->cpu), mcu_control, offset);
960                cpu_get_pc(space->cpu), state->mcu_control, offset);
922961         return 0xff;
923962
924963      case 3:
r7356r7357
933972
934973      default:
935974         logerror("%03X: MCU movx read mode %02X offset %04X\n",
936                cpu_get_pc(space->cpu), mcu_control, offset);
975                cpu_get_pc(space->cpu), state->mcu_control, offset);
937976         return 0xff;
938977   }
939978}
r7356r7357
19141953
19151954static MACHINE_DRIVER_START( system16a )
19161955
1956   /* driver data */
1957   MDRV_DRIVER_DATA(segas1x_state)
1958
19171959   /* basic machine hardware */
19181960   MDRV_CPU_ADD("maincpu", M68000, 10000000)
19191961   MDRV_CPU_PROGRAM_MAP(system16a_map)
r7356r7357
33203362
33213363static DRIVER_INIT( aceattaa )
33223364{
3365   segas1x_state *state = (segas1x_state *)machine->driver_data;
3366
33233367   system16a_generic_init(machine);
3324   custom_io_r = aceattaa_custom_io_r;
3368   state->custom_io_r = aceattaa_custom_io_r;
33253369}
33263370
33273371
r7356r7357
33413385
33423386static DRIVER_INIT( dumpmtmt )
33433387{
3388   segas1x_state *state = (segas1x_state *)machine->driver_data;
3389
33443390   system16a_generic_init(machine);
3345   i8751_vblank_hook = dumpmtmt_i8751_sim;
3391   state->i8751_vblank_hook = dumpmtmt_i8751_sim;
33463392}
33473393
33483394
33493395static DRIVER_INIT( mjleague )
33503396{
3397   segas1x_state *state = (segas1x_state *)machine->driver_data;
3398
33513399   system16a_generic_init(machine);
3352   custom_io_r = mjleague_custom_io_r;
3400   state->custom_io_r = mjleague_custom_io_r;
33533401}
33543402
33553403static DRIVER_INIT( passsht16a )
33563404{
3405   segas1x_state *state = (segas1x_state *)machine->driver_data;
3406
33573407   system16a_generic_init(machine);
3358   custom_io_r = passsht16a_custom_io_r;
3408   state->custom_io_r = passsht16a_custom_io_r;
33593409}
33603410
33613411static DRIVER_INIT( quartet )
33623412{
3413   segas1x_state *state = (segas1x_state *)machine->driver_data;
3414
33633415   system16a_generic_init(machine);
3364   i8751_vblank_hook = quartet_i8751_sim;
3416   state->i8751_vblank_hook = quartet_i8751_sim;
33653417}
33663418
33673419
33683420static DRIVER_INIT( sdi )
33693421{
3422   segas1x_state *state = (segas1x_state *)machine->driver_data;
3423
33703424   system16a_generic_init(machine);
33713425   fd1089b_decrypt(machine);
3372   custom_io_r = sdi_custom_io_r;
3426   state->custom_io_r = sdi_custom_io_r;
33733427}
33743428
33753429
33763430static DRIVER_INIT( sjryukoa )
33773431{
3432   segas1x_state *state = (segas1x_state *)machine->driver_data;
3433
33783434   system16a_generic_init(machine);
33793435   fd1089b_decrypt(machine);
3380   custom_io_r = sjryuko_custom_io_r;
3381   lamp_changed_w = sjryuko_lamp_changed_w;
3436   state->custom_io_r = sjryuko_custom_io_r;
3437   state->lamp_changed_w = sjryuko_lamp_changed_w;
33823438}
33833439
33843440
r7356r7357
33903446 *************************************/
33913447
33923448/* "Pre-System 16" */
3393GAME( 1986, bodyslam,   0,        system16a_8751,   bodyslam,   generic_16a, ROT0,   "Sega",          "Body Slam (8751 317-0015)", 0 )
3394GAME( 1986, dumpmtmt,   bodyslam, system16a_8751,   bodyslam,   dumpmtmt,    ROT0,   "Sega",          "Dump Matsumoto (Japan, 8751 317-0011a)", GAME_UNEMULATED_PROTECTION )
3395GAME( 1985, mjleague,   0,        system16a,        mjleague,   mjleague,    ROT270, "Sega",          "Major League", 0 )
3396GAME( 1986, quartet,    0,        system16a_8751,   quartet,    quartet,     ROT0,   "Sega",          "Quartet (Rev A, 8751 315-5194)", GAME_UNEMULATED_PROTECTION )
3397GAME( 1986, quarteta,   quartet,  system16a_8751,   quartet,    quartet,     ROT0,   "Sega",          "Quartet (8751 315-5194)", GAME_UNEMULATED_PROTECTION )
3398GAME( 1986, quartet2,   quartet,  system16a_8751,   quart2,     generic_16a, ROT0,   "Sega",          "Quartet 2 (8751 317-0010)", 0 )
3399GAME( 1986, quartet2a,  quartet,  system16a,        quart2,     generic_16a, ROT0,   "Sega",          "Quartet 2 (unprotected)", 0 )
3449GAME( 1986, bodyslam,   0,        system16a_8751,   bodyslam,   generic_16a, ROT0,   "Sega",          "Body Slam (8751 317-0015)", GAME_SUPPORTS_SAVE )
3450GAME( 1986, dumpmtmt,   bodyslam, system16a_8751,   bodyslam,   dumpmtmt,    ROT0,   "Sega",          "Dump Matsumoto (Japan, 8751 317-0011a)", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
3451GAME( 1985, mjleague,   0,        system16a,        mjleague,   mjleague,    ROT270, "Sega",          "Major League", GAME_SUPPORTS_SAVE )
3452GAME( 1986, quartet,    0,        system16a_8751,   quartet,    quartet,     ROT0,   "Sega",          "Quartet (Rev A, 8751 315-5194)", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
3453GAME( 1986, quarteta,   quartet,  system16a_8751,   quartet,    quartet,     ROT0,   "Sega",          "Quartet (8751 315-5194)", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
3454GAME( 1986, quartet2,   quartet,  system16a_8751,   quart2,     generic_16a, ROT0,   "Sega",          "Quartet 2 (8751 317-0010)", GAME_SUPPORTS_SAVE )
3455GAME( 1986, quartet2a,  quartet,  system16a,        quart2,     generic_16a, ROT0,   "Sega",          "Quartet 2 (unprotected)", GAME_SUPPORTS_SAVE )
34003456
34013457/* System 16A */
3402GAME( 1987, aliensyn5,  aliensyn, system16a,        aliensyn,   fd1089b_16a, ROT0,   "Sega",           "Alien Syndrome (set 5, System 16A, FD1089B 317-0037)", 0 )
3403GAME( 1987, aliensyn2,  aliensyn, system16a,        aliensyn,   fd1089a_16a, ROT0,   "Sega",           "Alien Syndrome (set 2, System 16A, FD1089A 317-0033)", 0 )
3404GAME( 1987, aliensynjo, aliensyn, system16a,        aliensynj,  fd1089a_16a, ROT0,   "Sega",           "Alien Syndrome (set 1, Japan, old, System 16A, FD1089A 317-0033)", 0 )
3405GAME( 1988, aceattaca,  aceattac, system16a       , aceattaa,   aceattaa,    ROT270, "Sega",           "Ace Attacker (Japan, System 16A, FD1094 317-0060)", 0 )
3406GAME( 1986, afighter,   0,        system16a_no7751, afighter,   fd1089a_16a, ROT270, "Sega",           "Action Fighter (FD1089A 317-0018)", 0 )
3407GAME( 1986, alexkidd,   0,        system16a,        alexkidd,   generic_16a, ROT0,   "Sega",           "Alex Kidd: The Lost Stars (set 2, unprotected)", 0 )
3408GAME( 1986, alexkidd1,  alexkidd, system16a,        alexkidd,   fd1089a_16a, ROT0,   "Sega",           "Alex Kidd: The Lost Stars (set 1, FD1089A 317-0021)", 0 )
3409GAME( 1986, fantzone,   0,        system16a_no7751, fantzone,   generic_16a, ROT0,   "Sega",           "Fantasy Zone (set 2, unprotected)", 0 )
3410GAME( 1986, fantzone1,  fantzone, system16a_no7751, fantzone,   generic_16a, ROT0,   "Sega",           "Fantasy Zone (set 1, unprotected)", 0 )
3411GAME( 1988, passsht16a, passsht,  system16a,        passsht16a, passsht16a,  ROT270, "Sega",           "Passing Shot (Japan, 4 Players, System 16A, FD1094 317-0071)", 0 )
3412GAME( 1987, sdi,        0,        system16a_no7751, sdi,        sdi,         ROT0,   "Sega",           "SDI - Strategic Defense Initiative (Japan, old, System 16A, FD1089B 317-0027)", 0 )
3413GAME( 1987, shinobi,    0,        system16a,        shinobi,    generic_16a, ROT0,   "Sega",           "Shinobi (set 6, System 16A, unprotected)", 0 )
3414GAME( 1987, shinobi1,   shinobi,  system16a,        shinobi,    generic_16a, ROT0,   "Sega",           "Shinobi (set 1, System 16A, FD1094 317-0050)", 0 )
3415GAME( 1987, shinobls,   shinobi,  system16a,        shinobi,    generic_16a, ROT0,   "[Sega] (Star bootleg)", "Shinobi (Star bootleg, System 16A)", 0 )
3416GAME( 1987, shinoblb,   shinobi,  system16a,        shinobi,    generic_16a, ROT0,   "[Sega] (Beta bootleg)", "Shinobi (Beta bootleg)", 0 ) // should have different sound hw? using original ATM
3417GAME( 1987, sjryuko1,   sjryuko,  system16a,        sjryuko,    sjryukoa,    ROT0,   "White Board",    "Sukeban Jansi Ryuko (set 1, System 16A, FD1089B 317-5021)", 0 )
3418GAME( 1988, tetris,     0,        system16a_no7751, tetris,     generic_16a, ROT0,   "Sega",           "Tetris (set 4, Japan, System 16A, FD1094 317-0093)", 0 )
3419GAME( 1988, tetris3,    tetris,   system16a_no7751, tetris,     generic_16a, ROT0,   "Sega",           "Tetris (set 3, Japan, System 16A, FD1094 317-0093a)", 0 )
3420GAME( 1987, timescan1,  timescan, system16a,        timescan,   fd1089b_16a, ROT270, "Sega",           "Time Scanner (set 1, System 16A, FD1089B 317-0024)", 0 )
3421GAME( 1988, wb31,       wb3,      system16a_no7751, wb3,        generic_16a, ROT0,   "Sega / Westone", "Wonder Boy III - Monster Lair (set 1, System 16A, FD1094 317-0084)", 0 )
3422GAME( 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 )
3458GAME( 1987, aliensyn5,  aliensyn, system16a,        aliensyn,   fd1089b_16a, ROT0,   "Sega",           "Alien Syndrome (set 5, System 16A, FD1089B 317-0037)", GAME_SUPPORTS_SAVE )
3459GAME( 1987, aliensyn2,  aliensyn, system16a,        aliensyn,   fd1089a_16a, ROT0,   "Sega",           "Alien Syndrome (set 2, System 16A, FD1089A 317-0033)", GAME_SUPPORTS_SAVE )
3460GAME( 1987, aliensynjo, aliensyn, system16a,        aliensynj,  fd1089a_16a, ROT0,   "Sega",           "Alien Syndrome (set 1, Japan, old, System 16A, FD1089A 317-0033)", GAME_SUPPORTS_SAVE )
3461GAME( 1988, aceattaca,  aceattac, system16a       , aceattaa,   aceattaa,    ROT270, "Sega",           "Ace Attacker (Japan, System 16A, FD1094 317-0060)", GAME_SUPPORTS_SAVE )
3462GAME( 1986, afighter,   0,        system16a_no7751, afighter,   fd1089a_16a, ROT270, "Sega",           "Action Fighter (FD1089A 317-0018)", GAME_SUPPORTS_SAVE )
3463GAME( 1986, alexkidd,   0,        system16a,        alexkidd,   generic_16a, ROT0,   "Sega",           "Alex Kidd: The Lost Stars (set 2, unprotected)", GAME_SUPPORTS_SAVE )
3464GAME( 1986, alexkidd1,  alexkidd, system16a,        alexkidd,   fd1089a_16a, ROT0,   "Sega",           "Alex Kidd: The Lost Stars (set 1, FD1089A 317-0021)", GAME_SUPPORTS_SAVE )
3465GAME( 1986, fantzone,   0,        system16a_no7751, fantzone,   generic_16a, ROT0,   "Sega",           "Fantasy Zone (set 2, unprotected)", GAME_SUPPORTS_SAVE )
3466GAME( 1986, fantzone1,  fantzone, system16a_no7751, fantzone,   generic_16a, ROT0,   "Sega",           "Fantasy Zone (set 1, unprotected)", GAME_SUPPORTS_SAVE )
3467GAME( 1988, passsht16a, passsht,  system16a,        passsht16a, passsht16a,  ROT270, "Sega",           "Passing Shot (Japan, 4 Players, System 16A, FD1094 317-0071)", GAME_SUPPORTS_SAVE )
3468GAME( 1987, sdi,        0,        system16a_no7751, sdi,        sdi,         ROT0,   "Sega",           "SDI - Strategic Defense Initiative (Japan, old, System 16A, FD1089B 317-0027)", GAME_SUPPORTS_SAVE )
3469GAME( 1987, shinobi,    0,        system16a,        shinobi,    generic_16a, ROT0,   "Sega",           "Shinobi (set 6, System 16A, unprotected)", GAME_SUPPORTS_SAVE )
3470GAME( 1987, shinobi1,   shinobi,  system16a,        shinobi,    generic_16a, ROT0,   "Sega",           "Shinobi (set 1, System 16A, FD1094 317-0050)", GAME_SUPPORTS_SAVE )
3471GAME( 1987, shinobls,   shinobi,  system16a,        shinobi,    generic_16a, ROT0,   "[Sega] (Star bootleg)", "Shinobi (Star bootleg, System 16A)", GAME_SUPPORTS_SAVE )
3472GAME( 1987, shinoblb,   shinobi,  system16a,        shinobi,    generic_16a, ROT0,   "[Sega] (Beta bootleg)", "Shinobi (Beta bootleg)", GAME_SUPPORTS_SAVE ) // should have different sound hw? using original ATM
3473GAME( 1987, sjryuko1,   sjryuko,  system16a,        sjryuko,    sjryukoa,    ROT0,   "White Board",    "Sukeban Jansi Ryuko (set 1, System 16A, FD1089B 317-5021)", GAME_SUPPORTS_SAVE )
3474GAME( 1988, tetris,     0,        system16a_no7751, tetris,     generic_16a, ROT0,   "Sega",           "Tetris (set 4, Japan, System 16A, FD1094 317-0093)", GAME_SUPPORTS_SAVE )
3475GAME( 1988, tetris3,    tetris,   system16a_no7751, tetris,     generic_16a, ROT0,   "Sega",           "Tetris (set 3, Japan, System 16A, FD1094 317-0093a)", GAME_SUPPORTS_SAVE )
3476GAME( 1987, timescan1,  timescan, system16a,        timescan,   fd1089b_16a, ROT270, "Sega",           "Time Scanner (set 1, System 16A, FD1089B 317-0024)", GAME_SUPPORTS_SAVE )
3477GAME( 1988, wb31,       wb3,      system16a_no7751, wb3,        generic_16a, ROT0,   "Sega / Westone", "Wonder Boy III - Monster Lair (set 1, System 16A, FD1094 317-0084)", GAME_SUPPORTS_SAVE )
3478GAME( 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 | GAME_SUPPORTS_SAVE )
src/mame/drivers/neogeo.c
r7356r7357
11941194 *
11951195 *************************************/
11961196
1197static ADDRESS_MAP_START( auido_io_map, ADDRESS_SPACE_IO, 8 )
1197static ADDRESS_MAP_START( audio_io_map, ADDRESS_SPACE_IO, 8 )
11981198  /*AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READWRITE(audio_command_r, audio_cpu_clear_nmi_w);*/  /* may not and NMI clear */
11991199   AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READ(audio_command_r)
12001200   AM_RANGE(0x04, 0x07) AM_MIRROR(0xff00) AM_DEVREADWRITE("ymsnd", ym2610_r, ym2610_w)
r7356r7357
12411241   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )                                 \
12421242   PORT_DIPNAME( 0x0018, 0x0018, "COMM Setting (Cabinet No.)" ) PORT_DIPLOCATION("SW:4,5")   \
12431243   PORT_DIPSETTING(     0x0018, "1" )                                          \
1244   PORT_DIPSETTING(     0x0008, "2" )                                          \
1245   PORT_DIPSETTING(     0x0010, "3" )                                          \
1244   PORT_DIPSETTING(     0x0010, "2" )                                          \
1245   PORT_DIPSETTING(     0x0008, "3" )                                          \
12461246   PORT_DIPSETTING(     0x0000, "4" )                                          \
12471247   PORT_DIPNAME( 0x0020, 0x0020, "COMM Setting (Link Enable)" ) PORT_DIPLOCATION("SW:6")   \
12481248   PORT_DIPSETTING(     0x0020, DEF_STR( Off ) )                                 \
r7356r7357
13481348
13491349   MDRV_CPU_ADD("audiocpu", Z80, NEOGEO_AUDIO_CPU_CLOCK)
13501350   MDRV_CPU_PROGRAM_MAP(audio_map)
1351   MDRV_CPU_IO_MAP(auido_io_map)
1351   MDRV_CPU_IO_MAP(audio_io_map)
13521352
13531353   MDRV_WATCHDOG_TIME_INIT(USEC(128762))
13541354
src/mame/drivers/segahang.c
r7356r7357
1717#include "cpu/z80/z80.h"
1818#include "cpu/mcs51/mcs51.h"
1919#include "deprecat.h"
20#include "includes/system16.h"
20#include "includes/segas16.h"
2121#include "machine/segaic16.h"
2222#include "machine/fd1089.h"
2323#include "machine/8255ppi.h"
r7356r7357
2525#include "sound/2203intf.h"
2626#include "sound/2151intf.h"
2727#include "sound/segapcm.h"
28#include "video/segaic16.h"
2829
2930
3031#define MASTER_CLOCK_25MHz      (25174800)
r7356r7357
4041
4142static UINT16 *workram;
4243
43static UINT8 adc_select;
44
45static void (*i8751_vblank_hook)(running_machine *machine);
46
47
48
4944/*************************************
5045 *
5146 *  Prototypes
r7356r7357
9590 *
9691 *************************************/
9792
98static void hangon_generic_init(void)
93static void hangon_generic_init( running_machine *machine )
9994{
95   segas1x_state *state = (segas1x_state *)machine->driver_data;
96
10097   /* reset the custom handlers and other pointers */
101   i8751_vblank_hook = NULL;
98   state->i8751_vblank_hook = NULL;
99
100   state->maincpu = devtag_get_device(machine, "maincpu");
101   state->soundcpu = devtag_get_device(machine, "soundcpu");
102   state->subcpu = devtag_get_device(machine, "sub");
103   state->mcu = devtag_get_device(machine, "mcu");
104   state->ppi8255_1 = devtag_get_device(machine, "ppi8255_1");
105   state->ppi8255_2 = devtag_get_device(machine, "ppi8255_2");
106
107   state_save_register_global(machine, state->adc_select);
102108}
103109
104110
105111static TIMER_CALLBACK( suspend_i8751 )
106112{
107   cputag_suspend(machine, "mcu", SUSPEND_REASON_DISABLE, 1);
113   segas1x_state *state = (segas1x_state *)machine->driver_data;
114   cpu_suspend(state->mcu, SUSPEND_REASON_DISABLE, 1);
108115}
109116
110117
r7356r7357
117124
118125static MACHINE_RESET( hangon )
119126{
127   segas1x_state *state = (segas1x_state *)machine->driver_data;
128
120129   fd1094_machine_init(devtag_get_device(machine, "sub"));
121130
122131   /* reset misc components */
123132   segaic16_tilemap_reset(machine, 0);
124133
125134   /* if we have a fake i8751 handler, disable the actual 8751 */
126   if (i8751_vblank_hook != NULL)
135   if (state->i8751_vblank_hook != NULL)
127136      timer_call_after_resynch(machine, NULL, 0, suspend_i8751);
128137
129138   /* reset global state */
130   adc_select = 0;
139   state->adc_select = 0;
131140}
132141
133142#if 0
r7356r7357
150159
151160static TIMER_CALLBACK( delayed_ppi8255_w )
152161{
153   ppi8255_w(devtag_get_device(machine, "ppi8255_0"), param >> 8, param & 0xff);
162   segas1x_state *state = (segas1x_state *)machine->driver_data;
163   ppi8255_w(state->ppi8255_1, param >> 8, param & 0xff);
154164}
155165
156166
157167static READ16_HANDLER( hangon_io_r )
158168{
169   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
170
159171   switch (offset & 0x3020/2)
160172   {
161173      case 0x0000/2: /* PPI @ 4B */
162         return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), offset & 3);
174         return ppi8255_r(state->ppi8255_1, offset & 3);
163175
164176      case 0x1000/2: /* Input ports and DIP switches */
165177      {
r7356r7357
168180      }
169181
170182      case 0x3000/2: /* PPI @ 4C */
171         return ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), offset & 3);
183         return ppi8255_r(state->ppi8255_2, offset & 3);
172184
173185      case 0x3020/2: /* ADC0804 data output */
174186      {
175187         static const char *const adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
176         return input_port_read_safe(space->machine, adcports[adc_select], 0);
188         return input_port_read_safe(space->machine, adcports[state->adc_select], 0);
177189      }
178190   }
179191
180192   logerror("%06X:hangon_io_r - unknown read access to address %04X\n", cpu_get_pc(space->cpu), offset * 2);
181   return segaic16_open_bus_r(space,0,mem_mask);
193   return segaic16_open_bus_r(space, 0, mem_mask);
182194}
183195
184196
185197static WRITE16_HANDLER( hangon_io_w )
186198{
199   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
200
187201   if (ACCESSING_BITS_0_7)
188202      switch (offset & 0x3020/2)
189203      {
r7356r7357
194208            return;
195209
196210         case 0x3000/2: /* PPI @ 4C */
197            ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), offset & 3, data & 0xff);
211            ppi8255_w(state->ppi8255_2, offset & 3, data & 0xff);
198212            return;
199213
200214         case 0x3020/2: /* ADC0804 */
r7356r7357
207221
208222static READ16_HANDLER( sharrier_io_r )
209223{
224   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
225
210226   switch (offset & 0x0030/2)
211227   {
212228      case 0x0000/2:
213         return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), offset & 3);
229         return ppi8255_r(state->ppi8255_1, offset & 3);
214230
215231      case 0x0010/2: /* Input ports and DIP switches */
216232      {
r7356r7357
220236
221237      case 0x0020/2: /* PPI @ 4C */
222238         if (offset == 2) return 0;
223         return ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), offset & 3);
239         return ppi8255_r(state->ppi8255_2, offset & 3);
224240
225241      case 0x0030/2: /* ADC0804 data output */
226242      {
227243         static const char *const adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
228         return input_port_read_safe(space->machine, adcports[adc_select], 0);
244         return input_port_read_safe(space->machine, adcports[state->adc_select], 0);
229245      }
230246   }
231247
232248   logerror("%06X:sharrier_io_r - unknown read access to address %04X\n", cpu_get_pc(space->cpu), offset * 2);
233   return segaic16_open_bus_r(space,0,mem_mask);
249   return segaic16_open_bus_r(space, 0, mem_mask);
234250}
235251
236252
237253static WRITE16_HANDLER( sharrier_io_w )
238254{
255   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
256
239257   if (ACCESSING_BITS_0_7)
240258      switch (offset & 0x0030/2)
241259      {
r7356r7357
246264            return;
247265
248266         case 0x0020/2: /* PPI @ 4C */
249            ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), offset & 3, data & 0xff);
267            ppi8255_w(state->ppi8255_2, offset & 3, data & 0xff);
250268            return;
251269
252270         case 0x0030/2: /* ADC0804 */
r7356r7357
266284
267285static WRITE8_DEVICE_HANDLER( sound_latch_w )
268286{
269   const address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
287   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
288   const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
270289   soundlatch_w(space, offset, data);
271290}
272291
r7356r7357
294313
295314static WRITE8_DEVICE_HANDLER( tilemap_sound_w )
296315{
316   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
317
297318   /* Port C : Tilemap origin and audio mute */
298319   /* D7 : Port A handshaking signal /OBF */
299320   /* D6 : Port A handshaking signal ACK */
r7356r7357
303324   /* D2 : SCONT1 - Tilemap origin bit 1 */
304325   /* D1 : SCONT0 - Tilemap origin bit 0 */
305326   /* D0 : MUTE (1= audio on, 0= audio off) */
306   cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
327   cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
307328   segaic16_tilemap_set_colscroll(device->machine, 0, ~data & 0x04);
308329   segaic16_tilemap_set_rowscroll(device->machine, 0, ~data & 0x02);
309330   sound_global_enable(device->machine, data & 0x01);
r7356r7357
312333
313334static WRITE8_DEVICE_HANDLER( sub_control_adc_w )
314335{
336   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
337
315338   /* Port A : S.CPU control and ADC channel select */
316339   /* D6 : INTR line on second CPU */
317340   /* D5 : RESET line on second CPU */
318341   /* D3-D2 : ADC_SELECT */
319   cputag_set_input_line(device->machine, "sub", 4, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
320   cputag_set_input_line(device->machine, "sub", INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
342   cpu_set_input_line(state->subcpu, 4, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
343   cpu_set_input_line(state->subcpu, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
321344
322345   /* If the CPU is being Reset we also need to reset the fd1094 state */
323346   if (data & 0x20)
324347   {
325      fd1094_machine_init(devtag_get_device(device->machine, "sub"));
348      fd1094_machine_init(state->subcpu);
326349   }
327350
328   adc_select = (data >> 2) & 3;
351   state->adc_select = (data >> 2) & 3;
329352}
330353
331354
r7356r7357
348371
349372static INTERRUPT_GEN( i8751_main_cpu_vblank )
350373{
374   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
375
351376   /* if we have a fake 8751 handler, call it on VBLANK */
352   if (i8751_vblank_hook != NULL)
353      (*i8751_vblank_hook)(device->machine);
377   if (state->i8751_vblank_hook != NULL)
378      (*state->i8751_vblank_hook)(device->machine);
354379   irq4_line_hold(device);
355380}
356381
r7356r7357
377402
378403static void sound_irq(running_device *device, int irq)
379404{
380   cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
405   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
406   cpu_set_input_line(state->soundcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
381407}
382408
383409
384410static READ8_HANDLER( sound_data_r )
385411{
412   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
413
386414   /* assert ACK */
387   ppi8255_set_port_c(devtag_get_device(space->machine, "ppi8255_0"), 0x00);
415   ppi8255_set_port_c(state->ppi8255_1, 0x00);
388416   return soundlatch_r(space, offset);
389417}
390418
r7356r7357
887915
888916static MACHINE_DRIVER_START( hangon_base )
889917
918   /* driver data */
919   MDRV_DRIVER_DATA(segas1x_state)
920
890921   /* basic machine hardware */
891922   MDRV_CPU_ADD("maincpu", M68000, MASTER_CLOCK_25MHz/4)
892923   MDRV_CPU_PROGRAM_MAP(hangon_map)
r7356r7357
898929   MDRV_MACHINE_RESET(hangon)
899930   MDRV_QUANTUM_TIME(HZ(6000))
900931
901   MDRV_PPI8255_ADD( "ppi8255_0", hangon_ppi_intf[0] )
902   MDRV_PPI8255_ADD( "ppi8255_1", hangon_ppi_intf[1] )
932   MDRV_PPI8255_ADD( "ppi8255_1", hangon_ppi_intf[0] )
933   MDRV_PPI8255_ADD( "ppi8255_2", hangon_ppi_intf[1] )
903934
904935   /* video hardware */
905936   MDRV_GFXDECODE(segahang)
r7356r7357
17971828
17981829static DRIVER_INIT( hangon )
17991830{
1800   hangon_generic_init();
1831   hangon_generic_init(machine);
18011832}
18021833
18031834
18041835static DRIVER_INIT( sharrier )
18051836{
1806   hangon_generic_init();
1807   i8751_vblank_hook = sharrier_i8751_sim;
1837   segas1x_state *state = (segas1x_state *)machine->driver_data;
1838
1839   hangon_generic_init(machine);
1840   state->i8751_vblank_hook = sharrier_i8751_sim;
18081841}
18091842
18101843
18111844static DRIVER_INIT( enduror )
18121845{
1813   hangon_generic_init();
1846   hangon_generic_init(machine);
18141847   fd1089b_decrypt(machine);
18151848}
18161849
r7356r7357
18211854   UINT16 *rom = (UINT16 *)memory_region(machine, "maincpu");
18221855   UINT16 *decrypt = auto_alloc_array(machine, UINT16, 0x40000/2);
18231856
1824   hangon_generic_init();
1857   hangon_generic_init(machine);
18251858   memory_set_decrypted_region(space, 0x000000, 0x03ffff, decrypt);
18261859
18271860   memcpy(decrypt + 0x00000/2, rom + 0x30000/2, 0x10000);
r7356r7357
18351868   UINT16 *rom = (UINT16 *)memory_region(machine, "maincpu");
18361869   UINT16 *decrypt = auto_alloc_array(machine, UINT16, 0x40000/2);
18371870
1838   hangon_generic_init();
1871   hangon_generic_init(machine);
18391872   memory_set_decrypted_region(space, 0x000000, 0x03ffff, decrypt);
18401873
18411874   memcpy(decrypt, rom, 0x30000);
18421875   /* missing data ROM */
18431876}
1877
18441878static DRIVER_INIT( shangonro )
18451879{
1846   hangon_generic_init();
1880   hangon_generic_init(machine);
18471881
18481882   /* init the FD1094 */
18491883   fd1094_driver_init(machine, "sub", NULL);
src/mame/drivers/ddragon.c
r7356r7357
559559ADDRESS_MAP_END
560560
561561
562static ADDRESS_MAP_START( ddragnba_sub_map, ADDRESS_SPACE_PROGRAM, 8 )
562static ADDRESS_MAP_START( ddragonba_sub_map, ADDRESS_SPACE_PROGRAM, 8 )
563563   AM_RANGE(0x0000, 0x0fff) AM_RAM
564564   AM_RANGE(0x8000, 0x8fff) AM_READWRITE(ddragon_spriteram_r, ddragon_spriteram_w)
565565   AM_RANGE(0xc000, 0xffff) AM_ROM
r7356r7357
574574ADDRESS_MAP_END
575575
576576/* might not be 100% accurate, check bits written */
577static WRITE8_HANDLER( ddragnba_port_w )
577static WRITE8_HANDLER( ddragonba_port_w )
578578{
579579   ddragon_state *state = (ddragon_state *)space->machine->driver_data;
580580   cpu_set_input_line(state->maincpu, M6809_IRQ_LINE, ASSERT_LINE);
581581   cpu_set_input_line(state->sub_cpu, state->sprite_irq, CLEAR_LINE );
582582}
583583
584static ADDRESS_MAP_START( ddragnba_sub_portmap, ADDRESS_SPACE_IO, 8 )
585   AM_RANGE(0x0000, 0xffff) AM_WRITE(ddragnba_port_w)
584static ADDRESS_MAP_START( ddragonba_sub_portmap, ADDRESS_SPACE_IO, 8 )
585   AM_RANGE(0x0000, 0xffff) AM_WRITE(ddragonba_port_w)
586586ADDRESS_MAP_END
587587
588588
r7356r7357
10331033MACHINE_DRIVER_END
10341034
10351035
1036static MACHINE_DRIVER_START( ddragnba )
1036static MACHINE_DRIVER_START( ddragonba )
10371037   MDRV_IMPORT_FROM(ddragon)
10381038
10391039   /* basic machine hardware */
10401040   MDRV_CPU_REPLACE("sub", M6803, MAIN_CLOCK / 2)   /* 6Mhz / 4 internally */
1041   MDRV_CPU_PROGRAM_MAP(ddragnba_sub_map)
1042   MDRV_CPU_IO_MAP(ddragnba_sub_portmap)
1041   MDRV_CPU_PROGRAM_MAP(ddragonba_sub_map)
1042   MDRV_CPU_IO_MAP(ddragonba_sub_portmap)
10431043MACHINE_DRIVER_END
10441044
10451045
1046static MACHINE_DRIVER_START( ddgn6809 )
1046static MACHINE_DRIVER_START( ddragon6809 )
10471047
10481048   /* driver data */
10491049   MDRV_DRIVER_DATA(ddragon_state)
r7356r7357
20332033   /* should the sound rom be bitswapped too? */
20342034}
20352035
2036static DRIVER_INIT( ddgn6809 )
2036static DRIVER_INIT( ddragon6809 )
20372037{
20382038   ddragon_state *state = (ddragon_state *)machine->driver_data;
20392039   /* Descramble GFX here */
r7356r7357
20572057GAME( 1987, ddragonua,   ddragon,  ddragon,  ddragon,  ddragon,  ROT0, "[Technos Japan] (Taito America license)", "Double Dragon (US Set 2)", GAME_SUPPORTS_SAVE )
20582058GAME( 1987, ddragonb2,   ddragon,  ddragon,  ddragon,  ddragon,  ROT0, "bootleg", "Double Dragon (bootleg)", GAME_SUPPORTS_SAVE )
20592059GAME( 1987, ddragonb,    ddragon,  ddragonb, ddragon,  ddragon,  ROT0, "bootleg", "Double Dragon (bootleg with HD6309)", GAME_SUPPORTS_SAVE ) // according to dump notes
2060GAME( 1987, ddragonba,   ddragon,  ddragnba, ddragon,  ddragon,  ROT0, "bootleg", "Double Dragon (bootleg with M6803)", GAME_SUPPORTS_SAVE )
2061GAME( 1987, ddragon6809, ddragon,  ddgn6809, ddragon,  ddgn6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 1)", GAME_NOT_WORKING )
2062GAME( 1987, ddragon6809a,ddragon,  ddgn6809, ddragon,  ddgn6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 2)", GAME_NOT_WORKING )
2060GAME( 1987, ddragonba,   ddragon,  ddragonba,   ddragon,  ddragon,  ROT0, "bootleg", "Double Dragon (bootleg with M6803)", GAME_SUPPORTS_SAVE )
2061GAME( 1987, ddragon6809, ddragon,  ddragon6809, ddragon,  ddragon6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 1)", GAME_NOT_WORKING )
2062GAME( 1987, ddragon6809a,ddragon,  ddragon6809, ddragon,  ddragon6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 2)", GAME_NOT_WORKING )
20632063GAME( 1988, ddragon2,    0,        ddragon2, ddragon2, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (World)", GAME_SUPPORTS_SAVE )
20642064GAME( 1988, ddragon2u,   ddragon2, ddragon2, ddragon2, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (US)", GAME_SUPPORTS_SAVE )
20652065
src/mame/drivers/asterix.c
r7356r7357
408408   ROM_LOAD( "068a06.1e", 0x000000, 0x200000, CRC(6df9ec0e) SHA1(cee60312e9813bd6579f3ac7c3c2521a8e633eca) )
409409ROM_END
410410
411ROM_START( asterixaad )
412   ROM_REGION( 0x100000, "maincpu", 0 )
413   ROM_LOAD16_BYTE( "068_aa_d01.8c", 0x000000,  0x20000, CRC(3fae5f1f) SHA1(73ef65dac8e1cd4d9a3695963231e3a2a860b486) )
414   ROM_LOAD16_BYTE( "068_aa_d02.8d", 0x000001,  0x20000, CRC(171f0ba0) SHA1(1665f23194da5811e4708ad0495378957b6e6251) )
415   ROM_LOAD16_BYTE( "068a03.7c", 0x080000,  0x20000, CRC(8223ebdc) SHA1(e4aa39e4bc1d210bdda5b0cb41d6c8006c48dd24) )
416   ROM_LOAD16_BYTE( "068a04.7d", 0x080001,  0x20000, CRC(9f351828) SHA1(e03842418f08e6267eeea03362450da249af73be) )
417
418   ROM_REGION( 0x010000, "audiocpu", 0 )
419   ROM_LOAD( "068_a05.5f", 0x000000, 0x010000,  CRC(d3d0d77b) SHA1(bfa77a8bf651dc27f481e96a2d63242084cc214c) )
420
421   ROM_REGION( 0x100000, "gfx1", 0 )
422   ROM_LOAD( "068a12.16k", 0x000000, 0x080000, CRC(b9da8e9c) SHA1(a46878916833923e421da0667e37620ae0b77744) )
423   ROM_LOAD( "068a11.12k", 0x080000, 0x080000, CRC(7eb07a81) SHA1(672c0c60834df7816d33d88643e4575b8ca9bcc1) )
424
425   ROM_REGION( 0x400000, "gfx2", 0 )
426   ROM_LOAD( "068a08.7k", 0x000000, 0x200000, CRC(c41278fe) SHA1(58e5f67a67ae97e0b264489828cd7e74662c5ed5) )
427   ROM_LOAD( "068a07.3k", 0x200000, 0x200000, CRC(32efdbc4) SHA1(b7e8610aa22249176d82b750e2549d1eea6abe4f) )
428
429   ROM_REGION( 0x200000, "k053260", 0 )
430   ROM_LOAD( "068a06.1e", 0x000000, 0x200000, CRC(6df9ec0e) SHA1(cee60312e9813bd6579f3ac7c3c2521a8e633eca) )
431ROM_END
432
411433ROM_START( asterixj )
412434   ROM_REGION( 0x100000, "maincpu", 0 )
413435   ROM_LOAD16_BYTE( "068_ja_d01.8c", 0x000000,  0x20000, CRC(2bc10940) SHA1(e25cc97435f157bed9c28d9e9277c9f47d4fb5fb) )
r7356r7357
443465GAME( 1992, asterix,    0,       asterix, asterix, asterix, ROT0, "Konami", "Asterix (ver EAD)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
444466GAME( 1992, asterixeac, asterix, asterix, asterix, asterix, ROT0, "Konami", "Asterix (ver EAC)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
445467GAME( 1992, asterixeaa, asterix, asterix, asterix, asterix, ROT0, "Konami", "Asterix (ver EAA)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
468GAME( 1992, asterixaad, asterix, asterix, asterix, asterix, ROT0, "Konami", "Asterix (ver AAD)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
446469GAME( 1992, asterixj,   asterix, asterix, asterix, asterix, ROT0, "Konami", "Asterix (ver JAD)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
src/mame/drivers/taito_l.c
r7356r7357
836836static ADDRESS_MAP_START( kurikint_map, ADDRESS_SPACE_PROGRAM, 8 )
837837   COMMON_BANKS_MAP
838838   AM_RANGE(0x8000, 0x9fff) AM_RAM
839   AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE_MEMBER(taitol_state, shared_ram)
839   AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_BASE_MEMBER(taitol_state, shared_ram)
840840   AM_RANGE(0xa800, 0xa800) AM_READWRITE(mux_r, mux_w)
841841   AM_RANGE(0xa801, 0xa801) AM_WRITE(mux_ctrl_w) AM_READNOP   // Watchdog or interrupt ack (value ignored)
842842ADDRESS_MAP_END
r7356r7357
29192919{
29202920   UINT8 *ROM = memory_region(machine, "audiocpu");
29212921   ROM[0x72] = 0x45;   /* reti -> retn  ('dead' loop @ $1104 )*/
2922   memory_install_write8_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM), 0xa7fe, 0xa7fe, 0, 0, evilston_snd_w);
2922   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa7fe, 0xa7fe, 0, 0, evilston_snd_w);
29232923}
29242924
29252925
src/mame/drivers/destroyr.c
r7356r7357
449449   MDRV_DRIVER_DATA(destroyr_state)
450450
451451   /* basic machine hardware */
452   MDRV_CPU_ADD("maincpu", M6800, 12096000 / 16)
452   MDRV_CPU_ADD("maincpu", M6800, XTAL_12_096MHz / 16)
453453   MDRV_CPU_PROGRAM_MAP(destroyr_map)
454454   MDRV_CPU_VBLANK_INT_HACK(irq0_line_assert, 4)
455455
src/mame/drivers/fuukifg2.c
r7356r7357
226226INPUT_PORTS_END
227227
228228/* Same as gogomile, but the default country is different and the coinage settings too. */
229static INPUT_PORTS_START( gogomilj )
229static INPUT_PORTS_START( gogomilej )
230230   PORT_INCLUDE( gogomile )
231231
232232   PORT_MODIFY("DSW")      // $880000.w
r7356r7357
668668***************************************************************************/
669669
670670GAME( 1995, gogomile, 0,        fuuki16, gogomile, 0, ROT0, "Fuuki", "Go Go! Mile Smile", GAME_IMPERFECT_SOUND )
671GAME( 1995, gogomilej,gogomile, fuuki16, gogomilj, 0, ROT0, "Fuuki", "Susume! Mile Smile (Japan)", GAME_IMPERFECT_SOUND )
671GAME( 1995, gogomilej,gogomile, fuuki16, gogomilej,0, ROT0, "Fuuki", "Susume! Mile Smile (Japan)", GAME_IMPERFECT_SOUND )
672672GAME( 1996, pbancho,  0,        fuuki16, pbancho,  0, ROT0, "Fuuki", "Gyakuten!! Puzzle Bancho (Japan)", 0)
src/mame/drivers/gunpey.c
r7356r7357
351351
352352/***************************************************************************************/
353353
354
355354ROM_START( gunpey )
356355   ROM_REGION( 0x100000, "maincpu", 0 ) /* V30 code */
357356   ROM_LOAD16_BYTE( "gp_rom1.021",  0x00000, 0x80000, CRC(07a589a7) SHA1(06c4140ffd5f74b3d3ddfc424f43fcd08d903490) )
r7356r7357
367366   ROM_LOAD( "gp_rom5.622",  0x000000, 0x400000,  CRC(f79903e0) SHA1(4fd50b4138e64a48ec1504eb8cd172a229e0e965)) // 1xxxxxxxxxxxxxxxxxxxxx = 0xFF
368367ROM_END
369368
370GAME( 2000, gunpey, 0, gunpey, gunpey, 0,   ROT0, "Banpresto", "Gunpey",GAME_NOT_WORKING)
369static DRIVER_INIT( gunpey )
370{
371   UINT8 *rom = memory_region(machine, "maincpu");
372
373   /* patch SLOOOOW cycle checks ... */
374   rom[0x848b5] = 0x7e;
375//  rom[0x848b6] = 0x03;
376   rom[0x89657] = 0x75;
377   rom[0x8e628] = 0x75;
378
379}
380
381GAME( 2000, gunpey, 0, gunpey, gunpey, gunpey,   ROT0, "Banpresto", "Gunpey",GAME_NOT_WORKING)
src/mame/drivers/dooyong.c
r7356r7357
256256   AM_RANGE(0xc000, 0xc7ff) AM_RAM
257257   AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_r)
258258   AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE("ym1", ym2203_r, ym2203_w)
259   AM_RANGE(0xf002, 0xf003) AM_DEVREADWRITE("ym1", ym2203_r, ym2203_w)
259   AM_RANGE(0xf002, 0xf003) AM_DEVREADWRITE("ym2", ym2203_r, ym2203_w)
260260ADDRESS_MAP_END
261261
262262static ADDRESS_MAP_START( pollux_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/backfire.c
r7356r7357
226226
227227static READ32_DEVICE_HANDLER(backfire_eeprom_r)
228228{
229   /* some kind of screen indicator?  checked by backfira set before it will boot */
229   /* some kind of screen indicator?  checked by backfirea set before it will boot */
230230   int backfire_screen = mame_rand(device->machine) & 1;
231231   return ((eeprom_read_bit(device) << 24) | input_port_read(device->machine, "IN0")
232232         | ((input_port_read(device->machine, "IN2") & 0xbf) << 16)
r7356r7357
655655//  mame_printf_debug( "%08x\n",cpu_get_pc(space->cpu));
656656
657657   if (cpu_get_pc(space->cpu)==0xce44)  cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); // backfire
658   if (cpu_get_pc(space->cpu)==0xcee4)  cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); // backfira
658   if (cpu_get_pc(space->cpu)==0xcee4)  cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(400)); // backfirea
659659
660660   return backfire_mainram[0x18/4];
661661}
src/mame/drivers/segas18.c
r7356r7357
3333#include "cpu/mcs51/mcs51.h"
3434#include "deprecat.h"
3535#include "machine/segaic16.h"
36#include "includes/system16.h"
36#include "includes/segas16.h"
3737#include "includes/genesis.h"
3838#include "sound/2612intf.h"
3939#include "sound/rf5c68.h"
40#include "video/segaic16.h"
4041
4142
42
4343/*************************************
4444 *
4545 *  Constants
4646 *
4747 *************************************/
4848
49#define ROM_BOARD_171_SHADOW   (0)      /* 171-???? -- used by shadow dancer */
50#define ROM_BOARD_171_5874      (1)      /* 171-5874 */
51#define ROM_BOARD_171_5987      (2)      /* 171-5987 */
49#define ROM_BOARD_171_SHADOW        (0)      /* 171-???? -- used by shadow dancer */
50#define ROM_BOARD_171_5874          (1)      /* 171-5874 */
51#define ROM_BOARD_171_5987          (2)      /* 171-5987 */
5252
5353
54
5554/*************************************
5655 *
5756 *  Statics
r7356r7357
6059
6160static UINT16 *workram;
6261
63static UINT8 rom_board;
64static UINT8 misc_io_data[0x10];
65static UINT8 mcu_data;
6662
67static read16_space_func custom_io_r;
68static write16_space_func custom_io_w;
69
70static UINT8 wwally_last_x[3], wwally_last_y[3];
71static UINT8 lghost_value, lghost_select;
72
73
74
7563/*************************************
7664 *
7765 *  Prototypes
r7356r7357
149137
150138static void sound_w(running_machine *machine, UINT8 data)
151139{
152   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
140   segas1x_state *state = (segas1x_state *)machine->driver_data;
141   const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
142
153143   soundlatch_w(space, 0, data & 0xff);
154   cputag_set_input_line(machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
144   cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, PULSE_LINE);
155145}
156146
157
158147static UINT8 sound_r(running_machine *machine)
159148{
160   return mcu_data;
149   segas1x_state *state = (segas1x_state *)machine->driver_data;
150   return state->mcu_data;
161151}
162152
163
164153static void system18_generic_init(running_machine *machine, int _rom_board)
165154{
155   segas1x_state *state = (segas1x_state *)machine->driver_data;
156
166157   /* set the ROM board */
167   rom_board = _rom_board;
158   state->rom_board = _rom_board;
168159
169160   /* allocate memory for regions not autmatically assigned */
170161   segaic16_spriteram_0 = auto_alloc_array(machine, UINT16, 0x00800/2);
r7356r7357
174165   workram              = auto_alloc_array(machine, UINT16, 0x04000/2);
175166
176167   /* init the memory mapper */
177   segaic16_memory_mapper_init(devtag_get_device(machine, "maincpu"), region_info_list[rom_board], sound_w, sound_r);
168   segaic16_memory_mapper_init(devtag_get_device(machine, "maincpu"), region_info_list[state->rom_board], sound_w, sound_r);
178169
179170   /* init the FD1094 */
180171   fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted);
181172
182173   /* reset the custom handlers and other pointers */
183   custom_io_r = NULL;
184   custom_io_w = NULL;
174   state->custom_io_r = NULL;
175   state->custom_io_w = NULL;
176
177   state->maincpu = devtag_get_device(machine, "maincpu");
178   state->soundcpu = devtag_get_device(machine, "soundcpu");
179   state->mcu = devtag_get_device(machine, "mcu");
180
181   state_save_register_global(machine, state->mcu_data);
182   state_save_register_global(machine, state->lghost_value);
183   state_save_register_global(machine, state->lghost_select);
184   state_save_register_global_array(machine, state->misc_io_data);
185   state_save_register_global_array(machine, state->wwally_last_x);
186   state_save_register_global_array(machine, state->wwally_last_y);
187   state_save_register_global_pointer(machine, segaic16_spriteram_0, 0x00800/2);
188   state_save_register_global_pointer(machine, segaic16_paletteram,  0x04000/2);
189   state_save_register_global_pointer(machine, segaic16_tileram_0,   0x10000/2);
190   state_save_register_global_pointer(machine, segaic16_textram_0,   0x01000/2);
191   state_save_register_global_pointer(machine, workram,              0x04000/2);
185192}
186193
187194
r7356r7357
200207
201208static MACHINE_RESET( system18 )
202209{
210   segas1x_state *state = (segas1x_state *)machine->driver_data;
211
203212   segaic16_memory_mapper_reset(machine);
204213   segaic16_tilemap_reset(machine, 0);
205214   fd1094_machine_init(devtag_get_device(machine, "maincpu"));
206215
207216   /* if we are running with a real live 8751, we need to boost the interleave at startup */
208   if (devtag_get_device(machine, "mcu") != NULL && cpu_get_type(devtag_get_device(machine, "mcu")) == CPU_I8751)
217   if (state->mcu != NULL && cpu_get_type(state->mcu) == CPU_I8751)
209218      timer_call_after_resynch(machine, NULL, 0, boost_interleave);
210219}
211220
r7356r7357
219228
220229static READ16_HANDLER( io_chip_r )
221230{
231   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
222232   static const char *const portnames[] = { "P1", "P2", "PORTC", "PORTD", "SERVICE", "COINAGE", "DSW", "PORTH" };
223233   offset &= 0x1f/2;
224234
r7356r7357
234244      case 0x0c/2:
235245      case 0x0e/2:
236246         /* if the port is configured as an output, return the last thing written */
237         if (misc_io_data[0x1e/2] & (1 << offset))
238            return misc_io_data[offset];
247         if (state->misc_io_data[0x1e/2] & (1 << offset))
248            return state->misc_io_data[offset];
239249
240250         /* otherwise, return an input port */
241251         return input_port_read(space->machine, portnames[offset]);
r7356r7357
253263      /* CNT register & mirror */
254264      case 0x18/2:
255265      case 0x1c/2:
256         return misc_io_data[0x1c/2];
266         return state->misc_io_data[0x1c/2];
257267
258268      /* port direction register & mirror */
259269      case 0x1a/2:
260270      case 0x1e/2:
261         return misc_io_data[0x1e/2];
271         return state->misc_io_data[0x1e/2];
262272   }
263273   return 0xffff;
264274}
r7356r7357
266276
267277static WRITE16_HANDLER( io_chip_w )
268278{
279   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
269280   UINT8 old;
270281
271282   /* generic implementation */
272283   offset &= 0x1f/2;
273   old = misc_io_data[offset];
274   misc_io_data[offset] = data;
284   old = state->misc_io_data[offset];
285   state->misc_io_data[offset] = data;
275286
276287   switch (offset)
277288   {
r7356r7357
299310
300311      /* tile banking */
301312      case 0x0e/2:
302         if (rom_board == ROM_BOARD_171_5874 || rom_board == ROM_BOARD_171_SHADOW)
313         if (state->rom_board == ROM_BOARD_171_5874 || state->rom_board == ROM_BOARD_171_SHADOW)
303314         {
304315            int i;
305316            for (i = 0; i < 4; i++)
r7356r7357
322333
323334static READ16_HANDLER( misc_io_r )
324335{
336   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
325337   static const char *const portnames[] = { "SERVICE", "COINAGE" };
326338
327339   offset &= 0x1fff;
r7356r7357
337349      case 0x2000/2:
338350         return input_port_read(space->machine, portnames[offset & 1]);
339351   }
340   if (custom_io_r)
341      return custom_io_r(space, offset, mem_mask);
352   if (state->custom_io_r)
353      return state->custom_io_r(space, offset, mem_mask);
342354   logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(space->cpu), offset * 2);
343   return segaic16_open_bus_r(space,0,mem_mask);
355   return segaic16_open_bus_r(space, 0, mem_mask);
344356}
345357
346358
347359static WRITE16_HANDLER( misc_io_w )
348360{
361   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
362
349363   offset &= 0x1fff;
350364   switch (offset & (0x3000/2))
351365   {
r7356r7357
368382         }
369383         break;
370384   }
371   if (custom_io_w)
385   if (state->custom_io_w)
372386   {
373      custom_io_w(space, offset, data, mem_mask);
387      state->custom_io_w(space, offset, data, mem_mask);
374388      return;
375389   }
376390   logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(space->cpu), offset * 2, data, mem_mask);
r7356r7357
432446      case 0x3024/2:
433447         return input_port_read(space->machine, "P34START");
434448   }
435   return segaic16_open_bus_r(space,0,mem_mask);
449   return segaic16_open_bus_r(space, 0, mem_mask);
436450}
437451
438452
r7356r7357
445459
446460static READ16_HANDLER( lghost_custom_io_r )
447461{
462   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
448463   UINT16 result;
449464   switch (offset)
450465   {
r7356r7357
452467      case 0x3012/2:
453468      case 0x3014/2:
454469      case 0x3016/2:
455         result = lghost_value | 0x7f;
456         lghost_value <<= 1;
470         result = state->lghost_value | 0x7f;
471         state->lghost_value <<= 1;
457472         return result;
458473   }
459   return segaic16_open_bus_r(space,0,mem_mask);
474   return segaic16_open_bus_r(space, 0, mem_mask);
460475}
461476
462477
463478static WRITE16_HANDLER( lghost_custom_io_w )
464479{
480   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
481
465482   switch (offset)
466483   {
467484      case 0x3010/2:
468         lghost_value = 255 - input_port_read(space->machine, "GUNY1");
485         state->lghost_value = 255 - input_port_read(space->machine, "GUNY1");
469486         break;
470487
471488      case 0x3012/2:
472         lghost_value = input_port_read(space->machine, "GUNX1");
489         state->lghost_value = input_port_read(space->machine, "GUNX1");
473490         break;
474491
475492      case 0x3014/2:
476         lghost_value = 255 - input_port_read(space->machine, lghost_select ? "GUNY3" : "GUNY2");
493         state->lghost_value = 255 - input_port_read(space->machine, state->lghost_select ? "GUNY3" : "GUNY2");
477494         break;
478495
479496      case 0x3016/2:
480         lghost_value = input_port_read(space->machine, lghost_select ? "GUNX3" : "GUNX2");
497         state->lghost_value = input_port_read(space->machine, state->lghost_select ? "GUNX3" : "GUNX2");
481498         break;
482499
483500      case 0x3020/2:
484         lghost_select = data & 1;
501         state->lghost_select = data & 1;
485502         break;
486503   }
487504}
r7356r7357
496513
497514static READ16_HANDLER( wwally_custom_io_r )
498515{
516   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
517
499518   switch (offset)
500519   {
501520      case 0x3000/2:
502         return (input_port_read(space->machine, "TRACKX1") - wwally_last_x[0]) & 0xff;
521         return (input_port_read(space->machine, "TRACKX1") - state->wwally_last_x[0]) & 0xff;
503522
504523      case 0x3004/2:
505         return (input_port_read(space->machine, "TRACKY1") - wwally_last_y[0]) & 0xff;
524         return (input_port_read(space->machine, "TRACKY1") - state->wwally_last_y[0]) & 0xff;
506525
507526      case 0x3008/2:
508         return (input_port_read(space->machine, "TRACKX2") - wwally_last_x[1]) & 0xff;
527         return (input_port_read(space->machine, "TRACKX2") - state->wwally_last_x[1]) & 0xff;
509528
510529      case 0x300c/2:
511         return (input_port_read(space->machine, "TRACKY2") - wwally_last_y[1]) & 0xff;
530         return (input_port_read(space->machine, "TRACKY2") - state->wwally_last_y[1]) & 0xff;
512531
513532      case 0x3010/2:
514         return (input_port_read(space->machine, "TRACKX3") - wwally_last_x[2]) & 0xff;
533         return (input_port_read(space->machine, "TRACKX3") - state->wwally_last_x[2]) & 0xff;
515534
516535      case 0x3014/2:
517         return (input_port_read(space->machine, "TRACKY3") - wwally_last_y[2]) & 0xff;
536         return (input_port_read(space->machine, "TRACKY3") - state->wwally_last_y[2]) & 0xff;
518537   }
519   return segaic16_open_bus_r(space,0,mem_mask);
538   return segaic16_open_bus_r(space, 0, mem_mask);
520539}
521540
522541
523542static WRITE16_HANDLER( wwally_custom_io_w )
524543{
544   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
545
525546   switch (offset)
526547   {
527548      case 0x3000/2:
528549      case 0x3004/2:
529         wwally_last_x[0] = input_port_read(space->machine, "TRACKX1");
530         wwally_last_y[0] = input_port_read(space->machine, "TRACKY1");
550         state->wwally_last_x[0] = input_port_read(space->machine, "TRACKX1");
551         state->wwally_last_y[0] = input_port_read(space->machine, "TRACKY1");
531552         break;
532553
533554      case 0x3008/2:
534555      case 0x300c/2:
535         wwally_last_x[1] = input_port_read(space->machine, "TRACKX2");
536         wwally_last_y[1] = input_port_read(space->machine, "TRACKY2");
556         state->wwally_last_x[1] = input_port_read(space->machine, "TRACKX2");
557         state->wwally_last_y[1] = input_port_read(space->machine, "TRACKY2");
537558         break;
538559
539560      case 0x3010/2:
540561      case 0x3014/2:
541         wwally_last_x[2] = input_port_read(space->machine, "TRACKX3");
542         wwally_last_y[2] = input_port_read(space->machine, "TRACKY3");
562         state->wwally_last_x[2] = input_port_read(space->machine, "TRACKX3");
563         state->wwally_last_y[2] = input_port_read(space->machine, "TRACKY3");
543564         break;
544565   }
545566}
r7356r7357
560581
561582static WRITE8_HANDLER( mcu_data_w )
562583{
563   mcu_data = data;
564   cputag_set_input_line(space->machine, "mcu", MCS51_INT1_LINE, HOLD_LINE);
584   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
585   state->mcu_data = data;
586   cpu_set_input_line(state->mcu, MCS51_INT1_LINE, HOLD_LINE);
565587}
566588
567589
r7356r7357
12591281
12601282static MACHINE_DRIVER_START( system18 )
12611283
1284   /* driver data */
1285   MDRV_DRIVER_DATA(segas1x_state)
1286
12621287   /* basic machine hardware */
12631288   MDRV_CPU_ADD("maincpu", M68000, 10000000)
12641289   MDRV_CPU_PROGRAM_MAP(system18_map)
r7356r7357
22152240
22162241static DRIVER_INIT( ddcrew )
22172242{
2243   segas1x_state *state = (segas1x_state *)machine->driver_data;
2244
22182245   DRIVER_INIT_CALL(generic_5987);
2219   custom_io_r = ddcrew_custom_io_r;
2246   state->custom_io_r = ddcrew_custom_io_r;
22202247}
22212248
22222249static DRIVER_INIT( lghost )
22232250{
2251   segas1x_state *state = (segas1x_state *)machine->driver_data;
2252
22242253   DRIVER_INIT_CALL(generic_5987);
2225   custom_io_r = lghost_custom_io_r;
2226   custom_io_w = lghost_custom_io_w;
2254   state->custom_io_r = lghost_custom_io_r;
2255   state->custom_io_w = lghost_custom_io_w;
22272256}
22282257
22292258static DRIVER_INIT( wwally )
22302259{
2260   segas1x_state *state = (segas1x_state *)machine->driver_data;
2261
22312262   DRIVER_INIT_CALL(generic_5987);
2232   custom_io_r = wwally_custom_io_r;
2233   custom_io_w = wwally_custom_io_w;
2263   state->custom_io_r = wwally_custom_io_r;
2264   state->custom_io_w = wwally_custom_io_w;
22342265}
22352266
22362267
src/mame/drivers/astrocorp.c
r7356r7357
55                driver by   Luca Elia (l.elia@tin.it)
66
77CPU:    68000
8GFX:    ASTRO V01 0005 (512 sprites, each made of N x M tiles. Tiles are 16x16x8)
8GFX:    ASTRO V01 0005 or ASTRO V02 0022
99SOUND:  OKI M6295 (AD-65)
10OTHER:  ASTRO 0001B, EEPROM
10OTHER:  EEPROM, Battery
1111
12 512 sprites, each made of N x M tiles. Tiles are 16x16x8
13
14To do:
15
16- Find source of level 2 interrupt
17
1218***************************************************************************/
1319
1420#include "emu.h"
21#include "deprecat.h"
1522#include "cpu/m68000/m68000.h"
1623#include "machine/eeprom.h"
24#include "machine/ticket.h"
1725#include "sound/okim6295.h"
1826
19typedef struct _astrocrp_state astrocrp_state;
20struct _astrocrp_state
27typedef struct _astrocorp_state astrocorp_state;
28struct _astrocorp_state
2129{
2230   /* memory pointers */
2331   UINT16 *   spriteram;
r7356r7357
2533   size_t     spriteram_size;
2634
2735   /* video-related */
36   bitmap_t * bitmap;
2837   UINT16     screen_enable;
38   UINT16     draw_sprites;
2939};
3040
41/***************************************************************************
42                                Video
43***************************************************************************/
3144
45static VIDEO_START( astrocorp )
46{
47   astrocorp_state *state = (astrocorp_state *)machine->driver_data;
48
49   state->bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
50
51   state_save_register_global_bitmap(machine, state->bitmap);
52   state_save_register_global       (machine, state->screen_enable);
53   state_save_register_global       (machine, state->draw_sprites);
54}
55
3256/***************************************************************************
3357                              Sprites Format
3458
r7356r7357
4771
4872***************************************************************************/
4973
50static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
74static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
5175{
52   astrocrp_state *state = (astrocrp_state *)machine->driver_data;
76   astrocorp_state *state = (astrocorp_state *)machine->driver_data;
5377   UINT16 *source = state->spriteram;
5478   UINT16 *finish = state->spriteram + state->spriteram_size / 2;
5579
5680   for ( ; source < finish; source += 8 / 2 )
5781   {
5882      int x, y;
83      int xwrap, ywrap;
5984
60      int   sx   = source[ 0x0/2 ];
85      int   sx      = source[ 0x0/2 ];
6186      int   code   = source[ 0x2/2 ];
62      int   sy   = source[ 0x4/2 ];
87      int   sy      = source[ 0x4/2 ];
6388      int   attr   = source[ 0x6/2 ];
6489
6590      int dimx   = (attr >> 8) & 0xff;
6691      int dimy   = (attr >> 0) & 0xff;
6792
68      if (!dimx && !dimy)
93      if (!sx && !code)
6994         return;
7095
7196      if (!(sx & 0x8000))
7297         continue;
7398
74      sx = (sx & 0x3fff) - (sx & 0x4000);
75      sy = (sy & 0x3fff) - (sy & 0x4000);
99      sx = (sx & 0x1fff) - (sx & 0x2000);
100      sy = (sy & 0x1fff) - (sy & 0x2000);
76101
77102      for (y = 0 ; y < dimy ; y++)
78103      {
79104         for (x = 0 ; x < dimx ; x++)
80105         {
81            drawgfx_transpen(bitmap,cliprect, machine->gfx[0],
82                  code++, 0,
83                  0, 0,
84                  sx + x * 16, sy + y * 16, 0xff);
106            for (ywrap = 0 ; ywrap <= 0x100 ; ywrap += 0x100)
107            {
108               for (xwrap = 0 ; xwrap <= 0x200 ; xwrap += 0x200)
109               {
110                  drawgfx_transpen(bitmap,cliprect, machine->gfx[0],
111                        code, 0,
112                        0, 0,
113                        sx + x * 16 - xwrap, sy + y * 16 - ywrap, 0xff);
114               }
115            }
116            code++;
85117         }
86118      }
87119   }
r7356r7357
89121
90122static VIDEO_UPDATE(astrocorp)
91123{
92   astrocrp_state *state = (astrocrp_state *)screen->machine->driver_data;
124   astrocorp_state *state = (astrocorp_state *)screen->machine->driver_data;
93125
94126   if (state->screen_enable & 1)
95127   {
96128      bitmap_fill(bitmap,cliprect,screen->machine->pens[0xff]);
97      draw_sprites(screen->machine, bitmap, cliprect);
129      copybitmap(bitmap, state->bitmap, 0,0,0,0, cliprect);
98130   }
99131   else
100132      bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
r7356r7357
107139                                Memory Maps
108140***************************************************************************/
109141
142static WRITE16_HANDLER( astrocorp_draw_sprites_w )
143{
144   astrocorp_state *state = (astrocorp_state *)space->machine->driver_data;
110145
146   UINT16 old = state->draw_sprites;
147   UINT16 now = COMBINE_DATA(&state->draw_sprites);
148
149   if (!old && now)
150      draw_sprites(space->machine, state->bitmap, video_screen_get_visible_area(space->machine->primary_screen));
151}
152
111153static WRITE16_HANDLER( astrocorp_eeprom_w )
112154{
113155   if (ACCESSING_BITS_0_7)
r7356r7357
125167   }
126168}
127169
128static WRITE16_HANDLER( astrocorp_outputs_w )
170static WRITE16_DEVICE_HANDLER( skilldrp_sound_bank_w )
129171{
130172   if (ACCESSING_BITS_0_7)
131173   {
174      okim6295_set_bank_base(device, 0x40000 * (data & 1));
175//      logerror("CPU #0 PC %06X: OKI bank %08X\n", cpu_get_pc(space->cpu), data);
176   }
177}
178
179static WRITE16_HANDLER( showhand_outputs_w )
180{
181   if (ACCESSING_BITS_0_7)
182   {
132183      coin_counter_w(space->machine, 0,   (data & 0x0004));   // coin counter
133184      set_led_status(space->machine, 0,   (data & 0x0008));   // you win
134185      if ((data & 0x0010)) increment_dispensed_tickets(space->machine, 1); // coin out
r7356r7357
145196//  popmessage("%04X",data);
146197}
147198
199static WRITE16_HANDLER( skilldrp_outputs_w )
200{
201   // key in          (0001)
202   // coin in         (0002)
203   // key out         (0004)
204   // coin out        (0008)
205   // hopper?         (0010)
206   // error  lamp     (0020)
207   // ticket motor?   (0080)
208   // select lamp     (0100)
209   // take   lamp     (0400)
210   // bet    lamp     (0800)
211   // start  lamp     (1000)
212   // win / test lamp (4000)
213   // ticket?         (8000)
214
215   // account    (5d20 4d20 4520 4420 4020 4000)
216
217   if (ACCESSING_BITS_0_7)
218   {
219      coin_counter_w(space->machine, 0,   (data & 0x0001));   // key in  |
220      coin_counter_w(space->machine, 0,   (data & 0x0002));   // coin in |- manual shows 1 in- and 1 out- counter
221      coin_counter_w(space->machine, 1,   (data & 0x0004));   // key out |
222      ticket_dispenser_w(devtag_get_device(space->machine, "hopper"), 0, (data & 0x0008)<<4);   // hopper motor?
223      //                                  (data & 0x0010)     // hopper?
224      set_led_status(space->machine, 0,   (data & 0x0020));   // error lamp (coin/hopper jam: "call attendant")
225      ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, data & 0x0080);   // ticket motor?
226   }
227   if (ACCESSING_BITS_8_15)
228   {
229      // lamps:
230      set_led_status(space->machine, 1,   (data & 0x0100));   // select
231      set_led_status(space->machine, 2,   (data & 0x0400));   // take
232      set_led_status(space->machine, 3,   (data & 0x0800));   // bet
233      set_led_status(space->machine, 4,   (data & 0x1000));   // start
234      set_led_status(space->machine, 5,   (data & 0x4000));   // win / test
235      set_led_status(space->machine, 6,   (data & 0x8000));   // ticket?
236   }
237
238//  popmessage("%04X",data);
239}
240
148241static WRITE16_HANDLER( astrocorp_enable_w )
149242{
150   astrocrp_state *state = (astrocrp_state *)space->machine->driver_data;
243   astrocorp_state *state = (astrocorp_state *)space->machine->driver_data;
151244   COMBINE_DATA(&state->screen_enable);
152245//  popmessage("%04X",data);
153   if (data & (~1))
154      logerror("CPU #0 PC %06X: screen enable = %04X\n", cpu_get_pc(space->cpu), data);
246   if (state->screen_enable & (~1))
247      logerror("CPU #0 PC %06X: screen enable = %04X\n", cpu_get_pc(space->cpu), state->screen_enable);
155248}
156249
157250static READ16_HANDLER( astrocorp_unk_r )
r7356r7357
162255// 5-6-5 Palette: BBBBB-GGGGGG-RRRRR
163256static WRITE16_HANDLER( astrocorp_palette_w )
164257{
165   astrocrp_state *state = (astrocrp_state *)space->machine->driver_data;
258   astrocorp_state *state = (astrocorp_state *)space->machine->driver_data;
166259   COMBINE_DATA(&state->paletteram[offset]);
167260   palette_set_color_rgb(space->machine, offset,
168261      pal5bit((state->paletteram[offset] >>  0) & 0x1f),
r7356r7357
173266
174267static ADDRESS_MAP_START( showhand_map, ADDRESS_SPACE_PROGRAM, 16 )
175268   AM_RANGE( 0x000000, 0x01ffff ) AM_ROM
176   AM_RANGE( 0x050000, 0x050fff ) AM_RAM AM_BASE_SIZE_MEMBER(astrocrp_state, spriteram, spriteram_size)
177   AM_RANGE( 0x052000, 0x052001 ) AM_WRITENOP
269   AM_RANGE( 0x050000, 0x050fff ) AM_RAM AM_BASE_SIZE_MEMBER(astrocorp_state, spriteram, spriteram_size)
270   AM_RANGE( 0x052000, 0x052001 ) AM_WRITE(astrocorp_draw_sprites_w)
178271   AM_RANGE( 0x054000, 0x054001 ) AM_READ_PORT("INPUTS")
179272   AM_RANGE( 0x058000, 0x058001 ) AM_WRITE(astrocorp_eeprom_w)
180   AM_RANGE( 0x05a000, 0x05a001 ) AM_WRITE(astrocorp_outputs_w)
273   AM_RANGE( 0x05a000, 0x05a001 ) AM_WRITE(showhand_outputs_w)
181274   AM_RANGE( 0x05e000, 0x05e001 ) AM_READ_PORT("EEPROMIN")
182   AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_BASE_MEMBER(astrocrp_state, paletteram)
183   AM_RANGE( 0x070000, 0x073fff ) AM_RAM
275   AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_BASE_MEMBER(astrocorp_state, paletteram)
276   AM_RANGE( 0x070000, 0x073fff ) AM_RAM AM_BASE_SIZE_GENERIC(nvram)   // battery
184277   AM_RANGE( 0x080000, 0x080001 ) AM_DEVWRITE("oki", astrocorp_sound_bank_w)
185278   AM_RANGE( 0x0a0000, 0x0a0001 ) AM_WRITE(astrocorp_enable_w)
186279   AM_RANGE( 0x0d0000, 0x0d0001 ) AM_READ(astrocorp_unk_r) AM_DEVWRITE8("oki", okim6295_w, 0xff00)
r7356r7357
188281
189282static ADDRESS_MAP_START( showhanc_map, ADDRESS_SPACE_PROGRAM, 16 )
190283   AM_RANGE( 0x000000, 0x01ffff ) AM_ROM
191   AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_BASE_MEMBER(astrocrp_state, paletteram)
284   AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_BASE_MEMBER(astrocorp_state, paletteram)
192285   AM_RANGE( 0x070000, 0x070001 ) AM_DEVWRITE("oki", astrocorp_sound_bank_w)
193   AM_RANGE( 0x080000, 0x080fff ) AM_RAM AM_BASE_SIZE_MEMBER(astrocrp_state, spriteram, spriteram_size)
194   AM_RANGE( 0x082000, 0x082001 ) AM_WRITENOP
286   AM_RANGE( 0x080000, 0x080fff ) AM_RAM AM_BASE_SIZE_MEMBER(astrocorp_state, spriteram, spriteram_size)
287   AM_RANGE( 0x082000, 0x082001 ) AM_WRITE(astrocorp_draw_sprites_w)
195288   AM_RANGE( 0x084000, 0x084001 ) AM_READ_PORT("INPUTS")
196289   AM_RANGE( 0x088000, 0x088001 ) AM_WRITE(astrocorp_eeprom_w)
197   AM_RANGE( 0x08a000, 0x08a001 ) AM_WRITE(astrocorp_outputs_w)
290   AM_RANGE( 0x08a000, 0x08a001 ) AM_WRITE(showhand_outputs_w)
198291   AM_RANGE( 0x08e000, 0x08e001 ) AM_READ_PORT("EEPROMIN")
199   AM_RANGE( 0x090000, 0x093fff ) AM_RAM
292   AM_RANGE( 0x090000, 0x093fff ) AM_RAM AM_BASE_SIZE_GENERIC(nvram)   // battery
200293   AM_RANGE( 0x0a0000, 0x0a0001 ) AM_WRITE(astrocorp_enable_w)
201294   AM_RANGE( 0x0e0000, 0x0e0001 ) AM_READ(astrocorp_unk_r) AM_DEVWRITE8("oki", okim6295_w, 0xff00)
202295ADDRESS_MAP_END
203296
297static ADDRESS_MAP_START( skilldrp_map, ADDRESS_SPACE_PROGRAM, 16 )
298   AM_RANGE( 0x000000, 0x03ffff ) AM_ROM
299   AM_RANGE( 0x200000, 0x200fff ) AM_RAM AM_BASE_SIZE_MEMBER(astrocorp_state, spriteram, spriteram_size)
300   AM_RANGE( 0x202000, 0x202001 ) AM_WRITE(astrocorp_draw_sprites_w)
301   AM_RANGE( 0x204000, 0x204001 ) AM_READ_PORT("INPUTS")
302   AM_RANGE( 0x208000, 0x208001 ) AM_WRITE(astrocorp_eeprom_w)
303   AM_RANGE( 0x20a000, 0x20a001 ) AM_WRITE(skilldrp_outputs_w)
304   AM_RANGE( 0x20e000, 0x20e001 ) AM_READ_PORT("EEPROMIN")
305   AM_RANGE( 0x380000, 0x3801ff ) AM_RAM_WRITE(astrocorp_palette_w) AM_BASE_MEMBER(astrocorp_state, paletteram)
306   AM_RANGE( 0x400000, 0x400001 ) AM_WRITE(astrocorp_enable_w)
307   AM_RANGE( 0x500000, 0x507fff ) AM_RAM AM_BASE_SIZE_GENERIC(nvram)   // battery
308   AM_RANGE( 0x580000, 0x580001 ) AM_DEVWRITE("oki", skilldrp_sound_bank_w)
309   AM_RANGE( 0x600000, 0x600001 ) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff)
310ADDRESS_MAP_END
311
204312/***************************************************************************
205313                                Input Ports
206314***************************************************************************/
r7356r7357
225333   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_SPECIAL   )   // coin sensor
226334
227335   PORT_START( "EEPROMIN" )
228   PORT_BIT( 0xfff7, IP_ACTIVE_LOW, IPT_UNUSED )
336   PORT_BIT( 0xfff7, IP_ACTIVE_LOW, IPT_UNUSED )
229337   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit)
230338
231339   PORT_START( "EEPROMOUT" )
232340   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit)
233341   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line)
234   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line)
342   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line)
235343INPUT_PORTS_END
236344
237345static INPUT_PORTS_START( showhanc )
r7356r7357
254362   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
255363
256364   PORT_START( "EEPROMIN" )
257   PORT_BIT( 0xfff7, IP_ACTIVE_LOW, IPT_UNUSED )
365   PORT_BIT( 0xfff7, IP_ACTIVE_LOW, IPT_UNUSED )
258366   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit)
259367
260368   PORT_START( "EEPROMOUT" )
261369   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit)
262370   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line)
263   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line)
371   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line)
264372INPUT_PORTS_END
265373
374static INPUT_PORTS_START( skilldrp )
375   PORT_START("INPUTS")   // 204000
376   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN1         )   PORT_IMPULSE(5)
377   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_GAMBLE_KEYOUT )
378   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_GAMBLE_TAKE   )
379   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_START3        )   PORT_NAME("Select / Double")
380   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_UNKNOWN       )
381   PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW )
382   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_GAMBLE_PAYOUT )
383   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_START1        )
384   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_OTHER         )   PORT_CODE(KEYCODE_T) PORT_NAME("Ticket Out")
385   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN       )
386   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN       )
387   PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_START2        )   PORT_NAME("Bet")
388   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r)   // ticket sw
389   PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_GAMBLE_BOOK   )
390   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("hopper", ticket_dispenser_line_r)   // hopper sw
391   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_GAMBLE_KEYIN  )
392
393   PORT_START( "EEPROMIN" )
394   PORT_BIT( 0xfff7, IP_ACTIVE_LOW,  IPT_UNUSED )
395   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit)
396
397   PORT_START( "EEPROMOUT" )
398   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit)
399   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_clock_line)
400   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line)
401INPUT_PORTS_END
402
266403/***************************************************************************
267404                                Graphics Layout
268405***************************************************************************/
r7356r7357
287424                                Machine Drivers
288425***************************************************************************/
289426
290static MACHINE_START( showhand )
291{
292   astrocrp_state *state = (astrocrp_state *)machine->driver_data;
293   state_save_register_global(machine, state->screen_enable);
294}
427static const UINT16 showhand_default_eeprom[15] =   {0x0001,0x0007,0x000a,0x0003,0x0000,0x0009,0x0003,0x0000,0x0002,0x0001,0x0000,0x0000,0x0000,0x0000,0x0000};
295428
296static MACHINE_RESET( showhand )
297{
298   astrocrp_state *state = (astrocrp_state *)machine->driver_data;
299   state->screen_enable = 0;
300}
301
302
303static const UINT16 showhand_default_eeprom[0x0f] =   {0x0001,0x0007,0x000a,0x0003,0x0000,0x0009,0x0003,0x0000,0x0002,0x0001,0x0000,0x0000,0x0000,0x0000,0x0000};
304
305429static MACHINE_DRIVER_START( showhand )
306430
307431   /* driver data */
308   MDRV_DRIVER_DATA(astrocrp_state)
432   MDRV_DRIVER_DATA(astrocorp_state)
309433
310434   /* basic machine hardware */
311435   MDRV_CPU_ADD("maincpu", M68000, XTAL_20MHz / 2)
312436   MDRV_CPU_PROGRAM_MAP(showhand_map)
313437   MDRV_CPU_VBLANK_INT("screen", irq4_line_hold)
314438
315   MDRV_MACHINE_START(showhand)
316   MDRV_MACHINE_RESET(showhand)
317
439   MDRV_NVRAM_HANDLER(generic_0fill)
318440   MDRV_EEPROM_93C46_ADD("eeprom")
319441   MDRV_EEPROM_DATA(showhand_default_eeprom, sizeof(showhand_default_eeprom))
320442
r7356r7357
329451   MDRV_GFXDECODE(astrocorp)
330452   MDRV_PALETTE_LENGTH(0x100)
331453
454   MDRV_VIDEO_START(astrocorp)
332455   MDRV_VIDEO_UPDATE(astrocorp)
333456
334457   /* sound hardware */
r7356r7357
347470MACHINE_DRIVER_END
348471
349472
473static INTERRUPT_GEN( skilldrp_irq )
474{
475   switch (cpu_getiloops(device))
476   {
477      case 0:   cpu_set_input_line(device, 4, HOLD_LINE);   break;   // sprites, sound, i/o
478      case 1:   cpu_set_input_line(device, 2, HOLD_LINE);   break;   // palette
479   }
480}
481
482static MACHINE_DRIVER_START( skilldrp )
483
484   /* driver data */
485   MDRV_DRIVER_DATA(astrocorp_state)
486
487   /* basic machine hardware */
488   MDRV_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2)   // JX-1689F1028N GRX586.V5
489   MDRV_CPU_PROGRAM_MAP(skilldrp_map)
490   MDRV_CPU_VBLANK_INT_HACK(skilldrp_irq, 2)
491
492   MDRV_NVRAM_HANDLER(generic_0fill)
493   MDRV_EEPROM_93C46_ADD("eeprom")
494
495   MDRV_TICKET_DISPENSER_ADD("ticket", 200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW )
496   MDRV_TICKET_DISPENSER_ADD("hopper", 200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW )
497
498   /* video hardware */
499   MDRV_SCREEN_ADD("screen", RASTER)
500   MDRV_SCREEN_REFRESH_RATE(58.846)
501   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
502   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
503   MDRV_SCREEN_SIZE(0x200, 0x100)
504   MDRV_SCREEN_VISIBLE_AREA(0, 0x200-1, 0, 0xf0-1)
505
506   MDRV_GFXDECODE(astrocorp)
507   MDRV_PALETTE_LENGTH(0x100)
508
509   MDRV_VIDEO_START(astrocorp)
510   MDRV_VIDEO_UPDATE(astrocorp)
511
512   /* sound hardware */
513   MDRV_SPEAKER_STANDARD_MONO("mono")
514
515   MDRV_SOUND_ADD("oki", OKIM6295, XTAL_24MHz/24)
516   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
517   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
518MACHINE_DRIVER_END
519
520
350521/***************************************************************************
351522                                ROMs Loading
352523***************************************************************************/
r7356r7357
441612   ROM_LOAD( "5.u43", 0x00000, 0x80000, CRC(d6b70f02) SHA1(5a94680594c1f06196fe3bcf7faf56e2ed576f01) )
442613ROM_END
443614
615/***************************************************************************
444616
617Skill Drop Georgia
618
619"Sep 13 2002 09:17:54" in code rom.
620
621AAI276832 on sticker
622
623***************************************************************************/
624
625ROM_START( skilldrp )
626   ROM_REGION( 0x40000, "maincpu", 0 )
627   ROM_LOAD16_WORD_SWAP( "7-skill_drop_g1.0s.bc133", 0x00000, 0x40000, CRC(f968b783) SHA1(1d693b1d460e659ca94aae8625ea26e120053f84) )
628
629   ROM_REGION( 0x200000, "sprites", 0 )
630   ROM_LOAD( "mx29f1610amc.u26", 0x000000, 0x200000, CRC(4fdac800) SHA1(bcafceb6c34866c474714347e23f9e819b5fcfa6) )
631
632   ROM_REGION( 0x80000, "oki", 0 )
633   ROM_LOAD( "5-skill_drop.bc52", 0x00000, 0x80000, CRC(a479e06d) SHA1(ee690d39188b8a43652c4aa5bf8267c1f6632d2f) )
634
635   ROM_REGION16_BE( 0x80, "eeprom", 0 )
636   ROM_LOAD( "skilldrp.nv", 0x00, 0x80, CRC(57886a3d) SHA1(bad8fa2ec2262ccb5ef8ec50959aec3f3bf8b90b) )
637ROM_END
638
445639static DRIVER_INIT( showhand )
446640{
447641#if 0
r7356r7357
471665#endif
472666}
473667
474GAME( 1999?, showhand, 0,        showhand, showhand, showhand, ROT0, "Astro Corp.", "Show Hand (Italy)", GAME_SUPPORTS_SAVE )
475GAME( 1999?, showhanc, showhand, showhanc, showhanc, showhanc, ROT0, "Astro Corp.", "Wang Pai Dui Jue",  GAME_SUPPORTS_SAVE )
668GAME( 1999?, showhand, 0,        showhand, showhand, showhand, ROT0, "Astro Corp.", "Show Hand (Italy)",  GAME_SUPPORTS_SAVE )
669GAME( 1999?, showhanc, showhand, showhanc, showhanc, showhanc, ROT0, "Astro Corp.", "Wang Pai Dui Jue",   GAME_SUPPORTS_SAVE )
670GAME( 2002,  skilldrp, 0,        skilldrp, skilldrp, 0,        ROT0, "Astro Corp.", "Skill Drop Georgia", GAME_SUPPORTS_SAVE )
src/mame/drivers/cshooter.c
r7356r7357
33 TS 01.05.2006:
44
55 - added sprites, bgmap reading and few ixes here and there
6   airraid and cshootre are a bit "playable" ;) without gfx
6   airraid and cshootere are a bit "playable" ;) without gfx
77
88
99Haze's notes :
r7356r7357
1414  - i can't decode the other gfx? rom
1515  - there don't seem to be any sprites / bg's in ram, interrupts?
1616  - palette? format isn't understood
17  - the other sets ('cshootre' and 'airraid') need decrypting ..
17  - the other sets ('cshootere' and 'airraid') need decrypting ..
1818    is the main one protected ? theres a 68705 on it
1919
2020
r7356r7357
658658   memory_set_bankptr(machine, "bank1",&memory_region(machine, "user1")[0]);
659659}
660660
661static DRIVER_INIT( cshootre )
661static DRIVER_INIT( cshootere )
662662{
663663   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
664664   int A;
r7356r7357
698698
699699
700700
701GAME( 1987, cshooter,  0,       cshooter, cshooter, cshooter, ROT270, "[Seibu Kaihatsu] (Taito license)",  "Cross Shooter (not encrypted)", GAME_NOT_WORKING | GAME_NO_SOUND )
702GAME( 1987, cshootere, cshooter, airraid, cshooter, cshootre, ROT270, "[Seibu Kaihatsu] (J.K.H. license)", "Cross Shooter (encrypted)", GAME_NOT_WORKING | GAME_NO_SOUND )
703GAME( 1987, airraid,   cshooter, airraid, cshooter, cshootre, ROT270, "Seibu Kaihatsu",                    "Air Raid (encrypted)", GAME_NOT_WORKING | GAME_NO_SOUND )
701GAME( 1987, cshooter,  0,       cshooter, cshooter, cshooter,  ROT270, "[Seibu Kaihatsu] (Taito license)",  "Cross Shooter (not encrypted)", GAME_NOT_WORKING | GAME_NO_SOUND )
702GAME( 1987, cshootere, cshooter, airraid, cshooter, cshootere, ROT270, "[Seibu Kaihatsu] (J.K.H. license)", "Cross Shooter (encrypted)", GAME_NOT_WORKING | GAME_NO_SOUND )
703GAME( 1987, airraid,   cshooter, airraid, cshooter, cshootere, ROT270, "Seibu Kaihatsu",                    "Air Raid (encrypted)", GAME_NOT_WORKING | GAME_NO_SOUND )
704704
src/mame/drivers/aerofgt.c
r7356r7357
778778   PORT_DIPSETTING(      0x0000, "5 Points" )
779779INPUT_PORTS_END
780780
781static INPUT_PORTS_START( spinlbru )
781static INPUT_PORTS_START( spinlbrku )
782782   PORT_INCLUDE(spinlbrk)
783783
784784   PORT_MODIFY("DSW")
r7356r7357
25022502
25032503
25042504GAME( 1990, spinlbrk, 0,        spinlbrk, spinlbrk, 0, ROT0,   "V-System Co.",     "Spinal Breakers (World)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
2505GAME( 1990, spinlbrku,spinlbrk, spinlbrk, spinlbru, 0, ROT0,   "V-System Co.",     "Spinal Breakers (US)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
2505GAME( 1990, spinlbrku,spinlbrk, spinlbrk, spinlbrku,0, ROT0,   "V-System Co.",     "Spinal Breakers (US)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
25062506GAME( 1990, spinlbrkj,spinlbrk, spinlbrk, spinlbrk, 0, ROT0,   "V-System Co.",     "Spinal Breakers (Japan)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
25072507GAME( 1991, pspikes,  0,        pspikes,  pspikes,  0, ROT0,   "Video System Co.", "Power Spikes (World)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
25082508GAME( 1991, pspikesk, pspikes,  pspikes,  pspikes,  0, ROT0,   "Video System Co.", "Power Spikes (Korea)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
src/mame/drivers/cliffhgr.c
r7356r7357
390390   PORT_BIT ( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
391391INPUT_PORTS_END
392392
393static INPUT_PORTS_START( cliffhga )
393static INPUT_PORTS_START( cliffhgra )
394394   PORT_START("BANK0")
395395   PORT_BIT ( 0x3F, IP_ACTIVE_LOW, IPT_UNUSED )
396396   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_SERVICE2 )   /* SW2 on CPU PCB */
r7356r7357
783783 *
784784 *************************************/
785785
786GAME( 1983, cliffhgr, 0,        cliffhgr, cliffhgr, cliff, ROT0, "Stern Electronics", "Cliff Hanger", 0)
787GAME( 1983, cliffhgra,cliffhgr, cliffhgr, cliffhga, cliff, ROT0, "Stern Electronics", "Cliff Hanger (Alt)", 0)
786GAME( 1983, cliffhgr, 0,        cliffhgr, cliffhgr,  cliff, ROT0, "Stern Electronics", "Cliff Hanger", 0)
787GAME( 1983, cliffhgra,cliffhgr, cliffhgr, cliffhgra, cliff, ROT0, "Stern Electronics", "Cliff Hanger (Alt)", 0)
788788GAME( 1983, goaltogo, 0,        cliffhgr, goaltogo, cliff, ROT0, "Stern Electronics", "Goal To Go", GAME_NOT_WORKING)
src/mame/drivers/battlnts.c
r7356r7357
139139   KONAMI8_B1_UNK(2)
140140INPUT_PORTS_END
141141
142static INPUT_PORTS_START( thehustj )
142static INPUT_PORTS_START( thehustlj )
143143   PORT_INCLUDE( battlnts )
144144
145145   PORT_MODIFY("DSW2")
r7356r7357
418418
419419GAME( 1987, battlnts,  0,        battlnts, battlnts, 0,        ROT90, "Konami", "Battlantis", GAME_SUPPORTS_SAVE )
420420GAME( 1987, battlntsj, battlnts, battlnts, battlnts, 0,        ROT90, "Konami", "Battlantis (Japan)", GAME_SUPPORTS_SAVE )
421GAME( 1987, rackemup,  0,        battlnts, thehustj, rackemup, ROT90, "Konami", "Rack 'em Up", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
422GAME( 1987, thehustl,  rackemup, battlnts, thehustj, 0,        ROT90, "Konami", "The Hustler (Japan version M)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
423GAME( 1987, thehustlj, rackemup, battlnts, thehustj, 0,        ROT90, "Konami", "The Hustler (Japan version J)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
421GAME( 1987, rackemup,  0,        battlnts, thehustlj,rackemup, ROT90, "Konami", "Rack 'em Up", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
422GAME( 1987, thehustl,  rackemup, battlnts, thehustlj,0,        ROT90, "Konami", "The Hustler (Japan version M)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
423GAME( 1987, thehustlj, rackemup, battlnts, thehustlj,0,        ROT90, "Konami", "The Hustler (Japan version J)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
src/mame/drivers/seibuspi.c
r7356r7357
25832583
25842584ROM_START( viprp1hk )
25852585   ROM_REGION32_LE(0x200000, "user1", 0)   /* i386 program */
2586   ROM_LOAD32_BYTE("seibu_1", 0x000000, 0x80000, CRC(283ba7b7) SHA1(28122e04b72f1163c69f3f845f6a493fdb6ed652) ) /* New Version or something different??? */
2586   ROM_LOAD32_BYTE("seibu_1", 0x000000, 0x80000, CRC(283ba7b7) SHA1(28122e04b72f1163c69f3f845f6a493fdb6ed652) ) /* Old Version, "=HONG KONG=" seems part of title */
25872587   ROM_LOAD32_BYTE("seibu_2", 0x000001, 0x80000, CRC(2c4db249) SHA1(a6372c9a3cde5f262ec5ef446945f6d3ad506e88) )
25882588   ROM_LOAD32_BYTE("seibu_3", 0x000002, 0x80000, CRC(91989503) SHA1(8c215fac200cc693396dbd57e0939e7efe883342) )
25892589   ROM_LOAD32_BYTE("seibu_4", 0x000003, 0x80000, CRC(12c9582d) SHA1(a79e26514e5ab8703a7a8c3ac39b359cfa4117c1) )
r7356r7357
34993499GAME( 1995, batlballu, senkyu,  spi,      spi_3button, batlball, ROT0,   "Seibu Kaihatsu (Fabtek License)", "Battle Balls (US)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
35003500
35013501GAME( 1995, viprp1,    0,       spi,      spi_3button, viprp1,  ROT270, "Seibu Kaihatsu", "Viper Phase 1 (World, New Version)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3502GAME( 1995, viprp1u,   viprp1,  spi,      spi_3button, viprp1o, ROT270, "Seibu Kaihatsu (Fabtek license)", "Viper Phase 1 (USA)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) /* New version, "=U.S.A=" seems part of title */
3502GAME( 1995, viprp1u,   viprp1,  spi,      spi_3button, viprp1o, ROT270, "Seibu Kaihatsu (Fabtek license)", "Viper Phase 1 (USA, New Version)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) /* New version, "=U.S.A=" seems part of title */
35033503GAME( 1995, viprp1j,   viprp1,  spi,      spi_3button, viprp1,  ROT270, "Seibu Kaihatsu", "Viper Phase 1 (Japan, New Version)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
35043504GAME( 1995, viprp1s,   viprp1,  spi,      spi_3button, viprp1,  ROT270, "Seibu Kaihatsu", "Viper Phase 1 (Switzerland, New Version)",  GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
35053505
src/mame/drivers/bfm_sc2.c
r7356r7357
44514451   ROM_LOAD("cpe1_snd.bin",  0x00000, 0x80000, CRC(ca8a56bb) SHA1(36434dae4369f004fa5b4dd00eb6b1a965be60f9))
44524452ROM_END
44534453
4454/*     year, name,     parent,    machine,       input,     init,       monitor, company,    fullname */
4454GAMEL( 1994, m_bdrwho, 0,         scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 1, UK, Game Card 95-750-288)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4455GAMEL( 1994, m_bdrwh1, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 2, UK, Game Card 95-750-661)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4456GAMEL( 1994, m_bdrwh2, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 3)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4457GAMEL( 1994, m_bdrwh3, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 4)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4458GAMEL( 1994, m_bdrwh4, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 5)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4459GAMEL( 1994, m_bdrwh5, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 6)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4460GAMEL( 1994, m_bdrwh6, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 7)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4461GAMEL( 1994, m_bdrwh7, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 8)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4462GAMEL( 1994, m_bdrwh8, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 9)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4463GAMEL( 1994, m_bdrwh9, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 10)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4464GAMEL( 1994, m_bdrw10, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 11)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4465GAMEL( 1994, m_bdrw11, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 12)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4466GAMEL( 1994, m_bdrw12, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 13)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4467GAMEL( 1994, m_bdrw13, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 14)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4468GAMEL( 1994, m_bdrw14, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 15)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4469GAMEL( 1994, m_bdrw15, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 16)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4470GAMEL( 1994, m_bdrw16, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 17)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4471GAMEL( 1994, m_bdrw17, m_bdrwho,  scorpion2,    drwho,      drwhon,      0,       "BFM",      "Dr.Who The Timelord (set 18, not encrypted)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
44554472
4456GAMEL( 1994, m_bdrwho, 0,        scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 1, UK, Game Card 95-750-288)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4457GAMEL( 1994, m_bdrwh1, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 2, UK, Game Card 95-750-661)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4458GAMEL( 1994, m_bdrwh2, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 3)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4459GAMEL( 1994, m_bdrwh3, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 4)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4460GAMEL( 1994, m_bdrwh4, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 5)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4461GAMEL( 1994, m_bdrwh5, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 6)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4462GAMEL( 1994, m_bdrwh6, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 7)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4463GAMEL( 1994, m_bdrwh7, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 8)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4464GAMEL( 1994, m_bdrwh8, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 9)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4465GAMEL( 1994, m_bdrwh9, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 10)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4466GAMEL( 1994, m_bdrw10, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 11)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4467GAMEL( 1994, m_bdrw11, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 12)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4468GAMEL( 1994, m_bdrw12, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 13)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4469GAMEL( 1994, m_bdrw13, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 14)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4470GAMEL( 1994, m_bdrw14, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 15)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4471GAMEL( 1994, m_bdrw15, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 16)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4472GAMEL( 1994, m_bdrw16, m_bdrwho,  scorpion2,    drwho,      drwho,      0,       "BFM",      "Dr.Who The Timelord (set 17)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4473GAMEL( 1994, m_bdrw17, m_bdrwho,  scorpion2,    drwho,      drwhon,      0,       "BFM",      "Dr.Who The Timelord (set 18, not encrypted)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK,layout_drwho)
4473GAME( 1994, m_brkfst, 0,          scorpion2,    bbrkfst,   bbrkfst,   0,       "BFM",      "The Big Breakfast (Set 1 UK, Game Card 95-750-524)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK|GAME_NOT_WORKING)
4474GAME( 1994, m_brkfs1, m_brkfst,     scorpion2,    bbrkfst,   bbrkfst,   0,       "BFM",      "The Big Breakfast (Set 2)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK|GAME_NOT_WORKING)
4475GAME( 1994, m_brkfs2, m_brkfst,     scorpion2,    bbrkfst,   bbrkfst,   0,       "BFM",      "The Big Breakfast (Set 3)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK|GAME_NOT_WORKING)
4476GAME( 1994, m_brkfs3, m_brkfst,     scorpion2,    bbrkfst,   bbrkfst,   0,       "BFM",      "The Big Breakfast (Set 4)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK|GAME_NOT_WORKING)
4477GAME( 1994, m_brkfs4, m_brkfst,     scorpion2,    bbrkfst,   bbrkfst,   0,       "BFM",      "The Big Breakfast (Set 5)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK|GAME_NOT_WORKING)
4478GAME( 1994, m_brkfs5, m_brkfst,     scorpion2,    bbrkfst,   bbrkfst,   0,       "BFM",      "The Big Breakfast (Set 6)", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK|GAME_NOT_WORKING)
44744479
4475GAME( 1994, m_brkfst, 0,        scorpion2,    bbrkfst,   bbrkfst,   0,       "BFM",      "The Big Breakfast (Set 1 UK, Game Card 95-750-524)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK|GAME_NOT_WORKING)
4476GAME( 1994, m_brkfs1, m_brkfst,     scorpion2,    bbrkfst,   bbrkfst,   0,       "BFM",      "The Big Breakfast (Set 2)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK|GAME_NOT_WORKING)
4477GAME( 1994, m_brkfs2, m_brkfst,     scorpion2,    bbrkfst,   bbrkfst,   0,       "BFM",      "The Big Breakfast (Set 3)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK|GAME_NOT_WORKING)
4478GAME( 1994, m_brkfs3, m_brkfst,     scorpion2,    bbrkfst,   bbrkfst,   0,       "BFM",      "The Big Breakfast (Set 4)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK|GAME_NOT_WORKING)
4479GAME( 1994, m_brkfs4, m_brkfst,     scorpion2,    bbrkfst,   bbrkfst,   0,       "BFM",      "The Big Breakfast (Set 5)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK|GAME_NOT_WORKING)
4480GAME( 1994, m_brkfs5, m_brkfst,     scorpion2,    bbrkfst,   bbrkfst,   0,       "BFM",      "The Big Breakfast (Set 6)",GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK|GAME_NOT_WORKING)
4481
4482GAME ( 1995, m_bfocus, 0,        scorpion3,    scorpion3,   focus,      0,       "BFM/ELAM", "Focus (Dutch, Game Card 95-750-347)", GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK)
4483
4484GAME ( 1996, m_bcgslm, 0,        scorpion2,    bfmcgslm,   bfmcgslm,   0,       "BFM",       "Club Grandslam (UK, Game Card 95-750-843)", GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK)
4485
4486GAME ( 1996, m_luvjub, 0,        scorpion2_dm01,luvjub,   luvjub,      0,       "BFM",       "Luvvly Jubbly (UK Multisite 10/25p, Game Card 95-750-808)", GAME_NOT_WORKING|GAME_REQUIRES_ARTWORK)
4487
4488GAME ( 1996, m_cpeno1, 0,        scorpion2_dm01,cpeno1,    cpeno1,     0,       "BFM",      "Club Public Enemy No.1 (UK, Game Card 95-750-846)", GAME_NOT_WORKING|GAME_REQUIRES_ARTWORK)
4480GAME( 1995, m_bfocus, 0,          scorpion3,    scorpion3,   focus,      0,       "BFM/ELAM", "Focus (Dutch, Game Card 95-750-347)", GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK)
4481GAME( 1996, m_bcgslm, 0,          scorpion2,    bfmcgslm,   bfmcgslm,   0,       "BFM",      "Club Grandslam (UK, Game Card 95-750-843)", GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK)
4482GAME( 1996, m_luvjub, 0,          scorpion2_dm01,luvjub,   luvjub,      0,       "BFM",      "Luvvly Jubbly (UK Multisite 10/25p, Game Card 95-750-808)", GAME_NOT_WORKING|GAME_REQUIRES_ARTWORK)
4483GAME( 1996, m_cpeno1, 0,     scorpion2_dm01,cpeno1,        cpeno1,         0,               "BFM",      "Club Public Enemy No.1 (UK, Game Card 95-750-846)", GAME_NOT_WORKING|GAME_REQUIRES_ARTWORK)
src/mame/drivers/megadriv.c
r7356r7357
7373#include "sound/upd7759.h"
7474#include "sound/fm.h"
7575#include "cpu/m68000/m68000.h"
76#include "megadriv.h"
76#include "includes/megadriv.h"
7777#include "cpu/sh2/sh2.h"
7878
7979#define MEGADRIV_VDP_VRAM(address) megadrive_vdp_vram[(address)&0x7fff]
src/mame/drivers/itech32.c
r7356r7357
40944094}
40954095
40964096
4097static DRIVER_INIT( gtclassp )
4097static DRIVER_INIT( gtclasscp )
40984098{
40994099   /* a little extra protection */
41004100   memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x680000, 0x680003, 0, 0, gtclass_prot_result_r);
r7356r7357
42274227GAME( 2000, gt2kt500, gt2k,     tourny,  gt98s, aamat,    ROT0, "Incredible Technologies", "Golden Tee 2K Tournament (v5.00)" , 0) /* PIC 16C54 labeled as ITGF2K */
42284228GAME( 2002, gtsuprem, gt2k,     tourny,  gt98s, aamat,    ROT0, "Incredible Technologies", "Golden Tee Supreme Edition Tournament (v5.10)" , 0) /* PIC 16C54 labeled as ITGF2K-I */
42294229
4230GAME( 2001, gtclassc, 0,        sftm,    aama,  aama,     ROT0, "Incredible Technologies", "Golden Tee Classic (v1.00)" , 0) /* PIC 16C54 labeled as ITGFCL */
4231GAME( 2001, gtclasscp, gtclassc, sftm,    aama,  gtclassp, ROT0, "Incredible Technologies", "Golden Tee Classic (v1.00) with Infinite Loop Protection" , 0) /* PIC 16C54 labeled as ITGFCL */
4230GAME( 2001, gtclassc,  0,        sftm,    aama,  aama,      ROT0, "Incredible Technologies", "Golden Tee Classic (v1.00)" , 0) /* PIC 16C54 labeled as ITGFCL */
4231GAME( 2001, gtclasscp, gtclassc, sftm,    aama,  gtclasscp, ROT0, "Incredible Technologies", "Golden Tee Classic (v1.00) with Infinite Loop Protection" , 0) /* PIC 16C54 labeled as ITGFCL */
42324232GAME( 2001, gtclasscs, gtclassc, sftm,    s_ver, s_ver,    ROT0, "Incredible Technologies", "Golden Tee Classic (v1.00S)" , 0) /* PIC 16C54 labeled as ITGFCL-M */
src/mame/drivers/astrof.c
r7356r7357
821821   PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
822822INPUT_PORTS_END
823823
824static INPUT_PORTS_START( spfgmk22 )
824static INPUT_PORTS_START( spfghmk22 )
825825   PORT_INCLUDE( astrof_common )
826826
827827   PORT_START("IN")
r7356r7357
935935   PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
936936INPUT_PORTS_END
937937
938static INPUT_PORTS_START( tomahaw1 )
938static INPUT_PORTS_START( tomahawk1 )
939939   PORT_INCLUDE( tomahawk )
940940
941941   PORT_MODIFY("DSW")
r7356r7357
13621362GAME( 1979, acombato, astrof,   abattle,  abattle,  afire,   ROT90, "bootleg",     "Astro Combat (older, PZ)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
13631363GAME( 1979, sstarbtl, astrof,   abattle,  abattle,  sstarbtl,ROT90, "bootleg",     "Super Star Battle", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
13641364GAME( 1979, spfghmk2, 0,        spfghmk2, spfghmk2, 0,       ROT90, "Data East",   "Space Fighter Mark II (set 1)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
1365GAME( 1979, spfghmk22,spfghmk2, spfghmk2, spfgmk22, 0,       ROT90, "Data East",   "Space Fighter Mark II (set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
1365GAME( 1979, spfghmk22,spfghmk2, spfghmk2, spfghmk22,0,       ROT90, "Data East",   "Space Fighter Mark II (set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
13661366GAME( 1980, tomahawk, 0,        tomahawk, tomahawk, 0,       ROT90, "Data East",   "Tomahawk 777 (rev 5)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1367GAME( 1980, tomahawk1,tomahawk, tomahawk, tomahaw1, 0,       ROT90, "Data East",   "Tomahawk 777 (rev 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1367GAME( 1980, tomahawk1,tomahawk, tomahawk, tomahawk1,0,       ROT90, "Data East",   "Tomahawk 777 (rev 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/galpanic.c
r7356r7357
7272    In the Comad games, the interruption is the same, but the addresses
7373    which are checked are in full RAM. So the Dip Switch could be checked.
7474
75  - I added the 'galpania' romset which is in fact the same as 'galpanic',
75  - I added the 'galpanica' romset which is in fact the same as 'galpanic',
7676    but with the PRG ROMS which aren't overwritten and simulated the CALC1
7777    MCU functions
7878    Here are a few notes about what I found :
r7356r7357
176176   }
177177}
178178
179static WRITE16_HANDLER( galpania_6295_bankswitch_w )
179static WRITE16_HANDLER( galpanica_6295_bankswitch_w )
180180{
181181   if (ACCESSING_BITS_8_15)
182182   {
r7356r7357
187187}
188188
189189#ifdef UNUSED_FUNCTION
190static WRITE16_HANDLER( galpania_misc_w )
190static WRITE16_HANDLER( galpanica_misc_w )
191191{
192192   running_device *pandora = devtag_get_device(machine, "pandora");
193193
r7356r7357
269269//  AM_RANGE(0x800006, 0x800007)    ??
270270   AM_RANGE(0x80000a, 0x80000b) AM_READ(kludge)   /* bits 8-a = timer? palette update code waits for them to be 111 */
271271   AM_RANGE(0x80000c, 0x80000d) AM_READ(kludge)   /* missw96 bits 8-a = timer? palette update code waits for them to be 111 */
272   AM_RANGE(0x900000, 0x900001) AM_WRITE(galpania_6295_bankswitch_w)   /* not sure */
272   AM_RANGE(0x900000, 0x900001) AM_WRITE(galpanica_6295_bankswitch_w)   /* not sure */
273273   AM_RANGE(0xc00000, 0xc0ffff) AM_RAM            /* missw96 */
274274   AM_RANGE(0xc80000, 0xc8ffff) AM_RAM            /* fantasia, newfant */
275275   AM_RANGE(0xf00000, 0xf00001) AM_DEVREADWRITE8("oki", comad_okim6295_r, okim6295_w, 0xff00)   /* fantasia, missw96 */
r7356r7357
287287   AM_RANGE(0x800004, 0x800005) AM_READ_PORT("SYSTEM")
288288//  AM_RANGE(0x800006, 0x800007)    ??
289289   AM_RANGE(0x800008, 0x800009) AM_READ(kludge)   /* bits 8-a = timer? palette update code waits for them to be 111 */
290   AM_RANGE(0x900000, 0x900001) AM_WRITE(galpania_6295_bankswitch_w)   /* not sure */
290   AM_RANGE(0x900000, 0x900001) AM_WRITE(galpanica_6295_bankswitch_w)   /* not sure */
291291   AM_RANGE(0xa00000, 0xa00001) AM_WRITENOP   /* coin counters, + ? */
292292   AM_RANGE(0xc80000, 0xc80001) AM_DEVREADWRITE8("oki", comad_okim6295_r, okim6295_w, 0xff00)
293293   AM_RANGE(0xf80000, 0xf8ffff) AM_RAM
r7356r7357
307307   AM_RANGE(0x800000, 0x800001) AM_READ_PORT("DSW1_P1")
308308   AM_RANGE(0x800002, 0x800003) AM_READ_PORT("DSW2_P2")
309309   AM_RANGE(0x800004, 0x800005) AM_READ_PORT("SYSTEM")
310   AM_RANGE(0x900000, 0x900001) AM_WRITE(galpania_6295_bankswitch_w)
310   AM_RANGE(0x900000, 0x900001) AM_WRITE(galpanica_6295_bankswitch_w)
311311   AM_RANGE(0xa00000, 0xa00001) AM_WRITENOP // ?
312312   AM_RANGE(0xd00000, 0xd00001) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0xff00)
313313   AM_RANGE(0xe80000, 0xe8ffff) AM_RAM
r7356r7357
334334   AM_RANGE(0x800002, 0x800003) AM_READ_PORT("DSW2_P2")
335335   AM_RANGE(0x800004, 0x800005) AM_READ_PORT("SYSTEM")
336336
337   AM_RANGE(0x900000, 0x900001) AM_WRITE(galpania_6295_bankswitch_w)
337   AM_RANGE(0x900000, 0x900001) AM_WRITE(galpanica_6295_bankswitch_w)
338338
339339   AM_RANGE(0xc00000, 0xc00001) AM_DEVREADWRITE8("oki", comad_okim6295_r, okim6295_w, 0xff00)
340340
r7356r7357
355355   AM_RANGE(0x800004, 0x800005) AM_READ_PORT("SYSTEM")
356356   AM_RANGE(0x800006, 0x800007) AM_READ(kludge)
357357   AM_RANGE(0x800008, 0x800009) AM_READ(kludge)
358   AM_RANGE(0x900000, 0x900001) AM_WRITE(galpania_6295_bankswitch_w)   /* not sure */
358   AM_RANGE(0x900000, 0x900001) AM_WRITE(galpanica_6295_bankswitch_w)   /* not sure */
359359   AM_RANGE(0xa00000, 0xa00001) AM_WRITENOP
360360   AM_RANGE(0xc80000, 0xc8ffff) AM_RAM
361361   AM_RANGE(0xd80000, 0xd80001) AM_WRITENOP
r7356r7357
485485   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
486486INPUT_PORTS_END
487487
488static INPUT_PORTS_START( galpania )
488static INPUT_PORTS_START( galpanica )
489489   PORT_START("DSW1_P1")
490490   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) )
491491   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
r7356r7357
915915MACHINE_DRIVER_END
916916
917917
918static MACHINE_DRIVER_START( galpania )
918static MACHINE_DRIVER_START( galpanica )
919919
920920   /* basic machine hardware */
921921   MDRV_IMPORT_FROM(galpanic)
r7356r7357
13201320ROM_END
13211321
13221322GAME( 1990, galpanic, 0,        galpanic, galpanic, 0, ROT90, "Kaneko", "Gals Panic (Unprotected)", GAME_NO_COCKTAIL )
1323GAME( 1990, galpanica,galpanic, galpania, galpania, 0, ROT90, "Kaneko", "Gals Panic (MCU Protected)", GAME_NO_COCKTAIL )
1323GAME( 1990, galpanica,galpanic, galpanica,galpanica,0, ROT90, "Kaneko", "Gals Panic (MCU Protected)", GAME_NO_COCKTAIL )
13241324GAME( 1994, supmodel, 0,        supmodel, fantasia, 0, ROT90, "Comad & New Japan System", "Super Model",GAME_NO_COCKTAIL ) // 'official' or hack of fantasia?
13251325GAME( 1995, newfant,  0,        comad,    fantasia, 0, ROT90, "Comad & New Japan System", "New Fantasia", GAME_NO_COCKTAIL )
13261326GAME( 1995, fantsy95, 0,        comad,    fantasia, 0, ROT90, "Hi-max Technology Inc.", "Fantasy '95", GAME_NO_COCKTAIL )
src/mame/drivers/finalizr.c
r7356r7357
66
77    2009-03:
88    Added dsw locations and verified factory setting based on Guru's notes
9    (actually for finalizr only, finalizb locations assumed to be the same)
9    (actually for finalizr only, finalizrb locations assumed to be the same)
1010
1111***************************************************************************/
1212
r7356r7357
193193   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
194194INPUT_PORTS_END
195195
196static INPUT_PORTS_START( finalizb )
196static INPUT_PORTS_START( finalizrb )
197197   PORT_INCLUDE( finalizr )
198198
199199   PORT_MODIFY("DSW2")
r7356r7357
374374}
375375
376376
377GAME( 1985, finalizr,  0,        finalizr, finalizr, finalizr, ROT90, "Konami", "Finalizer - Super Transformation", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
378GAME( 1985, finalizrb, finalizr, finalizr, finalizb, finalizr, ROT90, "bootleg", "Finalizer - Super Transformation (bootleg)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
377GAME( 1985, finalizr,  0,        finalizr, finalizr,  finalizr, ROT90, "Konami",  "Finalizer - Super Transformation", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
378GAME( 1985, finalizrb, finalizr, finalizr, finalizrb, finalizr, ROT90, "bootleg", "Finalizer - Super Transformation (bootleg)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/segaorun.c
r7356r7357
270270
271271#include "emu.h"
272272#include "cpu/z80/z80.h"
273#include "includes/system16.h"
273#include "includes/segas16.h"
274274#include "machine/fd1089.h"
275275#include "machine/segaic16.h"
276276#include "machine/8255ppi.h"
277277#include "cpu/m68000/m68000.h"
278278#include "sound/2151intf.h"
279279#include "sound/segapcm.h"
280#include "video/segaic16.h"
280281
281282#include "outrun.lh"
282283
r7356r7357
296297static UINT16 *workram;
297298static UINT16 *cpu1ram, *cpu1rom;
298299
299static UINT8 adc_select;
300
301static UINT8 irq2_state;
302static UINT8 vblank_irq_state;
303
304static read16_space_func custom_io_r;
305static write16_space_func custom_io_w;
306
307static const UINT8 *custom_map;
308
309
310
311300/*************************************
312301 *
313302 *  Prototypes
r7356r7357
376365
377366static TIMER_CALLBACK( delayed_sound_data_w )
378367{
379   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
368   segas1x_state *state = (segas1x_state *)machine->driver_data;
369   const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
380370   soundlatch_w(space, 0, param);
381   cputag_set_input_line(machine, "soundcpu", INPUT_LINE_NMI, ASSERT_LINE);
371   cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, ASSERT_LINE);
382372}
383373
384374
r7356r7357
390380
391381static READ8_HANDLER( sound_data_r )
392382{
393   cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, CLEAR_LINE);
394   return soundlatch_r(space,offset);
383   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
384
385   cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, CLEAR_LINE);
386   return soundlatch_r(space, offset);
395387}
396388
397389
398390
399391static void outrun_generic_init(running_machine *machine)
400392{
393   segas1x_state *state = (segas1x_state *)machine->driver_data;
394
401395   /* allocate memory for regions not automatically assigned */
402396   segaic16_spriteram_0 = auto_alloc_array(machine, UINT16, 0x01000/2);
403397   segaic16_paletteram  = auto_alloc_array(machine, UINT16, 0x02000/2);
r7356r7357
412406   fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted);
413407
414408   /* reset the custom handlers and other pointers */
415   custom_io_r = NULL;
416   custom_io_w = NULL;
417   custom_map = NULL;
409   state->custom_io_r = NULL;
410   state->custom_io_w = NULL;
411   state->custom_map = NULL;
412
413   state->maincpu = devtag_get_device(machine, "maincpu");
414   state->soundcpu = devtag_get_device(machine, "soundcpu");
415   state->subcpu = devtag_get_device(machine, "sub");
416   state->ppi8255 = devtag_get_device(machine, "ppi8255");
417
418   state_save_register_global(machine, state->adc_select);
419   state_save_register_global(machine, state->vblank_irq_state);
420   state_save_register_global(machine, state->irq2_state);
421   state_save_register_global_pointer(machine, segaic16_spriteram_0, 0x01000/2);
422   state_save_register_global_pointer(machine, segaic16_paletteram,  0x02000/2);
423   state_save_register_global_pointer(machine, segaic16_tileram_0,   0x10000/2);
424   state_save_register_global_pointer(machine, segaic16_textram_0,   0x01000/2);
425   state_save_register_global_pointer(machine, workram,              0x08000/2);
418426}
419427
420428
r7356r7357
427435
428436static void update_main_irqs(running_machine *machine)
429437{
430   cputag_set_input_line(machine, "maincpu", 2, irq2_state ? ASSERT_LINE : CLEAR_LINE);
431   cputag_set_input_line(machine, "maincpu", 4, vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
432   cputag_set_input_line(machine, "maincpu", 6, vblank_irq_state && irq2_state ? ASSERT_LINE : CLEAR_LINE);
438   segas1x_state *state = (segas1x_state *)machine->driver_data;
433439
434   if(vblank_irq_state || irq2_state)
440   cpu_set_input_line(state->maincpu, 2, state->irq2_state ? ASSERT_LINE : CLEAR_LINE);
441   cpu_set_input_line(state->maincpu, 4, state->vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
442   cpu_set_input_line(state->maincpu, 6, state->vblank_irq_state && state->irq2_state ? ASSERT_LINE : CLEAR_LINE);
443
444   if (state->vblank_irq_state || state->irq2_state)
435445      cpuexec_boost_interleave(machine, attotime_zero, ATTOTIME_IN_USEC(100));
436446}
437447
438448
439449static TIMER_CALLBACK( irq2_gen )
440450{
451   segas1x_state *state = (segas1x_state *)machine->driver_data;
452
441453   /* set the IRQ2 line */
442   irq2_state = 1;
454   state->irq2_state = 1;
443455   update_main_irqs(machine);
444456}
445457
446458
447459static TIMER_CALLBACK( scanline_callback )
448460{
461   segas1x_state *state = (segas1x_state *)machine->driver_data;
449462   int scanline = param;
450463   int next_scanline = scanline;
451464
r7356r7357
464477      case 66:
465478      case 130:
466479      case 194:
467         irq2_state = 0;
480         state->irq2_state = 0;
468481         next_scanline = (scanline == 194) ? 223 : (scanline + 63);
469482         break;
470483
471484      /* VBLANK triggers on scanline 223 */
472485      case 223:
473         vblank_irq_state = 1;
486         state->vblank_irq_state = 1;
474487         next_scanline = scanline + 1;
475         cputag_set_input_line(machine, "sub", 4, ASSERT_LINE);
488         cpu_set_input_line(state->subcpu, 4, ASSERT_LINE);
476489         break;
477490
478491      /* VBLANK turns off at the start of scanline 224 */
479492      case 224:
480         vblank_irq_state = 0;
493         state->vblank_irq_state = 0;
481494         next_scanline = 65;
482         cputag_set_input_line(machine, "sub", 4, CLEAR_LINE);
495         cpu_set_input_line(state->subcpu, 4, CLEAR_LINE);
483496         break;
484497   }
485498
r7356r7357
500513
501514static void outrun_reset(running_device *device)
502515{
503   cputag_set_input_line(device->machine, "sub", INPUT_LINE_RESET, PULSE_LINE);
516   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
517   cpu_set_input_line(state->subcpu, INPUT_LINE_RESET, PULSE_LINE);
504518}
505519
506520
507521static MACHINE_RESET( outrun )
508522{
523   segas1x_state *state = (segas1x_state *)machine->driver_data;
509524   fd1094_machine_init(devtag_get_device(machine, "maincpu"));
510525
511526   /* reset misc components */
512527   segaic16_memory_mapper_reset(machine);
513   if (custom_map)
514      segaic16_memory_mapper_config(machine, custom_map);
528   if (state->custom_map)
529      segaic16_memory_mapper_config(machine, state->custom_map);
515530   segaic16_tilemap_reset(machine, 0);
516531
517532   /* hook the RESET line, which resets CPU #1 */
r7356r7357
531546
532547static void log_unknown_ppi_read( running_machine *machine, unsigned port )
533548{
549   segas1x_state *state = (segas1x_state *)machine->driver_data;
534550   static const char ports[] = "ABC";
535551
536   logerror("%06X:read from 8255 port %c\n", cpu_get_pc(devtag_get_device(machine, "maincpu")), ports[port]);
552   logerror("%06X:read from 8255 port %c\n", cpu_get_pc(state->maincpu), ports[port]);
537553}
538554
539555
540556static void log_unknown_ppi_write( running_machine *machine, unsigned port, UINT8 data )
541557{
558   segas1x_state *state = (segas1x_state *)machine->driver_data;
542559   static const char ports[] = "ABC";
543560
544   logerror("%06X:write %02X to 8255 port %c\n", cpu_get_pc(devtag_get_device(machine, "maincpu")), data, ports[port]);
561   logerror("%06X:write %02X to 8255 port %c\n", cpu_get_pc(state->maincpu), data, ports[port]);
545562}
546563
547564
r7356r7357
580597
581598static WRITE8_DEVICE_HANDLER( video_control_w )
582599{
600   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
601
583602   /* Output port:
584603        D7: SG1 -- connects to sprite chip
585604        D6: SG0 -- connects to mixing
r7356r7357
589608        D0: Sound section reset (1= normal operation, 0= reset)
590609    */
591610   segaic16_set_display_enable(device->machine, data & 0x20);
592   adc_select = (data >> 2) & 7;
593   cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
611   state->adc_select = (data >> 2) & 7;
612   cpu_set_input_line(state->soundcpu, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
594613}
595614
596615
r7356r7357
603622
604623static READ16_HANDLER( misc_io_r )
605624{
606   if (custom_io_r)
607      return custom_io_r(space, offset, mem_mask);
625   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
626
627   if (state->custom_io_r)
628      return state->custom_io_r(space, offset, mem_mask);
608629   logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(space->cpu), offset * 2);
609   return segaic16_open_bus_r(space,0,mem_mask);
630   return segaic16_open_bus_r(space, 0, mem_mask);
610631}
611632
612633
613634static WRITE16_HANDLER( misc_io_w )
614635{
615   if (custom_io_w)
636   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
637
638   if (state->custom_io_w)
616639   {
617      custom_io_w(space, offset, data, mem_mask);
640      state->custom_io_w(space, offset, data, mem_mask);
618641      return;
619642   }
620643   logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(space->cpu), offset * 2, data, mem_mask);
r7356r7357
623646
624647static READ16_HANDLER( outrun_custom_io_r )
625648{
649   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
650
626651   offset &= 0x7f/2;
627652   switch (offset & 0x70/2)
628653   {
629654      case 0x00/2:
630         return ppi8255_r(devtag_get_device(space->machine, "ppi8255"), offset & 3);
655         return ppi8255_r(state->ppi8255, offset & 3);
631656
632657      case 0x10/2:
633658      {
r7356r7357
638663      case 0x30/2:
639664      {
640665         static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7" };
641         return input_port_read_safe(space->machine, ports[adc_select], 0x0010);
666         return input_port_read_safe(space->machine, ports[state->adc_select], 0x0010);
642667      }
643668
644669      case 0x60/2:
r7356r7357
646671   }
647672
648673   logerror("%06X:outrun_custom_io_r - unknown read access to address %04X\n", cpu_get_pc(space->cpu), offset * 2);
649   return segaic16_open_bus_r(space,0,mem_mask);
674   return segaic16_open_bus_r(space, 0, mem_mask);
650675}
651676
652677
653678static WRITE16_HANDLER( outrun_custom_io_w )
654679{
680   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
681
655682   offset &= 0x7f/2;
656683   switch (offset & 0x70/2)
657684   {
658685      case 0x00/2:
659686         if (ACCESSING_BITS_0_7)
660            ppi8255_w(devtag_get_device(space->machine, "ppi8255"), offset & 3, data);
687            ppi8255_w(state->ppi8255, offset & 3, data);
661688         return;
662689
663690      case 0x20/2:
r7356r7357
689716
690717static READ16_HANDLER( shangon_custom_io_r )
691718{
719   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
720
692721   offset &= 0x303f/2;
693722   switch (offset)
694723   {
r7356r7357
704733      case 0x3020/2:
705734      {
706735         static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
707         return input_port_read_safe(space->machine, ports[adc_select], 0x0010);
736         return input_port_read_safe(space->machine, ports[state->adc_select], 0x0010);
708737      }
709738   }
710739   logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(space->cpu), offset * 2);
r7356r7357
714743
715744static WRITE16_HANDLER( shangon_custom_io_w )
716745{
746   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
747
717748   offset &= 0x303f/2;
718749   switch (offset)
719750   {
r7356r7357
722753                D7-D6: (ADC1-0)
723754                D5: Screen display
724755            */
725         adc_select = (data >> 6) & 3;
756         state->adc_select = (data >> 6) & 3;
726757         segaic16_set_display_enable(space->machine, (data >> 5) & 1);
727758         return;
728759
r7356r7357
730761         /* Output port:
731762                D0: Sound section reset (1= normal operation, 0= reset)
732763            */
733         cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
764         cpu_set_input_line(state->soundcpu, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
734765         return;
735766
736767      case 0x3000/2:
737         watchdog_reset_w(space,0,0);
768         watchdog_reset_w(space, 0, 0);
738769         return;
739770
740771      case 0x3020/2:
r7356r7357
10611092
10621093static MACHINE_DRIVER_START( outrundx )
10631094
1095   /* driver data */
1096   MDRV_DRIVER_DATA(segas1x_state)
1097
10641098   /* basic machine hardware */
10651099   MDRV_CPU_ADD("maincpu", M68000, MASTER_CLOCK/4)
10661100   MDRV_CPU_PROGRAM_MAP(outrun_map)
r7356r7357
20812115
20822116static DRIVER_INIT( outrun )
20832117{
2118   segas1x_state *state = (segas1x_state *)machine->driver_data;
2119
20842120   outrun_generic_init(machine);
2085   custom_io_r = outrun_custom_io_r;
2086   custom_io_w = outrun_custom_io_w;
2121   state->custom_io_r = outrun_custom_io_r;
2122   state->custom_io_w = outrun_custom_io_w;
20872123}
20882124
20892125
20902126static DRIVER_INIT( outrunb )
20912127{
2128   segas1x_state *state = (segas1x_state *)machine->driver_data;
20922129   static const UINT8 memory_map[] = { 0x02,0x00,0x0d,0x10,0x00,0x12,0x0c,0x13,0x08,0x14,0x0f,0x20,0x00,0x00,0x00,0x00 };
20932130   UINT16 *word;
20942131   UINT8 *byte;
20952132   int i, length;
20962133
20972134   outrun_generic_init(machine);
2098   custom_map = memory_map;
2099   custom_io_r = outrun_custom_io_r;
2100   custom_io_w = outrun_custom_io_w;
2135   state->custom_map = memory_map;
2136   state->custom_io_r = outrun_custom_io_r;
2137   state->custom_io_w = outrun_custom_io_w;
21012138
21022139   /* main CPU: swap bits 11,12 and 6,7 */
21032140   word = (UINT16 *)memory_region(machine, "maincpu");
r7356r7357
21322169
21332170static DRIVER_INIT( shangon )
21342171{
2172   segas1x_state *state = (segas1x_state *)machine->driver_data;
2173
21352174   outrun_generic_init(machine);
2136   custom_io_r = shangon_custom_io_r;
2137   custom_io_w = shangon_custom_io_w;
2175   state->custom_io_r = shangon_custom_io_r;
2176   state->custom_io_w = shangon_custom_io_w;
21382177}
21392178
21402179
21412180static DRIVER_INIT( shangon3 )
21422181{
2182   segas1x_state *state = (segas1x_state *)machine->driver_data;
2183
21432184   outrun_generic_init(machine);
21442185   fd1089b_decrypt(machine);
2145   custom_io_r = shangon_custom_io_r;
2146   custom_io_w = shangon_custom_io_w;
2186   state->custom_io_r = shangon_custom_io_r;
2187   state->custom_io_w = shangon_custom_io_w;
21472188}
21482189
21492190
src/mame/drivers/gticlub.c
r7356r7357
228228#include "machine/k056230.h"
229229#include "machine/k033906.h"
230230#include "sound/rf5c400.h"
231#include "sound/k056800.h"
231232#include "video/voodoo.h"
232233#include "video/gticlub.h"
234#include "video/konicdev.h"
235
233236#include "rendlay.h"
234#include "sound/k056800.h"
235237
236238static UINT32 *work_ram;
237239
238240UINT8 gticlub_led_reg0;
239241UINT8 gticlub_led_reg1;
240242
241int K001604_vh_start(running_machine *machine, int chip);
242void K001604_draw_front_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect);
243void K001604_draw_back_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect);
244READ32_HANDLER(K001604_tile_r);
245READ32_HANDLER(K001604_char_r);
246WRITE32_HANDLER(K001604_tile_w);
247WRITE32_HANDLER(K001604_char_w);
248WRITE32_HANDLER(K001604_reg_w);
249READ32_HANDLER(K001604_reg_r);
250243
251
252
253244static WRITE32_HANDLER( paletteram32_w )
254245{
255246   COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
r7356r7357
267258   cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ1, param ? ASSERT_LINE : CLEAR_LINE);
268259}
269260
270static VIDEO_START( hangplt )
271{
272   K001604_vh_start(machine, 0);
273   K001604_vh_start(machine, 1);
274}
275
276
277261static VIDEO_UPDATE( hangplt )
278262{
279263   bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
280264
281265   if (strcmp(screen->tag, "lscreen") == 0)
282266   {
267      running_device *k001604 = devtag_get_device(screen->machine, "k001604_1");
283268      running_device *voodoo = devtag_get_device(screen->machine, "voodoo0");
284269
285   //  K001604_draw_back_layer(bitmap, cliprect);
270   //  k001604_draw_back_layer(k001604, bitmap, cliprect);
286271
287272      voodoo_update(voodoo, bitmap, cliprect);
288273
289      K001604_draw_front_layer(0, bitmap, cliprect);
274      k001604_draw_front_layer(k001604, bitmap, cliprect);
290275   }
291276   else if (strcmp(screen->tag, "rscreen") == 0)
292277   {
278      running_device *k001604 = devtag_get_device(screen->machine, "k001604_2");
293279      running_device *voodoo = devtag_get_device(screen->machine, "voodoo1");
294280
295   //  K001604_draw_back_layer(bitmap, cliprect);
281   //  k001604_draw_back_layer(k001604, bitmap, cliprect);
296282
297283      voodoo_update(voodoo, bitmap, cliprect);
298284
299      K001604_draw_front_layer(1, bitmap, cliprect);
285      k001604_draw_front_layer(k001604, bitmap, cliprect);
300286   }
301287
302288   draw_7segment_led(bitmap, 3, 3, gticlub_led_reg0);
r7356r7357
305291   return 0;
306292}
307293
294static READ32_HANDLER( gticlub_k001604_tile_r )
295{
296   running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1");
297   return k001604_tile_r(k001604, offset, mem_mask);
298}
299
300static WRITE32_HANDLER( gticlub_k001604_tile_w )
301{
302   running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1");
303   k001604_tile_w(k001604, offset, data, mem_mask);
304}
305
306
307static READ32_HANDLER( gticlub_k001604_char_r )
308{
309   running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1");
310   return k001604_char_r(k001604, offset, mem_mask);
311}
312
313static WRITE32_HANDLER( gticlub_k001604_char_w )
314{
315   running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1");
316   k001604_char_w(k001604, offset, data, mem_mask);
317}
318
319static READ32_HANDLER( gticlub_k001604_reg_r )
320{
321   running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1");
322   return k001604_reg_r(k001604, offset, mem_mask);
323}
324
325static WRITE32_HANDLER( gticlub_k001604_reg_w )
326{
327   running_device *k001604 = devtag_get_device(space->machine, get_cgboard_id() ? "k001604_2" : "k001604_1");
328   k001604_reg_w(k001604, offset, data, mem_mask);
329}
330
331
308332/******************************************************************/
309333
310334/* 93C56 EEPROM */
r7356r7357
406430
407431static ADDRESS_MAP_START( gticlub_map, ADDRESS_SPACE_PROGRAM, 32 )
408432   AM_RANGE(0x00000000, 0x000fffff) AM_RAM AM_BASE(&work_ram)      /* Work RAM */
409   AM_RANGE(0x74000000, 0x740000ff) AM_READWRITE(K001604_reg_r, K001604_reg_w)
433   AM_RANGE(0x74000000, 0x740000ff) AM_READWRITE(gticlub_k001604_reg_r, gticlub_k001604_reg_w)
410434   AM_RANGE(0x74010000, 0x7401ffff) AM_RAM_WRITE(paletteram32_w) AM_BASE_GENERIC(paletteram)
411   AM_RANGE(0x74020000, 0x7403ffff) AM_READWRITE(K001604_tile_r, K001604_tile_w)
412   AM_RANGE(0x74040000, 0x7407ffff) AM_READWRITE(K001604_char_r, K001604_char_w)
435   AM_RANGE(0x74020000, 0x7403ffff) AM_READWRITE(gticlub_k001604_tile_r, gticlub_k001604_tile_w)
436   AM_RANGE(0x74040000, 0x7407ffff) AM_READWRITE(gticlub_k001604_char_r, gticlub_k001604_char_w)
413437   AM_RANGE(0x78000000, 0x7800ffff) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc)
414438   AM_RANGE(0x78040000, 0x7804000f) AM_READWRITE(K001006_0_r, K001006_0_w)
415439   AM_RANGE(0x78080000, 0x7808000f) AM_READWRITE(K001006_1_r, K001006_1_w)
r7356r7357
757781   1
758782};
759783
784static const k001604_interface gticlub_k001604_intf =
785{
786   1, 2,   /* gfx index 1 & 2 */
787   1, 1,      /* layer_size, roz_size */
788   0      /* slrasslt hack */
789};
760790
791static const k001604_interface slrasslt_k001604_intf =
792{
793   1, 2,   /* gfx index 1 & 2 */
794   0, 0,      /* layer_size, roz_size */
795   1      /* slrasslt hack */
796};
797
798static const k001604_interface hangplt_k001604_intf_l =
799{
800   1, 2,   /* gfx index 1 & 2 */
801   0, 1,      /* layer_size, roz_size */
802   0      /* slrasslt hack */
803};
804
805static const k001604_interface hangplt_k001604_intf_r =
806{
807   3, 4,   /* gfx index 1 & 2 */
808   0, 1,      /* layer_size, roz_size */
809   0      /* slrasslt hack */
810};
811
812
761813static MACHINE_RESET( gticlub )
762814{
763815   cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE);
r7356r7357
800852   MDRV_VIDEO_START(gticlub)
801853   MDRV_VIDEO_UPDATE(gticlub)
802854
855   MDRV_K001604_ADD("k001604_1", gticlub_k001604_intf)
856
803857   MDRV_K056800_ADD("k056800", gticlub_k056800_interface)
804858
805859   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r7356r7357
826880
827881   MDRV_DEVICE_REMOVE("adc1038")
828882   MDRV_ADC1038_ADD("adc1038", thunderh_adc1038_intf)
883
884   MDRV_DEVICE_REMOVE("k001604_1")
885   MDRV_K001604_ADD("k001604_1", slrasslt_k001604_intf)
829886MACHINE_DRIVER_END
830887
831888
r7356r7357
902959   MDRV_SCREEN_SIZE(512, 384)
903960   MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 383)
904961
905   MDRV_VIDEO_START(hangplt)
906962   MDRV_VIDEO_UPDATE(hangplt)
907963
964   MDRV_K001604_ADD("k001604_1", hangplt_k001604_intf_l)
965   MDRV_K001604_ADD("k001604_2", hangplt_k001604_intf_r)
966
908967   MDRV_K056800_ADD("k056800", gticlub_k056800_interface)
909968
910969   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
src/mame/drivers/acefruit.c
r7356r7357
402402   PORT_BIT( 0xf4, IP_ACTIVE_LOW, IPT_UNKNOWN )
403403INPUT_PORTS_END
404404
405/* I've only mapped the known inputs after comparaison with 'spellbnd' and the ones known to do something */
405/* I've only mapped the known inputs after comparison with 'spellbnd' and the ones known to do something */
406406static INPUT_PORTS_START( starspnr )
407407   PORT_START("IN0")   // 0
408408   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Gamble" )
src/mame/drivers/dkong.c
r7356r7357
3737  Couriersud: 11/2007
3838
3939    - Added configuration switch to change palette between TKG02 (radarscp conversion) and TKG04 (dkong 2board)
40    - Added speech support (samples) to radarsc1
40    - Added speech support (samples) to radarscp1
4141    - Hooked up and written 8257 dma controller
4242        All dkong and dkongjr based games now use the 8257
4343        All epos and 2650 based games now use the 8257
r7356r7357
448448    state->hardware_type = HARDWARE_TRS02;
449449}
450450
451static MACHINE_START( radarsc1 )
451static MACHINE_START( radarscp1 )
452452{
453453    dkong_state *state = (dkong_state *)machine->driver_data;
454454
r7356r7357
16151615
16161616MACHINE_DRIVER_END
16171617
1618static MACHINE_DRIVER_START( radarsc1 )
1618static MACHINE_DRIVER_START( radarscp1 )
16191619
16201620    MDRV_IMPORT_FROM(dkong_base)
16211621
1622    MDRV_MACHINE_START(radarsc1)
1622    MDRV_MACHINE_START(radarscp1)
16231623    MDRV_PALETTE_LENGTH(RS_PALETTE_LENGTH)
1624    MDRV_PALETTE_INIT(radarsc1)
1624    MDRV_PALETTE_INIT(radarscp1)
16251625
16261626    /* sound hardware */
1627    MDRV_IMPORT_FROM(radarsc1_audio)
1627    MDRV_IMPORT_FROM(radarscp1_audio)
16281628
16291629MACHINE_DRIVER_END
16301630
r7356r7357
29482948 *************************************/
29492949
29502950GAME( 1980, radarscp, 0,        radarscp, radarscp,       0, ROT90, "Nintendo", "Radar Scope", GAME_SUPPORTS_SAVE )
2951GAME( 1980, radarscp1,radarscp, radarsc1, radarscp,       0, ROT90, "Nintendo", "Radar Scope (TRS01)", GAME_SUPPORTS_SAVE )
2951GAME( 1980, radarscp1,radarscp, radarscp1,radarscp,       0, ROT90, "Nintendo", "Radar Scope (TRS01)", GAME_SUPPORTS_SAVE )
29522952
29532953GAME( 1981, dkong,    0,        dkong2b,  dkong,          0,  ROT90, "Nintendo of America", "Donkey Kong (US set 1)", GAME_SUPPORTS_SAVE )
29542954GAME( 1981, dkongo,   dkong,    dkong2b,  dkong,          0,  ROT90, "Nintendo", "Donkey Kong (US set 2)", GAME_SUPPORTS_SAVE )
src/mame/drivers/appoooh.c
r7356r7357
603603   robowres_decode(machine, "maincpu");
604604}
605605
606static DRIVER_INIT(robowrb)
606static DRIVER_INIT(robowresb)
607607{
608608   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
609609   memory_set_decrypted_region(space, 0x0000, 0x7fff, memory_region(machine, "maincpu") + 0x1c000);
r7356r7357
618618
619619GAME( 1984, appoooh,   0,        appoooh,  appoooh,  0,        ROT0, "[Sanritsu] Sega", "Appoooh", GAME_SUPPORTS_SAVE )
620620GAME( 1986, robowres,  0,        robowres, robowres, robowres, ROT0, "Sega",            "Robo Wres 2001", GAME_SUPPORTS_SAVE )
621GAME( 1986, robowresb, robowres, robowres, robowres, robowrb,  ROT0, "bootleg",         "Robo Wres 2001 (bootleg)", GAME_SUPPORTS_SAVE )
621GAME( 1986, robowresb, robowres, robowres, robowres, robowresb,ROT0, "bootleg",         "Robo Wres 2001 (bootleg)", GAME_SUPPORTS_SAVE )
src/mame/drivers/goldstar.c
r7356r7357
50255025   MDRV_CPU_PROGRAM_MAP(lucky8_map)
50265026   //MDRV_CPU_IO_MAP(goldstar_readport)
50275027   MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse)
5028//  MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) // causes 'magical' to display 'wait' instead
50285029
50295030   /* 3x 8255 */
50305031   MDRV_PPI8255_ADD( "ppi8255_0", lucky8_ppi8255_intf[0] )
r7356r7357
63036304   ROM_LOAD( "g13", 0x0000, 0x0020, CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) )
63046305ROM_END
63056306
6307ROM_START( magical )
6308   ROM_REGION( 0x10000, "maincpu", 0 )
6309   ROM_LOAD( "8_p6_d12.512", 0x00000, 0x08000, CRC(6978c662) SHA1(cfdbcdcd4085c264e1d0ad4f18160b40d2d4e406) )
6310   ROM_IGNORE(0x8000) // 1ST AND 2ND HALF IDENTICAL
6311   ROM_LOAD( "9_p7_d14.512", 0x08000, 0x04000, CRC(095230ba) SHA1(e60f5497c2cd5f1c0fc33b1e21303dd569654e6d) )
6312   ROM_IGNORE(0xc000) // BADADDR        --xxxxxxxxxxxxxx
6313
6314   ROM_REGION( 0x30000, "gfx1", 0 )
6315   ROM_LOAD( "5_l5_g2.512", 0x00000, 0x10000, CRC(f0ffb199) SHA1(383406e6ab74e8cecaf5574a879bf24aa606ac37) )
6316   ROM_LOAD( "6_l6_g3.512", 0x10000, 0x10000, CRC(3e44d92b) SHA1(4e00e26a4dbf326c0c919c40382505189e82c85b) )
6317   ROM_LOAD( "7_l7_g5.512", 0x20000, 0x10000, CRC(654bb754) SHA1(346bfbf85fc38797cf422da47d474e2ef2ef459c) )
6318
6319   ROM_REGION( 0x8000, "gfx2", 0 )
6320   ROM_LOAD( "1_m1_h2.764", 0x00000, 0x2000, CRC(d7d657e4) SHA1(53e2717edb4cdeac83cd519b08225784600afa61) )
6321   ROM_LOAD( "2_m2_h3.764", 0x02000, 0x2000, CRC(fb7541d5) SHA1(62a36c186b32bd98dff5c3f0fa5f2ad13992835c) )
6322   ROM_LOAD( "3_m3_h5.764", 0x04000, 0x2000, CRC(49572d8b) SHA1(ceaaf911f58cceec82f429ca9114bffa1a67ec12) )
6323   ROM_LOAD( "4_m4_h6.764", 0x06000, 0x2000, CRC(cccfaa5d) SHA1(69d9b8a26c769fd69093610e92918c9a086a2077) )
6324
6325   ROM_REGION( 0x200, "proms", 0 )
6326   ROM_LOAD( "proms", 0x0000, 0x0200, NO_DUMP )
6327
6328   ROM_REGION( 0x20, "proms2", ROMREGION_ERASE00 )
6329   //ROM_LOAD( "d13", 0x0000, 0x0020, CRC(c6b41352) SHA1(d7c3b5aa32e4e456c9432a13bede1db6d62eb270) )
6330
6331   ROM_REGION( 0x100, "unkprom", ROMREGION_ERASE00 )
6332   //ROM_LOAD( "g14", 0x0000, 0x0100, CRC(bd48de71) SHA1(e4fa1e774af1499bc568be5b2deabb859d8c8172) )
6333
6334   ROM_REGION( 0x20, "unkprom2", ROMREGION_ERASE00 )
6335   //ROM_LOAD( "g13", 0x0000, 0x0020, CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) )
6336ROM_END
6337
63066338/*
63076339
63086340unknown koren or chinese bootleg of something?
r7356r7357
86568688GAME( 198?, wcat3,     0,        wcat3,    lucky8,   0,         ROT0, "E.A.I.",            "Wild Cat 3",                                  GAME_NOT_WORKING )
86578689
86588690GAME( 198?, mtonic,    0,        ncb3,     cmv801,   mtonic,    ROT0, "Tonic",             "Magical Tonic?",                              GAME_WRONG_COLORS | GAME_NOT_WORKING )
8691GAME( 198?, magical,   0,        lucky8,   lucky8,   0,         ROT0, "Micro Manufacturing Inc.", "Magical Tonic / Magical Odds?",                   GAME_NOT_WORKING )
86598692
86608693
86618694/* --- Amcoe games --- */
src/mame/drivers/system16.c
r7356r7357
9797#include "sound/rf5c68.h"
9898#include "video/segaic16.h"
9999
100#define ShadowColorsMultiplier 2
100#define SHADOW_COLORS_MULTIPLIER 2
101101
102/***************************************************************************/
103102
104static UINT16 coinctrl;
105
106103static INTERRUPT_GEN( sys16_interrupt )
107104{
108105   cpu_set_input_line(device, 4, HOLD_LINE); /* Interrupt vector 4, used by VBlank */
r7356r7357
110107
111108
112109/***************************************************************************/
113/*
110
111static WRITE16_HANDLER( sound_command_nmi_w )
112{
113   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
114
115   if (ACCESSING_BITS_0_7)
116   {
117      soundlatch_w(space, 0, data & 0xff);
118      cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, PULSE_LINE);
119   }
120}
121
122
123static ADDRESS_MAP_START( shinobib_map, ADDRESS_SPACE_PROGRAM, 16 )
124   AM_RANGE(0x000000, 0x03ffff) AM_ROM
125   AM_RANGE(0x400000, 0x40ffff) AM_RAM // tilemap ram on the original, used as a buffer on the bootlegs
126   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_BASE_MEMBER(segas1x_bootleg_state, textram)
127   AM_RANGE(0x411000, 0x411fff) AM_RAM AM_BASE_MEMBER(segas1x_bootleg_state, bg0_tileram)
128   AM_RANGE(0x412000, 0x412fff) AM_RAM AM_BASE_MEMBER(segas1x_bootleg_state, bg1_tileram)
129   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
130   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(segaic16_paletteram_w)  AM_BASE(&segaic16_paletteram)
131   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sound_command_nmi_w)
132   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
133   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
134   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
135   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW1")
136   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW2")
137   AM_RANGE(0xC43000, 0xC43001) AM_WRITENOP
138   AM_RANGE(0xC44000, 0xC44001) AM_WRITENOP
139   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(s16a_bootleg_bgscrolly_w)
140   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(s16a_bootleg_bgscrollx_w)
141   AM_RANGE(0xc46004, 0xc46005) AM_WRITE(s16a_bootleg_fgscrolly_w)
142   AM_RANGE(0xc46006, 0xc46007) AM_WRITE(s16a_bootleg_fgscrollx_w)
143   AM_RANGE(0xc46008, 0xc46009) AM_WRITE(s16a_bootleg_tilemapselect_w)
144   AM_RANGE(0xC60000, 0xC60001) AM_READNOP
145   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
146ADDRESS_MAP_END
147
148/***************************************************************************/
149
150static WRITE16_HANDLER( sound_command_w )
151{
152   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
153
154   if (ACCESSING_BITS_0_7)
155   {
156      soundlatch_w(space, 0, data & 0xff);
157      cpu_set_input_line(state->soundcpu, 0, HOLD_LINE);
158   }
159}
160
161static WRITE16_HANDLER( sys16_coinctrl_w )
162{
163   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
164
165   if (ACCESSING_BITS_0_7)
166   {
167      state->coinctrl = data & 0xff;
168      state->refreshenable = state->coinctrl & 0x20;
169      set_led_status(space->machine, 1, state->coinctrl & 0x08);
170      set_led_status(space->machine, 0, state->coinctrl & 0x04);
171      coin_counter_w(space->machine, 1, state->coinctrl & 0x02);
172      coin_counter_w(space->machine, 0, state->coinctrl & 0x01);
173      /* bit 6 is also used (1 most of the time; 0 in dduxbl, sdi, wb3;
174           tturf has it normally 1 but 0 after coin insertion) */
175      /* eswat sets bit 4 */
176   }
177}
178
179static ADDRESS_MAP_START( passshtb_map, ADDRESS_SPACE_PROGRAM, 16 )
180   AM_RANGE(0x000000, 0x01ffff) AM_ROM
181
182   AM_RANGE(0x400000, 0x407fff) AM_RAM // tilemap ram on original, buffer on bootleg
183   AM_RANGE(0x409000, 0x409fff) AM_RAM AM_BASE_MEMBER(segas1x_bootleg_state, bg0_tileram)
184   AM_RANGE(0x40a000, 0x40afff) AM_RAM AM_BASE_MEMBER(segas1x_bootleg_state, bg1_tileram)
185   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_BASE_MEMBER(segas1x_bootleg_state, textram)
186
187   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
188   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(segaic16_paletteram_w) AM_BASE(&segaic16_paletteram)
189   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
190   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
191   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
192   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
193   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
194   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
195   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
196   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(s16a_bootleg_bgscrolly_w)
197   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(s16a_bootleg_bgscrollx_w)
198   AM_RANGE(0xc46004, 0xc46005) AM_WRITE(s16a_bootleg_fgscrolly_w)
199   AM_RANGE(0xc46006, 0xc46007) AM_WRITE(s16a_bootleg_fgscrollx_w)
200   AM_RANGE(0xc46008, 0xc46009) AM_WRITE(s16a_bootleg_tilemapselect_w)
201
202   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
203ADDRESS_MAP_END
204
205/***************************************************************************/
206
207static READ16_HANDLER( passht4b_service_r )
208{
209   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
210   UINT16 val = input_port_read(space->machine, "SERVICE");
211
212   if(!(input_port_read(space->machine, "P1") & 0x40)) val &= 0xef;
213   if(!(input_port_read(space->machine, "P2") & 0x40)) val &= 0xdf;
214   if(!(input_port_read(space->machine, "P3") & 0x40)) val &= 0xbf;
215   if(!(input_port_read(space->machine, "P4") & 0x40)) val &= 0x7f;
216
217   state->passht4b_io3_val = (input_port_read(space->machine, "P1") << 4) | (input_port_read(space->machine, "P3") & 0xf);
218   state->passht4b_io2_val = (input_port_read(space->machine, "P2") << 4) | (input_port_read(space->machine, "P4") & 0xf);
219
220   state->passht4b_io1_val = 0xff;
221
222   // player 1 buttons
223   if(!(input_port_read(space->machine, "P1") & 0x10)) state->passht4b_io1_val &= 0xfe;
224   if(!(input_port_read(space->machine, "P1") & 0x20)) state->passht4b_io1_val &= 0xfd;
225   if(!(input_port_read(space->machine, "P1") & 0x80)) state->passht4b_io1_val &= 0xfc;
226
227   // player 2 buttons
228   if(!(input_port_read(space->machine, "P2") & 0x10)) state->passht4b_io1_val &= 0xfb;
229   if(!(input_port_read(space->machine, "P2") & 0x20)) state->passht4b_io1_val &= 0xf7;
230   if(!(input_port_read(space->machine, "P2") & 0x80)) state->passht4b_io1_val &= 0xf3;
231
232   // player 3 buttons
233   if(!(input_port_read(space->machine, "P3") & 0x10)) state->passht4b_io1_val &= 0xef;
234   if(!(input_port_read(space->machine, "P3") & 0x20)) state->passht4b_io1_val &= 0xdf;
235   if(!(input_port_read(space->machine, "P3") & 0x80)) state->passht4b_io1_val &= 0xcf;
236
237   // player 4 buttons
238   if(!(input_port_read(space->machine, "P4") & 0x10)) state->passht4b_io1_val &= 0xbf;
239   if(!(input_port_read(space->machine, "P4") & 0x20)) state->passht4b_io1_val &= 0x7f;
240   if(!(input_port_read(space->machine, "P4") & 0x80)) state->passht4b_io1_val &= 0x3f;
241
242   return val;
243}
244
245static READ16_HANDLER( passht4b_io1_r )
246{
247   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
248   return state->passht4b_io1_val;
249}
250
251static READ16_HANDLER( passht4b_io2_r )
252{
253   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
254   return state->passht4b_io2_val;
255}
256
257static READ16_HANDLER( passht4b_io3_r )
258{
259   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
260   return state->passht4b_io3_val;
261}
262
263static ADDRESS_MAP_START( passht4b_map, ADDRESS_SPACE_PROGRAM, 16 )
264   AM_RANGE(0x000000, 0x01ffff) AM_ROM
265   AM_RANGE(0x400000, 0x407fff) AM_RAM // tilemap ram on original, buffer on bootleg
266   AM_RANGE(0x409000, 0x40afff) AM_RAM AM_BASE_MEMBER(segas1x_bootleg_state, bg0_tileram)
267   AM_RANGE(0x40a000, 0x40bfff) AM_RAM AM_BASE_MEMBER(segas1x_bootleg_state, bg1_tileram)
268   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_BASE_MEMBER(segas1x_bootleg_state, textram)
269   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
270   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(segaic16_paletteram_w)  AM_BASE(&segaic16_paletteram)
271   AM_RANGE(0xc41000, 0xc41001) AM_READ(passht4b_service_r)
272   AM_RANGE(0xc41002, 0xc41003) AM_READ(passht4b_io1_r)
273   AM_RANGE(0xc41004, 0xc41005) AM_READ(passht4b_io2_r)
274   AM_RANGE(0xc41006, 0xc41007) AM_READ(passht4b_io3_r)
275   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
276   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
277   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
278   AM_RANGE(0xc43000, 0xc43001) AM_READ_PORT("P1")      // test mode only
279   AM_RANGE(0xc43002, 0xc43003) AM_READ_PORT("P2")
280   AM_RANGE(0xc43004, 0xc43005) AM_READ_PORT("P3")
281   AM_RANGE(0xc43006, 0xc43007) AM_READ_PORT("P4")
282   AM_RANGE(0xc4600a, 0xc4600b) AM_WRITE(sys16_coinctrl_w)   /* coin counter doesn't work */
283   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(s16a_bootleg_bgscrolly_w)
284   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(s16a_bootleg_bgscrollx_w)
285   AM_RANGE(0xc46004, 0xc46005) AM_WRITE(s16a_bootleg_fgscrolly_w)
286   AM_RANGE(0xc46006, 0xc46007) AM_WRITE(s16a_bootleg_fgscrollx_w)
287   AM_RANGE(0xc46008, 0xc46009) AM_WRITE(s16a_bootleg_tilemapselect_w)
288
289   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
290ADDRESS_MAP_END
291
292/***************************************************************************/
293
294static WRITE16_HANDLER( sys16_tilebank_w )
295{
296   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
297
298   if (ACCESSING_BITS_0_7)
299   {
300      switch (offset & 1)
301      {
302         case 0:
303            state->tile_bank0 = data & 0x0f;
304            break;
305         case 1:
306            state->tile_bank1 = data & 0x0f;
307            break;
308      }
309   }
310}
311
312static ADDRESS_MAP_START( wb3bbl_map, ADDRESS_SPACE_PROGRAM, 16 )
313   AM_RANGE(0x000000, 0x03ffff) AM_ROM
314   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(sys16_tilebank_w)
315   AM_RANGE(0x400000, 0x407fff) AM_RAM // tilemap ram on the original, used as a buffer on the bootlegs
316   AM_RANGE(0x409000, 0x40afff) AM_RAM AM_BASE_MEMBER(segas1x_bootleg_state, bg0_tileram)
317   AM_RANGE(0x40a000, 0x40bfff) AM_RAM AM_BASE_MEMBER(segas1x_bootleg_state, bg1_tileram)
318   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_BASE_MEMBER(segas1x_bootleg_state, textram)
319   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
320   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(segaic16_paletteram_w) AM_BASE(&segaic16_paletteram)
321   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
322   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
323   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
324   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
325   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
326   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
327   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
328   AM_RANGE(0xC44000, 0xC44001) AM_WRITENOP
329   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(s16a_bootleg_bgscrolly_w)
330   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(s16a_bootleg_bgscrollx_w)
331   AM_RANGE(0xc46004, 0xc46005) AM_WRITE(s16a_bootleg_fgscrolly_w)
332   AM_RANGE(0xc46006, 0xc46007) AM_WRITE(s16a_bootleg_fgscrollx_w)
333   AM_RANGE(0xc46008, 0xc46009) AM_WRITE(s16a_bootleg_tilemapselect_w)
334   AM_RANGE(0xff0000, 0xffffff) AM_RAM // work ram
335ADDRESS_MAP_END
336
337/***************************************************************************
338
114339    Tough Turf (Datsu bootleg) sound emulation
115340
116341    Memory map
r7356r7357
137362
138363    The sample sound codes in the sound test are OK, but in-game sample playback is bad.
139364    There seems to be more data in the high bits of the ROM bank control word which may be related.
140*/
365***************************************************************************/
141366
142static int sample_buffer = 0;
143static int sample_select = 0;
144
145static WRITE16_HANDLER( sound_command_nmi_w )
146{
147   if( ACCESSING_BITS_0_7 )
148   {
149      soundlatch_w( space, 0, data & 0xff );
150      cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
151   }
152}
153
154
155367static WRITE8_HANDLER( tturfbl_msm5205_data_w )
156368{
157   sample_buffer = data;
369   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
370   state->sample_buffer = data;
158371}
159372
160static void tturfbl_msm5205_callback(running_device *device)
373static void tturfbl_msm5205_callback( running_device *device )
161374{
162   msm5205_data_w(device, (sample_buffer >> 4) & 0x0F);
163   sample_buffer <<= 4;
164   sample_select ^= 1;
165   if(sample_select == 0)
166      cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
375   segas1x_bootleg_state *state = (segas1x_bootleg_state *)device->machine->driver_data;
376   msm5205_data_w(device, (state->sample_buffer >> 4) & 0x0f);
377
378   state->sample_buffer <<=  4;
379   state->sample_select ^=  1;
380   if(state->sample_select == 0)
381      cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, PULSE_LINE);
167382}
168383
169static const msm5205_interface tturfbl_msm5205_interface =
384static const msm5205_interface tturfbl_msm5205_interface =
170385{
171386   tturfbl_msm5205_callback,
172387   MSM5205_S48_4B
173388};
174389
175390
176static UINT8 *tturfbl_soundbank_ptr = NULL;      /* Pointer to currently selected portion of ROM */
177
178391static READ8_HANDLER( tturfbl_soundbank_r )
179392{
180   if(tturfbl_soundbank_ptr) return tturfbl_soundbank_ptr[offset & 0x3fff];
393   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
394
395   if (state->soundbank_ptr)
396      return state->soundbank_ptr[offset & 0x3fff];
181397   return 0x80;
182398}
183399
184400static WRITE8_HANDLER( tturfbl_soundbank_w )
185401{
402   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
186403   UINT8 *mem = memory_region(space->machine, "soundcpu");
187404
188405   switch(data)
189406   {
190407      case 0:
191         tturfbl_soundbank_ptr = &mem[0x18000]; /* tt014d68 8000-bfff */
408         state->soundbank_ptr = &mem[0x18000]; /* tt014d68 8000-bfff */
192409         break;
193410      case 1:
194         tturfbl_soundbank_ptr = &mem[0x1C000]; /* tt014d68 c000-ffff */
411         state->soundbank_ptr = &mem[0x1c000]; /* tt014d68 c000-ffff */
195412         break;
196413      case 2:
197         tturfbl_soundbank_ptr = &mem[0x20000]; /* tt0246ff 0000-3fff */
414         state->soundbank_ptr = &mem[0x20000]; /* tt0246ff 0000-3fff */
198415         break;
199416      case 3:
200         tturfbl_soundbank_ptr = &mem[0x24000]; /* tt0246ff 4000-7fff */
417         state->soundbank_ptr = &mem[0x24000]; /* tt0246ff 4000-7fff */
201418         break;
202419      case 4:
203         tturfbl_soundbank_ptr = &mem[0x28000]; /* tt0246ff 8000-bfff */
420         state->soundbank_ptr = &mem[0x28000]; /* tt0246ff 8000-bfff */
204421         break;
205422      case 8:
206         tturfbl_soundbank_ptr = mem;
423         state->soundbank_ptr = mem;
207424         break;
208425      default:
209         tturfbl_soundbank_ptr = NULL;
426         state->soundbank_ptr = NULL;
210427         logerror("Invalid bank setting %02X (%04X)\n", data, cpu_get_pc(space->cpu));
211428         break;
212429   }
r7356r7357
271488ADDRESS_MAP_END
272489
273490
274static WRITE16_HANDLER( sound_command_w )
275{
276   if( ACCESSING_BITS_0_7 )
277   {
278      soundlatch_w( space, 0, data & 0xff );
279      cputag_set_input_line(space->machine, "soundcpu", 0, HOLD_LINE );
280   }
281}
282
283
284//static UINT16 coinctrl;
285
286static WRITE16_HANDLER( sys16_coinctrl_w )
287{
288   if( ACCESSING_BITS_0_7 )
289   {
290      coinctrl = data&0xff;
291      sys16_refreshenable = coinctrl & 0x20;
292      set_led_status(space->machine, 1,coinctrl & 0x08);
293      set_led_status(space->machine, 0,coinctrl & 0x04);
294      coin_counter_w(space->machine, 1,coinctrl & 0x02);
295      coin_counter_w(space->machine, 0,coinctrl & 0x01);
296      /* bit 6 is also used (1 most of the time; 0 in dduxbl, sdi, wb3;
297           tturf has it normally 1 but 0 after coin insertion) */
298      /* eswat sets bit 4 */
299   }
300}
301
302491/***************************************************************************/
303492
304static MACHINE_DRIVER_START( system16 )
305
306   /* basic machine hardware */
307   MDRV_CPU_ADD("maincpu", M68000, 10000000)
308   MDRV_CPU_VBLANK_INT("screen", sys16_interrupt)
309
310   MDRV_CPU_ADD("soundcpu", Z80, 4000000)
311   MDRV_CPU_PROGRAM_MAP(sound_map)
312   MDRV_CPU_IO_MAP(sound_io_map)
313
314   /* video hardware */
315   MDRV_SCREEN_ADD("screen", RASTER)
316   MDRV_SCREEN_REFRESH_RATE(60)
317   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
318   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
319   MDRV_SCREEN_SIZE(40*8, 28*8)
320   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
321
322   MDRV_GFXDECODE(sys16)
323   MDRV_PALETTE_LENGTH(2048*ShadowColorsMultiplier)
324
325   MDRV_VIDEO_START(system16)
326   MDRV_VIDEO_UPDATE(system16)
327
328   /* sound hardware */
329   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
330
331   MDRV_SOUND_ADD("ymsnd", YM2151, 4000000)
332   MDRV_SOUND_ROUTE(0, "lspeaker", 0.32)
333   MDRV_SOUND_ROUTE(1, "rspeaker", 0.32)
334MACHINE_DRIVER_END
335
336
337static MACHINE_DRIVER_START( system16_7759 )
338
339   /* basic machine hardware */
340   MDRV_IMPORT_FROM(system16)
341
342   MDRV_CPU_MODIFY("soundcpu")
343   MDRV_CPU_PROGRAM_MAP(sound_7759_map)
344   MDRV_CPU_IO_MAP(sound_7759_io_map)
345
346   /* sound hardware */
347   MDRV_SOUND_ADD("7759", UPD7759, UPD7759_STANDARD_CLOCK)
348   MDRV_SOUND_CONFIG(sys16_upd7759_interface)
349   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.48)
350   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.48)
351MACHINE_DRIVER_END
352
353/***************************************************************************/
354
355static WRITE16_HANDLER( sys16_tilebank_w )
493static void set_tile_bank( running_machine *machine, int data )
356494{
357   if(ACCESSING_BITS_0_7)
358   {
359      switch(offset & 1)
360      {
361         case 0:
362            sys16_tile_bank0 = data & 0x0F;
363            break;
364         case 1:
365            sys16_tile_bank1 = data & 0x0F;
366            break;
367      }
368   }
495   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
496   state->tile_bank0 = (data >> 4) & 0x0f;
497   state->tile_bank1 = data & 0x0f;
369498}
370499
371static void set_tile_bank( int data )
500static void set_fg_page( running_machine *machine, int data )
372501{
373   sys16_tile_bank1 = data&0xf;
374   sys16_tile_bank0 = (data>>4)&0xf;
502   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
503   state->fg_page[0] = data >> 12;
504   state->fg_page[1] = (data >> 8) & 0x0f;
505   state->fg_page[2] = (data >> 4) & 0x0f;
506   state->fg_page[3] = data & 0x0f;
375507}
376508
377static void set_fg_page( int data )
509static void set_bg_page( running_machine *machine, int data )
378510{
379   sys16_fg_page[0] = data>>12;
380   sys16_fg_page[1] = (data>>8)&0xf;
381   sys16_fg_page[2] = (data>>4)&0xf;
382   sys16_fg_page[3] = data&0xf;
511   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
512   state->bg_page[0] = data >> 12;
513   state->bg_page[1] = (data >> 8) & 0x0f;
514   state->bg_page[2] = (data >> 4) & 0x0f;
515   state->bg_page[3] = data & 0x0f;
383516}
384517
385static void set_bg_page( int data )
386{
387   sys16_bg_page[0] = data>>12;
388   sys16_bg_page[1] = (data>>8)&0xf;
389   sys16_bg_page[2] = (data>>4)&0xf;
390   sys16_bg_page[3] = data&0xf;
391}
392518
393/***************************************************************************/
394
395static INPUT_PORTS_START( sys16_common )
396   PORT_START("P1")
397   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 )
398   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
399   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
400   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
401   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
402   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
403   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
404   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
405
406   PORT_START("P2")
407   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
408   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
409   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
410   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
411   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
412   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
413   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
414   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
415
416   PORT_START("SERVICE")
417   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
418   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
419   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
420   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
421   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
422   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
423   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
424   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
425
426   PORT_START("DSW1")
427   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
428   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
429   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
430   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
431   PORT_DIPSETTING(    0x05, "2 Coins/1 Credit 5/3 6/4" )
432   PORT_DIPSETTING(    0x04, "2 Coins/1 Credit 4/3" )
433   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
434   PORT_DIPSETTING(    0x01, "1 Coin/1 Credit 2/3" )
435   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 4/5" )
436   PORT_DIPSETTING(    0x03, "1 Coin/1 Credit 5/6" )
437   PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
438   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
439   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
440   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
441   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
442   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
443   PORT_DIPSETTING(    0x00, "Free Play (if Coin B too) or 1/1" )
444   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
445   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
446   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
447   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
448   PORT_DIPSETTING(    0x50, "2 Coins/1 Credit 5/3 6/4" )
449   PORT_DIPSETTING(    0x40, "2 Coins/1 Credit 4/3" )
450   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
451   PORT_DIPSETTING(    0x10, "1 Coin/1 Credit 2/3" )
452   PORT_DIPSETTING(    0x20, "1 Coin/1 Credit 4/5" )
453   PORT_DIPSETTING(    0x30, "1 Coin/1 Credit 5/6" )
454   PORT_DIPSETTING(    0x60, DEF_STR( 2C_3C ) )
455   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
456   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
457   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
458   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
459   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
460   PORT_DIPSETTING(    0x00, "Free Play (if Coin A too) or 1/1" )
461INPUT_PORTS_END
462
463/***************************************************************************/
464
465#ifdef UNUSED_DEFINITION
466static INPUT_PORTS_START( aliensyn )
467   PORT_INCLUDE( sys16_common )
468
469   PORT_START("DSW2")
470   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Listed as "Unused" */
471   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
472   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
473   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
474   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
475   PORT_DIPSETTING(    0x08, "2" )
476   PORT_DIPSETTING(    0x0c, "3" )
477   PORT_DIPSETTING(    0x04, "4" )
478   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
479   PORT_DIPNAME( 0x30, 0x30, "Timer" ) PORT_DIPLOCATION("SW2:5,6")
480   PORT_DIPSETTING(    0x00, "120" )
481   PORT_DIPSETTING(    0x10, "130" )
482   PORT_DIPSETTING(    0x20, "140" )
483   PORT_DIPSETTING(    0x30, "150" )
484   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
485   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
486   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
487   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
488   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
489INPUT_PORTS_END
490#endif
491/****************************************************************************/
492
493519static ADDRESS_MAP_START( bayroute_map, ADDRESS_SPACE_PROGRAM, 16 )
494520   AM_RANGE(0x000000, 0x0bffff) AM_ROM
495521   AM_RANGE(0x100000, 0x100003) AM_WRITENOP // tilebank control?
496522   AM_RANGE(0x500000, 0x503fff) AM_RAM // work ram
497523   AM_RANGE(0x600000, 0x600fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
498   AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
499   AM_RANGE(0x710000, 0x710fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
500   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&segaic16_paletteram)
524   AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
525   AM_RANGE(0x710000, 0x710fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
526   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(segaic16_paletteram_w)  AM_BASE(&segaic16_paletteram)
501527   AM_RANGE(0x900000, 0x900001) AM_WRITE(sys16_coinctrl_w)
502528   AM_RANGE(0x901002, 0x901003) AM_READ_PORT("P1")
503529   AM_RANGE(0x901006, 0x901007) AM_READ_PORT("P2")
r7356r7357
510536
511537/***************************************************************************/
512538
513static INPUT_PORTS_START( bayroute )
514   PORT_INCLUDE( sys16_common )
515
516   PORT_START("DSW2")
517   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:1")
518   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
519   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
520   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
521   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
522   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
523   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
524   PORT_DIPSETTING(    0x04, "1" )
525   PORT_DIPSETTING(    0x0c, "3" )
526   PORT_DIPSETTING(    0x08, "5" )
527   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
528   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5,6")
529   PORT_DIPSETTING(    0x30, "100k" )
530   PORT_DIPSETTING(    0x20, "150k" )
531   PORT_DIPSETTING(    0x10, "200k" )
532   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
533   PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
534   PORT_DIPSETTING(    0xc0, DEF_STR( Easy ) )
535   PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
536   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
537   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
538INPUT_PORTS_END
539
540/***************************************************************************/
541
542
543
544
545/***************************************************************************/
546
547static DRIVER_INIT( dduxbl )
548{
549   MACHINE_RESET_CALL(sys16_onetime);
550}
551
552/***************************************************************************/
553
554static INPUT_PORTS_START( ddux )
555   PORT_INCLUDE( sys16_common )
556
557   PORT_START("DSW2")
558   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
559   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
560   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
561   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2,3")
562   PORT_DIPSETTING(    0x04, DEF_STR( Easy ) )
563   PORT_DIPSETTING(    0x06, DEF_STR( Normal ) )
564   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
565   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
566   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4,5")
567   PORT_DIPSETTING(    0x10, "2" )
568   PORT_DIPSETTING(    0x18, "3" )
569   PORT_DIPSETTING(    0x08, "4" )
570   PORT_DIPSETTING(    0x00, "5" )
571   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:6,7")
572   PORT_DIPSETTING(    0x40, "150k" )
573   PORT_DIPSETTING(    0x60, "200k" )
574   PORT_DIPSETTING(    0x20, "300k" )
575   PORT_DIPSETTING(    0x00, "400k" )
576   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Listed as "Unused" */
577INPUT_PORTS_END
578
579/***************************************************************************/
580
581
582
583/***************************************************************************/
584
585static int eswat_tilebank0;
586
587static WRITE16_HANDLER( eswat_tilebank0_w )
588{
589   if( ACCESSING_BITS_0_7 )
590   {
591      eswat_tilebank0 = data&0xff;
592   }
593}
594
595
596
597/***************************************************************************/
598
599
600static MACHINE_RESET( eswatbl )
601{
602
603}
604
605
606static DRIVER_INIT( eswatbl )
607{
608   MACHINE_RESET_CALL(sys16_onetime);
609   sys16_rowscroll_scroll=0x8000;
610   //sys18_splittab_fg_x=&sys16_textram[0x0f80];
611}
612
613/***************************************************************************/
614
615static INPUT_PORTS_START( eswat )
616   PORT_INCLUDE( sys16_common )
617
618   PORT_START("DSW2")
619   PORT_DIPNAME( 0x01, 0x01, "Credits To Start" ) PORT_DIPLOCATION("SW2:1")
620   PORT_DIPSETTING(    0x01, "1 Credit" )
621   PORT_DIPSETTING(    0x00, "2 Credits" )
622   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
623   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
624   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
625   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:3")
626   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
627   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
628   PORT_DIPNAME( 0x08, 0x08, "Timer" ) PORT_DIPLOCATION("SW2:4")
629   PORT_DIPSETTING(    0x08, DEF_STR( Normal ) )
630   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
631   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
632   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
633   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
634   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
635   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
636   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:7,8")
637   PORT_DIPSETTING(    0x00, "1" )
638   PORT_DIPSETTING(    0x40, "2" )
639   PORT_DIPSETTING(    0xc0, "3" )
640   PORT_DIPSETTING(    0x80, "4" )
641INPUT_PORTS_END
642
643/***************************************************************************/
644
645/***************************************************************************/
646
647/***************************************************************************/
648
649
650static INPUT_PORTS_START( fpointbl )
651   PORT_START("SERVICE")
652   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
653   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
654   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
655   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
656   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
657   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
658   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
659   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
660
661   PORT_START("P1")
662   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
663   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 )
664   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
665   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
666   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
667   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
668   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
669   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
670
671   PORT_START("P2")
672   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
673   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
674   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
675   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
676   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
677   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
678   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
679   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
680
681   PORT_START("DSW2")
682   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Listed as "Unused" */
683   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
684   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
685   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
686   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) /* Listed as "Unused" */
687   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" ) /* Listed as "Unused" */
688   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
689   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
690   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
691   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
692   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
693   PORT_DIPNAME( 0x40, 0x40, "Clear Round Allowed" ) PORT_DIPLOCATION("SW2:7") /* Use button 3 */
694   PORT_DIPSETTING(    0x00, "1" )
695   PORT_DIPSETTING(    0x40, "2" )
696   /* SW2:8 The mode in which a block falls at twice [ usual ] speed as this when playing 25 minutes or more on one coin. */
697   PORT_DIPNAME( 0x80, 0x80, "2 Cell Move" ) PORT_DIPLOCATION("SW2:8")
698   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
699   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
700
701   PORT_START("DSW1")
702   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
703   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
704   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
705   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
706   PORT_DIPSETTING(    0x05, "2 Coins/1 Credit 5/3 6/4" )
707   PORT_DIPSETTING(    0x04, "2 Coins/1 Credit 4/3" )
708   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
709   PORT_DIPSETTING(    0x01, "1 Coin/1 Credit 2/3" )
710   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 4/5" )
711   PORT_DIPSETTING(    0x03, "1 Coin/1 Credit 5/6" )
712   PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
713   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
714   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
715   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
716   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
717   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
718   PORT_DIPSETTING(    0x00, "Free Play (if Coin B too) or 1/1" )
719   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
720   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
721   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
722   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
723   PORT_DIPSETTING(    0x50, "2 Coins/1 Credit 5/3 6/4" )
724   PORT_DIPSETTING(    0x40, "2 Coins/1 Credit 4/3" )
725   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
726   PORT_DIPSETTING(    0x10, "1 Coin/1 Credit 2/3" )
727   PORT_DIPSETTING(    0x20, "1 Coin/1 Credit 4/5" )
728   PORT_DIPSETTING(    0x30, "1 Coin/1 Credit 5/6" )
729   PORT_DIPSETTING(    0x60, DEF_STR( 2C_3C ) )
730   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
731   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
732   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
733   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
734   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
735   PORT_DIPSETTING(    0x00, "Free Play (if Coin A too) or 1/1" )
736INPUT_PORTS_END
737
738/***************************************************************************/
739
740539/*
741540    Flash Point (Datsu bootlegs = fpointbl, fpointbj)
742541    Has sound latch at $E000 instead of I/O ports $C0-FF
r7356r7357
749548
750549/***************************************************************************/
751550
752
753
754
755static WRITE16_HANDLER( sys16bootleg_bgpage_w )
551static WRITE16_HANDLER( s16bl_bgpage_w )
756552{
757   set_bg_page( data );
553   set_bg_page(space->machine, data);
758554}
759555
760static WRITE16_HANDLER( sys16bootleg_fgpage_w )
556static WRITE16_HANDLER( s16bl_fgpage_w )
761557{
762   set_fg_page( data );
558   set_fg_page(space->machine, data);
763559}
764560
765static WRITE16_HANDLER( sys16bootleg_fgscrollx_bank_w )
561static WRITE16_HANDLER( s16bl_fgscrollx_bank_w )
766562{
767
563   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
768564   int scroll = data & 0x1ff;
769   int bank = (data&0xc000)>>14;
770   scroll+=0x200;
771   set_tile_bank( bank );
565   int bank = (data & 0xc000) >> 14;
772566
773   scroll+=3; // so that the character portraits in attract mode are properly aligned (alighnment on character select no longer matches original tho?)
774   sys16_fg_scrollx = -scroll;
567   scroll += 0x200;
568   set_tile_bank(space->machine, bank);
569
570   scroll += 3; // so that the character portraits in attract mode are properly aligned (alighnment on character select no longer matches original tho?)
571   state->fg_scrollx = -scroll;
775572}
776573
777static WRITE16_HANDLER( sys16bootleg_fgscrollx_w )
574static WRITE16_HANDLER( s16bl_fgscrollx_w )
778575{
779
780   //data ^= 0x7; // 4 player passing shot
781
576   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
782577   int scroll = data & 0x1ff;
783   scroll+=0x200;
784   scroll+=3;
785578
579   scroll += 0x200;
580   scroll += 3;
786581
787   sys16_fg_scrollx = -scroll;
582   state->fg_scrollx = -scroll;
788583}
789584
790585
791static WRITE16_HANDLER( sys16bootleg_fgscrolly_w )
586static WRITE16_HANDLER( s16bl_fgscrolly_w )
792587{
588   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
793589   int scroll = data & 0xff;
794   sys16_fg_scrolly = scroll;
590
591   state->fg_scrolly = scroll;
795592}
796593
797static WRITE16_HANDLER( sys16bootleg_bgscrollx_w )
594static WRITE16_HANDLER( s16bl_bgscrollx_w )
798595{
799
596   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
800597   int scroll = data & 0x1ff;
801   scroll+=0x200;
802   scroll+=1; // so that the background fo the select screen is properly aligned
803   sys16_bg_scrollx = -scroll;
598
599   scroll+= 0x200;
600   scroll+= 1; // so that the background fo the select screen is properly aligned
601   state->bg_scrollx = -scroll;
804602}
805603
806static WRITE16_HANDLER( sys16bootleg_bgscrolly_w )
604static WRITE16_HANDLER( s16bl_bgscrolly_w )
807605{
606   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
808607   int scroll = data & 0xff;
809   sys16_bg_scrolly = scroll;
608
609   state->bg_scrolly = scroll;
810610}
811611
812612
813static ADDRESS_MAP_START( goldnaxe_b1_map, ADDRESS_SPACE_PROGRAM, 16 )
613static ADDRESS_MAP_START( goldnaxeb1_map, ADDRESS_SPACE_PROGRAM, 16 )
814614   AM_RANGE(0x000000, 0x0bffff) AM_ROM
815   AM_RANGE(0x100000, 0x10ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
816   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
817   AM_RANGE(0x118000, 0x118001) AM_WRITE(sys16bootleg_fgscrolly_w)
818   AM_RANGE(0x118008, 0x118009) AM_WRITE(sys16bootleg_fgscrollx_bank_w) // and tile bank
819   AM_RANGE(0x118010, 0x118011) AM_WRITE(sys16bootleg_bgscrolly_w)
820   AM_RANGE(0x118018, 0x118019) AM_WRITE(sys16bootleg_bgscrollx_w)
821   AM_RANGE(0x118020, 0x118021) AM_WRITE(sys16bootleg_fgpage_w)
822   AM_RANGE(0x118028, 0x118029) AM_WRITE(sys16bootleg_bgpage_w)
823   AM_RANGE(0x140000, 0x143fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&segaic16_paletteram)
615   AM_RANGE(0x100000, 0x10ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
616   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
617   AM_RANGE(0x118000, 0x118001) AM_WRITE(s16bl_fgscrolly_w)
618   AM_RANGE(0x118008, 0x118009) AM_WRITE(s16bl_fgscrollx_bank_w) // and tile bank
619   AM_RANGE(0x118010, 0x118011) AM_WRITE(s16bl_bgscrolly_w)
620   AM_RANGE(0x118018, 0x118019) AM_WRITE(s16bl_bgscrollx_w)
621   AM_RANGE(0x118020, 0x118021) AM_WRITE(s16bl_fgpage_w)
622   AM_RANGE(0x118028, 0x118029) AM_WRITE(s16bl_bgpage_w)
623   AM_RANGE(0x140000, 0x143fff) AM_RAM_WRITE(segaic16_paletteram_w)  AM_BASE(&segaic16_paletteram)
824624   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
825625   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
826626   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
r7356r7357
835635   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
836636ADDRESS_MAP_END
837637
838static ADDRESS_MAP_START( bayroute_b1_map, ADDRESS_SPACE_PROGRAM, 16 )
638static ADDRESS_MAP_START( bayrouteb1_map, ADDRESS_SPACE_PROGRAM, 16 )
839639   AM_RANGE(0x000000, 0x0bffff) AM_ROM
840640   AM_RANGE(0x500000, 0x503fff) AM_RAM // work ram
841641   AM_RANGE(0x600000, 0x600fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
842   AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
843   AM_RANGE(0x710000, 0x710fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
844   AM_RANGE(0x718000, 0x718001) AM_WRITE(sys16bootleg_fgscrolly_w)
845   AM_RANGE(0x718008, 0x718009) AM_WRITE(sys16bootleg_fgscrollx_bank_w) // and tile bank
846   AM_RANGE(0x718010, 0x718011) AM_WRITE(sys16bootleg_bgscrolly_w)
847   AM_RANGE(0x718018, 0x718019) AM_WRITE(sys16bootleg_bgscrollx_w)
848   AM_RANGE(0x718020, 0x718021) AM_WRITE(sys16bootleg_fgpage_w)
849   AM_RANGE(0x718028, 0x718029) AM_WRITE(sys16bootleg_bgpage_w)
850   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&segaic16_paletteram)
642   AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
643   AM_RANGE(0x710000, 0x710fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
644   AM_RANGE(0x718000, 0x718001) AM_WRITE(s16bl_fgscrolly_w)
645   AM_RANGE(0x718008, 0x718009) AM_WRITE(s16bl_fgscrollx_bank_w) // and tile bank
646   AM_RANGE(0x718010, 0x718011) AM_WRITE(s16bl_bgscrolly_w)
647   AM_RANGE(0x718018, 0x718019) AM_WRITE(s16bl_bgscrollx_w)
648   AM_RANGE(0x718020, 0x718021) AM_WRITE(s16bl_fgpage_w)
649   AM_RANGE(0x718028, 0x718029) AM_WRITE(s16bl_bgpage_w)
650   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(segaic16_paletteram_w)  AM_BASE(&segaic16_paletteram)
851651   AM_RANGE(0x901000, 0x901001) AM_READ_PORT("SERVICE") AM_WRITE(sys16_coinctrl_w)
852652   AM_RANGE(0x901002, 0x901003) AM_READ_PORT("P1")
853653   AM_RANGE(0x901006, 0x901007) AM_READ_PORT("P2")
r7356r7357
855655   AM_RANGE(0x902002, 0x902003) AM_READ_PORT("DSW1")
856656ADDRESS_MAP_END
857657
858
859static UINT16 datsu_page[4];
860
861static void datsu_set_pages(void)
658static void datsu_set_pages( running_machine *machine )
862659{
660   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
863661   UINT16 page;
864662
865   page = ((datsu_page[0] & 0x00f0) >>0) |
866         ((datsu_page[1] & 0x00f0) >>4) |
867         ((datsu_page[2] & 0x00f0) <<8) |
868         ((datsu_page[3] & 0x00f0) <<4);
663   page = ((state->datsu_page[0] & 0x00f0) >>0) |
664         ((state->datsu_page[1] & 0x00f0) >>4) |
665         ((state->datsu_page[2] & 0x00f0) <<8) |
666         ((state->datsu_page[3] & 0x00f0) <<4);
869667
870668
871   set_fg_page( page );
669   set_fg_page(machine, page);
872670
873   page = ((datsu_page[0] & 0x000f) <<4) |
874         ((datsu_page[1] & 0x000f) <<0) |
875         ((datsu_page[2] & 0x000f) <<12) |
876         ((datsu_page[3] & 0x000f) <<8);
671   page = ((state->datsu_page[0] & 0x000f) <<4) |
672         ((state->datsu_page[1] & 0x000f) <<0) |
673         ((state->datsu_page[2] & 0x000f) <<12) |
674         ((state->datsu_page[3] & 0x000f) <<8);
877675
878   set_bg_page( page );
676   set_bg_page(machine, page);
879677}
880678
881679static WRITE16_HANDLER( datsu_page0_w )
882680{
883   COMBINE_DATA(&datsu_page[0]);
884   datsu_set_pages();
681   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
682
683   COMBINE_DATA(&state->datsu_page[0]);
684   datsu_set_pages(space->machine);
885685}
886686
887687static WRITE16_HANDLER( datsu_page1_w )
888688{
889   COMBINE_DATA(&datsu_page[1]);
890   datsu_set_pages();
689   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
690
691   COMBINE_DATA(&state->datsu_page[1]);
692   datsu_set_pages(space->machine);
891693}
892694
893695static WRITE16_HANDLER( datsu_page2_w )
894696{
895   COMBINE_DATA(&datsu_page[2]);
896   datsu_set_pages();
697   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
698
699   COMBINE_DATA(&state->datsu_page[2]);
700   datsu_set_pages(space->machine);
897701}
898702
899703static WRITE16_HANDLER( datsu_page3_w )
900704{
901   COMBINE_DATA(&datsu_page[3]);
902   datsu_set_pages();
705   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
706
707   COMBINE_DATA(&state->datsu_page[3]);
708   datsu_set_pages(space->machine);
903709}
904710
905static ADDRESS_MAP_START( bayroute_b2_map, ADDRESS_SPACE_PROGRAM, 16 )
711static ADDRESS_MAP_START( bayrouteb2_map, ADDRESS_SPACE_PROGRAM, 16 )
906712   AM_RANGE(0x000000, 0x0bffff) AM_ROM
907713   AM_RANGE(0x500000, 0x503fff) AM_RAM // work ram
908714   AM_RANGE(0x600000, 0x600fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
909   AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
910   AM_RANGE(0x710000, 0x710fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
911   AM_RANGE(0x718000, 0x718001) AM_WRITE(sys16bootleg_fgscrolly_w)
912   AM_RANGE(0x718008, 0x718009) AM_WRITE(sys16bootleg_fgscrollx_bank_w) // and tile bank
913   AM_RANGE(0x718010, 0x718011) AM_WRITE(sys16bootleg_bgscrolly_w)
914   AM_RANGE(0x718018, 0x718019) AM_WRITE(sys16bootleg_bgscrollx_w)
715   AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
716   AM_RANGE(0x710000, 0x710fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
717   AM_RANGE(0x718000, 0x718001) AM_WRITE(s16bl_fgscrolly_w)
718   AM_RANGE(0x718008, 0x718009) AM_WRITE(s16bl_fgscrollx_bank_w) // and tile bank
719   AM_RANGE(0x718010, 0x718011) AM_WRITE(s16bl_bgscrolly_w)
720   AM_RANGE(0x718018, 0x718019) AM_WRITE(s16bl_bgscrollx_w)
915721   AM_RANGE(0x718020, 0x718021) AM_WRITE(datsu_page0_w)
916722   AM_RANGE(0x718022, 0x718023) AM_WRITE(datsu_page1_w)
917723   AM_RANGE(0x718024, 0x718025) AM_WRITE(datsu_page2_w)
918724   AM_RANGE(0x718026, 0x718027) AM_WRITE(datsu_page3_w)
919725
920   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&segaic16_paletteram)
726   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(segaic16_paletteram_w)  AM_BASE(&segaic16_paletteram)
921727   AM_RANGE(0x900000, 0x900001) AM_READ_PORT("DSW1")
922728   AM_RANGE(0x900002, 0x900003) AM_READ_PORT("DSW2")
923729   AM_RANGE(0x900006, 0x900007) AM_WRITE(sound_command_w)
r7356r7357
929735static ADDRESS_MAP_START( dduxbl_map, ADDRESS_SPACE_PROGRAM, 16 )
930736   AM_RANGE(0x000000, 0x0bffff) AM_ROM
931737   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(sys16_tilebank_w)
932   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
933   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
738   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
739   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
934740   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
935   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&segaic16_paletteram)
741   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(segaic16_paletteram_w)  AM_BASE(&segaic16_paletteram)
936742   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
937743   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_w)
938744   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
r7356r7357
941747   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
942748   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
943749
944   AM_RANGE(0xC46000, 0xC46001) AM_WRITE(sys16bootleg_fgscrolly_w)
945   AM_RANGE(0xC46008, 0xC46009) AM_WRITE(sys16bootleg_fgscrollx_w)
946   AM_RANGE(0xC46010, 0xC46011) AM_WRITE(sys16bootleg_bgscrolly_w)
947   AM_RANGE(0xC46018, 0xC46019) AM_WRITE(sys16bootleg_bgscrollx_w)
750   AM_RANGE(0xC46000, 0xC46001) AM_WRITE(s16bl_fgscrolly_w)
751   AM_RANGE(0xC46008, 0xC46009) AM_WRITE(s16bl_fgscrollx_w)
752   AM_RANGE(0xC46010, 0xC46011) AM_WRITE(s16bl_bgscrolly_w)
753   AM_RANGE(0xC46018, 0xC46019) AM_WRITE(s16bl_bgscrollx_w)
948754   AM_RANGE(0xC46020, 0xC46021) AM_WRITE(datsu_page0_w)
949755   AM_RANGE(0xC46022, 0xC46023) AM_WRITE(datsu_page1_w)
950756   AM_RANGE(0xC46024, 0xC46025) AM_WRITE(datsu_page2_w)
r7356r7357
953759   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
954760ADDRESS_MAP_END
955761
956static UINT16* goldnax_b2_fgpage;
957static UINT16* goldnax_b2_bgpage;
958
959static WRITE16_HANDLER( goldnax_b2_fgscrollx_w )
762static WRITE16_HANDLER( goldnaxeb2_fgscrollx_w )
960763{
764   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
961765   int scroll = data & 0x1ff;
962   int bank = (data&0xc000)>>14;
963   set_tile_bank( bank );
964   scroll +=0x1f6;
766   int bank = (data & 0xc000) >> 14;
767
768   set_tile_bank(space->machine,  bank);
769   scroll += 0x1f6;
965770   scroll &= 0x3ff;
966   sys16_fg_scrollx = -scroll;
771   state->fg_scrollx = -scroll;
967772}
968773
969static WRITE16_HANDLER( goldnax_b2_bgscrollx_w )
774static WRITE16_HANDLER( goldnaxeb2_bgscrollx_w )
970775{
776   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
971777   int scroll = data & 0x1ff;
972   scroll +=0x1f4;
778
779   scroll += 0x1f4;
973780   scroll &= 0x3ff;
974   sys16_bg_scrollx = -scroll;
781   state->bg_scrollx = -scroll;
975782}
976783
977784
978static WRITE16_HANDLER( goldnax_b2_fgscrolly_w )
785static WRITE16_HANDLER( goldnaxeb2_fgscrolly_w )
979786{
787   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
980788   int scroll = data & 0xff;
789
981790   scroll += 0x1;
982   sys16_fg_scrolly = scroll;
791   state->fg_scrolly = scroll;
983792}
984793
985static WRITE16_HANDLER( goldnax_b2_bgscrolly_w )
794static WRITE16_HANDLER( goldnaxeb2_bgscrolly_w )
986795{
796   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
987797   int scroll = data & 0xff;
988   scroll += 0x1;
989798
990   sys16_bg_scrolly = scroll;
799   scroll += 0x1;
800   state->bg_scrolly = scroll;
991801}
992802
993static WRITE16_HANDLER( goldnax_b2_fgpage_w )
803static WRITE16_HANDLER( goldnaxeb2_fgpage_w )
994804{
805   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
995806   UINT16 page;
996   COMBINE_DATA(&goldnax_b2_fgpage[offset]);
997807
998   page = ((goldnax_b2_fgpage[1] & 0xf) << 0) |
999         ((goldnax_b2_fgpage[0] & 0xf) << 4) |
1000         ((goldnax_b2_fgpage[3] & 0xf) << 8) |
1001         ((goldnax_b2_fgpage[2] & 0xf) << 12);
808   COMBINE_DATA(&state->goldnaxeb2_fgpage[offset]);
1002809
1003   set_fg_page( page^0xffff );
810   page = ((state->goldnaxeb2_fgpage[1] & 0xf) << 0) |
811         ((state->goldnaxeb2_fgpage[0] & 0xf) << 4) |
812         ((state->goldnaxeb2_fgpage[3] & 0xf) << 8) |
813         ((state->goldnaxeb2_fgpage[2] & 0xf) << 12);
1004814
815   set_fg_page(space->machine, page ^ 0xffff);
816
1005817}
1006818
1007static WRITE16_HANDLER( goldnax_b2_bgpage_w )
819static WRITE16_HANDLER( goldnaxeb2_bgpage_w )
1008820{
821   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
1009822   UINT16 page;
1010   COMBINE_DATA(&goldnax_b2_bgpage[offset]);
1011823
1012   page = ((goldnax_b2_bgpage[1] & 0xf) << 0) |
1013         ((goldnax_b2_bgpage[0] & 0xf) << 4) |
1014         ((goldnax_b2_bgpage[3] & 0xf) << 8) |
1015         ((goldnax_b2_bgpage[2] & 0xf) << 12);
824   COMBINE_DATA(&state->goldnaxeb2_bgpage[offset]);
1016825
1017   set_bg_page( page^0xffff );
826   page = ((state->goldnaxeb2_bgpage[1] & 0xf) << 0) |
827         ((state->goldnaxeb2_bgpage[0] & 0xf) << 4) |
828         ((state->goldnaxeb2_bgpage[3] & 0xf) << 8) |
829         ((state->goldnaxeb2_bgpage[2] & 0xf) << 12);
830
831   set_bg_page(space->machine, page ^ 0xffff);
1018832}
1019833
1020static ADDRESS_MAP_START( goldnaxe_b2_map, ADDRESS_SPACE_PROGRAM, 16 )
834static ADDRESS_MAP_START( goldnaxeb2_map, ADDRESS_SPACE_PROGRAM, 16 )
1021835   AM_RANGE(0x000000, 0x0bffff) AM_ROM
1022   AM_RANGE(0x100000, 0x10ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
1023   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
1024   AM_RANGE(0x140000, 0x143fff) AM_RAM_WRITE( segaic16_paletteram_w ) AM_BASE(&segaic16_paletteram)
836   AM_RANGE(0x100000, 0x10ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
837   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
838   AM_RANGE(0x140000, 0x143fff) AM_RAM_WRITE(segaic16_paletteram_w) AM_BASE(&segaic16_paletteram)
1025839   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
1026840   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("DSW2") AM_WRITENOP
1027841   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
r7356r7357
1029843   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
1030844   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
1031845   AM_RANGE(0xc43000, 0xc43001) AM_WRITENOP
1032   AM_RANGE(0xc44000, 0xc44001) AM_WRITE(goldnax_b2_fgscrolly_w)
1033   AM_RANGE(0xc44008, 0xc44009) AM_WRITE(goldnax_b2_fgscrollx_w) // and tile bank
1034   AM_RANGE(0xc44010, 0xc44011) AM_WRITE(goldnax_b2_bgscrolly_w)
1035   AM_RANGE(0xc44018, 0xc44019) AM_WRITE(goldnax_b2_bgscrollx_w)
1036   AM_RANGE(0xc44020, 0xc44027) AM_WRITE(goldnax_b2_bgpage_w) AM_BASE(&goldnax_b2_bgpage)
1037   AM_RANGE(0xc44060, 0xc44067) AM_WRITE(goldnax_b2_fgpage_w) AM_BASE(&goldnax_b2_fgpage)
846   AM_RANGE(0xc44000, 0xc44001) AM_WRITE(goldnaxeb2_fgscrolly_w)
847   AM_RANGE(0xc44008, 0xc44009) AM_WRITE(goldnaxeb2_fgscrollx_w) // and tile bank
848   AM_RANGE(0xc44010, 0xc44011) AM_WRITE(goldnaxeb2_bgscrolly_w)
849   AM_RANGE(0xc44018, 0xc44019) AM_WRITE(goldnaxeb2_bgscrollx_w)
850   AM_RANGE(0xc44020, 0xc44027) AM_WRITE(goldnaxeb2_bgpage_w) AM_BASE_MEMBER(segas1x_bootleg_state, goldnaxeb2_bgpage)
851   AM_RANGE(0xc44060, 0xc44067) AM_WRITE(goldnaxeb2_fgpage_w) AM_BASE_MEMBER(segas1x_bootleg_state, goldnaxeb2_fgpage)
1038852   AM_RANGE(0xc46000, 0xc46001) AM_WRITENOP
1039853   AM_RANGE(0xc43034, 0xc43035) AM_WRITENOP
1040854   AM_RANGE(0xfe0006, 0xfe0007) AM_WRITENOP
r7356r7357
1045859/***************************************************************************/
1046860
1047861
1048static MACHINE_RESET( goldnaxe )
1049{
1050   static const int bank[16] = {
1051      0,1,4,5,
1052      8,9,0,0,
1053      2,3,6,7,
1054      10,11,0,0
1055   };
862static ADDRESS_MAP_START( fpointbl_map, ADDRESS_SPACE_PROGRAM, 16 )
863   AM_RANGE(0x000000, 0x0bffff) AM_ROM
1056864
1057   sys16_obj_bank = bank;
1058}
865   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
866   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
867   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
1059868
1060static DRIVER_INIT( goldnab2 )
1061{
1062   MACHINE_RESET_CALL(sys16_onetime);
1063}
869   AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_w)
870   AM_RANGE(0x601000, 0x601001) AM_READ_PORT("SERVICE")
871   AM_RANGE(0x601002, 0x601003) AM_READ_PORT("P1")
872   AM_RANGE(0x601004, 0x601005) AM_READ_PORT("P2")
873   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW2")
874   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("DSW1")
1064875
1065/***************************************************************************/
876   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(segaic16_paletteram_w)  AM_BASE(&segaic16_paletteram)
877   AM_RANGE(0x843000, 0x843001) AM_WRITENOP
1066878
1067static INPUT_PORTS_START( goldnaxe )
1068   PORT_INCLUDE( sys16_common )
879   AM_RANGE(0xC46000, 0xC46001) AM_WRITE(s16bl_fgscrolly_w)
880   AM_RANGE(0xC46008, 0xC46009) AM_WRITE(s16bl_fgscrollx_w)
881   AM_RANGE(0xC46010, 0xC46011) AM_WRITE(s16bl_bgscrolly_w)
882   AM_RANGE(0xC46018, 0xC46019) AM_WRITE(s16bl_bgscrollx_w)
1069883
1070   PORT_START("DSW2")
1071   PORT_DIPNAME( 0x01, 0x01, "Credits Needed" ) PORT_DIPLOCATION("SW2:1")
1072   PORT_DIPSETTING(    0x01, "1 Credit To Start" )
1073   PORT_DIPSETTING(    0x00, "2 Credits To Start" )
1074   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
1075   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1076   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1077   PORT_DIPNAME( 0x3c, 0x3c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4,5,6") /* Definition according to manual */
1078   PORT_DIPSETTING(    0x00, "Special" )
1079   PORT_DIPSETTING(    0x14, DEF_STR( Easiest ) )
1080   PORT_DIPSETTING(    0x1c, DEF_STR( Easier ) )
1081   PORT_DIPSETTING(    0x34, DEF_STR( Easy ) )
1082   PORT_DIPSETTING(    0x3c, DEF_STR( Normal ) )
1083   PORT_DIPSETTING(    0x38, DEF_STR( Hard ) )
1084   PORT_DIPSETTING(    0x2c, DEF_STR( Harder ) )
1085   PORT_DIPSETTING(    0x28, DEF_STR( Hardest ) )
1086   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" ) /* Listed as "Unused" */
1087   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Listed as "Unused" */
884   AM_RANGE(0xC46020, 0xC46021) AM_WRITE(datsu_page0_w)
885   AM_RANGE(0xc46022, 0xc46023) AM_WRITE(datsu_page1_w)
886   AM_RANGE(0xC46024, 0xC46025) AM_WRITE(datsu_page2_w)
887   AM_RANGE(0xC46026, 0xC46027) AM_WRITE(datsu_page3_w)
1088888
1089/*  PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
1090    PORT_DIPSETTING(    0x08, "1" )
1091    PORT_DIPSETTING(    0x0c, "2" )
1092    PORT_DIPSETTING(    0x04, "3" )
1093    PORT_DIPSETTING(    0x00, "5" )
1094    PORT_DIPNAME( 0x30, 0x30, "Energy Meter" ) PORT_DIPLOCATION("SW2:5,6")
1095    PORT_DIPSETTING(    0x20, "2" )
1096    PORT_DIPSETTING(    0x30, "3" )
1097    PORT_DIPSETTING(    0x10, "4" )
1098    PORT_DIPSETTING(    0x00, "5" )
1099*/
1100INPUT_PORTS_END
889   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
890ADDRESS_MAP_END
1101891
1102/***************************************************************************/
1103892
1104static MACHINE_DRIVER_START( sys16_datsu_sound_cfg )
1105   /* TODO:
1106    - other games might use this sound configuration
1107    - speaker is likely to be mono for the bootlegs, not stereo.
1108    - check msm5205 frequency.
1109    */
1110   MDRV_CPU_ADD("soundcpu",Z80, 4000000)
1111   MDRV_CPU_PROGRAM_MAP(tturfbl_sound_map)
1112   MDRV_CPU_IO_MAP(tturfbl_sound_io_map)
893static WRITE16_HANDLER( eswat_tilebank0_w )
894{
895   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
1113896
1114   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
897   if (ACCESSING_BITS_0_7)
898   {
899      state->eswat_tilebank0 = data & 0xff;
900   }
901}
1115902
1116   MDRV_SOUND_ADD("ymsnd", YM2151, 4000000)
1117   MDRV_SOUND_ROUTE(0, "lspeaker", 0.32)
1118   MDRV_SOUND_ROUTE(1, "rspeaker", 0.32)
903static ADDRESS_MAP_START( eswatbl_map, ADDRESS_SPACE_PROGRAM, 16 )
904   AM_RANGE(0x000000, 0x07ffff) AM_ROM
1119905
1120   MDRV_SOUND_ADD("5205", MSM5205, 220000)
1121   MDRV_SOUND_CONFIG(tturfbl_msm5205_interface)
1122   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80)
1123   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
1124MACHINE_DRIVER_END
906   AM_RANGE(0x3e2000, 0x3e2001) AM_WRITE(eswat_tilebank0_w) // external tile bank ( > 0x4000 tiles )
1125907
1126static MACHINE_DRIVER_START( goldnaxe_b1 )
908   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
909   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
910   AM_RANGE(0x418000, 0x418001) AM_WRITE(s16bl_bgscrolly_w)
911   AM_RANGE(0x418008, 0x418009) AM_WRITE(s16bl_bgscrollx_w) // and tile bank
912   AM_RANGE(0x418010, 0x418011) AM_WRITE(s16bl_fgscrolly_w)
913   AM_RANGE(0x418018, 0x418019) AM_WRITE(s16bl_fgscrollx_bank_w)
914   AM_RANGE(0x418020, 0x418021) AM_WRITE(s16bl_bgpage_w)
915   AM_RANGE(0x418028, 0x418029) AM_WRITE(s16bl_fgpage_w)
1127916
1128   /* basic machine hardware */
1129   MDRV_CPU_ADD("maincpu", M68000, 10000000)
1130   MDRV_CPU_PROGRAM_MAP(goldnaxe_b1_map)
1131   MDRV_CPU_VBLANK_INT("screen", sys16_interrupt)
917   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
918   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(segaic16_paletteram_w)  AM_BASE(&segaic16_paletteram)
919   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
920   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
921   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
922   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
923   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
924   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
925   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
926   AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP
927   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
928ADDRESS_MAP_END
1132929
1133   /* video hardware */
1134   MDRV_SCREEN_ADD("screen", RASTER)
1135   MDRV_SCREEN_REFRESH_RATE(60)
1136   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1137   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1138   MDRV_SCREEN_SIZE(40*8, 28*8)
1139   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
930/***************************************************************************/
1140931
1141   MDRV_GFXDECODE(sys16)
1142   MDRV_PALETTE_LENGTH(2048*ShadowColorsMultiplier)
932static ADDRESS_MAP_START( tetrisbl_map, ADDRESS_SPACE_PROGRAM, 16 )
933   AM_RANGE(0x000000, 0x03ffff) AM_ROM
934   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
935   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
1143936
1144   MDRV_PALETTE_INIT( all_black )
1145   MDRV_VIDEO_START(system16)
1146   MDRV_VIDEO_UPDATE(system16)
937   AM_RANGE(0x418000, 0x418001) AM_WRITE(s16bl_fgscrolly_w)
938   AM_RANGE(0x418008, 0x418009) AM_WRITE(s16bl_fgscrollx_w)
939   AM_RANGE(0x418010, 0x418011) AM_WRITE(s16bl_bgscrolly_w)
940   AM_RANGE(0x418018, 0x418019) AM_WRITE(s16bl_bgscrollx_w)
941   AM_RANGE(0x418020, 0x418021) AM_WRITE(s16bl_fgpage_w)
942   AM_RANGE(0x418028, 0x418029) AM_WRITE(s16bl_bgpage_w)
1147943
1148   MDRV_MACHINE_RESET(goldnaxe)
1149MACHINE_DRIVER_END
944   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
945   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(segaic16_paletteram_w)  AM_BASE(&segaic16_paletteram)
946   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
947   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
948   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
949   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
950   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
951   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
952   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
953   AM_RANGE(0xc43034, 0xc43035) AM_WRITENOP
954   AM_RANGE(0xc80000, 0xc80001) AM_NOP
955   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
956ADDRESS_MAP_END
1150957
1151958
1152static MACHINE_DRIVER_START( goldnaxe_b2 )
1153   /* basic machine hardware */
1154   MDRV_IMPORT_FROM(goldnaxe_b1)
1155   MDRV_CPU_MODIFY("maincpu")
1156   MDRV_CPU_PROGRAM_MAP(goldnaxe_b2_map)
1157MACHINE_DRIVER_END
959static READ16_HANDLER( beautyb_unkx_r )
960{
961   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
1158962
1159static MACHINE_DRIVER_START( bayrouteb1 )
1160   /* basic machine hardware */
1161   MDRV_IMPORT_FROM(goldnaxe_b1)
1162   MDRV_CPU_MODIFY("maincpu")
1163   MDRV_CPU_PROGRAM_MAP(bayroute_b1_map)
1164MACHINE_DRIVER_END
963   state->beautyb_unkx++;
964   state->beautyb_unkx &= 0x7f;
965   return state->beautyb_unkx;
966}
1165967
1166static MACHINE_DRIVER_START( bayrouteb2 )
1167   /* basic machine hardware */
1168   MDRV_IMPORT_FROM(goldnaxe_b1)
1169   MDRV_CPU_MODIFY("maincpu")
1170   MDRV_CPU_PROGRAM_MAP(bayroute_b2_map)
968static ADDRESS_MAP_START( beautyb_map, ADDRESS_SPACE_PROGRAM, 16 )
969   AM_RANGE(0x000000, 0x00ffff) AM_ROM AM_WRITENOP
970   AM_RANGE(0x010000, 0x03ffff) AM_WRITENOP
1171971
1172   MDRV_IMPORT_FROM(sys16_datsu_sound_cfg)
1173MACHINE_DRIVER_END
972   AM_RANGE(0x0280D6, 0x0280D7) AM_READ(beautyb_unkx_r)
973   AM_RANGE(0x0280D8, 0x0280D9) AM_READ(beautyb_unkx_r)
1174974
1175static MACHINE_DRIVER_START( dduxbl )
975   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
976   AM_RANGE(0x410000, 0x413fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
1176977
1177   /* basic machine hardware */
1178   MDRV_IMPORT_FROM(system16)
1179   MDRV_CPU_MODIFY("maincpu")
1180   MDRV_CPU_PROGRAM_MAP(dduxbl_map)
1181MACHINE_DRIVER_END
978   AM_RANGE(0x418000, 0x418001) AM_WRITE(s16bl_bgscrolly_w)
979   AM_RANGE(0x418008, 0x418009) AM_WRITE(s16bl_bgscrollx_w)
980   AM_RANGE(0x418010, 0x418011) AM_WRITE(s16bl_fgscrolly_w)
981   AM_RANGE(0x418018, 0x418019) AM_WRITE(s16bl_fgscrollx_w)
982   AM_RANGE(0x418020, 0x418021) AM_WRITE(s16bl_bgpage_w)
983   AM_RANGE(0x418028, 0x418029) AM_WRITE(s16bl_fgpage_w)
1182984
985   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
986   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(segaic16_paletteram_w)  AM_BASE(&segaic16_paletteram)
1183987
1184static ADDRESS_MAP_START( fpointbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1185   AM_RANGE(0x000000, 0x0bffff) AM_ROM
988   AM_RANGE(0xC41000, 0xC41001) AM_READ(beautyb_unkx_r )
989   AM_RANGE(0xC41002, 0xC41003) AM_READ(beautyb_unkx_r )
1186990
1187   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
1188   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
1189   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
991   AM_RANGE(0xc40000, 0xc40001) AM_WRITENOP
992   AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP
1190993
994   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
995ADDRESS_MAP_END
996
997/***************************************************************************/
998
999static ADDRESS_MAP_START( tturfbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1000   AM_RANGE(0x000000, 0x03ffff) AM_ROM
1001   AM_RANGE(0x200000, 0x203fff) AM_RAM // work ram
1002   AM_RANGE(0x300000, 0x300fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
1003   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
1004   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
1005   AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(segaic16_paletteram_w) AM_BASE(&segaic16_paletteram)
1006   AM_RANGE(0x600000, 0x600001) AM_WRITE(sys16_coinctrl_w)
1007   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW2")
1008   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("DSW1")
11911009   AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_w)
11921010   AM_RANGE(0x601000, 0x601001) AM_READ_PORT("SERVICE")
11931011   AM_RANGE(0x601002, 0x601003) AM_READ_PORT("P1")
11941012   AM_RANGE(0x601004, 0x601005) AM_READ_PORT("P2")
1195   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW2")
1196   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("DSW1")
1013   AM_RANGE(0x602000, 0x602001) AM_READ_PORT("DSW2")
1014   AM_RANGE(0x602002, 0x602003) AM_READ_PORT("DSW1")
1015   AM_RANGE(0xc44000, 0xc44001) AM_WRITENOP
11971016
1198   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&segaic16_paletteram)
1199   AM_RANGE(0x843000, 0x843001) AM_WRITENOP
1200
1201   AM_RANGE(0xC46000, 0xC46001) AM_WRITE(sys16bootleg_fgscrolly_w)
1202   AM_RANGE(0xC46008, 0xC46009) AM_WRITE(sys16bootleg_fgscrollx_w)
1203   AM_RANGE(0xC46010, 0xC46011) AM_WRITE(sys16bootleg_bgscrolly_w)
1204   AM_RANGE(0xC46018, 0xC46019) AM_WRITE(sys16bootleg_bgscrollx_w)
1205
1017   AM_RANGE(0xC46000, 0xC46001) AM_WRITE(s16bl_fgscrolly_w)
1018   AM_RANGE(0xC46008, 0xC46009) AM_WRITE(s16bl_fgscrollx_w)
1019   AM_RANGE(0xC46010, 0xC46011) AM_WRITE(s16bl_bgscrolly_w)
1020   AM_RANGE(0xC46018, 0xC46019) AM_WRITE(s16bl_bgscrollx_w)
12061021   AM_RANGE(0xC46020, 0xC46021) AM_WRITE(datsu_page0_w)
12071022   AM_RANGE(0xc46022, 0xc46023) AM_WRITE(datsu_page1_w)
12081023   AM_RANGE(0xC46024, 0xC46025) AM_WRITE(datsu_page2_w)
12091024   AM_RANGE(0xC46026, 0xC46027) AM_WRITE(datsu_page3_w)
1210
1211   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
12121025ADDRESS_MAP_END
12131026
1027/***************************************************************************/
12141028
1215static MACHINE_RESET( fpointbl )
1029static WRITE16_HANDLER( sys18_refreshenable_w )
12161030{
1031   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
1032
1033   if (ACCESSING_BITS_0_7)
1034   {
1035      state->refreshenable = data & 0x02;
1036   }
12171037}
12181038
1219static DRIVER_INIT( fpointbl )
1039static WRITE16_HANDLER( sys18_tilebank_w )
12201040{
1221   MACHINE_RESET_CALL(sys16_onetime);
1222   //sys16_video_config(fpoint_update_proc, -0xb8, NULL);
1041   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
1042
1043   if (ACCESSING_BITS_0_7)
1044   {
1045      state->tile_bank0 = (data >> 0) & 0x0f;
1046      state->tile_bank1 = (data >> 4) & 0x0f;
1047   }
12231048}
12241049
1050static READ8_HANDLER( system18_bank_r )
1051{
1052   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
12251053
1054   if (state->sound_bank != NULL)
1055      return state->sound_bank[offset];
12261056
1227static MACHINE_DRIVER_START( fpointbl )
1057   return 0xff;
1058}
12281059
1229   /* basic machine hardware */
1230   MDRV_IMPORT_FROM(system16)
1231   MDRV_CPU_MODIFY("maincpu")
1232   MDRV_CPU_PROGRAM_MAP(fpointbl_map)
1060static ADDRESS_MAP_START( sound_18_map, ADDRESS_SPACE_PROGRAM, 8 )
1061   AM_RANGE(0x0000, 0x9fff) AM_ROM
1062   AM_RANGE(0xa000, 0xbfff) AM_READ(system18_bank_r)
1063   /**** D/A register ****/
1064   AM_RANGE(0xc000, 0xc008) AM_DEVWRITE("5c68", rf5c68_w)
1065   AM_RANGE(0xd000, 0xdfff) AM_DEVREADWRITE("5c68", rf5c68_mem_r, rf5c68_mem_w)
1066   AM_RANGE(0xe000, 0xffff) AM_RAM   //??
1067ADDRESS_MAP_END
12331068
1234   MDRV_CPU_MODIFY("soundcpu")
1235   MDRV_CPU_PROGRAM_MAP(fpointbl_sound_map)
12361069
1237   MDRV_MACHINE_RESET(fpointbl)
1238MACHINE_DRIVER_END
1070static WRITE8_HANDLER( sys18_soundbank_w )
1071{
1072   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
1073   UINT8 *mem = memory_region(space->machine, "soundcpu");
1074   int rom = (data >> 6) & 3;
1075   int bank = (data & 0x3f);
1076   int mask = state->sound_info[rom * 2 + 0];
1077   int offs = state->sound_info[rom * 2 + 1];
12391078
1079   if (mask)
1080      state->sound_bank = &mem[0x10000 + offs + ((bank & mask) << 13)];
1081   else
1082      state->sound_bank = NULL;
1083}
12401084
1085static ADDRESS_MAP_START( sound_18_io_map, ADDRESS_SPACE_IO, 8 )
1086   ADDRESS_MAP_GLOBAL_MASK(0xff)
1087   AM_RANGE(0x80, 0x83) AM_DEVREADWRITE("3438.0", ym3438_r, ym3438_w)
1088   AM_RANGE(0x90, 0x93) AM_DEVREADWRITE("3438.1", ym3438_r, ym3438_w)
1089   AM_RANGE(0xa0, 0xa0) AM_WRITE(sys18_soundbank_w)
1090   AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r)
1091ADDRESS_MAP_END
12411092
1242static ADDRESS_MAP_START( eswatbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1243   AM_RANGE(0x000000, 0x07ffff) AM_ROM
12441093
1245   AM_RANGE(0x3e2000, 0x3e2001) AM_WRITE(eswat_tilebank0_w) // external tile bank ( > 0x4000 tiles )
1094/***************************************************************************
12461095
1247   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
1248   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
1249   AM_RANGE(0x418000, 0x418001) AM_WRITE(sys16bootleg_bgscrolly_w)
1250   AM_RANGE(0x418008, 0x418009) AM_WRITE(sys16bootleg_bgscrollx_w) // and tile bank
1251   AM_RANGE(0x418010, 0x418011) AM_WRITE(sys16bootleg_fgscrolly_w)
1252   AM_RANGE(0x418018, 0x418019) AM_WRITE(sys16bootleg_fgscrollx_bank_w)
1253   AM_RANGE(0x418020, 0x418021) AM_WRITE(sys16bootleg_bgpage_w)
1254   AM_RANGE(0x418028, 0x418029) AM_WRITE(sys16bootleg_fgpage_w)
1096    Shadow Dancer (Bootleg)
12551097
1256   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
1257   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&segaic16_paletteram)
1258   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
1259   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
1260   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
1261   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
1262   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
1263   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
1264   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
1265   AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP
1266   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
1267ADDRESS_MAP_END
1098    This seems to be a modified version of shdancer. It has no warning screen, displays English text during the
1099    attract sequence, and has a 2P input test. The 'Sega' copyright text was changed to 'Datsu', and their
1100    logo is missing.
12681101
1102    Access to the configuration registers, I/O chip, and VDP are done even though it's likely none of this hardware
1103    exists in the bootleg. For example:
12691104
1270static MACHINE_DRIVER_START( eswatbl )
1105    - Most I/O port access has been redirected to new addresses.
1106    - Z80 sound command has been redirected to a new address.
1107    - The tilebank routine which saves the bank value in VDP VRAM has a form of protection has been modified to store
1108      the tilebank value directly to $E4001F.
1109    - Implementing screen blanking control via $E4001D leaves the screen blanked at the wrong times (after coin-up).
12711110
1272   /* basic machine hardware */
1273   MDRV_IMPORT_FROM(system16_7759)
1274   MDRV_CPU_MODIFY("maincpu")
1275   MDRV_CPU_PROGRAM_MAP(eswatbl_map)
1111    This is probably due to unmodified parts of the original code accessing these components, which would be ignored
1112    on the bootleg hardware. Both the I/O chip and VDP are supported in this driver, just as I don't know for certain
1113    how much of either are present on the real board.
12761114
1277   MDRV_MACHINE_RESET(eswatbl)
1278MACHINE_DRIVER_END
1115    Bootleg specific addresses:
12791116
1117    C40001 = DIP switch #1
1118    C40003 = DIP switch #2
1119    C40007 = Z80 sound command
1120    C41001 = Service input
1121    C41003 = Player 1 input
1122    C41005 = Player 2 input
1123    C44000 = Has 'clr.w' done after setting tile bank in $E4000F.
1124    C460xx = Extra video hardware controls
12801125
1281/***************************************************************************/
1126    Here are the I/O chip addresses accessed:
12821127
1128    E40001 = Player 1
1129    E40007 = Miscellaneous outputs (coin control, etc.)
1130    E4000F = Tile bank
1131    E4001D = CNT2-0 pin output state
1132    E4001F = I/O chip port direction
12831133
1284/***************************************************************************/
1134***************************************************************************/
12851135
1136static WRITE16_HANDLER( sound_command_irq_w )
1137{
1138   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
12861139
1287static ADDRESS_MAP_START( system16a_bootleg_passsht_map, ADDRESS_SPACE_PROGRAM, 16 )
1288   AM_RANGE(0x000000, 0x01ffff) AM_ROM
1140   if (ACCESSING_BITS_0_7)
1141   {
1142      soundlatch_w(space, 0, data & 0xff);
1143      cpu_set_input_line(state->soundcpu, 0, HOLD_LINE);
1144   }
1145}
12891146
1290   AM_RANGE(0x400000, 0x407fff) AM_RAM // tilemap ram on original, buffer on bootleg
1291   AM_RANGE(0x409000, 0x409fff) AM_RAM AM_BASE(&system16a_bootleg_bg0_tileram)
1292   AM_RANGE(0x40a000, 0x40afff) AM_RAM AM_BASE(&system16a_bootleg_bg1_tileram)
1293   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_BASE(&sys16_textram)
1294
1147static ADDRESS_MAP_START( shdancbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1148   AM_RANGE(0x000000, 0x07ffff) AM_ROM
1149   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
1150   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
12951151   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
1296   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( segaic16_paletteram_w ) AM_BASE(&segaic16_paletteram)
1297   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
1152   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(segaic16_paletteram_w) AM_BASE(&segaic16_paletteram)
1153   AM_RANGE(0xc00000, 0xc0ffff) AM_NOP
1154   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("COINAGE")
1155   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
1156   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_irq_w)
1157   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
12981158   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
12991159   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
1300   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
1301   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
1302   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
1303   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
1304   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(system16a_bootleg_bgscrolly_w)
1305   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(system16a_bootleg_bgscrollx_w)
1306   AM_RANGE(0xc46004, 0xc46005) AM_WRITE(system16a_bootleg_fgscrolly_w)
1307   AM_RANGE(0xc46006, 0xc46007) AM_WRITE(system16a_bootleg_fgscrollx_w)
1308   AM_RANGE(0xc46008, 0xc46009) AM_WRITE(system16a_bootleg_tilemapselect_w)
1160   AM_RANGE(0xc44000, 0xc44001) AM_WRITENOP // only used via clr.w after tilebank set
13091161
1310   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
1162
1163   AM_RANGE(0xe4001c, 0xe4001d) AM_WRITENOP // to prevent access to screen blanking control below
1164   AM_RANGE(0xe40000, 0xe4ffff) AM_NOP
1165   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP // config regs
1166   AM_RANGE(0xffc000, 0xffffff) AM_RAM
13111167ADDRESS_MAP_END
13121168
1313static int passht4b_io1_val;
1314static int passht4b_io2_val;
1315static int passht4b_io3_val;
13161169
1317static READ16_HANDLER( passht4b_service_r )
1318{
1319   UINT16 val=input_port_read(space->machine, "SERVICE");
1320   if(!(input_port_read(space->machine, "P1") & 0x40)) val&=0xef;
1321   if(!(input_port_read(space->machine, "P2") & 0x40)) val&=0xdf;
1322   if(!(input_port_read(space->machine, "P3") & 0x40)) val&=0xbf;
1323   if(!(input_port_read(space->machine, "P4") & 0x40)) val&=0x7f;
1170/***************************************************************************
13241171
1325   passht4b_io3_val=(input_port_read(space->machine, "P1") << 4) | (input_port_read(space->machine, "P3") & 0xf);
1326   passht4b_io2_val=(input_port_read(space->machine, "P2") << 4) | (input_port_read(space->machine, "P4") & 0xf);
1172    Sound hardware for Shadow Dancer (Datsu bootleg)
13271173
1328   passht4b_io1_val=0xff;
1174    Z80 memory map
1175    0000-7FFF : ROM (fixed)
1176    8000-BFFF : ROM (banked)
1177    C000-C007 : ?
1178    C400      : Sound command (r/o)
1179    C800      : MSM5205 sample data output (w/o)
1180    CC00-CC03 : YM3438 #1
1181    D000-D003 : YM3438 #2
1182    D400      : ROM bank control (w/o)
1183    DF00-DFFF : ?
1184    E000-FFFF : Work RAM
13291185
1330   // player 1 buttons
1331   if(!(input_port_read(space->machine, "P1") & 0x10)) passht4b_io1_val &=0xfe;
1332   if(!(input_port_read(space->machine, "P1") & 0x20)) passht4b_io1_val &=0xfd;
1333   if(!(input_port_read(space->machine, "P1") & 0x80)) passht4b_io1_val &=0xfc;
1186    The unused memory locations and I/O port access seem to be remnants of the original code that were not patched out:
13341187
1335   // player 2 buttons
1336   if(!(input_port_read(space->machine, "P2") & 0x10)) passht4b_io1_val &=0xfb;
1337   if(!(input_port_read(space->machine, "P2") & 0x20)) passht4b_io1_val &=0xf7;
1338   if(!(input_port_read(space->machine, "P2") & 0x80)) passht4b_io1_val &=0xf3;
1188    - Program accesses RF5C68A channel registes at $C000-$C007
1189    - Program clears RF5C68A wave memory at $DF00-$DFFF
1190    - Program writes to port $A0 to access sound ROM banking control latch
1191    - Program reads port $C0 to access sound command
13391192
1340   // player 3 buttons
1341   if(!(input_port_read(space->machine, "P3") & 0x10)) passht4b_io1_val &=0xef;
1342   if(!(input_port_read(space->machine, "P3") & 0x20)) passht4b_io1_val &=0xdf;
1343   if(!(input_port_read(space->machine, "P3") & 0x80)) passht4b_io1_val &=0xcf;
1193    Interrupts
13441194
1345   // player 4 buttons
1346   if(!(input_port_read(space->machine, "P4") & 0x10)) passht4b_io1_val &=0xbf;
1347   if(!(input_port_read(space->machine, "P4") & 0x20)) passht4b_io1_val &=0x7f;
1348   if(!(input_port_read(space->machine, "P4") & 0x80)) passht4b_io1_val &=0x3f;
1195    IRQ = Triggered when 68000 writes sound command. Z80 reads from $C400.
1196    NMI = Triggered when second nibble of sample data has been output to the MSM5205.
1197          Program copies sample data from ROM bank to the MSM5205 sample data buffer at $C800.
13491198
1350   return val;
1199    ROM banking seems correct.
1200    It doesn't look like there's a way to reset the MSM5205, unless that's related to bit 7 of the
1201    ROM bank control register.
1202    MSM5205 clock speed hasn't been confirmed.
1203
1204***************************************************************************/
1205
1206static WRITE8_HANDLER( shdancbl_msm5205_data_w )
1207{
1208   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
1209   state->sample_buffer = data;
13511210}
13521211
1353static READ16_HANDLER( passht4b_io1_r )
1212static void shdancbl_msm5205_callback(running_device *device)
13541213{
1355   return passht4b_io1_val;
1214   segas1x_bootleg_state *state = (segas1x_bootleg_state *)device->machine->driver_data;
1215   msm5205_data_w(device, state->sample_buffer & 0x0f);
1216
1217   state->sample_buffer >>=  4;
1218   state->sample_select ^=  1;
1219   if (state->sample_select == 0)
1220      cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, PULSE_LINE);
13561221}
13571222
1358static READ16_HANDLER( passht4b_io2_r )
1223static const msm5205_interface shdancbl_msm5205_interface =
13591224{
1360   return passht4b_io2_val;
1225   shdancbl_msm5205_callback,
1226   MSM5205_S48_4B
1227};
1228
1229static READ8_HANDLER( shdancbl_soundbank_r )
1230{
1231   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
1232
1233   if (state->soundbank_ptr)
1234      return state->soundbank_ptr[offset & 0x3fff];
1235   return 0xff;
13611236}
13621237
1363static READ16_HANDLER( passht4b_io3_r )
1238static WRITE8_HANDLER( shdancbl_bankctrl_w )
13641239{
1365   return passht4b_io3_val;
1240   segas1x_bootleg_state *state = (segas1x_bootleg_state *)space->machine->driver_data;
1241   UINT8 *mem = memory_region(space->machine, "soundcpu");
1242
1243   switch (data)
1244   {
1245      case 0:
1246         state->soundbank_ptr = &mem[0x18000]; /* IC45 8000-BFFF */
1247         break;
1248      case 1:
1249         state->soundbank_ptr = &mem[0x1C000]; /* IC45 C000-FFFF */
1250         break;
1251      case 2:
1252         state->soundbank_ptr = &mem[0x20000]; /* IC46 0000-3FFF */
1253         break;
1254      case 3:
1255         state->soundbank_ptr = &mem[0x24000]; /* IC46 4000-7FFF */
1256         break;
1257      default:
1258         state->soundbank_ptr = NULL;
1259         logerror("Invalid bank setting %02X (%04X)\n", data, cpu_get_pc(space->cpu));
1260         break;
1261   }
13661262}
13671263
1368static ADDRESS_MAP_START( system16a_bootleg_passht4b_map, ADDRESS_SPACE_PROGRAM, 16 )
1369   AM_RANGE(0x000000, 0x01ffff) AM_ROM
1370   AM_RANGE(0x400000, 0x407fff) AM_RAM // tilemap ram on original, buffer on bootleg
1371   AM_RANGE(0x409000, 0x40afff) AM_RAM AM_BASE(&system16a_bootleg_bg0_tileram)
1372   AM_RANGE(0x40a000, 0x40bfff) AM_RAM AM_BASE(&system16a_bootleg_bg1_tileram)
1373   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_BASE(&sys16_textram)
1264static ADDRESS_MAP_START(shdancbl_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1265   AM_RANGE(0x0000, 0x7fff) AM_ROM
1266   AM_RANGE(0x8000, 0xbfff) AM_READ(shdancbl_soundbank_r)
1267   AM_RANGE(0xc000, 0xc00f) AM_WRITENOP
1268   AM_RANGE(0xc400, 0xc400) AM_READ(soundlatch_r)
1269   AM_RANGE(0xc800, 0xc800) AM_WRITE(shdancbl_msm5205_data_w)
1270   AM_RANGE(0xcc00, 0xcc03) AM_DEVREADWRITE("3438.0", ym3438_r, ym3438_w)
1271   AM_RANGE(0xd000, 0xd003) AM_DEVREADWRITE("3438.1", ym3438_r, ym3438_w)
1272   AM_RANGE(0xd400, 0xd400) AM_WRITE(shdancbl_bankctrl_w)
1273   AM_RANGE(0xdf00, 0xdfff) AM_NOP
1274   AM_RANGE(0xe000, 0xffff) AM_RAM
1275ADDRESS_MAP_END
1276
1277
1278static ADDRESS_MAP_START( shdancbl_sound_io_map, ADDRESS_SPACE_IO, 8 )
1279   ADDRESS_MAP_GLOBAL_MASK(0xff)
1280   AM_RANGE(0xa0, 0xbf) AM_WRITENOP
1281   AM_RANGE(0xc0, 0xdf) AM_READNOP
1282ADDRESS_MAP_END
1283
1284
1285/***************************************************************************
1286
1287    Moonwalker (Bootleg)
1288
1289***************************************************************************/
1290
1291static ADDRESS_MAP_START( mwalkbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1292   AM_RANGE(0x000000, 0x07ffff) AM_ROM
1293   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
1294   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
13741295   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
1375   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&segaic16_paletteram)
1376   AM_RANGE(0xc41000, 0xc41001) AM_READ(passht4b_service_r)
1377   AM_RANGE(0xc41002, 0xc41003) AM_READ(passht4b_io1_r)
1378   AM_RANGE(0xc41004, 0xc41005) AM_READ(passht4b_io2_r)
1379   AM_RANGE(0xc41006, 0xc41007) AM_READ(passht4b_io3_r)
1380   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
1381   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
1382   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
1383   AM_RANGE(0xc43000, 0xc43001) AM_READ_PORT("P1")      // test mode only
1384   AM_RANGE(0xc43002, 0xc43003) AM_READ_PORT("P2")
1385   AM_RANGE(0xc43004, 0xc43005) AM_READ_PORT("P3")
1386   AM_RANGE(0xc43006, 0xc43007) AM_READ_PORT("P4")
1387   AM_RANGE(0xc4600a, 0xc4600b) AM_WRITE(sys16_coinctrl_w)   /* coin counter doesn't work */
1388   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(system16a_bootleg_bgscrolly_w)
1389   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(system16a_bootleg_bgscrollx_w)
1390   AM_RANGE(0xc46004, 0xc46005) AM_WRITE(system16a_bootleg_fgscrolly_w)
1391   AM_RANGE(0xc46006, 0xc46007) AM_WRITE(system16a_bootleg_fgscrollx_w)
1392   AM_RANGE(0xc46008, 0xc46009) AM_WRITE(system16a_bootleg_tilemapselect_w)
1296   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(segaic16_paletteram_w) AM_BASE(&segaic16_paletteram)
13931297
1394   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
1298   /* bootleg video regs */
1299   /*AM_RANGE(0xc00000, 0xc00001) AM_NOP
1300    AM_RANGE(0xc00002, 0xc00003) AM_NOP
1301    AM_RANGE(0xc00004, 0xc00005) AM_NOP // tile bank?
1302    AM_RANGE(0xc00006, 0xc00007) AM_NOP
1303    AM_RANGE(0xc44000, 0xc44001) AM_NOP
1304    AM_RANGE(0xc46000, 0xc46001) AM_NOP
1305    AM_RANGE(0xc46200, 0xc46201) AM_NOP
1306    AM_RANGE(0xc46400, 0xc464ff) AM_NOP // scroll?
1307    AM_RANGE(0xc46500, 0xc465ff) AM_NOP // scroll?
1308    */
1309
1310   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("COINAGE")
1311   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
1312   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_nmi_w)
1313   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
1314   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
1315   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
1316   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P3")
1317   AM_RANGE(0xc41008, 0xc41009) AM_READNOP // figure this out, extra input for 3p?
1318   AM_RANGE(0xc46600, 0xc46601) AM_WRITE(sys18_refreshenable_w)
1319   AM_RANGE(0xc46800, 0xc46801) AM_WRITE(sys18_tilebank_w)
1320
1321   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP // config regs
1322   AM_RANGE(0xffc000, 0xffffff) AM_RAM
13951323ADDRESS_MAP_END
13961324
1397/***************************************************************************/
13981325
1326/***************************************************************************
13991327
1400static MACHINE_RESET( passsht )
1401{
1402   sys16_sprxoffset = -0x48;
1403}
1328    Alien Storm (Bootleg)
14041329
1405static MACHINE_RESET( passht4b )
1406{
1407   sys16_sprxoffset = -0xb8;
1408}
1330***************************************************************************/
14091331
1410static DRIVER_INIT( passsht )
1411{
1412   MACHINE_RESET_CALL(sys16_onetime);
1413}
1332/* bootleg doesn't have real vdp or i/o */
1333static ADDRESS_MAP_START( astormbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1334   AM_RANGE(0x000000, 0x07ffff) AM_ROM
1335   AM_RANGE(0x100000, 0x10ffff) AM_RAM_WRITE(sys16_tileram_w) AM_BASE_MEMBER(segas1x_bootleg_state, tileram)
1336   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE(sys16_textram_w) AM_BASE_MEMBER(segas1x_bootleg_state, textram)
1337   AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE(segaic16_paletteram_w) AM_BASE(&segaic16_paletteram)
1338   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
1339   AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("COINAGE")
1340   AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("DSW1")
1341   AM_RANGE(0xa00006, 0xa00007) AM_WRITE(sound_command_nmi_w)
1342   AM_RANGE(0xa0000e, 0xa0000f) AM_WRITE(sys18_tilebank_w)
1343   AM_RANGE(0xa01000, 0xa01001) AM_READ_PORT("SERVICE")
1344   AM_RANGE(0xa01002, 0xa01003) AM_READ_PORT("P1")
1345   AM_RANGE(0xa01004, 0xa01005) AM_READ_PORT("P2")
1346   AM_RANGE(0xa01006, 0xa01007) AM_READ_PORT("P3")
1347   AM_RANGE(0xa02100, 0xa02101) AM_NOP
1348   AM_RANGE(0xa03000, 0xa03001) AM_NOP
1349   AM_RANGE(0xa03034, 0xa03035) AM_NOP
14141350
1415static DRIVER_INIT( passht4b )
1416{
1417   MACHINE_RESET_CALL(sys16_onetime);
1418}
1351   /* bootleg video regs */
1352   AM_RANGE(0xc00000, 0xc00001) AM_NOP
1353   AM_RANGE(0xc00002, 0xc00003) AM_NOP
1354   AM_RANGE(0xc00004, 0xc00005) AM_NOP // tile bank?
1355   AM_RANGE(0xc00006, 0xc00007) AM_NOP
1356   AM_RANGE(0xc44000, 0xc44001) AM_NOP
1357   AM_RANGE(0xc46000, 0xc46001) AM_NOP
1358   AM_RANGE(0xc46200, 0xc46201) AM_NOP
1359   AM_RANGE(0xc46400, 0xc464ff) AM_NOP // scroll?
1360   AM_RANGE(0xc46500, 0xc465ff) AM_NOP // scroll?
14191361
1420/***************************************************************************/
1362   AM_RANGE(0xc46600, 0xc46601) AM_WRITE(sys18_refreshenable_w)
1363   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP
1364   AM_RANGE(0xffc000, 0xffffff) AM_RAM
1365ADDRESS_MAP_END
14211366
1367/*************************************
1368 *
1369 *  Input ports
1370 *
1371 *************************************/
1372
1373/* System 16A/B Bootlegs */
1374static INPUT_PORTS_START( sys16_common )
1375   PORT_START("P1")
1376   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 )
1377   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
1378   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
1379   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1380   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1381   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1382   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1383   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1384
1385   PORT_START("P2")
1386   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
1387   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1388   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1389   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1390   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1391   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1392   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1393   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1394
1395   PORT_START("SERVICE")
1396   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1397   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1398   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
1399   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
1400   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1401   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1402   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1403   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1404
1405   PORT_START("DSW1")
1406   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
1407   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
1408   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
1409   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
1410   PORT_DIPSETTING(    0x05, "2 Coins/1 Credit 5/3 6/4" )
1411   PORT_DIPSETTING(    0x04, "2 Coins/1 Credit 4/3" )
1412   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
1413   PORT_DIPSETTING(    0x01, "1 Coin/1 Credit 2/3" )
1414   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 4/5" )
1415   PORT_DIPSETTING(    0x03, "1 Coin/1 Credit 5/6" )
1416   PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
1417   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
1418   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
1419   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
1420   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
1421   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
1422   PORT_DIPSETTING(    0x00, "Free Play (if Coin B too) or 1/1" )
1423   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
1424   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
1425   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
1426   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
1427   PORT_DIPSETTING(    0x50, "2 Coins/1 Credit 5/3 6/4" )
1428   PORT_DIPSETTING(    0x40, "2 Coins/1 Credit 4/3" )
1429   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
1430   PORT_DIPSETTING(    0x10, "1 Coin/1 Credit 2/3" )
1431   PORT_DIPSETTING(    0x20, "1 Coin/1 Credit 4/5" )
1432   PORT_DIPSETTING(    0x30, "1 Coin/1 Credit 5/6" )
1433   PORT_DIPSETTING(    0x60, DEF_STR( 2C_3C ) )
1434   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
1435   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
1436   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
1437   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
1438   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
1439   PORT_DIPSETTING(    0x00, "Free Play (if Coin A too) or 1/1" )
1440INPUT_PORTS_END
1441
1442
1443static INPUT_PORTS_START( shinobi )
1444   PORT_INCLUDE( sys16_common )
1445
1446   PORT_START("DSW2")
1447   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
1448   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1449   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1450   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
1451   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1452   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1453   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
1454   PORT_DIPSETTING(    0x08, "2" )
1455   PORT_DIPSETTING(    0x0c, "3" )
1456   PORT_DIPSETTING(    0x04, "5" )
1457   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1458   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
1459   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
1460   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
1461   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1462   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1463   PORT_DIPNAME( 0x40, 0x40, "Enemy's Bullet Speed" ) PORT_DIPLOCATION("SW2:7")
1464   PORT_DIPSETTING(    0x40, "Slow" )
1465   PORT_DIPSETTING(    0x00, "Fast" )
1466   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:8")
1467   PORT_DIPSETTING(    0x80, DEF_STR( Japanese ) )
1468   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
1469INPUT_PORTS_END
1470
14221471static INPUT_PORTS_START( passsht )
14231472   PORT_INCLUDE( sys16_common )
14241473
r7356r7357
15011550   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
15021551INPUT_PORTS_END
15031552
1504/***************************************************************************/
1553static INPUT_PORTS_START( wb3b )
1554   PORT_INCLUDE( sys16_common )
15051555
1506static MACHINE_DRIVER_START( passsht )
1556   PORT_START("DSW2")
1557   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Listed as "Unused" */
1558   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
1559   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1560   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1561   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
1562   PORT_DIPSETTING(    0x00, "2" )
1563   PORT_DIPSETTING(    0x0c, "3" )
1564   PORT_DIPSETTING(    0x08, "4" )
1565   PORT_DIPSETTING(    0x04, "5" )
1566   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5")
1567   PORT_DIPSETTING(    0x10, "50k/100k/180k/300k" )
1568   PORT_DIPSETTING(    0x00, "50k/150k/300k" )
1569   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6")
1570   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
1571   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
1572   PORT_DIPNAME( 0x40, 0x40, "Test Mode" ) PORT_DIPLOCATION("SW2:7")
1573   PORT_DIPSETTING(    0x40, DEF_STR( No ) )   /* Normal game */
1574   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )   /* Levels are selectable / Player is Invincible */
1575   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Listed as "Unused" */
1576INPUT_PORTS_END
15071577
1508   /* basic machine hardware */
1509   MDRV_IMPORT_FROM(system16_7759)
1510   MDRV_CPU_MODIFY("maincpu")
1511   MDRV_CPU_PROGRAM_MAP(system16a_bootleg_passsht_map)
1578static INPUT_PORTS_START( bayroute )
1579   PORT_INCLUDE( sys16_common )
15121580
1513   MDRV_VIDEO_START( system16a_bootleg_passsht )
1514   MDRV_VIDEO_UPDATE( system16a_bootleg )
1581   PORT_START("DSW2")
1582   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:1")
1583   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1584   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1585   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
1586   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1587   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1588   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
1589   PORT_DIPSETTING(    0x04, "1" )
1590   PORT_DIPSETTING(    0x0c, "3" )
1591   PORT_DIPSETTING(    0x08, "5" )
1592   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1593   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5,6")
1594   PORT_DIPSETTING(    0x30, "100k" )
1595   PORT_DIPSETTING(    0x20, "150k" )
1596   PORT_DIPSETTING(    0x10, "200k" )
1597   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1598   PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
1599   PORT_DIPSETTING(    0xc0, DEF_STR( Easy ) )
1600   PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
1601   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
1602   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1603INPUT_PORTS_END
15151604
1516   MDRV_MACHINE_RESET(passsht)
1517MACHINE_DRIVER_END
1605static INPUT_PORTS_START( goldnaxe )
1606   PORT_INCLUDE( sys16_common )
15181607
1608   PORT_START("DSW2")
1609   PORT_DIPNAME( 0x01, 0x01, "Credits Needed" ) PORT_DIPLOCATION("SW2:1")
1610   PORT_DIPSETTING(    0x01, "1 Credit To Start" )
1611   PORT_DIPSETTING(    0x00, "2 Credits To Start" )
1612   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
1613   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1614   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1615   PORT_DIPNAME( 0x3c, 0x3c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4,5,6") /* Definition according to manual */
1616   PORT_DIPSETTING(    0x00, "Special" )
1617   PORT_DIPSETTING(    0x14, DEF_STR( Easiest ) )
1618   PORT_DIPSETTING(    0x1c, DEF_STR( Easier ) )
1619   PORT_DIPSETTING(    0x34, DEF_STR( Easy ) )
1620   PORT_DIPSETTING(    0x3c, DEF_STR( Normal ) )
1621   PORT_DIPSETTING(    0x38, DEF_STR( Hard ) )
1622   PORT_DIPSETTING(    0x2c, DEF_STR( Harder ) )
1623   PORT_DIPSETTING(    0x28, DEF_STR( Hardest ) )
1624   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" ) /* Listed as "Unused" */
1625   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Listed as "Unused" */
15191626
1520static MACHINE_DRIVER_START( passht4b )
1627/*  PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
1628    PORT_DIPSETTING(    0x08, "1" )
1629    PORT_DIPSETTING(    0x0c, "2" )
1630    PORT_DIPSETTING(    0x04, "3" )
1631    PORT_DIPSETTING(    0x00, "5" )
1632    PORT_DIPNAME( 0x30, 0x30, "Energy Meter" ) PORT_DIPLOCATION("SW2:5,6")
1633    PORT_DIPSETTING(    0x20, "2" )
1634    PORT_DIPSETTING(    0x30, "3" )
1635    PORT_DIPSETTING(    0x10, "4" )
1636    PORT_DIPSETTING(    0x00, "5" )
1637*/
1638INPUT_PORTS_END
15211639
1522   /* basic machine hardware */
1523   MDRV_IMPORT_FROM(system16_7759)
1524   MDRV_CPU_MODIFY("maincpu")
1525   MDRV_CPU_PROGRAM_MAP(system16a_bootleg_passht4b_map)
1640static INPUT_PORTS_START( tturf )
1641   PORT_INCLUDE( sys16_common )
15261642
1527   MDRV_VIDEO_START( system16a_bootleg_passsht )
1528   MDRV_VIDEO_UPDATE( system16a_bootleg_passht4b )
1643   PORT_START("DSW2")
1644   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Continues ) ) PORT_DIPLOCATION("SW2:1,2")
1645   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1646   PORT_DIPSETTING(    0x01, "3" )
1647   PORT_DIPSETTING(    0x02, "Unlimited" )
1648   PORT_DIPSETTING(    0x03, "Unlimited" )
1649   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
1650   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
1651   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
1652   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
1653   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1654   PORT_DIPNAME( 0x30, 0x20, "Starting Energy" ) PORT_DIPLOCATION("SW2:5,6")
1655   PORT_DIPSETTING(    0x00, "3" )
1656   PORT_DIPSETTING(    0x10, "4" )
1657   PORT_DIPSETTING(    0x20, "6" )
1658   PORT_DIPSETTING(    0x30, "8" )
1659   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
1660   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1661   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1662   PORT_DIPNAME( 0x80, 0x00, "Bonus Energy" ) PORT_DIPLOCATION("SW2:8")
1663   PORT_DIPSETTING(    0x80, "1" )
1664   PORT_DIPSETTING(    0x00, "2" )
1665INPUT_PORTS_END
15291666
1530   MDRV_MACHINE_RESET(passht4b)
1531MACHINE_DRIVER_END
1667static INPUT_PORTS_START( ddux )
1668   PORT_INCLUDE( sys16_common )
15321669
1533/***************************************************************************/
1670   PORT_START("DSW2")
1671   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
1672   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1673   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1674   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2,3")
1675   PORT_DIPSETTING(    0x04, DEF_STR( Easy ) )
1676   PORT_DIPSETTING(    0x06, DEF_STR( Normal ) )
1677   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1678   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1679   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4,5")
1680   PORT_DIPSETTING(    0x10, "2" )
1681   PORT_DIPSETTING(    0x18, "3" )
1682   PORT_DIPSETTING(    0x08, "4" )
1683   PORT_DIPSETTING(    0x00, "5" )
1684   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:6,7")
1685   PORT_DIPSETTING(    0x40, "150k" )
1686   PORT_DIPSETTING(    0x60, "200k" )
1687   PORT_DIPSETTING(    0x20, "300k" )
1688   PORT_DIPSETTING(    0x00, "400k" )
1689   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Listed as "Unused" */
1690INPUT_PORTS_END
15341691
1535static INPUT_PORTS_START( shinobi )
1692static INPUT_PORTS_START( eswat )
15361693   PORT_INCLUDE( sys16_common )
15371694
15381695   PORT_START("DSW2")
1539   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
1540   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1541   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1696   PORT_DIPNAME( 0x01, 0x01, "Credits To Start" ) PORT_DIPLOCATION("SW2:1")
1697   PORT_DIPSETTING(    0x01, "1 Credit" )
1698   PORT_DIPSETTING(    0x00, "2 Credits" )
15421699   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
15431700   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
15441701   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1545   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
1546   PORT_DIPSETTING(    0x08, "2" )
1547   PORT_DIPSETTING(    0x0c, "3" )
1548   PORT_DIPSETTING(    0x04, "5" )
1549   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
1702   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:3")
1703   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1704   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1705   PORT_DIPNAME( 0x08, 0x08, "Timer" ) PORT_DIPLOCATION("SW2:4")
1706   PORT_DIPSETTING(    0x08, DEF_STR( Normal ) )
1707   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
15501708   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
15511709   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
15521710   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
15531711   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
15541712   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1555   PORT_DIPNAME( 0x40, 0x40, "Enemy's Bullet Speed" ) PORT_DIPLOCATION("SW2:7")
1556   PORT_DIPSETTING(    0x40, "Slow" )
1557   PORT_DIPSETTING(    0x00, "Fast" )
1558   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:8")
1559   PORT_DIPSETTING(    0x80, DEF_STR( Japanese ) )
1560   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
1713   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:7,8")
1714   PORT_DIPSETTING(    0x00, "1" )
1715   PORT_DIPSETTING(    0x40, "2" )
1716   PORT_DIPSETTING(    0xc0, "3" )
1717   PORT_DIPSETTING(    0x80, "4" )
15611718INPUT_PORTS_END
15621719
1563/***************************************************************************/
1720static INPUT_PORTS_START( fpointbl )
1721   PORT_START("SERVICE")
1722   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1723   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1724   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
1725   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
1726   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1727   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1728   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1729   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
15641730
1565static ADDRESS_MAP_START( system16a_bootleg_shinobi_map, ADDRESS_SPACE_PROGRAM, 16 )
1566   AM_RANGE(0x000000, 0x03ffff) AM_ROM
1567   AM_RANGE(0x400000, 0x40ffff) AM_RAM // tilemap ram on the original, used as a buffer on the bootlegs
1568   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_BASE(&sys16_textram)
1569   AM_RANGE(0x411000, 0x411fff) AM_RAM AM_BASE(&system16a_bootleg_bg0_tileram)
1570   AM_RANGE(0x412000, 0x412fff) AM_RAM AM_BASE(&system16a_bootleg_bg1_tileram)
1571   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
1572   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&segaic16_paletteram)
1573   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sound_command_nmi_w)
1574   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
1575   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
1576   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
1577   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW1")
1578   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW2")
1579   AM_RANGE(0xC43000, 0xC43001) AM_WRITENOP
1580   AM_RANGE(0xC44000, 0xC44001) AM_WRITENOP
1581   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(system16a_bootleg_bgscrolly_w)
1582   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(system16a_bootleg_bgscrollx_w)
1583   AM_RANGE(0xc46004, 0xc46005) AM_WRITE(system16a_bootleg_fgscrolly_w)
1584   AM_RANGE(0xc46006, 0xc46007) AM_WRITE(system16a_bootleg_fgscrollx_w)
1585   AM_RANGE(0xc46008, 0xc46009) AM_WRITE(system16a_bootleg_tilemapselect_w)
1586   AM_RANGE(0xC60000, 0xC60001) AM_READNOP
1587   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
1588ADDRESS_MAP_END
1731   PORT_START("P1")
1732   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
1733   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 )
1734   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
1735   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1736   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1737   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1738   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1739   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
15891740
1590/***************************************************************************/
1741   PORT_START("P2")
1742   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1743   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
1744   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1745   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1746   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1747   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1748   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1749   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
15911750
1751   PORT_START("DSW2")
1752   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Listed as "Unused" */
1753   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
1754   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1755   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1756   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) /* Listed as "Unused" */
1757   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" ) /* Listed as "Unused" */
1758   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
1759   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
1760   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
1761   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1762   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1763   PORT_DIPNAME( 0x40, 0x40, "Clear Round Allowed" ) PORT_DIPLOCATION("SW2:7") /* Use button 3 */
1764   PORT_DIPSETTING(    0x00, "1" )
1765   PORT_DIPSETTING(    0x40, "2" )
1766   /* SW2:8 The mode in which a block falls at twice [ usual ] speed as this when playing 25 minutes or more on one coin. */
1767   PORT_DIPNAME( 0x80, 0x80, "2 Cell Move" ) PORT_DIPLOCATION("SW2:8")
1768   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
1769   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
15921770
1593static DRIVER_INIT( shinobl )
1594{
1595   MACHINE_RESET_CALL(sys16_onetime);
1596}
1771   PORT_START("DSW1")
1772   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
1773   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
1774   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
1775   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
1776   PORT_DIPSETTING(    0x05, "2 Coins/1 Credit 5/3 6/4" )
1777   PORT_DIPSETTING(    0x04, "2 Coins/1 Credit 4/3" )
1778   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
1779   PORT_DIPSETTING(    0x01, "1 Coin/1 Credit 2/3" )
1780   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 4/5" )
1781   PORT_DIPSETTING(    0x03, "1 Coin/1 Credit 5/6" )
1782   PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
1783   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
1784   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
1785   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
1786   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
1787   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
1788   PORT_DIPSETTING(    0x00, "Free Play (if Coin B too) or 1/1" )
1789   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
1790   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
1791   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
1792   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
1793   PORT_DIPSETTING(    0x50, "2 Coins/1 Credit 5/3 6/4" )
1794   PORT_DIPSETTING(    0x40, "2 Coins/1 Credit 4/3" )
1795   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
1796   PORT_DIPSETTING(    0x10, "1 Coin/1 Credit 2/3" )
1797   PORT_DIPSETTING(    0x20, "1 Coin/1 Credit 4/5" )
1798   PORT_DIPSETTING(    0x30, "1 Coin/1 Credit 5/6" )
1799   PORT_DIPSETTING(    0x60, DEF_STR( 2C_3C ) )
1800   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
1801   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
1802   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
1803   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
1804   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
1805   PORT_DIPSETTING(    0x00, "Free Play (if Coin A too) or 1/1" )
1806INPUT_PORTS_END
15971807
1598/***************************************************************************/
1808static INPUT_PORTS_START( tetris )
1809   PORT_INCLUDE( sys16_common )   /* unconfirmed coinage dip */
15991810
1600static MACHINE_DRIVER_START( system16a_bootleg_shinobi )
1811   PORT_START("DSW2")
1812   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Listed as "Unused" */
1813   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
1814   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1815   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1816   /* From the code SW2:3,4 looks like some kind of difficulty level,
1817    but all 4 levels points to the same place so it doesn't actually change anything!! */
1818   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) /* Listed as "Unused" */
1819   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" ) /* Listed as "Unused" */
1820   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
1821   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
1822   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
1823   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1824   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1825   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" ) /* Listed as "Unused" */
1826   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Listed as "Unused" */
1827INPUT_PORTS_END
16011828
1602   /* basic machine hardware */
1603   MDRV_IMPORT_FROM(system16)
1604   MDRV_CPU_MODIFY("maincpu")
1605   MDRV_CPU_PROGRAM_MAP(system16a_bootleg_shinobi_map)
1829/* System 18 Bootlegs */
1830static INPUT_PORTS_START( astormbl )
1831   PORT_START("P1")
1832   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
1833   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1834   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )
1835   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1836   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1837   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1838   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1839   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
16061840
1607   MDRV_VIDEO_START( system16a_bootleg_shinobi )
1608   MDRV_VIDEO_UPDATE( system16a_bootleg )
1609MACHINE_DRIVER_END
1841   PORT_START("P2")
1842   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1843   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1844   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1845   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1846   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1847   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1848   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1849   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
16101850
1611/***************************************************************************/
1851   PORT_START("P3")
1852   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1853   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
1854   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
1855   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1856   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
1857   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
1858   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
1859   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
16121860
1861   PORT_START("SERVICE")
1862   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
1863   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1864   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
1865   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
1866   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1867   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1868   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 )
1869   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
16131870
1614static ADDRESS_MAP_START( tetrisbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1615   AM_RANGE(0x000000, 0x03ffff) AM_ROM
1616   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
1617   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
1871   PORT_START("COINAGE")
1872   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
1873   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
1874   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
1875   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
1876   PORT_DIPSETTING(    0x05, "2 Coins/1 Credit 5/3 6/4" )
1877   PORT_DIPSETTING(    0x04, "2 Coins/1 Credit 4/3" )
1878   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
1879   PORT_DIPSETTING(    0x01, "1 Coin/1 Credit 2/3" )
1880   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 4/5" )
1881   PORT_DIPSETTING(    0x03, "1 Coin/1 Credit 5/6" )
1882   PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
1883   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
1884   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
1885   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
1886   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
1887   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
1888   PORT_DIPSETTING(    0x00, "Free Play (if Coin B too) or 1/1" )
1889   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
1890   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
1891   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
1892   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
1893   PORT_DIPSETTING(    0x50, "2 Coins/1 Credit 5/3 6/4" )
1894   PORT_DIPSETTING(    0x40, "2 Coins/1 Credit 4/3" )
1895   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
1896   PORT_DIPSETTING(    0x10, "1 Coin/1 Credit 2/3" )
1897   PORT_DIPSETTING(    0x20, "1 Coin/1 Credit 4/5" )
1898   PORT_DIPSETTING(    0x30, "1 Coin/1 Credit 5/6" )
1899   PORT_DIPSETTING(    0x60, DEF_STR( 2C_3C ) )
1900   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
1901   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
1902   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
1903   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
1904   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
1905   PORT_DIPSETTING(    0x00, "Free Play (if Coin A too) or 1/1" )
16181906
1619   AM_RANGE(0x418000, 0x418001) AM_WRITE(sys16bootleg_fgscrolly_w)
1620   AM_RANGE(0x418008, 0x418009) AM_WRITE(sys16bootleg_fgscrollx_w)
1621   AM_RANGE(0x418010, 0x418011) AM_WRITE(sys16bootleg_bgscrolly_w)
1622   AM_RANGE(0x418018, 0x418019) AM_WRITE(sys16bootleg_bgscrollx_w)
1623   AM_RANGE(0x418020, 0x418021) AM_WRITE(sys16bootleg_fgpage_w)
1624   AM_RANGE(0x418028, 0x418029) AM_WRITE(sys16bootleg_bgpage_w)
1907   PORT_START("DSW1")
1908   PORT_DIPNAME( 0x01, 0x01, "2 Credits to Start" )
1909   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1910   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1911   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1912   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1913   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1914   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Difficulty ) )
1915   PORT_DIPSETTING(    0x04, DEF_STR( Easiest ) )
1916   PORT_DIPSETTING(    0x08, DEF_STR( Easier ) )
1917   PORT_DIPSETTING(    0x0c, DEF_STR( Easy ) )
1918   PORT_DIPSETTING(    0x1c, DEF_STR( Normal ) )
1919   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1920   PORT_DIPSETTING(    0x14, DEF_STR( Harder ) )
1921   PORT_DIPSETTING(    0x18, DEF_STR( Hardest ) )
1922   PORT_DIPSETTING(    0x00, "Special" )
1923   PORT_DIPNAME( 0x20, 0x20, "Coin Chutes" )
1924   PORT_DIPSETTING(    0x20, "3" )
1925   PORT_DIPSETTING(    0x00, "1" )
1926   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
1927   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1928   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1929   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
1930   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1931   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1932INPUT_PORTS_END
16251933
1626   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
1627   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&segaic16_paletteram)
1628   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
1629   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
1630   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
1631   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
1632   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
1633   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
1634   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
1635   AM_RANGE(0xc43034, 0xc43035) AM_WRITENOP
1636   AM_RANGE(0xc80000, 0xc80001) AM_NOP
1637   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
1638ADDRESS_MAP_END
1934static INPUT_PORTS_START( mwalkbl )
1935   PORT_INCLUDE( astormbl )
16391936
1937   PORT_MODIFY("P3")
1938   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START3 )
16401939
1641static READ16_HANDLER( beautyb_unkx_r )
1940   PORT_MODIFY("SERVICE")
1941   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1942   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1943   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1944
1945   PORT_MODIFY("DSW1")
1946   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
1947   PORT_DIPSETTING(    0x04, "2" )
1948   PORT_DIPSETTING(    0x00, "3" )
1949   PORT_DIPNAME( 0x08, 0x08, "Player Vitality" )
1950   PORT_DIPSETTING(    0x08, DEF_STR( Low ) )
1951   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
1952   PORT_DIPNAME( 0x10, 0x00, "Play Mode" )
1953   PORT_DIPSETTING(    0x10, "2 Players" )
1954   PORT_DIPSETTING(    0x00, "3 Players" )
1955   PORT_DIPNAME( 0x20, 0x20, "Coin Mode" )
1956   PORT_DIPSETTING(    0x20, "Common" )
1957   PORT_DIPSETTING(    0x00, "Individual" )
1958   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
1959   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
1960   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
1961   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
1962   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1963INPUT_PORTS_END
1964
1965
1966/*************************************
1967 *
1968 *  Graphics definitions
1969 *
1970 *************************************/
1971
1972static const gfx_layout charlayout  =
16421973{
1643   static int x = 0;
1644   x++;
1645   x&=0x7f;
1646   return x;
1647}
1974   8,8,
1975   RGN_FRAC(1,3),
1976   3,
1977   { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) },
1978   { 0, 1, 2, 3, 4, 5, 6, 7 },
1979   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
1980   8*8
1981};
16481982
1649static ADDRESS_MAP_START( beautyb_map, ADDRESS_SPACE_PROGRAM, 16 )
1650   AM_RANGE(0x000000, 0x00ffff) AM_ROM AM_WRITENOP
1651   AM_RANGE(0x010000, 0x03ffff) AM_WRITENOP
1983GFXDECODE_START( sys16 )
1984   GFXDECODE_ENTRY( "gfx1", 0, charlayout,   0, 1024 )
1985GFXDECODE_END
16521986
1653   AM_RANGE(0x0280D6, 0x0280D7) AM_READ(beautyb_unkx_r)
1654   AM_RANGE(0x0280D8, 0x0280D9) AM_READ(beautyb_unkx_r)
16551987
1656   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
1657   AM_RANGE(0x410000, 0x413fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
1988/*************************************
1989 *
1990 *  Machine driver
1991 *
1992 *************************************/
16581993
1659   AM_RANGE(0x418000, 0x418001) AM_WRITE(sys16bootleg_bgscrolly_w)
1660   AM_RANGE(0x418008, 0x418009) AM_WRITE(sys16bootleg_bgscrollx_w)
1661   AM_RANGE(0x418010, 0x418011) AM_WRITE(sys16bootleg_fgscrolly_w)
1662   AM_RANGE(0x418018, 0x418019) AM_WRITE(sys16bootleg_fgscrollx_w)
1663   AM_RANGE(0x418020, 0x418021) AM_WRITE(sys16bootleg_bgpage_w)
1664   AM_RANGE(0x418028, 0x418029) AM_WRITE(sys16bootleg_fgpage_w)
1994/* System 16A/B Bootlegs */
1995static MACHINE_DRIVER_START( system16 )
16651996
1666   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
1667   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&segaic16_paletteram)
1997   /* driver data */
1998   MDRV_DRIVER_DATA(segas1x_bootleg_state)
16681999
1669   AM_RANGE(0xC41000, 0xC41001) AM_READ(beautyb_unkx_r )
1670   AM_RANGE(0xC41002, 0xC41003) AM_READ(beautyb_unkx_r )
2000   /* basic machine hardware */
2001   MDRV_CPU_ADD("maincpu", M68000, 10000000)
2002   MDRV_CPU_VBLANK_INT("screen", sys16_interrupt)
16712003
1672   AM_RANGE(0xc40000, 0xc40001) AM_WRITENOP
1673   AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP
2004   MDRV_CPU_ADD("soundcpu", Z80, 4000000)
2005   MDRV_CPU_PROGRAM_MAP(sound_map)
2006   MDRV_CPU_IO_MAP(sound_io_map)
16742007
1675   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
1676ADDRESS_MAP_END
2008   /* video hardware */
2009   MDRV_SCREEN_ADD("screen", RASTER)
2010   MDRV_SCREEN_REFRESH_RATE(60)
2011   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
2012   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
2013   MDRV_SCREEN_SIZE(40*8, 28*8)
2014   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
16772015
1678/***************************************************************************/
2016   MDRV_GFXDECODE(sys16)
2017   MDRV_PALETTE_LENGTH(2048*SHADOW_COLORS_MULTIPLIER)
16792018
2019   MDRV_VIDEO_START(system16)
2020   MDRV_VIDEO_UPDATE(system16)
16802021
1681static DRIVER_INIT( tetrisbl )
2022   /* sound hardware */
2023   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
2024
2025   MDRV_SOUND_ADD("ymsnd", YM2151, 4000000)
2026   MDRV_SOUND_ROUTE(0, "lspeaker", 0.32)
2027   MDRV_SOUND_ROUTE(1, "rspeaker", 0.32)
2028MACHINE_DRIVER_END
2029
2030
2031static void sound_cause_nmi( running_device *device, int chip )
16822032{
1683   MACHINE_RESET_CALL(sys16_onetime);
2033   segas1x_bootleg_state *state = (segas1x_bootleg_state *)device->machine->driver_data;
2034
2035   /* upd7759 callback */
2036   cpu_set_input_line(state->soundcpu, INPUT_LINE_NMI, PULSE_LINE);
16842037}
16852038
16862039
1687/***************************************************************************/
2040const upd7759_interface sys16_upd7759_interface  =
2041{
2042   sound_cause_nmi
2043};
16882044
1689static INPUT_PORTS_START( tetris )
1690   PORT_INCLUDE( sys16_common )   /* unconfirmed coinage dip */
16912045
1692   PORT_START("DSW2")
1693   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Listed as "Unused" */
1694   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
1695   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1696   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1697   /* From the code SW2:3,4 looks like some kind of difficulty level,
1698    but all 4 levels points to the same place so it doesn't actually change anything!! */
1699   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) /* Listed as "Unused" */
1700   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" ) /* Listed as "Unused" */
1701   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,6")
1702   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
1703   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
1704   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1705   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1706   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" ) /* Listed as "Unused" */
1707   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Listed as "Unused" */
1708INPUT_PORTS_END
2046static MACHINE_DRIVER_START( system16_7759 )
17092047
1710/***************************************************************************/
2048   /* basic machine hardware */
2049   MDRV_IMPORT_FROM(system16)
17112050
2051   MDRV_CPU_MODIFY("soundcpu")
2052   MDRV_CPU_PROGRAM_MAP(sound_7759_map)
2053   MDRV_CPU_IO_MAP(sound_7759_io_map)
17122054
1713static MACHINE_DRIVER_START( tetrisbl )
2055   /* sound hardware */
2056   MDRV_SOUND_ADD("7759", UPD7759, UPD7759_STANDARD_CLOCK)
2057   MDRV_SOUND_CONFIG(sys16_upd7759_interface)
2058   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.48)
2059   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.48)
2060MACHINE_DRIVER_END
17142061
2062
2063static MACHINE_DRIVER_START( system16_datsu_sound )
2064   /* TODO:
2065    - other games might use this sound configuration
2066    - speaker is likely to be mono for the bootlegs, not stereo.
2067    - check msm5205 frequency.
2068    */
2069   MDRV_CPU_ADD("soundcpu",Z80, 4000000)
2070   MDRV_CPU_PROGRAM_MAP(tturfbl_sound_map)
2071   MDRV_CPU_IO_MAP(tturfbl_sound_io_map)
2072
2073   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
2074
2075   MDRV_SOUND_ADD("ymsnd", YM2151, 4000000)
2076   MDRV_SOUND_ROUTE(0, "lspeaker", 0.32)
2077   MDRV_SOUND_ROUTE(1, "rspeaker", 0.32)
2078
2079   MDRV_SOUND_ADD("5205", MSM5205, 220000)
2080   MDRV_SOUND_CONFIG(tturfbl_msm5205_interface)
2081   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80)
2082   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
2083MACHINE_DRIVER_END
2084
2085
2086static MACHINE_DRIVER_START( shinobib )
2087
17152088   /* basic machine hardware */
17162089   MDRV_IMPORT_FROM(system16)
17172090   MDRV_CPU_MODIFY("maincpu")
1718   MDRV_CPU_PROGRAM_MAP(tetrisbl_map)
2091   MDRV_CPU_PROGRAM_MAP(shinobib_map)
2092
2093   MDRV_VIDEO_START( s16a_bootleg_shinobi )
2094   MDRV_VIDEO_UPDATE( s16a_bootleg )
17192095MACHINE_DRIVER_END
17202096
1721static MACHINE_DRIVER_START( beautyb )
2097static MACHINE_DRIVER_START( passshtb )
17222098
17232099   /* basic machine hardware */
2100   MDRV_IMPORT_FROM(system16_7759)
2101   MDRV_CPU_MODIFY("maincpu")
2102   MDRV_CPU_PROGRAM_MAP(passshtb_map)
2103
2104   MDRV_VIDEO_START( s16a_bootleg_passsht )
2105   MDRV_VIDEO_UPDATE( s16a_bootleg )
2106MACHINE_DRIVER_END
2107
2108
2109static MACHINE_DRIVER_START( passsht4b )
2110
2111   /* basic machine hardware */
2112   MDRV_IMPORT_FROM(system16_7759)
2113   MDRV_CPU_MODIFY("maincpu")
2114   MDRV_CPU_PROGRAM_MAP(passht4b_map)
2115
2116   MDRV_VIDEO_START( s16a_bootleg_passsht )
2117   MDRV_VIDEO_UPDATE( s16a_bootleg_passht4b )
2118MACHINE_DRIVER_END
2119
2120static MACHINE_DRIVER_START( wb3bb )
2121
2122   /* basic machine hardware */
17242123   MDRV_IMPORT_FROM(system16)
17252124   MDRV_CPU_MODIFY("maincpu")
1726   MDRV_CPU_PROGRAM_MAP(beautyb_map)
2125   MDRV_CPU_PROGRAM_MAP(wb3bbl_map)
2126
2127   MDRV_VIDEO_START( s16a_bootleg_wb3bl )
2128   MDRV_VIDEO_UPDATE( s16a_bootleg )
17272129MACHINE_DRIVER_END
17282130
1729/***************************************************************************/
17302131
1731static INPUT_PORTS_START( tturf )
1732   PORT_INCLUDE( sys16_common )
2132static MACHINE_DRIVER_START( goldnaxeb1 )
17332133
1734   PORT_START("DSW2")
1735   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Continues ) ) PORT_DIPLOCATION("SW2:1,2")
1736   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1737   PORT_DIPSETTING(    0x01, "3" )
1738   PORT_DIPSETTING(    0x02, "Unlimited" )
1739   PORT_DIPSETTING(    0x03, "Unlimited" )
1740   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
1741   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
1742   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
1743   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
1744   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1745   PORT_DIPNAME( 0x30, 0x20, "Starting Energy" ) PORT_DIPLOCATION("SW2:5,6")
1746   PORT_DIPSETTING(    0x00, "3" )
1747   PORT_DIPSETTING(    0x10, "4" )
1748   PORT_DIPSETTING(    0x20, "6" )
1749   PORT_DIPSETTING(    0x30, "8" )
1750   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
1751   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1752   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1753   PORT_DIPNAME( 0x80, 0x00, "Bonus Energy" ) PORT_DIPLOCATION("SW2:8")
1754   PORT_DIPSETTING(    0x80, "1" )
1755   PORT_DIPSETTING(    0x00, "2" )
1756INPUT_PORTS_END
2134   /* driver data */
2135   MDRV_DRIVER_DATA(segas1x_bootleg_state)
17572136
2137   /* basic machine hardware */
2138   MDRV_CPU_ADD("maincpu", M68000, 10000000)
2139   MDRV_CPU_PROGRAM_MAP(goldnaxeb1_map)
2140   MDRV_CPU_VBLANK_INT("screen", sys16_interrupt)
17582141
1759/***************************************************************************/
2142   /* video hardware */
2143   MDRV_SCREEN_ADD("screen", RASTER)
2144   MDRV_SCREEN_REFRESH_RATE(60)
2145   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
2146   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
2147   MDRV_SCREEN_SIZE(40*8, 28*8)
2148   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
17602149
1761static ADDRESS_MAP_START( tturfbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1762   AM_RANGE(0x000000, 0x03ffff) AM_ROM
1763   AM_RANGE(0x200000, 0x203fff) AM_RAM // work ram
1764   AM_RANGE(0x300000, 0x300fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
1765   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
1766   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
1767   AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&segaic16_paletteram)
1768   AM_RANGE(0x600000, 0x600001) AM_WRITE(sys16_coinctrl_w)
1769   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW2")
1770   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("DSW1")
1771   AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_w)
1772   AM_RANGE(0x601000, 0x601001) AM_READ_PORT("SERVICE")
1773   AM_RANGE(0x601002, 0x601003) AM_READ_PORT("P1")
1774   AM_RANGE(0x601004, 0x601005) AM_READ_PORT("P2")
1775   AM_RANGE(0x602000, 0x602001) AM_READ_PORT("DSW2")
1776   AM_RANGE(0x602002, 0x602003) AM_READ_PORT("DSW1")
1777   AM_RANGE(0xc44000, 0xc44001) AM_WRITENOP
2150   MDRV_GFXDECODE(sys16)
2151   MDRV_PALETTE_LENGTH(2048*SHADOW_COLORS_MULTIPLIER)
17782152
1779   AM_RANGE(0xC46000, 0xC46001) AM_WRITE(sys16bootleg_fgscrolly_w)
1780   AM_RANGE(0xC46008, 0xC46009) AM_WRITE(sys16bootleg_fgscrollx_w)
1781   AM_RANGE(0xC46010, 0xC46011) AM_WRITE(sys16bootleg_bgscrolly_w)
1782   AM_RANGE(0xC46018, 0xC46019) AM_WRITE(sys16bootleg_bgscrollx_w)
1783   AM_RANGE(0xC46020, 0xC46021) AM_WRITE(datsu_page0_w)
1784   AM_RANGE(0xc46022, 0xc46023) AM_WRITE(datsu_page1_w)
1785   AM_RANGE(0xC46024, 0xC46025) AM_WRITE(datsu_page2_w)
1786   AM_RANGE(0xC46026, 0xC46027) AM_WRITE(datsu_page3_w)
1787ADDRESS_MAP_END
2153   MDRV_PALETTE_INIT( all_black )
2154   MDRV_VIDEO_START(system16)
2155   MDRV_VIDEO_UPDATE(system16)
2156MACHINE_DRIVER_END
17882157
1789/***************************************************************************/
17902158
1791static DRIVER_INIT( tturfbl )
1792{
1793   UINT8 *mem;
2159static MACHINE_DRIVER_START( goldnaxeb2 )
2160   /* basic machine hardware */
2161   MDRV_IMPORT_FROM(goldnaxeb1)
2162   MDRV_CPU_MODIFY("maincpu")
2163   MDRV_CPU_PROGRAM_MAP(goldnaxeb2_map)
2164MACHINE_DRIVER_END
17942165
1795   MACHINE_RESET_CALL(sys16_onetime);
17962166
1797   mem = memory_region(machine, "soundcpu");
1798   memcpy(mem, mem+0x10000, 0x8000);
1799}
2167static MACHINE_DRIVER_START( bayrouteb1 )
2168   /* basic machine hardware */
2169   MDRV_IMPORT_FROM(goldnaxeb1)
2170   MDRV_CPU_MODIFY("maincpu")
2171   MDRV_CPU_PROGRAM_MAP(bayrouteb1_map)
2172MACHINE_DRIVER_END
18002173
1801/***************************************************************************/
2174static MACHINE_DRIVER_START( bayrouteb2 )
2175   /* basic machine hardware */
2176   MDRV_IMPORT_FROM(goldnaxeb1)
2177   MDRV_CPU_MODIFY("maincpu")
2178   MDRV_CPU_PROGRAM_MAP(bayrouteb2_map)
18022179
2180   MDRV_IMPORT_FROM(system16_datsu_sound)
2181MACHINE_DRIVER_END
2182
18032183static MACHINE_DRIVER_START( tturfbl )
18042184
18052185   /* basic machine hardware */
r7356r7357
18182198   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
18192199MACHINE_DRIVER_END
18202200
2201static MACHINE_DRIVER_START( dduxbl )
18212202
1822/***************************************************************************/
2203   /* basic machine hardware */
2204   MDRV_IMPORT_FROM(system16)
2205   MDRV_CPU_MODIFY("maincpu")
2206   MDRV_CPU_PROGRAM_MAP(dduxbl_map)
2207MACHINE_DRIVER_END
18232208
1824static INPUT_PORTS_START( wb3b )
1825   PORT_INCLUDE( sys16_common )
2209static MACHINE_DRIVER_START( eswatbl )
18262210
1827   PORT_START("DSW2")
1828   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Listed as "Unused" */
1829   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
1830   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1831   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1832   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
1833   PORT_DIPSETTING(    0x00, "2" )
1834   PORT_DIPSETTING(    0x0c, "3" )
1835   PORT_DIPSETTING(    0x08, "4" )
1836   PORT_DIPSETTING(    0x04, "5" )
1837   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5")
1838   PORT_DIPSETTING(    0x10, "50k/100k/180k/300k" )
1839   PORT_DIPSETTING(    0x00, "50k/150k/300k" )
1840   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6")
1841   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
1842   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
1843   PORT_DIPNAME( 0x40, 0x40, "Test Mode" ) PORT_DIPLOCATION("SW2:7")
1844   PORT_DIPSETTING(    0x40, DEF_STR( No ) )   /* Normal game */
1845   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )   /* Levels are selectable / Player is Invincible */
1846   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Listed as "Unused" */
1847INPUT_PORTS_END
2211   /* basic machine hardware */
2212   MDRV_IMPORT_FROM(system16_7759)
2213   MDRV_CPU_MODIFY("maincpu")
2214   MDRV_CPU_PROGRAM_MAP(eswatbl_map)
2215MACHINE_DRIVER_END
18482216
1849/***************************************************************************/
2217static MACHINE_DRIVER_START( fpointbl )
18502218
1851static ADDRESS_MAP_START( wb3bbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1852   AM_RANGE(0x000000, 0x03ffff) AM_ROM
1853   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(sys16_tilebank_w)
1854   AM_RANGE(0x400000, 0x407fff) AM_RAM // tilemap ram on the original, used as a buffer on the bootlegs
1855   AM_RANGE(0x409000, 0x40afff) AM_RAM AM_BASE(&system16a_bootleg_bg0_tileram)
1856   AM_RANGE(0x40a000, 0x40bfff) AM_RAM AM_BASE(&system16a_bootleg_bg1_tileram)
1857   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_BASE(&sys16_textram)
1858   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
1859   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( segaic16_paletteram_w )  AM_BASE(&segaic16_paletteram)
1860   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
1861   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
1862   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
1863   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
1864   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
1865   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
1866   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
1867   AM_RANGE(0xC44000, 0xC44001) AM_WRITENOP
1868   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(system16a_bootleg_bgscrolly_w)
1869   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(system16a_bootleg_bgscrollx_w)
1870   AM_RANGE(0xc46004, 0xc46005) AM_WRITE(system16a_bootleg_fgscrolly_w)
1871   AM_RANGE(0xc46006, 0xc46007) AM_WRITE(system16a_bootleg_fgscrollx_w)
1872   AM_RANGE(0xc46008, 0xc46009) AM_WRITE(system16a_bootleg_tilemapselect_w)
1873   AM_RANGE(0xff0000, 0xffffff) AM_RAM // work ram
1874ADDRESS_MAP_END
2219   /* basic machine hardware */
2220   MDRV_IMPORT_FROM(system16)
2221   MDRV_CPU_MODIFY("maincpu")
2222   MDRV_CPU_PROGRAM_MAP(fpointbl_map)
18752223
1876/***************************************************************************/
2224   MDRV_CPU_MODIFY("soundcpu")
2225   MDRV_CPU_PROGRAM_MAP(fpointbl_sound_map)
2226MACHINE_DRIVER_END
18772227
1878static DRIVER_INIT( wb3bbl )
1879{
1880   MACHINE_RESET_CALL(sys16_onetime);
1881}
2228static MACHINE_DRIVER_START( tetrisbl )
18822229
1883/***************************************************************************/
2230   /* basic machine hardware */
2231   MDRV_IMPORT_FROM(system16)
2232   MDRV_CPU_MODIFY("maincpu")
2233   MDRV_CPU_PROGRAM_MAP(tetrisbl_map)
2234MACHINE_DRIVER_END
18842235
1885static MACHINE_DRIVER_START( system16a_bootleg_wb3 )
18862236
2237static MACHINE_DRIVER_START( beautyb )
2238
18872239   /* basic machine hardware */
18882240   MDRV_IMPORT_FROM(system16)
18892241   MDRV_CPU_MODIFY("maincpu")
1890   MDRV_CPU_PROGRAM_MAP(wb3bbl_map)
2242   MDRV_CPU_PROGRAM_MAP(beautyb_map)
2243MACHINE_DRIVER_END
18912244
1892   MDRV_VIDEO_START( system16a_bootleg_wb3bl )
1893   MDRV_VIDEO_UPDATE( system16a_bootleg )
2245
2246/* System 18 Bootlegs */
2247static MACHINE_DRIVER_START( system18 )
2248
2249   /* driver data */
2250   MDRV_DRIVER_DATA(segas1x_bootleg_state)
2251
2252   /* basic machine hardware */
2253   MDRV_CPU_ADD("maincpu", M68000, 10000000)
2254   MDRV_CPU_VBLANK_INT("screen", irq4_line_hold)
2255
2256   MDRV_CPU_ADD("soundcpu", Z80, 8000000)
2257   MDRV_CPU_PROGRAM_MAP(sound_18_map)
2258   MDRV_CPU_IO_MAP(sound_18_io_map)
2259
2260   /* video hardware */
2261   MDRV_SCREEN_ADD("screen", RASTER)
2262   MDRV_SCREEN_REFRESH_RATE(60)
2263   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
2264   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
2265   MDRV_SCREEN_SIZE(40*8, 28*8)
2266   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
2267
2268   MDRV_GFXDECODE(sys16)
2269   MDRV_PALETTE_LENGTH((2048+2048)*SHADOW_COLORS_MULTIPLIER) // 64 extra colours for vdp (but we use 2048 so shadow mask works)
2270
2271   MDRV_VIDEO_START(system18old)
2272   MDRV_VIDEO_UPDATE(system18old)
2273
2274   /* sound hardware */
2275   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
2276
2277   MDRV_SOUND_ADD("3438.0", YM3438, 8000000)
2278   MDRV_SOUND_ROUTE(0, "lspeaker", 0.40)
2279   MDRV_SOUND_ROUTE(1, "rspeaker", 0.40)
2280   MDRV_SOUND_ROUTE(2, "lspeaker", 0.40)
2281   MDRV_SOUND_ROUTE(3, "rspeaker", 0.40)
2282
2283   MDRV_SOUND_ADD("3438.1", YM3438, 8000000)
2284   MDRV_SOUND_ROUTE(0, "lspeaker", 0.40)
2285   MDRV_SOUND_ROUTE(1, "rspeaker", 0.40)
2286   MDRV_SOUND_ROUTE(2, "lspeaker", 0.40)
2287   MDRV_SOUND_ROUTE(3, "rspeaker", 0.40)
2288
2289   MDRV_SOUND_ADD("5c68", RF5C68, 8000000)
2290   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
2291   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
18942292MACHINE_DRIVER_END
18952293
1896/*****************************************************************************/
18972294
2295static MACHINE_DRIVER_START( astormbl )
2296
2297   /* basic machine hardware */
2298   MDRV_IMPORT_FROM(system18)
2299   MDRV_CPU_MODIFY("maincpu")
2300   MDRV_CPU_PROGRAM_MAP(astormbl_map)
2301MACHINE_DRIVER_END
2302
2303
2304static MACHINE_DRIVER_START( mwalkbl )
2305
2306   /* basic machine hardware */
2307   MDRV_IMPORT_FROM(system18)
2308   MDRV_CPU_MODIFY("maincpu")
2309   MDRV_CPU_PROGRAM_MAP(mwalkbl_map)
2310MACHINE_DRIVER_END
2311
2312
2313static MACHINE_DRIVER_START( shdancbl )
2314
2315   /* basic machine hardware */
2316   MDRV_IMPORT_FROM(system18)
2317   MDRV_CPU_MODIFY("maincpu")
2318   MDRV_CPU_PROGRAM_MAP(shdancbl_map)
2319
2320   MDRV_CPU_MODIFY("soundcpu")
2321   MDRV_CPU_PROGRAM_MAP(shdancbl_sound_map)
2322   MDRV_CPU_IO_MAP(shdancbl_sound_io_map)
2323   MDRV_DEVICE_REMOVE("5c68")
2324
2325   MDRV_SOUND_ADD("5205", MSM5205, 200000)
2326   MDRV_SOUND_CONFIG(shdancbl_msm5205_interface)
2327   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80)
2328   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
2329MACHINE_DRIVER_END
2330
2331
2332/*************************************
2333 *
2334 *  ROM definition(s)
2335 *
2336 *************************************/
2337
2338/******************************
2339    System 16A Bootlegs
2340******************************/
2341
2342/* Shinobi bootleg by 'Datsu' - Sound hardware is different */
2343ROM_START( shinobld )
2344   ROM_REGION( 0x040000, "maincpu", 0 ) /* 68000 code */
2345   ROM_LOAD16_BYTE( "12.bin", 0x000001, 0x10000, CRC(757a0c71) SHA1(8f476b0fd5f5dd480489af09b99585c58a4801fc) )
2346   ROM_LOAD16_BYTE( "14.bin", 0x000000, 0x10000, CRC(a65870b2) SHA1(3e9b4aa694bf86ef9db4756ebaa3d8d87d7f269a) )
2347   ROM_LOAD16_BYTE( "13.bin", 0x020001, 0x10000, CRC(c4334bcd) SHA1(ea1dd23ca6fbf632d8e10bbb9ced6515a69bd14a) )
2348   ROM_LOAD16_BYTE( "15.bin", 0x020000, 0x10000, CRC(b70a6ec1) SHA1(79db41c36d6a053bcdc355b46b19ae938a7755a9) )
2349
2350   ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT ) /* tiles */
2351   ROM_LOAD( "9.bin",  0x00000, 0x10000, CRC(565e11c6) SHA1(e063400b3d0470b932d75da0be9cd4b446189dea) )
2352   ROM_LOAD( "10.bin", 0x10000, 0x10000, CRC(7cc40b6c) SHA1(ffad7eef7ab2ff9a2e49a8d71b5785a61fa3c675) )
2353   ROM_LOAD( "11.bin", 0x20000, 0x10000, CRC(0f6c7b1c) SHA1(defc76592c285b3396e89a3cff7a73f3a948117f) )
2354
2355   ROM_REGION16_BE( 0x080000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
2356   ROM_LOAD16_BYTE( "5.bin", 0x00001, 0x10000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
2357   ROM_LOAD16_BYTE( "3.bin", 0x00000, 0x10000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
2358   ROM_LOAD16_BYTE( "8.bin", 0x20001, 0x10000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) )
2359   ROM_LOAD16_BYTE( "2.bin", 0x20000, 0x10000, CRC(25307ef8) SHA1(91ffbe436f80d583524ee113a8b7c0cf5d8ab286) )
2360   ROM_LOAD16_BYTE( "6.bin", 0x40001, 0x10000, CRC(c29ac34e) SHA1(b5e9b8c3233a7d6797f91531a0d9123febcf1660) )
2361   ROM_LOAD16_BYTE( "4.bin", 0x40000, 0x10000, CRC(04a437f8) SHA1(ea5fed64443236e3404fab243761e60e2e48c84c) )
2362   ROM_LOAD16_BYTE( "7.bin", 0x60001, 0x10000, CRC(41f41063) SHA1(5cc461e9738dddf9eea06831fce3702d94674163) )
2363   ROM_LOAD16_BYTE( "1.bin", 0x60000, 0x10000, CRC(b6e1fd72) SHA1(eb86e4bf880bd1a1d9bcab3f2f2e917bcaa06172) )
2364
2365   ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU + data */
2366   ROM_LOAD( "16.bin", 0x0000, 0x10000, CRC(52c8364e) SHA1(01d30b82f92498d155d2e31d43d58dff0285cce3) )
2367ROM_END
2368
2369/* Passing Shot Bootleg is a decrypted version of Passing Shot Japanese (passshtj). It has been heavily modified */
2370ROM_START( passshtb )
2371   ROM_REGION( 0x020000, "maincpu", 0 ) /* 68000 code */
2372   ROM_LOAD16_BYTE( "pass3_2p.bin", 0x000000, 0x10000, CRC(26bb9299) SHA1(11bacf86dfdd8bcfbfb61f0ebc59890325c48adc) )
2373   ROM_LOAD16_BYTE( "pass4_2p.bin", 0x000001, 0x10000, CRC(06ac6d5d) SHA1(2dd71a8a956404326797de8beed7bca016c9919e) )
2374
2375   ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
2376   ROM_LOAD( "opr11854.b9",  0x00000, 0x10000, CRC(d31c0b6c) SHA1(610d04988da70c30300cc5614817eda9d2204f39) )
2377   ROM_LOAD( "opr11855.b10", 0x10000, 0x10000, CRC(b78762b4) SHA1(d594ef846bd7fed8da91a89906b39c1a2867a1fe) )
2378   ROM_LOAD( "opr11856.b11", 0x20000, 0x10000, CRC(ea49f666) SHA1(36ccd32cdcbb7fcc300628bb59c220ec3c324d82) )
2379
2380   ROM_REGION16_BE( 0x80000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
2381   ROM_LOAD16_BYTE( "opr11862.b1",  0x00001, 0x10000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
2382   ROM_LOAD16_BYTE( "opr11865.b5",  0x00000, 0x10000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
2383   ROM_LOAD16_BYTE( "opr11863.b2",  0x20001, 0x10000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) )
2384   ROM_LOAD16_BYTE( "opr11866.b6",  0x20000, 0x10000, CRC(50eb71cc) SHA1(463b4917ca19c7f4ad2c2845caa104d5e4a2dda3) )
2385   ROM_LOAD16_BYTE( "opr11864.b3",  0x40001, 0x10000, CRC(05733ca8) SHA1(1dbc7c99450ebe6a9fd8c0244fd3cb38b74984ef) )
2386   ROM_LOAD16_BYTE( "opr11867.b7",  0x40000, 0x10000, CRC(81e49697) SHA1(a70fa409e3555ad6c8f28930a7026fdf2deb8c65) )
2387
2388   ROM_REGION( 0x30000, "soundcpu", 0 ) /* sound CPU */
2389   ROM_LOAD( "epr11857.a7",  0x00000, 0x08000, CRC(789edc06) SHA1(8c89c94e503513c287807d187de78a7fbd75a7cf) )
2390   ROM_LOAD( "epr11858.a8",  0x10000, 0x08000, CRC(08ab0018) SHA1(0685f80a7d403208c9cfffea3f2035324f3924fe) )
2391   ROM_LOAD( "epr11859.a9",  0x18000, 0x08000, CRC(8673e01b) SHA1(e79183ab30e683fdf61ced2e9dbe010567c324cb) )
2392   ROM_LOAD( "epr11860.a10", 0x20000, 0x08000, CRC(10263746) SHA1(1f981fb185c6a9795208ecdcfba36cf892a99ed5) )
2393   ROM_LOAD( "epr11861.a11", 0x28000, 0x08000, CRC(38b54a71) SHA1(68ec4ef5b115844214ff2213be1ce6678904fbd2) )
2394ROM_END
2395
2396ROM_START( passht4b )
2397   ROM_REGION( 0x20000, "maincpu", 0 ) /* 68000 code */
2398   ROM_LOAD16_BYTE( "pas4p.3", 0x000000, 0x10000, CRC(2d8bc946) SHA1(35d3e529d4815543d9876fd0545c3d686467abaa) )
2399   ROM_LOAD16_BYTE( "pas4p.4", 0x000001, 0x10000, CRC(e759e831) SHA1(dd5727dc28010cb988e4951723171171eb645ce8) )
2400
2401   ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT ) /* tiles */
2402   ROM_LOAD( "pas4p.11", 0x00000, 0x10000, CRC(da20fbc9) SHA1(21dc8143f4d1cebae4f86e83495fa84e5293ba48) )
2403   ROM_LOAD( "pas4p.12", 0x10000, 0x10000, CRC(bebb9211) SHA1(4f56048f6f70b63f74a4c0d64456213d36ce5b26) )
2404   ROM_LOAD( "pas4p.13", 0x20000, 0x10000, CRC(e37506c3) SHA1(e6fbf15d58f321a3d052fefbe5a1901e4a1734ae) )
2405
2406   ROM_REGION16_BE( 0x60000, "gfx2", 0 ) /* sprites */
2407   ROM_LOAD16_BYTE( "opr11862.b1",  0x00001, 0x10000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
2408   ROM_LOAD16_BYTE( "opr11865.b5",  0x00000, 0x10000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
2409   ROM_LOAD16_BYTE( "opr11863.b2",  0x20001, 0x10000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) )
2410   ROM_LOAD16_BYTE( "opr11866.b6",  0x20000, 0x10000, CRC(50eb71cc) SHA1(463b4917ca19c7f4ad2c2845caa104d5e4a2dda3) )
2411   ROM_LOAD16_BYTE( "opr11864.b3",  0x40001, 0x10000, CRC(05733ca8) SHA1(1dbc7c99450ebe6a9fd8c0244fd3cb38b74984ef) )
2412   ROM_LOAD16_BYTE( "opr11867.b7",  0x40000, 0x10000, CRC(81e49697) SHA1(a70fa409e3555ad6c8f28930a7026fdf2deb8c65) )
2413
2414   ROM_REGION( 0x20000, "soundcpu", 0 ) /* sound CPU */
2415   ROM_LOAD( "pas4p.1",  0x00000, 0x08000, CRC(e60fb017) SHA1(21298036eab55c74427f1c2e3a9623d41bca4849) )
2416   ROM_LOAD( "pas4p.2",  0x10000, 0x10000, CRC(092e016e) SHA1(713638749efa9dce19c547b84308236110bc85fe) )
2417ROM_END
2418
2419ROM_START( wb3bbl )
2420   ROM_REGION( 0x040000, "maincpu", 0 ) /* 68000 code */
2421   ROM_LOAD16_BYTE( "wb3_03", 0x000000, 0x10000, CRC(0019ab3b) SHA1(89d49a437690fa6e0c35bb9f1450042f89504714) )
2422   ROM_LOAD16_BYTE( "wb3_05", 0x000001, 0x10000, CRC(196e17ee) SHA1(71e4345b2c3d1612a3d424c9310fad1e23c8a9f7) )
2423   ROM_LOAD16_BYTE( "wb3_02", 0x020000, 0x10000, CRC(c87350cb) SHA1(55a8cb68d70b6060dd9a55e281e216ce3917ea5b) )
2424   ROM_LOAD16_BYTE( "wb3_04", 0x020001, 0x10000, CRC(565d5035) SHA1(e28a132f1a4ce9466945e231c54502178748af98) )
2425
2426   ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT ) /* tiles */
2427   ROM_LOAD( "wb3_14", 0x00000, 0x10000, CRC(d3f20bca) SHA1(0a87f709f8e2a913473512ede408e2cbc535443f) )
2428   ROM_LOAD( "wb3_15", 0x10000, 0x10000, CRC(96ff9d52) SHA1(791a9da4860e0d42fba98f80a3c6725ad8c73e33) )
2429   ROM_LOAD( "wb3_16", 0x20000, 0x10000, CRC(afaf0d31) SHA1(d4309329a0a543250788146b63b27ff058c02fc3) )
2430
2431   ROM_REGION16_BE( 0x100000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
2432   ROM_LOAD16_BYTE( "epr12090.b1", 0x00001, 0x010000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) )
2433   ROM_LOAD16_BYTE( "epr12094.b5", 0x00000, 0x010000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
2434   ROM_LOAD16_BYTE( "epr12091.b2", 0x20001, 0x010000, CRC(8409a243) SHA1(bcbb9510a6499d8147543d6befa5a49f4ac055d9) )
2435   ROM_LOAD16_BYTE( "epr12095.b6", 0x20000, 0x010000, CRC(e774ec2c) SHA1(a4aa15ec7be5539a740ad02ff720458018dbc536) )
2436   ROM_LOAD16_BYTE( "epr12092.b3", 0x40001, 0x010000, CRC(5c2f0d90) SHA1(e0fbc0f841e4607ad232931368b16e81440a75c4) )
2437   ROM_LOAD16_BYTE( "epr12096.b7", 0x40000, 0x010000, CRC(0cd59d6e) SHA1(caf754a461feffafcfe7bfc6e89da76c4db257c5) )
2438   ROM_LOAD16_BYTE( "epr12093.b4", 0x60001, 0x010000, CRC(4891e7bb) SHA1(1be04fcabe9bfa8cf746263a5bcca67902a021a0) )
2439   ROM_LOAD16_BYTE( "epr12097.b8", 0x60000, 0x010000, CRC(e645902c) SHA1(497cfcf6c25cc2e042e16dbcb1963d2223def15a) )
2440
2441
2442   ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
2443   ROM_LOAD( "epr12127.a10", 0x0000, 0x8000, CRC(0bb901bb) SHA1(c81b198df8e3b0ec568032c76addf0d1a1711194) )
2444ROM_END
2445
2446
2447/******************************
2448    System 16B Bootlegs
2449******************************/
2450
18982451// protected + encrypted bootleg
18992452ROM_START( bayrouteb1 )
19002453   ROM_REGION( 0xc0000, "maincpu", 0 ) /* 68000 code */
r7356r7357
19842537   ROM_LOAD( "br_02", 0x20000, 0x10000, CRC(ef63991b) SHA1(4221741780f88c80b3213ddca949bee7d4c1469a) )
19852538ROM_END
19862539
1987// sys16B
1988ROM_START( dduxbl )
1989   ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 code */
1990   ROM_LOAD16_BYTE( "dduxb03.bin", 0x000000, 0x20000, CRC(e7526012) SHA1(a1798008bfa1ce9b87dc330f3817b1978052fcfd) )
1991   ROM_LOAD16_BYTE( "dduxb05.bin", 0x000001, 0x20000, CRC(459d1237) SHA1(55e9c0dc341c919d58cc789203642c397d7ac65e) )
1992   /* empty 0x40000 - 0x80000 */
1993   ROM_LOAD16_BYTE( "dduxb02.bin", 0x080000, 0x20000, CRC(d8ed3132) SHA1(a9d5ad8f79fb635cc234a99fad398688a5f15926) )
1994   ROM_LOAD16_BYTE( "dduxb04.bin", 0x080001, 0x20000, CRC(30c6cb92) SHA1(2e17c74eeb37c9731fc2e365cc0114f7383c0106) )
2540/*
19952541
1996   ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT ) /* tiles */
1997   ROM_LOAD( "dduxb14.bin", 0x00000, 0x10000, CRC(664bd135) SHA1(674b06e01c2c8f5b8057dd24d470330c3f140473) )
1998   ROM_LOAD( "dduxb15.bin", 0x10000, 0x10000, CRC(ce0d2b30) SHA1(e60521c46f1650c9bdc76f2ceb91a6d61aaa0a09) )
1999   ROM_LOAD( "dduxb16.bin", 0x20000, 0x10000, CRC(6de95434) SHA1(7bed2a0261cf6c2fbb3756633f05f0bb2173977c) )
2542    this is a more complete dump of the old encrypted bootleg set
20002543
2001   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) //* sprites */
2002   ROM_LOAD16_BYTE( "dduxb06.bin", 0x00000, 0x010000, CRC(b0079e99) SHA1(9bb4d3fa804a3d05a6e06b45a1280d7064e96ac6) )
2003   ROM_LOAD16_BYTE( "dduxb10.bin", 0x00001, 0x010000, CRC(0be3aee5) SHA1(48fc779b7398abbb82cd0d0d28705ece75b3c4e3) )
2004   ROM_LOAD16_BYTE( "dduxb07.bin", 0x20000, 0x010000, CRC(0217369c) SHA1(b6ec2fa1279a27a602d79e1073c54193745ea816) )
2005   ROM_LOAD16_BYTE( "dduxb11.bin", 0x20001, 0x010000, CRC(cfb2af18) SHA1(1ad18f933a7b797f0364d1f4a6c8549351b4c9a6) )
2006   ROM_LOAD16_BYTE( "dduxb08.bin", 0x40000, 0x010000, CRC(8844f336) SHA1(18c1baaad3bcc658d4a6d03de8c97378b5284e88) )
2007   ROM_LOAD16_BYTE( "dduxb12.bin", 0x40001, 0x010000, CRC(28ce9b15) SHA1(1640df9c8f21893c0647ad2f4210c714a06e6f37) )
2008   ROM_LOAD16_BYTE( "dduxb09.bin", 0x60000, 0x010000, CRC(6b64f665) SHA1(df07fcf2bbec6fa78f89b95272762aebd6f3ec0e) )
2009   ROM_LOAD16_BYTE( "dduxb13.bin", 0x60001, 0x010000, CRC(efe57759) SHA1(69b8969b20ab9480df2735bd2bcd527069196bd7) )
2544    Golden Axe (different HW bottleg)
20102545
2011   ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
2012   ROM_LOAD( "dduxb01.bin", 0x0000, 0x8000, CRC(0dbef0d7) SHA1(8b9afb2fcb946cec467b1e691c267194b503f841) )
2013ROM_END
2546    Anno    1989
2547    Produttore
2548    N.revisione
20142549
2015// sys16B
2016ROM_START( eswatbl )
2017   ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
2018   ROM_LOAD16_BYTE( "eswat_c.rom", 0x000000, 0x10000, CRC(1028cc81) SHA1(24b4cd182419a44f3d6afa1c4273353024eb278f) )
2019   ROM_LOAD16_BYTE( "eswat_f.rom", 0x000001, 0x10000, CRC(f7b2d388) SHA1(8131ba8f4fa01751b9993c3c6c218c9bd3adb328) )
2020   ROM_LOAD16_BYTE( "eswat_b.rom", 0x020000, 0x10000, CRC(87c6b1b5) SHA1(a9f29e29a9c0e3daf272dce263a5fd7866642c77) )
2021   ROM_LOAD16_BYTE( "eswat_e.rom", 0x020001, 0x10000, CRC(937ddf9a) SHA1(9fc73f93e9c4221a4dc778593edc02cb405b2f78) )
2022   ROM_LOAD16_BYTE( "eswat_a.rom", 0x040000, 0x08000, CRC(2af4fc62) SHA1(f7b1539a5ab9560bd49dfecf44699abccfb649be) )
2023   ROM_LOAD16_BYTE( "eswat_d.rom", 0x040001, 0x08000, CRC(b4751e19) SHA1(57c9687dc864c163d13dbb89057cd42684a199cd) )
2550    CPU:
2551    main PCB:
2552        1x 68000 (main)(missing)
2553        1x LH0080B-Z80B-CPU (sound)
2554        1x D7759C (sound)
2555        1x YM2151 (sound)
2556        1x YM3012 (sound)
2557        1x UPC1241H (sound)
2558        1x oscillator 20.000 (close to main)
2559        1x oscillator 24.000MHz (close to sound)
2560        1x blue resonator 655K (close to sound)
20242561
2025   ROM_REGION( 0xc0000, "gfx1", 0 ) /* tiles */
2026   ROM_LOAD( "mpr12624.b11", 0x00000, 0x40000, CRC(375a5ec4) SHA1(42b9116bdc0e0a5b1dd667ac1856b4c2252829ba) ) // ic19
2027   ROM_LOAD( "mpr12625.b12", 0x40000, 0x40000, CRC(3b8c757e) SHA1(0b66e8446d059a12e47e2a6fe8f0a333245bb95c) ) // ic20
2028   ROM_LOAD( "mpr12626.b13", 0x80000, 0x40000, CRC(3efca25c) SHA1(0d866bf53a16b52719f73081e933f4db27d72ece) ) // ic21
2562    ROMs:
2563    main PCB:
2564        2x NMC27C512 (1,3)
2565        2x NMC27C256 (2,12)
2566        8x TMS27PC512 (4,5,6,7,8,9,10,11)
20292567
2030   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) /* sprites */
2031   ROM_LOAD16_BYTE( "ic9",  0x000001, 0x20000, CRC(0d1530bf) SHA1(bb8626cd98761c1c20cee117d00315c85621ba6a) )
2032   ROM_CONTINUE(            0x100001, 0x20000 )
2033   ROM_LOAD16_BYTE( "ic12", 0x000000, 0x20000, CRC(18ff0799) SHA1(5417223378aef16ee2b4f438d1f8f11a23fe7265) )
2034   ROM_CONTINUE(            0x100000, 0x20000 )
2035   ROM_LOAD16_BYTE( "ic10", 0x040001, 0x20000, CRC(32069246) SHA1(4913009bc72bf4f8b171b14fe06457f5784cab15) )
2036   ROM_CONTINUE(            0x140001, 0x20000 )
2037   ROM_LOAD16_BYTE( "ic13", 0x040000, 0x20000, CRC(a3dfe436) SHA1(640ccc552114d403f35d441574d2f3e4f1d4a8f9) )
2038   ROM_CONTINUE(            0x140000, 0x20000 )
2039   ROM_LOAD16_BYTE( "ic11", 0x080001, 0x20000, CRC(f6b096e0) SHA1(695ad1adbdc29f4d614645867e16de038cf92709) )
2040   ROM_CONTINUE(            0x180001, 0x20000 )
2041   ROM_LOAD16_BYTE( "ic14", 0x080000, 0x20000, CRC(6773fef6) SHA1(91e646ea447be02254d060daf255d26afe0cc79e) )
2042   ROM_CONTINUE(            0x180000, 0x20000 )
2568    roms PCB:
2569        29x Am27C512 (13-32,34-42)
2570        1x NMC27C512 (33)
2571        1x PROM N82S129N
20432572
2044   ROM_REGION( 0x50000, "soundcpu", 0 ) /* sound CPU */
2045   ROM_LOAD( "epr12617.a13",  0x00000, 0x08000, CRC(7efecf23) SHA1(2b87af7cfaab5942a3f7b38c987fcba01d3475ab) ) // ic8
2046   ROM_LOAD( "mpr12616.a11", 0x10000, 0x40000, CRC(254347c2) SHA1(bf2d83a69a5be375c7e42e9f7d6e65c1095a354c) ) // ic6
2047ROM_END
20482573
2049// sys16B
2050ROM_START( fpointbl )
2051   ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 code */
2052   ROM_LOAD16_BYTE( "flpoint.003", 0x000000, 0x10000, CRC(4d6df514) SHA1(168aa1629ab7152ba1984605155406b236954a2c) )
2053   ROM_LOAD16_BYTE( "flpoint.002", 0x000001, 0x10000, CRC(4dff2ee8) SHA1(bd157d8c168d45e7490a05d5e1e901d9bdda9599) )
2574    RAMs:
2575    main PCB:
2576        1x GM76C28
2577        2x GM76C88
2578        2x HM6116K
20542579
2055   ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT ) /* tiles */
2056   ROM_LOAD( "flpoint.006", 0x00000, 0x10000, CRC(c539727d) SHA1(56674effe1d273128dddd2ff9e02974ec10f3fff) )
2057   ROM_LOAD( "flpoint.005", 0x10000, 0x10000, CRC(82c0b8b0) SHA1(e1e2e721cb8ad53df33065582dc90edeba9c3cab) )
2058   ROM_LOAD( "flpoint.004", 0x20000, 0x10000, CRC(522426ae) SHA1(90fd0a19b30a8a61dc4cfa66a64115596333dcc6) )
2580    roms PCB:
2581        8x LC3517BS
2582        2x 256K S BGD-A
20592583
2060   ROM_REGION16_BE( 0x20000, "gfx2", 0 ) /* sprites */
2061   ROM_LOAD16_BYTE( "12596.bin", 0x00001, 0x010000, CRC(4a4041f3) SHA1(4c52b30223d8aa80ccdbb196098cb17e64ad6583) )
2062   ROM_LOAD16_BYTE( "12597.bin", 0x00000, 0x010000, CRC(6961e676) SHA1(7639d2da086b57a9a8d6100fdacf40d97d7c4772) )
20632584
2064   ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
2065   ROM_LOAD( "flpoint.001", 0x0000, 0x8000, CRC(c5b8e0fe) SHA1(6cf8c67151d8604326fc6dbf976c0635b452a844) )   // bootleg rom doesn't work, but should be correct!
2066ROM_END
2585    PLDs:
2586    main PCB:
2587        3x PAL16L8ACN (not dumped)
20672588
2068ROM_START( fpointbj )
2069   ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 code */
2070   ROM_LOAD16_BYTE( "boot2.003", 0x000000, 0x10000, CRC(6c00d1b0) SHA1(fd0c47b8ca010a64d3ef91980f93854ebc98fbda) )
2071   ROM_LOAD16_BYTE( "boot2.002", 0x000001, 0x10000, CRC(c1fcd704) SHA1(697bef464e53fb9891ed15ee2d6210107b693b20) )
2589    roms PCB:
2590        1x PEEL18CV8P (not dumped)
20722591
2073   ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT ) /* tiles */
2074   ROM_LOAD( "flpoint.006", 0x00000, 0x10000, CRC(c539727d) SHA1(56674effe1d273128dddd2ff9e02974ec10f3fff) )
2075   ROM_LOAD( "flpoint.005", 0x10000, 0x10000, CRC(82c0b8b0) SHA1(e1e2e721cb8ad53df33065582dc90edeba9c3cab) )
2076   ROM_LOAD( "flpoint.004", 0x20000, 0x10000, CRC(522426ae) SHA1(90fd0a19b30a8a61dc4cfa66a64115596333dcc6) )
2592    Note
2593    main PCB:
2594        1x JAMMA edge connector
2595        2x 50 pins flat cable connector to roms PCB
2596        1x trimmer (volume)
2597        2x 8x2 switches dip
20772598
2078   ROM_REGION16_BE( 0x20000, "gfx2", 0 ) /* sprites */
2079   ROM_LOAD16_BYTE( "12596.bin", 0x00001, 0x010000, CRC(4a4041f3) SHA1(4c52b30223d8aa80ccdbb196098cb17e64ad6583) )
2080   ROM_LOAD16_BYTE( "12597.bin", 0x00000, 0x010000, CRC(6961e676) SHA1(7639d2da086b57a9a8d6100fdacf40d97d7c4772) )
2081
2082   ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
2083   ROM_LOAD( "flpoint.001", 0x0000, 0x8000, CRC(c5b8e0fe) SHA1(6cf8c67151d8604326fc6dbf976c0635b452a844) )   // bootleg rom doesn't work, but should be correct!
2084
2085   /* stuff below isn't used but loaded because it was on the board .. */
2086   ROM_REGION( 0x0120, "proms", 0 )
2087   ROM_LOAD( "82s129.1",  0x0000, 0x0100, CRC(a7c22d96) SHA1(160deae8053b09c09328325246598b3518c7e20b) )
2088   ROM_LOAD( "82s123.2",  0x0100, 0x0020, CRC(58bcf8bd) SHA1(e4d3d179b08c0f3424a6bec0f15058fb1b56f8d8) )
2089
2090   ROM_REGION( 0x0600, "plds", 0 )
2091   ROM_LOAD( "fpointbj_gal16v8_1.bin", 0x0000, 0x0117, CRC(ba7f292c) SHA1(c383700d05663c9c5f29d5d04d16b05cd6adceb8) )
2092   ROM_LOAD( "fpointbj_gal16v8_3.bin", 0x0200, 0x0117, CRC(ce1ab1e1) SHA1(dcfc0015d8595ee6cb6bb02c95655161a7f3b017) )
2093   ROM_LOAD( "fpointbj_gal20v8.bin", 0x0400, 0x019d, NO_DUMP ) /* Protected */
2094ROM_END
2095
2096static UINT8 *decrypted_region;
2097
2098static DRIVER_INIT( goldnabl )
2099{
2100   int i;
2101   UINT8 *ROM = memory_region(machine, "maincpu");
2102   UINT8* KEY = memory_region(machine, "decryption");
2103   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
2104   UINT8 data[0x1000];
2105
2106   // the decryption key is in a rom (part of an MSDOS executable...)
2107   for (i=0;i<0x800;i++)
2108   {
2109      KEY[i] = KEY[i] ^ 0xff;
2110      data[(i*2)+0] = ((KEY[i] & 0x80) >> 1) | ((KEY[i] & 0x40) >> 2) | ((KEY[i] & 0x20) >> 3) | ((KEY[i] & 0x10) >> 4);
2111      data[(i*2)+1] = ((KEY[i] & 0x08) << 3) | ((KEY[i] & 0x04) << 2) | ((KEY[i] & 0x02) << 1) | ((KEY[i] & 0x01) << 0);
2112   }
2113
2114   decrypted_region = auto_alloc_array(machine, UINT8, 0xc0000);
2115   memcpy (decrypted_region, ROM, 0xc0000);
2116
2117   for (i = 0;i < 0x40000;i++)
2118   {
2119      decrypted_region[i] = ROM[i] ^ data[(i&0xfff)^1];
2120   }
2121
2122   memory_set_decrypted_region(space, 0x00000, 0xbffff, decrypted_region);
2123
2124   MACHINE_RESET_CALL(sys16_onetime);
2125}
2126
2127
2128static DRIVER_INIT( bayrouteb1 )
2129{
2130   // it has the same encryption as the golden axe bootleg!
2131   //
2132   // but also some protection, probably code provided in RAM by an MCU
2133   //
2134   // for now we use the code which is present in the unprotected bootleg set
2135   // and modify the rom to use it
2136   UINT16 *ROM2;
2137   UINT16* decrypted_region2;
2138
2139   // decrypt
2140   DRIVER_INIT_CALL( goldnabl );
2141
2142   ROM2 = (UINT16*)memory_region(machine, "maincpu");
2143   decrypted_region2 = (UINT16*)decrypted_region;
2144
2145   // patch interrupt vector
2146   ROM2[0x0070/2] = 0x000b;
2147   ROM2[0x0072/2] = 0xf000;
2148
2149   // patch check for code in RAM
2150   decrypted_region2[0x107e/2] = 0x48e7;
2151   decrypted_region2[0x1080/2] = 0x000b;
2152   decrypted_region2[0x1082/2] = 0xf000;
2153}
2154
2155static DRIVER_INIT( bayrouteb2 )
2156{
2157   UINT8 *mem;
2158
2159   MACHINE_RESET_CALL(sys16_onetime);
2160
2161   mem = memory_region(machine, "soundcpu");
2162   memcpy(mem, mem+0x10000, 0x8000);
2163}
2164
2165/*
2166
2167this is a more complete dump of the old encrypted bootleg set
2168
2169Golden Axe (different HW bottleg)
2170
2171Anno    1989
2172Produttore
2173N.revisione
2174CPU main PCB:
21751x 68000 (main)(missing)
21761x LH0080B-Z80B-CPU (sound)
21771x D7759C (sound)
21781x YM2151 (sound)
21791x YM3012 (sound)
21801x UPC1241H (sound)
21811x oscillator 20.000 (close to main)
21821x oscillator 24.000MHz (close to sound)
21831x blue resonator 655K (close to sound)
2184ROMs    main PCB:
21852x NMC27C512 (1,3)
21862x NMC27C256 (2,12)
21878x TMS27PC512 (4,5,6,7,8,9,10,11)
2188
2189roms PCB:
219029x Am27C512 (13-32,34-42)
21911x NMC27C512 (33)
21921x PROM N82S129N
2193
2194
2195RAMs:
2196main PCB:
21971x GM76C28
21982x GM76C88
21992x HM6116K
2200
2201roms PCB:
22028x LC3517BS
22032x 256K S BGD-A
2204
2205
2206PLDs:
2207main PCB:
22083x PAL16L8ACN (not dumped)
2209
2210roms PCB:
22111x PEEL18CV8P (not dumped)
2212Note    main PCB:
22131x JAMMA edge connector
22142x 50 pins flat cable connector to roms PCB
22151x trimmer (volume)
22162x 8x2 switches dip
2217
2218roms PCB:
22192x 50 pins flat cable connector to roms PCB
2599    roms PCB:
2600        2x 50 pins flat cable connector to roms PCB
22202601*/
22212602
22222603ROM_START( goldnaxeb1 )
r7356r7357
22862667   ROM_LOAD( "82s129.bin",     0x000, 0x100,  CRC(88962e80) SHA1(ebf3d57d53fcba727cf20e4bb26f12934f7d1bc7) )
22872668ROM_END
22882669
2289/* Golden Axe (bootleg) made in Italy?
2290   PCB: GENSYS-1/I
2670/*
2671    Golden Axe (bootleg) made in Italy?
2672    PCB: GENSYS-1/I
22912673
2292 CPUs
2674    CPUs
2675        1x SCN68000CAN64-KGQ7551-8931KE (main - upper board)(IC40)
2676        1x oscillator 20.000MHz (upper board - near main CPU)(XL2)
2677        1x STZ8400BB1-Z80BCPU-28911 (sound - upper board)(IC44)
2678        2x YAMAHA YM2203C (sound - upper board)IC27, IC28)
2679        1x OKI M5205 (sound - upper board)(IC16)
2680        2x YAMAHA Y3014B (DAC - sound - upper board)(IC19, IC20)
2681        1x crystal resonator CSB398P (upper board - near sound CPUs)(XL1)
2682        1x oscillator 24MHz (lower board near connectors to upper board)(XL1)
22932683
2294 1x SCN68000CAN64-KGQ7551-8931KE (main - upper board)(IC40)
2295 1x oscillator 20.000MHz (upper board - near main CPU)(XL2)
2296 1x STZ8400BB1-Z80BCPU-28911 (sound - upper board)(IC44)
2297 2x YAMAHA YM2203C (sound - upper board)IC27, IC28)
2298 1x OKI M5205 (sound - upper board)(IC16)
2299 2x YAMAHA Y3014B (DAC - sound - upper board)(IC19, IC20)
2300 1x crystal resonator CSB398P (upper board - near sound CPUs)(XL1)
2301 1x oscillator 24MHz (lower board near connectors to upper board)(XL1)
2684    ROMs
2685        8x TMS27C512-20JL (from 1 to 8 - upper board) (CPU)
2686        26x ST M27512FI (from 9 to 34 - upper board) (Sound + Tilemap)
2687        6x ST M27512FI (from 35 to 40 - lower board) (Sprites)
23022688
2303 ROMs
2304 8x TMS27C512-20JL (from 1 to 8 - upper board) (CPU)
2305 26x ST M27512FI (from 9 to 34 - upper board) (Sound + Tilemap)
2306 6x ST M27512FI (from 35 to 40 - lower board) (Sprites)
2307
23082689*/
23092690
2310
23112691ROM_START( goldnaxeb2 )
23122692   ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 code */
23132693   ROM_LOAD16_BYTE( "ic39.1", 0x00000, 0x10000, CRC(71489c9a) SHA1(ec25463a2c63027d2635f0e27f5a971d68938fe3) )
r7356r7357
23202700   ROM_LOAD16_BYTE( "ic36.4", 0xa0000, 0x10000, CRC(b69ab892) SHA1(9b426058a80abb8dd3d6c0c55574fdc841889a72) )
23212701   ROM_LOAD16_BYTE( "ic50.8", 0xa0001, 0x10000, CRC(3cf2f725) SHA1(1f620fcebe8533cba50736ae1d97c095abf1bc25) )
23222702
2323
23242703   ROM_REGION( 0x60000, "gfx1", ROMREGION_INVERT ) /* tiles */
23252704   ROM_LOAD( "ic4.35",  0x00000, 0x10000, CRC(84587263) SHA1(3a88c8578a477a487a0a214a367042b9739f39eb) )
23262705   ROM_LOAD( "ic18.38", 0x10000, 0x10000, CRC(63d72388) SHA1(ba0a582b1daf3a1e316237efbad17fcc0381643f) )
r7356r7357
23602739   ROM_LOAD( "ic46.9",  0x10000, 0x10000, CRC(634dd54e) SHA1(ac4ab0ad9c1ac634ff4dfb83232b0fa5cfb26fdd) )
23612740ROM_END
23622741
2363
2364
2365ROM_START( passht4b )
2366   ROM_REGION( 0x20000, "maincpu", 0 ) /* 68000 code */
2367   ROM_LOAD16_BYTE( "pas4p.3", 0x000000, 0x10000, CRC(2d8bc946) SHA1(35d3e529d4815543d9876fd0545c3d686467abaa) )
2368   ROM_LOAD16_BYTE( "pas4p.4", 0x000001, 0x10000, CRC(e759e831) SHA1(dd5727dc28010cb988e4951723171171eb645ce8) )
2369
2370   ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT ) /* tiles */
2371   ROM_LOAD( "pas4p.11", 0x00000, 0x10000, CRC(da20fbc9) SHA1(21dc8143f4d1cebae4f86e83495fa84e5293ba48) )
2372   ROM_LOAD( "pas4p.12", 0x10000, 0x10000, CRC(bebb9211) SHA1(4f56048f6f70b63f74a4c0d64456213d36ce5b26) )
2373   ROM_LOAD( "pas4p.13", 0x20000, 0x10000, CRC(e37506c3) SHA1(e6fbf15d58f321a3d052fefbe5a1901e4a1734ae) )
2374
2375   ROM_REGION16_BE( 0x60000, "gfx2", 0 ) /* sprites */
2376   ROM_LOAD16_BYTE( "opr11862.b1",  0x00001, 0x10000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
2377   ROM_LOAD16_BYTE( "opr11865.b5",  0x00000, 0x10000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
2378   ROM_LOAD16_BYTE( "opr11863.b2",  0x20001, 0x10000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) )
2379   ROM_LOAD16_BYTE( "opr11866.b6",  0x20000, 0x10000, CRC(50eb71cc) SHA1(463b4917ca19c7f4ad2c2845caa104d5e4a2dda3) )
2380   ROM_LOAD16_BYTE( "opr11864.b3",  0x40001, 0x10000, CRC(05733ca8) SHA1(1dbc7c99450ebe6a9fd8c0244fd3cb38b74984ef) )
2381   ROM_LOAD16_BYTE( "opr11867.b7",  0x40000, 0x10000, CRC(81e49697) SHA1(a70fa409e3555ad6c8f28930a7026fdf2deb8c65) )
2382
2383   ROM_REGION( 0x20000, "soundcpu", 0 ) /* sound CPU */
2384   ROM_LOAD( "pas4p.1",  0x00000, 0x08000, CRC(e60fb017) SHA1(21298036eab55c74427f1c2e3a9623d41bca4849) )
2385   ROM_LOAD( "pas4p.2",  0x10000, 0x10000, CRC(092e016e) SHA1(713638749efa9dce19c547b84308236110bc85fe) )
2386ROM_END
2387
2388/* Passing Shot Bootleg is a decrypted version of Passing Shot Japanese (passshtj). It has been heavily modified */
2389ROM_START( passshtb )
2390   ROM_REGION( 0x020000, "maincpu", 0 ) /* 68000 code */
2391   ROM_LOAD16_BYTE( "pass3_2p.bin", 0x000000, 0x10000, CRC(26bb9299) SHA1(11bacf86dfdd8bcfbfb61f0ebc59890325c48adc) )
2392   ROM_LOAD16_BYTE( "pass4_2p.bin", 0x000001, 0x10000, CRC(06ac6d5d) SHA1(2dd71a8a956404326797de8beed7bca016c9919e) )
2393
2394   ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
2395   ROM_LOAD( "opr11854.b9",  0x00000, 0x10000, CRC(d31c0b6c) SHA1(610d04988da70c30300cc5614817eda9d2204f39) )
2396   ROM_LOAD( "opr11855.b10", 0x10000, 0x10000, CRC(b78762b4) SHA1(d594ef846bd7fed8da91a89906b39c1a2867a1fe) )
2397   ROM_LOAD( "opr11856.b11", 0x20000, 0x10000, CRC(ea49f666) SHA1(36ccd32cdcbb7fcc300628bb59c220ec3c324d82) )
2398
2399   ROM_REGION16_BE( 0x80000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
2400   ROM_LOAD16_BYTE( "opr11862.b1",  0x00001, 0x10000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
2401   ROM_LOAD16_BYTE( "opr11865.b5",  0x00000, 0x10000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
2402   ROM_LOAD16_BYTE( "opr11863.b2",  0x20001, 0x10000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) )
2403   ROM_LOAD16_BYTE( "opr11866.b6",  0x20000, 0x10000, CRC(50eb71cc) SHA1(463b4917ca19c7f4ad2c2845caa104d5e4a2dda3) )
2404   ROM_LOAD16_BYTE( "opr11864.b3",  0x40001, 0x10000, CRC(05733ca8) SHA1(1dbc7c99450ebe6a9fd8c0244fd3cb38b74984ef) )
2405   ROM_LOAD16_BYTE( "opr11867.b7",  0x40000, 0x10000, CRC(81e49697) SHA1(a70fa409e3555ad6c8f28930a7026fdf2deb8c65) )
2406
2407   ROM_REGION( 0x30000, "soundcpu", 0 ) /* sound CPU */
2408   ROM_LOAD( "epr11857.a7",  0x00000, 0x08000, CRC(789edc06) SHA1(8c89c94e503513c287807d187de78a7fbd75a7cf) )
2409   ROM_LOAD( "epr11858.a8",  0x10000, 0x08000, CRC(08ab0018) SHA1(0685f80a7d403208c9cfffea3f2035324f3924fe) )
2410   ROM_LOAD( "epr11859.a9",  0x18000, 0x08000, CRC(8673e01b) SHA1(e79183ab30e683fdf61ced2e9dbe010567c324cb) )
2411   ROM_LOAD( "epr11860.a10", 0x20000, 0x08000, CRC(10263746) SHA1(1f981fb185c6a9795208ecdcfba36cf892a99ed5) )
2412   ROM_LOAD( "epr11861.a11", 0x28000, 0x08000, CRC(38b54a71) SHA1(68ec4ef5b115844214ff2213be1ce6678904fbd2) )
2413ROM_END
2414
2415
2416
2417/* Shinobi bootleg by 'Datsu' - Sound hardware is different */
2418ROM_START( shinobld )
2419   ROM_REGION( 0x040000, "maincpu", 0 ) /* 68000 code */
2420   ROM_LOAD16_BYTE( "12.bin", 0x000001, 0x10000, CRC(757a0c71) SHA1(8f476b0fd5f5dd480489af09b99585c58a4801fc) )
2421   ROM_LOAD16_BYTE( "14.bin", 0x000000, 0x10000, CRC(a65870b2) SHA1(3e9b4aa694bf86ef9db4756ebaa3d8d87d7f269a) )
2422   ROM_LOAD16_BYTE( "13.bin", 0x020001, 0x10000, CRC(c4334bcd) SHA1(ea1dd23ca6fbf632d8e10bbb9ced6515a69bd14a) )
2423   ROM_LOAD16_BYTE( "15.bin", 0x020000, 0x10000, CRC(b70a6ec1) SHA1(79db41c36d6a053bcdc355b46b19ae938a7755a9) )
2424
2425   ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT ) /* tiles */
2426   ROM_LOAD( "9.bin",  0x00000, 0x10000, CRC(565e11c6) SHA1(e063400b3d0470b932d75da0be9cd4b446189dea) )
2427   ROM_LOAD( "10.bin", 0x10000, 0x10000, CRC(7cc40b6c) SHA1(ffad7eef7ab2ff9a2e49a8d71b5785a61fa3c675) )
2428   ROM_LOAD( "11.bin", 0x20000, 0x10000, CRC(0f6c7b1c) SHA1(defc76592c285b3396e89a3cff7a73f3a948117f) )
2429
2430   ROM_REGION16_BE( 0x080000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
2431   ROM_LOAD16_BYTE( "5.bin", 0x00001, 0x10000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
2432   ROM_LOAD16_BYTE( "3.bin", 0x00000, 0x10000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
2433   ROM_LOAD16_BYTE( "8.bin", 0x20001, 0x10000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) )
2434   ROM_LOAD16_BYTE( "2.bin", 0x20000, 0x10000, CRC(25307ef8) SHA1(91ffbe436f80d583524ee113a8b7c0cf5d8ab286) )
2435   ROM_LOAD16_BYTE( "6.bin", 0x40001, 0x10000, CRC(c29ac34e) SHA1(b5e9b8c3233a7d6797f91531a0d9123febcf1660) )
2436   ROM_LOAD16_BYTE( "4.bin", 0x40000, 0x10000, CRC(04a437f8) SHA1(ea5fed64443236e3404fab243761e60e2e48c84c) )
2437   ROM_LOAD16_BYTE( "7.bin", 0x60001, 0x10000, CRC(41f41063) SHA1(5cc461e9738dddf9eea06831fce3702d94674163) )
2438   ROM_LOAD16_BYTE( "1.bin", 0x60000, 0x10000, CRC(b6e1fd72) SHA1(eb86e4bf880bd1a1d9bcab3f2f2e917bcaa06172) )
2439
2440   ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU + data */
2441   ROM_LOAD( "16.bin", 0x0000, 0x10000, CRC(52c8364e) SHA1(01d30b82f92498d155d2e31d43d58dff0285cce3) )
2442ROM_END
2443
2444// sys16B
2445ROM_START( tetrisbl )
2446   ROM_REGION( 0x040000, "maincpu", ROMREGION_ERASEFF ) /* 68000 code */
2447   ROM_LOAD16_BYTE( "rom2.bin", 0x000000, 0x10000, CRC(4d165c38) SHA1(04706b1977ae18bd09bafaf8ea65f8e5f32e04b8) )
2448   ROM_LOAD16_BYTE( "rom1.bin", 0x000001, 0x10000, CRC(1e912131) SHA1(8f53504ac08942ee340489d84eab825e654d0a2c) )
2449
2450   ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
2451   ROM_LOAD( "epr12165.b9",  0x00000, 0x10000, CRC(62640221) SHA1(c311d3847a981d0e1609f9b3d80481565d32d78c) )
2452   ROM_LOAD( "epr12166.b10", 0x10000, 0x10000, CRC(9abd183b) SHA1(621b017cb34973f9227be383e26b5cd41aea9422) )
2453   ROM_LOAD( "epr12167.b11", 0x20000, 0x10000, CRC(2495fd4e) SHA1(2db94ead9223a67238a97e724668076fc43e5534) )
2454
2455   ROM_REGION16_BE( 0x020000, "gfx2", 0 ) /* sprites */
2456   ROM_LOAD16_BYTE( "obj0-o.rom", 0x00001, 0x10000, CRC(2fb38880) SHA1(0e1b601bbda78d1887951c1f7e752531c281bc83) )
2457   ROM_LOAD16_BYTE( "obj0-e.rom", 0x00000, 0x10000, CRC(d6a02cba) SHA1(d80000f92e754e89c6ca7b7273feab448fc9a061) )
2458
2459   ROM_REGION( 0x40000, "soundcpu", 0 ) /* sound CPU */
2460   ROM_LOAD( "epr12168.a7", 0x0000, 0x8000, CRC(bd9ba01b) SHA1(fafa7dc36cc057a50ae4cdf7a35f3594292336f4) )
2461ROM_END
2462
2463// sys16B
24642742ROM_START( tturfbl )
24652743   ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 code */
24662744   ROM_LOAD16_BYTE( "tt042197.rom", 0x00000, 0x10000, CRC(deee5af1) SHA1(0caba775021dc7e28ac6b7af8eac4f49d3102c83) )
r7356r7357
24882766   ROM_LOAD( "tt0246ff.rom", 0x20000, 0x10000, CRC(bb4bba8f) SHA1(b182a7e1d0425e93c2c1b93472aafd30a6af6907) )
24892767ROM_END
24902768
2491ROM_START( wb3bbl )
2492   ROM_REGION( 0x040000, "maincpu", 0 ) /* 68000 code */
2493   ROM_LOAD16_BYTE( "wb3_03", 0x000000, 0x10000, CRC(0019ab3b) SHA1(89d49a437690fa6e0c35bb9f1450042f89504714) )
2494   ROM_LOAD16_BYTE( "wb3_05", 0x000001, 0x10000, CRC(196e17ee) SHA1(71e4345b2c3d1612a3d424c9310fad1e23c8a9f7) )
2495   ROM_LOAD16_BYTE( "wb3_02", 0x020000, 0x10000, CRC(c87350cb) SHA1(55a8cb68d70b6060dd9a55e281e216ce3917ea5b) )
2496   ROM_LOAD16_BYTE( "wb3_04", 0x020001, 0x10000, CRC(565d5035) SHA1(e28a132f1a4ce9466945e231c54502178748af98) )
2769ROM_START( dduxbl )
2770   ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 code */
2771   ROM_LOAD16_BYTE( "dduxb03.bin", 0x000000, 0x20000, CRC(e7526012) SHA1(a1798008bfa1ce9b87dc330f3817b1978052fcfd) )
2772   ROM_LOAD16_BYTE( "dduxb05.bin", 0x000001, 0x20000, CRC(459d1237) SHA1(55e9c0dc341c919d58cc789203642c397d7ac65e) )
2773   /* empty 0x40000 - 0x80000 */
2774   ROM_LOAD16_BYTE( "dduxb02.bin", 0x080000, 0x20000, CRC(d8ed3132) SHA1(a9d5ad8f79fb635cc234a99fad398688a5f15926) )
2775   ROM_LOAD16_BYTE( "dduxb04.bin", 0x080001, 0x20000, CRC(30c6cb92) SHA1(2e17c74eeb37c9731fc2e365cc0114f7383c0106) )
24972776
24982777   ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT ) /* tiles */
2499   ROM_LOAD( "wb3_14", 0x00000, 0x10000, CRC(d3f20bca) SHA1(0a87f709f8e2a913473512ede408e2cbc535443f) )
2500   ROM_LOAD( "wb3_15", 0x10000, 0x10000, CRC(96ff9d52) SHA1(791a9da4860e0d42fba98f80a3c6725ad8c73e33) )
2501   ROM_LOAD( "wb3_16", 0x20000, 0x10000, CRC(afaf0d31) SHA1(d4309329a0a543250788146b63b27ff058c02fc3) )
2778   ROM_LOAD( "dduxb14.bin", 0x00000, 0x10000, CRC(664bd135) SHA1(674b06e01c2c8f5b8057dd24d470330c3f140473) )
2779   ROM_LOAD( "dduxb15.bin", 0x10000, 0x10000, CRC(ce0d2b30) SHA1(e60521c46f1650c9bdc76f2ceb91a6d61aaa0a09) )
2780   ROM_LOAD( "dduxb16.bin", 0x20000, 0x10000, CRC(6de95434) SHA1(7bed2a0261cf6c2fbb3756633f05f0bb2173977c) )
25022781
2503   ROM_REGION16_BE( 0x100000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
2504   ROM_LOAD16_BYTE( "epr12090.b1", 0x00001, 0x010000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) )
2505   ROM_LOAD16_BYTE( "epr12094.b5", 0x00000, 0x010000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
2506   ROM_LOAD16_BYTE( "epr12091.b2", 0x20001, 0x010000, CRC(8409a243) SHA1(bcbb9510a6499d8147543d6befa5a49f4ac055d9) )
2507   ROM_LOAD16_BYTE( "epr12095.b6", 0x20000, 0x010000, CRC(e774ec2c) SHA1(a4aa15ec7be5539a740ad02ff720458018dbc536) )
2508   ROM_LOAD16_BYTE( "epr12092.b3", 0x40001, 0x010000, CRC(5c2f0d90) SHA1(e0fbc0f841e4607ad232931368b16e81440a75c4) )
2509   ROM_LOAD16_BYTE( "epr12096.b7", 0x40000, 0x010000, CRC(0cd59d6e) SHA1(caf754a461feffafcfe7bfc6e89da76c4db257c5) )
2510   ROM_LOAD16_BYTE( "epr12093.b4", 0x60001, 0x010000, CRC(4891e7bb) SHA1(1be04fcabe9bfa8cf746263a5bcca67902a021a0) )
2511   ROM_LOAD16_BYTE( "epr12097.b8", 0x60000, 0x010000, CRC(e645902c) SHA1(497cfcf6c25cc2e042e16dbcb1963d2223def15a) )
2782   ROM_REGION16_BE( 0x100000, "gfx2", 0 ) //* sprites */
2783   ROM_LOAD16_BYTE( "dduxb06.bin", 0x00000, 0x010000, CRC(b0079e99) SHA1(9bb4d3fa804a3d05a6e06b45a1280d7064e96ac6) )
2784   ROM_LOAD16_BYTE( "dduxb10.bin", 0x00001, 0x010000, CRC(0be3aee5) SHA1(48fc779b7398abbb82cd0d0d28705ece75b3c4e3) )
2785   ROM_LOAD16_BYTE( "dduxb07.bin", 0x20000, 0x010000, CRC(0217369c) SHA1(b6ec2fa1279a27a602d79e1073c54193745ea816) )
2786   ROM_LOAD16_BYTE( "dduxb11.bin", 0x20001, 0x010000, CRC(cfb2af18) SHA1(1ad18f933a7b797f0364d1f4a6c8549351b4c9a6) )
2787   ROM_LOAD16_BYTE( "dduxb08.bin", 0x40000, 0x010000, CRC(8844f336) SHA1(18c1baaad3bcc658d4a6d03de8c97378b5284e88) )
2788   ROM_LOAD16_BYTE( "dduxb12.bin", 0x40001, 0x010000, CRC(28ce9b15) SHA1(1640df9c8f21893c0647ad2f4210c714a06e6f37) )
2789   ROM_LOAD16_BYTE( "dduxb09.bin", 0x60000, 0x010000, CRC(6b64f665) SHA1(df07fcf2bbec6fa78f89b95272762aebd6f3ec0e) )
2790   ROM_LOAD16_BYTE( "dduxb13.bin", 0x60001, 0x010000, CRC(efe57759) SHA1(69b8969b20ab9480df2735bd2bcd527069196bd7) )
25122791
2792   ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
2793   ROM_LOAD( "dduxb01.bin", 0x0000, 0x8000, CRC(0dbef0d7) SHA1(8b9afb2fcb946cec467b1e691c267194b503f841) )
2794ROM_END
25132795
2796ROM_START( eswatbl )
2797   ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
2798   ROM_LOAD16_BYTE( "eswat_c.rom", 0x000000, 0x10000, CRC(1028cc81) SHA1(24b4cd182419a44f3d6afa1c4273353024eb278f) )
2799   ROM_LOAD16_BYTE( "eswat_f.rom", 0x000001, 0x10000, CRC(f7b2d388) SHA1(8131ba8f4fa01751b9993c3c6c218c9bd3adb328) )
2800   ROM_LOAD16_BYTE( "eswat_b.rom", 0x020000, 0x10000, CRC(87c6b1b5) SHA1(a9f29e29a9c0e3daf272dce263a5fd7866642c77) )
2801   ROM_LOAD16_BYTE( "eswat_e.rom", 0x020001, 0x10000, CRC(937ddf9a) SHA1(9fc73f93e9c4221a4dc778593edc02cb405b2f78) )
2802   ROM_LOAD16_BYTE( "eswat_a.rom", 0x040000, 0x08000, CRC(2af4fc62) SHA1(f7b1539a5ab9560bd49dfecf44699abccfb649be) )
2803   ROM_LOAD16_BYTE( "eswat_d.rom", 0x040001, 0x08000, CRC(b4751e19) SHA1(57c9687dc864c163d13dbb89057cd42684a199cd) )
2804
2805   ROM_REGION( 0xc0000, "gfx1", 0 ) /* tiles */
2806   ROM_LOAD( "mpr12624.b11", 0x00000, 0x40000, CRC(375a5ec4) SHA1(42b9116bdc0e0a5b1dd667ac1856b4c2252829ba) ) // ic19
2807   ROM_LOAD( "mpr12625.b12", 0x40000, 0x40000, CRC(3b8c757e) SHA1(0b66e8446d059a12e47e2a6fe8f0a333245bb95c) ) // ic20
2808   ROM_LOAD( "mpr12626.b13", 0x80000, 0x40000, CRC(3efca25c) SHA1(0d866bf53a16b52719f73081e933f4db27d72ece) ) // ic21
2809
2810   ROM_REGION16_BE( 0x1c0000, "gfx2", 0 ) /* sprites */
2811   ROM_LOAD16_BYTE( "ic9",  0x000001, 0x20000, CRC(0d1530bf) SHA1(bb8626cd98761c1c20cee117d00315c85621ba6a) )
2812   ROM_CONTINUE(            0x100001, 0x20000 )
2813   ROM_LOAD16_BYTE( "ic12", 0x000000, 0x20000, CRC(18ff0799) SHA1(5417223378aef16ee2b4f438d1f8f11a23fe7265) )
2814   ROM_CONTINUE(            0x100000, 0x20000 )
2815   ROM_LOAD16_BYTE( "ic10", 0x040001, 0x20000, CRC(32069246) SHA1(4913009bc72bf4f8b171b14fe06457f5784cab15) )
2816   ROM_CONTINUE(            0x140001, 0x20000 )
2817   ROM_LOAD16_BYTE( "ic13", 0x040000, 0x20000, CRC(a3dfe436) SHA1(640ccc552114d403f35d441574d2f3e4f1d4a8f9) )
2818   ROM_CONTINUE(            0x140000, 0x20000 )
2819   ROM_LOAD16_BYTE( "ic11", 0x080001, 0x20000, CRC(f6b096e0) SHA1(695ad1adbdc29f4d614645867e16de038cf92709) )
2820   ROM_CONTINUE(            0x180001, 0x20000 )
2821   ROM_LOAD16_BYTE( "ic14", 0x080000, 0x20000, CRC(6773fef6) SHA1(91e646ea447be02254d060daf255d26afe0cc79e) )
2822   ROM_CONTINUE(            0x180000, 0x20000 )
2823
2824   ROM_REGION( 0x50000, "soundcpu", 0 ) /* sound CPU */
2825   ROM_LOAD( "epr12617.a13",  0x00000, 0x08000, CRC(7efecf23) SHA1(2b87af7cfaab5942a3f7b38c987fcba01d3475ab) ) // ic8
2826   ROM_LOAD( "mpr12616.a11", 0x10000, 0x40000, CRC(254347c2) SHA1(bf2d83a69a5be375c7e42e9f7d6e65c1095a354c) ) // ic6
2827ROM_END
2828
2829ROM_START( fpointbl )
2830   ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 code */
2831   ROM_LOAD16_BYTE( "flpoint.003", 0x000000, 0x10000, CRC(4d6df514) SHA1(168aa1629ab7152ba1984605155406b236954a2c) )
2832   ROM_LOAD16_BYTE( "flpoint.002", 0x000001, 0x10000, CRC(4dff2ee8) SHA1(bd157d8c168d45e7490a05d5e1e901d9bdda9599) )
2833
2834   ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT ) /* tiles */
2835   ROM_LOAD( "flpoint.006", 0x00000, 0x10000, CRC(c539727d) SHA1(56674effe1d273128dddd2ff9e02974ec10f3fff) )
2836   ROM_LOAD( "flpoint.005", 0x10000, 0x10000, CRC(82c0b8b0) SHA1(e1e2e721cb8ad53df33065582dc90edeba9c3cab) )
2837   ROM_LOAD( "flpoint.004", 0x20000, 0x10000, CRC(522426ae) SHA1(90fd0a19b30a8a61dc4cfa66a64115596333dcc6) )
2838
2839   ROM_REGION16_BE( 0x20000, "gfx2", 0 ) /* sprites */
2840   ROM_LOAD16_BYTE( "12596.bin", 0x00001, 0x010000, CRC(4a4041f3) SHA1(4c52b30223d8aa80ccdbb196098cb17e64ad6583) )
2841   ROM_LOAD16_BYTE( "12597.bin", 0x00000, 0x010000, CRC(6961e676) SHA1(7639d2da086b57a9a8d6100fdacf40d97d7c4772) )
2842
25142843   ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
2515   ROM_LOAD( "epr12127.a10", 0x0000, 0x8000, CRC(0bb901bb) SHA1(c81b198df8e3b0ec568032c76addf0d1a1711194) )
2844   ROM_LOAD( "flpoint.001", 0x0000, 0x8000, CRC(c5b8e0fe) SHA1(6cf8c67151d8604326fc6dbf976c0635b452a844) )   // bootleg rom doesn't work, but should be correct!
25162845ROM_END
25172846
2847ROM_START( fpointbj )
2848   ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 code */
2849   ROM_LOAD16_BYTE( "boot2.003", 0x000000, 0x10000, CRC(6c00d1b0) SHA1(fd0c47b8ca010a64d3ef91980f93854ebc98fbda) )
2850   ROM_LOAD16_BYTE( "boot2.002", 0x000001, 0x10000, CRC(c1fcd704) SHA1(697bef464e53fb9891ed15ee2d6210107b693b20) )
25182851
2519/* Looked at 24/05/09 */
2852   ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT ) /* tiles */
2853   ROM_LOAD( "flpoint.006", 0x00000, 0x10000, CRC(c539727d) SHA1(56674effe1d273128dddd2ff9e02974ec10f3fff) )
2854   ROM_LOAD( "flpoint.005", 0x10000, 0x10000, CRC(82c0b8b0) SHA1(e1e2e721cb8ad53df33065582dc90edeba9c3cab) )
2855   ROM_LOAD( "flpoint.004", 0x20000, 0x10000, CRC(522426ae) SHA1(90fd0a19b30a8a61dc4cfa66a64115596333dcc6) )
25202856
2521// System 16B based bootlegs
2522GAME( 1989, bayrouteb1, bayroute, bayrouteb1, bayroute, bayrouteb1, ROT0,   "bootleg", "Bay Route (encrypted, protected bootleg)", GAME_NO_SOUND | GAME_NOT_WORKING ) // broken sprites (due to missing/wrong irq code?)
2523GAME( 1989, bayrouteb2, bayroute, bayrouteb2, bayroute, bayrouteb2, ROT0,   "bootleg", "Bay Route (Datsu bootleg)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
2524GAME( 1989, goldnaxeb1, goldnaxe, goldnaxe_b1, goldnaxe, goldnabl, ROT0,   "bootleg", "Golden Axe (encrypted bootleg)", GAME_NOT_WORKING|GAME_NO_SOUND )
2525GAME( 1989, goldnaxeb2, goldnaxe, goldnaxe_b2, goldnaxe, goldnab2, ROT0,   "bootleg", "Golden Axe (bootleg)", GAME_NOT_WORKING|GAME_NO_SOUND )
2526GAME( 1989, tturfbl,  tturf,    tturfbl,  tturf,    tturfbl,  ROT0,   "bootleg", "Tough Turf (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2527GAME( 1989, dduxbl,   ddux,     dduxbl,   ddux,     dduxbl,   ROT0,   "bootleg", "Dynamite Dux (bootleg)", GAME_NOT_WORKING )
2528GAME( 1989, eswatbl,  eswat,    eswatbl,  eswat,    eswatbl,  ROT0,   "bootleg", "E-Swat - Cyber Police (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND )
2529GAME( 1989, fpointbl, fpoint,   fpointbl, fpointbl, fpointbl, ROT0,   "bootleg", "Flash Point (World, bootleg)", GAME_NOT_WORKING )
2530GAME( 1989, fpointbj, fpoint,   fpointbl, fpointbl, fpointbl, ROT0,   "bootleg", "Flash Point (Japan, bootleg)", GAME_NOT_WORKING )
2531GAME( 1988, tetrisbl, tetris,   tetrisbl, tetris,   tetrisbl, ROT0,   "bootleg", "Tetris (bootleg)", 0 )
2857   ROM_REGION16_BE( 0x20000, "gfx2", 0 ) /* sprites */
2858   ROM_LOAD16_BYTE( "12596.bin", 0x00001, 0x010000, CRC(4a4041f3) SHA1(4c52b30223d8aa80ccdbb196098cb17e64ad6583) )
2859   ROM_LOAD16_BYTE( "12597.bin", 0x00000, 0x010000, CRC(6961e676) SHA1(7639d2da086b57a9a8d6100fdacf40d97d7c4772) )
25322860
2533// System 16A based bootlegs (less complex tilemap system)
2534GAME( 1987, shinobld, shinobi,  system16a_bootleg_shinobi,  shinobi,  shinobl,  ROT0,   "[Sega] (Datsu bootleg)", "Shinobi (Datsu bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
2535GAME( 1988, passshtb, passsht,  passsht,  passsht,  passsht,  ROT270, "bootleg", "Passing Shot (2 Players) (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2536GAME( 1988, passht4b, passsht,  passht4b, passht4b, passht4b, ROT270, "bootleg", "Passing Shot (4 Players) (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
2537GAME( 1988, wb3bbl,   wb3,      system16a_bootleg_wb3,   wb3b,     wb3bbl,   ROT0,   "bootleg", "Wonder Boy III - Monster Lair (bootleg)", GAME_NOT_WORKING )
2861   ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU */
2862   ROM_LOAD( "flpoint.001", 0x0000, 0x8000, CRC(c5b8e0fe) SHA1(6cf8c67151d8604326fc6dbf976c0635b452a844) )   // bootleg rom doesn't work, but should be correct!
25382863
2539static DRIVER_INIT( beautyb )
2540{
2541   UINT16*rom = (UINT16*)memory_region( machine, "maincpu" );
2542   int x;
2864   /* stuff below isn't used but loaded because it was on the board .. */
2865   ROM_REGION( 0x0120, "proms", 0 )
2866   ROM_LOAD( "82s129.1",  0x0000, 0x0100, CRC(a7c22d96) SHA1(160deae8053b09c09328325246598b3518c7e20b) )
2867   ROM_LOAD( "82s123.2",  0x0100, 0x0020, CRC(58bcf8bd) SHA1(e4d3d179b08c0f3424a6bec0f15058fb1b56f8d8) )
25432868
2544   for (x=0;x<0x8000;x++)
2545   {
2546      rom[x] = rom[x] ^ 0x2400;
2869   ROM_REGION( 0x0600, "plds", 0 )
2870   ROM_LOAD( "fpointbj_gal16v8_1.bin", 0x0000, 0x0117, CRC(ba7f292c) SHA1(c383700d05663c9c5f29d5d04d16b05cd6adceb8) )
2871   ROM_LOAD( "fpointbj_gal16v8_3.bin", 0x0200, 0x0117, CRC(ce1ab1e1) SHA1(dcfc0015d8595ee6cb6bb02c95655161a7f3b017) )
2872   ROM_LOAD( "fpointbj_gal20v8.bin", 0x0400, 0x019d, NO_DUMP ) /* Protected */
2873ROM_END
25472874
2548      if (x&8) rom[x] = BITSWAP16(rom[x],15,14,10,12,  11,13,9,8,
2549                                7,6,5,4,   3,2,1,0 );
2875ROM_START( tetrisbl )
2876   ROM_REGION( 0x040000, "maincpu", ROMREGION_ERASEFF ) /* 68000 code */
2877   ROM_LOAD16_BYTE( "rom2.bin", 0x000000, 0x10000, CRC(4d165c38) SHA1(04706b1977ae18bd09bafaf8ea65f8e5f32e04b8) )
2878   ROM_LOAD16_BYTE( "rom1.bin", 0x000001, 0x10000, CRC(1e912131) SHA1(8f53504ac08942ee340489d84eab825e654d0a2c) )
25502879
2551   }
2880   ROM_REGION( 0x30000, "gfx1", 0 ) /* tiles */
2881   ROM_LOAD( "epr12165.b9",  0x00000, 0x10000, CRC(62640221) SHA1(c311d3847a981d0e1609f9b3d80481565d32d78c) )
2882   ROM_LOAD( "epr12166.b10", 0x10000, 0x10000, CRC(9abd183b) SHA1(621b017cb34973f9227be383e26b5cd41aea9422) )
2883   ROM_LOAD( "epr12167.b11", 0x20000, 0x10000, CRC(2495fd4e) SHA1(2db94ead9223a67238a97e724668076fc43e5534) )
25522884
2553   MACHINE_RESET_CALL(sys16_onetime);
2885   ROM_REGION16_BE( 0x020000, "gfx2", 0 ) /* sprites */
2886   ROM_LOAD16_BYTE( "obj0-o.rom", 0x00001, 0x10000, CRC(2fb38880) SHA1(0e1b601bbda78d1887951c1f7e752531c281bc83) )
2887   ROM_LOAD16_BYTE( "obj0-e.rom", 0x00000, 0x10000, CRC(d6a02cba) SHA1(d80000f92e754e89c6ca7b7273feab448fc9a061) )
25542888
2555}
2889   ROM_REGION( 0x40000, "soundcpu", 0 ) /* sound CPU */
2890   ROM_LOAD( "epr12168.a7", 0x0000, 0x8000, CRC(bd9ba01b) SHA1(fafa7dc36cc057a50ae4cdf7a35f3594292336f4) )
2891ROM_END
25562892
2557/* Program Roms contain
25582893
2894
2895/******************************
2896    Tetris-based HW
2897******************************/
2898
2899/*
2900Program Roms contain
2901
25592902Designed and Programmed by A.M.T. Research & Development Department 03/30/1991.
25602903Copying or Revising for Commercial Use Is Not Permitted.
2561
25622904*/
25632905
25642906ROM_START( beautyb )
r7356r7357
26152957   ROM_LOAD( "iqpipe.u4", 0x0000, 0x0104, CRC(e9cd78fb) SHA1(557d3e7ef3b25c1338b24722cac91bca788c02b8) )
26162958ROM_END
26172959
2618GAME( 1991, beautyb,    0,        beautyb,    tetris,    beautyb, ROT0,  "AMT", "Beauty Block", GAME_NO_SOUND|GAME_NOT_WORKING )
2619GAME( 1991, iqpipe,     0,        beautyb,    tetris,    beautyb, ROT0,  "AMT", "IQ Pipe", GAME_NO_SOUND|GAME_NOT_WORKING )
26202960
2961/******************************
2962    System 18 Bootlegs
2963******************************/
26212964
2622/***************************************************************************/
2623
2624static WRITE16_HANDLER( sys18_refreshenable_w )
2625{
2626   if(ACCESSING_BITS_0_7)
2627   {
2628      sys16_refreshenable = data & 0x02;
2629   }
2630}
2631
2632static WRITE16_HANDLER( sys18_tilebank_w )
2633{
2634   if(ACCESSING_BITS_0_7)
2635   {
2636      sys16_tile_bank0 = (data >> 0) & 0x0F;
2637      sys16_tile_bank1 = (data >> 4) & 0x0F;
2638   }
2639}
2640
2641/***************************************************************************/
2642
2643#if 0
2644static void set_fg_page( int data )
2645{
2646   sys16_fg_page[0] = data>>12;
2647   sys16_fg_page[1] = (data>>8)&0xf;
2648   sys16_fg_page[2] = (data>>4)&0xf;
2649   sys16_fg_page[3] = data&0xf;
2650}
2651
2652static void set_bg_page( int data )
2653{
2654   sys16_bg_page[0] = data>>12;
2655   sys16_bg_page[1] = (data>>8)&0xf;
2656   sys16_bg_page[2] = (data>>4)&0xf;
2657   sys16_bg_page[3] = data&0xf;
2658}
2659
2660static void set_fg2_page( int data )
2661{
2662   sys16_fg2_page[0] = data>>12;
2663   sys16_fg2_page[1] = (data>>8)&0xf;
2664   sys16_fg2_page[2] = (data>>4)&0xf;
2665   sys16_fg2_page[3] = data&0xf;
2666}
2667
2668static void set_bg2_page( int data )
2669{
2670   sys16_bg2_page[0] = data>>12;
2671   sys16_bg2_page[1] = (data>>8)&0xf;
2672   sys16_bg2_page[2] = (data>>4)&0xf;
2673   sys16_bg2_page[3] = data&0xf;
2674}
2675#endif
2676
2677/***************************************************************************/
2678/*
2679    Sound hardware for Shadow Dancer (Datsu bootleg)
2680
2681    Z80 memory map
2682    0000-7FFF : ROM (fixed)
2683    8000-BFFF : ROM (banked)
2684    C000-C007 : ?
2685    C400      : Sound command (r/o)
2686    C800      : MSM5205 sample data output (w/o)
2687    CC00-CC03 : YM3438 #1
2688    D000-D003 : YM3438 #2
2689    D400      : ROM bank control (w/o)
2690    DF00-DFFF : ?
2691    E000-FFFF : Work RAM
2692
2693    The unused memory locations and I/O port access seem to be remnants of the original code that were not patched out:
2694
2695    - Program accesses RF5C68A channel registes at $C000-$C007
2696    - Program clears RF5C68A wave memory at $DF00-$DFFF
2697    - Program writes to port $A0 to access sound ROM banking control latch
2698    - Program reads port $C0 to access sound command
2699
2700    Interrupts
2701
2702    IRQ = Triggered when 68000 writes sound command. Z80 reads from $C400.
2703    NMI = Triggered when second nibble of sample data has been output to the MSM5205.
2704          Program copies sample data from ROM bank to the MSM5205 sample data buffer at $C800.
2705
2706    ROM banking seems correct.
2707    It doesn't look like there's a way to reset the MSM5205, unless that's related to bit 7 of the
2708    ROM bank control register.
2709    MSM5205 clock speed hasn't been confirmed.
2710*/
2711/***************************************************************************/
2712
2713
2714static WRITE8_HANDLER( shdancbl_msm5205_data_w )
2715{
2716   sample_buffer = data;
2717}
2718
2719static void shdancbl_msm5205_callback(running_device *device)
2720{
2721   msm5205_data_w(device, sample_buffer & 0x0F);
2722   sample_buffer >>= 4;
2723   sample_select ^= 1;
2724   if(sample_select == 0)
2725      cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
2726}
2727
2728static const msm5205_interface shdancbl_msm5205_interface =
2729{
2730   shdancbl_msm5205_callback,
2731   MSM5205_S48_4B
2732};
2733
2734static UINT8* shdancbl_soundbank_ptr = NULL;      /* Pointer to currently selected portion of ROM */
2735
2736static WRITE16_HANDLER( sound_command_irq_w )
2737{
2738   if( ACCESSING_BITS_0_7 )
2739   {
2740      soundlatch_w( space, 0, data&0xff );
2741      cputag_set_input_line(space->machine, "soundcpu", 0, HOLD_LINE );
2742   }
2743}
2744
2745static READ8_HANDLER( shdancbl_soundbank_r )
2746{
2747   if(shdancbl_soundbank_ptr) return shdancbl_soundbank_ptr[offset & 0x3FFF];
2748   return 0xFF;
2749}
2750
2751static WRITE8_HANDLER( shdancbl_bankctrl_w )
2752{
2753   UINT8 *mem = memory_region(space->machine, "soundcpu");
2754
2755   switch(data)
2756   {
2757      case 0:
2758         shdancbl_soundbank_ptr = &mem[0x18000]; /* IC45 8000-BFFF */
2759         break;
2760      case 1:
2761         shdancbl_soundbank_ptr = &mem[0x1C000]; /* IC45 C000-FFFF */
2762         break;
2763      case 2:
2764         shdancbl_soundbank_ptr = &mem[0x20000]; /* IC46 0000-3FFF */
2765         break;
2766      case 3:
2767         shdancbl_soundbank_ptr = &mem[0x24000]; /* IC46 4000-7FFF */
2768         break;
2769      default:
2770         shdancbl_soundbank_ptr = NULL;
2771         logerror("Invalid bank setting %02X (%04X)\n", data, cpu_get_pc(space->cpu));
2772         break;
2773   }
2774}
2775
2776static ADDRESS_MAP_START(shdancbl_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
2777   AM_RANGE(0x0000, 0x7fff) AM_ROM
2778   AM_RANGE(0x8000, 0xbfff) AM_READ(shdancbl_soundbank_r)
2779   AM_RANGE(0xc000, 0xc00f) AM_WRITENOP
2780   AM_RANGE(0xc400, 0xc400) AM_READ(soundlatch_r)
2781   AM_RANGE(0xc800, 0xc800) AM_WRITE(shdancbl_msm5205_data_w)
2782   AM_RANGE(0xcc00, 0xcc03) AM_DEVREADWRITE("3438.0", ym3438_r, ym3438_w)
2783   AM_RANGE(0xd000, 0xd003) AM_DEVREADWRITE("3438.1", ym3438_r, ym3438_w)
2784   AM_RANGE(0xd400, 0xd400) AM_WRITE(shdancbl_bankctrl_w)
2785   AM_RANGE(0xdf00, 0xdfff) AM_NOP
2786   AM_RANGE(0xe000, 0xffff) AM_RAM
2787ADDRESS_MAP_END
2788
2789
2790static ADDRESS_MAP_START( shdancbl_sound_io_map, ADDRESS_SPACE_IO, 8 )
2791   ADDRESS_MAP_GLOBAL_MASK(0xff)
2792   AM_RANGE(0xa0, 0xbf) AM_WRITENOP
2793   AM_RANGE(0xc0, 0xdf) AM_READNOP
2794ADDRESS_MAP_END
2795
2796/***************************************************************************/
2797
2798static UINT8 *sys18_SoundMemBank;
2799
2800static READ8_HANDLER( system18_bank_r )
2801{
2802   if(sys18_SoundMemBank)
2803      return sys18_SoundMemBank[offset];
2804   return 0xFF;
2805}
2806
2807static ADDRESS_MAP_START( sound_18_map, ADDRESS_SPACE_PROGRAM, 8 )
2808   AM_RANGE(0x0000, 0x9fff) AM_ROM
2809   AM_RANGE(0xa000, 0xbfff) AM_READ(system18_bank_r)
2810   /**** D/A register ****/
2811   AM_RANGE(0xc000, 0xc008) AM_DEVWRITE("5c68", rf5c68_w)
2812   AM_RANGE(0xd000, 0xdfff) AM_DEVREADWRITE("5c68", rf5c68_mem_r, rf5c68_mem_w)
2813   AM_RANGE(0xe000, 0xffff) AM_RAM   //??
2814ADDRESS_MAP_END
2815
2816
2817static WRITE8_HANDLER( sys18_soundbank_w )
2818{
2819   UINT8 *mem = memory_region(space->machine, "soundcpu");
2820   int rom = (data >> 6) & 3;
2821   int bank = (data & 0x3f);
2822   int mask = sys18_sound_info[rom*2+0];
2823   int offs = sys18_sound_info[rom*2+1];
2824   if(mask) sys18_SoundMemBank = &mem[0x10000 + offs + ((bank & mask) << 13)];
2825   else sys18_SoundMemBank = NULL;
2826}
2827
2828static ADDRESS_MAP_START( sound_18_io_map, ADDRESS_SPACE_IO, 8 )
2829   ADDRESS_MAP_GLOBAL_MASK(0xff)
2830   AM_RANGE(0x80, 0x83) AM_DEVREADWRITE("3438.0", ym3438_r, ym3438_w)
2831   AM_RANGE(0x90, 0x93) AM_DEVREADWRITE("3438.1", ym3438_r, ym3438_w)
2832   AM_RANGE(0xa0, 0xa0) AM_WRITE(sys18_soundbank_w)
2833   AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r)
2834ADDRESS_MAP_END
2835
2836
2837/***************************************************************************/
2838/*
2839    Shadow Dancer (Bootleg)
2840
2841    This seems to be a modified version of shdancer. It has no warning screen, displays English text during the
2842    attract sequence, and has a 2P input test. The 'Sega' copyright text was changed to 'Datsu', and their
2843    logo is missing.
2844
2845    Access to the configuration registers, I/O chip, and VDP are done even though it's likely none of this hardware
2846    exists in the bootleg. For example:
2847
2848    - Most I/O port access has been redirected to new addresses.
2849    - Z80 sound command has been redirected to a new address.
2850    - The tilebank routine which saves the bank value in VDP VRAM has a form of protection has been modified to store
2851      the tilebank value directly to $E4001F.
2852    - Implementing screen blanking control via $E4001D leaves the screen blanked at the wrong times (after coin-up).
2853
2854    This is probably due to unmodified parts of the original code accessing these components, which would be ignored
2855    on the bootleg hardware. Both the I/O chip and VDP are supported in this driver, just as I don't know for certain
2856    how much of either are present on the real board.
2857
2858    Bootleg specific addresses:
2859
2860    C40001 = DIP switch #1
2861    C40003 = DIP switch #2
2862    C40007 = Z80 sound command
2863    C41001 = Service input
2864    C41003 = Player 1 input
2865    C41005 = Player 2 input
2866    C44000 = Has 'clr.w' done after setting tile bank in $E4000F.
2867    C460xx = Extra video hardware controls
2868
2869    Here are the I/O chip addresses accessed:
2870
2871    E40001 = Player 1
2872    E40007 = Miscellaneous outputs (coin control, etc.)
2873    E4000F = Tile bank
2874    E4001D = CNT2-0 pin output state
2875    E4001F = I/O chip port direction
2876*/
2877/***************************************************************************/
2878
2879static ADDRESS_MAP_START( shdancbl_map, ADDRESS_SPACE_PROGRAM, 16 )
2880   AM_RANGE(0x000000, 0x07ffff) AM_ROM
2881   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
2882   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
2883   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
2884   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( segaic16_paletteram_w ) AM_BASE(&segaic16_paletteram)
2885   AM_RANGE(0xc00000, 0xc0ffff) AM_NOP
2886   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("COINAGE")
2887   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
2888   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_irq_w)
2889   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
2890   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
2891   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
2892   AM_RANGE(0xc44000, 0xc44001) AM_WRITENOP // only used via clr.w after tilebank set
2893
2894
2895   AM_RANGE(0xe4001c, 0xe4001d) AM_WRITENOP // to prevent access to screen blanking control below
2896   AM_RANGE(0xe40000, 0xe4ffff) AM_NOP
2897   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP // config regs
2898   AM_RANGE(0xffc000, 0xffffff) AM_RAM
2899ADDRESS_MAP_END
2900
2901/***************************************************************************/
2902
2903
2904static DRIVER_INIT( shdancbl )
2905{
2906   UINT8 *mem;
2907
2908   MACHINE_RESET_CALL(sys16_onetime);
2909
2910   sys18_splittab_fg_x=&sys16_textram[0x0f80/2];
2911   sys18_splittab_bg_x=&sys16_textram[0x0fc0/2];
2912   sys16_MaxShadowColors=0;
2913
2914   /* Copy first 32K of IC45 to Z80 address space */
2915   mem = memory_region(machine, "soundcpu");
2916   memcpy(mem, mem+0x10000, 0x8000);
2917}
2918
2919/***************************************************************************/
2920/*
2921    Moonwalker (Bootleg)
2922*/
2923/***************************************************************************/
2924
2925static ADDRESS_MAP_START( mwalkbl_map, ADDRESS_SPACE_PROGRAM, 16 )
2926   AM_RANGE(0x000000, 0x07ffff) AM_ROM
2927   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
2928   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
2929   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
2930   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( segaic16_paletteram_w ) AM_BASE(&segaic16_paletteram)
2931
2932   /* bootleg video regs */
2933   /*AM_RANGE(0xc00000, 0xc00001) AM_NOP
2934    AM_RANGE(0xc00002, 0xc00003) AM_NOP
2935    AM_RANGE(0xc00004, 0xc00005) AM_NOP // tile bank?
2936    AM_RANGE(0xc00006, 0xc00007) AM_NOP
2937    AM_RANGE(0xc44000, 0xc44001) AM_NOP
2938    AM_RANGE(0xc46000, 0xc46001) AM_NOP
2939    AM_RANGE(0xc46200, 0xc46201) AM_NOP
2940    AM_RANGE(0xc46400, 0xc464ff) AM_NOP // scroll?
2941    AM_RANGE(0xc46500, 0xc465ff) AM_NOP // scroll?
2942    */
2943
2944   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("COINAGE")
2945   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
2946   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_nmi_w)
2947   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
2948   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
2949   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
2950   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P3")
2951   AM_RANGE(0xc41008, 0xc41009) AM_READNOP // figure this out, extra input for 3p?
2952   AM_RANGE(0xc46600, 0xc46601) AM_WRITE(sys18_refreshenable_w)
2953   AM_RANGE(0xc46800, 0xc46801) AM_WRITE(sys18_tilebank_w)
2954
2955   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP // config regs
2956   AM_RANGE(0xffc000, 0xffffff) AM_RAM
2957ADDRESS_MAP_END
2958
2959/***************************************************************************/
2960
2961static DRIVER_INIT( mwalkbl )
2962{
2963   UINT8 *RAM= memory_region(machine, "soundcpu");
2964   static const int mwalk_sound_info[] =
2965   {
2966      0x0f, 0x00000, // ROM #1 = 128K
2967      0x1f, 0x20000, // ROM #2 = 256K
2968      0x1f, 0x60000, // ROM #3 = 256K
2969      0x1f, 0xA0000  // ROM #4 = 256K
2970   };
2971
2972   MACHINE_RESET_CALL(sys16_onetime);
2973   sys18_splittab_fg_x=&sys16_textram[0x0f80/2];
2974   sys18_splittab_bg_x=&sys16_textram[0x0fc0/2];
2975
2976   memcpy(sys18_sound_info, mwalk_sound_info, sizeof(sys18_sound_info));
2977   memcpy(RAM,&RAM[0x10000],0xa000);
2978}
2979
2980/***************************************************************************/
2981
2982/* bootleg doesn't have real vdp or i/o */
2983
2984static ADDRESS_MAP_START( astormbl_map, ADDRESS_SPACE_PROGRAM, 16 )
2985   AM_RANGE(0x000000, 0x07ffff) AM_ROM
2986   AM_RANGE(0x100000, 0x10ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
2987   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
2988   AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE( segaic16_paletteram_w ) AM_BASE(&segaic16_paletteram)
2989   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE(&segaic16_spriteram_0)
2990   AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("COINAGE")
2991   AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("DSW1")
2992   AM_RANGE(0xa00006, 0xa00007) AM_WRITE(sound_command_nmi_w)
2993   AM_RANGE(0xa0000e, 0xa0000f) AM_WRITE(sys18_tilebank_w)
2994   AM_RANGE(0xa01000, 0xa01001) AM_READ_PORT("SERVICE")
2995   AM_RANGE(0xa01002, 0xa01003) AM_READ_PORT("P1")
2996   AM_RANGE(0xa01004, 0xa01005) AM_READ_PORT("P2")
2997   AM_RANGE(0xa01006, 0xa01007) AM_READ_PORT("P3")
2998   AM_RANGE(0xa02100, 0xa02101) AM_NOP
2999   AM_RANGE(0xa03000, 0xa03001) AM_NOP
3000   AM_RANGE(0xa03034, 0xa03035) AM_NOP
3001
3002   /* bootleg video regs */
3003   AM_RANGE(0xc00000, 0xc00001) AM_NOP
3004   AM_RANGE(0xc00002, 0xc00003) AM_NOP
3005   AM_RANGE(0xc00004, 0xc00005) AM_NOP // tile bank?
3006   AM_RANGE(0xc00006, 0xc00007) AM_NOP
3007   AM_RANGE(0xc44000, 0xc44001) AM_NOP
3008   AM_RANGE(0xc46000, 0xc46001) AM_NOP
3009   AM_RANGE(0xc46200, 0xc46201) AM_NOP
3010   AM_RANGE(0xc46400, 0xc464ff) AM_NOP // scroll?
3011   AM_RANGE(0xc46500, 0xc465ff) AM_NOP // scroll?
3012
3013   AM_RANGE(0xc46600, 0xc46601) AM_WRITE(sys18_refreshenable_w)
3014   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP
3015   AM_RANGE(0xffc000, 0xffffff) AM_RAM
3016ADDRESS_MAP_END
3017
3018
3019/***************************************************************************/
3020
3021
3022static DRIVER_INIT( astormbl )
3023{
3024   UINT8 *RAM= memory_region(machine, "soundcpu");
3025   static const int astormbl_sound_info[] =
3026   {
3027      0x0f, 0x00000, // ROM #1 = 128K
3028      0x1f, 0x20000, // ROM #2 = 256K
3029      0x1f, 0x60000, // ROM #3 = 256K
3030      0x1f, 0xA0000  // ROM #4 = 256K
3031   };
3032
3033   MACHINE_RESET_CALL(sys16_onetime);
3034   sys18_splittab_fg_x=&sys16_textram[0x0f80/2];
3035   sys18_splittab_bg_x=&sys16_textram[0x0fc0/2];
3036   sys16_MaxShadowColors = 0; // doesn't seem to use transparent shadows
3037
3038   memcpy(sys18_sound_info, astormbl_sound_info, sizeof(sys18_sound_info));
3039   memcpy(RAM,&RAM[0x10000],0xa000);
3040}
3041
3042
3043/*****************************************************************************/
3044
3045static MACHINE_DRIVER_START( system18 )
3046
3047   /* basic machine hardware */
3048   MDRV_CPU_ADD("maincpu", M68000, 10000000)
3049   MDRV_CPU_VBLANK_INT("screen", irq4_line_hold)
3050
3051   MDRV_CPU_ADD("soundcpu", Z80, 8000000)
3052   MDRV_CPU_PROGRAM_MAP(sound_18_map)
3053   MDRV_CPU_IO_MAP(sound_18_io_map)
3054
3055   /* video hardware */
3056   MDRV_SCREEN_ADD("screen", RASTER)
3057   MDRV_SCREEN_REFRESH_RATE(60)
3058   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
3059   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
3060   MDRV_SCREEN_SIZE(40*8, 28*8)
3061   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
3062
3063   MDRV_GFXDECODE(sys16)
3064   MDRV_PALETTE_LENGTH((2048+2048)*ShadowColorsMultiplier) // 64 extra colours for vdp (but we use 2048 so shadow mask works)
3065
3066   MDRV_VIDEO_START(system18old)
3067   MDRV_VIDEO_UPDATE(system18old)
3068
3069   /* sound hardware */
3070   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
3071
3072   MDRV_SOUND_ADD("3438.0", YM3438, 8000000)
3073   MDRV_SOUND_ROUTE(0, "lspeaker", 0.40)
3074   MDRV_SOUND_ROUTE(1, "rspeaker", 0.40)
3075   MDRV_SOUND_ROUTE(2, "lspeaker", 0.40)
3076   MDRV_SOUND_ROUTE(3, "rspeaker", 0.40)
3077
3078   MDRV_SOUND_ADD("3438.1", YM3438, 8000000)
3079   MDRV_SOUND_ROUTE(0, "lspeaker", 0.40)
3080   MDRV_SOUND_ROUTE(1, "rspeaker", 0.40)
3081   MDRV_SOUND_ROUTE(2, "lspeaker", 0.40)
3082   MDRV_SOUND_ROUTE(3, "rspeaker", 0.40)
3083
3084   MDRV_SOUND_ADD("5c68", RF5C68, 8000000)
3085   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
3086   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
3087MACHINE_DRIVER_END
3088
3089
3090static MACHINE_DRIVER_START( astormbl )
3091
3092   /* basic machine hardware */
3093   MDRV_IMPORT_FROM(system18)
3094   MDRV_CPU_MODIFY("maincpu")
3095   MDRV_CPU_PROGRAM_MAP(astormbl_map)
3096MACHINE_DRIVER_END
3097
3098
3099static MACHINE_DRIVER_START( mwalkbl )
3100
3101   /* basic machine hardware */
3102   MDRV_IMPORT_FROM(system18)
3103   MDRV_CPU_MODIFY("maincpu")
3104   MDRV_CPU_PROGRAM_MAP(mwalkbl_map)
3105MACHINE_DRIVER_END
3106
3107
3108static MACHINE_DRIVER_START( shdancbl )
3109
3110   /* basic machine hardware */
3111   MDRV_IMPORT_FROM(system18)
3112   MDRV_CPU_MODIFY("maincpu")
3113   MDRV_CPU_PROGRAM_MAP(shdancbl_map)
3114
3115   MDRV_CPU_MODIFY("soundcpu")
3116   MDRV_CPU_PROGRAM_MAP(shdancbl_sound_map)
3117   MDRV_CPU_IO_MAP(shdancbl_sound_io_map)
3118   MDRV_DEVICE_REMOVE("5c68")
3119
3120   MDRV_SOUND_ADD("5205", MSM5205, 200000)
3121   MDRV_SOUND_CONFIG(shdancbl_msm5205_interface)
3122   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80)
3123   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
3124MACHINE_DRIVER_END
3125
3126
3127/***************************************************************************/
3128
3129static INPUT_PORTS_START( astormbl )
3130   PORT_START("P1")   /* player 1 */
3131   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
3132   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
3133   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )
3134   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3135   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
3136   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
3137   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
3138   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
3139
3140   PORT_START("P2")   /* player 2 */
3141   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3142   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
3143   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
3144   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3145   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
3146   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
3147   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
3148   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
3149
3150   PORT_START("SERVICE")
3151   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
3152   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
3153   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
3154   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
3155   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
3156   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
3157   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 )
3158   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
3159
3160   PORT_START("COINAGE")
3161   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
3162   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
3163   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
3164   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
3165   PORT_DIPSETTING(    0x05, "2 Coins/1 Credit 5/3 6/4" )
3166   PORT_DIPSETTING(    0x04, "2 Coins/1 Credit 4/3" )
3167   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
3168   PORT_DIPSETTING(    0x01, "1 Coin/1 Credit 2/3" )
3169   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 4/5" )
3170   PORT_DIPSETTING(    0x03, "1 Coin/1 Credit 5/6" )
3171   PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
3172   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
3173   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
3174   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
3175   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
3176   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
3177   PORT_DIPSETTING(    0x00, "Free Play (if Coin B too) or 1/1" )
3178   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
3179   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
3180   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
3181   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
3182   PORT_DIPSETTING(    0x50, "2 Coins/1 Credit 5/3 6/4" )
3183   PORT_DIPSETTING(    0x40, "2 Coins/1 Credit 4/3" )
3184   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
3185   PORT_DIPSETTING(    0x10, "1 Coin/1 Credit 2/3" )
3186   PORT_DIPSETTING(    0x20, "1 Coin/1 Credit 4/5" )
3187   PORT_DIPSETTING(    0x30, "1 Coin/1 Credit 5/6" )
3188   PORT_DIPSETTING(    0x60, DEF_STR( 2C_3C ) )
3189   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
3190   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
3191   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
3192   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
3193   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
3194   PORT_DIPSETTING(    0x00, "Free Play (if Coin A too) or 1/1" )
3195
3196   PORT_START("DSW1")   /* DSW1 */
3197   PORT_DIPNAME( 0x01, 0x01, "2 Credits to Start" )
3198   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
3199   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3200   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
3201   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3202   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3203   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Difficulty ) )
3204   PORT_DIPSETTING(    0x04, DEF_STR( Easiest ) )
3205   PORT_DIPSETTING(    0x08, DEF_STR( Easier ) )
3206   PORT_DIPSETTING(    0x0c, DEF_STR( Easy ) )
3207   PORT_DIPSETTING(    0x1c, DEF_STR( Normal ) )
3208   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
3209   PORT_DIPSETTING(    0x14, DEF_STR( Harder ) )
3210   PORT_DIPSETTING(    0x18, DEF_STR( Hardest ) )
3211   PORT_DIPSETTING(    0x00, "Special" )
3212   PORT_DIPNAME( 0x20, 0x20, "Coin Chutes" )
3213   PORT_DIPSETTING(    0x20, "3" )
3214   PORT_DIPSETTING(    0x00, "1" )
3215   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
3216   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3217   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3218   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
3219   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3220   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3221
3222   PORT_START("P3")   /* player 3 */
3223   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
3224   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
3225   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
3226   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3227   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
3228   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
3229   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
3230   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
3231INPUT_PORTS_END
3232
3233static INPUT_PORTS_START( mwalkbl )
3234   PORT_INCLUDE( astormbl )
3235
3236   PORT_MODIFY("SERVICE")   /* service */
3237   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
3238   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3239   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3240
3241   PORT_MODIFY("DSW1")   /* DSW1 */
3242   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
3243   PORT_DIPSETTING(    0x04, "2" )
3244   PORT_DIPSETTING(    0x00, "3" )
3245   PORT_DIPNAME( 0x08, 0x08, "Player Vitality" )
3246   PORT_DIPSETTING(    0x08, DEF_STR( Low ) )
3247   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
3248   PORT_DIPNAME( 0x10, 0x00, "Play Mode" )
3249   PORT_DIPSETTING(    0x10, "2 Players" )
3250   PORT_DIPSETTING(    0x00, "3 Players" )
3251   PORT_DIPNAME( 0x20, 0x20, "Coin Mode" )
3252   PORT_DIPSETTING(    0x20, "Common" )
3253   PORT_DIPSETTING(    0x00, "Individual" )
3254   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
3255   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
3256   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
3257   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
3258   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
3259
3260   PORT_MODIFY("P3")   /* player 3 */
3261   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START3 )
3262INPUT_PORTS_END
3263
3264/*****************************************************************************/
3265
32662965ROM_START( astormbl )
32672966   ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
32682967   ROM_LOAD16_BYTE( "astorm.a6", 0x000000, 0x40000, CRC(7682ed3e) SHA1(b857352ad9c66488e91f60989472638c483e4ae8) )
r7356r7357
34863185ROM_END
34873186
34883187
3489/*****************************************************************************/
3188/*************************************
3189 *
3190 *  Driver initialization
3191 *
3192 *************************************/
34903193
3491GAME( 1990, astormbl, astorm,   astormbl, astormbl, astormbl, ROT0, "bootleg", "Alien Storm (bootleg, set 1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
3492GAME( 1990, astormb2, astorm,   astormbl, astormbl, astormbl, ROT0, "bootleg", "Alien Storm (bootleg, set 2)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
3194static DRIVER_INIT( common )
3195{
3196   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
34933197
3494GAME( 1990, mwalkbl,  mwalk,    mwalkbl,  mwalkbl,  mwalkbl,  ROT0, "bootleg", "Michael Jackson's Moonwalker (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
3198   state->bg1_trans = 0;
3199   state->splittab_bg_x = 0;
3200   state->splittab_bg_y = 0;
3201   state->splittab_fg_x = 0;
3202   state->splittab_fg_y = 0;
34953203
3496GAME( 1989, shdancbl, shdancer, shdancbl, mwalkbl,  shdancbl, ROT0, "bootleg", "Shadow Dancer (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
3204   state->spritebank_type = 0;
3205   state->back_yscroll = 0;
3206   state->fore_yscroll = 0;
3207   state->text_yscroll = 0;
3208   state->sprite_xoffs = 107;
34973209
3210   state->sample_buffer = 0;
3211   state->sample_select = 0;
3212
3213   state->soundbank_ptr = NULL;
3214
3215   state->beautyb_unkx = 0;
3216
3217   state->maincpu = devtag_get_device(machine, "maincpu");
3218   state->soundcpu = devtag_get_device(machine, "soundcpu");
3219}
3220
3221/* Sys16A */
3222static DRIVER_INIT( shinobl )
3223{
3224   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
3225
3226   DRIVER_INIT_CALL(common);
3227
3228   state->spritebank_type = 1;
3229   state->sprite_xoffs = 117;
3230}
3231
3232static DRIVER_INIT( passsht )
3233{
3234   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
3235
3236   DRIVER_INIT_CALL(common);
3237
3238   state->spritebank_type = 1;
3239   state->back_yscroll = 3;
3240   state->sprite_xoffs = 117;
3241}
3242
3243static DRIVER_INIT( wb3bbl )
3244{
3245   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
3246
3247   DRIVER_INIT_CALL(common);
3248
3249   state->spritebank_type = 1;
3250   state->back_yscroll = 2;
3251   state->fore_yscroll = 2;
3252   state->sprite_xoffs = 117;
3253}
3254
3255
3256/* Sys16B */
3257static DRIVER_INIT( goldnaxeb1 )
3258{
3259   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
3260   int i;
3261   UINT8 *ROM = memory_region(machine, "maincpu");
3262   UINT8 *KEY = memory_region(machine, "decryption");
3263   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
3264   UINT8 data[0x1000];
3265
3266   // the decryption key is in a rom (part of an MSDOS executable...)
3267   for (i = 0; i < 0x800; i++)
3268   {
3269      KEY[i] = KEY[i] ^ 0xff;
3270      data[(i * 2) + 0] = ((KEY[i] & 0x80) >> 1) | ((KEY[i] & 0x40) >> 2) | ((KEY[i] & 0x20) >> 3) | ((KEY[i] & 0x10) >> 4);
3271      data[(i * 2) + 1] = ((KEY[i] & 0x08) << 3) | ((KEY[i] & 0x04) << 2) | ((KEY[i] & 0x02) << 1) | ((KEY[i] & 0x01) << 0);
3272   }
3273
3274   state->decrypted_region = auto_alloc_array(machine, UINT8, 0xc0000);
3275   memcpy(state->decrypted_region, ROM, 0xc0000);
3276
3277   for (i = 0; i < 0x40000; i++)
3278   {
3279      state->decrypted_region[i] = ROM[i] ^ data[(i & 0xfff) ^ 1];
3280   }
3281
3282   memory_set_decrypted_region(space, 0x00000, 0xbffff, state->decrypted_region);
3283
3284   DRIVER_INIT_CALL(common);
3285
3286   state->spritebank_type = 1;
3287   state->sprite_xoffs = 121;
3288}
3289
3290
3291static DRIVER_INIT( bayrouteb1 )
3292{
3293   // it has the same encryption as the golden axe bootleg!
3294   //
3295   // but also some protection, probably code provided in RAM by an MCU
3296   //
3297   // for now we use the code which is present in the unprotected bootleg set
3298   // and modify the rom to use it
3299   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
3300   UINT16 *ROM2;
3301   UINT16 *decrypted_region2;
3302
3303   // decrypt
3304   DRIVER_INIT_CALL( goldnaxeb1 );
3305
3306   ROM2 = (UINT16*)memory_region(machine, "maincpu");
3307   decrypted_region2 = (UINT16*)state->decrypted_region;
3308
3309   // patch interrupt vector
3310   ROM2[0x0070/2] = 0x000b;
3311   ROM2[0x0072/2] = 0xf000;
3312
3313   // patch check for code in RAM
3314   decrypted_region2[0x107e/2] = 0x48e7;
3315   decrypted_region2[0x1080/2] = 0x000b;
3316   decrypted_region2[0x1082/2] = 0xf000;
3317}
3318
3319static DRIVER_INIT( bayrouteb2 )
3320{
3321   UINT8 *mem = memory_region(machine, "soundcpu");
3322
3323   memcpy(mem, mem + 0x10000, 0x8000);
3324
3325   DRIVER_INIT_CALL(common);
3326}
3327
3328static DRIVER_INIT( goldnaxeb2 )
3329{
3330   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
3331
3332   DRIVER_INIT_CALL(common);
3333
3334   state->spritebank_type = 1;
3335   state->sprite_xoffs = 121;
3336}
3337
3338static DRIVER_INIT( tturfbl )
3339{
3340   UINT8 *mem = memory_region(machine, "soundcpu");
3341
3342   memcpy(mem, mem + 0x10000, 0x8000);
3343
3344   DRIVER_INIT_CALL(common);
3345}
3346
3347static DRIVER_INIT( dduxbl )
3348{
3349   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
3350
3351   DRIVER_INIT_CALL(common);
3352
3353   state->sprite_xoffs = 112;
3354}
3355
3356static DRIVER_INIT( eswatbl )
3357{
3358   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
3359
3360   DRIVER_INIT_CALL(common);
3361   //state->splittab_fg_x = &sys16_textram[0x0f80];
3362
3363   state->spritebank_type = 1;
3364   state->sprite_xoffs = 124;
3365}
3366
3367static DRIVER_INIT( fpointbl )
3368{
3369   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
3370
3371   DRIVER_INIT_CALL(common);
3372   //sys16_video_config(fpoint_update_proc, -0xb8, NULL);
3373
3374   state->back_yscroll = 2;
3375   state->fore_yscroll = 2;
3376}
3377
3378/* Tetris-based */
3379static DRIVER_INIT( beautyb )
3380{
3381   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
3382   UINT16*rom = (UINT16*)memory_region( machine, "maincpu" );
3383   int x;
3384
3385   for (x = 0; x < 0x8000; x++)
3386   {
3387      rom[x] = rom[x] ^ 0x2400;
3388
3389      if (x & 8) rom[x] = BITSWAP16(rom[x],15,14,10,12,  11,13,9,8,
3390                                  7,6,5,4,   3,2,1,0 );
3391   }
3392
3393   DRIVER_INIT_CALL(common);
3394
3395   state->sprite_xoffs = 112;
3396}
3397
3398
3399/* Sys18 */
3400static DRIVER_INIT( shdancbl )
3401{
3402   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
3403   UINT8 *mem = memory_region(machine, "soundcpu");;
3404
3405   /* Copy first 32K of IC45 to Z80 address space */
3406   memcpy(mem, mem + 0x10000, 0x8000);
3407
3408   DRIVER_INIT_CALL(common);
3409
3410   state->spritebank_type = 1;
3411   state->splittab_fg_x = &state->textram[0x0f80/2];
3412   state->splittab_bg_x = &state->textram[0x0fc0/2];
3413}
3414
3415static DRIVER_INIT( mwalkbl )
3416{
3417   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
3418   UINT8 *RAM =  memory_region(machine, "soundcpu");
3419   static const int mwalk_sound_info[]  =
3420   {
3421      0x0f, 0x00000, // ROM #1 = 128K
3422      0x1f, 0x20000, // ROM #2 = 256K
3423      0x1f, 0x60000, // ROM #3 = 256K
3424      0x1f, 0xA0000  // ROM #4 = 256K
3425   };
3426
3427   memcpy(state->sound_info, mwalk_sound_info, sizeof(state->sound_info));
3428   memcpy(RAM, &RAM[0x10000], 0xa000);
3429
3430   DRIVER_INIT_CALL(common);
3431
3432   state->spritebank_type = 1;
3433   state->splittab_fg_x = &state->textram[0x0f80/2];
3434   state->splittab_bg_x = &state->textram[0x0fc0/2];
3435}
3436
3437static DRIVER_INIT( astormbl )
3438{
3439   segas1x_bootleg_state *state = (segas1x_bootleg_state *)machine->driver_data;
3440   UINT8 *RAM =  memory_region(machine, "soundcpu");
3441   static const int astormbl_sound_info[]  =
3442   {
3443      0x0f, 0x00000, // ROM #1 = 128K
3444      0x1f, 0x20000, // ROM #2 = 256K
3445      0x1f, 0x60000, // ROM #3 = 256K
3446      0x1f, 0xA0000  // ROM #4 = 256K
3447   };
3448
3449   memcpy(state->sound_info, astormbl_sound_info, sizeof(state->sound_info));
3450   memcpy(RAM, &RAM[0x10000], 0xa000);
3451
3452   DRIVER_INIT_CALL(common);
3453
3454   state->spritebank_type = 1;
3455   state->splittab_fg_x = &state->textram[0x0f80/2];
3456   state->splittab_bg_x = &state->textram[0x0fc0/2];
3457}
3458
3459/*************************************
3460 *
3461 *  Game driver(s)
3462 *
3463 *************************************/
3464
3465/* System 16A based bootlegs (less complex tilemap system) */
3466GAME( 1987, shinobld,    shinobi,   shinobib,    shinobi,   shinobl,    ROT0,   "[Sega] (Datsu bootleg)", "Shinobi (Datsu bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
3467GAME( 1988, passshtb,    passsht,   passshtb,    passsht,   passsht,    ROT270, "bootleg", "Passing Shot (2 Players) (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
3468GAME( 1988, passht4b,    passsht,   passsht4b,   passht4b,  shinobl,    ROT270, "bootleg", "Passing Shot (4 Players) (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
3469GAME( 1988, wb3bbl,      wb3,       wb3bb,       wb3b,      wb3bbl,     ROT0,   "bootleg", "Wonder Boy III - Monster Lair (bootleg)", GAME_NOT_WORKING )
3470
3471/* System 16B based bootlegs */
3472GAME( 1989, bayrouteb1,  bayroute,  bayrouteb1,  bayroute,  bayrouteb1, ROT0,   "bootleg", "Bay Route (encrypted, protected bootleg)", GAME_NO_SOUND | GAME_NOT_WORKING ) // broken sprites (due to missing/wrong irq code?)
3473GAME( 1989, bayrouteb2,  bayroute,  bayrouteb2,  bayroute,  bayrouteb2, ROT0,   "bootleg", "Bay Route (Datsu bootleg)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
3474GAME( 1989, goldnaxeb1,  goldnaxe,  goldnaxeb1,  goldnaxe,  goldnaxeb1, ROT0,   "bootleg", "Golden Axe (encrypted bootleg)", GAME_NOT_WORKING|GAME_NO_SOUND )
3475GAME( 1989, goldnaxeb2,  goldnaxe,  goldnaxeb2,  goldnaxe,  goldnaxeb2, ROT0,   "bootleg", "Golden Axe (bootleg)", GAME_NOT_WORKING|GAME_NO_SOUND )
3476GAME( 1989, tturfbl,     tturf,     tturfbl,     tturf,     tturfbl,    ROT0,   "bootleg", "Tough Turf (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
3477GAME( 1989, dduxbl,      ddux,      dduxbl,      ddux,      dduxbl,     ROT0,   "bootleg", "Dynamite Dux (bootleg)", GAME_NOT_WORKING )
3478GAME( 1989, eswatbl,     eswat,     eswatbl,     eswat,     eswatbl,    ROT0,   "bootleg", "E-Swat - Cyber Police (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND )
3479GAME( 1989, fpointbl,    fpoint,    fpointbl,    fpointbl,  fpointbl,   ROT0,   "bootleg", "Flash Point (World, bootleg)", GAME_NOT_WORKING )
3480GAME( 1989, fpointbj,    fpoint,    fpointbl,    fpointbl,  fpointbl,   ROT0,   "bootleg", "Flash Point (Japan, bootleg)", GAME_NOT_WORKING )
3481GAME( 1988, tetrisbl,    tetris,    tetrisbl,    tetris,    dduxbl,     ROT0,   "bootleg", "Tetris (bootleg)", 0 )
3482
3483/* Tetris-based hardware */
3484GAME( 1991, beautyb,     0,         beautyb,     tetris,    beautyb,    ROT0,   "AMT", "Beauty Block", GAME_NO_SOUND | GAME_NOT_WORKING )
3485GAME( 1991, iqpipe,      0,         beautyb,     tetris,    beautyb,    ROT0,   "AMT", "IQ Pipe", GAME_NO_SOUND | GAME_NOT_WORKING )
3486
3487/* System 18 bootlegs */
3488GAME( 1990, astormbl,    astorm,    astormbl,    astormbl,  astormbl,   ROT0,   "bootleg", "Alien Storm (bootleg, set 1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
3489GAME( 1990, astormb2,    astorm,    astormbl,    astormbl,  astormbl,   ROT0,   "bootleg", "Alien Storm (bootleg, set 2)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
3490GAME( 1990, mwalkbl,     mwalk,     mwalkbl,     mwalkbl,   mwalkbl,    ROT0,   "bootleg", "Michael Jackson's Moonwalker (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
3491GAME( 1989, shdancbl,    shdancer,  shdancbl,    mwalkbl,   shdancbl,   ROT0,   "bootleg", "Shadow Dancer (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
src/mame/drivers/actfancr.c
r7356r7357
625625   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f0026, 0x1f0027, 0, 0, cycle_r);
626626}
627627
628static DRIVER_INIT( actfancj )
628static DRIVER_INIT( actfancrj )
629629{
630630   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f0026, 0x1f0027, 0, 0, cyclej_r);
631631}
r7356r7357
633633
634634GAME( 1989, actfancr, 0,        actfancr, actfancr, actfancr, ROT0, "Data East Corporation", "Act-Fancer Cybernetick Hyper Weapon (World revision 2)", GAME_SUPPORTS_SAVE )
635635GAME( 1989, actfancr1,actfancr, actfancr, actfancr, actfancr, ROT0, "Data East Corporation", "Act-Fancer Cybernetick Hyper Weapon (World revision 1)", GAME_SUPPORTS_SAVE )
636GAME( 1989, actfancrj,actfancr, actfancr, actfancr, actfancj, ROT0, "Data East Corporation", "Act-Fancer Cybernetick Hyper Weapon (Japan revision 1)", GAME_SUPPORTS_SAVE )
636GAME( 1989, actfancrj,actfancr, actfancr, actfancr, actfancrj,ROT0, "Data East Corporation", "Act-Fancer Cybernetick Hyper Weapon (Japan revision 1)", GAME_SUPPORTS_SAVE )
637637GAME( 1989, triothep, 0,        triothep, triothep, 0,        ROT0, "Data East Corporation", "Trio The Punch - Never Forget Me... (World)", GAME_SUPPORTS_SAVE )
638638GAME( 1989, triothepj,triothep, triothep, triothep, 0,        ROT0, "Data East Corporation", "Trio The Punch - Never Forget Me... (Japan)", GAME_SUPPORTS_SAVE )
src/mame/drivers/cps1.c
r7356r7357
25522552   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
25532553
25542554   PORT_START("DSWC")
2555   PORT_DIPNAME( 0x08, 0x08, "Freeze" )
2556   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2557   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2555   PORT_DIPUNUSED( 0x01, 0x01 )
2556   PORT_DIPUNUSED( 0x02, 0x02 )
2557   PORT_DIPUNUSED( 0x04, 0x04 )
2558   PORT_DIPUNUSED( 0x08, 0x08 )
2559   PORT_DIPUNUSED( 0x10, 0x10 )
2560   PORT_DIPUNUSED( 0x20, 0x20 )
2561   PORT_DIPUNUSED( 0x40, 0x40 )
2562   PORT_DIPUNUSED( 0x80, 0x80 ) /* doubles up as an extra service switch */
25582563
25592564   PORT_START( "EEPROMIN" )
25602565   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit)
r7356r7357
25662571INPUT_PORTS_END
25672572
25682573/* Needs further checking */
2574static INPUT_PORTS_START( pang3n )
2575   PORT_INCLUDE( pang3 )
2576
2577   PORT_MODIFY("DSWC")
2578   PORT_DIPUNUSED( 0x01, 0x01 )
2579   PORT_DIPUNUSED( 0x02, 0x02 )
2580   PORT_DIPUNUSED( 0x04, 0x04 )
2581   PORT_DIPNAME( 0x08, 0x08, "Freeze" )
2582   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2583   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2584   PORT_DIPUNUSED( 0x10, 0x10 )
2585   PORT_DIPUNUSED( 0x20, 0x20 )
2586   PORT_DIPUNUSED( 0x40, 0x40 )
2587   PORT_DIPUNUSED( 0x80, 0x80 )
2588INPUT_PORTS_END
2589
2590/* Needs further checking */
25692591static INPUT_PORTS_START( megaman )
25702592   PORT_INCLUDE( cps1_3b )
25712593
r7356r7357
85008522   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
85018523ROM_END
85028524
8503/* B-Board 94916-10 */
8525
85048526ROM_START( pang3 )
85058527   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
8528   ROM_LOAD16_WORD_SWAP( "pa3e-17a.11l", 0x00000, 0x80000, CRC(a213fa80) SHA1(fee6b0b21e2ef573ebfb35eaa1785533101c9170) )
8529   ROM_LOAD16_WORD_SWAP( "pa3e-16a.10l", 0x80000, 0x80000, CRC(7169ea67) SHA1(1076afaff7b05c9009798a0cea13e71fa27f2b7e) )
8530
8531   ROM_REGION( 0x400000, "gfx", 0 )
8532   ROMX_LOAD( "pa3-01m.2c", 0x000000, 0x100000, CRC(068a152c) SHA1(fa491874068924c39bcc7de93dfda3b27f5d9613) , ROM_GROUPWORD | ROM_SKIP(6) )
8533   ROM_CONTINUE(            0x000004, 0x100000 )
8534   ROMX_LOAD( "pa3-07m.2f", 0x000002, 0x100000, CRC(3a4a619d) SHA1(cfe68e24632b53fb6cd6d03b2166d6b5ba28b778) , ROM_GROUPWORD | ROM_SKIP(6) )
8535   ROM_CONTINUE(            0x000006, 0x100000 )
8536
8537   ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
8538   ROM_LOAD( "pa3-11.11f",  0x00000, 0x08000, CRC(90a08c46) SHA1(7544adab2d7e052e0d21c920bff7841d9d718345) )
8539
8540   ROM_REGION( 0x40000, "oki", 0 )   /* Samples */
8541   ROM_LOAD( "pa3-05.10d",  0x00000, 0x20000, CRC(73a10d5d) SHA1(999465e4fbc35a34746d2db61ad49f61403d5af7) )
8542   ROM_LOAD( "pa3-06.11d",  0x20000, 0x20000, CRC(affa4f82) SHA1(27b9292bbc121cf585f53297a79fe8f0d0a729ae) )
8543
8544   ROM_REGION( 0x0200, "aboardplds", 0 )
8545   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
8546   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
8547   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
8548   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
8549   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
8550ROM_END
8551
8552
8553/* B-Board 94916-10 */
8554ROM_START( pang3n ) /* this set isn't encrypted, is it actually an original? */
8555   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
85068556   ROM_LOAD16_WORD_SWAP( "pa3w-17.11l", 0x00000, 0x80000, CRC(12138234) SHA1(956a2c847a3cfb94007d1a636167fd2bb9f826ec) )
85078557   ROM_LOAD16_WORD_SWAP( "pa3w-16.10l", 0x80000, 0x80000, CRC(d1ba585c) SHA1(c6d04441fe97abf0a72b23c917777a7b58e94a85) )
85088558
r7356r7357
87188768   DRIVER_INIT_CALL(cps1);
87198769}
87208770
8721static DRIVER_INIT( pang3 )
8771static DRIVER_INIT( pang3n )
87228772{
87238773   /* Pang 3 is the only non-QSound game to have an EEPROM. */
87248774   /* It is mapped in the CPS-B address range so probably is on the C-board. */
r7356r7357
87278777   DRIVER_INIT_CALL(cps1);
87288778}
87298779
8730static DRIVER_INIT( pang3j )
8780static DRIVER_INIT( pang3 )
87318781{
87328782   UINT16 *rom = (UINT16 *)memory_region(machine, "maincpu");
87338783   int A, src, dst;
r7356r7357
87488798      rom[A/2] = dst;
87498799   }
87508800
8751   DRIVER_INIT_CALL(pang3);
8801   DRIVER_INIT_CALL(pang3n);
87528802}
87538803#endif
87548804
r7356r7357
89188968GAME( 1993, mbombrdj, mbombrd,  qsound,     slammast, slammast, ROT0,   "Capcom", "Muscle Bomber Duo - Heat Up Warriors (Japan 931206)", GAME_SUPPORTS_SAVE )
89198969
89208970GAME( 1994, pnickj,   0,        cps1_12MHz, pnickj,   cps1,     ROT0,   "Compile (Capcom license)", "Pnickies (Japan 940608)", GAME_SUPPORTS_SAVE )
8921/* Japanese version of Pang 3 is encrypted, Euro version is not */
8922GAME( 1995, pang3,    0,        pang3,      pang3,    pang3,    ROT0,   "Mitchell", "Pang! 3 (Euro 950511)", GAME_SUPPORTS_SAVE )
8923GAME( 1995, pang3j,   pang3,    pang3,      pang3,    pang3j,   ROT0,   "Mitchell", "Pang! 3 (Japan 950511)", GAME_SUPPORTS_SAVE )
8971
8972GAME( 1995, pang3,    0,        pang3,      pang3,    pang3,     ROT0,   "Mitchell", "Pang! 3 (Euro 950601)", GAME_SUPPORTS_SAVE )
8973GAME( 1995, pang3n,   pang3,    pang3,      pang3n,   pang3n,    ROT0,   "Mitchell", "Pang! 3 (Euro 950511, not encrypted)", GAME_SUPPORTS_SAVE )
8974GAME( 1995, pang3j,   pang3,    pang3,      pang3n,   pang3,     ROT0,   "Mitchell", "Pang! 3 (Japan 950511)", GAME_SUPPORTS_SAVE )
src/mame/drivers/namcos11.c
r7356r7357
44  =====================================
55  Driver by smf & Ryan Holtz
66  Board notes by The Guru
7  Sound by R Belmont
7  Sound and MCU hookup by R. Belmont
88  Thanks to the original Zinc Team.
99
1010  Issues:
11   The C76 internal rom is not dumped, we use the sound program from Prop Cycle and patch the inputs.
1211   Random draw list corruption in soul edge v2 & dunkmania.
1312   soul edge, dunk mania & prime goal ex try to access joypads/memory cards. It is unknown what they would do if they found one.
13   Pocket Racer can't enter service menus with proper C76 hookup, runs 60 FPS when it looks like it should be 30
1414
1515Known Dumps
1616-----------
r7356r7357
266266#include "emu.h"
267267#include "deprecat.h"
268268#include "cpu/mips/psx.h"
269#include "cpu/m37710/m37710.h"
269270#include "includes/psx.h"
270271#include "machine/at28c16.h"
271#include "audio/namcoc7x.h"
272#include "sound/c352.h"
272273
273274#define VERBOSE_LEVEL ( 0 )
274275
r7356r7357
553554   return data;
554555}
555556
556static WRITE32_HANDLER( sharedram_w )
557{
558   verboselog( space->machine, 1, "sharedram_w( %08x, %08x, %08x )\n", ( offset * 4 ) + 0x4000, data, mem_mask );
559   COMBINE_DATA( &namcos11_sharedram[ offset ] );
560}
561
562static READ32_HANDLER( sharedram_r )
563{
564   verboselog( space->machine, 1, "sharedram_r( %08x, %08x ) %08x\n", ( offset * 4 ) + 0x4000, mem_mask, namcos11_sharedram[ offset ] );
565   return namcos11_sharedram[ offset ];
566}
567
568#define SHRAM( x ) namcos11_sharedram[ ( x - 0x4000 ) / 4 ]
569
570static UINT16 m_n_oldcoin;
571
572557static INTERRUPT_GEN( namcos11_vblank )
573558{
574   UINT16 n_coin;
575   UINT32 n_input;
576
577   n_input = ( input_port_read(device->machine,  "PLAYER1" ) << 16 );
578   SHRAM( 0xbd00 ) = n_input | ( ( n_input & ~SHRAM( 0xbd00 ) ) >> 8 ) | ( SHRAM( 0xbd00 ) & 0x0000ffff );
579
580   n_input = input_port_read(device->machine,  "PLAYER2" ) | ( input_port_read(device->machine,  "PLAYER3" ) << 16 );
581   SHRAM( 0xbd04 ) = n_input | ( ( n_input & ~SHRAM( 0xbd04 ) ) >> 8 );
582
583   n_input = input_port_read(device->machine,  "PLAYER4" );
584   SHRAM( 0xbd08 ) = n_input | ( ( n_input & ~SHRAM( 0xbd08 ) ) >> 8 ) | ( SHRAM( 0xbd08 ) & 0xffff0000 );
585
586   n_coin = input_port_read(device->machine,  "COIN" );
587
588   if( ( n_coin & m_n_oldcoin & 0x08 ) != 0 )
589   {
590      SHRAM( 0xbd1c ) = ( SHRAM( 0xbd1c ) & 0x0000ffff ) | ( ( SHRAM( 0xbd1c ) + 0x00010000 ) & 0xffff0000 );
591   }
592   if( ( n_coin & m_n_oldcoin & 0x04 ) != 0 )
593   {
594      SHRAM( 0xbd20 ) = ( SHRAM( 0xbd20 ) & 0xffff0000 ) | ( ( SHRAM( 0xbd20 ) + 0x00000001 ) & 0x0000ffff );
595   }
596   if( ( n_coin & m_n_oldcoin & 0x02 ) != 0 )
597   {
598      SHRAM( 0xbd20 ) = ( SHRAM( 0xbd20 ) & 0x0000ffff ) | ( ( SHRAM( 0xbd20 ) + 0x00010000 ) & 0xffff0000 );
599   }
600   if( ( n_coin & m_n_oldcoin & 0x01 ) != 0 )
601   {
602      SHRAM( 0xbd24 ) = ( SHRAM( 0xbd24 ) & 0xffff0000 ) | ( ( SHRAM( 0xbd24 ) + 0x00000001 ) & 0x0000ffff );
603   }
604   m_n_oldcoin = ~n_coin;
605
606559   if( strcmp( device->machine->gamedrv->name, "pocketrc" ) == 0 )
607560   {
608561      if( g_p_n_psxram[ 0x12c74 / 4 ] == 0x1440fff9 )
r7356r7357
613566      {
614567         g_p_n_psxram[ 0x64694 / 4 ] = 0;
615568      }
616
617      if( ( SHRAM( 0xbe88 ) & 0x0000ffff ) == 2 )
618      {
619         cpu_set_input_line(device, INPUT_LINE_RESET, PULSE_LINE );
620         memset( namcos11_keycus, 0, namcos11_keycus_size );
621
622         SHRAM( 0xbe88 ) = ( SHRAM( 0xbe88 ) & 0xffff0000 );
623      }
624
625      SHRAM( 0xbd30 ) = ( SHRAM( 0xbd30 ) & 0x0000ffff ) | ( 0x0080 << 16 );
626
627      SHRAM( 0xbd08 ) = ( SHRAM( 0xbd08 ) & 0x0000ffff ) | ( ( input_port_read(device->machine,  "STEERING" ) - 0x8000 ) << 16 );
628      SHRAM( 0xbd0c ) = ( SHRAM( 0xbd0c ) & 0xffff0000 ) | ( input_port_read(device->machine,  "GAS" ) << 0 );
629569   }
630570
631571   psx_vblank(device);
632572}
633573
634static TIMER_CALLBACK( mcu_timer )
635{
636   SHRAM( 0xbd00 ) = ( SHRAM( 0xbd00 ) & 0xffffff00 ) | input_port_read(machine,  "SWITCH" );
637}
638
639574static UINT32 m_n_bankoffset;
640575
641576INLINE void bankswitch_rom8( const address_space *space, const char *bank, int n_data )
r7356r7357
750685   AM_RANGE(0x1f801c00, 0x1f801dff) AM_NOP
751686   AM_RANGE(0x1f802020, 0x1f802033) AM_RAM /* ?? */
752687   AM_RANGE(0x1f802040, 0x1f802043) AM_WRITENOP
753   AM_RANGE(0x1fa04000, 0x1fa0ffff) AM_READWRITE(sharedram_r, sharedram_w) AM_BASE(&namcos11_sharedram) /* shared ram */
688   AM_RANGE(0x1fa04000, 0x1fa0ffff) AM_RAM AM_BASE(&namcos11_sharedram) /* shared ram with C76 */
754689   AM_RANGE(0x1fa20000, 0x1fa2ffff) AM_WRITE(keycus_w) AM_BASE(&namcos11_keycus) AM_SIZE(&namcos11_keycus_size) /* keycus */
755690   AM_RANGE(0x1fa30000, 0x1fa30fff) AM_DEVREADWRITE8("at28c16", at28c16_r, at28c16_w, 0x00ff00ff) /* eeprom */
756691   AM_RANGE(0x1fb00000, 0x1fb00003) AM_WRITENOP /* ?? */
r7356r7357
763698   AM_RANGE(0xfffe0130, 0xfffe0133) AM_WRITENOP
764699ADDRESS_MAP_END
765700
701static READ16_HANDLER( c76_shared_r )
702{
703   UINT16 *share16 = (UINT16 *)namcos11_sharedram;
704
705   return share16[offset];
706}
707
708static WRITE16_HANDLER( c76_shared_w )
709{
710   UINT16 *share16 = (UINT16 *)namcos11_sharedram;
711
712   COMBINE_DATA(&share16[offset]);
713}
714
715static UINT8 su_83;
716
717static READ16_HANDLER( c76_speedup_r )
718{
719   if ((cpu_get_pc(space->cpu) == 0xc153) && (!(su_83 & 0xff00)))
720   {
721      cpu_spinuntil_int(space->cpu);
722   }
723
724   return su_83;
725}
726
727static WRITE16_HANDLER( c76_speedup_w )
728{
729   COMBINE_DATA(&su_83);
730}
731
732static READ16_HANDLER( c76_inputs_r )
733{
734//  logerror("'c76' Read port %d @ %06X\n", offset, cpu_get_pc(space->cpu));
735
736   switch (offset)
737   {
738      case 0:
739         return input_port_read(space->machine, "PLAYER4");
740
741      case 1:
742         return input_port_read(space->machine, "SWITCH");
743
744      case 2:
745         return input_port_read(space->machine, "PLAYER1");
746
747      case 3:
748         return input_port_read(space->machine, "PLAYER2");
749   }
750
751   return 0xff;
752}
753
754ADDRESS_MAP_START( c76_map, ADDRESS_SPACE_PROGRAM, 16 )
755   AM_RANGE(0x002000, 0x002fff) AM_DEVREADWRITE("c352", c352_r, c352_w )
756   AM_RANGE(0x001000, 0x001007) AM_READ( c76_inputs_r )
757   AM_RANGE(0x004000, 0x00bfff) AM_READWRITE( c76_shared_r, c76_shared_w )
758   AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_REGION("c76", 0x40000)
759   AM_RANGE(0x080000, 0x0fffff) AM_ROM AM_REGION("c76", 0)
760   AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("c76", 0)
761   AM_RANGE(0x280000, 0x2fffff) AM_ROM AM_REGION("c76", 0)
762   AM_RANGE(0x300000, 0x300001) AM_WRITENOP
763   AM_RANGE(0x301000, 0x301001) AM_WRITENOP
764ADDRESS_MAP_END
765
766static READ8_HANDLER(dac7_r)      // bit 7
767{
768   return input_port_read_safe(space->machine, "PLAYER3", 0xff)&0x80;
769}
770
771static READ8_HANDLER(dac6_r)      // bit 3
772{
773   return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<4)&0x80;
774}
775
776static READ8_HANDLER(dac5_r)      // bit 2
777{
778   return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<5)&0x80;
779}
780
781static READ8_HANDLER(dac4_r)      // bit 1
782{
783   return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<6)&0x80;
784}
785
786static READ8_HANDLER(dac3_r)      // bit 0
787{
788   return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<7)&0x80;
789}
790
791static READ8_HANDLER(dac2_r)      // bit 4
792{
793   return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<3)&0x80;
794}
795
796static READ8_HANDLER(dac1_r)      // bit 5
797{
798   return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<2)&0x80;
799}
800
801static READ8_HANDLER(dac0_r)      // bit 6
802{
803   return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<1)&0x80;
804}
805
806static READ8_HANDLER(pocketrc_gas_r)
807{
808   return input_port_read(space->machine, "GAS");
809}
810
811static READ8_HANDLER(pocketrc_steer_r)
812{
813   return input_port_read(space->machine, "STEERING");
814}
815
816ADDRESS_MAP_START( c76_io_map, ADDRESS_SPACE_IO, 8 )
817   AM_RANGE(M37710_ADC7_L, M37710_ADC7_L) AM_READ(dac7_r)
818   AM_RANGE(M37710_ADC6_L, M37710_ADC6_L) AM_READ(dac6_r)
819   AM_RANGE(M37710_ADC5_L, M37710_ADC5_L) AM_READ(dac5_r)
820   AM_RANGE(M37710_ADC4_L, M37710_ADC4_L) AM_READ(dac4_r)
821   AM_RANGE(M37710_ADC3_L, M37710_ADC3_L) AM_READ(dac3_r)
822   AM_RANGE(M37710_ADC2_L, M37710_ADC2_L) AM_READ(dac2_r)
823   AM_RANGE(M37710_ADC1_L, M37710_ADC1_L) AM_READ(dac1_r)
824   AM_RANGE(M37710_ADC0_L, M37710_ADC0_L) AM_READ(dac0_r)
825
826   AM_RANGE(M37710_ADC0_H, M37710_ADC7_H) AM_READNOP
827ADDRESS_MAP_END
828
829INTERRUPT_GEN( c76_interrupt )
830{
831   switch (cpu_getiloops(device))
832   {
833      case 0:
834         cpu_set_input_line(device, M37710_LINE_IRQ0, HOLD_LINE);
835         break;
836
837      case 1:
838         cpu_set_input_line(device, M37710_LINE_IRQ2, HOLD_LINE);
839         break;
840
841      case 2:
842         cpu_set_input_line(device, M37710_LINE_ADC, HOLD_LINE);
843         break;
844   }
845}
846
766847static const struct
767848{
768849   const char *s_name;
r7356r7357
796877static DRIVER_INIT( namcos11 )
797878{
798879   int n_game;
799   emu_timer *timer;
800880
801   timer = timer_alloc(machine,  mcu_timer , NULL);
802   timer_adjust_periodic( timer, ATTOTIME_IN_HZ( 600 ), 0, ATTOTIME_IN_HZ( 600 ) );
881   memory_install_readwrite16_handler(cputag_get_address_space(machine, "c76", ADDRESS_SPACE_PROGRAM), 0x82, 0x83, 0, 0, c76_speedup_r, c76_speedup_w);
803882
883   if( strcmp( machine->gamedrv->name, "pocketrc" ) == 0 )
884   {
885      memory_install_read8_handler(cputag_get_address_space(machine, "c76", ADDRESS_SPACE_IO), M37710_ADC0_L, M37710_ADC0_L, 0, 0, pocketrc_steer_r);
886      memory_install_read8_handler(cputag_get_address_space(machine, "c76", ADDRESS_SPACE_IO), M37710_ADC1_L, M37710_ADC1_L, 0, 0, pocketrc_gas_r);
887   }
888
804889   psx_driver_init(machine);
805   namcoc7x_on_driver_init(machine);
806   namcoc7x_set_host_ram(namcos11_sharedram);
807890
808891   n_game = 0;
809892   while( namcos11_config_table[ n_game ].s_name != NULL )
r7356r7357
862945      memory_install_write32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f788000, 0x1f788003, 0, 0, lightgun_w );
863946      memory_install_read32_handler (cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f780000, 0x1f78000f, 0, 0, lightgun_r );
864947   }
865
866   state_save_register_global(machine,  m_n_oldcoin );
867948}
868949
869950static MACHINE_RESET( namcos11 )
r7356r7357
878959   MDRV_CPU_PROGRAM_MAP( namcos11_map)
879960   MDRV_CPU_VBLANK_INT("screen", namcos11_vblank)
880961
962   MDRV_CPU_ADD("c76", M37702, 16384000)
963   MDRV_CPU_PROGRAM_MAP(c76_map)
964   MDRV_CPU_IO_MAP(c76_io_map)
965   MDRV_CPU_VBLANK_INT_HACK(c76_interrupt, 3)
966
881967   MDRV_MACHINE_RESET( namcos11 )
882968
883969   /* video hardware */
r7356r7357
894980   MDRV_VIDEO_START( psx_type1 )
895981   MDRV_VIDEO_UPDATE( psx )
896982
897   NAMCO_C7X_MCU_SHARED(16384000)
898   NAMCO_C7X_SOUND(16384000)
983   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
984   MDRV_SOUND_ADD("c352", C352, 16384000)
985   MDRV_SOUND_ROUTE(0, "rspeaker", 1.00)
986   MDRV_SOUND_ROUTE(1, "lspeaker", 1.00)
987   MDRV_SOUND_ROUTE(2, "rspeaker", 1.00)
988   MDRV_SOUND_ROUTE(3, "lspeaker", 1.00)
899989
900990   MDRV_AT28C16_ADD( "at28c16", NULL )
901991MACHINE_DRIVER_END
r7356r7357
903993static MACHINE_DRIVER_START( coh110 )
904994   MDRV_IMPORT_FROM( coh100 )
905995   MDRV_VIDEO_START( psx_type2 )
996
997   MDRV_SCREEN_MODIFY("screen")
998   MDRV_SCREEN_REFRESH_RATE( 30 )
906999MACHINE_DRIVER_END
9071000
9081001static INPUT_PORTS_START( namcos11 )
9091002   PORT_START( "SWITCH" )
910   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* read by pocket racer */
911   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
912   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
913   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
914   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 )
915   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
916   PORT_DIPNAME( 0x02, 0x00, "DIP1 (Test)" )
1003   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
1004   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
1005   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
1006   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
1007   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 )
1008   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN4 )
1009   PORT_DIPNAME( 0x02, 0x02, "DIP1 (Test)" )
1010   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1011   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1012   PORT_DIPNAME( 0x01, 0x01, "DIP2 (Freeze)" )
1013   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1014   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1015
1016   PORT_START( "TEST" )
1017   PORT_DIPNAME( 0x80, 0x00, "TDIP8" )
9171018   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1019   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1020   PORT_DIPNAME( 0x40, 0x00, "TDIP7" )
1021   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1022   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1023   PORT_DIPNAME( 0x20, 0x00, "TDIP6" )
1024   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1025   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1026   PORT_DIPNAME( 0x10, 0x00, "TDIP5" )
1027   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1028   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1029   PORT_DIPNAME( 0x08, 0x00, "TDIP4" )
1030   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1031   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1032   PORT_DIPNAME( 0x04, 0x00, "TDIP3" )
1033   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1034   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1035   PORT_DIPNAME( 0x02, 0x00, "TDIP2" )
1036   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
9181037   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
919   PORT_DIPNAME( 0x01, 0x00, "DIP2 (Freeze)" )
1038   PORT_DIPNAME( 0x01, 0x00, "TDIP1" )
9201039   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
9211040   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
9221041
9231042   PORT_START( "PLAYER1" )
924   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
925   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
926   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
927   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
928   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 )
929   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 )
930   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 )
931   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_START1 )
1043   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1044   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1045   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1046   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1047   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
1048   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
1049   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
1050   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
9321051
9331052   PORT_START( "PLAYER2" )
934   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER( 2 )
935   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER( 2 )
936   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER( 2 )
937   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER( 2 )
938   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER( 2 )
939   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER( 2 )
940   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER( 2 )
941   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_START2 )
1053   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER( 2 )
1054   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER( 2 )
1055   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER( 2 )
1056   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER( 2 )
1057   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER( 2 )
1058   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER( 2 )
1059   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER( 2 )
1060   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
9421061
9431062   PORT_START( "PLAYER3" )
944   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER( 3 )
945   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER( 3 )
946   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER( 3 )
947   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER( 3 )
948   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER( 3 )
949   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER( 3 )
950   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER( 3 )
951   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_START3 )
1063   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER( 3 )
1064   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER( 3 )
1065   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER( 3 )
1066   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER( 3 )
1067   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER( 3 )
1068   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER( 3 )
1069   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER( 3 )
1070   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
9521071
9531072   PORT_START( "PLAYER4" )
954   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER( 4 )
955   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER( 4 )
956   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER( 4 )
957   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER( 4 )
958   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER( 4 )
959   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER( 4 )
960   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER( 4 )
961   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_START4 )
962
963   PORT_START( "COIN" )
964   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
965   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
966   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
967   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN3 )
968   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN4 )
1073   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER( 4 )
1074   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER( 4 )
1075   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER( 4 )
1076   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER( 4 )
1077   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER( 4 )
1078   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER( 4 )
1079   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER( 4 )
1080   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
9691081INPUT_PORTS_END
9701082
9711083static INPUT_PORTS_START( tekken )
9721084   PORT_INCLUDE( namcos11 )
9731085
1086   PORT_MODIFY( "SWITCH" )
1087   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1088   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1089
9741090   PORT_MODIFY( "PLAYER1" )
975   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1091   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
9761092
9771093   PORT_MODIFY( "PLAYER2" )
978   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1094   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
9791095
9801096   PORT_MODIFY( "PLAYER3" )
981   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
982   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
983   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
984   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
985   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON3 )
986   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON4 )
987   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
988   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
1097   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
9891098
9901099   PORT_MODIFY( "PLAYER4" )
991   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
992   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
993   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
994   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
995   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER( 2 )
996   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER( 2 )
997   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
998   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
1100   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
9991101INPUT_PORTS_END
10001102
10011103static INPUT_PORTS_START( souledge )
10021104   PORT_INCLUDE( namcos11 )
10031105
1106   PORT_MODIFY( "SWITCH" )
1107   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1108   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1109
10041110   PORT_MODIFY( "PLAYER3" )
1005   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
1006   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
1007   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
1008   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
1009   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON4 )
1010   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1011   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1012   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
1111   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
1112   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1113   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1114   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1115   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 )
1116   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1117   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1118   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
10131119
10141120   PORT_MODIFY( "PLAYER4" )
1015   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
1016   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
1017   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
1018   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
1019   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER( 2 )
1020   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1021   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1022   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
1121   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
1122   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1123   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1124   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1125   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER( 2 )
1126   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1127   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1128   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
10231129INPUT_PORTS_END
10241130
10251131static INPUT_PORTS_START( myangel3 )
10261132   PORT_INCLUDE( namcos11 )
10271133
1134   PORT_MODIFY( "SWITCH" )
1135   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1136   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1137
10281138   PORT_MODIFY( "PLAYER1" )
1029   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1030   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1031   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED )
1032   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1033   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 )
1034   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON3 )
1035   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 )
1139   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNUSED )
1140   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 )
1141   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 )
1142   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
1143   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
10361144
10371145   PORT_MODIFY( "PLAYER2" )
1038   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1039   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1040   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED )
1041   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER( 2 )
1042   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER( 2 )
1043   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER( 2 )
1044   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER( 2 )
1146   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNUSED )
1147   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1148   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1149   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1150   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
10451151
10461152   PORT_MODIFY( "PLAYER3" )
1047   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
1048   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1049   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1050   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED )
1051   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
1052   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
1053   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
1054   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
1153   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1154   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1155   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1156   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
1157   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1158   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1159   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1160   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
10551161
10561162   PORT_MODIFY( "PLAYER4" )
1057   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
1058   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1059   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1060   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED )
1061   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
1062   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
1063   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
1064   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
1163   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1164   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1165   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1166   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
1167   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1168   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1169   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1170   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
10651171INPUT_PORTS_END
10661172
10671173static INPUT_PORTS_START( ptblnk2a )
10681174   PORT_INCLUDE( namcos11 )
10691175
10701176   PORT_MODIFY( "PLAYER1" )
1071   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
1072   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
1073   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
1074   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
1075   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1076   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1177   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
1178   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1179   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1180   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1181   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1182   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
10771183
10781184   PORT_MODIFY( "PLAYER2" )
1079   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
1080   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
1081   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
1082   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
1083   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1084   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1185   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
1186   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1187   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1188   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1189   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1190   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
10851191
10861192   PORT_MODIFY( "PLAYER3" )
1087   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
1088   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
1089   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
1090   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
1091   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED )
1092   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1093   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1094   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
1193   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
1194   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1195   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1196   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1197   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
1198   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1199   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1200   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
10951201
10961202   PORT_MODIFY( "PLAYER4" )
1097   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
1098   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
1099   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
1100   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
1101   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED )
1102   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1103   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1104   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
1203   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
1204   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1205   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1206   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1207   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
1208   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1209   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1210   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
11051211
11061212   PORT_START( "GUN1X" )
11071213   PORT_BIT( 0xffff, 0x022f, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX( 0xd8, 0x387 ) PORT_SENSITIVITY( 100 ) PORT_KEYDELTA( 15 ) PORT_PLAYER( 1 )
r7356r7357
11191225static INPUT_PORTS_START( pocketrc )
11201226   PORT_INCLUDE( namcos11 )
11211227
1228   PORT_MODIFY( "SWITCH" )
1229   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1230   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1231
11221232   PORT_MODIFY( "PLAYER1" )
1123   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
1124   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1125   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1126   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED )
1127   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
1128   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
1129   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
1130   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
1233   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1234   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1235   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1236   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
1237   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1238   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1239   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1240   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
11311241
11321242   PORT_MODIFY( "PLAYER2" )
1133   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
1134   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1135   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1136   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED )
1137   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
1138   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
1139   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
1140   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
1243   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1244   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1245   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1246   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
1247   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1248   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1249   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1250   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
11411251
11421252   PORT_MODIFY( "PLAYER3" )
1143   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
1144   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1145   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1146   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED )
1147   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED )
1148   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
1149   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
1150   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
1253   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1254   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1255   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1256   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
1257   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1258   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1259   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1260   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
11511261
11521262   PORT_MODIFY( "PLAYER4" )
1153   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
1154   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED )
1155   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
1156   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED )
1157   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CODE( KEYCODE_A )
1158   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
1159   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1160   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1263   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1264   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1265   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1266   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
1267   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
1268   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1269   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1270   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
11611271
1162   PORT_MODIFY( "COIN" )
1163   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
1164   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
1165   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
1166
11671272   PORT_START( "STEERING" )
1168   PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_MINMAX( 0x7f00, 0x80ff ) PORT_SENSITIVITY( 100 ) PORT_KEYDELTA( 3 ) PORT_CENTERDELTA( 128 ) PORT_PLAYER( 1 ) PORT_REVERSE
1273   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX( 0x00, 0xff ) PORT_SENSITIVITY( 100 ) PORT_KEYDELTA( 3 ) PORT_CENTERDELTA( 128 ) PORT_PLAYER( 1 ) PORT_REVERSE
11691274
11701275   PORT_START( "GAS" )
11711276   PORT_BIT( 0x00ff, 0x0000, IPT_PEDAL ) PORT_MINMAX( 0x0000, 0x00ff ) PORT_SENSITIVITY( 100 ) PORT_KEYDELTA( 15 ) PORT_PLAYER( 1 ) PORT_REVERSE
r7356r7357
11881293   ROM_LOAD16_BYTE( "dc1rom3l.ic1", 0x0c00000, 0x200000, CRC(a76bcd4c) SHA1(817abdc43158b7aaac329c3ea17782277acb36a4) )
11891294   ROM_LOAD16_BYTE( "dc1rom3u.ic9", 0x0c00001, 0x200000, CRC(1405d123) SHA1(3d7be5558358740f5a0a3a3022543cf5aca4cf24) )
11901295
1191   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1296   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
11921297   ROM_LOAD( "dc1sprog.6d",  0x0000000, 0x040000, CRC(96cd7788) SHA1(68a5a53a5fc50e2b6b684c99d27d81e3a8c56287) )
1193   NAMCO_C7X_BIOS
1298   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
11941299
11951300   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
11961301   ROM_LOAD( "dc1wave.8k",   0x000000, 0x400000, CRC(8ba0f6a7) SHA1(e9868debd808e92b196d1baeeeae9c4855356a01) )
r7356r7357
12141319   ROM_LOAD16_BYTE( "dm1rom1u.ic8", 0x0400001, 0x200000, CRC(01e905d3) SHA1(430b2ae0c67265b6acc8aa4dd50f6144929993f8) )
12151320   ROM_CONTINUE( 0x0400001, 0x200000 ) /* first & second half identical */
12161321
1217   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1322   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
12181323   ROM_LOAD( "dm1sprog.6d",  0x0000000, 0x040000, CRC(de1cbc78) SHA1(855ebece1841f50ae324d7d6b8b18ab6f657d28e) )
1219   NAMCO_C7X_BIOS
1324   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
12201325
12211326   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
12221327   ROM_LOAD( "dm1wave.8k",   0x000000, 0x400000, CRC(4891d53e) SHA1(a1fee060e94d3219174b5974517f4fd3be32aaa5) )
r7356r7357
12401345   ROM_LOAD16_BYTE( "dm1rom1u.ic8", 0x0400001, 0x200000, CRC(01e905d3) SHA1(430b2ae0c67265b6acc8aa4dd50f6144929993f8) )
12411346   ROM_CONTINUE( 0x0400001, 0x200000 ) /* first & second half identical */
12421347
1243   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1348   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
12441349   ROM_LOAD( "dm1sprog.6d",  0x0000000, 0x040000, CRC(de1cbc78) SHA1(855ebece1841f50ae324d7d6b8b18ab6f657d28e) )
1245   NAMCO_C7X_BIOS
1350   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
12461351
12471352   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
12481353   ROM_LOAD( "dm1wave.8k",   0x800000, 0x400000, CRC(4891d53e) SHA1(a1fee060e94d3219174b5974517f4fd3be32aaa5) )
r7356r7357
12591364   ROM_LOAD16_BYTE( "kqt1prg1l.ic3", 0x1000000, 0x800000, CRC(298d8eeb) SHA1(c421b1bdd5fd46c026a41e2cec47cafd1a69d33d) )
12601365   ROM_LOAD16_BYTE( "kqt1prg1u.ic6", 0x1000001, 0x800000, CRC(911783db) SHA1(1005fc9b38e212844e397150a6f98f43ad88d4b9) )
12611366
1262   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1367   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
12631368   ROM_LOAD( "kqt1sprog.7e", 0x0000000, 0x040000, CRC(bb1888a6) SHA1(4db07738079725413cdba7eb75252ee71ae50a66) )
1264   NAMCO_C7X_BIOS
1369   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
12651370
12661371   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
12671372   ROM_LOAD( "kqt1wave.8k",  0x000000, 0x400000, CRC(92ca8e4f) SHA1(48d6bdfcc5de1c280afa36c3f0dd6d4177771355) )
r7356r7357
12771382   ROM_LOAD16_BYTE( "pkr1rom0l.ic5", 0x000000, 0x200000, CRC(6c9b074c) SHA1(885f342bd178e4146e1f75259206f6625c0b3c18) )
12781383   ROM_LOAD16_BYTE( "pkr1rom0u.ic6", 0x000001, 0x200000, CRC(a55c0906) SHA1(3b6abfa877f88a4d96222d98af02498b0c777af6) )
12791384
1280   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1385   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
12811386   ROM_LOAD( "pkr1verb.6d",  0x000000, 0x040000, CRC(9bf08992) SHA1(fca7943f7bcf0ee758fa63fbdef8f7456b9e46cb) )
1282   NAMCO_C7X_BIOS
1387   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
12831388
12841389   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
12851390   ROM_LOAD( "pkr1wave.8k",  0x000000, 0x400000, CRC(72517c46) SHA1(d0dcc750fe8eca9e965e7c366ac39a42ffd76557) )
r7356r7357
13011406   ROM_LOAD16_BYTE( "pg1rom1l.ic8", 0x0400001, 0x200000, CRC(59b5a71c) SHA1(ddc1f0a5488466166c21fd0c84ab2b4cf04316bf) )
13021407   ROM_CONTINUE( 0x0400001, 0x200000 ) /* first & second half identical */
13031408
1304   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1409   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
13051410   ROM_LOAD( "pg1sprog.6d",  0x0000000, 0x040000, CRC(e7c3396d) SHA1(12bbb8ebcaab1b40462a12917dd9b58bd9ab8663) )
1306   NAMCO_C7X_BIOS
1411   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
13071412
13081413   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
13091414   ROM_LOAD( "pg1wave.8k",   0x0000000, 0x400000, CRC(fc9ad9eb) SHA1(ce5bb2288ed8cf1348825c39423cbb99d9324b9c) )
r7356r7357
13211426   ROM_LOAD16_BYTE( "gnb1prg0l.ic2", 0x000000, 0x800000, CRC(78746037) SHA1(d130ca1153a730e3c967945248f00662f9fab304) )
13221427   ROM_LOAD16_BYTE( "gnb1prg0u.ic5", 0x000001, 0x800000, CRC(697d3279) SHA1(40302780f7494d9413888b2d1da38bd14a9a444f) )
13231428
1324   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1429   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
13251430   ROM_LOAD( "gnb1vera.6d",  0x0000000, 0x040000, CRC(6461ae77) SHA1(1377b716a69ef9d4d2e48083d23f22bd5c103c00) )
1326   NAMCO_C7X_BIOS
1431   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
13271432
13281433   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
13291434   ROM_LOAD( "gnb1wave.8k",  0x0000000, 0x400000, CRC(4e19d9d6) SHA1(0a92c987536999a789663a30c787950ab6995128) )
r7356r7357
13471452   ROM_LOAD16_BYTE( "so1rom3u.ic1", 0x0c00000, 0x200000, CRC(f11bd521) SHA1(baf936dec58cebfeef1c74f95e455b2fe74eb982) )
13481453   ROM_LOAD16_BYTE( "so1rom3l.ic9", 0x0c00001, 0x200000, CRC(84465bcc) SHA1(d8be888d41cfe194c3a1853d9146d3a74ef7bab1) )
13491454
1350   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1455   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
13511456   ROM_LOAD( "so1sprogc.6d", 0x0000000, 0x040000, CRC(2bbc118c) SHA1(4168a9aa525f1f0ce6cf6e14cfe4c118c4c0d773) )
1352   NAMCO_C7X_BIOS
1457   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
13531458
13541459   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
13551460   ROM_LOAD( "so1wave.8k",   0x000000, 0x400000, CRC(0e68836b) SHA1(c392b370a807803c7ab060105861253e1b407f49) )
r7356r7357
13731478   ROM_LOAD16_BYTE( "so1rom3u.ic1", 0x0c00000, 0x200000, CRC(f11bd521) SHA1(baf936dec58cebfeef1c74f95e455b2fe74eb982) )
13741479   ROM_LOAD16_BYTE( "so1rom3l.ic9", 0x0c00001, 0x200000, CRC(84465bcc) SHA1(d8be888d41cfe194c3a1853d9146d3a74ef7bab1) )
13751480
1376   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1481   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
13771482   ROM_LOAD( "so1sprogc.6d", 0x0000000, 0x040000, CRC(2bbc118c) SHA1(4168a9aa525f1f0ce6cf6e14cfe4c118c4c0d773) )
1378   NAMCO_C7X_BIOS
1483   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
13791484
13801485   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
13811486   ROM_LOAD( "so1wave.8k",   0x000000, 0x400000, CRC(0e68836b) SHA1(c392b370a807803c7ab060105861253e1b407f49) )
r7356r7357
13991504   ROM_LOAD16_BYTE( "so1rom3u.ic1", 0x0c00000, 0x200000, CRC(f11bd521) SHA1(baf936dec58cebfeef1c74f95e455b2fe74eb982) )
14001505   ROM_LOAD16_BYTE( "so1rom3l.ic9", 0x0c00001, 0x200000, CRC(84465bcc) SHA1(d8be888d41cfe194c3a1853d9146d3a74ef7bab1) )
14011506
1402   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1507   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
14031508   ROM_LOAD( "so1sprog.6d",  0x0000000, 0x040000, CRC(f6f682b7) SHA1(a64e19be3f6e630b8c34f34b46b95aadfabd3f63) )
1404   NAMCO_C7X_BIOS
1509   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
14051510
14061511   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
14071512   ROM_LOAD( "so1wave.8k",   0x800000, 0x400000, CRC(0e68836b) SHA1(c392b370a807803c7ab060105861253e1b407f49) )
r7356r7357
14241529   ROM_LOAD16_BYTE( "so1rom3u.ic1", 0x0c00000, 0x200000, CRC(f11bd521) SHA1(baf936dec58cebfeef1c74f95e455b2fe74eb982) )
14251530   ROM_LOAD16_BYTE( "so1rom3l.ic9", 0x0c00001, 0x200000, CRC(84465bcc) SHA1(d8be888d41cfe194c3a1853d9146d3a74ef7bab1) )
14261531
1427   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1532   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
14281533   ROM_LOAD( "so1sprog.6d",  0x0000000, 0x040000, CRC(f6f682b7) SHA1(a64e19be3f6e630b8c34f34b46b95aadfabd3f63) )
1429   NAMCO_C7X_BIOS
1534   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
14301535
14311536   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
14321537   ROM_LOAD( "so1wave.8k",   0x000000, 0x400000, CRC(0e68836b) SHA1(c392b370a807803c7ab060105861253e1b407f49) )
r7356r7357
14401545
14411546   ROM_REGION32_LE( 0x0100000, "user2", ROMREGION_ERASE00 ) /* main data */
14421547
1443   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1548   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
14441549   ROM_LOAD( "stp1sprog.7e", 0x0000000, 0x040000, CRC(08aaaf6a) SHA1(51c913a39ff7c154aef8bb10139cc8b92eb4756a) )
1445   NAMCO_C7X_BIOS
1550   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
14461551
14471552   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
14481553   ROM_LOAD( "stp1wave.8k",  0x000000, 0x400000, CRC(18f30e92) SHA1(b3819455856298527a7224495f541145aecf23dd) )
r7356r7357
14641569   ROM_LOAD16_BYTE( "te1rom2l.ic4", 0x0800000, 0x200000, CRC(41d77846) SHA1(eeab049135c02a255899fe37e225c1111b2fbb7d) )
14651570   ROM_LOAD16_BYTE( "te1rom2u.ic7", 0x0800001, 0x200000, CRC(a678987e) SHA1(c62c00ce5cf4d001723c999b2bc3dbb90283def1) )
14661571
1467   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1572   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
14681573   ROM_LOAD( "te1sprog.6d",  0x0000000, 0x040000, CRC(849587e9) SHA1(94c6a757b24758a866a41bd8acd46aa46844f74b) )
1469   NAMCO_C7X_BIOS
1574   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
14701575
14711576   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
14721577   ROM_LOAD( "te1wave.8k",   0x0000000, 0x200000, CRC(fce6c57a) SHA1(7fb8c69452c92c59a940a2b69d0d73ef7aefcb82) )
r7356r7357
14871592   ROM_LOAD16_BYTE( "te1rom2l.ic4", 0x0800000, 0x200000, CRC(41d77846) SHA1(eeab049135c02a255899fe37e225c1111b2fbb7d) )
14881593   ROM_LOAD16_BYTE( "te1rom2u.ic7", 0x0800001, 0x200000, CRC(a678987e) SHA1(c62c00ce5cf4d001723c999b2bc3dbb90283def1) )
14891594
1490   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1595   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
14911596   ROM_LOAD( "te1sprog.6d",  0x0000000, 0x040000, CRC(849587e9) SHA1(94c6a757b24758a866a41bd8acd46aa46844f74b) )
1492   NAMCO_C7X_BIOS
1597   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
14931598
14941599   ROM_REGION( 0x0200000, "c352", 0 ) /* samples */
14951600   ROM_LOAD( "te1wave.8k",   0x0000000, 0x200000, CRC(fce6c57a) SHA1(7fb8c69452c92c59a940a2b69d0d73ef7aefcb82) )
r7356r7357
15101615   ROM_LOAD16_BYTE( "te1rom2l.ic4", 0x0800000, 0x200000, CRC(41d77846) SHA1(eeab049135c02a255899fe37e225c1111b2fbb7d) )
15111616   ROM_LOAD16_BYTE( "te1rom2u.ic7", 0x0800001, 0x200000, CRC(a678987e) SHA1(c62c00ce5cf4d001723c999b2bc3dbb90283def1) )
15121617
1513   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1618   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
15141619   ROM_LOAD( "te1sprog.6d",  0x0000000, 0x040000, CRC(849587e9) SHA1(94c6a757b24758a866a41bd8acd46aa46844f74b) )
1515   NAMCO_C7X_BIOS
1620   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
15161621
15171622   ROM_REGION( 0x0200000, "c352", 0 ) /* samples */
15181623   ROM_LOAD( "te1wave.8k",   0x0000000, 0x200000, CRC(fce6c57a) SHA1(7fb8c69452c92c59a940a2b69d0d73ef7aefcb82) )
r7356r7357
15331638   ROM_LOAD16_BYTE( "te1rom2l.ic4", 0x0800000, 0x200000, CRC(41d77846) SHA1(eeab049135c02a255899fe37e225c1111b2fbb7d) )
15341639   ROM_LOAD16_BYTE( "te1rom2u.ic7", 0x0800001, 0x200000, CRC(a678987e) SHA1(c62c00ce5cf4d001723c999b2bc3dbb90283def1) )
15351640
1536   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1641   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
15371642   ROM_LOAD( "te1sprog.6d",  0x0000000, 0x040000, CRC(849587e9) SHA1(94c6a757b24758a866a41bd8acd46aa46844f74b) )
1538   NAMCO_C7X_BIOS
1643   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
15391644
15401645   ROM_REGION( 0x0200000, "c352", 0 ) /* samples */
15411646   ROM_LOAD( "te1wave.8k",   0x0000000, 0x200000, CRC(fce6c57a) SHA1(7fb8c69452c92c59a940a2b69d0d73ef7aefcb82) )
r7356r7357
15581663   ROM_LOAD16_BYTE( "tes1rom3l.ic9", 0x0c00000, 0x200000, CRC(d5ac0f18) SHA1(342d063f7974bd1f90b5ca4832dfa4fbc9605453) )
15591664   ROM_LOAD16_BYTE( "tes1rom3u.ic1", 0x0c00001, 0x200000, CRC(44ed509d) SHA1(27e26aaf5ce72ab686f3f05743b1d91b5334b4e0) )
15601665
1561   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1666   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
15621667   ROM_LOAD( "tes1sprog.6d", 0x0000000, 0x040000, CRC(af18759f) SHA1(aabd7d1384925781d37f860605a5d4622e0fc2e4) )
1563   NAMCO_C7X_BIOS
1668   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
15641669
15651670   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
15661671   ROM_LOAD( "tes1wave.8k",  0x800000, 0x400000, CRC(34a34eab) SHA1(8e83a579abdcd419dc5cff8aa4c1d7e6c3add773) )
r7356r7357
15831688   ROM_LOAD16_BYTE( "tes1rom3l.ic9", 0x0c00000, 0x200000, CRC(d5ac0f18) SHA1(342d063f7974bd1f90b5ca4832dfa4fbc9605453) )
15841689   ROM_LOAD16_BYTE( "tes1rom3u.ic1", 0x0c00001, 0x200000, CRC(44ed509d) SHA1(27e26aaf5ce72ab686f3f05743b1d91b5334b4e0) )
15851690
1586   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1691   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
15871692   ROM_LOAD( "tes1sprog.6d", 0x0000000, 0x040000, CRC(af18759f) SHA1(aabd7d1384925781d37f860605a5d4622e0fc2e4) )
1588   NAMCO_C7X_BIOS
1693   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
15891694
15901695   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
15911696   ROM_LOAD( "tes1wave.8k",  0x800000, 0x400000, CRC(34a34eab) SHA1(8e83a579abdcd419dc5cff8aa4c1d7e6c3add773) )
r7356r7357
16081713   ROM_LOAD16_BYTE( "tes1rom3l.ic9", 0x0c00000, 0x200000, CRC(d5ac0f18) SHA1(342d063f7974bd1f90b5ca4832dfa4fbc9605453) )
16091714   ROM_LOAD16_BYTE( "tes1rom3u.ic1", 0x0c00001, 0x200000, CRC(44ed509d) SHA1(27e26aaf5ce72ab686f3f05743b1d91b5334b4e0) )
16101715
1611   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1716   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
16121717   ROM_LOAD( "tes1sprog.6d", 0x0000000, 0x040000, CRC(af18759f) SHA1(aabd7d1384925781d37f860605a5d4622e0fc2e4) )
1613   NAMCO_C7X_BIOS
1718   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
16141719
16151720   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
16161721   ROM_LOAD( "tes1wave.8k",  0x800000, 0x400000, CRC(34a34eab) SHA1(8e83a579abdcd419dc5cff8aa4c1d7e6c3add773) )
r7356r7357
16311736   ROM_LOAD16_BYTE( "xv31rom2l.ic4", 0x0800000, 0x200000, CRC(8403a277) SHA1(35193211351494a086d8422e3b0b71a8d3a262a6) )
16321737   ROM_LOAD16_BYTE( "xv31rom2u.ic7", 0x0800001, 0x200000, CRC(ecf70432) SHA1(bec128a215e0aef66e9a8707bb0d1eb7b098a356) )
16331738
1634   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1739   ROM_REGION16_LE( 0x100000, "c76", 0 ) /* sound data and MCU BIOS */
16351740   ROM_LOAD( "xv31sprog.6d", 0x0000000, 0x040000, CRC(e50b856a) SHA1(631da4f60c9ce08387fca26a70481a2fdacf9765) )
1636   NAMCO_C7X_BIOS
1741   ROM_LOAD( "c76.bin",      0x040000, 0x004000, CRC(399faac7) SHA1(ceb184ef0486caf715dd997101999785f67a40b8) )
16371742
16381743   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
16391744   ROM_LOAD( "xv31wave.8k",  0x000000, 0x400000, CRC(14f25ddd) SHA1(4981cf1017432ff85b768ec88c36f535df30b783) )
src/mame/drivers/itech8.c
r7356r7357
27352735
27362736/* Wheel of Fortune-style PCB */
27372737GAME( 1989, wfortune, 0,        wfortune,          wfortune, 0,        ROT0,   "GameTek", "Wheel Of Fortune", 0 )
2738GAME( 1989, wfortunea, wfortune, wfortune,          wfortune, 0,        ROT0,   "GameTek", "Wheel Of Fortune (alternate)", 0 )
2738GAME( 1989, wfortunea,wfortune, wfortune,          wfortune, 0,        ROT0,   "GameTek", "Wheel Of Fortune (alternate)", 0 )
27392739
27402740/* Grudge Match-style PCB */
27412741GAME( 1989, grmatch,  0,        grmatch,           grmatch,  grmatch,  ROT0,   "Yankee Game Technology", "Grudge Match (Yankee Game Technology)", 0 )
r7356r7357
27492749GAME( 1991, gtg2j,    gtg2,     stratab_lo,        gtg,      0,        ROT0,   "Strata/Incredible Technologies", "Golden Tee Golf II (Joystick, V1.0)", 0 )
27502750
27512751/* Slick Shot-style PCB */
2752GAME( 1990, slikshot, 0,        slikshot_hi,       slikshot, slikshot, ROT90,  "Grand Products/Incredible Technologies", "Slick Shot (V2.2)", 0 )
2753GAME( 1990, slikshot17, slikshot, slikshot_hi,       slikshot, slikshot, ROT90,  "Grand Products/Incredible Technologies", "Slick Shot (V1.7)", 0 )
2754GAME( 1990, slikshot16, slikshot, slikshot_hi,       slikshot, slikshot, ROT90,  "Grand Products/Incredible Technologies", "Slick Shot (V1.6)", 0 )
2755GAME( 1990, dynobop,  0,        slikshot_hi,       dynobop,  slikshot, ROT90,  "Grand Products/Incredible Technologies", "Dyno Bop", 0 )
2756GAME( 1990, sstrike,  0,        sstrike,           sstrike,  sstrike,  ROT270, "Strata/Incredible Technologies", "Super Strike Bowling", 0 )
2757GAME( 1991, pokrdice, 0,        slikshot_lo_noz80, pokrdice, 0,        ROT90,  "Strata/Incredible Technologies", "Poker Dice", 0 )
2752GAME( 1990, slikshot,  0,        slikshot_hi,       slikshot, slikshot, ROT90,  "Grand Products/Incredible Technologies", "Slick Shot (V2.2)", 0 )
2753GAME( 1990, slikshot17,slikshot, slikshot_hi,       slikshot, slikshot, ROT90,  "Grand Products/Incredible Technologies", "Slick Shot (V1.7)", 0 )
2754GAME( 1990, slikshot16,slikshot, slikshot_hi,       slikshot, slikshot, ROT90,  "Grand Products/Incredible Technologies", "Slick Shot (V1.6)", 0 )
2755GAME( 1990, dynobop,   0,        slikshot_hi,       dynobop,  slikshot, ROT90,  "Grand Products/Incredible Technologies", "Dyno Bop", 0 )
2756GAME( 1990, sstrike,   0,        sstrike,           sstrike,  sstrike,  ROT270, "Strata/Incredible Technologies", "Super Strike Bowling", 0 )
2757GAME( 1991, pokrdice,  0,        slikshot_lo_noz80, pokrdice, 0,        ROT90,  "Strata/Incredible Technologies", "Poker Dice", 0 )
27582758
27592759/* Hot Shots Tennis-style PCB */
2760GAME( 1990, hstennis, 0,        hstennis_hi,       hstennis, hstennis, ROT90,  "Strata/Incredible Technologies", "Hot Shots Tennis (V1.1)", 0 )
2761GAME( 1990, hstennis10, hstennis, hstennis_hi,       hstennis, hstennis, ROT90,  "Strata/Incredible Technologies", "Hot Shots Tennis (V1.0)", 0 )
2762GAME( 1991, arlingtn, 0,        hstennis_hi,       arlingtn, arligntn, ROT0,   "Strata/Incredible Technologies", "Arlington Horse Racing (v1.21-D)", 0 )
2763GAME( 1991, peggle,   0,        hstennis_lo,       peggle,   peggle,   ROT90,  "Strata/Incredible Technologies", "Peggle (Joystick, v1.0)", 0 )
2764GAME( 1991, pegglet,  peggle,   hstennis_lo,       pegglet,  peggle,   ROT90,  "Strata/Incredible Technologies", "Peggle (Trackball, v1.0)", 0 )
2765GAME( 1992, neckneck, 0,        hstennis_lo,       neckneck, neckneck, ROT0,   "Bundra Games/Incredible Technologies", "Neck-n-Neck (v1.2)", 0 )
2760GAME( 1990, hstennis,  0,        hstennis_hi,       hstennis, hstennis, ROT90,  "Strata/Incredible Technologies", "Hot Shots Tennis (V1.1)", 0 )
2761GAME( 1990, hstennis10,hstennis, hstennis_hi,       hstennis, hstennis, ROT90,  "Strata/Incredible Technologies", "Hot Shots Tennis (V1.0)", 0 )
2762GAME( 1991, arlingtn,  0,        hstennis_hi,       arlingtn, arligntn, ROT0,   "Strata/Incredible Technologies", "Arlington Horse Racing (v1.21-D)", 0 )
2763GAME( 1991, peggle,    0,        hstennis_lo,       peggle,   peggle,   ROT90,  "Strata/Incredible Technologies", "Peggle (Joystick, v1.0)", 0 )
2764GAME( 1991, pegglet,   peggle,   hstennis_lo,       pegglet,  peggle,   ROT90,  "Strata/Incredible Technologies", "Peggle (Trackball, v1.0)", 0 )
2765GAME( 1992, neckneck,  0,        hstennis_lo,       neckneck, neckneck, ROT0,   "Bundra Games/Incredible Technologies", "Neck-n-Neck (v1.2)", 0 )
27662766
27672767/* Rim Rockin' Basketball-style PCB */
2768GAME( 1991, rimrockn, 0,        rimrockn,          rimrockn, rimrockn, ROT0,   "Strata/Incredible Technologies", "Rim Rockin' Basketball (V2.2)", 0 )
2768GAME( 1991, rimrockn,   0,        rimrockn,          rimrockn, rimrockn, ROT0,   "Strata/Incredible Technologies", "Rim Rockin' Basketball (V2.2)", 0 )
27692769GAME( 1991, rimrockn20, rimrockn, rimrockn,          rimrockn, rimrockn, ROT0,   "Strata/Incredible Technologies", "Rim Rockin' Basketball (V2.0)", 0 )
27702770GAME( 1991, rimrockn16, rimrockn, rimrockn,          rimrockn, rimrockn, ROT0,   "Strata/Incredible Technologies", "Rim Rockin' Basketball (V1.6)", 0 )
27712771GAME( 1991, rimrockn12, rimrockn, rimrockn,          rimrockn, rimrockn, ROT0,   "Strata/Incredible Technologies", "Rim Rockin' Basketball (V1.2)", 0 )
src/mame/drivers/galaxian.c
r7356r7357
28342834   irq_line = 0;
28352835
28362836   /* decrypt the code */
2837   cclimbrj_decode(machine);
2837   cclimberj_decode(machine);
28382838}
28392839
28402840
src/mame/drivers/atetris.c
r7356r7357
220220ADDRESS_MAP_END
221221
222222
223static ADDRESS_MAP_START( atetrsb2_map, ADDRESS_SPACE_PROGRAM, 8 )
223static ADDRESS_MAP_START( atetrisb2_map, ADDRESS_SPACE_PROGRAM, 8 )
224224   AM_RANGE(0x0000, 0x0fff) AM_RAM
225225   AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(atetris_videoram_w) AM_BASE_GENERIC(videoram) AM_SIZE_GENERIC(videoram)
226226   AM_RANGE(0x2000, 0x20ff) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_BASE_GENERIC(paletteram)
r7356r7357
276276
277277
278278// Same as the regular one except they added a Flip Controls switch
279static INPUT_PORTS_START( atetcktl )
279static INPUT_PORTS_START( atetrisc )
280280   PORT_INCLUDE( atetris )
281281
282282   PORT_MODIFY("IN0")
r7356r7357
374374MACHINE_DRIVER_END
375375
376376
377static MACHINE_DRIVER_START( atetrsb2 )
377static MACHINE_DRIVER_START( atetrisb2 )
378378
379379   /* basic machine hardware */
380380   MDRV_CPU_ADD("maincpu", M6502,BOOTLEG_CLOCK/8)
381   MDRV_CPU_PROGRAM_MAP(atetrsb2_map)
381   MDRV_CPU_PROGRAM_MAP(atetrisb2_map)
382382
383383   MDRV_MACHINE_START(atetris)
384384   MDRV_MACHINE_RESET(atetris)
r7356r7357
509509GAME( 1988, atetris,  0,       atetris,  atetris,  atetris, ROT0,   "Atari Games", "Tetris (set 1)", GAME_SUPPORTS_SAVE )
510510GAME( 1988, atetrisa, atetris, atetris,  atetris,  atetris, ROT0,   "Atari Games", "Tetris (set 2)", GAME_SUPPORTS_SAVE )
511511GAME( 1988, atetrisb, atetris, atetris,  atetris,  atetris, ROT0,   "bootleg",     "Tetris (bootleg set 1)", GAME_SUPPORTS_SAVE )
512GAME( 1988, atetrisb2,atetris, atetrsb2, atetris,  atetris, ROT0,   "bootleg",     "Tetris (bootleg set 2)", GAME_SUPPORTS_SAVE )
513GAME( 1989, atetrisc, atetris, atetris,  atetcktl, atetris, ROT270, "Atari Games", "Tetris (cocktail set 1)", GAME_SUPPORTS_SAVE )
514GAME( 1989, atetrisc2,atetris, atetris,  atetcktl, atetris, ROT270, "Atari Games", "Tetris (cocktail set 2)", GAME_SUPPORTS_SAVE )
512GAME( 1988, atetrisb2,atetris, atetrisb2,atetris,  atetris, ROT0,   "bootleg",     "Tetris (bootleg set 2)", GAME_SUPPORTS_SAVE )
513GAME( 1989, atetrisc, atetris, atetris,  atetrisc, atetris, ROT270, "Atari Games", "Tetris (cocktail set 1)", GAME_SUPPORTS_SAVE )
514GAME( 1989, atetrisc2,atetris, atetris,  atetrisc, atetris, ROT270, "Atari Games", "Tetris (cocktail set 2)", GAME_SUPPORTS_SAVE )
src/mame/drivers/sangho.c
r7356r7357
1/* Sang Ho Soft 'Puzzle Star' PCB */
2
31/*
42
5 It is important that this is finished before all the
6 PCBs are dead incase we need anything additional
7 from the boards which can only be retrived while they are
8 in working condition.
3Sang Ho Soft 'Puzzle Star' PCB
94
10 At this stage it looks unlikely that we will need anything
11 as the battery backed chip appears to control ports+banking.
5Driver by David Haywood, Tomasz Slanina and Mariusz Wojcieszek
126
13 */
14
15/*
16
177Each board contains a custom FGPA on a sub-board with
188a warning   "WARNING ! NO TOUCH..." printed on the PCB
199
r7356r7357
5343#include "sound/2413intf.h"
5444
5545static UINT8* sangho_ram;
46static UINT8 sexyboom_bank[8];
5647
5748static WRITE8_HANDLER(sangho_ram_w)
5849{
r7356r7357
6758   AM_RANGE(0xc000, 0xffff) AM_ROMBANK("bank4")
6859ADDRESS_MAP_END
6960
61static ADDRESS_MAP_START( sexyboom_map, ADDRESS_SPACE_PROGRAM, 8 )
62   AM_RANGE(0x0000, 0x3fff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank5")
63   AM_RANGE(0x4000, 0x7fff) AM_READ_BANK("bank2") AM_WRITE_BANK("bank6")
64   AM_RANGE(0x8000, 0xbfff) AM_READ_BANK("bank3") AM_WRITE_BANK("bank7")
65   AM_RANGE(0xc000, 0xffff) AM_READ_BANK("bank4") AM_WRITE_BANK("bank8")
66ADDRESS_MAP_END
67
7068/* Wrong ! */
7169static WRITE8_HANDLER(pzlestar_bank_w)
7270{
r7356r7357
7472   memory_set_bankptr(space->machine, "bank3",&memory_region(space->machine, "user1")[  0x18000  ]);
7573}
7674
75static void sexyboom_map_bank(running_machine *machine, int bank)
76{
77   UINT8 banknum, banktype;
78   char read_bank_name[6], write_bank_name[6];
79
80   banknum = sexyboom_bank[bank*2];
81   banktype = sexyboom_bank[bank*2 + 1];
82   sprintf(read_bank_name, "bank%d", bank+1);
83   sprintf(write_bank_name, "bank%d", bank+1+4);
84
85   if (banktype == 0)
86   {
87      if (banknum & 0x80)
88      {
89         // ram
90         memory_set_bankptr(machine, read_bank_name, &sangho_ram[(banknum & 0x7f) * 0x4000]);
91         memory_install_write_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), bank*0x4000, (bank+1)*0x4000 - 1, 0, 0, write_bank_name );
92         memory_set_bankptr(machine, write_bank_name, &sangho_ram[(banknum & 0x7f) * 0x4000]);
93      }
94      else
95      {
96         // rom 0
97         memory_set_bankptr(machine, read_bank_name, memory_region(machine, "user1")+0x4000*banknum);
98         memory_unmap_write(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), bank*0x4000, (bank+1)*0x4000 - 1, 0, 0);
99      }
100   }
101   else if (banktype == 0x82)
102   {
103      memory_set_bankptr(machine, read_bank_name, memory_region(machine, "user1")+0x20000+banknum*0x4000);
104      memory_unmap_write(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), bank*0x4000, (bank+1)*0x4000 - 1, 0, 0);
105   }
106   else if (banktype == 0x80)
107   {
108      memory_set_bankptr(machine, read_bank_name, memory_region(machine, "user1")+0x120000+banknum*0x4000);
109      memory_unmap_write(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), bank*0x4000, (bank+1)*0x4000 - 1, 0, 0);
110   }
111   else
112   {
113      logerror("Unknown bank type %02x\n", banktype);
114   }
115}
116
117static WRITE8_HANDLER(sexyboom_bank_w)
118{
119   sexyboom_bank[offset] = data;
120   sexyboom_map_bank(space->machine, offset>>1);
121}
122
77123/* Puzzle Star Ports */
78124
79125static ADDRESS_MAP_START( pzlestar_io_map, ADDRESS_SPACE_IO, 8 )
r7356r7357
101147   AM_RANGE( 0xf2, 0xf2) AM_WRITE( v9938_0_palette_w )
102148   AM_RANGE( 0xf3, 0xf3) AM_WRITE( v9938_0_register_w )
103149   AM_RANGE( 0xf7, 0xf7) AM_READ_PORT("DSW")
104   //bank f8-ff ???
150   AM_RANGE( 0xf8, 0xff) AM_WRITE( sexyboom_bank_w )
105151ADDRESS_MAP_END
106152
107153
r7356r7357
188234
189235static MACHINE_RESET(sexyboom)
190236{
191   /* give it some code to run */
192   memcpy(sangho_ram,memory_region(machine, "user1"),0x8000);
193   /* patch out rom check */
194   sangho_ram[0x022e]=0xc9;
195   sangho_ram[0x4604]=0xc9;
237   sexyboom_bank[0] = 0x00;
238   sexyboom_bank[1] = 0x00;
239   sexyboom_bank[2] = 0x01;
240   sexyboom_bank[3] = 0x00;
241   sexyboom_bank[4] = 0x80;
242   sexyboom_bank[5] = 0x00;
243   sexyboom_bank[6] = 0x80;
244   sexyboom_bank[7] = 0x01;
245   sexyboom_map_bank(machine, 0);
246   sexyboom_map_bank(machine, 1);
247   sexyboom_map_bank(machine, 2);
248   sexyboom_map_bank(machine, 3);
196249
197   sangho_common_machine_reset(machine);
250   v9938_reset(0);
198251}
199252
200253static void msx_vdp_interrupt(running_machine *machine, int i)
r7356r7357
252305static MACHINE_DRIVER_START(sexyboom )
253306
254307   MDRV_CPU_ADD("maincpu", Z80,8000000) // ?
255   MDRV_CPU_PROGRAM_MAP(pzlestar_map)
308   MDRV_CPU_PROGRAM_MAP(sexyboom_map)
256309   MDRV_CPU_IO_MAP(sexyboom_io_map)
257310   MDRV_CPU_VBLANK_INT_HACK(sangho_interrupt,262)
258311
r7356r7357
324377}
325378
326379GAME( 1991, pzlestar,  0,    pzlestar, sangho, sangho, ROT270, "Sang Ho Soft", "Puzzle Star (Sang Ho Soft)", GAME_NOT_WORKING )
327GAME( 1992, sexyboom,  0,    sexyboom, sangho, sangho, ROT270, "Sang Ho Soft", "Sexy Boom", GAME_NOT_WORKING | GAME_NO_SOUND )
380GAME( 1992, sexyboom,  0,    sexyboom, sangho, sangho, ROT270, "Sang Ho Soft", "Sexy Boom", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS )
src/mame/drivers/pachifev.c
r7356r7357
1/***************************************************************************
1/**********************************************************************************************************
22
33PACHI FEVER / SANKI DENSHI KOGYO
44
5DORE GA CPU ? <- where's the CPU?
65
76GEN6480830 (TEXAS INSTRUMENTS)
87XTAL:12.000MHZ
r7356r7357
1312
1413DIP SWITCH:8BIT x 3
1514
16============================================================================
15===========================================================================================================
1716
18Skeleton driver, just the main CPU was identified (TMS9900). Can't get it
19to upload a vram / blitter list at all :-/
20Many thanks to Olivier Galibert and Wilbert Pol for the identify effort ;-)
17Many thanks to Olivier Galibert and Wilbert Pol for identify the CPU
2118
22***************************************************************************/
2319
20Tomasz Slanina 10.02.2010:
21---------------------------
22
23There's very little info about the game or hardware, so all the above (except for clocks and MSM ) is
24just a guess:
25
26- CPU (GEN6480830 ?) is TMS9995 or derivative ( decrementer + lvl3 interrupt, internal ram)
27- RY050012 could be a VDP ( probably TMS9928A )
28- SN76469A (or similar) used for music
29- MSM5205 - sample player (see below)
30
31- TODO:
32  - what's the correct game title - Pachifever ? Fever 777 ?
33  - ic48.50 ROM redump (probably more adpcm samples + lookuptable .. mapped at $c000)
34  - remaing DSW
35  - unknown writes ($ffxx range)
36  - controls : unused bits (is the BUTTON1 used _only_ for entering initials?)
37  - controls : make PLUNGER (or whatever it is in reality) implementation more clear
38               here's some code used to read plunger pos(angle?):
39
400284: 04CC             clr  R12            ; CRU address
410286: 0208 FF00        li   R8,>ff00     ; R8=ff00 - initial data ($ff)
42028A: D688             movb R8,*R10     ; ff-> ff40  - write to output
43028C: 3449             stcr R9,1        ; CRU read (one bit)
44028E: 1603             jne  >0296        ; not zer0 - end
450290: 0228 FC00        ai   R8,>fc00    ; R8=R8-4
460294: 18FA             joc  >028a        ; loop
47
480296: D6A0 020F        movb @>020f,*R10  ; 00 ->ff40 - end of controls read
49029A: 045B             b    *R11        ; b $1ca - process data in R8
50
51***********************************************************************************************************/
52
2453#include "emu.h"
2554#include "cpu/tms9900/tms9900.h"
55#include "video/tms9928a.h"
2656#include "sound/msm5205.h"
57#include "sound/sn76496.h"
2758
28static VIDEO_START( pachifev )
59#define USE_MSM 0
60#define NUM_PLUNGER_REPEATS    50
61
62typedef struct _pachifev_state pachifev_state;
63
64struct _pachifev_state
2965{
66 /* controls related */
3067
68 int power;
69 int max_power;
70 int input_power;
71 int previous_power;
72 int cnt;
73
74};
75
76static WRITE8_HANDLER(controls_w)
77{
78    if(!data)
79    {
80        pachifev_state *state = (pachifev_state *)space->machine->driver_data;
81
82        /*end of input read*/
83        state->power=0;
84        state->max_power=state->input_power;
85        if(--state->cnt <= 0) /* why to do it N times? no ide.. someone should fix it */
86        {
87            state->cnt=0;
88            state->input_power=0;
89        }
90    }
3191}
3292
33static VIDEO_UPDATE( pachifev )
93static READ8_HANDLER(controls_r)
3494{
35   return 0;
95    pachifev_state *state = (pachifev_state *)space->machine->driver_data;
96    int output_bit=(state->power < state->max_power)?0:1;
97    ++state->power;
98    return output_bit;
3699}
37100
38static ADDRESS_MAP_START( pachifev_map, ADDRESS_SPACE_PROGRAM, 16 )
39   AM_RANGE(0x0000, 0xbfff) AM_ROM
40   AM_RANGE(0xe000, 0xffff) AM_RAM
101static ADDRESS_MAP_START( pachifev_map, ADDRESS_SPACE_PROGRAM, 8 )
102    AM_RANGE(0x0000, 0x9fff) AM_ROM
103
104    AM_RANGE(0xc000, 0xc0ff) AM_NOP /* game is expecting here some kind of lookup table (adpcm samples start?) */
105
106    AM_RANGE(0xe000, 0xe7ff) AM_RAM
107    AM_RANGE(0xf000, 0xf0fb) AM_NOP  /* internal ram */
108    AM_RANGE(0xff00, 0xff00) AM_READ_PORT("IN0")
109    AM_RANGE(0xff02, 0xff02) AM_READ_PORT("IN1")
110    AM_RANGE(0xff04, 0xff04) AM_READ_PORT("DSW1")
111    AM_RANGE(0xff06, 0xff06) AM_READ_PORT("DSW2")
112    AM_RANGE(0xff08, 0xff08) AM_READ_PORT("DSW3")
113    AM_RANGE(0xff10, 0xff10) AM_READWRITE(TMS9928A_vram_r, TMS9928A_vram_w)
114    AM_RANGE(0xff12, 0xff12) AM_READWRITE(TMS9928A_register_r, TMS9928A_register_w)
115    AM_RANGE(0xff20, 0xff20) AM_WRITENOP /* unknown */
116    AM_RANGE(0xff30, 0xff30) AM_DEVWRITE("sn76", sn76496_w)
117    AM_RANGE(0xff40, 0xff40) AM_WRITE(controls_w)
118    AM_RANGE(0xff50, 0xff50) AM_WRITENOP /* unknown */
119    AM_RANGE(0xfffa, 0xfffb) AM_NOP /* decrementer */
120    AM_RANGE(0xfffc, 0xffff) AM_NOP /* nmi */
41121ADDRESS_MAP_END
42122
43static ADDRESS_MAP_START( pachifev_io, ADDRESS_SPACE_IO, 8 )
44//  AM_RANGE(0x0f70, 0x0f70) AM_WRITE()
45//  AM_RANGE(0x0f71, 0x0f71) AM_WRITE()
123static ADDRESS_MAP_START( pachifev_cru, ADDRESS_SPACE_IO, 8 )
124    AM_RANGE(0x000, 0x000) AM_READ(controls_r)
46125ADDRESS_MAP_END
47126
127static INPUT_PORTS_START( pachifev )
128    PORT_START("IN0")
129    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )  /* used on enter player initials in top 5 */
130    PORT_BIT( 0x4d, IP_ACTIVE_LOW, IPT_UNKNOWN )
131    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
132    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
133    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
48134
49static INPUT_PORTS_START( pachifev )
135    PORT_START("IN1")
136    PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
137
138    PORT_START("DSW1")
139    PORT_DIPUNKNOWN( 0x07, 0x07 )
140
141    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
142    PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
143    PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
144
145    PORT_DIPNAME( 0x30, 0x10, "Balls" )
146    PORT_DIPSETTING(    0x00, "200")
147    PORT_DIPSETTING(    0x10, "100")
148    PORT_DIPSETTING(    0x20, "50")
149    PORT_DIPSETTING(    0x30, "25")
150
151    PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_A ) )
152    PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ))
153    PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
154    PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
155    PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) )
156
157    PORT_START("DSW2")
158
159    PORT_DIPNAME( 0x03, 0x01, "Time" )
160    PORT_DIPSETTING(    0x00, "180")
161    PORT_DIPSETTING(    0x01, "120")
162    PORT_DIPSETTING(    0x02, "150")
163    PORT_DIPSETTING(    0x03, "90")
164
165    PORT_DIPUNKNOWN( 0x0c, 0x0c )
166
167    PORT_DIPNAME( 0x30, 0x20, "Limit (attract)" ) /* attract mode only??? */
168    PORT_DIPSETTING(    0x00, "2000")
169    PORT_DIPSETTING(    0x10, "1500")
170    PORT_DIPSETTING(    0x20, "1000")
171    PORT_DIPSETTING(    0x30, "500")
172
173    PORT_DIPNAME( 0xc0, 0xc0, "Limit (game)" )  /* ball limit in game */
174    PORT_DIPSETTING(    0x00, "1500")
175    PORT_DIPSETTING(    0x40, "1000")
176    PORT_DIPSETTING(    0x80, "500")
177    PORT_DIPSETTING(    0xc0, "300")
178
179    PORT_START("DSW3")
180    PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
181    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
182    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
183
184    PORT_DIPUNKNOWN( 0xfe, 0xfe )
185
186    PORT_START("PLUNGER")
187    PORT_BIT( 0x3f, 0x00, IPT_POSITIONAL ) PORT_MINMAX(0x00,0x3f) PORT_SENSITIVITY(30) PORT_KEYDELTA(4) PORT_CENTERDELTA(0xff)
188
50189INPUT_PORTS_END
51190
191
192#if USE_MSM
193
52194static UINT32 adpcm_pos;
53//static UINT8 adpcm_idle;
195static UINT8 adpcm_idle=0;
54196
55197static void pf_adpcm_int(running_device *device)
56198{
57   static UINT8 trigger,adpcm_data;
199    static UINT8 trigger,adpcm_data;
58200
59   if (adpcm_pos >= 0x4000/* || adpcm_idle*/)
60   {
61      //adpcm_idle = 1;
62      msm5205_reset_w(device,1);
63      trigger = 0;
64   }
65   else
66   {
67      UINT8 *ROM = memory_region(device->machine, "adpcm");
201    if (adpcm_pos >= 0x4000 || adpcm_idle)
202    {
203        adpcm_idle = 1;
204        msm5205_reset_w(device,1);
205        trigger = 0;
206    }
207    else
208    {
209        UINT8 *ROM = memory_region(device->machine, "adpcm");
68210
69      adpcm_data = ((trigger ? (ROM[adpcm_pos] & 0x0f) : (ROM[adpcm_pos] & 0xf0)>>4) );
70      msm5205_data_w(device,adpcm_data & 0xf);
71      trigger^=1;
72      if(trigger == 0)
73      {
74         adpcm_pos++;
75         //if((ROM[adpcm_pos] & 0xff) == 0xff)
76         //  adpcm_idle = 1;
77      }
78   }
211        adpcm_data = ((trigger ? (ROM[adpcm_pos] & 0x0f) : (ROM[adpcm_pos] & 0xf0)>>4) );
212        msm5205_data_w(device,adpcm_data & 0xf);
213        trigger^=1;
214        if(trigger == 0)
215        {
216            adpcm_pos++;
217            if((ROM[adpcm_pos] & 0xff) == 0xff)
218              adpcm_idle = 1;
219        }
220    }
79221}
80222
81223static const msm5205_interface msm5205_config =
82224{
83   pf_adpcm_int,   /* interrupt function */
84   MSM5205_S48_4B   /* 8kHz */
225    pf_adpcm_int,    /* interrupt function */
226    MSM5205_S48_4B    /* 8kHz */
85227};
86228
229#endif
230
87231static MACHINE_RESET( pachifev )
88232{
89   adpcm_pos = 0;
233    pachifev_state *state = (pachifev_state *)machine->driver_data;
234
235    state->power=0;
236    state->max_power=0;
237    state->input_power=0;
238    state->previous_power=0;
239    state->cnt=0;
240
241#if USE_MSM
242    adpcm_pos = 0;
243#endif
90244}
91245
246
92247static INTERRUPT_GEN( pachifev_vblank_irq )
93248{
249    TMS9928A_interrupt(device->machine);
250
251    {
252        pachifev_state *state = (pachifev_state *)device->machine->driver_data;
253        int current_power=input_port_read(device->machine, "PLUNGER") & 0x3f;
254        if(current_power != state->previous_power)
255        {
256            popmessage    ("%d%%", (current_power * 100) / 0x3f);
257        }
258
259        if( (!current_power) && (state->previous_power) )
260        {
261            state->input_power=state->previous_power;
262            state->cnt=NUM_PLUNGER_REPEATS;
263        }
264
265        state->previous_power=current_power;
266    }
267
94268}
95269
270static const TMS9928a_interface tms9928a_interface =
271{
272    TMS99x8A,
273    0x4000,
274    0, 0,
275    0 /* no interrupt is generated */
276};
277
278static MACHINE_START( pachifev)
279{
280    /* configure VDP */
281    TMS9928A_configure(&tms9928a_interface);
282    {
283        pachifev_state *state = (pachifev_state *)machine->driver_data;
284
285        state_save_register_global(machine, state->power);
286        state_save_register_global(machine, state->max_power);
287        state_save_register_global(machine, state->input_power);
288        state_save_register_global(machine, state->previous_power);
289        state_save_register_global(machine, state->cnt);
290    }
291}
292
293static const struct tms9995reset_param pachifev_processor_config =
294{
295    1,0,0
296};
297
96298static MACHINE_DRIVER_START( pachifev )
97299
98   /* basic machine hardware */
99   MDRV_CPU_ADD("maincpu", TMS9900, 12000000/4) /* unknown divider */
100   MDRV_CPU_PROGRAM_MAP(pachifev_map)
101   MDRV_CPU_IO_MAP(pachifev_io)
102   MDRV_CPU_VBLANK_INT("screen",pachifev_vblank_irq)
300    MDRV_DRIVER_DATA(pachifev_state)
103301
104   /* video hardware */
105   MDRV_SCREEN_ADD("screen", RASTER)
106   MDRV_SCREEN_REFRESH_RATE(60)
107   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
108   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
109   MDRV_SCREEN_SIZE(32*8, 32*8)
110   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
111   MDRV_PALETTE_LENGTH(512)
112   MDRV_MACHINE_RESET(pachifev)
302    /* basic machine hardware */
303    MDRV_CPU_ADD("maincpu", TMS9995, XTAL_12MHz)
304    MDRV_CPU_CONFIG(pachifev_processor_config)
305    MDRV_CPU_PROGRAM_MAP(pachifev_map)
306    MDRV_CPU_IO_MAP(pachifev_cru)
307    MDRV_CPU_VBLANK_INT("screen",pachifev_vblank_irq)
113308
114   MDRV_VIDEO_START(pachifev)
115   MDRV_VIDEO_UPDATE(pachifev)
309    MDRV_MACHINE_START(pachifev)
310    MDRV_MACHINE_RESET(pachifev)
116311
117   /* sound hardware */
118   MDRV_SPEAKER_STANDARD_MONO("mono")
119   MDRV_SOUND_ADD("adpcm", MSM5205, 288000)
120   MDRV_SOUND_CONFIG(msm5205_config)
121   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
122MACHINE_DRIVER_END
312    /* video hardware */
123313
124/***************************************************************************
314    MDRV_IMPORT_FROM(tms9928a)
315    MDRV_SCREEN_MODIFY("screen")
316    MDRV_SCREEN_REFRESH_RATE((float)XTAL_10_738635MHz/2/342/262)
317    MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
125318
126  Game driver(s)
319    /* sound hardware */
320    MDRV_SPEAKER_STANDARD_MONO("mono")
321#if USE_MSM
322    MDRV_SOUND_ADD("adpcm", MSM5205, 288000)  /* guess */
323    MDRV_SOUND_CONFIG(msm5205_config)
324    MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
325#endif
326    MDRV_SOUND_ADD("sn76", SN76489, XTAL_10_738635MHz/3) /* guess */
327    MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
328MACHINE_DRIVER_END
127329
128***************************************************************************/
129
130330ROM_START( pachifev )
131   ROM_REGION( 0x10000, "maincpu", 0 )
132   ROM_LOAD( "ic42.00",   0x00000, 0x2000, CRC(9653546e) SHA1(0836d01118241d38bbf61732275afe3ae47d0622) )
133   ROM_LOAD( "ic43.01",   0x02000, 0x2000, CRC(5572dce5) SHA1(fad45b33e095ac6e3ed3d7cdc3d8678c153a1b38) )
134   ROM_LOAD( "ic44.02",   0x04000, 0x2000, CRC(98b3841f) SHA1(0563139877bf01e1673767ee1798bbcf68adadea) )
135   ROM_LOAD( "ic45.03",   0x06000, 0x2000, CRC(6b76e6fa) SHA1(5be10ab0b76e2061fc7e9c77649572955bee7661) )
136   ROM_LOAD( "ic46.04",   0x08000, 0x2000, CRC(1c8c66d7) SHA1(3b9b05f35b20d798651c7d5fdb35e6af956615a1) )
137   ROM_LOAD( "ic48.50",   0x0a000, 0x2000, CRC(1c8c66d7) SHA1(3b9b05f35b20d798651c7d5fdb35e6af956615a1) )
331    ROM_REGION( 0x10000, "maincpu", 0 )
332    ROM_LOAD( "ic42.00",   0x00000, 0x2000, CRC(9653546e) SHA1(0836d01118241d38bbf61732275afe3ae47d0622) )
333    ROM_LOAD( "ic43.01",   0x02000, 0x2000, CRC(5572dce5) SHA1(fad45b33e095ac6e3ed3d7cdc3d8678c153a1b38) )
334    ROM_LOAD( "ic44.02",   0x04000, 0x2000, CRC(98b3841f) SHA1(0563139877bf01e1673767ee1798bbcf68adadea) )
335    ROM_LOAD( "ic45.03",   0x06000, 0x2000, CRC(6b76e6fa) SHA1(5be10ab0b76e2061fc7e9c77649572955bee7661) )
336    ROM_LOAD( "ic46.04",   0x08000, 0x2000, CRC(1c8c66d7) SHA1(3b9b05f35b20d798651c7d5fdb35e6af956615a1) )
138337
139   ROM_REGION( 0x4000, "adpcm", 0 ) //msm code
140   ROM_LOAD( "ic66.10",   0x0000, 0x2000, CRC(217c573e) SHA1(6fb90865d1d81f5ea00fa7916d0ccb6756ef5ce5) )
338    ROM_REGION( 0x4000, "adpcm", 0 )
339    ROM_LOAD( "ic66.10",   0x0000, 0x2000, CRC(217c573e) SHA1(6fb90865d1d81f5ea00fa7916d0ccb6756ef5ce5) )
340
341    ROM_REGION( 0x2000, "user1", 0 )
342    ROM_LOAD( "ic48.50",   0x00000, 0x2000, BAD_DUMP CRC(1c8c66d7) SHA1(3b9b05f35b20d798651c7d5fdb35e6af956615a1) )
141343ROM_END
142344
143static DRIVER_INIT( pachifev )
144{
145}
345GAME( 1983, pachifev,  0,       pachifev,  pachifev,  0, ROT270, "Sanki Denshi Kogyo", "Pachifever", GAME_IMPERFECT_SOUND )
146346
147GAME( 1983, pachifev,  0,       pachifev,  pachifev,  pachifev, ROT0, "Sanki Denshi Kogyo", "Pachi Fever", GAME_NOT_WORKING )
src/mame/drivers/kyugo.c
r7356r7357
7878
7979Main_PortMap( gyrodine, 0x00 )
8080Main_PortMap( flashgal, 0x40 )
81Main_PortMap( flashgla, 0xc0 )
81Main_PortMap( flashgala, 0xc0 )
8282Main_PortMap( srdmissn, 0x08 )
8383
8484
r7356r7357
102102Sub_MemMap( sonofphx, 0x7fff, 0xa000, 0xc080, 0xc040, 0xc000 )
103103Sub_MemMap( srdmissn, 0x7fff, 0x8000, 0xf400, 0xf401, 0xf402 )
104104Sub_MemMap( legend,   0x7fff, 0xc000, 0xf800, 0xf801, 0xf802 )
105Sub_MemMap( flashgla, 0x7fff, 0xe000, 0xc040, 0xc080, 0xc0c0 )
105Sub_MemMap( flashgala, 0x7fff, 0xe000, 0xc040, 0xc080, 0xc0c0 )
106106
107107
108108
r7356r7357
123123Sub_PortMap( gyrodine, 0x00, 0xc0 )
124124Sub_PortMap( sonofphx, 0x00, 0x40 )
125125Sub_PortMap( srdmissn, 0x80, 0x84 )
126Sub_PortMap( flashgla, 0x40, 0x80 )
126Sub_PortMap( flashgala, 0x40, 0x80 )
127127
128128
129129/*************************************
r7356r7357
555555   MDRV_CPU_IO_MAP(flashgal_portmap)
556556MACHINE_DRIVER_END
557557
558static MACHINE_DRIVER_START( flashgla )
558static MACHINE_DRIVER_START( flashgala )
559559
560560   /* basic machine hardware */
561561   MDRV_IMPORT_FROM(gyrodine)
562562   MDRV_CPU_MODIFY("maincpu")
563   MDRV_CPU_IO_MAP(flashgla_portmap)
563   MDRV_CPU_IO_MAP(flashgala_portmap)
564564
565565   MDRV_CPU_MODIFY("sub")
566   MDRV_CPU_PROGRAM_MAP(flashgla_sub_map)
567   MDRV_CPU_IO_MAP(flashgla_sub_portmap)
566   MDRV_CPU_PROGRAM_MAP(flashgala_sub_map)
567   MDRV_CPU_IO_MAP(flashgala_sub_portmap)
568568MACHINE_DRIVER_END
569569
570570static MACHINE_DRIVER_START( legend )
r7356r7357
13341334GAME( 1985, 99lstwara, sonofphx, sonofphx, sonofphx, 0,        ROT90, "Proma", "'99: The Last War (alternate)", GAME_SUPPORTS_SAVE )
13351335GAME( 1985, 99lstwark, sonofphx, sonofphx, sonofphx, 0,        ROT90, "Kyugo", "'99: The Last War (Kyugo)", GAME_SUPPORTS_SAVE )
13361336GAME( 1985, flashgal,  0,        flashgal, flashgal, 0,        ROT0,  "Sega", "Flashgal (set 1)", GAME_SUPPORTS_SAVE )
1337GAME( 1985, flashgala, flashgal, flashgla, flashgal, 0,        ROT0,  "Sega", "Flashgal (set 2)", GAME_SUPPORTS_SAVE )
1337GAME( 1985, flashgala, flashgal, flashgala,flashgal, 0,        ROT0,  "Sega", "Flashgal (set 2)", GAME_SUPPORTS_SAVE )
13381338GAME( 1986, srdmissn,  0,        srdmissn, srdmissn, srdmissn, ROT90, "Taito Corporation", "S.R.D. Mission", GAME_SUPPORTS_SAVE )
13391339GAME( 1986, fx,        srdmissn, srdmissn, srdmissn, srdmissn, ROT90, "bootleg", "F-X", GAME_SUPPORTS_SAVE )
13401340GAME( 1986, legend,    0,        legend,   legend,   srdmissn, ROT0,  "Sega / Coreland", "Legend", GAME_SUPPORTS_SAVE )
src/mame/drivers/blockade.c
r7356r7357
360360   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
361361INPUT_PORTS_END
362362
363static INPUT_PORTS_START( minesw4p )
363static INPUT_PORTS_START( mineswpr4 )
364364   PORT_START("IN0")
365365   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
366366   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* This wiring selects cocktail mode */
r7356r7357
621621GAME( 1978, blasto,    0,        blasto,   blasto,   0, ROT0, "Gremlin", "Blasto", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
622622GAME( 1977, hustle,    0,        hustle,   hustle,   0, ROT0, "Gremlin", "Hustle", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
623623GAME( 1977, mineswpr,  0,        blasto,   mineswpr, 0, ROT0, "Amutech", "Minesweeper", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
624GAME( 1977, mineswpr4, mineswpr, blasto,   minesw4p, 0, ROT0, "Amutech", "Minesweeper (4-Player)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
624GAME( 1977, mineswpr4, mineswpr, blasto,   mineswpr4,0, ROT0, "Amutech", "Minesweeper (4-Player)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/espial.c
r7356r7357
55Espial: The Orca logo is displayed, but looks to be "blacked out" via the
66        color proms by having 0x1c & 0x1d set to black.
77
8
9Stephh's notes (based on the games Z80 code and some tests) :
10
111) 'espial*'
12
13  - The games read both players controls for player 2 when "Cabinet" is set
14    to "Upright" (code at 0x0321).
15  - The games read both buttons status regardless of settings. They are
16    then comnbined if Dip Switch is set to "1" (code at 0x32a).
17  - The "CRE." displayed at the bottom right of the screen is in fact
18    not really the number of credits (especially when coinage isn't 1C_1C)
19    as it relies on a transformation of real number of credits (stored at
20    0x5802) based on settings (coins needed stored at 0x5806 and credits
21    awarded at 0x5804). Check code at 0x080b which displays the odd value.
22
232) 'netwars'
24
25  - The game reads both players controls for player 2 when "Cabinet" is set
26    to "Upright" (code at 0x038e).
27  - The "CREDIT" displayed at the bottom right of the screen is in fact
28    not really the number of credits (especially when coinage isn't 1C_1C)
29    as it relies on a transformation of real number of credits (stored at
30    0x5802) based on settings (coins needed stored at 0x5806 and credits
31    awarded at 0x5804). Check code at 0x0147 which displays the odd value.
32  - When you get a perfect in the bonus game, you are only awarded 1000 points
33    even if the game tells you that you have been awarded 10000 points.
34
835***************************************************************************/
936
1037#include "emu.h"
r7356r7357
142169ADDRESS_MAP_END
143170
144171
172/* verified from Z80 code */
145173static INPUT_PORTS_START( espial )
146174   PORT_START("IN0")
147175   PORT_DIPNAME( 0x01, 0x00, "Number of Buttons" )
148176   PORT_DIPSETTING(    0x01, "1" )
149177   PORT_DIPSETTING(    0x00, "2" )
150   PORT_DIPNAME( 0x02, 0x02, "Enemy Bullets Vulnerable" )   /* you can shoot bullets */
178   PORT_DIPNAME( 0x02, 0x02, "Enemy Bullets Vulnerable" )  /* you can shoot bullets */
151179   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
152180   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
153   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
154   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
181   PORT_DIPUNUSED( 0x04, IP_ACTIVE_HIGH )
182   PORT_DIPUNUSED( 0x08, IP_ACTIVE_HIGH )
155183   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
156184   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
157   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
185   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
158186   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
159187
160188   PORT_START("DSW1")
r7356r7357
172200   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
173201   PORT_DIPSETTING(    0x10, DEF_STR( 1C_6C ) )
174202   PORT_DIPSETTING(    0x1c, DEF_STR( Free_Play ) )
175   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )   /* Sources on the net show 20K/50K & 40K/70K */
176   PORT_DIPSETTING(   0x00, "20k and every 70k" )
177   PORT_DIPSETTING(   0x20, "50k and every 100k" )
203   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )       /* code at 0x43e1 in 'espial' and 0x44b5 in 'espialu' */
204   PORT_DIPSETTING(   0x00, "20k 70k 70k+" )              /* last bonus life at 980k : max. 15 bonus lives */
205   PORT_DIPSETTING(   0x20, "50k 100k 100k+" )            /* last bonus life at 900k : max. 10 bonus lives */
178206   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )
179207   PORT_DIPSETTING(   0x40, DEF_STR( Upright ) )
180208   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
181   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
182   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
183   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
209   PORT_DIPNAME( 0x80, 0x00, "Reset on Check Error" )
210   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
211   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
184212
185213   PORT_START("IN1")
186214   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
187215   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
188   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
216   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
189217   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
190   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
191   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
192   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
193   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
218   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_8WAY PORT_COCKTAIL
219   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_8WAY
220   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_COCKTAIL
221   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
194222
195223   PORT_START("IN2")
196224   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
197225   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
198226   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
199227   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
200   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
201   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
202   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
203   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
228   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_8WAY
229   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
230   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
231   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_8WAY
204232INPUT_PORTS_END
205233
206234
235/* verified from Z80 code */
207236static INPUT_PORTS_START( netwars )
208237   PORT_START("IN0")
209   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )   /* probably unused */
210   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
211   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
212   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )   /* used */
213   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
214   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
215   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )   /* probably unused */
216   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
217   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
218   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )   /* used */
219   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
220   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
238   PORT_DIPUNUSED( 0x01, IP_ACTIVE_HIGH )
239   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Difficulty ) )       /* when enemies shoot - code at 0x2216 */
240   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
241   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
242   PORT_DIPUNUSED( 0x04, IP_ACTIVE_HIGH )
243   PORT_DIPUNUSED( 0x08, IP_ACTIVE_HIGH )                  /* no effect due to code at 0x0e0a */
221244   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
222245   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
223246   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
r7356r7357
238261   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
239262   PORT_DIPSETTING(    0x10, DEF_STR( 1C_6C ) )
240263   PORT_DIPSETTING(    0x1c, DEF_STR( Free_Play ) )
241   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )
242   PORT_DIPSETTING(   0x00, "20k and every 70k" )
243   PORT_DIPSETTING(   0x20, "50k and every 100k" )
264   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )       /* code at 0x2383 */
265   PORT_DIPSETTING(   0x00, "20k and 50k" )
266   PORT_DIPSETTING(   0x20, "40k and 70k" )
244267   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )
245268   PORT_DIPSETTING(   0x40, DEF_STR( Upright ) )
246269   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
247   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
248   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
249   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
270   PORT_DIPNAME( 0x80, 0x00, "Reset on Check Error" )
271   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
272   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
250273
251274   PORT_START("IN1")
252275   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
253276   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
254   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
277   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
255278   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
256   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
257   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
258   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
279   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY PORT_COCKTAIL
280   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY
281   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY PORT_COCKTAIL
259282   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
260283
261284   PORT_START("IN2")
r7356r7357
263286   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
264287   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
265288   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
266   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
289   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY
267290   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
268291   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
269   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
292   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
270293INPUT_PORTS_END
271294
272295
src/mame/drivers/toaplan1.c
r7356r7357
21692169   ROM_LOAD( "tp018_11.bpr",  0x20, 0x20, CRC(a1e17492) SHA1(9ddec4c97f2d541f69f3c32c47aaa21fd9699ae2) )   /* ??? */
21702170ROM_END
21712171
2172ROM_START( outzoned )
2173   ROM_REGION( 0x040000, "maincpu", 0 )   /* Main 68K code */
2174   ROM_LOAD16_BYTE( "tp07.bin",  0x000000, 0x20000, CRC(a85a1d48) SHA1(74f16ef5126f0ce3d94a66849ccd7c28338e3974) )
2175   ROM_LOAD16_BYTE( "tp08.bin",  0x000001, 0x20000, CRC(d8cc44af) SHA1(da9c07e3670e5c7a2c1f9bc433e604a2a13b8a54) )
21722176
2177   ROM_REGION( 0x10000, "audiocpu", 0 )   /* Sound Z80 code */
2178   ROM_LOAD( "tp09.bin",  0x0000, 0x8000, CRC(dd56041f) SHA1(a481b8959b349761624166906175f8efcbebb7e7) )
2179
2180   ROM_REGION( 0x100000, "gfx1", 0 )
2181   ROM_LOAD( "rom5.bin",  0x00000, 0x80000, CRC(c64ec7b6) SHA1(e73b51c3713c2ea7a572a02531c15d1261ddeaa0) )
2182   ROM_LOAD( "rom6.bin",  0x80000, 0x80000, CRC(64b6c5ac) SHA1(07fa20115f603445c0d51af3465c0471c09d76b1) )
2183
2184   ROM_REGION( 0x80000, "gfx2", 0 )
2185   ROM_LOAD( "rom2.bin",  0x00000, 0x20000, CRC(6bb72d16) SHA1(a127b10d9c255542bd09fcb5df057c12fd28c0d1) )
2186   ROM_LOAD( "rom1.bin",  0x20000, 0x20000, CRC(0934782d) SHA1(e4a775ead23227d7d6e76aea23aa3103b511d031) )
2187   ROM_LOAD( "rom3.bin",  0x40000, 0x20000, CRC(ec903c07) SHA1(75906f31200877fc8f6e78c2606ad5be49778165) )
2188   ROM_LOAD( "rom4.bin",  0x60000, 0x20000, CRC(50cbf1a8) SHA1(cfab1504746654b4a61912155e9aeca746c65321) )
2189
2190   ROM_REGION( 0x40, "proms", 0 )      /* nibble bproms, lo/hi order to be determined */
2191   ROM_LOAD( "tp018_10.bpr",  0x00, 0x20, CRC(bc88cced) SHA1(5055362710c0f58823c05fb4c0e0eec638b91e3d) )   /* sprite attribute (flip/position) ?? */
2192   ROM_LOAD( "tp018_11.bpr",  0x20, 0x20, CRC(a1e17492) SHA1(9ddec4c97f2d541f69f3c32c47aaa21fd9699ae2) )   /* ??? */
2193ROM_END
2194
21732195ROM_START( vimana )         /* From board serial number 1547.04 (July '94) */
21742196   ROM_REGION( 0x040000, "maincpu", 0 )   /* Main 68K code */
21752197   ROM_LOAD16_BYTE( "tp019-7a.bin",  0x000000, 0x20000, CRC(5a4bf73e) SHA1(9a43d822bc24b59278f294d0b3275595de997d16) )
r7356r7357
22842306GAME( 1990, outzonea, outzone,  outzone,  outzone,  toaplan1, ROT270, "Toaplan", "Out Zone (set 2)", 0 )
22852307GAME( 1990, outzoneb, outzone,  outzone,  outzoneb, toaplan1, ROT270, "Toaplan", "Out Zone (set 3, prototype?)", 0 ) // early revision at least
22862308GAME( 1990, outzonec, outzone,  outzone,  outzonec, toaplan1, ROT270, "Toaplan", "Out Zone (set 4)", 0 )
2309GAME( 1990, outzoned, outzone,  outzone,  outzonec, toaplan1, ROT270, "Toaplan", "Out Zone (set 5)", 0 )
22872310GAME( 1991, vimana,   0,        vimana,   vimana,   vimana,   ROT270, "Toaplan", "Vimana", GAME_NO_SOUND )
22882311GAME( 1991, vimana1,  vimana,   vimana,   vimana,   vimana,   ROT270, "Toaplan", "Vimana (old set)", GAME_NO_SOUND )
22892312GAME( 1991, vimanan,  vimana,   vimana,   vimanan,  vimana,   ROT270, "Toaplan (Nova Apparate GMBH & Co license)", "Vimana (Nova Apparate GMBH & Co)", GAME_NO_SOUND )
src/mame/drivers/igs009.c
r7356r7357
793793ROM_END
794794
795795GAME( 1995?, jingbell, 0, jingbell, jingbell, jingbell, ROT0, "IGS", "Jingle Bell (Italy, V133I)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
796GAME( 1998,  gp98,  0,    gp98, jingbell,        0,    ROT0, "Romtec Co. LTD", "Grand Prix '98",GAME_NOT_WORKING| GAME_NO_SOUND )
796GAME( 1998,  gp98,     0,    gp98, jingbell,        0, ROT0, "Romtec Co. LTD", "Grand Prix '98",GAME_NOT_WORKING| GAME_NO_SOUND )
src/mame/drivers/funkyjet.c
r7356r7357
208208   PORT_DIPSETTING(      0x0000, "4" )
209209INPUT_PORTS_END
210210
211static INPUT_PORTS_START( funkyjej )
211static INPUT_PORTS_START( funkyjetj )
212212   PORT_INCLUDE(funkyjet)
213213
214214   PORT_MODIFY("DSW")
r7356r7357
392392/******************************************************************************/
393393
394394GAME( 1992, funkyjet, 0,        funkyjet, funkyjet, funkyjet, ROT0, "[Data East] (Mitchell license)", "Funky Jet (World)", GAME_SUPPORTS_SAVE )
395GAME( 1992, funkyjetj,funkyjet, funkyjet, funkyjej, funkyjet, ROT0, "Data East Corporation", "Funky Jet (Japan)", GAME_SUPPORTS_SAVE )
395GAME( 1992, funkyjetj,funkyjet, funkyjet, funkyjetj,funkyjet, ROT0, "Data East Corporation", "Funky Jet (Japan)", GAME_SUPPORTS_SAVE )
396396GAME( 1995, sotsugyo, 0,        funkyjet, sotsugyo, funkyjet, ROT0, "Mitchell (Atlus license)", "Sotsugyo Shousho", GAME_SUPPORTS_SAVE )
src/mame/drivers/spiders.c
r7356r7357
811811   ROM_LOAD( "sp11-12.r9",   0x6000, 0x1000, CRC(4d37da5a) SHA1(37567d19596506385e9dcc7a7c0cf65120189ae0) )
812812ROM_END
813813
814ROM_START( spiders3 )
815   ROM_REGION( 0x10000, "maincpu", 0 )
816   ROM_LOAD( "sp-ic74.bin",   0xc000, 0x1000, CRC(ed6b5dcd) SHA1(551fecb9adbab5cb5ac07fb27cc1fcfa03b5e832) )
817   ROM_LOAD( "sp-ic73.bin",   0xd000, 0x1000, CRC(bc04f779) SHA1(a6366461a120d978b27470dad34a2270aee71428) )
818   ROM_LOAD( "sp-ic72.bin",   0xe000, 0x1000, CRC(c7dd097d) SHA1(c7802ac33c1a67ffcb1891e74f0e43483f5b1016) )
819   ROM_LOAD( "sp-ic71.bin",   0xf000, 0x1000, CRC(593b43c4) SHA1(f0cf06a22be205f00a9d52f766c3aae1985f0090) )
814820
821   ROM_REGION( 0x10000, "audiocpu", 0 )
822   ROM_LOAD( "sp-ic3.bin",   0xf800, 0x0800, CRC(153adee7) SHA1(45dbd756adb5d75562b066fc152c0af7925052de) )
815823
824   ROM_REGION( 0x10000, "gfx1", 0 )
825   ROM_LOAD( "sp-ic33.bin",  0x0000, 0x1000, CRC(7209dacd) SHA1(142de81c013f4074a8eaedc5cd7e9498e6910eb9) )
826   ROM_LOAD( "sp-ic25.bin",  0x1000, 0x1000, CRC(d3d06722) SHA1(da510ed162e5c310945123c9ce6d5648c7b0ae48) )
827   ROM_LOAD( "sp-ic24",      0x2000, 0x1000, CRC(a40a5517) SHA1(3f524c7dbbfe8aad7860d15c38d2702732895681) )
828   ROM_LOAD( "sp-ic23",      0x3000, 0x1000, CRC(3ca08053) SHA1(20c5709d9650c426b91aed5318a9ab0a10009f17) )
829   ROM_LOAD( "sp-ic22",      0x4000, 0x1000, CRC(07ea073c) SHA1(2e57831092730db5fbdb97c2d78d8842868906f4) )
830   ROM_LOAD( "sp-ic21",      0x5000, 0x1000, CRC(41b344b4) SHA1(c0eac1e332da1eada062059ae742b666051da76c) )
831   ROM_LOAD( "sp-ic20",      0x6000, 0x1000, CRC(4d37da5a) SHA1(37567d19596506385e9dcc7a7c0cf65120189ae0) )
832ROM_END
833
834
816835/*************************************
817836 *
818837 *  Game drivers
r7356r7357
822841/* this is a newer version with just one bug fix */
823842GAME( 1981, spiders,  0,       spiders, spiders, 0, ROT270, "Sigma Enterprises Inc.", "Spiders (set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
824843GAME( 1981, spiders2, spiders, spiders, spiders, 0, ROT270, "Sigma Enterprises Inc.", "Spiders (set 2)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
844GAME( 1981, spiders3, spiders, spiders, spiders, 0, ROT270, "Sigma Enterprises Inc.", "Spiders (set 3)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
825845GAME( 1981, spinner,  spiders, spiders, spiders, 0, ROT270, "bootleg",              "Spinner", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
src/mame/drivers/subsino.c
r7356r7357
2525  Press START/DEAL (key 2) to exit.
2626
2727
28  * Treasure Island.
29
30  To enter test mode, keep STATS/TEST (key 9) pressed during boot.
31  HOLD3 (key C) to increase the tune/sound number, START (key 2) to decrease it.
32
33  To enter the bookkeeping mode press STATS/TEST (key 9).
34  Press START/TAKE (key 2) to exit.
35
36
2837  * Poker Carnival (crsbingo)
2938
3039  To adjust the game rate, press SETTINGS (key 0) and then use HOLD4 (key V)
r7356r7357
4150  HOLD5 (key B) to select between VOICE <-> MUSIC.
4251  HOLD4 (key V) to increase the tune/sound number, START (key 2) to decrease it.
4352
44  To enter the bookkeeping mode press STATS (key 9).
53  To enter the bookkeeping mode press STATS/TEST (key 9).
4554  Press START/DEAL (key 2) to exit.
4655
4756
r7356r7357
116125  - Added button-lamps layout.
117126
118127
128  2010-02-03
129  ----------
130
131  Treasure Island:
132
133  - Added proper inputs.
134  - Added coin/keyin/keyout/payout counters.
135  - Limited the bet and coin pulses to avoid repeats and coin jams.
136  - Added complete coinage and keyin DIP switches.
137  - Added main game and double-up rates DIP switches.
138  - Added minimum bet DIP switches.
139  - Added maximum bet DIP switches.
140  - Added main game and double-up limit DIP switches.
141  - Added payout mode and auto take DIP switches.
142  - Added DIP locations as seen in the settings mode.
143  - Added demo sounds DIP switch.
144  - Created proper button-lamps layout.
145  - Added technical notes.
146  - Some clean-ups...
147
148
119149***************************************************************************/
120150
121151#include "emu.h"
r7356r7357
129159#include "crsbingo.lh"
130160#include "sharkpy.lh"
131161#include "smoto.lh"
162#include "tisub.lh"
132163
133164/***************************************************************************
134165*                              Video Hardware                              *
r7356r7357
137168static UINT8 *videoram;
138169static UINT8 *colorram;
139170static tilemap_t *tmap;
171static tilemap_t *reel1_tilemap, *reel2_tilemap, *reel3_tilemap;
140172static int tiles_offset;
173static UINT8* reel1_ram;
174static UINT8* reel2_ram;
175static UINT8* reel3_ram;
176static UINT8* reel1_scroll;
177static UINT8* reel2_scroll;
178static UINT8* reel3_scroll;
141179
180
142181static WRITE8_HANDLER( subsino_tiles_offset_w )
143182{
144183   tiles_offset = (data & 1) ? 0x1000: 0;
r7356r7357
167206   SET_TILE_INFO(0, code, color, 0);
168207}
169208
209
210
170211static VIDEO_START( subsino )
171212{
172213   tmap = tilemap_create(   machine, get_tile_info, tilemap_scan_rows, 8,8, 0x40,0x20 );
r7356r7357
174215   tiles_offset = 0;
175216}
176217
218
219
220WRITE8_HANDLER( subsino_reel1_ram_w )
221{
222   reel1_ram[offset] = data;
223   tilemap_mark_tile_dirty(reel1_tilemap,offset);
224}
225
226static TILE_GET_INFO( get_subsino_reel1_tile_info )
227{
228   int code = reel1_ram[tile_index];
229
230   SET_TILE_INFO(
231         1,
232         code,
233         0,
234         0);
235}
236
237
238WRITE8_HANDLER( subsino_reel2_ram_w )
239{
240   reel2_ram[offset] = data;
241   tilemap_mark_tile_dirty(reel2_tilemap,offset);
242}
243
244static TILE_GET_INFO( get_subsino_reel2_tile_info )
245{
246   int code = reel2_ram[tile_index];
247
248   SET_TILE_INFO(
249         1,
250         code,
251         0,
252         0);
253}
254
255WRITE8_HANDLER( subsino_reel3_ram_w )
256{
257   reel3_ram[offset] = data;
258   tilemap_mark_tile_dirty(reel3_tilemap,offset);
259}
260
261static TILE_GET_INFO( get_subsino_reel3_tile_info )
262{
263   int code = reel3_ram[tile_index];
264
265   SET_TILE_INFO(
266         1,
267         code,
268         0,
269         0);
270}
271
272
273
274static VIDEO_START( subsino_reels )
275{
276   VIDEO_START_CALL( subsino );
277
278   reel1_tilemap = tilemap_create(machine,get_subsino_reel1_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
279   reel2_tilemap = tilemap_create(machine,get_subsino_reel2_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
280   reel3_tilemap = tilemap_create(machine,get_subsino_reel3_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
281
282   tilemap_set_scroll_cols(reel1_tilemap, 64);
283   tilemap_set_scroll_cols(reel2_tilemap, 64);
284   tilemap_set_scroll_cols(reel3_tilemap, 64);
285
286}
287
177288static VIDEO_UPDATE( subsino )
178289{
179290   bitmap_fill(bitmap,cliprect,0);
r7356r7357
181292   return 0;
182293}
183294
295// are these hardcoded, or registers?
296static const rectangle visible1 = { 0*8, (14+48)*8-1,  4*8,  (4+7)*8-1 };
297static const rectangle visible2 = { 0*8, (14+48)*8-1, 10*8, (10+7)*8-1 };
298static const rectangle visible3 = { 0*8, (14+48)*8-1, 18*8, (18+7)*8-1 };
299
300static VIDEO_UPDATE( subsino_reels )
301{
302   int i;
303   bitmap_fill(bitmap,cliprect,0);
304
305   for (i= 0;i < 64;i++)
306   {
307      tilemap_set_scrolly(reel1_tilemap, i, reel1_scroll[i]);
308      tilemap_set_scrolly(reel2_tilemap, i, reel2_scroll[i]);
309      tilemap_set_scrolly(reel3_tilemap, i, reel3_scroll[i]);
310   }
311
312   tilemap_draw(bitmap, &visible1, reel1_tilemap, 0, 0);
313   tilemap_draw(bitmap, &visible2, reel2_tilemap, 0, 0);
314   tilemap_draw(bitmap, &visible3, reel3_tilemap, 0, 0);
315
316   tilemap_draw(bitmap,cliprect, tmap, 0, 0);
317   return 0;
318}
319
184320static PALETTE_INIT( subsino_2proms )
185321{
186322   int i,r,g,b,val;
r7356r7357
253389  --x- ----  Payout pulse.
254390
255391
392  * Treasure Island.
393
394  7654 3210
395  ---- ---x  Key In pulse.
396  ---- --x-  Coin pulse.
397  ---x ----  Key Out pulse.
398  --x- ----  Payout pulse.
399
400
256401  * Super Rider, Super Moto, Shark Party.
257402
258403  7654 3210
r7356r7357
269414   output_set_lamp_value(14, (data >> 6) & 1);   /* Lamp 14 */
270415   output_set_lamp_value(15, (data >> 7) & 1);   /* Lamp 15 */
271416
272   coin_counter_w( space->machine, 0, data & 0x01 );   /* Coin1 */
273   coin_counter_w( space->machine, 1, data & 0x02 );   /* keyin */
417   coin_counter_w( space->machine, 0, data & 0x01 );   /* coin / keyin */
418   coin_counter_w( space->machine, 1, data & 0x02 );   /* keyin / coin */
274419   coin_counter_w( space->machine, 2, data & 0x10 );   /* keyout */
275420   coin_counter_w( space->machine, 3, data & 0x20 );   /* payout */
276421
r7356r7357
308453  x--- ----  GAME OVER?.
309454
310455
456  * Treasure Island.
457
458  7654 3210
459  ---- ---x  HOLD1.
460  ---- --x-  HOLD2 / BIG.
461  ---- -x--  ???.
462  ---- x---  BET.
463  ---x ----  DOUBLE / INFO.
464  --x- ----  START / TAKE.
465  -x-- ----  HOLD3 / SMALL.
466  x--- ----  ???.
467
468
311469  * Poker Carnival (crsbingo).
312470
313471  7654 3210
r7356r7357
370528
371529   AM_RANGE( 0x0c000, 0x0cfff ) AM_RAM
372530
373   AM_RANGE( 0x0d000, 0x0d000 ) AM_READ_PORT( "DSW1" )
374   AM_RANGE( 0x0d001, 0x0d001 ) AM_READ_PORT( "DSW2" )
375   AM_RANGE( 0x0d002, 0x0d002 ) AM_READ_PORT( "DSW3" )
531   AM_RANGE( 0x0d000, 0x0d000 ) AM_READ_PORT( "SW1" )
532   AM_RANGE( 0x0d001, 0x0d001 ) AM_READ_PORT( "SW2" )
533   AM_RANGE( 0x0d002, 0x0d002 ) AM_READ_PORT( "SW3" )
376534
377   AM_RANGE( 0x0d004, 0x0d004 ) AM_READ_PORT( "DSW4" )
535   AM_RANGE( 0x0d004, 0x0d004 ) AM_READ_PORT( "SW4" )
378536   AM_RANGE( 0x0d005, 0x0d005 ) AM_READ_PORT( "INA" )
379537   AM_RANGE( 0x0d006, 0x0d006 ) AM_READ_PORT( "INB" )
380538
r7356r7357
397555static ADDRESS_MAP_START( sharkpy_map, ADDRESS_SPACE_PROGRAM, 8 )
398556   AM_RANGE( 0x09800, 0x09fff ) AM_RAM
399557
400   AM_RANGE( 0x09000, 0x09000 ) AM_READ_PORT( "DSW1" )
401   AM_RANGE( 0x09001, 0x09001 ) AM_READ_PORT( "DSW2" )
402   AM_RANGE( 0x09002, 0x09002 ) AM_READ_PORT( "DSW3" )
558   AM_RANGE( 0x09000, 0x09000 ) AM_READ_PORT( "SW1" )
559   AM_RANGE( 0x09001, 0x09001 ) AM_READ_PORT( "SW2" )
560   AM_RANGE( 0x09002, 0x09002 ) AM_READ_PORT( "SW3" )
403561
404   AM_RANGE( 0x09004, 0x09004 ) AM_READ_PORT( "DSW4" )
562   AM_RANGE( 0x09004, 0x09004 ) AM_READ_PORT( "SW4" )
405563   AM_RANGE( 0x09005, 0x09005 ) AM_READ_PORT( "INA" )
406564   AM_RANGE( 0x09006, 0x09006 ) AM_READ_PORT( "INB" )
407565
r7356r7357
438596   AM_RANGE( 0x09004, 0x09004 ) AM_READ_PORT( "INA" )
439597   AM_RANGE( 0x09005, 0x09005 ) AM_READ_PORT( "INB" )
440598
441   AM_RANGE( 0x09006, 0x09006 ) AM_READ_PORT( "DSW1" )
442   AM_RANGE( 0x09007, 0x09007 ) AM_READ_PORT( "DSW2" )
443   AM_RANGE( 0x09008, 0x09008 ) AM_READ_PORT( "DSW3" )
599   AM_RANGE( 0x09006, 0x09006 ) AM_READ_PORT( "SW1" )
600   AM_RANGE( 0x09007, 0x09007 ) AM_READ_PORT( "SW2" )
601   AM_RANGE( 0x09008, 0x09008 ) AM_READ_PORT( "SW3" )
444602
445603   AM_RANGE( 0x0900b, 0x0900b ) AM_RAM //protection
446604
r7356r7357
527685static ADDRESS_MAP_START( crsbingo_map, ADDRESS_SPACE_PROGRAM, 8 )
528686   AM_RANGE( 0x09800, 0x09fff ) AM_RAM
529687
530   AM_RANGE( 0x09000, 0x09000 ) AM_READ_PORT( "DSW1" )
531   AM_RANGE( 0x09001, 0x09001 ) AM_READ_PORT( "DSW2" )
688   AM_RANGE( 0x09000, 0x09000 ) AM_READ_PORT( "SW1" )
689   AM_RANGE( 0x09001, 0x09001 ) AM_READ_PORT( "SW2" )
532690   AM_RANGE( 0x09002, 0x09002 ) AM_READ_PORT( "INA" )
533691   AM_RANGE( 0x09003, 0x09003 ) AM_READ_PORT( "INB" )
534692   AM_RANGE( 0x09004, 0x09004 ) AM_READ_PORT( "INC" )
535693   AM_RANGE( 0x09005, 0x09005 ) AM_WRITE( subsino_out_a_w )
536694
537   AM_RANGE( 0x09008, 0x09008 ) AM_READ_PORT( "DSW4" )
538   AM_RANGE( 0x09009, 0x09009 ) AM_READ_PORT( "DSW3" )   // AM_WRITE( subsino_out_a_w )
695   AM_RANGE( 0x09008, 0x09008 ) AM_READ_PORT( "SW4" )
696   AM_RANGE( 0x09009, 0x09009 ) AM_READ_PORT( "SW3" )   // AM_WRITE( subsino_out_a_w )
539697   AM_RANGE( 0x0900a, 0x0900a ) AM_READWRITE( hwcheck_r, subsino_out_b_w )
540698
541699   AM_RANGE( 0x09010, 0x09010 ) AM_READWRITE( flash_r, flash_w )
r7356r7357
557715
558716ADDRESS_MAP_END
559717
718static ADDRESS_MAP_START( tisub_map, ADDRESS_SPACE_PROGRAM, 8 )
719   AM_RANGE( 0x09800, 0x09fff ) AM_RAM
560720
721   AM_RANGE( 0x09000, 0x09000 ) AM_READ_PORT( "SW1" )
722   AM_RANGE( 0x09001, 0x09001 ) AM_READ_PORT( "SW2" )
723   AM_RANGE( 0x09002, 0x09002 ) AM_READ_PORT( "SW3" )
724
725   AM_RANGE( 0x09004, 0x09004 ) AM_READ_PORT( "SW4" )
726   AM_RANGE( 0x09005, 0x09005 ) AM_READ_PORT( "INA" )
727   AM_RANGE( 0x09006, 0x09006 ) AM_READ_PORT( "INB" )
728
729   /* 0x09008: is marked as OUTPUT C in the test mode. */
730   AM_RANGE( 0x09009, 0x09009 ) AM_WRITE( subsino_out_b_w )
731   AM_RANGE( 0x0900a, 0x0900a ) AM_WRITE( subsino_out_a_w )
732
733   AM_RANGE( 0x0900c, 0x0900c ) AM_READ_PORT( "INC" )
734
735   AM_RANGE( 0x09016, 0x09017 ) AM_DEVWRITE( "ymsnd", ym3812_w )
736
737//  AM_RANGE( 0x0900c, 0x0900c ) AM_DEVWRITE( "oki", okim6295_w )
738
739   AM_RANGE( 0x0901b, 0x0901b ) AM_WRITE( subsino_tiles_offset_w )
740
741   AM_RANGE( 0x07800, 0x07fff ) AM_RAM
742   AM_RANGE( 0x08800, 0x08fff ) AM_RAM_WRITE( subsino_videoram_w ) AM_BASE( &videoram )
743   AM_RANGE( 0x08000, 0x087ff ) AM_RAM_WRITE( subsino_colorram_w ) AM_BASE( &colorram )
744
745   AM_RANGE( 0x00000, 0x0bfff ) AM_ROM // overlap unmapped regions
746   AM_RANGE( 0x10000, 0x13fff ) AM_ROM
747   AM_RANGE( 0x14000, 0x14fff ) AM_ROM // reads the card face data here (see rom copy in rom loading)
748
749   AM_RANGE( 0x150c0, 0x150ff ) AM_RAM AM_BASE(&reel3_scroll)
750   AM_RANGE( 0x15140, 0x1517f ) AM_RAM AM_BASE(&reel2_scroll)
751   AM_RANGE( 0x15180, 0x151bf ) AM_RAM AM_BASE(&reel1_scroll)
752
753   AM_RANGE( 0x15800, 0x159ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_BASE(&reel1_ram)
754   AM_RANGE( 0x15a00, 0x15bff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_BASE(&reel2_ram)
755   AM_RANGE( 0x15c00, 0x15dff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_BASE(&reel3_ram)
756ADDRESS_MAP_END
757
561758static ADDRESS_MAP_START( subsino_iomap, ADDRESS_SPACE_IO, 8 )
562759   AM_RANGE( 0x0000, 0x003f ) AM_RAM // internal regs
563760ADDRESS_MAP_END
r7356r7357
568765
569766static INPUT_PORTS_START( victor21 )
570767
571   PORT_START( "DSW1" )
768   PORT_START( "SW1" )
572769   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
573770   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
574771   PORT_DIPSETTING(    0x05, DEF_STR( 1C_2C ) )
r7356r7357
594791   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
595792   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
596793
597   PORT_START( "DSW2" )
794   PORT_START( "SW2" )
598795   PORT_DIPNAME( 0x03, 0x03, "Main Game Rate" )
599796   PORT_DIPSETTING(    0x00, "75%" )
600797   PORT_DIPSETTING(    0x01, "80%" )
r7356r7357
611808   PORT_DIPNAME( 0x20, 0x20, "Attract Music" )
612809   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
613810   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
614   PORT_DIPNAME( 0x40, 0x40, "DSW2 - 40" )
811   PORT_DIPNAME( 0x40, 0x40, "SW2 - 40" )
615812   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
616813   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
617814   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
618815   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
619816   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
620817
621   PORT_START( "DSW3" )
622   PORT_DIPNAME( 0x01, 0x01, "DSW3" )
818   PORT_START( "SW3" )
819   PORT_DIPNAME( 0x01, 0x01, "SW3" )
623820   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
624821   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
625822   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
r7356r7357
678875
679876static INPUT_PORTS_START( victor5 )
680877
681   PORT_START( "DSW1" )
878   PORT_START( "SW1" )
682879   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
683880   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
684881   PORT_DIPSETTING(    0x05, DEF_STR( 1C_2C ) )
r7356r7357
703900   PORT_DIPSETTING(    0xc0, "50" )
704901   PORT_DIPSETTING(    0x00, "80" )
705902
706   PORT_START( "DSW2" )
903   PORT_START( "SW2" )
707904   PORT_DIPNAME( 0x03, 0x03, "Main Game Rate" )
708905   PORT_DIPSETTING(    0x00, "68%" )
709906   PORT_DIPSETTING(    0x01, "76%" )
r7356r7357
726923   PORT_DIPSETTING(    0xc0, "10" )
727924   PORT_DIPSETTING(    0x00, "20" )
728925
729   PORT_START( "DSW3" )
730   PORT_DIPNAME( 0x01, 0x01, "DSW3" )
926   PORT_START( "SW3" )
927   PORT_DIPNAME( 0x01, 0x01, "SW3" )
731928   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
732929   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
733930   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
r7356r7357
784981INPUT_PORTS_END
785982
786983
984static INPUT_PORTS_START( tisub )
985
986   PORT_START( "SW1" )
987   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW1:1,2,3")   // SW1-123
988   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
989   PORT_DIPSETTING(    0x05, DEF_STR( 1C_2C ) )
990   PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
991   PORT_DIPSETTING(    0x07, "1 Coin / 10 Credits" )
992   PORT_DIPSETTING(    0x03, "1 Coin / 20 Credits" )
993   PORT_DIPSETTING(    0x02, "1 Coin / 25 Credits" )
994   PORT_DIPSETTING(    0x01, "1 Coin / 50 Credits" )
995   PORT_DIPSETTING(    0x00, "1 Coin / 100 Credits" )
996   PORT_DIPNAME( 0x38, 0x38, "Key In" )            PORT_DIPLOCATION("SW1:4,5,6")   // SW1-456
997   PORT_DIPSETTING(    0x30, "4 Points/Pulse" )
998   PORT_DIPSETTING(    0x28, "8 Points/Pulse" )
999   PORT_DIPSETTING(    0x20, "20 Points/Pulse" )
1000   PORT_DIPSETTING(    0x38, "40 Points/Pulse" )
1001   PORT_DIPSETTING(    0x18, "80 Points/Pulse" )
1002   PORT_DIPSETTING(    0x10, "100 Points/Pulse" )
1003   PORT_DIPSETTING(    0x08, "200 Points/Pulse" )
1004   PORT_DIPSETTING(    0x00, "400 Points/Pulse" )
1005   PORT_DIPNAME( 0x40, 0x40, "Payout Mode" )         PORT_DIPLOCATION("SW1:7")   // SW1-7
1006   PORT_DIPSETTING(    0x40, "Coin Value" )
1007   PORT_DIPSETTING(    0x00, "Key In Value" )
1008   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW1:8")
1009   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1010   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1011
1012   PORT_START( "SW2" )
1013   PORT_DIPNAME( 0x03, 0x03, "Minimum Bet" )         PORT_DIPLOCATION("SW2:1,2")   // SW2-12
1014   PORT_DIPSETTING(    0x03, "1" )
1015   PORT_DIPSETTING(    0x02, "8" )
1016   PORT_DIPSETTING(    0x01, "16" )
1017   PORT_DIPSETTING(    0x00, "32" )
1018   PORT_DIPNAME( 0x0c, 0x08, "Max Bet" )            PORT_DIPLOCATION("SW2:3,4")   // SW2-34
1019   PORT_DIPSETTING(    0x0c, "2" )
1020   PORT_DIPSETTING(    0x00, "8" )
1021   PORT_DIPSETTING(    0x04, "16" )
1022   PORT_DIPSETTING(    0x08, "32" )
1023   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW2:5")   // Not in test mode.
1024   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1025   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1026   PORT_DIPNAME( 0x20, 0x20, "Game Limit" )         PORT_DIPLOCATION("SW2:6")   // SW2-6
1027   PORT_DIPSETTING(    0x20, "20000" )
1028   PORT_DIPSETTING(    0x00, "30000" )
1029   PORT_DIPNAME( 0x40, 0x40, "Auto Take" )            PORT_DIPLOCATION("SW2:7")   // SW2-7
1030   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1031   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1032   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW2:8")
1033   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1034   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1035
1036   PORT_START( "SW3" )
1037   PORT_DIPNAME( 0x07, 0x07, "Main Game Rate" )      PORT_DIPLOCATION("SW3:1,2,3")   // SW3-123
1038   PORT_DIPSETTING(    0x00, "77%" )
1039   PORT_DIPSETTING(    0x01, "80%" )
1040   PORT_DIPSETTING(    0x02, "83%" )
1041   PORT_DIPSETTING(    0x03, "86%" )
1042   PORT_DIPSETTING(    0x04, "89%" )
1043   PORT_DIPSETTING(    0x07, "92%" )
1044   PORT_DIPSETTING(    0x05, "95%" )
1045   PORT_DIPSETTING(    0x06, "98%" )
1046   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW3:4")
1047   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1048   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1049   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW3:5")
1050   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1051   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1052   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW3:6")
1053   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1054   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1055   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW3:7")
1056   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1057   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1058   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW3:8")
1059   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1060   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1061
1062   PORT_START( "SW4" )
1063   PORT_DIPNAME( 0x07, 0x07, "Double-Up Rate" )      PORT_DIPLOCATION("SW4:1,2,3")   // SW4-123
1064   PORT_DIPSETTING(    0x00, "70%" )
1065   PORT_DIPSETTING(    0x01, "74%" )
1066   PORT_DIPSETTING(    0x02, "78%" )
1067   PORT_DIPSETTING(    0x03, "82%" )
1068   PORT_DIPSETTING(    0x04, "86%" )
1069   PORT_DIPSETTING(    0x07, "90%" )
1070   PORT_DIPSETTING(    0x05, "94%" )
1071   PORT_DIPSETTING(    0x06, "98%" )
1072   PORT_DIPNAME( 0x08, 0x08, "Double-Up Limit" )      PORT_DIPLOCATION("SW4:4")   // SW4-4
1073   PORT_DIPSETTING(    0x08, "5000" )
1074   PORT_DIPSETTING(    0x00, "10000" )
1075   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW4:5")
1076   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1077   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1078   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW4:6")
1079   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1080   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1081   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW4:7")
1082   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1083   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1084   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW4:8")
1085   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1086   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1087
1088   PORT_START( "INA" )
1089   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP )   PORT_NAME("Double / Info")
1090   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )   PORT_NAME("Hold 1")
1091   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD2 )   PORT_NAME("Hold 2 / Big")
1092   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD3 )   PORT_NAME("Hold 3 / Small")
1093   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1094   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL )   PORT_NAME("Start / Take")
1095   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_BET )      PORT_IMPULSE(3)
1096   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1097
1098   PORT_START( "INB" )
1099   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )         PORT_IMPULSE(3)   // coin
1100   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN )   // key in
1101   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1102   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1103   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )      PORT_CODE(KEYCODE_9)   PORT_NAME("Stats / Test")   // Bookkeeping.
1104   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE )      PORT_CODE(KEYCODE_0)   PORT_NAME("Settings")      // Current settings.
1105   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )   // payout
1106   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )   // key out
1107
1108   PORT_START( "INC" )
1109   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1110   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1111   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE )      PORT_CODE(KEYCODE_R)   PORT_NAME("Reset")   // hard reset
1112   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1113   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1114   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1115   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1116   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1117INPUT_PORTS_END
1118
1119
7871120static INPUT_PORTS_START( crsbingo )
7881121
789   PORT_START( "DSW1" )
1122   PORT_START( "SW1" )
7901123   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
7911124   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
7921125   PORT_DIPSETTING(    0x05, DEF_STR( 1C_2C ) )
r7356r7357
8121145   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
8131146   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
8141147
815   PORT_START( "DSW2" )
1148   PORT_START( "SW2" )
8161149   PORT_DIPNAME( 0x03, 0x03, "Minimum Bet" )
8171150   PORT_DIPSETTING(    0x02, "1" )
8181151   PORT_DIPSETTING(    0x01, "5" )
r7356r7357
8351168   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
8361169   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
8371170
838   PORT_START( "DSW3" )
839   PORT_DIPNAME( 0x01, 0x01, "DSW3" )
1171   PORT_START( "SW3" )
1172   PORT_DIPNAME( 0x01, 0x01, "SW3" )
8401173   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
8411174   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
8421175   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
r7356r7357
8611194   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
8621195   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
8631196
864   PORT_START( "DSW4" )
1197   PORT_START( "SW4" )
8651198   PORT_DIPNAME( 0x07, 0x07, "Double-Up Rate" )
8661199   PORT_DIPSETTING(    0x00, "70%" )
8671200   PORT_DIPSETTING(    0x01, "74%" )
r7356r7357
9021235   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN )   // key in
9031236   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
9041237   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
905   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )      PORT_CODE(KEYCODE_9)   PORT_NAME("Stats")   // Bookkeeping.
1238   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )      PORT_CODE(KEYCODE_9)   PORT_NAME("Stats")      // Bookkeeping.
9061239   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE )      PORT_CODE(KEYCODE_0)   PORT_NAME("Settings")   // Game Rate & others.
9071240   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )   // payout
9081241   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )   // key out
r7356r7357
9211254
9221255static INPUT_PORTS_START( sharkpy )
9231256
924   PORT_START( "DSW1" )
1257   PORT_START( "SW1" )
9251258   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) )
9261259   PORT_DIPSETTING(    0x01, "1 Coin / 10 Credits" )
9271260   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
r7356r7357
9331266   PORT_DIPUNKNOWN( 0x40, 0x40 )
9341267   PORT_DIPUNKNOWN( 0x80, 0x80 )
9351268
936   PORT_START( "DSW2" )
1269   PORT_START( "SW2" )
9371270   PORT_DIPUNKNOWN( 0x01, 0x01 )
9381271   PORT_DIPUNKNOWN( 0x02, 0x02 )
9391272   PORT_DIPUNKNOWN( 0x04, 0x04 )
r7356r7357
9471280   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
9481281   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
9491282
950   PORT_START( "DSW3" )
1283   PORT_START( "SW3" )
9511284   PORT_DIPNAME( 0x07, 0x07, "Main Game Rate" )
9521285   PORT_DIPSETTING(    0x00, "55%" )
9531286   PORT_DIPSETTING(    0x01, "60%" )
r7356r7357
9691302   PORT_DIPUNKNOWN( 0x40, 0x40 )
9701303   PORT_DIPUNKNOWN( 0x80, 0x80 )
9711304
972   PORT_START( "DSW4" )
1305   PORT_START( "SW4" )
9731306   PORT_DIPUNKNOWN( 0x01, 0x01 )
9741307   PORT_DIPUNKNOWN( 0x02, 0x02 )
9751308   PORT_DIPUNKNOWN( 0x04, 0x04 )
r7356r7357
10131346
10141347static INPUT_PORTS_START( smoto16 )
10151348
1016   PORT_START( "DSW1" )
1349   PORT_START( "SW1" )
10171350   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) )
10181351   PORT_DIPSETTING(    0x01, "1 Coin / 10 Credits" )
10191352   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
r7356r7357
10251358   PORT_DIPUNKNOWN( 0x40, 0x40 )
10261359   PORT_DIPUNKNOWN( 0x80, 0x80 )
10271360
1028   PORT_START( "DSW2" )
1361   PORT_START( "SW2" )
10291362   PORT_DIPUNKNOWN( 0x01, 0x01 )
10301363   PORT_DIPUNKNOWN( 0x02, 0x02 )
10311364   PORT_DIPUNKNOWN( 0x04, 0x04 )
r7356r7357
10391372   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
10401373   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
10411374
1042   PORT_START( "DSW3" )
1375   PORT_START( "SW3" )
10431376   PORT_DIPNAME( 0x07, 0x07, "Main Game Rate" )
10441377   PORT_DIPSETTING(    0x00, "55%" )
10451378   PORT_DIPSETTING(    0x01, "60%" )
r7356r7357
10611394   PORT_DIPUNKNOWN( 0x40, 0x40 )
10621395   PORT_DIPUNKNOWN( 0x80, 0x80 )
10631396
1064   PORT_START( "DSW4" )
1397   PORT_START( "SW4" )
10651398   PORT_DIPUNKNOWN( 0x01, 0x01 )
10661399   PORT_DIPUNKNOWN( 0x02, 0x02 )
10671400   PORT_DIPUNKNOWN( 0x04, 0x04 )
r7356r7357
11071440
11081441static INPUT_PORTS_START( smoto20 )
11091442
1110   PORT_START( "DSW1" )
1443   PORT_START( "SW1" )
11111444   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) )
11121445   PORT_DIPSETTING(    0x01, "1 Coin / 10 Credits" )
11131446   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
r7356r7357
11191452   PORT_DIPUNKNOWN( 0x40, 0x40 )
11201453   PORT_DIPUNKNOWN( 0x80, 0x80 )
11211454
1122   PORT_START( "DSW2" )
1455   PORT_START( "SW2" )
11231456   PORT_DIPUNKNOWN( 0x01, 0x01 )
11241457   PORT_DIPUNKNOWN( 0x02, 0x02 )
11251458   PORT_DIPUNKNOWN( 0x04, 0x04 )
r7356r7357
11331466   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
11341467   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
11351468
1136   PORT_START( "DSW3" )
1469   PORT_START( "SW3" )
11371470   PORT_DIPNAME( 0x07, 0x07, "Main Game Rate" )
11381471   PORT_DIPSETTING(    0x00, "25%" )
11391472   PORT_DIPSETTING(    0x01, "30%" )
r7356r7357
11551488   PORT_DIPUNKNOWN( 0x40, 0x40 )
11561489   PORT_DIPUNKNOWN( 0x80, 0x80 )
11571490
1158   PORT_START( "DSW4" )
1491   PORT_START( "SW4" )
11591492   PORT_DIPUNKNOWN( 0x01, 0x01 )
11601493   PORT_DIPUNKNOWN( 0x02, 0x02 )
11611494   PORT_DIPUNKNOWN( 0x04, 0x04 )
r7356r7357
12251558   8*8
12261559};
12271560
1561static const gfx_layout layout_8x32x4 =
1562{
1563   8, 32,
1564   RGN_FRAC(1, 4),
1565   4,
1566   { RGN_FRAC(2,4), RGN_FRAC(3,4), RGN_FRAC(0,4), RGN_FRAC(1,4) },
1567   { STEP8(0,1) },
1568   { STEP32(0,8) },
1569   8*8*4
1570};
1571
1572
12281573static GFXDECODE_START( subsino_depth3 )
12291574   GFXDECODE_ENTRY( "tilemap", 0, layout_8x8x3, 0, 16 )
12301575GFXDECODE_END
r7356r7357
12331578   GFXDECODE_ENTRY( "tilemap", 0, layout_8x8x4, 0, 16 )
12341579GFXDECODE_END
12351580
1581static GFXDECODE_START( subsino_depth4_reels )
1582   GFXDECODE_ENTRY( "tilemap", 0, layout_8x8x4, 0, 16 )
1583   GFXDECODE_ENTRY( "reels", 0, layout_8x32x4, 0, 16 )
1584GFXDECODE_END
12361585
12371586/***************************************************************************
12381587*                             Machine Drivers                              *
r7356r7357
13531702   MDRV_CPU_PROGRAM_MAP(sharkpy_map)
13541703MACHINE_DRIVER_END
13551704
1705static MACHINE_DRIVER_START( tisub )
1706   /* basic machine hardware */
1707   MDRV_CPU_ADD("maincpu", Z180, XTAL_12MHz / 8)   /* Unknown CPU and clock */
1708   MDRV_CPU_PROGRAM_MAP(tisub_map)
1709   MDRV_CPU_IO_MAP(subsino_iomap)
13561710
1711   /* video hardware */
1712   MDRV_SCREEN_ADD("screen", RASTER)
1713   MDRV_SCREEN_REFRESH_RATE(60)
1714   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1715   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1716   MDRV_SCREEN_SIZE(512, 256)
1717   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0+16, 256-16-1)
1718
1719   MDRV_GFXDECODE(subsino_depth4_reels)
1720
1721   MDRV_PALETTE_LENGTH(0x100)
1722   MDRV_PALETTE_INIT(subsino_3proms)
1723
1724   MDRV_VIDEO_START(subsino_reels)
1725   MDRV_VIDEO_UPDATE(subsino_reels)
1726
1727   /* sound hardware */
1728   MDRV_SPEAKER_STANDARD_MONO("mono")
1729
1730   MDRV_SOUND_ADD("ymsnd", YM3812, XTAL_3_579545MHz)   /* Unknown clock */
1731   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1732MACHINE_DRIVER_END
1733
1734
13571735/***************************************************************************
13581736*                               ROMs Loading                               *
13591737***************************************************************************/
r7356r7357
14671845
14681846/***************************************************************************
14691847
1848  Treasure Island
1849  -- this has an extra layer for the reels, exactly the same as goldstar.c
1850
1851***************************************************************************/
1852
1853ROM_START( tisub )
1854   ROM_REGION( 0x18000, "maincpu", 0 )
1855   ROM_LOAD( "rom_1.bin", 0x10000, 0x4000,  CRC(ed3b4a69) SHA1(c57985e8d19b2b495fc768e52b83cbbd75f027ad) )
1856   ROM_CONTINUE(0x0000,0xc000)
1857   ROM_COPY( "maincpu", 0x09000, 0x14000, 0x1000)
1858
1859   ROM_REGION( 0x40000, "tilemap", 0 )
1860   ROM_LOAD( "rom_4.bin", 0x00000, 0x10000, CRC(37724fda) SHA1(084653662c9f77afef2a77c607e1fb093aaf3adf) )
1861   ROM_LOAD( "rom_5.bin", 0x10000, 0x10000, CRC(3d18acd8) SHA1(179545c18ad880097366c07c8e2fa821701a2758) )
1862   ROM_LOAD( "rom_6.bin", 0x20000, 0x10000, CRC(c2c226df) SHA1(39762b390d6b271c3252342e843a181dd152a0cc) )
1863   ROM_LOAD( "rom_7.bin", 0x30000, 0x10000, CRC(9d7d99d8) SHA1(a3df5e023c2102028a5186101dc0b19d91e8965e) )
1864
1865   ROM_REGION( 0x8000, "reels", 0 )
1866   ROM_LOAD( "rom_2.bin", 0x0000, 0x4000, CRC(836c756d) SHA1(fca1d5b600861eea30ed73ee13be735e7d167097) )
1867   ROM_IGNORE(0x4000)
1868   ROM_LOAD( "rom_3.bin", 0x4000, 0x4000, CRC(2ad82222) SHA1(68780b9528393b28eaa2f90501efb5a8c39bed63) )
1869   ROM_IGNORE(0x4000)
1870
1871   ROM_REGION( 0x300, "proms", 0 )
1872   ROM_LOAD( "n82s129n.u39", 0x000, 0x100, NO_DUMP )
1873   ROM_LOAD( "n82s129n.u40", 0x100, 0x100, NO_DUMP )
1874   ROM_LOAD( "n82s129n.u41", 0x200, 0x100, NO_DUMP )
1875ROM_END
1876
1877/***************************************************************************
1878
14701879Cross Bingo
14711880(C)1991 Subsino
14721881
r7356r7357
19402349   rom[0x12e1] = 0x20;   // "ERROR 951010"
19412350}
19422351
2352static DRIVER_INIT( tisub )
2353{
2354   UINT8 *rom = memory_region( machine, "maincpu" );
19432355
2356   DRIVER_INIT_CALL(victor5);
2357
2358   /* this trips a z180 MMU core bug? It unmaps a region then the program code jumps to that region... */
2359   rom[0x64c8] = 0x00;
2360   rom[0x64c9] = 0x00;
2361   rom[0x64ca] = 0x00;
2362   rom[0x64cd] = 0x00;
2363   rom[0x64ce] = 0x00;
2364   rom[0x64cf] = 0x00;
2365}
2366
2367
19442368/***************************************************************************
19452369*                               Game Drivers                               *
19462370***************************************************************************/
19472371
1948/*     YEAR  NAME      PARENT    MACHINE   INPUT     INIT      ROT    COMPANY            FULLNAME                    FLAGS  LAYOUT      */
1949GAMEL( 1990, victor21, 0,        victor21, victor21, victor21, ROT0, "Subsino / Buffy", "Victor 21",                 0,     layout_victor21 )
1950GAMEL( 1991, victor5,  0,        victor5,  victor5,  victor5,  ROT0, "Subsino",         "Victor 5",                  0,     layout_victor5 ) // board sticker says Victor 5, in-game says G.E.A with no manufacturer info?
1951GAMEL( 1991, crsbingo, 0,        crsbingo, crsbingo, crsbingo, ROT0, "Subsino",         "Poker Carnival",            0,     layout_crsbingo ) // alt version of Cross Bingo?
1952GAMEL( 1996, sharkpy,  0,        sharkpy,  sharkpy,  sharkpy,  ROT0, "Subsino",         "Shark Party (Italy, v1.3)", 0,     layout_sharkpy ) // missing POST messages?
1953GAMEL( 1996, sharkpya, sharkpy,  sharkpy,  sharkpy,  sharkpy,  ROT0, "Subsino",         "Shark Party (Italy, v1.6)", 0,     layout_sharkpy ) // missing POST messages?
1954GAMEL( 1996, smoto20,  0,        srider,   smoto20,  smoto20,  ROT0, "Subsino",         "Super Rider (Italy, v2.0)", 0,     layout_smoto )
1955GAMEL( 1996, smoto16,  smoto20,  srider,   smoto16,  smoto16,  ROT0, "Subsino",         "Super Moto (Italy, v1.6)",  0,     layout_smoto )
2372/*     YEAR  NAME      PARENT    MACHINE   INPUT     INIT      ROT    COMPANY            FULLNAME                    FLAGS              LAYOUT      */
2373GAMEL( 1990, victor21, 0,        victor21, victor21, victor21, ROT0, "Subsino / Buffy", "Victor 21",                 0,                 layout_victor21 )
2374GAMEL( 1991, victor5,  0,        victor5,  victor5,  victor5,  ROT0, "Subsino",         "Victor 5",                  0,                 layout_victor5 ) // board sticker says Victor 5, in-game says G.E.A with no manufacturer info?
2375GAMEL( 1991, tisub,    0,        tisub,    tisub,    tisub,    ROT0, "Subsino",         "Treasure Island (Subsino)", GAME_WRONG_COLORS, layout_tisub )
2376GAMEL( 1991, crsbingo, 0,        crsbingo, crsbingo, crsbingo, ROT0, "Subsino",         "Poker Carnival",            0,                 layout_crsbingo ) // alt version of Cross Bingo?
2377GAMEL( 1996, sharkpy,  0,        sharkpy,  sharkpy,  sharkpy,  ROT0, "Subsino",         "Shark Party (Italy, v1.3)", 0,                 layout_sharkpy ) // missing POST messages?
2378GAMEL( 1996, sharkpya, sharkpy,  sharkpy,  sharkpy,  sharkpy,  ROT0, "Subsino",         "Shark Party (Italy, v1.6)", 0,                 layout_sharkpy ) // missing POST messages?
2379GAMEL( 1996, smoto20,  0,        srider,   smoto20,  smoto20,  ROT0, "Subsino",         "Super Rider (Italy, v2.0)", 0,                 layout_smoto )
2380GAMEL( 1996, smoto16,  smoto20,  srider,   smoto16,  smoto16,  ROT0, "Subsino",         "Super Moto (Italy, v1.6)",  0,                 layout_smoto )
src/mame/drivers/alpha68k.c
r7356r7357
7575    and select difficulty/court. I've mapped them this way because you
7676    absolutely need the 2 buttons when you are in the "test mode".
7777
78 4)  'timesold', 'timesol1' and 'btlfield'
78 4)  'timesold', 'timesold1' and 'btlfield'
7979
8080  - The "Unused" Dip Switch is sort of "Debug Mode" Dip Switch and has an
8181    effect ONLY if 0x008fff.b is writable (as Bryan mentioned it).
r7356r7357
8888    it is set to "Romstar". Again, it has an effect only if 0x000074.w is
8989    writable and its role seems only to be limited to display some coordonates.
9090
91 7)  'skyadvnt', 'skyadvnu' and 'skyadvnj'
91 7)  'skyadvnt', 'skyadvntu' and 'skyadvntj'
9292
9393  - As in 'skysoldr', you can access to some "hidden features" if 0x000074.w
9494    is writable :
r7356r7357
9797      * bit 6 (when "Difficulty" Dip Switch is set to DEF_STR( Hard ) or DEF_STR( Hardest ))
9898        determines if some coordonates are displayed.
9999
100 8)  'gangwarb'
100 8)  'gangwarsb'
101101
102102  - When "Coin Slots" Dip Switch is set to "1", COIN2 only adds ONE credit
103103    and this has nothing to do with the microcontroller stuff.
r7356r7357
125125    for 'sstingry', even if I had to rewrite it !)
126126  - Fix screen flipping in 'sbasebal' (this was a Dip Switch issue)
127127  - Add READ16_HANDLER( *_cycle_r ) for the following games :
128      * timesol1  (based on the one from 'timesold')
128      * timesold1  (based on the one from 'timesold')
129129      * btlfield  (based on the one from 'timesold')
130      * gangwarb  (I splitted the one from 'gangwars')
131      * skyadvnt, skyadvnu and skyadvnj
130      * gangwarsb  (I splitted the one from 'gangwars')
131      * skyadvnt, skyadvntu and skyadvntj
132132  - Change manufacturer for the following games :
133133      * timesold
134      * timesol1
134      * timesold1
135135      * btlfield
136136      * skysoldr
137137    I can send you the ending pics where "Alpha Denshi Co." is mentioned.
r7356r7357
180180DIP locations verified from manuals for:
181181- tnextspc
182182- btlfield
183- gangwarb
183- gangwarsb
184184- skyadvnt
185185- goldmedl
186186- kyros
r7356r7357
11761176   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(8) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_REVERSE PORT_PLAYER(2)
11771177INPUT_PORTS_END
11781178
1179static INPUT_PORTS_START( btlfildb )
1179static INPUT_PORTS_START( btlfieldb )
11801180   PORT_INCLUDE( btlfield )
11811181
11821182   PORT_MODIFY("IN4") /* A 6 way dip switch */
r7356r7357
13581358INPUT_PORTS_END
13591359
13601360/* Same as 'skyadvnt' but bits 0-3 of 2nd set of Dip Switches are different */
1361static INPUT_PORTS_START( skyadvnu )
1361static INPUT_PORTS_START( skyadvntu )
13621362   PORT_INCLUDE( skyadvnt )
13631363
13641364   PORT_MODIFY("IN4") /* A 6 way dip switch */
r7356r7357
14281428INPUT_PORTS_END
14291429
14301430/* Same as 'gangwars' but bits 0-3 of 2nd set of Dip Switches are different */
1431static INPUT_PORTS_START( gangwarb )
1431static INPUT_PORTS_START( gangwarsb )
14321432   PORT_INCLUDE( gangwars )   /* See notes about "IN2" (microcontroller) */
14331433
14341434   PORT_MODIFY("IN3")
r7356r7357
21642164   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
21652165MACHINE_DRIVER_END
21662166
2167static MACHINE_DRIVER_START( btlfildb )
2167static MACHINE_DRIVER_START( btlfieldb )
21682168   MDRV_IMPORT_FROM(alpha68k_II)
21692169   MDRV_CPU_MODIFY("maincpu")
21702170   MDRV_CPU_VBLANK_INT_HACK(alpha68k_interrupt,2)
r7356r7357
31403140   return ret;
31413141}
31423142
3143static READ16_HANDLER( timesol1_cycle_r )
3143static READ16_HANDLER( timesold1_cycle_r )
31443144{
31453145   alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
31463146   int ret = state->shared_ram[0x4];
r7356r7357
32103210   return ret;
32113211}
32123212
3213static READ16_HANDLER( gangwarb_cycle_r )
3213static READ16_HANDLER( gangwarsb_cycle_r )
32143214{
32153215   alpha68k_state *state = (alpha68k_state *)space->machine->driver_data;
32163216   int ret = state->shared_ram[0x103];
r7356r7357
32693269   state->coin_id = 0x22 | (0x22 << 8);
32703270}
32713271
3272static DRIVER_INIT( timesol1 )
3272static DRIVER_INIT( timesold1 )
32733273{
32743274   alpha68k_state *state = (alpha68k_state *)machine->driver_data;
3275   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, timesol1_cycle_r);
3275   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, timesold1_cycle_r);
32763276   state->invert_controls = 1;
32773277   state->microcontroller_id = 0;
32783278   state->coin_id = 0x22 | (0x22 << 8);
r7356r7357
32873287   state->coin_id = 0x22 | (0x22 << 8);
32883288}
32893289
3290static DRIVER_INIT( btlfildb )
3290static DRIVER_INIT( btlfieldb )
32913291{
32923292   alpha68k_state *state = (alpha68k_state *)machine->driver_data;
32933293   state->invert_controls = 1;
r7356r7357
33143314   state->coin_id = 0x23 | (0x24 << 8);
33153315}
33163316
3317static DRIVER_INIT( goldmeda )
3317static DRIVER_INIT( goldmedla )
33183318{
33193319   alpha68k_state *state = (alpha68k_state *)machine->driver_data;
33203320   memory_set_bankptr(machine, "bank8", memory_region(machine, "maincpu") + 0x20000);
r7356r7357
33323332   state->coin_id = 0x22 | (0x22 << 8);
33333333}
33343334
3335static DRIVER_INIT( skyadvnu )
3335static DRIVER_INIT( skyadvntu )
33363336{
33373337   alpha68k_state *state = (alpha68k_state *)machine->driver_data;
33383338   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r);
r7356r7357
33513351   state->coin_id = 0x23 | (0x24 << 8);
33523352}
33533353
3354static DRIVER_INIT( gangwarb )
3354static DRIVER_INIT( gangwarsb )
33553355{
33563356   alpha68k_state *state = (alpha68k_state *)machine->driver_data;
3357   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x40206, 0x40207, 0, 0, gangwarb_cycle_r);
3357   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x40206, 0x40207, 0, 0, gangwarsb_cycle_r);
33583358   memory_set_bankptr(machine, "bank8", memory_region(machine, "user1"));
33593359   state->invert_controls = 0;
33603360   state->microcontroller_id = 0x8512;
r7356r7357
34013401GAME( 1987, jongbou,   0,        jongbou,        jongbou,  jongbou,  ROT90, "SNK",                "Mahjong Block Jongbou (Japan)", GAME_SUPPORTS_SAVE )
34023402GAME( 1988, paddlema,  0,        alpha68k_I,     paddlema, paddlema, ROT90, "SNK",                "Paddle Mania", GAME_SUPPORTS_SAVE )
34033403GAME( 1987, timesold,  0,        alpha68k_II,    timesold, timesold, ROT90, "[Alpha Denshi Co.] (SNK/Romstar license)", "Time Soldiers (US Rev 3)", GAME_SUPPORTS_SAVE )
3404GAME( 1987, timesold1, timesold, alpha68k_II,    timesold, timesol1, ROT90, "[Alpha Denshi Co.] (SNK/Romstar license)", "Time Soldiers (US Rev 1)", GAME_SUPPORTS_SAVE )
3404GAME( 1987, timesold1, timesold, alpha68k_II,    timesold, timesold1,ROT90, "[Alpha Denshi Co.] (SNK/Romstar license)", "Time Soldiers (US Rev 1)", GAME_SUPPORTS_SAVE )
34053405GAME( 1987, btlfield,  timesold, alpha68k_II,    btlfield, btlfield, ROT90, "[Alpha Denshi Co.] (SNK license)", "Battle Field (Japan)", GAME_SUPPORTS_SAVE )
3406GAME( 1987, btlfieldb, timesold, btlfildb,      btlfildb, btlfildb, ROT90, "bootleg",            "Battle Field (bootleg)", GAME_SUPPORTS_SAVE )
3406GAME( 1987, btlfieldb, timesold, btlfieldb,      btlfieldb,btlfieldb,ROT90, "bootleg",            "Battle Field (bootleg)", GAME_SUPPORTS_SAVE )
34073407GAME( 1988, skysoldr,  0,        alpha68k_II,    skysoldr, skysoldr, ROT90, "[Alpha Denshi Co.] (SNK of America/Romstar license)", "Sky Soldiers (US)", GAME_SUPPORTS_SAVE )
34083408GAME( 1988, goldmedl,  0,        alpha68k_II_gm, goldmedl, goldmedl, ROT0,  "SNK",                "Gold Medalist", GAME_SUPPORTS_SAVE )
3409GAME( 1988, goldmedla, goldmedl, alpha68k_II_gm, goldmedl, goldmeda, ROT0,  "SNK",                "Gold Medalist (alt)", GAME_SUPPORTS_SAVE )
3410GAME( 1988, goldmedlb, goldmedl, alpha68k_II_gm, goldmedl, goldmeda, ROT0,  "bootleg",            "Gold Medalist (bootleg)", GAME_NOT_WORKING )
3409GAME( 1988, goldmedla, goldmedl, alpha68k_II_gm, goldmedl, goldmedla,ROT0,  "SNK",                "Gold Medalist (alt)", GAME_SUPPORTS_SAVE )
3410GAME( 1988, goldmedlb, goldmedl, alpha68k_II_gm, goldmedl, goldmedla,ROT0,  "bootleg",            "Gold Medalist (bootleg)", GAME_NOT_WORKING )
34113411GAME( 1989, skyadvnt,  0,        alpha68k_V,     skyadvnt, skyadvnt, ROT90, "Alpha Denshi Co.",   "Sky Adventure (World)", GAME_SUPPORTS_SAVE )
3412GAME( 1989, skyadvntu, skyadvnt, alpha68k_V,     skyadvnu, skyadvnu, ROT90, "Alpha Denshi Co. (SNK of America license)", "Sky Adventure (US)", GAME_SUPPORTS_SAVE )
3412GAME( 1989, skyadvntu, skyadvnt, alpha68k_V,     skyadvntu,skyadvntu,ROT90, "Alpha Denshi Co. (SNK of America license)", "Sky Adventure (US)", GAME_SUPPORTS_SAVE )
34133413GAME( 1989, skyadvntj, skyadvnt, alpha68k_V,     skyadvnt, skyadvnt, ROT90, "Alpha Denshi Co.",   "Sky Adventure (Japan)", GAME_SUPPORTS_SAVE )
34143414GAME( 1989, gangwars,  0,        alpha68k_V,     gangwars, gangwars, ROT0,  "Alpha Denshi Co.",   "Gang Wars (US)", GAME_SUPPORTS_SAVE )
3415GAME( 1989, gangwarsb, gangwars, alpha68k_V,     gangwarb, gangwarb, ROT0,  "bootleg",            "Gang Wars (bootleg)", GAME_SUPPORTS_SAVE )
3415GAME( 1989, gangwarsb, gangwars, alpha68k_V,     gangwarsb,gangwarsb,ROT0,  "bootleg",            "Gang Wars (bootleg)", GAME_SUPPORTS_SAVE )
34163416#if SBASEBAL_HACK
34173417GAME( 1989, sbasebal,  0,        alpha68k_V_sb,  sbasebal, sbasebal, ROT0,  "Alpha Denshi Co.",   "Super Champion Baseball (Japan)", GAME_SUPPORTS_SAVE )
34183418#else
src/mame/drivers/galaxold.c
r7356r7357
294294    for hi-score table when screen not is flipped
295295
296296
297Notes about 'azurian' :
298-----------------------
297Stephh's notes (based on the games Z80 code and some tests) for other games :
299298
300  bit 6 of IN1 is linked with bit 2 of IN2 (check code at 0x05b3) to set difficulty :
2991) 'scramblb' and 'scramb2'
301300
302    bit 6  bit 2        contents of
303     IN1     IN2          0x40f4            consequences                   difficulty
301  - Player 2 controls are used for player 2 regardless of the "Cabinet" Dip Switch
302    (check code at 0x1043 which changes player and routines that handle players inputs :
303    0x1741 UP and DOWN - 0x1796 LEFT and RIGHT - 0x24e6 BUTTON1 - 0x2615 BUTTON2).
304304
305     OFF     OFF             2          aliens move 2 frames out of 3       easy
306     ON      OFF             4          aliens move 4 frames out of 5       hard
307     OFF     ON              3          aliens move 3 frames out of 4       normal
308     ON      ON              5          aliens move 5 frames out of 6       very hard
3052) 'bagmanmc'
309306
310  aliens movements is handled by routine at 0x1d59 :
307  - DSW bit 6 was previously used for "Bonus Lives" settings, but it has no effect
308    in this set because of 'NOP' instructions from 0x3501 to 0x3507.
311309
312    - alien 1 moves when 0x4044 != 0 else contents of 0x40f4 is stored at 0x4044
313    - alien 2 moves when 0x4054 != 0 else contents of 0x40f4 is stored at 0x4054
314    - alien 3 moves when 0x4064 != 0 else contents of 0x40f4 is stored at 0x4064
3103) 'porter'
315311
312  - It's difficult to map correctly players buttons because of what they do :
313    on one side, both buttons do the same thing (code at 0x0940 for player 1 and
314    player 2 in "Upright" cabinet, or 0x1cc0 for player 2 in "Cocktail" cabinet),
315    but on the other side, due to code at 0x0910, player 1 BUTTON1 acts as a
316    START1 button while player 1 BUTTON2 acts as a START2 button. Any help is welcome !
316317
317Notes about 'scorpnmc' :
318-----------------------
3184) 'tazzmang'
319319
320  As the START buttons are also the buttons for player 1, how should I map them ?
321  I've coded this the same way as in 'checkman', but I'm not sure this is correct.
320  - If you press COIN2 during the boot-up sequence, you enter sort of "test mode"
321    where you can access to all inputs, but this doesn't give a clue about what
322    they do (only the status - 0 or 1 - is displayed).
323  - IN1 bit 0 has 2 effects : it starts a one player game (code at 0x5585),
324    but it also acts as 2nd button (bomb) for BOTH players regardless of "Cabinet"
325    settings (code at 0x5805 for player 1 and player 2 in "Upright" cabinet, or
326    0x5563 for player 2 in "Cocktail" cabinet).
322327
323  I can't tell if it's a bug, but if you reset the game when the screen is flipped,
324  the screens remains flipped (the "flip screen" routine doesn't seem to be called) !
3285) 'bongo'
325329
330  - IN0 bit 1 is supposed to be COIN2 (see coinage routine at 0x0288), but
331    there is a test on it at 0x0082 (in NMI routine) which jumps to 0xc003
332    (unmapped memory) if it pressed (HIGH).
333  - IN0 bit 7 is tested on startup (code at 0x0048) in combinaison with bits 0 and 1
334    (which are supposed to be COIN1 and COIN2). If all of them are pressed (HIGH),
335    the game displays a "CREDIT FAULT" message then jumps back to 0x0048.
336  - IN0 bit 4 and IN1 bit 4 should have been IPT_JOYSTICK_DOWN (Upright and Cocktail)
337    but their status is discarded with 3 'NOP' instructions at 0x06ca.
338  - IN0 bit 7 and IN0 bit 6 should have been IPT_BUTTON1 (Upright and Cocktail)
339    but their status is discarded with 3 'NOP' instructions at 0x06d1.
340  - DSW0 is read via code at 0x2426, but its contents is directly overwritten
341    with value read from DSW1 (AY port A) via code at 0x3647.
326342
3434) 'ozon1'
327344
328Notes about 'frogg' :
329---------------------
345  - Player 2 controls are used for player 2 regardless of the "Cabinet" Dip Switch
346    (check code at 0x03c6 which changes player and routines that handle players inputs :
347    0x0dc3 and 0x1e31 LEFT and RIGHT - 0x0e76 BUTTON1).
348  - Credits are coded on 1 byte (range 0x00-0xff) and stored at 0x4002.
349    To display them, they are converted to BCD on 1 byte via routine at 0x1421.
350    As a result, it will always display 0 to 99 (eg: 0xf0 = 240 will display 40).
351    When you get 256 credits, 0x4002 = 0x00, so the game thinks you have no credit
352    at all and enters "attract mode" again (but the game does NOT reset).
353  - There's an ingame bug when you get 101 or 201 credits : due to code at 0x0239,
354    the game checks the BCD value (0x01) instead of the correct one at 0x4002,
355    so you can't start a 2 players game !
356  - There is another ingame bug when "Coinage" settings are "A 1C/2C  B 1C/1C"
357    and you press COIN2 : due to code at 0x0473, contents of 0x4004 is NEVER reset
358    to 0x00, so routine at 0x042a ALWAYS thinks that you've pressed COIN2,
359    and as a consequence, it ALWAYS adds 1 credit (even when you are playing) !
330360
331  If bit 5 of IN0 or bit 5 of IN1 is HIGH, something strange occurs (check code
332  at 0x3580) : each time you press START2 a counter at 0x47da is incremented.
333  When this counter reaches 0x2f, each next time you press START2, it acts as if
334  you had pressed COIN2, so credits are added !
335  Bit 5 of IN0 is tested if "Cabinet" Dip Switch is set to "Upright" and
336  bit 5 of IN1 is tested if "Cabinet" Dip Switch is set to "Cocktail".
337361
338
339
340TO DO :
341-------
342
343  - smooncrs : fix read/writes at/to unmapped memory (when player 2, "cocktail" mode)
344               fix the ?#! bug with "bullets" (when player 2, "cocktail" mode)
345  - frogg    : fix read/writes at/to unmapped/wrong memory
346  - scprpng  : fix read/writes at/to unmapped/wrong memory
347
348362***************************************************************************/
349363
350364#include "emu.h"
r7356r7357
449463   AM_RANGE(0xb800, 0xb800) AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)
450464ADDRESS_MAP_END
451465
466
452467static ADDRESS_MAP_START( rockclim_map, ADDRESS_SPACE_PROGRAM, 8 )
453468   AM_RANGE(0x0000, 0x3fff) AM_ROM
454469   AM_RANGE(0x4000, 0x47ff) AM_READWRITE(rockclim_videoram_r, rockclim_videoram_w) AM_BASE(&rockclim_videoram)//4800 - 4803 = bg scroll ?
455470   AM_RANGE(0x4800, 0x4803) AM_WRITE(rockclim_scroll_w)
456471   AM_RANGE(0x5000, 0x53ff) AM_RAM //?
472   AM_RANGE(0x5800, 0x5800) AM_READ_PORT("IN2")
457473   AM_RANGE(0x6000, 0x7fff) AM_ROM
458474   AM_RANGE(0x8000, 0x87ff) AM_RAM
459475   AM_RANGE(0x8800, 0x8800) AM_READ_PORT("DSW1")
r7356r7357
479495   AM_RANGE(0xb800, 0xb800) AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)
480496ADDRESS_MAP_END
481497
498
499static ADDRESS_MAP_START( ckongg_map, ADDRESS_SPACE_PROGRAM, 8 )
500   AM_RANGE(0x0000, 0x5fff) AM_ROM
501   AM_RANGE(0x6000, 0x6fff) AM_RAM
502   AM_RANGE(0x9000, 0x93ff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) AM_BASE(&galaxold_videoram)
503   AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
504   AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
505   AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
506   AM_RANGE(0x9880, 0x98ff) AM_RAM
507   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("IN0")
508   AM_RANGE(0xc000, 0xc001) AM_WRITE(galaxold_leds_w)
509   AM_RANGE(0xc002, 0xc002) AM_WRITE(galaxold_coin_lockout_w)
510   AM_RANGE(0xc003, 0xc003) AM_WRITE(galaxold_coin_counter_w)
511   AM_RANGE(0xc004, 0xc007) AM_DEVWRITE(GAL_AUDIO, galaxian_lfo_freq_w)
512   AM_RANGE(0xc400, 0xc400) AM_READ_PORT("IN1")
513   AM_RANGE(0xc400, 0xc402) AM_DEVWRITE(GAL_AUDIO, galaxian_background_enable_w)
514   AM_RANGE(0xc403, 0xc403) AM_DEVWRITE(GAL_AUDIO, galaxian_noise_enable_w)
515   AM_RANGE(0xc405, 0xc405) AM_DEVWRITE(GAL_AUDIO, galaxian_shoot_enable_w)
516   AM_RANGE(0xc406, 0xc407) AM_DEVWRITE(GAL_AUDIO, galaxian_vol_w)
517   AM_RANGE(0xc800, 0xc800) AM_READ_PORT("DSW")
518   AM_RANGE(0xc801, 0xc801) AM_WRITE(galaxold_nmi_enable_w)
519   AM_RANGE(0xc804, 0xc804) AM_WRITENOP // link cut
520   AM_RANGE(0xc806, 0xc806) AM_WRITE(galaxold_flip_screen_x_w)
521   AM_RANGE(0xc807, 0xc807) AM_WRITE(galaxold_flip_screen_y_w)
522   AM_RANGE(0xcc00, 0xcc00) AM_READ(watchdog_reset_r) AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)
523ADDRESS_MAP_END
524
525/* Memory map based on mooncrst_map according to Z80 code - seems to be good but needs further checking */
526static ADDRESS_MAP_START( ckongmc_map, ADDRESS_SPACE_PROGRAM, 8 )
527   AM_RANGE(0x0000, 0x5fff) AM_ROM
528   AM_RANGE(0x6000, 0x6fff) AM_RAM
529   AM_RANGE(0x9000, 0x93ff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) AM_BASE(&galaxold_videoram)
530   AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
531   AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
532   AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
533   AM_RANGE(0x9880, 0x98ff) AM_RAM
534   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
535   AM_RANGE(0xa001, 0xa002) AM_WRITE(galaxold_leds_w)                                              /* GUESS */
536//  AM_RANGE(0xa002, 0xa002) AM_WRITE(galaxold_coin_lockout_w)                                      /* not written */
537//  AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxold_coin_counter_w)                                      /* not written */
538   AM_RANGE(0xa004, 0xa007) AM_DEVWRITE(GAL_AUDIO, galaxian_lfo_freq_w)                            /* GUESS */
539   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1")
540   AM_RANGE(0xa800, 0xa802) AM_DEVWRITE(GAL_AUDIO, galaxian_background_enable_w)                   /* GUESS */
541   AM_RANGE(0xa803, 0xa803) AM_DEVWRITE(GAL_AUDIO, galaxian_noise_enable_w)                        /* GUESS */
542   AM_RANGE(0xa805, 0xa805) AM_DEVWRITE(GAL_AUDIO, galaxian_shoot_enable_w)                        /* GUESS */
543   AM_RANGE(0xa806, 0xa807) AM_DEVWRITE(GAL_AUDIO, galaxian_vol_w)                                 /* GUESS */
544   AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW")
545   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxold_nmi_enable_w)
546   AM_RANGE(0xb004, 0xb004) AM_WRITENOP                                                            /* AM_WRITE(galaxold_stars_enable_w) */
547   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)                                     /* GUESS */
548   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)                                     /* GUESS */
549   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)     /* GUESS */
550ADDRESS_MAP_END
551
552
482553static ADDRESS_MAP_START( scramblb_map, ADDRESS_SPACE_PROGRAM, 8 )
483554   AM_RANGE(0x0000, 0x3fff) AM_ROM
484555   AM_RANGE(0x4000, 0x47ff) AM_RAM
r7356r7357
509580   AM_RANGE(0x8202, 0x8202) AM_READ(scramblb_protection_2_r)
510581ADDRESS_MAP_END
511582
512
513583static READ8_HANDLER( scramb2_protection_r ) { return 0x25; }
514584static READ8_HANDLER( scramb2_port0_r ) { return (input_port_read(space->machine, "IN0") >> offset) & 0x1; }
515585static READ8_HANDLER( scramb2_port1_r ) { return (input_port_read(space->machine, "IN1") >> offset) & 0x1; }
r7356r7357
540610ADDRESS_MAP_END
541611
542612
543
544613static ADDRESS_MAP_START( _4in1_map, ADDRESS_SPACE_PROGRAM, 8 )
545614   AM_RANGE(0x0000, 0x3fff) AM_ROMBANK("bank1")   /* banked game code */
546615   AM_RANGE(0x4000, 0x47ff) AM_RAM
r7356r7357
571640   AM_RANGE(0xc000, 0xdfff) AM_ROM      /* fixed menu code */
572641ADDRESS_MAP_END
573642
643
574644static ADDRESS_MAP_START( bagmanmc_map, ADDRESS_SPACE_PROGRAM, 8 )
575645   AM_RANGE(0x0000, 0x5fff) AM_ROM
576646   AM_RANGE(0x6000, 0x67ff) AM_RAM
r7356r7357
591661   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)
592662ADDRESS_MAP_END
593663
664
594665static ADDRESS_MAP_START( dkongjrm_map, ADDRESS_SPACE_PROGRAM, 8 )
595666   AM_RANGE(0x0000, 0x5fff) AM_ROM
596667   AM_RANGE(0x6000, 0x6fff) AM_RAM
r7356r7357
607678   AM_RANGE(0xa803, 0xa803) AM_DEVWRITE(GAL_AUDIO, galaxian_noise_enable_w)
608679  //AM_RANGE(0xa805, 0xa805) AM_WRITE(galaxian)
609680   AM_RANGE(0xa806, 0xa807) AM_DEVWRITE(GAL_AUDIO, galaxian_vol_w)
610   AM_RANGE(0xb000, 0xb0ff) AM_READ_PORT("IN2")
681   AM_RANGE(0xb000, 0xb0ff) AM_READ_PORT("DSW")
611682   AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxold_gfxbank_w)
612683   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxold_nmi_enable_w)
613684  //AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_stars_enable_w)
r7356r7357
616687   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)
617688ADDRESS_MAP_END
618689
619static ADDRESS_MAP_START( ozon1_map, ADDRESS_SPACE_PROGRAM, 8 )
620   AM_RANGE(0x0000, 0x2fff) AM_ROM
621   AM_RANGE(0x4000, 0x4200) AM_RAM
622   AM_RANGE(0x4300, 0x43ff) AM_RAM
623   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) AM_BASE(&galaxold_videoram)
624   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxold_videoram_w)
625   AM_RANGE(0x5000, 0x503f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
626   AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
627   AM_RANGE(0x6801, 0x6801) AM_WRITENOP //continuosly 0 and 1
628   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxold_coin_counter_w)
629   AM_RANGE(0x6806, 0x6806) AM_WRITENOP //only one 0 at reset
630   AM_RANGE(0x6807, 0x6807) AM_WRITENOP //only one 0 at reset
631   AM_RANGE(0x8100, 0x8100) AM_READ_PORT("IN0")
632   AM_RANGE(0x8101, 0x8101) AM_READ_PORT("IN1")
633   AM_RANGE(0x8102, 0x8102) AM_READ_PORT("DSW")
634   AM_RANGE(0x8103, 0x8103) AM_WRITENOP //only one 9b at reset
635ADDRESS_MAP_END
636690
637static ADDRESS_MAP_START( ozon1_io_map, ADDRESS_SPACE_IO, 8 )
638   ADDRESS_MAP_GLOBAL_MASK(0xff)
639   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_data_address_w)
691static ADDRESS_MAP_START( tazzmang, ADDRESS_SPACE_PROGRAM, 8 )
692   AM_RANGE(0x0000, 0x5fff) AM_ROM
693   AM_RANGE(0x7000, 0x7000) AM_READ_PORT("DSW0") /* mirror */
694   AM_RANGE(0x8000, 0x87ff) AM_RAM
695   AM_RANGE(0x8800, 0x883f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
696   AM_RANGE(0x8840, 0x885f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
697   AM_RANGE(0x8860, 0x887f) AM_RAM AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
698   AM_RANGE(0x8880, 0x8bff) AM_WRITENOP
699   AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
700   AM_RANGE(0x9800, 0x9800) AM_READ(watchdog_reset_r)
701   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
702   AM_RANGE(0xa7ff, 0xa7ff) AM_READ_PORT("IN0") /* mirror */
703   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1") AM_DEVWRITE(GAL_AUDIO, galaxian_background_enable_w)
704   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxold_coin_counter_w)
705   AM_RANGE(0xa805, 0xa805) AM_DEVWRITE(GAL_AUDIO, galaxian_shoot_enable_w)
706   AM_RANGE(0xa806, 0xa807) AM_DEVWRITE(GAL_AUDIO, galaxian_vol_w)
707   AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW0")
708   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxold_nmi_enable_w)
709   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_stars_enable_w)
710   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
711   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
712   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)
640713ADDRESS_MAP_END
641714
642static ADDRESS_MAP_START( drivfrcg, ADDRESS_SPACE_PROGRAM, 8 )
643   AM_RANGE(0x0000, 0x0fff) AM_ROM
644   AM_RANGE(0x1480, 0x14bf) AM_MIRROR(0x6000) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
645   AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_WRITEONLY AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
646   AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ_PORT("IN0")
647   AM_RANGE(0x1503, 0x1503) AM_MIRROR(0x6000) AM_WRITE(galaxold_coin_counter_w)
648   AM_RANGE(0x1580, 0x1580) AM_MIRROR(0x6000) AM_READ_PORT("IN1")
649   AM_RANGE(0x1580, 0x1582) AM_MIRROR(0x6000) AM_DEVWRITE(GAL_AUDIO, galaxian_background_enable_w)
650   AM_RANGE(0x1583, 0x1583) AM_MIRROR(0x6000) AM_WRITENOP
651   AM_RANGE(0x1585, 0x1585) AM_MIRROR(0x6000) AM_WRITENOP
652   AM_RANGE(0x1586, 0x1587) AM_MIRROR(0x6000) AM_DEVWRITE(GAL_AUDIO, galaxian_lfo_freq_w)
653   AM_RANGE(0x1600, 0x1600) AM_MIRROR(0x6000) AM_READ_PORT("DSW0") AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)
654   AM_RANGE(0x1700, 0x1700) AM_MIRROR(0x6000) AM_READ_PORT("DSW1") AM_WRITENOP
655   AM_RANGE(0x1701, 0x1701) AM_MIRROR(0x6000) AM_WRITENOP
656   AM_RANGE(0x1704, 0x1707) AM_MIRROR(0x6000) AM_DEVWRITE(GAL_AUDIO, galaxian_vol_w)
657   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
658   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
659   AM_RANGE(0x2000, 0x2fff) AM_ROM
660   AM_RANGE(0x4000, 0x4fff) AM_ROM
661   AM_RANGE(0x6000, 0x6fff) AM_ROM
662ADDRESS_MAP_END
663715
664static ADDRESS_MAP_START( drivfrcg_io, ADDRESS_SPACE_IO, 8 )
665   AM_RANGE(0x00, 0x00) AM_READ(drivfrcg_port0_r)
666   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE") AM_WRITENOP
667ADDRESS_MAP_END
668
669716static ADDRESS_MAP_START( bongo, ADDRESS_SPACE_PROGRAM, 8 )
670717   AM_RANGE(0x0000, 0x5fff) AM_ROM
671718   AM_RANGE(0x8000, 0x83ff) AM_RAM
r7356r7357
692739ADDRESS_MAP_END
693740
694741
695static ADDRESS_MAP_START( hunchbkg, ADDRESS_SPACE_PROGRAM, 8 )
696   AM_RANGE(0x0000, 0x0fff) AM_ROM
697   AM_RANGE(0x1480, 0x14bf) AM_MIRROR(0x6000) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
698   AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_WRITEONLY AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
699   AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ_PORT("IN0")
700   AM_RANGE(0x1503, 0x1503) AM_MIRROR(0x6000) AM_WRITE(galaxold_coin_counter_w)
701   AM_RANGE(0x1580, 0x1580) AM_MIRROR(0x6000) AM_READ_PORT("IN1")
702   AM_RANGE(0x1580, 0x1582) AM_MIRROR(0x6000) AM_DEVWRITE(GAL_AUDIO, galaxian_background_enable_w)
703   AM_RANGE(0x1583, 0x1583) AM_MIRROR(0x6000) AM_WRITENOP
704   AM_RANGE(0x1584, 0x1587) AM_MIRROR(0x6000) AM_DEVWRITE(GAL_AUDIO, galaxian_lfo_freq_w)
705   AM_RANGE(0x1600, 0x1600) AM_MIRROR(0x6000) AM_READ_PORT("DSW0")
706   AM_RANGE(0x1600, 0x1601) AM_MIRROR(0x6000) AM_WRITENOP
707   AM_RANGE(0x1604, 0x1604) AM_MIRROR(0x6000) AM_WRITENOP
708   AM_RANGE(0x1606, 0x1606) AM_MIRROR(0x6000) AM_WRITE(galaxold_flip_screen_x_w)
709   AM_RANGE(0x1607, 0x1607) AM_MIRROR(0x6000) AM_WRITE(galaxold_flip_screen_y_w)
710   AM_RANGE(0x1680, 0x1680) AM_MIRROR(0x6000) AM_READNOP AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)
711   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
712   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
713   AM_RANGE(0x2000, 0x2fff) AM_ROM
714   AM_RANGE(0x4000, 0x4fff) AM_ROM
715   AM_RANGE(0x6000, 0x6fff) AM_ROM
742static ADDRESS_MAP_START( ozon1_map, ADDRESS_SPACE_PROGRAM, 8 )
743   AM_RANGE(0x0000, 0x2fff) AM_ROM
744   AM_RANGE(0x4000, 0x4200) AM_RAM
745   AM_RANGE(0x4300, 0x43ff) AM_RAM
746   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) AM_BASE(&galaxold_videoram)
747   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxold_videoram_w)
748   AM_RANGE(0x5000, 0x503f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
749   AM_RANGE(0x5040, 0x505f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
750   AM_RANGE(0x6801, 0x6801) AM_WRITENOP //continuosly 0 and 1
751   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxold_coin_counter_w)
752   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w)
753   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
754   AM_RANGE(0x8100, 0x8100) AM_READ_PORT("IN0")
755   AM_RANGE(0x8101, 0x8101) AM_READ_PORT("IN1")
756   AM_RANGE(0x8102, 0x8102) AM_READ_PORT("IN2")
757   AM_RANGE(0x8103, 0x8103) AM_WRITENOP //only one 9b at reset
716758ADDRESS_MAP_END
717759
718
719static ADDRESS_MAP_START( hunchbkg_io, ADDRESS_SPACE_IO, 8 )
720   AM_RANGE(S2650_DATA_PORT,  S2650_DATA_PORT) AM_READNOP // not used
721   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE")
760static ADDRESS_MAP_START( ozon1_io_map, ADDRESS_SPACE_IO, 8 )
761   ADDRESS_MAP_GLOBAL_MASK(0xff)
762   AM_RANGE(0x00, 0x01) AM_DEVWRITE("aysnd", ay8910_data_address_w)
722763ADDRESS_MAP_END
723764
765
724766static ADDRESS_MAP_START( harem_cpu1, ADDRESS_SPACE_PROGRAM, 8 )
725767   AM_RANGE(0x0000, 0x1fff) AM_ROM
726768   AM_RANGE(0x2000, 0x27ff) AM_RAM
r7356r7357
754796   AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r)
755797ADDRESS_MAP_END
756798
757static ADDRESS_MAP_START( tazzmang, ADDRESS_SPACE_PROGRAM, 8 )
758   AM_RANGE(0x0000, 0x5fff) AM_ROM
759   AM_RANGE(0x7000, 0x7000) AM_READ_PORT("DSW0") /* mirror */
760   AM_RANGE(0x8000, 0x87ff) AM_RAM
761   AM_RANGE(0x8800, 0x883f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
762   AM_RANGE(0x8840, 0x885f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
763   AM_RANGE(0x8860, 0x887f) AM_RAM AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
764   AM_RANGE(0x8880, 0x8bff) AM_WRITENOP
765   AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
766   AM_RANGE(0x9800, 0x9800) AM_READ(watchdog_reset_r)
767   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
768   AM_RANGE(0xa7ff, 0xa7ff) AM_READ_PORT("IN0") /* mirror */
769   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1") AM_DEVWRITE(GAL_AUDIO, galaxian_background_enable_w)
770   AM_RANGE(0xa803, 0xa803) AM_WRITE(galaxold_coin_counter_w)
771   AM_RANGE(0xa805, 0xa805) AM_DEVWRITE(GAL_AUDIO, galaxian_shoot_enable_w)
772   AM_RANGE(0xa806, 0xa807) AM_DEVWRITE(GAL_AUDIO, galaxian_vol_w)
773   AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW0")
774   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxold_nmi_enable_w)
775   AM_RANGE(0xb004, 0xb004) AM_WRITE(galaxold_stars_enable_w)
776   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)
777   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)
778   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)
799
800static ADDRESS_MAP_START( hunchbkg, ADDRESS_SPACE_PROGRAM, 8 )
801   AM_RANGE(0x0000, 0x0fff) AM_ROM
802   AM_RANGE(0x1480, 0x14bf) AM_MIRROR(0x6000) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
803   AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_WRITEONLY AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
804   AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ_PORT("IN0")
805   AM_RANGE(0x1503, 0x1503) AM_MIRROR(0x6000) AM_WRITE(galaxold_coin_counter_w)
806   AM_RANGE(0x1580, 0x1580) AM_MIRROR(0x6000) AM_READ_PORT("IN1")
807   AM_RANGE(0x1580, 0x1582) AM_MIRROR(0x6000) AM_DEVWRITE(GAL_AUDIO, galaxian_background_enable_w)
808   AM_RANGE(0x1583, 0x1583) AM_MIRROR(0x6000) AM_WRITENOP
809   AM_RANGE(0x1584, 0x1587) AM_MIRROR(0x6000) AM_DEVWRITE(GAL_AUDIO, galaxian_lfo_freq_w)
810   AM_RANGE(0x1600, 0x1600) AM_MIRROR(0x6000) AM_READ_PORT("DSW0")
811   AM_RANGE(0x1600, 0x1601) AM_MIRROR(0x6000) AM_WRITENOP
812   AM_RANGE(0x1604, 0x1604) AM_MIRROR(0x6000) AM_WRITENOP
813   AM_RANGE(0x1606, 0x1606) AM_MIRROR(0x6000) AM_WRITE(galaxold_flip_screen_x_w)
814   AM_RANGE(0x1607, 0x1607) AM_MIRROR(0x6000) AM_WRITE(galaxold_flip_screen_y_w)
815   AM_RANGE(0x1680, 0x1680) AM_MIRROR(0x6000) AM_READNOP AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)
816   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
817   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
818   AM_RANGE(0x2000, 0x2fff) AM_ROM
819   AM_RANGE(0x4000, 0x4fff) AM_ROM
820   AM_RANGE(0x6000, 0x6fff) AM_ROM
779821ADDRESS_MAP_END
780822
823static ADDRESS_MAP_START( hunchbkg_io, ADDRESS_SPACE_IO, 8 )
824   AM_RANGE(S2650_DATA_PORT,  S2650_DATA_PORT) AM_READNOP // not used
825   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE")
826ADDRESS_MAP_END
827
828
829static ADDRESS_MAP_START( drivfrcg, ADDRESS_SPACE_PROGRAM, 8 )
830   AM_RANGE(0x0000, 0x0fff) AM_ROM
831   AM_RANGE(0x1480, 0x14bf) AM_MIRROR(0x6000) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
832   AM_RANGE(0x14c0, 0x14ff) AM_MIRROR(0x6000) AM_WRITEONLY AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
833   AM_RANGE(0x1500, 0x1500) AM_MIRROR(0x6000) AM_READ_PORT("IN0")
834   AM_RANGE(0x1503, 0x1503) AM_MIRROR(0x6000) AM_WRITE(galaxold_coin_counter_w)
835   AM_RANGE(0x1580, 0x1580) AM_MIRROR(0x6000) AM_READ_PORT("IN1")
836   AM_RANGE(0x1580, 0x1582) AM_MIRROR(0x6000) AM_DEVWRITE(GAL_AUDIO, galaxian_background_enable_w)
837   AM_RANGE(0x1583, 0x1583) AM_MIRROR(0x6000) AM_WRITENOP
838   AM_RANGE(0x1585, 0x1585) AM_MIRROR(0x6000) AM_WRITENOP
839   AM_RANGE(0x1586, 0x1587) AM_MIRROR(0x6000) AM_DEVWRITE(GAL_AUDIO, galaxian_lfo_freq_w)
840   AM_RANGE(0x1600, 0x1600) AM_MIRROR(0x6000) AM_READ_PORT("DSW0") AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)
841   AM_RANGE(0x1700, 0x1700) AM_MIRROR(0x6000) AM_READ_PORT("DSW1") AM_WRITENOP
842   AM_RANGE(0x1701, 0x1701) AM_MIRROR(0x6000) AM_WRITENOP
843   AM_RANGE(0x1704, 0x1707) AM_MIRROR(0x6000) AM_DEVWRITE(GAL_AUDIO, galaxian_vol_w)
844   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
845   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
846   AM_RANGE(0x2000, 0x2fff) AM_ROM
847   AM_RANGE(0x4000, 0x4fff) AM_ROM
848   AM_RANGE(0x6000, 0x6fff) AM_ROM
849ADDRESS_MAP_END
850
851static ADDRESS_MAP_START( drivfrcg_io, ADDRESS_SPACE_IO, 8 )
852   AM_RANGE(0x00, 0x00) AM_READ(drivfrcg_port0_r)
853   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE") AM_WRITENOP
854ADDRESS_MAP_END
855
856
781857static ADDRESS_MAP_START( racknrol, ADDRESS_SPACE_PROGRAM, 8 )
782858   AM_RANGE(0x0000, 0x0fff) AM_ROM
783859   AM_RANGE(0x1400, 0x143f) AM_MIRROR(0x6000) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
r7356r7357
807883   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE")
808884ADDRESS_MAP_END
809885
810static ADDRESS_MAP_START( ckongg_map, ADDRESS_SPACE_PROGRAM, 8 )
811   AM_RANGE(0x0000, 0x5fff) AM_ROM
812   AM_RANGE(0x6000, 0x6fff) AM_RAM
813   AM_RANGE(0x9000, 0x93ff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) AM_BASE(&galaxold_videoram)
814   AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
815   AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
816   AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
817   AM_RANGE(0x9880, 0x98ff) AM_RAM
818   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("IN0")
819   AM_RANGE(0xc000, 0xc001) AM_WRITE(galaxold_leds_w)
820   AM_RANGE(0xc002, 0xc002) AM_WRITE(galaxold_coin_lockout_w)
821   AM_RANGE(0xc003, 0xc003) AM_WRITE(galaxold_coin_counter_w)
822   AM_RANGE(0xc004, 0xc007) AM_DEVWRITE(GAL_AUDIO, galaxian_lfo_freq_w)
823   AM_RANGE(0xc400, 0xc400) AM_READ_PORT("IN1")
824   AM_RANGE(0xc400, 0xc402) AM_DEVWRITE(GAL_AUDIO, galaxian_background_enable_w)
825   AM_RANGE(0xc403, 0xc403) AM_DEVWRITE(GAL_AUDIO, galaxian_noise_enable_w)
826   AM_RANGE(0xc405, 0xc405) AM_DEVWRITE(GAL_AUDIO, galaxian_shoot_enable_w)
827   AM_RANGE(0xc406, 0xc407) AM_DEVWRITE(GAL_AUDIO, galaxian_vol_w)
828   AM_RANGE(0xc800, 0xc800) AM_READ_PORT("DSW0")
829   AM_RANGE(0xc801, 0xc801) AM_WRITE(galaxold_nmi_enable_w)
830   AM_RANGE(0xc804, 0xc804) AM_WRITENOP // link cut
831   AM_RANGE(0xc806, 0xc806) AM_WRITE(galaxold_flip_screen_x_w)
832   AM_RANGE(0xc807, 0xc807) AM_WRITE(galaxold_flip_screen_y_w)
833   AM_RANGE(0xcc00, 0xcc00) AM_READ(watchdog_reset_r) AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)
834ADDRESS_MAP_END
835
836/* Memory map based on mooncrst_map according to Z80 code - seems to be good but needs further checking */
837static ADDRESS_MAP_START( ckongmc_map, ADDRESS_SPACE_PROGRAM, 8 )
838   AM_RANGE(0x0000, 0x5fff) AM_ROM
839   AM_RANGE(0x6000, 0x6fff) AM_RAM
840   AM_RANGE(0x9000, 0x93ff) AM_READWRITE(galaxold_videoram_r, galaxold_videoram_w) AM_BASE(&galaxold_videoram)
841   AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
842   AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
843   AM_RANGE(0x9860, 0x987f) AM_RAM AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
844   AM_RANGE(0x9880, 0x98ff) AM_RAM
845   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
846   AM_RANGE(0xa001, 0xa002) AM_WRITE(galaxold_leds_w)                                              /* GUESS */
847//  AM_RANGE(0xa002, 0xa002) AM_WRITE(galaxold_coin_lockout_w)                                      /* not written */
848//  AM_RANGE(0xa003, 0xa003) AM_WRITE(galaxold_coin_counter_w)                                      /* not written */
849   AM_RANGE(0xa004, 0xa007) AM_DEVWRITE(GAL_AUDIO, galaxian_lfo_freq_w)                            /* GUESS */
850   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1")
851   AM_RANGE(0xa800, 0xa802) AM_DEVWRITE(GAL_AUDIO, galaxian_background_enable_w)                   /* GUESS */
852   AM_RANGE(0xa803, 0xa803) AM_DEVWRITE(GAL_AUDIO, galaxian_noise_enable_w)                        /* GUESS */
853   AM_RANGE(0xa805, 0xa805) AM_DEVWRITE(GAL_AUDIO, galaxian_shoot_enable_w)                        /* GUESS */
854   AM_RANGE(0xa806, 0xa807) AM_DEVWRITE(GAL_AUDIO, galaxian_vol_w)                                 /* GUESS */
855   AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW0")
856   AM_RANGE(0xb001, 0xb001) AM_WRITE(galaxold_nmi_enable_w)
857   AM_RANGE(0xb004, 0xb004) AM_WRITENOP                                                            /* AM_WRITE(galaxold_stars_enable_w) */
858   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxold_flip_screen_x_w)                                     /* GUESS */
859   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxold_flip_screen_y_w)                                     /* GUESS */
860   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r) AM_DEVWRITE(GAL_AUDIO, galaxian_pitch_w)     /* GUESS */
861ADDRESS_MAP_END
862
863886static READ8_HANDLER( hexpoola_data_port_r )
864887{
865888   switch (cpu_get_pc(space->cpu))
r7356r7357
882905ADDRESS_MAP_END
883906
884907
885static INPUT_PORTS_START( scramblb )
908/* Lives Dips are spread accross two input ports */
909static CUSTOM_INPUT( vpool_lives_r )
910{
911   int bit_mask = (FPTR)param;
912
913   switch (bit_mask)
914   {
915      case 0x40:  /* vpool : IN1 (0xa800) bit 6 */
916         return ((input_port_read(field->port->machine, "LIVES") & bit_mask) >> 6);
917      case 0x01:  /* vpool : DSW (0xb000) bit 0 */
918         return ((input_port_read(field->port->machine, "LIVES") & bit_mask) >> 0);
919
920      default:
921         logerror("vpool_lives_r : invalid %02X bit_mask\n",bit_mask);
922         return 0;
923   }
924}
925
926/* verified from Z80 code */
927static INPUT_PORTS_START( vpool )
886928   PORT_START("IN0")
887929   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
888   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
889   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
890   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
930   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
931   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_2WAY
932   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
891933   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
892   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
893   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
894   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
934   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
935   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
936   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )           /* uses same coinage as COIN1 and COIN2 */
895937
896938   PORT_START("IN1")
897939   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
898940   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
899   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
900   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
941   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_2WAY PORT_COCKTAIL
942   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
901943   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
902   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
944   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
945   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vpool_lives_r, (void *)0x40)
946   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
947
948   PORT_START("DSW0")
949   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vpool_lives_r, (void *)0x01)
950   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
951   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
952   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
953   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coinage ) )
954   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
955   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
956   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
957   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
958   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
959
960   PORT_START("LIVES")
961   PORT_DIPNAME( 0x41, 0x01, DEF_STR( Lives ) )
962   PORT_DIPSETTING(    0x41, "1" )
963   PORT_DIPSETTING(    0x40, "2" )
964   PORT_DIPSETTING(    0x01, "3" )
965   PORT_DIPSETTING(    0x00, "Infinite (Cheat)" )          /* also gives 99 credits after coin insertion regardless of coinage */
966INPUT_PORTS_END
967
968
969/* verified from Z80 code */
970static INPUT_PORTS_START( rockclim )
971   PORT_START("IN0")
972   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )             /* only adds 1 credit if "Coin Slots" is set to 1 */
973   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
974   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT )  PORT_8WAY
975   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY
976   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP )    PORT_8WAY
977   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN )  PORT_8WAY
903978   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
979   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
980   PORT_DIPSETTING(   0x40, DEF_STR( Cocktail ) )
981   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
982
983   PORT_START("IN1")
984   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
985   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
986   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT )   PORT_8WAY
987   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT )  PORT_8WAY
988   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP )     PORT_8WAY
989   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN )   PORT_8WAY
990   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
991   PORT_DIPSETTING(    0x00, "30000" )
992   PORT_DIPSETTING(    0x40, "50000" )
993   PORT_DIPNAME( 0x80, 0x00, "Coin Slots" )
994   PORT_DIPSETTING(    0x80, "1" )
995   PORT_DIPSETTING(    0x00, "2" )
996
997   PORT_START("IN2")
998   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT )  PORT_8WAY PORT_COCKTAIL
999   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY PORT_COCKTAIL
1000   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP )    PORT_8WAY PORT_COCKTAIL
1001   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN )  PORT_8WAY PORT_COCKTAIL
1002   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT )   PORT_8WAY PORT_COCKTAIL
1003   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT )  PORT_8WAY PORT_COCKTAIL
1004   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP )     PORT_8WAY PORT_COCKTAIL
1005   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN )   PORT_8WAY PORT_COCKTAIL
1006
1007   PORT_START("DSW0")
1008   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1009   PORT_DIPSETTING(    0x00, "3" )
1010   PORT_DIPSETTING(    0x01, "4" )
1011   PORT_DIPSETTING(    0x02, "5" )
1012   PORT_DIPSETTING(    0x03, "6" )
1013   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
1014   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_TILT )
1015   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1016
1017   PORT_START("DSW1")
1018   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
1019   PORT_DIPSETTING(    0x00, DEF_STR( 9C_1C ) )
1020   PORT_DIPSETTING(    0x01, DEF_STR( 8C_1C ) )
1021   PORT_DIPSETTING(    0x02, DEF_STR( 7C_1C ) )
1022   PORT_DIPSETTING(    0x03, DEF_STR( 6C_1C ) )
1023   PORT_DIPSETTING(    0x04, DEF_STR( 5C_1C ) )
1024   PORT_DIPSETTING(    0x05, DEF_STR( 4C_1C ) )
1025   PORT_DIPSETTING(    0x06, DEF_STR( 3C_1C ) )
1026   PORT_DIPSETTING(    0x07, DEF_STR( 2C_1C ) )
1027   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
1028   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
1029   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
1030   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
1031   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
1032   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
1033   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
1034   PORT_DIPSETTING(    0x08, DEF_STR( 1C_8C ) )
1035   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
1036   PORT_DIPSETTING(    0x00, DEF_STR( 9C_1C ) )
1037   PORT_DIPSETTING(    0x10, DEF_STR( 8C_1C ) )
1038   PORT_DIPSETTING(    0x20, DEF_STR( 7C_1C ) )
1039   PORT_DIPSETTING(    0x30, DEF_STR( 6C_1C ) )
1040   PORT_DIPSETTING(    0x40, DEF_STR( 5C_1C ) )
1041   PORT_DIPSETTING(    0x50, DEF_STR( 4C_1C ) )
1042   PORT_DIPSETTING(    0x60, DEF_STR( 3C_1C ) )
1043   PORT_DIPSETTING(    0x70, DEF_STR( 2C_1C ) )
1044   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
1045   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
1046   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
1047   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
1048   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
1049   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
1050   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
1051   PORT_DIPSETTING(    0x80, DEF_STR( 1C_8C ) )
1052INPUT_PORTS_END
1053
1054
1055/* Coinage Dips are spread accross two input ports */
1056static CUSTOM_INPUT( ckongg_coinage_r )
1057{
1058   int bit_mask = (FPTR)param;
1059
1060   switch (bit_mask)
1061   {
1062      case 0x0c:  /* ckongg  : DSW (0xc800) bits 2 and 3 */
1063         return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 2);
1064      case 0x40:  /* ckongg  : IN1 (0xc400) bit 6 */
1065         return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 6);
1066
1067      case 0xc0:  /* ckongmc : IN1 (0xa800) bits 6 and 7 */
1068         return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 6);
1069      case 0x01:  /* ckongmc : DSW (0xb000) bit 0 */
1070         return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 0);
1071
1072      default:
1073         logerror("ckongg_coinage_r : invalid %02X bit_mask\n",bit_mask);
1074         return 0;
1075   }
1076}
1077
1078/* verified from Z80 code */
1079static INPUT_PORTS_START( ckongg )
1080   PORT_START("IN0")
1081   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1082   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1083   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_4WAY
1084   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1085   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY
1086   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY
1087   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1088   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1089
1090   PORT_START("IN1")
1091   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1092   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1093   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_4WAY PORT_COCKTAIL
1094   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1095   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY PORT_COCKTAIL
1096   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY PORT_COCKTAIL
1097   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ckongg_coinage_r, (void *)0x40)
1098   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
1099   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
1100   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1101
1102   PORT_START("DSW")
1103   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1104   PORT_DIPSETTING(    0x00, "3" )
1105   PORT_DIPSETTING(    0x01, "4" )
1106   PORT_DIPSETTING(    0x02, "5" )
1107   PORT_DIPSETTING(    0x03, "6" )
1108   PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ckongg_coinage_r, (void *)0x0c)
1109   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1110
1111   PORT_START("COINAGE")
1112   PORT_DIPNAME( 0x4c, 0x00, DEF_STR( Coinage ) )
1113   PORT_DIPSETTING(    0x4c, DEF_STR( 5C_1C ) )
1114   PORT_DIPSETTING(    0x44, DEF_STR( 4C_1C ) )
1115   PORT_DIPSETTING(    0x0c, DEF_STR( 3C_1C ) )
1116   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
1117   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1118   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
1119   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1120   PORT_DIPSETTING(    0x48, DEF_STR( 1C_4C ) )
1121INPUT_PORTS_END
1122
1123/* verified from Z80 code */
1124static INPUT_PORTS_START( ckongmc )
1125   PORT_START("IN0")
1126   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1127   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1128   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_4WAY
1129   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1130   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY
1131   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
1132   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY PORT_COCKTAIL
1133   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY
1134
1135   PORT_START("IN1")
1136   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* also START1 : code at 0x5064 for BUTTON1 and 0x514d for START1 */
1137   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1138   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_4WAY PORT_COCKTAIL
1139   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1140   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY PORT_COCKTAIL
1141   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1142   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ckongg_coinage_r, (void *)0xc0)
1143
1144   PORT_START("DSW")
1145   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ckongg_coinage_r, (void *)0x01)
1146   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Lives ) )
1147   PORT_DIPSETTING(    0x00, "3" )
1148   PORT_DIPSETTING(    0x02, "4" )
1149   PORT_DIPSETTING(    0x04, "5" )
1150   PORT_DIPSETTING(    0x06, "6" )
1151   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
1152   PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
1153   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1154   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1155
1156   PORT_START("COINAGE")
1157   PORT_DIPNAME( 0xc1, 0x00, DEF_STR( Coinage ) )
1158   PORT_DIPSETTING(    0xc1, DEF_STR( 5C_1C ) )
1159   PORT_DIPSETTING(    0x41, DEF_STR( 4C_1C ) )
1160   PORT_DIPSETTING(    0xc0, DEF_STR( 3C_1C ) )
1161   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
1162   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1163   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
1164   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
1165   PORT_DIPSETTING(    0x81, DEF_STR( 1C_4C ) )
1166INPUT_PORTS_END
1167
1168
1169/* verified from Z80 code */
1170static INPUT_PORTS_START( scramblb )
1171   PORT_START("IN0")
1172   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1173   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_PLAYER(2)
1174   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_PLAYER(1)
1175   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1176   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
1177   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
1178   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_PLAYER(1)
1179   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_8WAY PORT_PLAYER(1)
1180
1181   PORT_START("IN1")
1182   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1183   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1184   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_PLAYER(2)
1185   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1186   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1187   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
1188   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
9041189   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
9051190   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
906   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1191   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_8WAY PORT_PLAYER(2)
9071192
9081193   PORT_START("IN2")
9091194   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
r7356r7357
9191204   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
9201205INPUT_PORTS_END
9211206
922
923/* the cocktail controls only seem to be used in upright mode, is the flip flag wrong for this bootleg? */
1207/* verified from Z80 code */
9241208static INPUT_PORTS_START( scramb2 )
9251209   PORT_START("IN0")
926   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
927   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
928   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
929   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
930   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
931   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
932   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
933   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
934   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1210   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY PORT_PLAYER(2)
1211   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1212   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )           /* uses same coinage as COIN1 */
1213   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1214   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1215   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_PLAYER(1)
1216   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
9351217   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
9361218
9371219   PORT_START("IN1")
r7356r7357
9401222   PORT_DIPSETTING(    0x01, "4" )
9411223   PORT_DIPSETTING(    0x02, "5" )
9421224   PORT_DIPSETTING(    0x03, "255 (Cheat)")
943   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
944   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
945   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
946   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1225   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1226   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1227   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1228   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_PLAYER(2)
9471229   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
9481230   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
9491231
9501232   PORT_START("IN2")
951   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1233   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
9521234   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
953   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
954   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
955   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
956   PORT_DIPSETTING(    0x06, DEF_STR( 1C_4C ) )
1235   PORT_DIPSETTING(    0x00, "A 1/1  B 2/1" )
1236   PORT_DIPSETTING(    0x02, "A 1/2  B 1/1" )
1237   PORT_DIPSETTING(    0x04, "A 1/3  B 3/1" )
1238   PORT_DIPSETTING(    0x06, "A 1/4  B 4/1" )
9571239   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
9581240   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
9591241   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
960   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
961   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
962   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
963   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
964   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
965   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
966   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
967   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1242   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY PORT_PLAYER(1)
1243   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
1244   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_PLAYER(1)
1245   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
9681246INPUT_PORTS_END
9691247
1248
9701249static INPUT_PORTS_START( 4in1 )
9711250   PORT_START("IN0")
9721251   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
r7356r7357
10921371   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
10931372INPUT_PORTS_END
10941373
1374
1375/* verified from Z80 code */
10951376static INPUT_PORTS_START( bagmanmc )
10961377   PORT_START("IN0")
10971378   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
10981379   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
10991380   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1100   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1381   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
11011382   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1102   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1103   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1383   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_8WAY
1384   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_8WAY
11041385   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 )
11051386
11061387   PORT_START("IN1")
11071388   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START2 )
1108   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1389   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
11091390   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1110   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1111   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1391   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_8WAY PORT_COCKTAIL
1392   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_COCKTAIL
11121393   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1113   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1394   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )           /* stored to 0x6163 bit 4 but not tested */
11141395   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
11151396   PORT_DIPSETTING(   0x80, DEF_STR( Upright ) )
11161397   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
r7356r7357
11321413   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Language ) )
11331414   PORT_DIPSETTING(   0x20, DEF_STR( English ) )
11341415   PORT_DIPSETTING(   0x00, DEF_STR( French ) )
1135   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) )
1136   PORT_DIPSETTING(   0x40, "30000" )
1137   PORT_DIPSETTING(   0x00, "40000" )
1138   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )   // Check code at 0x2d78 and 0x2e6b
1139   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1140   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
1416   PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )                   /* see notes */
1417   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )          /* check code at 0x2d78 and 0x2e6b - affect initials entry */
1418   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
1419   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
11411420INPUT_PORTS_END
11421421
1422
1423/* Coinage Dips are spread accross two input ports */
1424static CUSTOM_INPUT( dkongjrm_coinage_r )
1425{
1426   int bit_mask = (FPTR)param;
1427
1428   switch (bit_mask)
1429   {
1430      case 0xc0:  /* dkongjrm : IN1 (0xa8??) bits 6 and 7 */
1431         return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 6);
1432      case 0x01:  /* dkongjrm : DSW (0xb0??) bit 0 */
1433         return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 0);
1434
1435      default:
1436         logerror("dkongjrm_coinage_r : invalid %02X bit_mask\n",bit_mask);
1437         return 0;
1438   }
1439}
1440
1441/* verified from Z80 code */
11431442static INPUT_PORTS_START( dkongjrm )
11441443   PORT_START("IN0")
11451444   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1146   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1147   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
1445   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
1446   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_4WAY
11481447   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1149   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
1448   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY
11501449   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1151   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1152   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
1450   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY PORT_COCKTAIL
1451   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY
11531452
11541453   PORT_START("IN1")
11551454   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
11561455   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1157   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1456   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
11581457   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1159   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1458   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY PORT_COCKTAIL
11601459   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1161   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
1162   PORT_DIPSETTING(   0xc0, DEF_STR( 3C_1C ) )
1163   PORT_DIPSETTING(   0x40, DEF_STR( 2C_1C ) )
1164   PORT_DIPSETTING(   0x00, DEF_STR( 1C_1C ) )
1165   PORT_DIPSETTING(   0x80, DEF_STR( 1C_2C ) )
1460   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(dkongjrm_coinage_r, (void *)0xc0)
11661461
1167   PORT_START("IN2")
1168   PORT_DIPNAME( 0x01, 0x00, "Coin Multiplier" )
1169   PORT_DIPSETTING(    0x00, "*1" )
1170   PORT_DIPSETTING(    0x01, "*2" )
1462   PORT_START("DSW")
1463   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(dkongjrm_coinage_r, (void *)0x01)
11711464   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Lives ) )
11721465   PORT_DIPSETTING(   0x00, "3" )
11731466   PORT_DIPSETTING(   0x02, "4" )
r7356r7357
11771470   PORT_DIPSETTING(   0x08, DEF_STR( Upright ) )
11781471   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
11791472   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1473
1474   PORT_START("COINAGE")
1475   PORT_DIPNAME( 0xc1, 0x00, DEF_STR( Coinage ) )
1476   PORT_DIPSETTING(    0xc1, DEF_STR( 5C_1C ) )
1477   PORT_DIPSETTING(    0x41, DEF_STR( 4C_1C ) )
1478   PORT_DIPSETTING(    0xc0, DEF_STR( 3C_1C ) )
1479   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
1480   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1481   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
1482   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
1483   PORT_DIPSETTING(    0x81, DEF_STR( 1C_4C ) )
11801484INPUT_PORTS_END
11811485
1182static INPUT_PORTS_START( rockclim )
11831486
1487/* verified from Z80 code */
1488static INPUT_PORTS_START( porter )
11841489   PORT_START("IN0")
11851490   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
11861491   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1187   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY
1188   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY
1189   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY
1190   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_8WAY
1191   PORT_DIPNAME( 0x40, 0x40, "Unknown 1" ) //code at $7713
1192   PORT_DIPSETTING(    0x00, "0" )
1193   PORT_DIPSETTING(    0x40, "1" )
1492   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_8WAY
1493   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1494   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_8WAY
1495   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL       /* see notes */
1496   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_COCKTAIL
1497   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_8WAY
11941498
11951499   PORT_START("IN1")
1500   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )                     /* also START1 - see notes */
1501   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )                     /* also START2 - see notes */
1502   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_COCKTAIL
1503   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1504   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )  PORT_8WAY PORT_COCKTAIL
1505   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL       /* see notes */
1506   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
1507   PORT_DIPSETTING(   0x00, "10000 only" )
1508   PORT_DIPSETTING(   0x40, "30000 only" )
1509   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
1510   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
1511   PORT_DIPSETTING(   0x80, DEF_STR( Cocktail ) )
1512
1513   PORT_START("DSW0")
1514   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) )
1515   PORT_DIPSETTING(   0x00, "A 2C/1C  B 1C/3C" )
1516   PORT_DIPSETTING(   0x01, "A 1C/1C  B 1C/6C" )
1517   PORT_DIPUNUSED( 0x02, IP_ACTIVE_LOW )                             /* stored to 0x8021 bit 1 but not tested */
1518   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) )
1519   PORT_DIPSETTING(   0x00, "2" )
1520   PORT_DIPSETTING(   0x04, "3" )
1521   PORT_DIPSETTING(   0x08, "4" )
1522   PORT_DIPSETTING(   0x0c, "5" )
1523   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1524INPUT_PORTS_END
1525
1526
1527/* verified from Z80 code */
1528static INPUT_PORTS_START( tazzmang )
1529   PORT_START("IN0")
1530   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1531   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1532   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_8WAY
1533   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1534   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1535   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_COCKTAIL
1536   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_8WAY
1537   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_8WAY
1538
1539   PORT_START("IN1")
1540   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Start 1 / P1 and P2 Button 2")
1541   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1542   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_COCKTAIL
1543   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1544   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1545   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_8WAY PORT_COCKTAIL
1546   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
1547   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
1548   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
1549   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Lives ) )
1550   PORT_DIPSETTING(   0x00, "3" )
1551   PORT_DIPSETTING(   0x80, "5" )
1552
1553   PORT_START("DSW0")
1554   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1555   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1556   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1557   PORT_DIPNAME( 0x06, 0x04, DEF_STR( Coinage ) )
1558   PORT_DIPSETTING(    0x00, "A 4C/1C  B 1C/4C" )
1559   PORT_DIPSETTING(    0x02, "A 3C/1C  B 1C/3C" )
1560   PORT_DIPSETTING(    0x06, "A 2C/1C  B 1C/2C" )
1561   PORT_DIPSETTING(    0x04, DEF_STR( 1C_1C ) )
1562   PORT_DIPUNUSED( 0x08, IP_ACTIVE_LOW )
1563   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1564INPUT_PORTS_END
1565
1566
1567/* verified from Z80 code */
1568static INPUT_PORTS_START( bongo )
1569   PORT_START("IN0")
1570   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1571   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )           /* see notes */
1572   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
1573   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
1574   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )            /* see notes */
1575   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
1576   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )            /* see notes */
1577   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )            /* see notes */
1578
1579   PORT_START("IN1")
11961580   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
11971581   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1198   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT  ) PORT_8WAY
1199   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT  ) PORT_8WAY
1200   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_8WAY
1201   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_8WAY
1202   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) )
1203   PORT_DIPSETTING(    0x00, "30,000" )
1204   PORT_DIPSETTING(    0x40, "50,000" )
1205   PORT_DIPNAME( 0x80, 0x80, "Coin Slots" )
1206   PORT_DIPSETTING(    0x00, "2" )
1207   PORT_DIPSETTING(    0x80, "1" )
1582   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_COCKTAIL
1583   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
1584   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )            /* see notes */
1585   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_COCKTAIL
1586   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
1587   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
12081588
12091589   PORT_START("DSW0")
1210   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1211   PORT_DIPSETTING(    0x00, "3" )
1212   PORT_DIPSETTING(    0x01, "4" )
1213   PORT_DIPSETTING(    0x02, "5" )
1214   PORT_DIPSETTING(    0x03, "6" )
1590   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )            /* see notes */
12151591
12161592   PORT_START("DSW1")
1217   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
1218   PORT_DIPSETTING(    0x00, DEF_STR( 9C_1C ) )
1219   PORT_DIPSETTING(    0x01, DEF_STR( 8C_1C ) )
1220   PORT_DIPSETTING(    0x02, DEF_STR( 7C_1C ) )
1221   PORT_DIPSETTING(    0x03, DEF_STR( 6C_1C ) )
1222   PORT_DIPSETTING(    0x04, DEF_STR( 5C_1C ) )
1223   PORT_DIPSETTING(    0x05, DEF_STR( 4C_1C ) )
1224   PORT_DIPSETTING(    0x06, DEF_STR( 3C_1C ) )
1225   PORT_DIPSETTING(    0x07, DEF_STR( 2C_1C ) )
1226   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
1227   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
1228   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
1229   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
1230   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
1231   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
1232   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
1233   PORT_DIPSETTING(    0x08, DEF_STR( 1C_8C ) )
1234   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
1235   PORT_DIPSETTING(    0x00, DEF_STR( 9C_1C ) )
1236   PORT_DIPSETTING(    0x10, DEF_STR( 8C_1C ) )
1237   PORT_DIPSETTING(    0x20, DEF_STR( 7C_1C ) )
1238   PORT_DIPSETTING(    0x30, DEF_STR( 6C_1C ) )
1239   PORT_DIPSETTING(    0x40, DEF_STR( 5C_1C ) )
1240   PORT_DIPSETTING(    0x50, DEF_STR( 4C_1C ) )
1241   PORT_DIPSETTING(    0x60, DEF_STR( 3C_1C ) )
1242   PORT_DIPSETTING(    0x70, DEF_STR( 2C_1C ) )
1243   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
1244   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
1245   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
1246   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
1247   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
1248   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
1249   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
1250   PORT_DIPSETTING(    0x80, DEF_STR( 1C_8C ) )
1593   PORT_DIPUNUSED( 0x01, IP_ACTIVE_HIGH )
1594   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Lives ) )
1595   PORT_DIPSETTING(    0x00, "2" )
1596   PORT_DIPSETTING(    0x02, "3" )
1597   PORT_DIPSETTING(    0x04, "4" )
1598   PORT_DIPSETTING(    0x06, "5" )
1599   PORT_DIPNAME( 0x08, 0x00, "Infinite Lives (Cheat)" )    /* always gives 3 lives */
1600   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1601   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1602   PORT_DIPUNUSED( 0x10, IP_ACTIVE_HIGH )
1603   PORT_DIPUNUSED( 0x20, IP_ACTIVE_HIGH )
1604   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coinage ) )
1605   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )            /* also 1C_3C for Coin B if it existed */
1606   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )            /* also 1C_6C for Coin B if it existed */
1607   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
1608   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1609   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
12511610INPUT_PORTS_END
12521611
1253/*
12541612
1255Game bug:
1256- you can insert 99 credits 3 times consecutively, then it resets
1257
1258*/
1613/* verified from Z80 code */
12591614static INPUT_PORTS_START( ozon1 )
12601615   PORT_START("IN0")
1261   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1262   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1263   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1616   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
1617   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1618   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
12641619   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
12651620   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
1266   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
1621   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
12671622   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
12681623   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
12691624
12701625   PORT_START("IN1")
1271   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
1626   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
12721627   PORT_DIPSETTING(    0x00, "3" )
12731628   PORT_DIPSETTING(    0x01, "4" )
12741629   PORT_DIPSETTING(    0x02, "5" )
12751630   PORT_DIPSETTING(    0x03, "6" )
1276   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1631   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
12771632   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
12781633   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
1279   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
1634   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
12801635   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
12811636   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
12821637
1283   PORT_START("DSW")
1284   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1285   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1286   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1638   PORT_START("IN2")
1639   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
12871640   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
12881641   PORT_DIPSETTING(    0x00, "A 1C/1C  B 2C/1C" )
1289   PORT_DIPSETTING(    0x02, "A 1C/2C  B 1C/1C" ) // when you insert a coin with COIN2 it starts an infinite loop
1642   PORT_DIPSETTING(    0x02, "A 1C/2C  B 1C/1C" ) /* see notes */
12901643   PORT_DIPSETTING(    0x04, "A 1C/3C  B 3C/1C" )
12911644   PORT_DIPSETTING(    0x06, "A 1C/4C  B 4C/1C" )
1292   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1293   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1294   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1295   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1296   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1297   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1298   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1299   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1300   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1301   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1302   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1303   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1304   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1305   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1306   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1645   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1646   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1647   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1648   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
13071649INPUT_PORTS_END
13081650
1651
1652/* verified from Z80 code */
13091653static INPUT_PORTS_START( ladybugg )
13101654   PORT_START("IN0")
13111655   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
13121656   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1313   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
1314   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
1315   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1316   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
1317   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1318   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
1657   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_4WAY
1658   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1659   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
1660   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY
1661   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY PORT_COCKTAIL
1662   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY
13191663
13201664   PORT_START("IN1")
13211665   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
13221666   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1323   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
1324   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
1325   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
1326   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL /* 2nd Button 1 */
1327   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
1328   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1329   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
1330   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) )
1331   PORT_DIPSETTING(    0x80, "A 1C/1C  B 1C/5C" )
1332   PORT_DIPSETTING(    0x00, "A 2C/1C  B 1C/3C" )
1667   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_4WAY PORT_COCKTAIL
1668   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1669   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
1670   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY PORT_COCKTAIL
1671   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
1672   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
1673   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1674   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
1675   PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
13331676
13341677   PORT_START("IN2")
1335   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) )
1336   PORT_DIPSETTING(    0x00, DEF_STR( Easiest ) )
1337   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
1678   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
1679   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
1680   PORT_DIPSETTING(    0x01, DEF_STR( Medium ) )
13381681   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
13391682   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
13401683   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
13411684   PORT_DIPSETTING(    0x00, "3" )
1342   PORT_DIPSETTING(    0x04, "4" )
1343   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
1344   PORT_DIPSETTING(    0x00, "20000" )
1345   PORT_DIPSETTING(    0x08, "40000" )
1346   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* Yes, the game reads both of these */
1347   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* Check code at 0x22e1 */
1685   PORT_DIPSETTING(    0x04, "5" )
1686   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1687   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1688   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1689   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
13481690INPUT_PORTS_END
13491691
1350static INPUT_PORTS_START( vpool )
1351   PORT_START("IN0")
1352   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1353   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1354   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1355   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1356   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1357   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1358   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1359   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1360   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
1361   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
13621692
1363   PORT_START("IN1")
1364   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1365   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1366   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1367   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1368   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1369   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1370   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1371   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1372   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1373   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1374   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1375   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1376   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1377   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1378
1379   PORT_START("DSW0")
1380   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
1381   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1382   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1383   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1384   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1385   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1386   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1387   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1388   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1389   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1390   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1391   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1392   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1393   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1394   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1395   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1396   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1397   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1398   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1399   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1400   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1401   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1402   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1403   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1404INPUT_PORTS_END
1405
1406static INPUT_PORTS_START( drivfrcg )
1407   PORT_START("IN0")
1408   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1409   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1410   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1411   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1412   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1413   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1414   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1415   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1416
1417   PORT_START("IN1")
1418   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1419   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
1420   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1421   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1422   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1423   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1424   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
1425   PORT_DIPSETTING(    0x40, "A 2C/1C  B 1C/3C" )
1426   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/5C" )
1427   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1428
1429   PORT_START("DSW0")
1693static INPUT_PORTS_START( harem )
1694   PORT_START("IN0")//Change tag when major usage uncovered.
14301695   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1431   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1432   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1696   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1697   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
14331698   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1434   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1435   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1699   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1700   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
14361701   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1437   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1438   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1702   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1703   PORT_DIPSETTING(   0x04, DEF_STR( On ) )
14391704   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1440   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1441   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1705   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1706   PORT_DIPSETTING(   0x08, DEF_STR( On ) )
14421707   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1443   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1444   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1708   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1709   PORT_DIPSETTING(   0x10, DEF_STR( On ) )
14451710   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1446   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1447   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1711   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1712   PORT_DIPSETTING(   0x20, DEF_STR( On ) )
14481713   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1449   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1450   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1714   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1715   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
14511716   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1452   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1453   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1717   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1718   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
14541719
1455   PORT_START("DSW1")
1720   PORT_START("IN1")
14561721   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1457   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1458   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1722   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1723   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
14591724   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1460   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1461   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1725   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1726   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
14621727   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1463   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1464   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1728   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1729   PORT_DIPSETTING(   0x04, DEF_STR( On ) )
14651730   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1466   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1467   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1731   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1732   PORT_DIPSETTING(   0x08, DEF_STR( On ) )
14681733   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1469   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1470   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1734   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1735   PORT_DIPSETTING(   0x10, DEF_STR( On ) )
14711736   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1472   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1473   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1737   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1738   PORT_DIPSETTING(   0x20, DEF_STR( On ) )
14741739   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1475   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1476   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1740   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1741   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
14771742   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1478   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1479   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1480
1481   PORT_START("SENSE")
1482   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1743   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1744   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
14831745INPUT_PORTS_END
14841746
1485static INPUT_PORTS_START( bongo )
1747
1748static INPUT_PORTS_START( hunchbkg )
14861749   PORT_START("IN0")
14871750   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1488   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // coin? it jumps to an unmapped area at $C003
1489   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
1490   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
1751   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1752   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1)
1753   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1)
14911754   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1492   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
1493   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1494   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1755   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1756   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1757   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1)
14951758
14961759   PORT_START("IN1")
1497   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1498   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1499   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
1500   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
1760   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Start 1 / P1 Button 1") PORT_PLAYER(1)
1761   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Start 2 / P1 Button 1") PORT_PLAYER(1)
1762   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1763   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
15011764   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1502   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
1765   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
15031766   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
15041767   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
15051768
15061769   PORT_START("DSW0")
1507   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1508   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1509   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1770   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1771   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1772   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
15101773   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
15111774   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
15121775   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
r7356r7357
15291792   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
15301793   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
15311794
1532   PORT_START("DSW1")
1533   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1534   PORT_DIPSETTING(    0x0, DEF_STR( Off ) )
1535   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1536   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Lives ) )
1537   PORT_DIPSETTING(    0x00, "2" )
1538   PORT_DIPSETTING(    0x02, "3" )
1539   PORT_DIPSETTING(    0x04, "4" )
1540   PORT_DIPSETTING(    0x06, "5" )
1541   PORT_DIPNAME( 0x08, 0x00, "Infinite Lives" )
1542   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1543   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1544   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1545   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1546   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1547   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1548   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1549   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1550   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coinage ) )
1551   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
1552   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
1553   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
1554   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1555   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
1795   PORT_START("SENSE")
1796   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
15561797INPUT_PORTS_END
15571798
1558static INPUT_PORTS_START( hunchbkg )
1799
1800static INPUT_PORTS_START( drivfrcg )
15591801   PORT_START("IN0")
15601802   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
15611803   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1562   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1)
1563   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1)
1804   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1805   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
15641806   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
15651807   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1566   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1567   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1)
1808   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1809   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
15681810
15691811   PORT_START("IN1")
1570   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Start 1 / P1 Button 1") PORT_PLAYER(1)
1571   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Start 2 / P1 Button 1") PORT_PLAYER(1)
1572   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1573   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1812   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1813   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
1814   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1815   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
15741816   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1575   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1576   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1817   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1818   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
1819   PORT_DIPSETTING(    0x40, "A 2C/1C  B 1C/3C" )
1820   PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/5C" )
15771821   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
15781822
15791823   PORT_START("DSW0")
1580   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1581   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1582   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1824   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1825   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1826   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
15831827   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
15841828   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
15851829   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
r7356r7357
16021846   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
16031847   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
16041848
1605   PORT_START("SENSE")
1606   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1607INPUT_PORTS_END
1608
1609static INPUT_PORTS_START( harem )
1610   PORT_START("IN0")//Change tag when major usage uncovered.
1849   PORT_START("DSW1")
16111850   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1612   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1613   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
1851   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1852   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
16141853   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1615   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1616   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
1854   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1855   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
16171856   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1618   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1619   PORT_DIPSETTING(   0x04, DEF_STR( On ) )
1857   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1858   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
16201859   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1621   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1622   PORT_DIPSETTING(   0x08, DEF_STR( On ) )
1623   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1624   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1625   PORT_DIPSETTING(   0x10, DEF_STR( On ) )
1626   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1627   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1628   PORT_DIPSETTING(   0x20, DEF_STR( On ) )
1629   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1630   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1631   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
1632   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1633   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1634   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
1635
1636   PORT_START("IN1")
1637   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1638   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1639   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
1640   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1641   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1642   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
1643   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1644   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1645   PORT_DIPSETTING(   0x04, DEF_STR( On ) )
1646   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1647   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1648   PORT_DIPSETTING(   0x08, DEF_STR( On ) )
1649   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1650   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1651   PORT_DIPSETTING(   0x10, DEF_STR( On ) )
1652   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1653   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1654   PORT_DIPSETTING(   0x20, DEF_STR( On ) )
1655   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1656   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1657   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
1658   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1659   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1660   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
1661INPUT_PORTS_END
1662
1663static INPUT_PORTS_START( tazzmang )
1664   PORT_START("IN0")
1665   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1666   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1667   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1668   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1669   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1670   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1671   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1672   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1673
1674   PORT_START("IN1")
1675   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Start 1 / P1 and P2 Button 2")
1676   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1677   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1678   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1679   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1680   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1681   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1682   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1683
1684   PORT_START("DSW0")
1685   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
1686   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1687   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
1688   PORT_DIPNAME( 0x06, 0x04, DEF_STR( Coinage ) )
1689   PORT_DIPSETTING(    0x00, "A 4C/1C  B 1C/4C" )
1690   PORT_DIPSETTING(    0x02, "A 3C/1C  B 1C/3C" )
1691   PORT_DIPSETTING(    0x06, "A 2C/1C  B 1C/2C" )
1692   PORT_DIPSETTING(    0x04, "A 1C/1C  B 1C/1C" )
1693   PORT_DIPNAME( 0x08, 0x00, "3" )
16941860   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
16951861   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
16961862   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
r7356r7357
17051871   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
17061872   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
17071873   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1874
1875   PORT_START("SENSE")
1876   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
17081877INPUT_PORTS_END
17091878
1879
17101880static INPUT_PORTS_START( racknrol )
17111881   PORT_START("IN0")
17121882   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
r7356r7357
17701940   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
17711941INPUT_PORTS_END
17721942
1943
17731944static INPUT_PORTS_START( trvchlng )
17741945   PORT_START("IN0")
17751946   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
r7356r7357
18342005INPUT_PORTS_END
18352006
18362007
1837/* Coinage Dips are spread accross two input ports */
1838static CUSTOM_INPUT( ckongg_coinage_r )
1839{
1840   int bit_mask = (FPTR)param;
1841
1842   switch (bit_mask)
1843   {
1844      case 0x0c:  /* ckongg  : DSW (0xc800) bits 2 and 3 */
1845         return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 2);
1846      case 0x40:  /* ckongg  : IN1 (0xc400) bit 6 */
1847         return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 6);
1848
1849      case 0xc0:  /* ckongmc : IN1 (0xa800) bits 6 and 7 */
1850         return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 6);
1851      case 0x01:  /* ckongmc : DSW (0xb000) bit 0 */
1852         return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 0);
1853
1854      default:
1855         logerror("ckongg_bonus_r : invalid %02X bit_mask\n",bit_mask);
1856         return 0;
1857   }
1858}
1859
1860/* verified from Z80 code */
1861static INPUT_PORTS_START( ckongg )
1862   PORT_START("IN0")
1863   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1864   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1865   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_4WAY
1866   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1867   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY
1868   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY
1869   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1870   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1871
1872   PORT_START("IN1")
1873   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1874   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1875   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_4WAY PORT_COCKTAIL
1876   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1877   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY PORT_COCKTAIL
1878   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY PORT_COCKTAIL
1879   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ckongg_coinage_r, (void *)0x40)
1880   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
1881   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
1882   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1883
1884   PORT_START("DSW0")
1885   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1886   PORT_DIPSETTING(    0x00, "3" )
1887   PORT_DIPSETTING(    0x01, "4" )
1888   PORT_DIPSETTING(    0x02, "5" )
1889   PORT_DIPSETTING(    0x03, "6" )
1890   PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ckongg_coinage_r, (void *)0x0c)
1891   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1892
1893   PORT_START("COINAGE")
1894   PORT_DIPNAME( 0x4c, 0x00, DEF_STR( Coinage ) )
1895   PORT_DIPSETTING(    0x4c, DEF_STR( 5C_1C ) )
1896   PORT_DIPSETTING(    0x44, DEF_STR( 4C_1C ) )
1897   PORT_DIPSETTING(    0x0c, DEF_STR( 3C_1C ) )
1898   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
1899   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1900   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
1901   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1902   PORT_DIPSETTING(    0x48, DEF_STR( 1C_4C ) )
1903INPUT_PORTS_END
1904
1905/* verified from Z80 code */
1906static INPUT_PORTS_START( ckongmc )
1907   PORT_START("IN0")
1908   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1909   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1910   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_4WAY
1911   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1912   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY
1913   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
1914   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY PORT_COCKTAIL
1915   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_4WAY
1916
1917   PORT_START("IN1")
1918   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* also START1 : code at 0x5064 for BUTTON1 and 0x514d for START1 */
1919   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1920   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_4WAY PORT_COCKTAIL
1921   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1922   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_4WAY PORT_COCKTAIL
1923   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1924   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ckongg_coinage_r, (void *)0xc0)
1925
1926   PORT_START("DSW0")
1927   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ckongg_coinage_r, (void *)0x01)
1928   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Lives ) )
1929   PORT_DIPSETTING(    0x00, "3" )
1930   PORT_DIPSETTING(    0x02, "4" )
1931   PORT_DIPSETTING(    0x04, "5" )
1932   PORT_DIPSETTING(    0x06, "6" )
1933   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
1934   PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
1935   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1936   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1937
1938   PORT_START("COINAGE")
1939   PORT_DIPNAME( 0xc1, 0x00, DEF_STR( Coinage ) )
1940   PORT_DIPSETTING(    0xc1, DEF_STR( 5C_1C ) )
1941   PORT_DIPSETTING(    0x41, DEF_STR( 4C_1C ) )
1942   PORT_DIPSETTING(    0xc0, DEF_STR( 3C_1C ) )
1943   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
1944   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1945   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
1946   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
1947   PORT_DIPSETTING(    0x81, DEF_STR( 1C_4C ) )
1948INPUT_PORTS_END
1949
1950static INPUT_PORTS_START( porter )
1951   PORT_START("IN0")
1952   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1953   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1954   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
1955   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
1956   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
1957    PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1958    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1959    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1960   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1961    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1962    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1963   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
1964
1965   PORT_START("IN1")
1966   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // and START
1967   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) // and START2
1968   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1969   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1970   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1971    PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1972    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1973    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1974    PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1975    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1976    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1977    PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1978    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1979    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1980
1981   PORT_START("DSW0")
1982    PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1983   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1984    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1985    PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1986    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1987    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1988    PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1989    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1990    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1991    PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1992    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1993    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1994    PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1995    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1996    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1997    PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1998    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1999    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2000    PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
2001    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2002    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2003    PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
2004    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2005    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2006INPUT_PORTS_END
2007
20082008static const gfx_layout galaxold_charlayout =
20092009{
20102010   8,8,
r7356r7357
24892489
24902490***************************************************************************/
24912491
2492ROM_START( vpool )
2493   ROM_REGION( 0x10000, "maincpu", 0 )
2494   ROM_LOAD( "vidpool1.bin", 0x0000, 0x0800, CRC(333f4732) SHA1(b57460c039c69137645bd4280ad877aa789277d6) )
2495   ROM_CONTINUE(             0x2000, 0x0800 )
2496   ROM_LOAD( "vidpool2.bin", 0x0800, 0x0800, CRC(eea6c0f1) SHA1(5b18caa78e246f55fd9cd778d6e83f79f0b3f157) )
2497   ROM_CONTINUE(             0x2800, 0x0800 )
2498   ROM_LOAD( "vidpool3.bin", 0x1000, 0x0800, CRC(309972a6) SHA1(8269d2f677f55dda71d6a7b0796d2d53a4def59d) )
2499   ROM_CONTINUE(             0x3000, 0x0800 )
2500   ROM_LOAD( "vidpool4.bin", 0x1800, 0x0800, CRC(c4f71c1d) SHA1(e1d01135d5ccc1a53308ce89dc2a8fc0992207d5) )
2501   ROM_CONTINUE(             0x3800, 0x0800 )
2502
2503   ROM_REGION( 0x1000, "gfx1", 0 )
2504   ROM_LOAD( "hustler.5f", 0x0000, 0x0800, CRC(0bdfad0e) SHA1(8e6f1737604f3801c03fa2e9a5e6a2778b54bae8) ) // vidpoolh.bin
2505   ROM_LOAD( "hustler.5h", 0x0800, 0x0800, CRC(8e062177) SHA1(7e52a1669804b6c2f694cfc64b04abc8246bb0c2) ) // vidpoolk.bin
2506
2507   ROM_REGION( 0x0020, "proms", 0 )
2508   ROM_LOAD( "hustler.clr",  0x0000, 0x0020, CRC(aa1f7f5e) SHA1(311dd17aa11490a1173c76223e4ccccf8ea29850) )
2509ROM_END
2510
2511ROM_START( rockclim )
2512   ROM_REGION( 0x10000, "maincpu", 0 )
2513   ROM_LOAD( "lc01.a1",   0x0000, 0x1000, CRC(8601ae8d) SHA1(6e0c3b34ce5e6879ce7a116c5c2660889a68320d) )
2514   ROM_LOAD( "lc02.a2",   0x1000, 0x1000, CRC(2dde9d4c) SHA1(7e343113116b94894558819a7f77f77e4e952da7) )
2515   ROM_LOAD( "lc03.a3",   0x2000, 0x1000, CRC(82c48a67) SHA1(abf95062eb5c9bd4bb3c9b9af59396a4ca6905d8) )
2516   ROM_LOAD( "lc04.a4",   0x3000, 0x1000, CRC(7cd3a04a) SHA1(756c12288e120e6f761b266b91920d17cab6926c) )
2517   ROM_LOAD( "lc05.a5",   0x6000, 0x1000, CRC(5e542149) SHA1(425a5a8769c3fa0887db8ff04e2a4f32f18d2679) )
2518   ROM_LOAD( "lc06.a6",   0x7000, 0x1000, CRC(b2bdca64) SHA1(e72e63725164c922816dda90ac964a94062eab1b) )
2519
2520   ROM_REGION( 0x2000, "gfx1", 0 )
2521   ROM_LOAD( "lc08.a9",   0x0000, 0x800, CRC(7f18e1ef) SHA1(2a160b994708ec0f06774dde3ec613af7e3f32c6) )
2522   ROM_LOAD( "lc07.a7",   0x0800, 0x800, CRC(f18b50ac) SHA1(a2328eb55882a09403cae1a497c611b494649cac) )
2523   ROM_LOAD( "lc10.c9",   0x1000, 0x800, CRC(dec5781b) SHA1(b6277fc890d153db24bd48293780cf239a6aa0e7) )
2524   ROM_LOAD( "lc09.c7",   0x1800, 0x800, CRC(06c0b5de) SHA1(561cf99a6be03205c7bc5fd15d4d51ee4d6d164b) )
2525
2526   ROM_REGION( 0x2000, "gfx2", 0 )
2527   ROM_LOAD( "lc13.g5",   0x0000, 0x1000, CRC(19475f2b) SHA1(5d42aa45a7b519dacdecd3d2edbfee6971693034) )
2528   ROM_LOAD( "lc14.g7",   0x1000, 0x1000, CRC(cc96d1db) SHA1(9713b47b723a5d8837f2a8e8c43e46dc41a62e5b) )
2529
2530   ROM_REGION( 0x0040, "proms", 0 )
2531   ROM_LOAD( "lc12.e9",  0x0000, 0x0020, CRC(f6e76547) SHA1(c9ea78d1876156561b3bbf327d7e0299e1d9fd4a) )
2532   ROM_LOAD( "lc11.f4",  0x0020, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2533ROM_END
2534
2535/*
2536Crazy Kong
2537Bootleg, 1982
2538
2539PCB Layout
2540----------
2541
2542|----------------------------------------------|
2543|        AY3-8910    MB7051          2125 2125 |
2544| LM3900     ROM.5S  MB7051          2125 2125 |
2545|                    MB7051          2125 2125 |
2546|            ROM.5R                            |
2547|                                              |
2548|1           ROM.5N                            |
2549|8                                             |
2550|W           ROM.5M               ROM.11N      |
2551|A                                ROM.11L      |
2552|Y           ROM.5K          2114 ROM.11K      |
2553|   VOL                      2114 ROM.11H      |
2554|            ROM.5H 2114                       |
2555|  Z80              2114                       |
2556|            ROM.5F                            |
2557|     2114                                     |
2558|     2114   ROM.5D              5101 ROM.11C  |
2559|                                              |
2560|HA1368 DSW(8) 6116  18.432MHz   5101 ROM.11A  |
2561|----------------------------------------------|
2562Notes:
2563      Z80     : Clock running at 3.072MHz (18.432/6)
2564      AY3-8910: Clock running at 1.536MHz (18.432/12)
2565      2125    : 1K x1 SRAM (DIP16)
2566      2114    : 1K x4 SRAM (DIP18)
2567      6116    : 2K x8 SRAM (DIP24)
2568      5101    : 256 x4 SRAM (SDIP22)
2569      LM3900  : National Semiconductor LM3900 Quadruple Norton Operational Amplifier (DIP14)
2570      HA1368  : Hitachi HA1368 18V, 4.5A, 5.3W Audio Power Amplifier IC
2571      MB7051  : Hitachi MB7051 32bytes x8 Bipolar PROM (DIP16)
2572*/
2573
2574ROM_START( ckongg )
2575   ROM_REGION( 0x10000, "maincpu", 0 )
2576   ROM_LOAD( "ck1.bin",       0x2400, 0x0400, CRC(a4323b94) SHA1(1fed47e1df5efa8f40585bedab07b60067edc2bb) )
2577   ROM_CONTINUE(              0x1C00, 0x0400)
2578   ROM_CONTINUE(              0x4800, 0x0400)
2579   ROM_CONTINUE(              0x0C00, 0x0400)
2580   ROM_LOAD( "ck2.bin",       0x4400, 0x0400, CRC(1e532996) SHA1(fe1feeca347fccd266925614a46c98cff683f5d3) )
2581   ROM_CONTINUE(              0x0000, 0x0400)
2582   ROM_CONTINUE(              0x1800, 0x0400)
2583   ROM_CONTINUE(              0x2800, 0x0400)
2584   ROM_LOAD( "ck3.bin",       0x3400, 0x0400, CRC(65157cde) SHA1(572b9bd56894600e21220356d0bf193c7920672c) )
2585   ROM_CONTINUE(              0x4c00, 0x0400)
2586   ROM_CONTINUE(              0x5000, 0x0400)
2587   ROM_CONTINUE(              0x0400, 0x0400)
2588   ROM_LOAD( "ck4.bin",       0x2000, 0x0400, CRC(43827bc6) SHA1(a2ca9afff0dd1bdcfc3a6ead9ff30b7c91caa7ea) )
2589   ROM_CONTINUE(              0x3800, 0x0400)
2590   ROM_CONTINUE(              0x1000, 0x0400)
2591   ROM_CONTINUE(              0x4000, 0x0400)
2592   ROM_LOAD( "ck5.bin",       0x0800, 0x0400, CRC(a74ed96e) SHA1(1e845d693a728fea9d52953b5493ec98fdec63e3) )
2593   ROM_CONTINUE(              0x5400, 0x0400)  // fill
2594   ROM_CONTINUE(              0x2c00, 0x0400)
2595   ROM_CONTINUE(              0x1400, 0x0400)
2596   ROM_LOAD( "ck7.bin",       0x3000, 0x0400, CRC(2c4d8129) SHA1(ab1708ff72ee027106fe8da0caea03a796b3212b) )
2597   ROM_CONTINUE(              0x3c00, 0x0400)
2598
2599   ROM_REGION( 0x2000, "gfx1", 0 )
2600   ROM_LOAD( "ckvid10.bin",   0x0000, 0x1000, CRC(7866d2cb) SHA1(62dd8b80bc0459c7337d8a8cb83e53b999e7f4a9) )
2601   ROM_LOAD( "ckvid7.bin",    0x1000, 0x1000, CRC(7311a101) SHA1(49d54c8b94cae4ba81d7a7684eaa4e87815bb4da) )
2602
2603   ROM_REGION( 0x0020, "proms", 0 )
2604   ROM_LOAD( "ck_cp.bin",     0x0000, 0x0020, CRC(7e0b79cb) SHA1(72ef3eb5f09e10c13dcf6fd568a6d16658055a16) )
2605ROM_END
2606
2607ROM_START( ckongmc )
2608   ROM_REGION( 0x10000, "maincpu", 0 )
2609   ROM_LOAD( "kc1.bin",       0x0000, 0x0800, CRC(a87fc828) SHA1(f66b72427d8cdfabdf2274e22bdb10018ac7d2f9) )
2610   ROM_CONTINUE( 0x2000, 0x0800)
2611   ROM_LOAD( "kc2.bin",       0x0800, 0x0800, CRC(94a13dec) SHA1(d3bfd5a266bb1f0e66d847e15b51bdd4c9a15e37) )
2612   ROM_CONTINUE( 0x2800, 0x0800)
2613   ROM_LOAD( "kc3.bin",       0x1000, 0x0800, CRC(5efc6705) SHA1(9af59a9cb58599b1c7ce0a063929531f6c73b912) )
2614   ROM_CONTINUE( 0x3000, 0x0800)
2615   ROM_LOAD( "kc4.bin",       0x1800, 0x0800, CRC(ac917d66) SHA1(63a0db01bb93e052fec64fa69ebcbae3b0b8aa04) )
2616   ROM_CONTINUE( 0x3800, 0x0800)
2617   ROM_LOAD( "kc5.bin",       0x4000, 0x0800, CRC(5a9ee1ed) SHA1(1bc420a42a4931c389b4f8db451de7c59786dfbc) )
2618   ROM_LOAD( "kc6.bin",       0x4800, 0x0800, CRC(f787431e) SHA1(5cee497b8f4072509920d982470cbe06bd18f88b) )
2619   ROM_LOAD( "kc7.bin",       0x5000, 0x0800, CRC(7a185e31) SHA1(a257f32958af6b2c1c9007b46bd1dc984670b0d9) )
2620
2621   ROM_REGION( 0x2000, "gfx1", 0 )
2622   ROM_LOAD( "kc8carat.bin",   0x0000, 0x1000, CRC(7866d2cb) SHA1(62dd8b80bc0459c7337d8a8cb83e53b999e7f4a9) )
2623   ROM_LOAD( "kc9carat.bin",   0x1000, 0x1000, CRC(7311a101) SHA1(49d54c8b94cae4ba81d7a7684eaa4e87815bb4da) )
2624
2625   ROM_REGION( 0x0020, "proms", 0 ) // not in this set
2626   ROM_LOAD( "ck_cp.bin",     0x0000, 0x0020, CRC(7e0b79cb) SHA1(72ef3eb5f09e10c13dcf6fd568a6d16658055a16) )
2627ROM_END
2628
24922629ROM_START( scramblb )
24932630   ROM_REGION( 0x10000, "maincpu", 0 )
24942631   ROM_LOAD( "scramble.1k",  0x0000, 0x0800, CRC(9e025c4a) SHA1(a8cc9391bdd01a5a2fe7f0c4e889b4e2495df891) )
r7356r7357
25082645   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
25092646ROM_END
25102647
2511
25122648ROM_START( scramb2 )
25132649   ROM_REGION( 0x10000, "maincpu", 0 )
25142650   ROM_LOAD( "r1.7f1",  0x0000, 0x0800, CRC(4a43148c) SHA1(ea27fd3acf661101296a58a7a50fb8e4d5292760) )
r7356r7357
25332669   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
25342670ROM_END
25352671
2536
25372672ROM_START( 4in1 )
25382673   ROM_REGION( 0x20000, "maincpu", 0 )   /* 64k for code  64k for banked code, encrypted */
25392674   /* Menu Code, Fixed at 0xc000 - 0xdfff */
r7356r7357
26012736   ROM_LOAD( "g1-l.bin",     0x0800, 0x0800, CRC(2ae6b5ab) SHA1(59bdebf75d28a247293440ec2ad83eaf30e3de00) )
26022737   ROM_LOAD( "g2-l.bin",     0x1800, 0x0800, CRC(98b37397) SHA1(29914435a10cebbbce04382c45e13a64a0cd18cb) )
26032738
2604
26052739   ROM_REGION( 0x0020, "proms", 0 )
26062740   ROM_LOAD( "bagmanmc.clr", 0x0000, 0x0020, NO_DUMP )   // missing
26072741ROM_END
r7356r7357
26262760   ROM_LOAD( "hustler.clr",  0x0000, 0x0020, CRC(aa1f7f5e) SHA1(311dd17aa11490a1173c76223e4ccccf8ea29850) )
26272761ROM_END
26282762
2629ROM_START( rockclim )
2630
2763ROM_START( porter )
26312764   ROM_REGION( 0x10000, "maincpu", 0 )
2632   ROM_LOAD( "lc01.a1",   0x0000, 0x1000, CRC(8601ae8d) SHA1(6e0c3b34ce5e6879ce7a116c5c2660889a68320d) )
2633   ROM_LOAD( "lc02.a2",   0x1000, 0x1000, CRC(2dde9d4c) SHA1(7e343113116b94894558819a7f77f77e4e952da7) )
2634   ROM_LOAD( "lc03.a3",   0x2000, 0x1000, CRC(82c48a67) SHA1(abf95062eb5c9bd4bb3c9b9af59396a4ca6905d8) )
2635   ROM_LOAD( "lc04.a4",   0x3000, 0x1000, CRC(7cd3a04a) SHA1(756c12288e120e6f761b266b91920d17cab6926c) )
2636   ROM_LOAD( "lc05.a5",   0x6000, 0x1000, CRC(5e542149) SHA1(425a5a8769c3fa0887db8ff04e2a4f32f18d2679) )
2637   ROM_LOAD( "lc06.a6",   0x7000, 0x1000, CRC(b2bdca64) SHA1(e72e63725164c922816dda90ac964a94062eab1b) )
2765   ROM_LOAD( "port1.bin",          0x0000, 0x0800, CRC(babaf7fe) SHA1(2138abf57990df9b6f9953efd3be9b2bede49520) )
2766   ROM_CONTINUE(                   0x2000, 0x0800)
2767   ROM_LOAD( "port2.bin",          0x0800, 0x0800, CRC(8f7eb0e3) SHA1(7ac5bfc0bb8b6a7a3e9acab5ce9a53f7cba1fca5) )
2768   ROM_CONTINUE(                   0x2800, 0x0800)
2769   ROM_LOAD( "port3.bin",          0x1000, 0x0800, CRC(683939b5) SHA1(caf69b03794cb5cf63b1aa52cf8ef355a3aeef87) )
2770   ROM_CONTINUE(                   0x3000, 0x0800)
2771   ROM_LOAD( "port4.bin",          0x1800, 0x0800, CRC(6a65d58d) SHA1(05824a41b2912f12bff7887e7483cb3f4367d339) )
2772   ROM_CONTINUE(                   0x3800,0x0800)
2773   ROM_LOAD( "port5.bin",          0x4000, 0x0800, CRC(2978a9aa) SHA1(99ec75c7f83f4858b26e083b50fde41fbcfe449a) )
2774   ROM_LOAD( "port6.bin",          0x4800, 0x0800, CRC(7ecdffb5) SHA1(18ce71b670503bef039c6bfb0aed5e8c10e9eb2d) )
26382775
26392776   ROM_REGION( 0x2000, "gfx1", 0 )
2640   ROM_LOAD( "lc08.a9",   0x0000, 0x800, CRC(7f18e1ef) SHA1(2a160b994708ec0f06774dde3ec613af7e3f32c6) )
2641   ROM_LOAD( "lc07.a7",   0x0800, 0x800, CRC(f18b50ac) SHA1(a2328eb55882a09403cae1a497c611b494649cac) )
2642   ROM_LOAD( "lc10.c9",   0x1000, 0x800, CRC(dec5781b) SHA1(b6277fc890d153db24bd48293780cf239a6aa0e7) )
2643   ROM_LOAD( "lc09.c7",   0x1800, 0x800, CRC(06c0b5de) SHA1(561cf99a6be03205c7bc5fd15d4d51ee4d6d164b) )
2777   ROM_LOAD( "port7.bin",          0x0000, 0x1000, CRC(603294f9) SHA1(168b90fdf38cd2e2c7f54cde16b4d83dc5bb3046) )
2778   ROM_LOAD( "port8.bin",          0x1000, 0x1000, CRC(b66a763d) SHA1(995b473b1942ff666b0989993587e41e89542172) )
26442779
2645   ROM_REGION( 0x2000, "gfx2", 0 )
2646   ROM_LOAD( "lc13.g5",   0x0000, 0x1000, CRC(19475f2b) SHA1(5d42aa45a7b519dacdecd3d2edbfee6971693034) )
2647   ROM_LOAD( "lc14.g7",   0x1000, 0x1000, CRC(cc96d1db) SHA1(9713b47b723a5d8837f2a8e8c43e46dc41a62e5b) )
2780   ROM_REGION( 0x0020, "proms", 0 ) // not in the set
2781   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, BAD_DUMP CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
2782ROM_END
26482783
2649   ROM_REGION( 0x0040, "proms", 0 )
2650   ROM_LOAD( "lc12.e9",  0x0000, 0x0020, CRC(f6e76547) SHA1(c9ea78d1876156561b3bbf327d7e0299e1d9fd4a) )
2651   ROM_LOAD( "lc11.f4",  0x0020, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2784ROM_START( tazzmang )
2785   ROM_REGION( 0x10000, "maincpu", 0 )
2786   ROM_LOAD( "tazzm1.4k",    0x0000, 0x1000, CRC(a14480a1) SHA1(60dac6b57e8331cc4daedaf87faf3e3acc68f378) )
2787   ROM_LOAD( "tazzm2.5j",    0x1000, 0x1000, CRC(5609f5db) SHA1(3fc50109ea0e012e3e310ae4f5dd0cf460bdca52) )
2788   ROM_LOAD( "tazzm3.6f",    0x2000, 0x1000, CRC(fe7f7002) SHA1(ac4134c07a798328b18994010bcaf6b3f728466a) )
2789   ROM_LOAD( "tazzm4.7e",    0x3000, 0x1000, CRC(c9ca1d0a) SHA1(d420ca2e926174e17215212278c86ba9bbb3d9dc) )
2790   ROM_LOAD( "tazzm5.7l",    0x4000, 0x1000, CRC(f50cd8a6) SHA1(b59ca37171b9acc9854f1beae43cfa5643219a5f) )
2791   ROM_LOAD( "tazzm6.7l",    0x5000, 0x1000, CRC(5cf2e7d2) SHA1(ad89e2655164e0fc5ecc9af70c5f0dd9b094d432) )
2792
2793   ROM_REGION( 0x1000, "gfx1", 0 )
2794   ROM_LOAD( "tazm8.1lk",    0x0000, 0x0800, CRC(2c5b612b) SHA1(32e3a41a9a4a8b1285b6a195213ff0d98012360a) )
2795   ROM_LOAD( "tazzm7.1jh",   0x0800, 0x0800, CRC(3f5ff3ac) SHA1(bc70eef54a45b52c14e35464e5f06b5eec554eb6) )
2796
2797   ROM_REGION( 0x0020, "proms", 0 )
2798   ROM_LOAD( "prom.6l",      0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
26522799ROM_END
26532800
2801ROM_START( bongo )
2802   ROM_REGION( 0x10000, "maincpu", 0 )
2803   ROM_LOAD( "bg1.bin",    0x0000, 0x1000, CRC(de9a8ec6) SHA1(b5ee99b26d1a39e31b643ad0f5723ee8e364023e) )
2804   ROM_LOAD( "bg2.bin",    0x1000, 0x1000, CRC(a19da662) SHA1(a2674392d489c5e5eeb9abc51572a37cc6045220) )
2805   ROM_LOAD( "bg3.bin",    0x2000, 0x1000, CRC(9f6f2150) SHA1(26a1f872686ddddcdb690d7b826ba26c20cdec35) )
2806   ROM_LOAD( "bg4.bin",    0x3000, 0x1000, CRC(f80372d2) SHA1(078e2c8b947103c168c0c85430f8ebc9d09f8ba7) )
2807   ROM_LOAD( "bg5.bin",    0x4000, 0x1000, CRC(fc92eade) SHA1(f4012a1c4631388a3e8109a8381bc4084ddc8757) )
2808   ROM_LOAD( "bg6.bin",    0x5000, 0x1000, CRC(561d9e5d) SHA1(68d7fab3cfb5b3360fe8064c70bf21bb1341032f) )
2809
2810   ROM_REGION( 0x2000, "gfx1", 0 )
2811   ROM_LOAD( "b-h.bin",    0x0000, 0x1000, CRC(fc79d103) SHA1(dac1152221ebdc4cd9bf353b4cc5d45021ca5d9e) )
2812   ROM_LOAD( "b-k.bin",    0x1000, 0x1000, CRC(94d17bf3) SHA1(2a70968249946de52c5a4cfabafbbf4ecda844a8) )
2813
2814   ROM_REGION( 0x0020, "proms", 0 )
2815   ROM_LOAD( "b-clr.bin",  0x0000, 0x0020, CRC(c4761ada) SHA1(067d12b2d3635ffa6337ed234ba42717447bea00) )
2816ROM_END
2817
26542818ROM_START( ozon1 )
26552819   ROM_REGION( 0x10000, "maincpu", 0 )
26562820   ROM_LOAD( "rom1.bin",     0x0000, 0x1000, CRC(54899e8b) SHA1(270af76ae4396ebda767f160535fa77c0b49726a) )
r7356r7357
26862850   ROM_LOAD( "lbuggx.clr", 0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
26872851ROM_END
26882852
2689ROM_START( vpool )
2853/*
2854
2855on a cocktail galaxian pcb (eagle style)
2856
2857this had a CPU daughtercard with 3 unknown prom/pal/gal type things on it:
2858
2859Harris M3-7643-5 x2
2860TI SN746471 ? (number has been partially obliterated on purpose.
2861and a 74ls126
2862
2863The CPU has 'VIDEO STARS - V.S PRO - TEL: 03045 61541' on a sticky label on it.
2864
2865the cpu daughterboard is etched 'competitive video'.
2866
2867The rom daughtercard may not have come from this precise pcb,
2868i think it was on a fullsize pcb according to the spacing of the riser pins.
2869This daughterboard is also etched competitive video, and uses 4 2716's and 3 2732's.
2870
2871there are 8 rom sockets on this daughterboard, 7 are roms, and the final socket is actually a 6116 ram.
2872
2873there is a small prom in the midle of the pcb inbetween the risers,
2874with a circular red labelled saying 'k'. This might be a decryption prom or somethign? i dunno.
2875
2876there is a TBP18s03 PROM installed at 6L which i guess is the colour prom :)
2877
2878I think thats about it.
2879
2880Dumped 26.05.04
2881Andy Welburn
2882www.andys-arcade.com
2883
2884*/
2885
2886/* this rom mapping probably isn't quite right */
2887ROM_START( vstars )
26902888   ROM_REGION( 0x10000, "maincpu", 0 )
2691   ROM_LOAD( "vidpool1.bin", 0x0000, 0x0800, CRC(333f4732) SHA1(b57460c039c69137645bd4280ad877aa789277d6) )
2692   ROM_CONTINUE(             0x2000, 0x0800 )
2693   ROM_LOAD( "vidpool2.bin", 0x0800, 0x0800, CRC(eea6c0f1) SHA1(5b18caa78e246f55fd9cd778d6e83f79f0b3f157) )
2694   ROM_CONTINUE(             0x2800, 0x0800 )
2695   ROM_LOAD( "vidpool3.bin", 0x1000, 0x0800, CRC(309972a6) SHA1(8269d2f677f55dda71d6a7b0796d2d53a4def59d) )
2696   ROM_CONTINUE(             0x3000, 0x0800 )
2697   ROM_LOAD( "vidpool4.bin", 0x1800, 0x0800, CRC(c4f71c1d) SHA1(e1d01135d5ccc1a53308ce89dc2a8fc0992207d5) )
2698   ROM_CONTINUE(             0x3800, 0x0800 )
2889   ROM_LOAD( "c-k2.bin",       0x0000, 0x0400, CRC(b0fcf6c1) SHA1(7dc8a7b99977ea9582c1ed36fa9f1fa502a70c6e) )
2890   ROM_CONTINUE(               0x0800, 0x0400)
2891   ROM_LOAD( "c-k1.bin",       0x0c00, 0x0400, CRC(ea9603b2) SHA1(f72202f17f862c7ea81e556690f8fcb9ee926e7f) )
2892   ROM_CONTINUE(               0x0400, 0x0400)
2893   ROM_LOAD( "c-k4.bin",       0x1c00, 0x0400, CRC(f5743990) SHA1(defd1577b935e3597eba74344dca5626ec2993dd) )
2894   ROM_CONTINUE(               0x1000, 0x0400)
2895   ROM_LOAD( "c-k3.bin",       0x1400, 0x0400, CRC(c4338a77) SHA1(b1ca2d43340b671ef33f3a96ce8e1c286a3e6d80) )
2896   ROM_CONTINUE(               0x1800, 0x0400)
2897   ROM_LOAD( "c-k6.bin",       0x2c00, 0x0400, CRC(184b9d7e) SHA1(80159ab19233ce95e9c74d039b6777d01b32e959) )
2898   ROM_CONTINUE(               0x2000, 0x0400)
2899   ROM_CONTINUE(               0x2400, 0x0400)
2900   ROM_CONTINUE(               0x2800, 0x0400)
2901   ROM_LOAD( "c-k7.bin",       0x4c00, 0x0400, CRC(9ddcc06f) SHA1(63bc77d8b3273681ca4e681105a117d19a0f23a5) )
2902   ROM_CONTINUE(               0x4000, 0x0400)
2903   ROM_CONTINUE(               0x4400, 0x0400)
2904   ROM_CONTINUE(               0x4800, 0x0400)
26992905
2906   /* seems to be data, can't rearrange based on the jumps */
2907   ROM_LOAD( "c-k5.bin",       0x3c00, 0x0400, CRC(d8df2ec4) SHA1(bef1d4b404cddb8a5f9d4e3f30ee09915c602f56) )
2908   ROM_CONTINUE(               0x3000, 0x0400)
2909   ROM_CONTINUE(               0x3400, 0x0400)
2910   ROM_CONTINUE(               0x3800, 0x0400)
2911
2912   /* Crazy Kong gfx?! */
2913   ROM_REGION( 0x2000, "gfx1", 0 )
2914   ROM_LOAD( "1h.bin",   0x0000, 0x1000, CRC(7866d2cb) SHA1(62dd8b80bc0459c7337d8a8cb83e53b999e7f4a9) )
2915   ROM_LOAD( "1k.bin",   0x1000, 0x1000, CRC(7311a101) SHA1(49d54c8b94cae4ba81d7a7684eaa4e87815bb4da) )
2916
2917   ROM_REGION( 0x0020, "proms", 0 )
2918   ROM_LOAD( "6l.bin",     0x0000, 0x0020, CRC(fd81e715) SHA1(eadafe88f26405e6540d4b248b940974e8c31145) )
2919
2920   ROM_REGION( 0x0020, "proms2", 0 )
2921   ROM_LOAD( "k.bin",     0x0000, 0x0020, CRC(d46ed869) SHA1(9c0a11df11b1a24ee933d1aa435337b78c3ca643) )
2922ROM_END
2923
2924ROM_START( harem )
2925   ROM_REGION( 0x10000, "maincpu", 0 )
2926   ROM_LOAD( "p0_ic85.bin",  0x0000, 0x2000, CRC(4521b753) SHA1(9033f9c3be8fec1e5ff251e9f60faaf3848a1a1e) )
2927   ROM_LOAD( "p1_ic87.bin",  0x8000, 0x2000, BAD_DUMP CRC(3cc5d1e8) SHA1(827e2d20de2a00ec016ead249ed3afdccd0c856c) )
2928
2929   ROM_REGION( 0x10000, "audiocpu", 0 )
2930   ROM_LOAD( "s1_ic12.bin",  0x0000, 0x2000, CRC(b54799dd) SHA1(b6aeb010257cba48a52afd33b4f8031c7d99550c) )
2931   ROM_LOAD( "s2_ic13.bin",  0x2000, 0x1000, CRC(2d5573a4) SHA1(1fdcd99d89e078509634742b2116a35bb199fe4b) )
2932
2933   ROM_REGION( 0x2000, "unknown", 0 )
2934   ROM_LOAD( "a1_ic25.bin",  0x0000, 0x2000, CRC(279f923a) SHA1(166b1b625997766f0de7cc18af52c42268022fcb) )
2935
2936   ROM_REGION( 0x4000, "gfx1", 0 )
2937   ROM_LOAD( "m0_ic36.bin",  0x0000, 0x2000, CRC(64b3c6d6) SHA1(e71092585f7ffdae85b2a4c9add1bc71e5a608a8) )
2938   ROM_LOAD( "m1_ic37.bin",  0x2000, 0x2000, CRC(cb0324fb) SHA1(61612f683810339d5d5f31daa4c475d0338d446f) )
2939
2940   ROM_REGION( 0x0020, "proms", 0 )
2941   ROM_LOAD( "harem.clr",    0x0000, 0x0020, CRC(c9a2bf73) SHA1(dad65ebf43a5df147e334afd552e67f5fcd26df7) )
2942ROM_END
2943
2944ROM_START( hunchbkg )
2945   ROM_REGION( 0x8000, "maincpu", 0 )
2946   ROM_LOAD( "gal_hb_1",     0x0000, 0x0800, CRC(46590e9b) SHA1(5d26578c91adec20d8d8a17d5dade9ef2febcbe5) )
2947   ROM_LOAD( "gal_hb_2",     0x0800, 0x0800, CRC(4e6e671c) SHA1(5948fc7f390f0343b367d333395427ce2f9b2931) )
2948   ROM_LOAD( "gal_hb_3",     0x2000, 0x0800, CRC(d29dc242) SHA1(3f6087fe962ee63c2886ad3f502c1a37d357ba87) )
2949   ROM_LOAD( "gal_hb_4",     0x2800, 0x0800, CRC(d409d292) SHA1(d631c9106106b31b605b6fdf1d4f40e237a725ac) )
2950   ROM_LOAD( "gal_hb_5",     0x4000, 0x0800, CRC(29d3a8c4) SHA1(2e1ef20d980e5033503d8095e9576dcb8f532f41) )
2951   ROM_LOAD( "gal_hb_6",     0x4800, 0x0800, CRC(b016fd15) SHA1(cdfbd531e23438f05a7c3aad99a94ce55912aac3) )
2952   ROM_LOAD( "gal_hb_7",     0x6000, 0x0800, CRC(d2731d27) SHA1(8c4a3d2303d85c3b11803c577a9ad21e6e69011e) )
2953   ROM_LOAD( "gal_hb_8",     0x6800, 0x0800, CRC(e4b1a666) SHA1(9f73d17cff208374d587536e783be024fc9ab700) )
2954
27002955   ROM_REGION( 0x1000, "gfx1", 0 )
2701   ROM_LOAD( "hustler.5f", 0x0000, 0x0800, CRC(0bdfad0e) SHA1(8e6f1737604f3801c03fa2e9a5e6a2778b54bae8) ) // vidpoolh.bin
2702   ROM_LOAD( "hustler.5h", 0x0800, 0x0800, CRC(8e062177) SHA1(7e52a1669804b6c2f694cfc64b04abc8246bb0c2) ) // vidpoolk.bin
2956   ROM_LOAD( "gal_hb_kl",    0x0000, 0x0800, CRC(3977650e) SHA1(1de05d6ceed3f2ed0925caa8235b63a93f03f61e) )
2957   ROM_LOAD( "gal_hb_hj",    0x0800, 0x0800, CRC(db489c3d) SHA1(df08607ad07222c1c1c4b3589b50b785bdeefbf2) )
27032958
27042959   ROM_REGION( 0x0020, "proms", 0 )
2705   ROM_LOAD( "hustler.clr",  0x0000, 0x0020, CRC(aa1f7f5e) SHA1(311dd17aa11490a1173c76223e4ccccf8ea29850) )
2960   ROM_LOAD( "gal_hb_cp",    0x0000, 0x0020, CRC(cbff6762) SHA1(4515a6e12a0a5c485a55291feee17a571120a549) )
27062961ROM_END
27072962
27082963ROM_START( drivfrcg )
r7356r7357
27673022   ROM_LOAD( "bot.clr",      0x0020, 0x0020, CRC(0f0782af) SHA1(32c0dd09ead5c70cee2657e9cb8cb9fcf54c5a6a) )
27683023ROM_END
27693024
2770ROM_START( bongo )
2771   ROM_REGION( 0x10000, "maincpu", 0 )
2772   ROM_LOAD( "bg1.bin",    0x0000, 0x1000, CRC(de9a8ec6) SHA1(b5ee99b26d1a39e31b643ad0f5723ee8e364023e) )
2773   ROM_LOAD( "bg2.bin",    0x1000, 0x1000, CRC(a19da662) SHA1(a2674392d489c5e5eeb9abc51572a37cc6045220) )
2774   ROM_LOAD( "bg3.bin",    0x2000, 0x1000, CRC(9f6f2150) SHA1(26a1f872686ddddcdb690d7b826ba26c20cdec35) )
2775   ROM_LOAD( "bg4.bin",    0x3000, 0x1000, CRC(f80372d2) SHA1(078e2c8b947103c168c0c85430f8ebc9d09f8ba7) )
2776   ROM_LOAD( "bg5.bin",    0x4000, 0x1000, CRC(fc92eade) SHA1(f4012a1c4631388a3e8109a8381bc4084ddc8757) )
2777   ROM_LOAD( "bg6.bin",    0x5000, 0x1000, CRC(561d9e5d) SHA1(68d7fab3cfb5b3360fe8064c70bf21bb1341032f) )
2778
2779   ROM_REGION( 0x2000, "gfx1", 0 )
2780   ROM_LOAD( "b-h.bin",    0x0000, 0x1000, CRC(fc79d103) SHA1(dac1152221ebdc4cd9bf353b4cc5d45021ca5d9e) )
2781   ROM_LOAD( "b-k.bin",    0x1000, 0x1000, CRC(94d17bf3) SHA1(2a70968249946de52c5a4cfabafbbf4ecda844a8) )
2782
2783   ROM_REGION( 0x0020, "proms", 0 )
2784   ROM_LOAD( "b-clr.bin",  0x0000, 0x0020, CRC(c4761ada) SHA1(067d12b2d3635ffa6337ed234ba42717447bea00) )
2785ROM_END
2786
2787ROM_START( hunchbkg )
2788   ROM_REGION( 0x8000, "maincpu", 0 )
2789   ROM_LOAD( "gal_hb_1",     0x0000, 0x0800, CRC(46590e9b) SHA1(5d26578c91adec20d8d8a17d5dade9ef2febcbe5) )
2790   ROM_LOAD( "gal_hb_2",     0x0800, 0x0800, CRC(4e6e671c) SHA1(5948fc7f390f0343b367d333395427ce2f9b2931) )
2791   ROM_LOAD( "gal_hb_3",     0x2000, 0x0800, CRC(d29dc242) SHA1(3f6087fe962ee63c2886ad3f502c1a37d357ba87) )
2792   ROM_LOAD( "gal_hb_4",     0x2800, 0x0800, CRC(d409d292) SHA1(d631c9106106b31b605b6fdf1d4f40e237a725ac) )
2793   ROM_LOAD( "gal_hb_5",     0x4000, 0x0800, CRC(29d3a8c4) SHA1(2e1ef20d980e5033503d8095e9576dcb8f532f41) )
2794   ROM_LOAD( "gal_hb_6",     0x4800, 0x0800, CRC(b016fd15) SHA1(cdfbd531e23438f05a7c3aad99a94ce55912aac3) )
2795   ROM_LOAD( "gal_hb_7",     0x6000, 0x0800, CRC(d2731d27) SHA1(8c4a3d2303d85c3b11803c577a9ad21e6e69011e) )
2796   ROM_LOAD( "gal_hb_8",     0x6800, 0x0800, CRC(e4b1a666) SHA1(9f73d17cff208374d587536e783be024fc9ab700) )
2797
2798   ROM_REGION( 0x1000, "gfx1", 0 )
2799   ROM_LOAD( "gal_hb_kl",    0x0000, 0x0800, CRC(3977650e) SHA1(1de05d6ceed3f2ed0925caa8235b63a93f03f61e) )
2800   ROM_LOAD( "gal_hb_hj",    0x0800, 0x0800, CRC(db489c3d) SHA1(df08607ad07222c1c1c4b3589b50b785bdeefbf2) )
2801
2802   ROM_REGION( 0x0020, "proms", 0 )
2803   ROM_LOAD( "gal_hb_cp",    0x0000, 0x0020, CRC(cbff6762) SHA1(4515a6e12a0a5c485a55291feee17a571120a549) )
2804ROM_END
2805
2806ROM_START( harem )
2807   ROM_REGION( 0x10000, "maincpu", 0 )
2808   ROM_LOAD( "p0_ic85.bin",  0x0000, 0x2000, CRC(4521b753) SHA1(9033f9c3be8fec1e5ff251e9f60faaf3848a1a1e) )
2809   ROM_LOAD( "p1_ic87.bin",  0x8000, 0x2000, BAD_DUMP CRC(3cc5d1e8) SHA1(827e2d20de2a00ec016ead249ed3afdccd0c856c) )
2810
2811   ROM_REGION( 0x10000, "audiocpu", 0 )
2812   ROM_LOAD( "s1_ic12.bin",  0x0000, 0x2000, CRC(b54799dd) SHA1(b6aeb010257cba48a52afd33b4f8031c7d99550c) )
2813   ROM_LOAD( "s2_ic13.bin",  0x2000, 0x1000, CRC(2d5573a4) SHA1(1fdcd99d89e078509634742b2116a35bb199fe4b) )
2814
2815   ROM_REGION( 0x2000, "unknown", 0 )
2816   ROM_LOAD( "a1_ic25.bin",  0x0000, 0x2000, CRC(279f923a) SHA1(166b1b625997766f0de7cc18af52c42268022fcb) )
2817
2818   ROM_REGION( 0x4000, "gfx1", 0 )
2819   ROM_LOAD( "m0_ic36.bin",  0x0000, 0x2000, CRC(64b3c6d6) SHA1(e71092585f7ffdae85b2a4c9add1bc71e5a608a8) )
2820   ROM_LOAD( "m1_ic37.bin",  0x2000, 0x2000, CRC(cb0324fb) SHA1(61612f683810339d5d5f31daa4c475d0338d446f) )
2821
2822   ROM_REGION( 0x0020, "proms", 0 )
2823   ROM_LOAD( "harem.clr",    0x0000, 0x0020, CRC(c9a2bf73) SHA1(dad65ebf43a5df147e334afd552e67f5fcd26df7) )
2824ROM_END
2825
2826ROM_START( tazzmang )
2827   ROM_REGION( 0x10000, "maincpu", 0 )
2828   ROM_LOAD( "tazzm1.4k",    0x0000, 0x1000, CRC(a14480a1) SHA1(60dac6b57e8331cc4daedaf87faf3e3acc68f378) )
2829   ROM_LOAD( "tazzm2.5j",    0x1000, 0x1000, CRC(5609f5db) SHA1(3fc50109ea0e012e3e310ae4f5dd0cf460bdca52) )
2830   ROM_LOAD( "tazzm3.6f",    0x2000, 0x1000, CRC(fe7f7002) SHA1(ac4134c07a798328b18994010bcaf6b3f728466a) )
2831   ROM_LOAD( "tazzm4.7e",    0x3000, 0x1000, CRC(c9ca1d0a) SHA1(d420ca2e926174e17215212278c86ba9bbb3d9dc) )
2832   ROM_LOAD( "tazzm5.7l",    0x4000, 0x1000, CRC(f50cd8a6) SHA1(b59ca37171b9acc9854f1beae43cfa5643219a5f) )
2833   ROM_LOAD( "tazzm6.7l",    0x5000, 0x1000, CRC(5cf2e7d2) SHA1(ad89e2655164e0fc5ecc9af70c5f0dd9b094d432) )
2834
2835   ROM_REGION( 0x1000, "gfx1", 0 )
2836   ROM_LOAD( "tazm8.1lk",    0x0000, 0x0800, CRC(2c5b612b) SHA1(32e3a41a9a4a8b1285b6a195213ff0d98012360a) )
2837   ROM_LOAD( "tazzm7.1jh",   0x0800, 0x0800, CRC(3f5ff3ac) SHA1(bc70eef54a45b52c14e35464e5f06b5eec554eb6) )
2838
2839   ROM_REGION( 0x0020, "proms", 0 )
2840   ROM_LOAD( "prom.6l",      0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
2841ROM_END
2842
28433025ROM_START( racknrol )
28443026   ROM_REGION( 0x8000, "maincpu", 0 )
28453027   ROM_LOAD( "horz_p.bin",   0x0000, 0x1000, CRC(32ca5b43) SHA1(f3e7662f947dcdd80f6eae4f002d2fe64a825aff) )
r7356r7357
29153097   ROM_LOAD( "senko1.bin",   0x0000, 0x0020, CRC(1434c7ff) SHA1(0ee5f5351dd84fbf8d3d8eaafbdbe86dd29960f8) )
29163098ROM_END
29173099
2918/*
2919Crazy Kong
2920Bootleg, 1982
2921
2922PCB Layout
2923----------
2924
2925|----------------------------------------------|
2926|        AY3-8910    MB7051          2125 2125 |
2927| LM3900     ROM.5S  MB7051          2125 2125 |
2928|                    MB7051          2125 2125 |
2929|            ROM.5R                            |
2930|                                              |
2931|1           ROM.5N                            |
2932|8                                             |
2933|W           ROM.5M               ROM.11N      |
2934|A                                ROM.11L      |
2935|Y           ROM.5K          2114 ROM.11K      |
2936|   VOL                      2114 ROM.11H      |
2937|            ROM.5H 2114                       |
2938|  Z80              2114                       |
2939|            ROM.5F                            |
2940|     2114                                     |
2941|     2114   ROM.5D              5101 ROM.11C  |
2942|                                              |
2943|HA1368 DSW(8) 6116  18.432MHz   5101 ROM.11A  |
2944|----------------------------------------------|
2945Notes:
2946      Z80     : Clock running at 3.072MHz (18.432/6)
2947      AY3-8910: Clock running at 1.536MHz (18.432/12)
2948      2125    : 1K x1 SRAM (DIP16)
2949      2114    : 1K x4 SRAM (DIP18)
2950      6116    : 2K x8 SRAM (DIP24)
2951      5101    : 256 x4 SRAM (SDIP22)
2952      LM3900  : National Semiconductor LM3900 Quadruple Norton Operational Amplifier (DIP14)
2953      HA1368  : Hitachi HA1368 18V, 4.5A, 5.3W Audio Power Amplifier IC
2954      MB7051  : Hitachi MB7051 32bytes x8 Bipolar PROM (DIP16)
2955*/
2956
2957ROM_START( ckongg )
2958   ROM_REGION( 0x10000, "maincpu", 0 )
2959   ROM_LOAD( "ck1.bin",       0x2400, 0x0400, CRC(a4323b94) SHA1(1fed47e1df5efa8f40585bedab07b60067edc2bb) )
2960   ROM_CONTINUE(              0x1C00, 0x0400)
2961   ROM_CONTINUE(              0x4800, 0x0400)
2962   ROM_CONTINUE(              0x0C00, 0x0400)
2963   ROM_LOAD( "ck2.bin",       0x4400, 0x0400, CRC(1e532996) SHA1(fe1feeca347fccd266925614a46c98cff683f5d3) )
2964   ROM_CONTINUE(              0x0000, 0x0400)
2965   ROM_CONTINUE(              0x1800, 0x0400)
2966   ROM_CONTINUE(              0x2800, 0x0400)
2967   ROM_LOAD( "ck3.bin",       0x3400, 0x0400, CRC(65157cde) SHA1(572b9bd56894600e21220356d0bf193c7920672c) )
2968   ROM_CONTINUE(              0x4c00, 0x0400)
2969   ROM_CONTINUE(              0x5000, 0x0400)
2970   ROM_CONTINUE(              0x0400, 0x0400)
2971   ROM_LOAD( "ck4.bin",       0x2000, 0x0400, CRC(43827bc6) SHA1(a2ca9afff0dd1bdcfc3a6ead9ff30b7c91caa7ea) )
2972   ROM_CONTINUE(              0x3800, 0x0400)
2973   ROM_CONTINUE(              0x1000, 0x0400)
2974   ROM_CONTINUE(              0x4000, 0x0400)
2975   ROM_LOAD( "ck5.bin",       0x0800, 0x0400, CRC(a74ed96e) SHA1(1e845d693a728fea9d52953b5493ec98fdec63e3) )
2976   ROM_CONTINUE(              0x5400, 0x0400)  // fill
2977   ROM_CONTINUE(              0x2c00, 0x0400)
2978   ROM_CONTINUE(              0x1400, 0x0400)
2979   ROM_LOAD( "ck7.bin",       0x3000, 0x0400, CRC(2c4d8129) SHA1(ab1708ff72ee027106fe8da0caea03a796b3212b) )
2980   ROM_CONTINUE(              0x3c00, 0x0400)
2981
2982   ROM_REGION( 0x2000, "gfx1", 0 )
2983   ROM_LOAD( "ckvid10.bin",   0x0000, 0x1000, CRC(7866d2cb) SHA1(62dd8b80bc0459c7337d8a8cb83e53b999e7f4a9) )
2984   ROM_LOAD( "ckvid7.bin",    0x1000, 0x1000, CRC(7311a101) SHA1(49d54c8b94cae4ba81d7a7684eaa4e87815bb4da) )
2985
2986   ROM_REGION( 0x0020, "proms", 0 )
2987   ROM_LOAD( "ck_cp.bin",     0x0000, 0x0020, CRC(7e0b79cb) SHA1(72ef3eb5f09e10c13dcf6fd568a6d16658055a16) )
2988ROM_END
2989
2990ROM_START( ckongmc )
2991   ROM_REGION( 0x10000, "maincpu", 0 )
2992   ROM_LOAD( "kc1.bin",       0x0000, 0x0800, CRC(a87fc828) SHA1(f66b72427d8cdfabdf2274e22bdb10018ac7d2f9) )
2993   ROM_CONTINUE( 0x2000, 0x0800)
2994   ROM_LOAD( "kc2.bin",       0x0800, 0x0800, CRC(94a13dec) SHA1(d3bfd5a266bb1f0e66d847e15b51bdd4c9a15e37) )
2995   ROM_CONTINUE( 0x2800, 0x0800)
2996   ROM_LOAD( "kc3.bin",       0x1000, 0x0800, CRC(5efc6705) SHA1(9af59a9cb58599b1c7ce0a063929531f6c73b912) )
2997   ROM_CONTINUE( 0x3000, 0x0800)
2998   ROM_LOAD( "kc4.bin",       0x1800, 0x0800, CRC(ac917d66) SHA1(63a0db01bb93e052fec64fa69ebcbae3b0b8aa04) )
2999   ROM_CONTINUE( 0x3800, 0x0800)
3000   ROM_LOAD( "kc5.bin",       0x4000, 0x0800, CRC(5a9ee1ed) SHA1(1bc420a42a4931c389b4f8db451de7c59786dfbc) )
3001   ROM_LOAD( "kc6.bin",       0x4800, 0x0800, CRC(f787431e) SHA1(5cee497b8f4072509920d982470cbe06bd18f88b) )
3002   ROM_LOAD( "kc7.bin",       0x5000, 0x0800, CRC(7a185e31) SHA1(a257f32958af6b2c1c9007b46bd1dc984670b0d9) )
3003
3004   ROM_REGION( 0x2000, "gfx1", 0 )
3005   ROM_LOAD( "kc8carat.bin",   0x0000, 0x1000, CRC(7866d2cb) SHA1(62dd8b80bc0459c7337d8a8cb83e53b999e7f4a9) )
3006   ROM_LOAD( "kc9carat.bin",   0x1000, 0x1000, CRC(7311a101) SHA1(49d54c8b94cae4ba81d7a7684eaa4e87815bb4da) )
3007
3008   ROM_REGION( 0x0020, "proms", 0 ) // not in this set
3009   ROM_LOAD( "ck_cp.bin",     0x0000, 0x0020, CRC(7e0b79cb) SHA1(72ef3eb5f09e10c13dcf6fd568a6d16658055a16) )
3010ROM_END
3011
3012
3013ROM_START( porter )
3014   ROM_REGION( 0x10000, "maincpu", 0 )
3015   ROM_LOAD( "port1.bin",          0x0000, 0x0800, CRC(babaf7fe) SHA1(2138abf57990df9b6f9953efd3be9b2bede49520) )
3016   ROM_CONTINUE(                   0x2000, 0x0800)
3017   ROM_LOAD( "port2.bin",          0x0800, 0x0800, CRC(8f7eb0e3) SHA1(7ac5bfc0bb8b6a7a3e9acab5ce9a53f7cba1fca5) )
3018   ROM_CONTINUE(                   0x2800, 0x0800)
3019   ROM_LOAD( "port3.bin",          0x1000, 0x0800, CRC(683939b5) SHA1(caf69b03794cb5cf63b1aa52cf8ef355a3aeef87) )
3020   ROM_CONTINUE(                   0x3000, 0x0800)
3021   ROM_LOAD( "port4.bin",          0x1800, 0x0800, CRC(6a65d58d) SHA1(05824a41b2912f12bff7887e7483cb3f4367d339) )
3022   ROM_CONTINUE(                   0x3800,0x0800)
3023   ROM_LOAD( "port5.bin",          0x4000, 0x0800, CRC(2978a9aa) SHA1(99ec75c7f83f4858b26e083b50fde41fbcfe449a) )
3024   ROM_LOAD( "port6.bin",          0x4800, 0x0800, CRC(7ecdffb5) SHA1(18ce71b670503bef039c6bfb0aed5e8c10e9eb2d) )
3025
3026   ROM_REGION( 0x2000, "gfx1", 0 )
3027   ROM_LOAD( "port7.bin",          0x0000, 0x1000, CRC(603294f9) SHA1(168b90fdf38cd2e2c7f54cde16b4d83dc5bb3046) )
3028   ROM_LOAD( "port8.bin",          0x1000, 0x1000, CRC(b66a763d) SHA1(995b473b1942ff666b0989993587e41e89542172) )
3029
3030   ROM_REGION( 0x0020, "proms", 0 ) // not in the set
3031   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, BAD_DUMP CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* Compatible with 82s123 prom */
3032ROM_END
3033
3034
3035/*
3036
3037on a cocktail galaxian pcb (eagle style)
3038
3039this had a CPU daughtercard with 3 unknown prom/pal/gal type things on it:
3040
3041Harris M3-7643-5 x2
3042TI SN746471 ? (number has been partially obliterated on purpose.
3043and a 74ls126
3044
3045The CPU has 'VIDEO STARS - V.S PRO - TEL: 03045 61541' on a sticky label on it.
3046
3047the cpu daughterboard is etched 'competitive video'.
3048
3049The rom daughtercard may not have come from this precise pcb,
3050i think it was on a fullsize pcb according to the spacing of the riser pins.
3051This daughterboard is also etched competitive video, and uses 4 2716's and 3 2732's.
3052
3053there are 8 rom sockets on this daughterboard, 7 are roms, and the final socket is actually a 6116 ram.
3054
3055there is a small prom in the midle of the pcb inbetween the risers,
3056with a circular red labelled saying 'k'. This might be a decryption prom or somethign? i dunno.
3057
3058there is a TBP18s03 PROM installed at 6L which i guess is the colour prom :)
3059
3060I think thats about it.
3061
3062Dumped 26.05.04
3063Andy Welburn
3064www.andys-arcade.com
3065
3066*/
3067
3068/* this rom mapping probably isn't quite right */
3069ROM_START( vstars )
3070   ROM_REGION( 0x10000, "maincpu", 0 )
3071   ROM_LOAD( "c-k2.bin",       0x0000, 0x0400, CRC(b0fcf6c1) SHA1(7dc8a7b99977ea9582c1ed36fa9f1fa502a70c6e) )
3072   ROM_CONTINUE(               0x0800, 0x0400)
3073   ROM_LOAD( "c-k1.bin",       0x0c00, 0x0400, CRC(ea9603b2) SHA1(f72202f17f862c7ea81e556690f8fcb9ee926e7f) )
3074   ROM_CONTINUE(               0x0400, 0x0400)
3075   ROM_LOAD( "c-k4.bin",       0x1c00, 0x0400, CRC(f5743990) SHA1(defd1577b935e3597eba74344dca5626ec2993dd) )
3076   ROM_CONTINUE(               0x1000, 0x0400)
3077   ROM_LOAD( "c-k3.bin",       0x1400, 0x0400, CRC(c4338a77) SHA1(b1ca2d43340b671ef33f3a96ce8e1c286a3e6d80) )
3078   ROM_CONTINUE(               0x1800, 0x0400)
3079   ROM_LOAD( "c-k6.bin",       0x2c00, 0x0400, CRC(184b9d7e) SHA1(80159ab19233ce95e9c74d039b6777d01b32e959) )
3080   ROM_CONTINUE(               0x2000, 0x0400)
3081   ROM_CONTINUE(               0x2400, 0x0400)
3082   ROM_CONTINUE(               0x2800, 0x0400)
3083   ROM_LOAD( "c-k7.bin",       0x4c00, 0x0400, CRC(9ddcc06f) SHA1(63bc77d8b3273681ca4e681105a117d19a0f23a5) )
3084   ROM_CONTINUE(               0x4000, 0x0400)
3085   ROM_CONTINUE(               0x4400, 0x0400)
3086   ROM_CONTINUE(               0x4800, 0x0400)
3087
3088   /* seems to be data, can't rearrange based on the jumps */
3089   ROM_LOAD( "c-k5.bin",       0x3c00, 0x0400, CRC(d8df2ec4) SHA1(bef1d4b404cddb8a5f9d4e3f30ee09915c602f56) )
3090   ROM_CONTINUE(               0x3000, 0x0400)
3091   ROM_CONTINUE(               0x3400, 0x0400)
3092   ROM_CONTINUE(               0x3800, 0x0400)
3093
3094   /* Crazy Kong gfx?! */
3095   ROM_REGION( 0x2000, "gfx1", 0 )
3096   ROM_LOAD( "1h.bin",   0x0000, 0x1000, CRC(7866d2cb) SHA1(62dd8b80bc0459c7337d8a8cb83e53b999e7f4a9) )
3097   ROM_LOAD( "1k.bin",   0x1000, 0x1000, CRC(7311a101) SHA1(49d54c8b94cae4ba81d7a7684eaa4e87815bb4da) )
3098
3099   ROM_REGION( 0x0020, "proms", 0 )
3100   ROM_LOAD( "6l.bin",     0x0000, 0x0020, CRC(fd81e715) SHA1(eadafe88f26405e6540d4b248b940974e8c31145) )
3101
3102   ROM_REGION( 0x0020, "proms2", 0 )
3103   ROM_LOAD( "k.bin",     0x0000, 0x0020, CRC(d46ed869) SHA1(9c0a11df11b1a24ee933d1aa435337b78c3ca643) )
3104ROM_END
3105
3106GAME( 1981, scramblb, scramble, scramblb, scramblb, 0,        ROT90,  "bootleg", "Scramble (Galaxian hardware)", GAME_SUPPORTS_SAVE )
3107GAME( 1981, scramb2,  scramble, scramb2,  scramb2,  0,        ROT90,  "bootleg", "Scramble (bootleg)", GAME_SUPPORTS_SAVE )
3108
3109GAME( 1981, 4in1,     0,        4in1,     4in1,     4in1,     ROT90,  "Armenia / Food and Fun", "4 Fun in 1", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
3110GAME( 1982, bagmanmc, bagman,   bagmanmc, bagmanmc, 0,        ROT90,  "bootleg", "Bagman (Moon Cresta hardware)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
3111GAME( 1982, dkongjrm, dkongjr,  dkongjrm, dkongjrm, 0,        ROT90,  "bootleg", "Donkey Kong Jr. (Moon Cresta hardware)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
3100/* Z80 games */
3101GAME( 1980, vpool,    hustler,  mooncrst, vpool,    0,        ROT90,  "bootleg", "Video Pool (bootleg on Moon Cresta hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
31123102GAME( 1981, rockclim, 0,        rockclim, rockclim, 0,         ROT180, "Taito", "Rock Climber", GAME_SUPPORTS_SAVE )
3113GAME( 1983, ozon1,    0,        ozon1,    ozon1,    0,         ROT90,  "Proma", "Ozon I", GAME_SUPPORTS_SAVE )
3114GAME( 1983, ladybugg, ladybug,  batman2,  ladybugg, ladybugg, ROT270, "bootleg", "Lady Bug (bootleg on Galaxian hardware)", GAME_SUPPORTS_SAVE )
3115GAME( 1980, vpool,    hustler,  mooncrst, vpool,    0,        ROT90,  "bootleg", "Video Pool (bootleg on Moon Cresta hardware)", GAME_SUPPORTS_SAVE )
3103GAME( 1981, ckongg,   ckong,    ckongg,   ckongg,   0,        ROT90,  "bootleg", "Crazy Kong (bootleg on Galaxian hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3104GAME( 1981, ckongmc,  ckong,    ckongmc,  ckongmc,  0,        ROT90,  "bootleg", "Crazy Kong (bootleg on Moon Cresta hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // set was marked as 'King Kong on Galaxian'
3105GAME( 1981, scramblb, scramble, scramblb, scramblb, 0,        ROT90,  "bootleg", "Scramble (bootleg on Galaxian hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3106GAME( 1981, scramb2,  scramble, scramb2,  scramb2,  0,        ROT90,  "bootleg", "Scramble (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3107GAME( 1981, 4in1,     0,        4in1,     4in1,     4in1,     ROT90,  "Armenia / Food and Fun", "4 Fun in 1", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
3108GAME( 1982, bagmanmc, bagman,   bagmanmc, bagmanmc, 0,        ROT90,  "bootleg", "Bagman (bootleg on Moon Cresta hardware)", GAME_WRONG_COLORS | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3109GAME( 1982, dkongjrm, dkongjr,  dkongjrm, dkongjrm, 0,        ROT90,  "bootleg", "Donkey Kong Jr. (bootleg on Moon Cresta hardware)", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3110GAME( 1982, porter,   dockman,  mooncrst, porter,   0,        ROT90,  "bootleg", "Port Man (bootleg on Moon Cresta hardware)", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL ) // missing GFX bank switch!
3111GAME( 1982, tazzmang, tazmania,   tazzmang, tazzmang, 0,        ROT90,  "bootleg", "Tazz-Mania (bootleg on Galaxian hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3112GAME( 1983, bongo,    0,        bongo,    bongo,    0,         ROT90,  "Jetsoft", "Bongo", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3113GAME( 1983, ozon1,    0,        ozon1,    ozon1,    0,         ROT90,  "Proma", "Ozon I", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3114GAME( 1983, ladybugg, ladybug,  batman2,  ladybugg, ladybugg, ROT270, "bootleg", "Lady Bug (bootleg on Galaxian hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3115GAME( 1982, vstars,   0,        mooncrst, porter,   0,        ROT90,  "Competitive Video?", "Video Stars", GAME_NOT_WORKING )
3116GAME( 1983, harem,    0,        harem,    harem,    0,        ROT90,  "I.G.R.", "Harem", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
3117
3118/* S2650 games */
3119GAME( 1983, hunchbkg, hunchbak,   hunchbkg, hunchbkg, 0,        ROT90,  "Century Electronics", "Hunchback (Galaxian hardware)", GAME_SUPPORTS_SAVE )
31163120GAME( 1984, drivfrcg, drivfrcp, drivfrcg, drivfrcg, 0,        ROT90,  "Shinkai Inc. (Magic Eletronics USA licence)", "Driving Force (Galaxian conversion)", GAME_SUPPORTS_SAVE )
31173121GAME( 1985, drivfrcb, drivfrcp, drivfrcg, drivfrcg, 0,        ROT90,  "bootleg", "Driving Force (Galaxian conversion bootleg)", GAME_SUPPORTS_SAVE )
3118GAME( 1983, bongo,    0,        bongo,    bongo,    0,         ROT90,  "Jetsoft", "Bongo", GAME_SUPPORTS_SAVE )
3119GAME( 1983, hunchbkg, hunchbak,   hunchbkg, hunchbkg, 0,        ROT90,  "Century Electronics", "Hunchback (Galaxian hardware)", GAME_SUPPORTS_SAVE )
3120GAME( 1983, harem,    0,        harem,    harem,    0,        ROT90,  "I.G.R.", "Harem", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
3121GAME( 1982, tazzmang, tazmania,   tazzmang, tazzmang, 0,        ROT90,  "bootleg", "Tazz-Mania (Galaxian Hardware)", GAME_SUPPORTS_SAVE )
31223122GAME( 1986, racknrol, 0,        racknrol, racknrol, 0,         ROT0,   "Status (Shinkai License)", "Rack + Roll", GAME_SUPPORTS_SAVE )
31233123GAME( 1986, hexpool,  racknrol, racknrol, racknrol, 0,         ROT90,  "Shinkai", "Hex Pool (Shinkai)", GAME_SUPPORTS_SAVE )
31243124GAME( 1985, hexpoola, racknrol, hexpoola, racknrol, 0,         ROT90,  "Senko", "Hex Pool (Senko)", GAME_SUPPORTS_SAVE )
31253125GAME( 1985, trvchlng, 0,        racknrol, trvchlng, 0,         ROT90,  "Joyland (Senko License)", "Trivia Challenge", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
3126GAME( 1981, ckongg,   0,        ckongg,   ckongg,   0,        ROT90,  "bootleg", "Crazy Kong (bootleg on Galaxian hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3127GAME( 1981, ckongmc,  ckongg,   ckongmc,  ckongmc,  0,        ROT90,  "bootleg", "Crazy Kong (bootleg on Moon Cresta hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // set was marked as 'King Kong on Galaxian'
3128GAME( 1982, porter,   0,        mooncrst, porter,   0,        ROT90,  "[Nova Games Ltd.] (bootleg)", "Port Man (bootleg on Moon Cresta hardware)", GAME_IMPERFECT_GRAPHICS ) // missing GFX bank switch!
3129GAME( 1982, vstars,   0,        mooncrst, porter,   0,        ROT90,  "Competitive Video?", "Video Stars", GAME_NOT_WORKING )
src/mame/drivers/ssgbl.c
r7356r7357
11#include "emu.h"
2#include "megadriv.h"
2#include "includes/megadriv.h"
33
44/* Sunset Riders bootleg - based on Genesis / Megadrive version
55
src/mame/drivers/dec0.c
r7356r7357
858858   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)
859859INPUT_PORTS_END
860860
861static INPUT_PORTS_START( midresb )
862   PORT_INCLUDE( dec0 )
863
864   PORT_START("DSW")
865   DEC0_COIN_SETTING
866   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:5" )   // Always OFF
867   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6")
868   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
869   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
870   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7")
871   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
872   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
873   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" )   // Always OFF
874
875   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
876   PORT_DIPSETTING(      0x0300, "3" )
877   PORT_DIPSETTING(      0x0200, "4" )
878   PORT_DIPSETTING(      0x0100, "5" )
879   PORT_DIPSETTING(      0x0000, "Infinite (Cheat)")
880   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
881   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
882   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
883   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
884   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
885   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )  PORT_DIPLOCATION("SW2:5")   /* manual mentions Extra Lives - Default OFF */
886   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
887   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
888   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )  PORT_DIPLOCATION("SW2:6")   /* manual mentions Extra Lives - Default OFF */
889   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
890   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
891   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Allow_Continue ) )  PORT_DIPLOCATION("SW2:7")
892   PORT_DIPSETTING(      0x4000, DEF_STR( No ) )
893   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
894   PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" )   // Always OFF
895
896   PORT_START("AN0")   /* player 1 12-way rotary control - converted in controls_r() */
897   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)
898
899   PORT_START("AN1")   /* player 2 12-way rotary control - converted in controls_r() */
900   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)
901INPUT_PORTS_END
902
861903static INPUT_PORTS_START( bouldash )
862904   PORT_INCLUDE( dec1 )
863905
r7356r7357
15281570   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.40)
15291571MACHINE_DRIVER_END
15301572
1573static MACHINE_DRIVER_START( midresb )
1574   MDRV_IMPORT_FROM(midres)
1575
1576   MDRV_CPU_REPLACE("audiocpu", M6502, 1500000 )
1577   MDRV_CPU_PROGRAM_MAP(dec0_s_map)
1578
1579   MDRV_SOUND_MODIFY("ym2")
1580   MDRV_SOUND_CONFIG(ym3812_config)
1581   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
1582MACHINE_DRIVER_END
1583
15311584/******************************************************************************/
15321585
15331586ROM_START( hbarrel )
r7356r7357
28532906   dump_to_file(machine,R, 0x70000, 0x08000);
28542907}
28552908#endif
2909
2910static DRIVER_INIT( midresb )
2911{
2912   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x00180000, 0x0018000f, 0, 0,  dec0_controls_r );
2913   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x001a0000, 0x001a000f, 0, 0,  dec0_rotary_r );
2914
2915   memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x00180014, 0x00180015, 0, 0, midres_sound_w );
2916}
2917
28562918/******************************************************************************/
28572919
28582920GAME( 1987, hbarrel,  0,        hbarrel,  hbarrel,  hbarrel,  ROT270, "Data East USA",         "Heavy Barrel (US)", 0 )
r7356r7357
28792941GAME( 1989, midres,   0,        midres,   midres,   0,        ROT0,   "Data East Corporation", "Midnight Resistance (World)", 0 )
28802942GAME( 1989, midresu,  midres,   midres,   midres,   0,        ROT0,   "Data East USA",         "Midnight Resistance (US)", 0 )
28812943GAME( 1989, midresj,  midres,   midres,   midres,   0,        ROT0,   "Data East Corporation", "Midnight Resistance (Japan)", 0 )
2882GAME( 1989, midresb,  midres,   midres,  midres,  0,        ROT0,   "bootleg",               "Midnight Resistance (bootleg with 68705)", GAME_NOT_WORKING ) // need to hook up 68705
2944GAME( 1989, midresb,  midres,   midresb,  midresb,  midresb,  ROT0,   "bootleg",               "Midnight Resistance (bootleg with 68705)", 0 ) // need to hook up 68705?
28832945GAME( 1990, bouldash, 0,        slyspy,   bouldash, slyspy,   ROT0,   "Data East Corporation (licensed from First Star)", "Boulder Dash / Boulder Dash Part 2 (World)", 0 )
28842946GAME( 1990, bouldashj,bouldash, slyspy,   bouldash, slyspy,   ROT0,   "Data East Corporation (licensed from First Star)", "Boulder Dash / Boulder Dash Part 2 (Japan)", 0 )
src/mame/drivers/firebeat.c
r7356r7357
23472347
23482348/*****************************************************************************/
23492349
2350GAME( 2000, ppp,     0,       firebeat,      ppp,    ppp,      ROT0,   "Konami",  "ParaParaParadise", GAME_NOT_WORKING)
2350GAME( 2000, ppp,      0,       firebeat,      ppp,    ppp,      ROT0,   "Konami",  "ParaParaParadise", GAME_NOT_WORKING)
23512351GAME( 2000, ppd,      0,       firebeat,      ppp,    ppd,      ROT0,   "Konami",  "ParaParaDancing", GAME_NOT_WORKING)
2352GAME( 2000, ppp11,     0,       firebeat,      ppp,    ppp,      ROT0,   "Konami",  "ParaParaParadise v1.1", GAME_NOT_WORKING)
2352GAME( 2000, ppp11,    0,       firebeat,      ppp,    ppp,      ROT0,   "Konami",  "ParaParaParadise v1.1", GAME_NOT_WORKING)
23532353GAMEL(2000, kbm,      0,       firebeat2,     kbm,    kbm,    ROT270,   "Konami",  "Keyboardmania", GAME_NOT_WORKING, layout_firebeat)
23542354GAMEL(2000, kbm2nd,   0,       firebeat2,     kbm,    kbm,    ROT270,   "Konami",  "Keyboardmania 2nd Mix", GAME_NOT_WORKING, layout_firebeat)
23552355GAMEL(2001, kbm3rd,   0,       firebeat2,     kbm,    kbm,    ROT270,   "Konami",  "Keyboardmania 3rd Mix", GAME_NOT_WORKING, layout_firebeat)
src/mame/drivers/bigevglf.c
r7356r7357
294294   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_REVERSE PORT_COCKTAIL
295295INPUT_PORTS_END
296296
297static INPUT_PORTS_START( bigevglj )
297static INPUT_PORTS_START( bigevglfj )
298298   PORT_INCLUDE(bigevglf)
299299
300300   PORT_MODIFY("DSW2")
r7356r7357
641641}
642642
643643GAME( 1986, bigevglf,  0,        bigevglf, bigevglf, bigevglf, ROT270, "Taito America Corporation", "Big Event Golf (US)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
644GAME( 1986, bigevglfj, bigevglf, bigevglf, bigevglj, bigevglf, ROT270, "Taito Corporation", "Big Event Golf (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
644GAME( 1986, bigevglfj, bigevglf, bigevglf, bigevglfj,bigevglf, ROT270, "Taito Corporation", "Big Event Golf (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
src/mame/drivers/bagman.c
r7356r7357
957957   *bagman_video_enable = 1;
958958}
959959
960GAME( 1982, bagman,     0,      bagman,  bagman,  0,        ROT270, "Valadon Automation", "Bagman", 0 )
960GAME( 1982, bagman,      0,  bagman,  bagman,  0,        ROT270, "Valadon Automation", "Bagman", 0 )
961961GAME( 1982, bagnard,  bagman,  bagman,  bagman,  0,        ROT270, "Valadon Automation", "Le Bagnard (set 1)", 0 )
962962GAME( 1982, bagnarda, bagman,  bagman,  bagman,  bagnarda, ROT270, "Valadon Automation", "Le Bagnard (set 2)", 0 )
963963GAME( 1982, bagmans,  bagman,  bagman,  bagmans, 0,        ROT270, "Valadon Automation (Stern license)", "Bagman (Stern set 1)", 0 )
964964GAME( 1982, bagmans2, bagman,  bagman,  bagman,  0,        ROT270, "Valadon Automation (Stern license)", "Bagman (Stern set 2)", 0 )
965GAME( 1984, sbagman,  0,      bagman,  sbagman, 0,        ROT270, "Valadon Automation", "Super Bagman", 0 )
965GAME( 1984, sbagman,       0,  bagman,  sbagman, 0,        ROT270, "Valadon Automation", "Super Bagman", 0 )
966966GAME( 1984, sbagmans, sbagman, bagman,  sbagman, 0,        ROT270, "Valadon Automation (Stern license)", "Super Bagman (Stern)", 0 )
967GAME( 1983, pickin,     0,      pickin,  pickin,  0,        ROT270, "Valadon Automation", "Pickin'", 0 )
968GAME( 1984, botanic,  0,       botanic, botanic, 0,        ROT270, "Valadon Automation (Itisa license)", "Botanic", 0 )
969GAME( 1984, squaitsa, 0,       squaitsa,squaitsa,0,        ROT0,   "Itisa",              "Squash (Itisa)", 0 )
967GAME( 1983, pickin,      0,  pickin,  pickin,  0,        ROT270, "Valadon Automation", "Pickin'", 0 )
968GAME( 1984, botanic,       0,  botanic, botanic, 0,        ROT270, "Valadon Automation (Itisa license)", "Botanic", 0 )
969GAME( 1984, squaitsa,      0,  squaitsa,squaitsa,0,        ROT0,   "Itisa",              "Squash (Itisa)", 0 )
970970
src/mame/drivers/cvs.c
r7356r7357
895895   PORT_DIPSETTING(    0x00, "80k only" )                  /* displays "80000" */
896896
897897   /* hunchbak : DSW2 bit 5 stored at 0x5e97 - code at 0x516c - read back code at 0x6054 */
898   /* hunchbka : DSW2 bit 5 stored at 0x1e97 - code at 0x0c0c - read back code at 0x6054 */
898   /* hunchbaka : DSW2 bit 5 stored at 0x1e97 - code at 0x0c0c - read back code at 0x6054 */
899899INPUT_PORTS_END
900900
901901static INPUT_PORTS_START( superbik )
r7356r7357
16161616}
16171617
16181618
1619static DRIVER_INIT( hunchbka )
1619static DRIVER_INIT( hunchbaka )
16201620{
16211621   UINT8 *ROM = memory_region(machine, "maincpu");
16221622
r7356r7357
17181718GAME( 1982, diggerc,   0,        cvs,     diggerc,  0,        ROT90, "Century Electronics", "Digger (CVS)", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
17191719GAME( 1983, heartatk,  0,        cvs,     heartatk, 0,        ROT90, "Century Electronics", "Heart Attack", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
17201720GAME( 1983, hunchbak,  0,        cvs,     hunchbak, 0,        ROT90, "Century Electronics", "Hunchback (set 1)", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1721GAME( 1983, hunchbaka, hunchbak, cvs,     hunchbak, hunchbka, ROT90, "Century Electronics", "Hunchback (set 2)", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1721GAME( 1983, hunchbaka, hunchbak, cvs,     hunchbak, hunchbaka,ROT90, "Century Electronics", "Hunchback (set 2)", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
17221722GAME( 1983, superbik,  0,        cvs,     superbik, superbik, ROT90, "Century Electronics", "Superbike", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
17231723GAME( 1983, raiders,   0,        cvs,     raiders,  raiders,  ROT90, "Century Electronics", "Raiders", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
17241724GAME( 1983, hero,      0,        cvs,     hero,     hero,     ROT90, "Seatongrove Ltd",     "Hero", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/jackie.c
r7356r7357
1/*
2Happy Jackie (c) 1993 IGS.
3Video Slot machine game for amusement only.
4
5Driver by David Haywood and Mirko Buffoni
6*/
7/*
8
9Anno    199x
10Produttore  IGS
11N.revisione
12
13CPU
14
151x Z0840006PSC (main)
162x D8255AC
171x unknown AMT001
181x unknown IGS002
191x UM3567 (sound)
201x oscillator 12.000MHz
211x oscillator 3.579645
22
23ROMs
24
252x D27128A (1,3)
261x MBM27128 (2)
273x 27C010 (4,5,6)
281x D27512 (7sv)
291x MBM27C512 (v110)
301x unknown (DIP20 mil300)(jack3)
313x PEEL18CV8PC (read protected)
321x TIBPAL16L8 (read protected)
33
34Note
35
361x 36x2 edge connector
371x 10x2 edge connector (payout system)
381x trimmer (volume)
391x pushbutton
401x battery
415x 8x2 switches dip
42
43*/
44
45
146#include "emu.h"
247#include "deprecat.h"
348#include "cpu/z80/z80.h"
r7356r7357
453498   GFXDECODE_ENTRY( "gfx2", 0, layout_8x32x6, 0, 16 )
454499GFXDECODE_END
455500
501static DRIVER_INIT( jackie )
502{
456503
504   int A;
505   UINT8 *rom = memory_region(machine, "maincpu");
457506
507   for (A = 0;A < 0xf000;A++)
508   {
509      rom[A] = rom[A] ^ 0x21;
510
511      if (((A & 0x0080) == 0x0000) && ((A & 0x0008) == 0x0000)) rom[A] = rom[A] ^ 0x20;
512      if ((A & 0x0282) == 0x0282) rom[A] ^= 0x01;
513      if ((A & 0x0940) == 0x0940) rom[A] ^= 0x02;
514   }
515   memset( &rom[0xf000], 0, 0x1000);
516
517   // Patch trap
518   rom[0x7e86] = 0xc3;
519}
520
521
458522static MACHINE_DRIVER_START( jackie )
459523
460524   /* basic machine hardware */
r7356r7357
487551MACHINE_DRIVER_END
488552
489553
490/*
491
492Anno    199x
493Produttore  IGS
494N.revisione
495
496CPU
497
4981x Z0840006PSC (main)
4992x D8255AC
5001x unknown AMT001
5011x unknown IGS002
5021x UM3567 (sound)
5031x oscillator 12.000MHz
5041x oscillator 3.579645
505
506ROMs
507
5082x D27128A (1,3)
5091x MBM27128 (2)
5103x 27C010 (4,5,6)
5111x D27512 (7sv)
5121x MBM27C512 (v110)
5131x unknown (DIP20 mil300)(jack3)
5143x PEEL18CV8PC (read protected)
5151x TIBPAL16L8 (read protected)
516
517Note
518
5191x 36x2 edge connector
5201x 10x2 edge connector (payout system)
5211x trimmer (volume)
5221x pushbutton
5231x battery
5245x 8x2 switches dip
525
526*/
527554ROM_START( jackie )
528555   ROM_REGION( 0x10000, "maincpu", 0 )
529556   ROM_LOAD( "jackiev110.u23",   0x0000, 0x10000, CRC(1b78a619) SHA1(a6eb6b6e544efa55225f2e947483614afb6ece3b) )
r7356r7357
548575   ROM_LOAD( "18cv8.u9",   0x0000, 0x155, BAD_DUMP CRC(996e8f59) SHA1(630d9b91f6e8eda781061e2a8ff6fb0fecaf034c) )
549576ROM_END
550577
551static DRIVER_INIT( jackie )
552{
553578
554   int A;
555   UINT8 *rom = memory_region(machine, "maincpu");
556
557   for (A = 0;A < 0xf000;A++)
558   {
559      rom[A] = rom[A] ^ 0x21;
560
561      if (((A & 0x0080) == 0x0000) && ((A & 0x0008) == 0x0000)) rom[A] = rom[A] ^ 0x20;
562      if ((A & 0x0282) == 0x0282) rom[A] ^= 0x01;
563      if ((A & 0x0940) == 0x0940) rom[A] ^= 0x02;
564   }
565   memset( &rom[0xf000], 0, 0x1000);
566
567   // Patch trap
568   rom[0x7e86] = 0xc3;
569}
570
571579GAME( 1993,  jackie,   0,        jackie,   jackie, jackie,  ROT0, "IGS",    "Happy Jackie (v110U)",       0 )
src/mame/drivers/alg.c
r7356r7357
795795  /* works ok but uses right player (2) controls only for trigger and holster */
796796GAME( 1992, maddog2,  alg_bios, alg_r2,   alg_2p, palr6,    ROT0,  "American Laser Games", "Mad Dog II: The Lost Gold v2.04", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
797797GAME( 1992, maddog22, alg_bios, alg_r2,   alg_2p, palr6,    ROT0,  "American Laser Games", "Mad Dog II: The Lost Gold v2.02", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
798GAME( 1992, maddog21, maddog2, alg_r2,   alg_2p, palr6,    ROT0,  "American Laser Games", "Mad Dog II: The Lost Gold v1.0", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
798GAME( 1992, maddog21, maddog2, alg_r2,   alg_2p, palr6,    ROT0,  "American Laser Games", "Mad Dog II: The Lost Gold v1.0", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
799799  /* works ok but uses right player (2) controls only for trigger and holster */
800800GAME( 1992, spacepir, alg_bios, alg_r2,   alg_2p, palr6,    ROT0,  "American Laser Games", "Space Pirates v2.2", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
801801GAME( 1992, gallgall, alg_bios, alg_r2,   alg_2p, palr6,    ROT0,  "American Laser Games", "Gallagher's Gallery v2.2", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
802802  /* all good, but no holster */
803803GAME( 1993, crimepat, alg_bios, alg_r2,   alg_2p, palr6,    ROT0,  "American Laser Games", "Crime Patrol v1.4", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
804804GAME( 1993, crimep2,  alg_bios, alg_r2,   alg_2p, palr6,    ROT0,  "American Laser Games", "Crime Patrol 2: Drug Wars v1.3", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
805GAME( 1993, crimep211,crimep2, alg_r2,   alg_2p, palr6,    ROT0,  "American Laser Games", "Crime Patrol 2: Drug Wars v1.1", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
805GAME( 1993, crimep211,crimep2, alg_r2,   alg_2p, palr6,    ROT0,  "American Laser Games", "Crime Patrol 2: Drug Wars v1.1", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
806806GAME( 1994, lastbh,   alg_bios, alg_r2,   alg_2p, palr6,    ROT0,  "American Laser Games", "The Last Bounty Hunter v0.06", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
807807GAME( 1995, fastdraw, alg_bios, alg_r2,   alg_2p, palr6,    ROT90, "American Laser Games", "Fast Draw Showdown v1.3", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
808808  /* works ok but uses right player (2) controls only for trigger and holster */
src/mame/drivers/bombjack.c
r7356r7357
44
55driver by Mirko Buffoni
66
7bombjac2 has YOU ARE LUCY instead of LUCKY, so it's probably an older version
7bombjack2 has YOU ARE LUCY instead of LUCKY, so it's probably an older version
88
99
1010MAIN BOARD:
r7356r7357
8585  - Ingame bug : if game is reset when screen is flipped, the screen remains
8686    flipped for the start-up tests and we'll be OK when scores are displayed.
8787
88  - The only difference between 'bombjack' and 'bombjac2' is that 'bombjack'
88  - The only difference between 'bombjack' and 'bombjack2' is that 'bombjack'
8989    fixes the message when you get a 'S' for extra credit (text at 0xd24a) :
9090      * 'bombjack' : "YOU ARE LUCKY"
91      * 'bombjac2' : "YOU ARE LUCY"
91      * 'bombjack2' : "YOU ARE LUCY"
9292
93932008-07
9494Dip Locations and factory settings verified with manual
src/mame/drivers/astrocde.c
r7356r7357
996996   PORT_DIPNAME( 0x10, 0x00, "Lives per Credit" )      PORT_DIPLOCATION("S1:5")
997997   PORT_DIPSETTING(    0x10, "2" )
998998   PORT_DIPSETTING(    0x00, "3" )
999   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("S1:6")
1000   PORT_DIPSETTING(    0x00, "Mission 5" )
1001   PORT_DIPSETTING(    0x20, DEF_STR( None ) )
999   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("S1:6")
1000   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1001   PORT_DIPSETTING(    0x20, "Mission 5" )
10021002   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )   PORT_DIPLOCATION("S1:7")
10031003   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
10041004   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r7356r7357
10081008INPUT_PORTS_END
10091009
10101010
1011static INPUT_PORTS_START( gorfg )
1011static INPUT_PORTS_START( gorfpgm1g )
10121012   PORT_INCLUDE(gorf)
10131013
10141014   PORT_MODIFY("P4HANDLE")
r7356r7357
18381838/* 91354 CPU board + 90708 game board + 91356 RAM board + 91355 pattern board + 91364 ROM/RAM board */
18391839GAMEL(1981, gorf,     0,    gorf,     gorf,     gorf,     ROT270, "Midway", "Gorf", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_gorf  )
18401840GAMEL(1981, gorfpgm1, gorf, gorf,     gorf,     gorf,     ROT270, "Midway", "Gorf (program 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_gorf )
1841GAMEL(1981, gorfpgm1g,gorf, gorf,     gorfg,    gorf,     ROT270, "Midway", "Gorf (program 1, with German Language ROM)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_gorf )
1841GAMEL(1981, gorfpgm1g,gorf, gorf,     gorfpgm1g,gorf,     ROT270, "Midway", "Gorf (program 1, with German Language ROM)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_gorf )
18421842
18431843/* 91354 CPU board + 90708 game board + 91356 RAM board + 91355 pattern board + 91423 memory board */
18441844GAME( 1981, robby,    0,    robby,    robby,    robby,    ROT0,   "Bally Midway", "Robby Roto", GAME_SUPPORTS_SAVE )
src/mame/drivers/8080bw.c
r7356r7357
5656/* 21 Nov 1999 - added spacewar3 [LT]                                       */
5757/*                                                                          */
5858/* 26 May 2001 - added galxwars                                             */
59/*                     galxwar2                                             */
60/*                     jspectr2                                             */
61/*                     ozmawar2                                             */
59/*                     galxwar2 (galxwars2)                                 */
60/*                     jspectr2 (jspecter2)                                 */
61/*                     ozmawar2 (ozmawars2)                                 */
6262/*                     spaceatt                                             */
6363/*                     sstrangr                                             */
6464/*                                                                          */
r7356r7357
6767/* 30 Jul 2001 - added sstrngr2                                             */
6868/*                                                                          */
6969/* 17 Jul 2006 - schaser - connect up prom - fix dipswitches                */
70/*               schasrcv - allow bottom line to show on screen            */
70/*               schasrcv (schasercv) - allow bottom line to show on screen */
7171/*                                                                          */
7272/*                                                                          */
7373/* 10 Sep 2006 - invadpt2 - add name reset button                           */
7474/*               spcewars - add bitstream circuit, fix dipswitches          */
7575/*                                                                          */
7676/*                                                                          */
77/* 13 Dec 2006 - add PRELIMINARY sound support and documentation to         */
78/*               rollingc, spcenctr, gunfight, m4, gmissile, schasrcv,      */
79/*               280zzzap, lagunar, lupin3, phantom2, blueshrk, desertgu,   */
80/*               ballbomb, yasokdon/yosakdoa, shuttlei, invrvnge/invrvnga.  */
77/* 13 Dec 2006 - add PRELIMINARY sound support and documentation to:        */
78/*               rollingc, spcenctr, gunfight, m4, gmissile,                */
79/*               schasrcv (schasercv), 280zzzap, lagunar, lupin3, phantom2, */
80/*       blueshrk, desertgu, ballbomb, yosakdon/yosakdoa (yosakdona)*/
81/*               shuttlei, invrvnge/invrvnga (invrvngea).                   */
8182/*               Documented indianbt sound. Removed NO_SOUND flag from      */
8283/*               cosmo and dogpatch as the sound was already working.       */
8384/*               [Robert]                                                   */
r7356r7357
950951/*                                                     */
951952/*******************************************************/
952953
953static ADDRESS_MAP_START( schasrcv_io_map, ADDRESS_SPACE_IO, 8 )
954static ADDRESS_MAP_START( schasercv_io_map, ADDRESS_SPACE_IO, 8 )
954955   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
955956   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
956957   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE("mb14241", mb14241_shift_count_w)
957   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_shift_result_r) AM_WRITE(schasrcv_sh_port_1_w)
958   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_shift_result_r) AM_WRITE(schasercv_sh_port_1_w)
958959   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_shift_data_w)
959   AM_RANGE(0x05, 0x05) AM_WRITE(schasrcv_sh_port_2_w)
960   AM_RANGE(0x05, 0x05) AM_WRITE(schasercv_sh_port_2_w)
960961ADDRESS_MAP_END
961962
962963
963static INPUT_PORTS_START( schasrcv )
964static INPUT_PORTS_START( schasercv )
964965   PORT_INCLUDE( invrvnge )
965966
966967   PORT_MODIFY("IN1")
r7356r7357
984985   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:8" )
985986INPUT_PORTS_END
986987
987static MACHINE_DRIVER_START( schasrcv )
988static MACHINE_DRIVER_START( schasercv )
988989
989990   /* basic machine hardware */
990991   MDRV_IMPORT_FROM(mw8080bw_root)
991992   MDRV_CPU_MODIFY("maincpu")
992993   MDRV_CPU_PROGRAM_MAP(schaser_map)
993   MDRV_CPU_IO_MAP(schasrcv_io_map)
994   MDRV_CPU_IO_MAP(schasercv_io_map)
994995   MDRV_MACHINE_START(extra_8080bw)
995996
996997   /* add shifter */
997998   MDRV_MB14241_ADD("mb14241")
998999
9991000   /* video hardware */
1000   MDRV_VIDEO_UPDATE(schasrcv)
1001   MDRV_VIDEO_UPDATE(schasercv)
10011002
10021003   /* sound hardware */
10031004   MDRV_IMPORT_FROM(invaders_samples_audio)
r7356r7357
28612862GAME( 1980, vortex,   0,        invaders, invadpt2, 0, ROT270, "Zilec Electronics Ltd.", "Vortex", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) /* Encrypted 8080 */
28622863GAME( 1979, cosmo,    0,        cosmo,    cosmo,    0, ROT90,  "TDS & Mints", "Cosmo", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
28632864GAME( 1979, schaser,  0,        schaser,  schaser,  0, ROT270, "Taito", "Space Chaser", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_COLORS )
2864GAME( 1979, schasercv,schaser,  schasrcv, schasrcv, 0, ROT270, "Taito", "Space Chaser (CV version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_COLORS )
2865GAME( 1979, schasercv,schaser,  schasercv,schasercv,0, ROT270, "Taito", "Space Chaser (CV version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_COLORS )
28652866GAME( 1979, sflush,   0,        sflush,   sflush,   0, ROT270, "Taito", "Straight Flush",GAME_SUPPORTS_SAVE | GAME_NO_SOUND | GAME_IMPERFECT_COLORS | GAME_NO_COCKTAIL)
28662867GAME( 1980, lupin3,   0,        lupin3,   lupin3,   0, ROT270, "Taito", "Lupin III (set 1)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
28672868GAME( 1980, lupin3a,  lupin3,   lupin3a,  lupin3a,  0, ROT270, "Taito", "Lupin III (set 2)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
src/mame/drivers/kingobox.c
r7356r7357
797797   ROM_LOAD( "prom1.bin",    0x0800, 0x0400, CRC(913f5975) SHA1(3d1e40eeb4d5a3a4bd42ec73d05bfca13b2f1805) ) /* blue component */
798798ROM_END
799799
800static DRIVER_INIT( ringkin3 )
800static DRIVER_INIT( ringking3 )
801801{
802802   int i;
803803   UINT8 *RAM = memory_region(machine, "proms");
r7356r7357
807807      RAM[i] = RAM[i + 0x100] >> 4;
808808}
809809
810static DRIVER_INIT( ringkinw )
810static DRIVER_INIT( ringkingw )
811811{
812812   int i,j,k;
813813   UINT8 *PROMS = memory_region(machine, "proms");
r7356r7357
832832GAME( 1985, kingofb,   0,       kingofb,  kingofb,  0,        ROT90, "Woodplace",     "King of Boxer (English)", GAME_SUPPORTS_SAVE )
833833GAME( 1985, ringking,  kingofb, ringking, ringking, 0,        ROT90, "Data East USA", "Ring King (US set 1)", GAME_SUPPORTS_SAVE )
834834GAME( 1985, ringking2, kingofb, ringking, ringking, 0,        ROT90, "Data East USA", "Ring King (US set 2)", GAME_SUPPORTS_SAVE )
835GAME( 1985, ringking3, kingofb, kingofb,  kingofb,  ringkin3, ROT90, "Data East USA", "Ring King (US set 3)", GAME_SUPPORTS_SAVE )
836GAME( 1985, ringkingw, kingofb, kingofb,  kingofb,  ringkinw, ROT90, "Woodplace",     "Ring King (US, Woodplace license)", GAME_SUPPORTS_SAVE )
835GAME( 1985, ringking3, kingofb, kingofb,  kingofb,  ringking3,ROT90, "Data East USA", "Ring King (US set 3)", GAME_SUPPORTS_SAVE )
836GAME( 1985, ringkingw, kingofb, kingofb,  kingofb,  ringkingw,ROT90, "Woodplace",     "Ring King (US, Woodplace license)", GAME_SUPPORTS_SAVE )
src/mame/drivers/bfmsys85.c
r7356r7357
483483   ROM_LOAD( "sc271.bin",  0x8000, 0x8000,  CRC(58e9c9df) SHA1(345c5aa279327d7142edc6823aad0cfd40cbeb73))
484484ROM_END
485485
486//    year,name,     parent, machine,  input,           init, monitor,     company,     fullname,            flags
487486GAME( 1985,m_supcrd, 0,    bfmsys85, bfmsys85,       0,     0,       "BFM/ELAM",   "Supercards (Dutch, Game Card 39-340-271?)", GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
src/mame/drivers/esripsys.c
r7356r7357
896896   ROM_LOAD( "6331_vid.u155", 0x0240, 0x0020, CRC(63371737) SHA1(f08c03c81322c0de9ee64b4a9f11a1422c5bd463) )
897897ROM_END
898898
899ROM_START( turbosb7 )
899ROM_START( turbosub7 )
900900   ROM_REGION( 0xc0000, "main_code", 0) /* Non-bankswitched, 6809 #0 code */
901901   ROM_LOAD( "mem6u85.bin",    0x18000, 0x4000, CRC(30016c8b) SHA1(0cd2dd7052de0eaa451ff8b0b2224180764c26de) )
902902
r7356r7357
10061006   ROM_LOAD( "6331_vid.u155", 0x0240, 0x0020, CRC(63371737) SHA1(f08c03c81322c0de9ee64b4a9f11a1422c5bd463) )
10071007ROM_END
10081008
1009ROM_START( turbosb6 )
1009ROM_START( turbosub6 )
10101010   ROM_REGION( 0xc0000, "main_code", 0) /* Non-bankswitched, 6809 #0 code */
10111011   ROM_LOAD( "u85",    0x18000, 0x4000, CRC(d37ccb06) SHA1(445df1caa4dd4901e474bb0903bf28e536edf493) )
10121012
r7356r7357
11291129 *
11301130 *************************************/
11311131
1132GAME( 1985, turbosub, 0,        esripsys, turbosub, esripsys, ROT0, "Entertainment Sciences", "Turbo Sub (prototype rev. TSCA)", GAME_SUPPORTS_SAVE )
1133GAME( 1985, turbosb7, turbosub, esripsys, turbosub, esripsys, ROT0, "Entertainment Sciences", "Turbo Sub (prototype rev. TSC7)", GAME_SUPPORTS_SAVE )
1134GAME( 1985, turbosb6, turbosub, esripsys, turbosub, esripsys, ROT0, "Entertainment Sciences", "Turbo Sub (prototype rev. TSC6)", GAME_SUPPORTS_SAVE )
1132GAME( 1985, turbosub,  0,        esripsys, turbosub, esripsys, ROT0, "Entertainment Sciences", "Turbo Sub (prototype rev. TSCA)", GAME_SUPPORTS_SAVE )
1133GAME( 1985, turbosub7, turbosub, esripsys, turbosub, esripsys, ROT0, "Entertainment Sciences", "Turbo Sub (prototype rev. TSC7)", GAME_SUPPORTS_SAVE )
1134GAME( 1985, turbosub6, turbosub, esripsys, turbosub, esripsys, ROT0, "Entertainment Sciences", "Turbo Sub (prototype rev. TSC6)", GAME_SUPPORTS_SAVE )
src/mame/drivers/blockout.c
r7356r7357
193193   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_DIPLOCATION("SW2:8") /* Listed as "Unused" */
194194INPUT_PORTS_END
195195
196static INPUT_PORTS_START( blckoutj )
196static INPUT_PORTS_START( blockoutj )
197197   PORT_INCLUDE( blockout )
198198
199199   PORT_MODIFY("P1")
r7356r7357
405405
406406GAME( 1989, blockout, 0,        blockout, blockout, 0, ROT0, "Technos Japan + California Dreams", "Block Out (set 1)", GAME_SUPPORTS_SAVE )
407407GAME( 1989, blockout2,blockout, blockout, blockout, 0, ROT0, "Technos Japan + California Dreams", "Block Out (set 2)", GAME_SUPPORTS_SAVE )
408GAME( 1989, blockoutj,blockout, blockout, blckoutj, 0, ROT0, "Technos Japan + California Dreams", "Block Out (Japan)", GAME_SUPPORTS_SAVE )
408GAME( 1989, blockoutj,blockout, blockout, blockoutj,0, ROT0, "Technos Japan + California Dreams", "Block Out (Japan)", GAME_SUPPORTS_SAVE )
409409GAME( 1991, agress,   0,        blockout, agress,   0, ROT0, "Palco", "Agress", GAME_SUPPORTS_SAVE )
410410GAME( 2003, agressb,  agress,   blockout, agress,   0, ROT0, "Palco", "Agress (English bootleg)", GAME_SUPPORTS_SAVE )
src/mame/drivers/harddriv.c
r7356r7357
356356};
357357
358358
359/* used on the low-resolution multisync boards for harddrvc, racedrvc, steeltal */
359/* used on the low-resolution multisync boards for harddrivc, racedrivc, steeltal */
360360static const tms34010_config gsp_config_multisync =
361361{
362362   TRUE,                     /* halt on reset */
r7356r7357
798798INPUT_PORTS_END
799799
800800
801static INPUT_PORTS_START( racedrvc )
801static INPUT_PORTS_START( racedrivc )
802802   PORT_START("IN0")      /* 60c000 */
803803   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )   /* diagnostic switch */
804804   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SPECIAL )   /* HBLANK */
r7356r7357
13341334MACHINE_DRIVER_END
13351335
13361336
1337static MACHINE_DRIVER_START( harddrvc )
1337static MACHINE_DRIVER_START( harddrivc )
13381338
13391339   /* basic machine hardware */
13401340   MDRV_IMPORT_FROM( multisync_msp )   /* multisync board with MSP */
r7356r7357
13531353MACHINE_DRIVER_END
13541354
13551355
1356static MACHINE_DRIVER_START( racedrvc )
1356static MACHINE_DRIVER_START( racedrivc )
13571357
13581358   /* basic machine hardware */
13591359   MDRV_IMPORT_FROM( multisync_nomsp )   /* multisync board without MSP */
r7356r7357
39383938}
39393939
39403940
3941static DRIVER_INIT( harddrvc )
3941static DRIVER_INIT( harddrivc )
39423942{
39433943   harddriv_state *state = (harddriv_state *)machine->driver_data;
39443944
r7356r7357
40324032}
40334033
40344034
4035static void racedrvc_init_common(running_machine *machine, offs_t gsp_protection)
4035static void racedrivc_init_common(running_machine *machine, offs_t gsp_protection)
40364036{
40374037   harddriv_state *state = (harddriv_state *)machine->driver_data;
40384038
r7356r7357
40664066   state->rddsp32_speedup_pc = 0x6054b0;
40674067}
40684068
4069static DRIVER_INIT( racedrvc ) { racedrvc_init_common(machine, 0xfff95cd0); }
4070static DRIVER_INIT( racedrc1 ) { racedrvc_init_common(machine, 0xfff7ecd0); }
4069static DRIVER_INIT( racedrivc ) { racedrivc_init_common(machine, 0xfff95cd0); }
4070static DRIVER_INIT( racedrivc1 ) { racedrivc_init_common(machine, 0xfff7ecd0); }
40714071
40724072
40734073
r7356r7357
41234123
41244124
41254125static DRIVER_INIT( steeltal ) { steeltal_init_common(machine, 0x4fc18, 0); }
4126static DRIVER_INIT( steelta1 ) { steeltal_init_common(machine, 0x4f9c6, 0); }
4127static DRIVER_INIT( steeltap ) { steeltal_init_common(machine, 0x52290, 1); }
4126static DRIVER_INIT( steeltal1 ) { steeltal_init_common(machine, 0x4f9c6, 0); }
4127static DRIVER_INIT( steeltalp ) { steeltal_init_common(machine, 0x52290, 1); }
41284128
41294129
41304130static DRIVER_INIT( strtdriv )
r7356r7357
41854185}
41864186
41874187
4188static DRIVER_INIT( hdrivaip )
4188static DRIVER_INIT( hdrivairp )
41894189{
41904190   harddriv_state *state = (harddriv_state *)machine->driver_data;
41914191
r7356r7357
42314231GAME( 1988, harddriv2,  harddriv, harddriv, harddriv, harddriv, ROT0, "Atari Games", "Hard Drivin' (cockpit, rev 2)", 0 )
42324232GAME( 1988, harddriv1,  harddriv, harddriv, harddriv, harddriv, ROT0, "Atari Games", "Hard Drivin' (cockpit, rev 1)", GAME_NOT_WORKING )
42334233
4234GAME( 1990, harddrivc,  harddriv, harddrvc, racedrvc, harddrvc, ROT0, "Atari Games", "Hard Drivin' (compact, rev 2)", 0 )
4235GAME( 1990, harddrivcg, harddriv, harddrvc, racedrvc, harddrvc, ROT0, "Atari Games", "Hard Drivin' (compact, German, rev 2)", 0 )
4236GAME( 1990, harddrivcb, harddriv, harddrvc, racedrvc, harddrvc, ROT0, "Atari Games", "Hard Drivin' (compact, British, rev 2)", 0 )
4237GAME( 1990, harddrivc1, harddriv, harddrvc, racedrvc, harddrvc, ROT0, "Atari Games", "Hard Drivin' (compact, rev 1)", 0 )
4234GAME( 1990, harddrivc,  harddriv, harddrivc, racedrivc, harddrivc, ROT0, "Atari Games", "Hard Drivin' (compact, rev 2)", 0 )
4235GAME( 1990, harddrivcg, harddriv, harddrivc, racedrivc, harddrivc, ROT0, "Atari Games", "Hard Drivin' (compact, German, rev 2)", 0 )
4236GAME( 1990, harddrivcb, harddriv, harddrivc, racedrivc, harddrivc, ROT0, "Atari Games", "Hard Drivin' (compact, British, rev 2)", 0 )
4237GAME( 1990, harddrivc1, harddriv, harddrivc, racedrivc, harddrivc, ROT0, "Atari Games", "Hard Drivin' (compact, rev 1)", 0 )
42384238
42394239GAME( 1989, stunrun,   0,        stunrun,  stunrun,  stunrun,  ROT0, "Atari Games", "S.T.U.N. Runner (rev 6)", 0 )
42404240GAME( 1989, stunrunj,  stunrun,  stunrun,  stunrun,  stunrun,  ROT0, "Atari Games", "S.T.U.N. Runner (rev 7, Japan)", 0 )
r7356r7357
42604260GAME( 1990, racedrivb1, racedriv, racedriv, racedriv, racedriv, ROT0, "Atari Games", "Race Drivin' (cockpit, British, rev 1)", GAME_NOT_WORKING )
42614261GAME( 1990, racedrivg1, racedriv, racedriv, racedriv, racedriv, ROT0, "Atari Games", "Race Drivin' (cockpit, German, rev 2)", GAME_NOT_WORKING )
42624262
4263GAME( 1990, racedrivc,   racedriv, racedrvc, racedrvc, racedrvc, ROT0, "Atari Games", "Race Drivin' (compact, rev 5)", 0 )
4264GAME( 1990, racedrivcb,  racedriv, racedrvc, racedrvc, racedrvc, ROT0, "Atari Games", "Race Drivin' (compact, British, rev 5)", 0 )
4265GAME( 1990, racedrivcg,  racedriv, racedrvc, racedrvc, racedrvc, ROT0, "Atari Games", "Race Drivin' (compact, German, rev 5)", 0 )
4266GAME( 1990, racedrivc4,  racedriv, racedrvc, racedrvc, racedrvc, ROT0, "Atari Games", "Race Drivin' (compact, rev 4)", 0 )
4267GAME( 1990, racedrivcb4, racedriv, racedrvc, racedrvc, racedrvc, ROT0, "Atari Games", "Race Drivin' (compact, British, rev 4)", 0 )
4268GAME( 1990, racedrivcg4, racedriv, racedrvc, racedrvc, racedrvc, ROT0, "Atari Games", "Race Drivin' (compact, German, rev 4)", 0 )
4269GAME( 1990, racedrivc2,  racedriv, racedrvc, racedrvc, racedrc1, ROT0, "Atari Games", "Race Drivin' (compact, rev 2)", 0 )
4270GAME( 1990, racedrivc1,  racedriv, racedrvc, racedrvc, racedrc1, ROT0, "Atari Games", "Race Drivin' (compact, rev 1)", 0 )
4263GAME( 1990, racedrivc,   racedriv, racedrivc, racedrivc, racedrivc, ROT0, "Atari Games", "Race Drivin' (compact, rev 5)", 0 )
4264GAME( 1990, racedrivcb,  racedriv, racedrivc, racedrivc, racedrivc, ROT0, "Atari Games", "Race Drivin' (compact, British, rev 5)", 0 )
4265GAME( 1990, racedrivcg,  racedriv, racedrivc, racedrivc, racedrivc, ROT0, "Atari Games", "Race Drivin' (compact, German, rev 5)", 0 )
4266GAME( 1990, racedrivc4,  racedriv, racedrivc, racedrivc, racedrivc, ROT0, "Atari Games", "Race Drivin' (compact, rev 4)", 0 )
4267GAME( 1990, racedrivcb4, racedriv, racedrivc, racedrivc, racedrivc, ROT0, "Atari Games", "Race Drivin' (compact, British, rev 4)", 0 )
4268GAME( 1990, racedrivcg4, racedriv, racedrivc, racedrivc, racedrivc, ROT0, "Atari Games", "Race Drivin' (compact, German, rev 4)", 0 )
4269GAME( 1990, racedrivc2,  racedriv, racedrivc, racedrivc, racedrivc1,ROT0, "Atari Games", "Race Drivin' (compact, rev 2)", 0 )
4270GAME( 1990, racedrivc1,  racedriv, racedrivc, racedrivc, racedrivc1,ROT0, "Atari Games", "Race Drivin' (compact, rev 1)", 0 )
42714271
42724272GAME( 1990, racedrivpan, racedriv, racedriv, racedriv, racedriv, ROT0, "Atari Games", "Race Drivin' Panorama (prototype, rev 2.1)", GAME_NOT_WORKING )
42734273
42744274GAME( 1991, steeltal,  0,        steeltal, steeltal, steeltal, ROT0, "Atari Games", "Steel Talons (rev 2)", 0 )
42754275GAME( 1991, steeltalg, steeltal, steeltal, steeltal, steeltal, ROT0, "Atari Games", "Steel Talons (German, rev 2)", 0 )
4276GAME( 1991, steeltal1, steeltal, steeltal, steeltal, steelta1, ROT0, "Atari Games", "Steel Talons (rev 1)", 0 )
4277GAME( 1991, steeltalp, steeltal, steeltal, steeltal, steeltap, ROT0, "Atari Games", "Steel Talons (prototype)", GAME_NOT_WORKING )
4276GAME( 1991, steeltal1, steeltal, steeltal, steeltal, steeltal1,ROT0, "Atari Games", "Steel Talons (rev 1)", 0 )
4277GAME( 1991, steeltalp, steeltal, steeltal, steeltal, steeltalp,ROT0, "Atari Games", "Steel Talons (prototype)", GAME_NOT_WORKING )
42784278
42794279GAME( 1993, strtdriv, 0,        strtdriv, strtdriv, strtdriv, ROT0, "Atari Games", "Street Drivin' (prototype)", GAME_NO_SOUND )
42804280
42814281GAME( 1993, hdrivair,  0,        hdrivair, hdrivair, hdrivair, ROT0, "Atari Games", "Hard Drivin's Airborne (prototype)", GAME_NO_SOUND )
4282GAME( 1993, hdrivairp, hdrivair, hdrivair, hdrivair, hdrivaip, ROT0, "Atari Games", "Hard Drivin's Airborne (prototype, early rev)", GAME_NOT_WORKING | GAME_NO_SOUND )
4282GAME( 1993, hdrivairp, hdrivair, hdrivair, hdrivair, hdrivairp,ROT0, "Atari Games", "Hard Drivin's Airborne (prototype, early rev)", GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/drivers/firetrap.c
r7356r7357
370370   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
371371INPUT_PORTS_END
372372
373static INPUT_PORTS_START( firetpbl )
373static INPUT_PORTS_START( firetrapbl )
374374   PORT_START("IN0")   /* IN0 */
375375   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_4WAY
376376   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_4WAY
r7356r7357
633633   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
634634MACHINE_DRIVER_END
635635
636static MACHINE_DRIVER_START( firetpbl )
636static MACHINE_DRIVER_START( firetrapbl )
637637
638638   /* driver data */
639639   MDRV_DRIVER_DATA(firetrap_state)
r7356r7357
747747   ROM_LOAD( "firetrap.4b",  0x0100,  0x0100, CRC(d5abfc64) SHA1(6c808c1d6087804214dc29d35280f42382c40b18) ) /* palette blue component */
748748ROM_END
749749
750ROM_START( firetpbl )
750ROM_START( firetrapbl )
751751   ROM_REGION( 0x28000, "maincpu", 0 )   /* 64k for code + 96k for banked ROMs */
752752   ROM_LOAD( "ft0d.bin",     0x00000, 0x8000, CRC(793ef849) SHA1(5a2c587370733d43484ba0a38a357260cdde8357) )
753753   ROM_LOAD( "ft0a.bin",     0x08000, 0x8000, CRC(613313ee) SHA1(54e386b2b1faada3441e3e0bb7822a63eab36930) )   /* unprotection code */
r7356r7357
810810
811811
812812
813GAME( 1986, firetrap, 0,        firetrap, firetrap, 0, ROT90, "Data East USA", "Fire Trap (US)", GAME_SUPPORTS_SAVE )
814GAME( 1986, firetpbl, firetrap, firetpbl, firetpbl, 0, ROT90, "bootleg", "Fire Trap (Japan bootleg)", GAME_SUPPORTS_SAVE )
813GAME( 1986, firetrap,   0,        firetrap,   firetrap,   0, ROT90, "Data East USA", "Fire Trap (US)", GAME_SUPPORTS_SAVE )
814GAME( 1986, firetrapbl, firetrap, firetrapbl, firetrapbl, 0, ROT90, "bootleg", "Fire Trap (Japan bootleg)", GAME_SUPPORTS_SAVE )
src/mame/drivers/zr107.c
r7356r7357
167167#include "cpu/m68000/m68000.h"
168168#include "cpu/powerpc/ppc.h"
169169#include "cpu/sharc/sharc.h"
170#include "sound/k054539.h"
171170#include "machine/konppc.h"
172171#include "machine/adc083x.h"
173172#include "machine/k056230.h"
174173#include "machine/eeprom.h"
174#include "sound/k056800.h"
175#include "sound/k054539.h"
175176#include "video/konicdev.h"
176177#include "video/gticlub.h"
177#include "sound/k056800.h"
178178
179179static UINT8 led_reg0, led_reg1;
180180
181181
182182
183// defined in drivers/nwk-tr.c
184int K001604_vh_start(running_machine *machine, int chip);
185void K001604_draw_front_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect);
186void K001604_draw_back_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect);
187READ32_HANDLER(K001604_tile_r);
188READ32_HANDLER(K001604_char_r);
189WRITE32_HANDLER(K001604_tile_w);
190WRITE32_HANDLER(K001604_char_w);
191WRITE32_HANDLER(K001604_reg_w);
192READ32_HANDLER(K001604_reg_r);
193
194
195
196
197183static VIDEO_START( jetwave )
198184{
199185   K001005_init(machine);
200186   K001006_init(machine);
201   K001604_vh_start(machine, 0);
202187}
203188
204189
205190static VIDEO_UPDATE( jetwave )
206191{
192   running_device *k001604 = devtag_get_device(screen->machine, "k001604");
193
207194   bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
208195
209196   K001005_draw(bitmap, cliprect);
210197
211   K001604_draw_front_layer(0, bitmap, cliprect);
198   k001604_draw_front_layer(k001604, bitmap, cliprect);
212199
213200   draw_7segment_led(bitmap, 3, 3, led_reg0);
214201   draw_7segment_led(bitmap, 9, 3, led_reg1);
r7356r7357
428415
429416static ADDRESS_MAP_START( jetwave_map, ADDRESS_SPACE_PROGRAM, 32 )
430417   AM_RANGE(0x00000000, 0x000fffff) AM_MIRROR(0x80000000) AM_RAM      /* Work RAM */
431   AM_RANGE(0x74000000, 0x740000ff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_reg_r, K001604_reg_w)
418   AM_RANGE(0x74000000, 0x740000ff) AM_MIRROR(0x80000000) AM_DEVREADWRITE("k001604", k001604_reg_r, k001604_reg_w)
432419   AM_RANGE(0x74010000, 0x7401ffff) AM_MIRROR(0x80000000) AM_RAM_WRITE(jetwave_palette_w) AM_BASE_GENERIC(paletteram)
433   AM_RANGE(0x74020000, 0x7403ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_tile_r, K001604_tile_w)
434   AM_RANGE(0x74040000, 0x7407ffff) AM_MIRROR(0x80000000) AM_READWRITE(K001604_char_r, K001604_char_w)
420   AM_RANGE(0x74020000, 0x7403ffff) AM_MIRROR(0x80000000) AM_DEVREADWRITE("k001604", k001604_tile_r, k001604_tile_w)
421   AM_RANGE(0x74040000, 0x7407ffff) AM_MIRROR(0x80000000) AM_DEVREADWRITE("k001604", k001604_char_r, k001604_char_w)
435422   AM_RANGE(0x78000000, 0x7800ffff) AM_MIRROR(0x80000000) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc)      /* 21N 21K 23N 23K */
436423   AM_RANGE(0x78010000, 0x7801ffff) AM_MIRROR(0x80000000) AM_WRITE(cgboard_dsp_shared_w_ppc)
437424   AM_RANGE(0x78040000, 0x7804000f) AM_MIRROR(0x80000000) AM_READWRITE(K001006_0_r, K001006_0_w)
r7356r7357
775762   MDRV_ADC0838_ADD("adc0838", zr107_adc_interface)
776763MACHINE_DRIVER_END
777764
765
766static const k001604_interface jetwave_k001604_intf =
767{
768   0, 1,   /* gfx index 1 & 2 */
769   0, 1,      /* layer_size, roz_size */
770   0      /* slrasslt hack */
771};
772
778773static MACHINE_DRIVER_START( jetwave )
779774
780775   /* basic machine hardware */
r7356r7357
809804   MDRV_VIDEO_START(jetwave)
810805   MDRV_VIDEO_UPDATE(jetwave)
811806
807   MDRV_K001604_ADD("k001604", jetwave_k001604_intf)
808
812809   MDRV_K056800_ADD("k056800", zr107_k056800_interface)
813810
814811   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
src/mame/drivers/bladestl.c
r7356r7357
221221   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(2)
222222INPUT_PORTS_END
223223
224static INPUT_PORTS_START( bladstle )
224static INPUT_PORTS_START( bladestle )
225225   PORT_INCLUDE( bladestl )
226226
227227   PORT_MODIFY("DSW2")
r7356r7357
437437 *************************************/
438438
439439GAME( 1987, bladestl,  0,        bladestl, bladestl, 0, ROT90, "Konami", "Blades of Steel (version T)", GAME_SUPPORTS_SAVE )
440GAME( 1987, bladestle, bladestl, bladestl, bladstle, 0, ROT90, "Konami", "Blades of Steel (version E)", GAME_SUPPORTS_SAVE )
440GAME( 1987, bladestle, bladestl, bladestl, bladestle,0, ROT90, "Konami", "Blades of Steel (version E)", GAME_SUPPORTS_SAVE )
src/mame/drivers/funworld.c
r7356r7357
956956    - Added new game: Jolly Card (Evona Electronic)
957957    - Added new game: Super Joly 2000 - 3x
958958    - Fixed some inputs.
959    - Masked inputs to allow jolyjkra to boot.
959    - Masked inputs to allow jolyjokra to boot.
960960    - Added minor corrections.
961961    - Updated technical notes.
962962
r7356r7357
18031803   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
18041804INPUT_PORTS_END
18051805
1806static INPUT_PORTS_START( jolyjkra )
1806static INPUT_PORTS_START( jolyjokra )
18071807   PORT_START("IN0")
18081808   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN )   PORT_NAME("Remote")
18091809   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )   PORT_NAME("Halten (Hold) 1")
r7356r7357
28752875   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
28762876ROM_END
28772877
2878ROM_START( jolyjkra )   /* Jolly Joker (Impera, 50bet) */
2878ROM_START( jolyjokra )   /* Jolly Joker (Impera, 50bet) */
28792879   ROM_REGION( 0x10000, "maincpu", 0 )
28802880   ROM_LOAD( "impera50.bin", 0x8000, 0x8000, CRC(7effc044) SHA1(961438e7fb8222296fb959b510cdf646e4ac3226) )
28812881
r7356r7357
32083208GAME( 1993, vegasfst, vegasslw, funworld, funworld, 0,        ROT0, "Soft Design",     "Royal Vegas Joker Card (fast deal)",              0 )
32093209GAME( 1993, vegasfte, vegasslw, funworld, funworld, 0,        ROT0, "Soft Design",     "Royal Vegas Joker Card (fast deal, english gfx)", 0 )
32103210GAME( 198?, jolyjokr, 0,        funworld, funworld, 0,        ROT0, "Impera",          "Jolly Joker",                                     0 )
3211GAME( 198?, jolyjkra, jolyjokr, funworld, jolyjkra, 0,        ROT0, "Impera",          "Jolly Joker (50bet)",                             0 )
3211GAME( 198?, jolyjokra,jolyjokr, funworld, jolyjokra,0,        ROT0, "Impera",          "Jolly Joker (50bet)",                             0 )
32123212GAME( 1993, jokercrd, 0,        funworld, funworld, 0,        ROT0, "Vesely Svet",     "Joker Card (Ver.A267BC, encrypted)",              GAME_WRONG_COLORS | GAME_NOT_WORKING )
32133213GAME( 199?, mongolnw, 0,        royalmcu, royalcrd, 0,        ROT0, "bootleg",         "Mongolfier New (italian)",                        GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
32143214GAME( 199?, soccernw, 0,        royalcrd, royalcrd, soccernw, ROT0, "bootleg",         "Soccer New (italian)",                            GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
src/mame/drivers/lethal.c
r7356r7357
651651   MDRV_DRIVER_DATA(lethal_state)
652652
653653   /* basic machine hardware */
654   MDRV_CPU_ADD("maincpu", HD6309, MAIN_CLOCK/2)   // ???
654   MDRV_CPU_ADD("maincpu", HD6309, MAIN_CLOCK/2)    /* verified on pcb */
655655   MDRV_CPU_PROGRAM_MAP(le_main)
656656   MDRV_CPU_VBLANK_INT("screen", lethalen_interrupt)
657657
658   MDRV_CPU_ADD("soundcpu", Z80, 8000000)
658   MDRV_CPU_ADD("soundcpu", Z80, MAIN_CLOCK/4)  /* verified on pcb */
659659   MDRV_CPU_PROGRAM_MAP(le_sound)
660660
661661   MDRV_MACHINE_START(lethalen)
r7356r7357
670670   MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
671671
672672   MDRV_SCREEN_ADD("screen", RASTER)
673   MDRV_SCREEN_REFRESH_RATE(60)
673   MDRV_SCREEN_REFRESH_RATE(59.62)  /* verified on pcb */
674674   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
675675   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
676676   MDRV_SCREEN_SIZE(64*8, 32*8)
src/mame/drivers/exprraid.c
r7356r7357
168168    (reads from 0x2801 occur almost all the time).
169169    So IMO this set looks like a World bootleg .
170170
1714) 'wexpresb'
1714) 'wexpressb'
172172
173173  - "@ 1986 DATA EAST CORPORATION" + extra code to display the Warning screen (Japan)
174174  - Modified Warning screen
r7356r7357
184184      * 0xe826 : COIN1 - 0xe82e : COIN2 (Mode 1)
185185      * 0xe836 : COIN1 - 0xe83e : COIN2 (Mode 2)
186186
1875) 'wexpresc'
1875) 'wexpressb2'
188188
189189  - "@ 1986 DATA EAST CORPORATION" + extra code to display the Warning screen (Japan)
190190  - Original Warning screen
r7356r7357
193193    that there shall exist a "better" Japan undumped version)
194194    so all comments also fit for this set. The main difference is
195195    the way protection is bypassed (in a different way than 'wexpress'
196    but also in a different way than 'wexpresb' as reads from 0x2801
196    but also in a different way than 'wexpressb' as reads from 0x2801
197197    occur when you lose a life but also on "shoot" stages).
198    The other difference is that you can NOT continue a game as in 'wexpresb'.
199  - "Bonus lives" routine starts at 0xe4e5 (same as 'wexpresb')
200  - Coinage related stuff starts at 0xe7d8 (same as 'wexpresb').
201  - Coinage tables (same as 'wexpresb') :
198    The other difference is that you can NOT continue a game as in 'wexpressb'.
199  - "Bonus lives" routine starts at 0xe4e5 (same as 'wexpressb')
200  - Coinage related stuff starts at 0xe7d8 (same as 'wexpressb').
201  - Coinage tables (same as 'wexpressb') :
202202      * 0xe826 : COIN1 - 0xe82e : COIN2 (Mode 1)
203203      * 0xe836 : COIN1 - 0xe83e : COIN2 (Mode 2)
204204
r7356r7357
781781   exprraid_gfx_expand(machine);
782782}
783783
784static DRIVER_INIT( wexpresb )
784static DRIVER_INIT( wexpressb )
785785{
786786   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x3800, 0x3800, 0, 0, vblank_r);
787787   exprraid_gfx_expand(machine);
788788}
789789
790static DRIVER_INIT( wexpresc )
790static DRIVER_INIT( wexpressb2 )
791791{
792792   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xFFC0, 0xFFC0, 0, 0, vblank_r);
793793   exprraid_gfx_expand(machine);
794794}
795795
796796
797GAME( 1986, exprraid,  0,        exprraid, exprraid, exprraid, ROT0, "Data East USA", "Express Raider (US set 1)", GAME_SUPPORTS_SAVE )
798GAME( 1986, exprraida, exprraid, exprraid, exprraid, exprraid, ROT0, "Data East USA", "Express Raider (US set 2)", GAME_SUPPORTS_SAVE )
799GAME( 1986, wexpress,  exprraid, exprraid, exprraid, wexpress, ROT0, "Data East Corporation", "Western Express (World?)", GAME_SUPPORTS_SAVE )
800GAME( 1986, wexpressb, exprraid, exprboot, exprboot, wexpresb, ROT0, "bootleg", "Western Express (bootleg set 1)", GAME_SUPPORTS_SAVE )
801GAME( 1986, wexpressb2,exprraid, exprboot, exprboot, wexpresc, ROT0, "bootleg", "Western Express (bootleg set 2)", GAME_SUPPORTS_SAVE )
797GAME( 1986, exprraid,  0,        exprraid, exprraid, exprraid,  ROT0, "Data East USA", "Express Raider (US set 1)", GAME_SUPPORTS_SAVE )
798GAME( 1986, exprraida, exprraid, exprraid, exprraid, exprraid,  ROT0, "Data East USA", "Express Raider (US set 2)", GAME_SUPPORTS_SAVE )
799GAME( 1986, wexpress,  exprraid, exprraid, exprraid, wexpress,  ROT0, "Data East Corporation", "Western Express (World?)", GAME_SUPPORTS_SAVE )
800GAME( 1986, wexpressb, exprraid, exprboot, exprboot, wexpressb, ROT0, "bootleg", "Western Express (bootleg set 1)", GAME_SUPPORTS_SAVE )
801GAME( 1986, wexpressb2,exprraid, exprboot, exprboot, wexpressb2,ROT0, "bootleg", "Western Express (bootleg set 2)", GAME_SUPPORTS_SAVE )
src/mame/drivers/2mindril.c
r7356r7357
2626460004, 46000c
2727460006, 46000e
2828
29*/
3029
31/*
32
33TWO MINUTE DRILL - Taito 1993?
34
35No idea what this game is... I do not have the pinout
36See pic for more details
37
3830 Brief hardware overview:
3931 ------------------------
4032
r7356r7357
4840                  - TC0510NI0
4941
5042DAC               -26.6860Mhz
51                        -32.0000Mhz
43                  -32.0000Mhz
5244
5345*/
5446
src/mame/drivers/taitogn.c
r7356r7357
326326#include "machine/idectrl.h"
327327#include "machine/mb3773.h"
328328#include "sound/psx.h"
329#include "audio/taito_zm.h"
329330
330
331331static unsigned char cis[512];
332332static int locked;
333333
r7356r7357
853853   psx_machine_init(machine);
854854   devtag_reset(machine, "card");
855855   ide_set_gnet_readlock(devtag_get_device(machine, "card"), 1);
856
857   // halt sound CPU since it has no valid program at start
858   cputag_set_input_line(machine, "mn10200",INPUT_LINE_RESET,ASSERT_LINE); /* MCU */
856859}
857860
858861static ADDRESS_MAP_START( zn_map, ADDRESS_SPACE_PROGRAM, 32 )
r7356r7357
948951   MDRV_NVRAM_HANDLER( coh3002t )
949952
950953   MDRV_MB3773_ADD("mb3773")
954
955   MDRV_IMPORT_FROM( taito_zoom_sound )
951956MACHINE_DRIVER_END
952957
953958static INPUT_PORTS_START( coh3002t )
r7356r7357
10751080       ROM_LOAD16_WORD_BIOS(0, "flash.u30", 0x000000, 0x200000, CRC(c48c8236) SHA1(c6dad60266ce2ff635696bc0d91903c543273559) ) \
10761081   ROM_SYSTEM_BIOS( 1, "v2",   "G-NET Bios v2" ) \
10771082       ROM_LOAD16_WORD_BIOS(1, "flashv2.u30", 0x000000, 0x200000, CRC(CAE462D3) SHA1(f1b10846a8423d9fe021191c5876190857c3d2a4) ) \
1078   ROM_REGION32_LE( 0x80000,  "soundcpu", 0) \
1083   ROM_REGION32_LE( 0x80000,  "mn10200", 0) \
10791084   ROM_FILL( 0, 0x80000, 0xff) \
1080   ROM_REGION32_LE( 0x600000, "samples", 0) \
1085   ROM_REGION32_LE( 0x600000, "zsg1", 0) \
10811086   ROM_FILL( 0, 0x600000, 0xff)
10821087
10831088ROM_START( taitogn )
src/mame/drivers/cojag.c
r7356r7357
13351335   ROMX_LOAD( "fish_eng.07-00", 0x800007, 0x100000, CRC(13fa20ad) SHA1(0a04fdea025109c0e604ef2a6d58cfb3adce9bd1), ROM_SKIP(7) )
13361336ROM_END
13371337
1338ROM_START( freezejp )
1338ROM_START( freezeatjp )
13391339   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
13401340   ROM_LOAD32_BYTE( "prog_jpn.hh",          0x000000, 0x040000, CRC(989302bf) SHA1(232927ec0a52b8bb587a3c206af8e1c6cde67860) )
13411341   ROM_LOAD32_BYTE( "prog_jpn.hl",          0x000001, 0x040000, CRC(6262b760) SHA1(12ca749f5cdc6db7d19f88a21f5f955b80206784) )
r7356r7357
13611361   ROMX_LOAD( "fish_jpn.07-00", 0x800007, 0x100000, CRC(e7e0daa5) SHA1(108da84cc6b4df7ae88cfdacd27c1728e59cdb81), ROM_SKIP(7) )
13621362ROM_END
13631363
1364ROM_START( freezea2 )
1364ROM_START( freezeat2 )
13651365   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
13661366   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(a8aefa52) SHA1(ba95da93035520de4b15245f68217c59dfb69dbd) )
13671367   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(152dd641) SHA1(52fa260baf1979ed8f15f8abcbbeebd8e595d0e4) )
r7356r7357
13871387   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(1f20c020) SHA1(71b32386dc0444264f2f1e2a81899e0e9260994c), ROM_SKIP(7) )
13881388ROM_END
13891389
1390ROM_START( freezea3 )
1390ROM_START( freezeat3 )
13911391   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
13921392   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(863942e6) SHA1(c7429c8a5c86ff93c64950e201cffca83dd7b7b0) )
13931393   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(2acc18ef) SHA1(ead02566f7641b1d1066bd2e257b695e5c7e8437) )
r7356r7357
14131413   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(5ae08327) SHA1(822d8292793509ebfbfce27e92a74c78c4328bda), ROM_SKIP(7) )
14141414ROM_END
14151415
1416ROM_START( freezea4 )
1416ROM_START( freezeat4 )
14171417   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
14181418   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(80336f5e) SHA1(9946e8eebec2cd68db059f40f535ea212f41913d) )
14191419   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(55125520) SHA1(13be4fbf32bcd94a2ea97fd690bd1dfdff146d33) )
r7356r7357
14391439   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(a84335c3) SHA1(340f5ddb9bff1ecd469eab8be36cc0ede84f1f5e), ROM_SKIP(7) )
14401440ROM_END
14411441
1442ROM_START( freezea5 )
1442ROM_START( freezeat5 )
14431443   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
14441444   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(95c4fc64) SHA1(cd00efe7f760ef1e4cdc4bc8a3b368427cb15d8a) )
14451445   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(ffb9cb71) SHA1(35d6a5440d63bc5b94c4447645365039169da368) )
r7356r7357
14651465   ROMX_LOAD( "fish_gr1.07-00", 0x800007, 0x100000, CRC(3676ac70) SHA1(640c4d4f53ca2bcae2009e402fd6ad70e40defa4), ROM_SKIP(7) )
14661466ROM_END
14671467
1468ROM_START( freezea6 )
1468ROM_START( freezeat6 )
14691469   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for R3000 code */
14701470   ROM_LOAD32_BYTE( "prog.hh",              0x000000, 0x040000, CRC(120711fe) SHA1(387e3cc8a1a9ea7d65c528387891d09ed9889fe3) )
14711471   ROM_LOAD32_BYTE( "prog.hl",              0x000001, 0x040000, CRC(18dd292a) SHA1(00e79851140716985f43594142c97e510a06b24a) )
r7356r7357
16091609}
16101610
16111611static DRIVER_INIT( freezeat ) { init_freeze_common(machine, 0x1001a9f4); }
1612static DRIVER_INIT( freezea2 ) { init_freeze_common(machine, 0x1001a8c4); }
1613static DRIVER_INIT( freezea3 ) { init_freeze_common(machine, 0x1001a134); }
1614static DRIVER_INIT( freezea4 ) { init_freeze_common(machine, 0x1001a134); }
1615static DRIVER_INIT( freezea5 ) { init_freeze_common(machine, 0x10019b34); }
1616static DRIVER_INIT( freezea6 ) { init_freeze_common(machine, 0x10019684); }
1612static DRIVER_INIT( freezeat2 ) { init_freeze_common(machine, 0x1001a8c4); }
1613static DRIVER_INIT( freezeat3 ) { init_freeze_common(machine, 0x1001a134); }
1614static DRIVER_INIT( freezeat4 ) { init_freeze_common(machine, 0x1001a134); }
1615static DRIVER_INIT( freezeat5 ) { init_freeze_common(machine, 0x10019b34); }
1616static DRIVER_INIT( freezeat6 ) { init_freeze_common(machine, 0x10019684); }
16171617
16181618
16191619static DRIVER_INIT( vcircle )
r7356r7357
16351635 *
16361636 *************************************/
16371637
1638GAME( 1996, area51,   0,        cojagr3k,  area51,   area51,   ROT0, "Atari Games", "Area 51 (R3000)", 0 )
1639GAME( 1995, area51t,  area51,   cojag68k,  area51,   area51a,  ROT0, "Time Warner", "Area 51 (Time Warner License)", 0 )
1640GAME( 1995, area51a,  area51,   cojag68k,  area51,   area51a,  ROT0, "Atari Games", "Area 51 (Atari Games License)", 0 )
1641GAME( 1995, fishfren, 0,        cojagr3k,  fishfren, fishfren, ROT0, "Time Warner Interactive", "Fishin' Frenzy (prototype)", 0 )
1642GAME( 1996, freezeat, 0,        cojagr3k,  freezeat, freezeat, ROT0, "Atari Games", "Freeze (Atari) (prototype, English voice, 96/10/25)", 0 )
1643GAME( 1996, freezejp, freezeat, cojagr3k,  freezeat, freezeat, ROT0, "Atari Games", "Freeze (Atari) (prototype, Japanese voice, 96/10/25)", 0 )
1644GAME( 1996, freezea2, freezeat, cojagr3k,  freezeat, freezea2, ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/10/18)", 0 )
1645GAME( 1996, freezea3, freezeat, cojagr3k,  freezeat, freezea3, ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/10/07)", 0 )
1646GAME( 1996, freezea4, freezeat, cojagr3k,  freezeat, freezea4, ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/10/03)", 0 )
1647GAME( 1996, freezea5, freezeat, cojagr3k,  freezeat, freezea5, ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/09/20, AMOA-96)", 0 )
1648GAME( 1996, freezea6, freezeat, cojagr3k,  freezeat, freezea6, ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/09/07, Jamma-96)", 0 )
1649GAME( 1996, maxforce, 0,        cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force v1.05", 0 )
1650GAME( 1996, maxf_102, maxforce, cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force v1.02", 0 )
1651GAME( 1996, maxf_ng,  maxforce, cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force (No Gore version)", 0 )
1652GAME( 1998, area51mx, 0,        cojag68k,  area51,   area51mx, ROT0, "Atari Games", "Area 51 / Maximum Force Duo v2.0", 0 )
1653GAME( 1998, a51mxr3k, area51mx, cojagr3k,  area51,   a51mxr3k, ROT0, "Atari Games", "Area 51 / Maximum Force Duo (R3000)", 0 )
1654GAME( 1996, vcircle,  0,        cojagr3k,  vcircle,  vcircle,  ROT0, "Atari Games", "Vicious Circle (prototype)", 0 )
1638GAME( 1996, area51,    0,        cojagr3k,  area51,   area51,   ROT0, "Atari Games", "Area 51 (R3000)", 0 )
1639GAME( 1995, area51t,   area51,   cojag68k,  area51,   area51a,  ROT0, "Time Warner", "Area 51 (Time Warner License)", 0 )
1640GAME( 1995, area51a,   area51,   cojag68k,  area51,   area51a,  ROT0, "Atari Games", "Area 51 (Atari Games License)", 0 )
1641GAME( 1995, fishfren,  0,        cojagr3k,  fishfren, fishfren, ROT0, "Time Warner Interactive", "Fishin' Frenzy (prototype)", 0 )
1642GAME( 1996, freezeat,  0,        cojagr3k,  freezeat, freezeat, ROT0, "Atari Games", "Freeze (Atari) (prototype, English voice, 96/10/25)", 0 )
1643GAME( 1996, freezeatjp,freezeat, cojagr3k,  freezeat, freezeat, ROT0, "Atari Games", "Freeze (Atari) (prototype, Japanese voice, 96/10/25)", 0 )
1644GAME( 1996, freezeat2, freezeat, cojagr3k,  freezeat, freezeat2,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/10/18)", 0 )
1645GAME( 1996, freezeat3, freezeat, cojagr3k,  freezeat, freezeat3,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/10/07)", 0 )
1646GAME( 1996, freezeat4, freezeat, cojagr3k,  freezeat, freezeat4,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/10/03)", 0 )
1647GAME( 1996, freezeat5, freezeat, cojagr3k,  freezeat, freezeat5,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/09/20, AMOA-96)", 0 )
1648GAME( 1996, freezeat6, freezeat, cojagr3k,  freezeat, freezeat6,ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/09/07, Jamma-96)", 0 )
1649GAME( 1996, maxforce,  0,        cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force v1.05", 0 )
1650GAME( 1996, maxf_102,  maxforce, cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force v1.02", 0 )
1651GAME( 1996, maxf_ng,   maxforce, cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force (No Gore version)", 0 )
1652GAME( 1998, area51mx,  0,        cojag68k,  area51,   area51mx, ROT0, "Atari Games", "Area 51 / Maximum Force Duo v2.0", 0 )
1653GAME( 1998, a51mxr3k,  area51mx, cojagr3k,  area51,   a51mxr3k, ROT0, "Atari Games", "Area 51 / Maximum Force Duo (R3000)", 0 )
1654GAME( 1996, vcircle,   0,        cojagr3k,  vcircle,  vcircle,  ROT0, "Atari Games", "Vicious Circle (prototype)", 0 )
src/mame/drivers/aristmk5.c
r7356r7357
185185GAME( 1996, dolphntr, 0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Dolphin Treasure (B - 06/12/96, NSW/ACT, Rev 1.24.4.0)", GAME_NOT_WORKING|GAME_NO_SOUND )
186186GAME( 1996, dolphtra, 0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Dolphin Treasure (B - 06/12/96, NSW/ACT, Rev 3)", GAME_NOT_WORKING|GAME_NO_SOUND )
187187GAME( 1997, goldprmd, 0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Golden Pyramids (B - 13-05-97, USA)", GAME_NOT_WORKING|GAME_NO_SOUND )
188GAME( 1997, qotn,     0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Queen of the Nile (B - 13-05-97, NSW/ACT)", GAME_NOT_WORKING|GAME_NO_SOUND )
188GAME( 1997, qotn,     0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Queen of the Nile (B - 13-05-97, NSW/ACT)", GAME_NOT_WORKING|GAME_NO_SOUND )
189189GAME( 1997, dmdtouch, 0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Diamond Touch (E - 30-06-97, Local)", GAME_NOT_WORKING|GAME_NO_SOUND )
190190GAME( 1998, adonis,   0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Adonis (A - 25-05-98, NSW/ACT)", GAME_NOT_WORKING|GAME_NO_SOUND )
191191GAME( 1998, reelrock, 0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Reelin-n-Rockin (A - 13/07/98, Local)", GAME_NOT_WORKING|GAME_NO_SOUND )
src/mame/drivers/darkhors.c
r7356r7357
941941
942942GAME( 199?, jclub2,   0,      jclub2,  darkhors, 0,        ROT0, "Seta", "Jockey Club II (newer hardware)", GAME_NOT_WORKING | GAME_NO_SOUND )
943943GAME( 199?, jclub2o,  jclub2, jclub2o, darkhors, 0,        ROT0, "Seta", "Jockey Club II (older hardware)", GAME_NOT_WORKING | GAME_NO_SOUND )
944GAME( 2001, darkhors, jclub2, darkhors, darkhors, darkhors, ROT0, "bootleg", "Dark Horse (bootleg of Jockey Club II)", GAME_IMPERFECT_GRAPHICS )
944GAME( 2001, darkhors, jclub2, darkhors,darkhors, darkhors, ROT0, "bootleg", "Dark Horse (bootleg of Jockey Club II)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/bishjan.c
r7356r7357
10211021
10221022
10231023GAME( 1998, saklove, 0, saklove, saklove, saklove, ROT0, "Subsino", "Ying Hua Lian 2.0 (China 1.02)", 0 )
1024GAME( 1999, bishjan, 0, bishjan, bishjan, bishjan, ROT0, "Subsino", "Bishou Jan (Japan 203)",         GAME_NO_SOUND )
1024GAME( 1999, bishjan, 0, bishjan, bishjan, bishjan, ROT0, "Subsino", "Bishou Jan (Japan 203)", GAME_NO_SOUND )
src/mame/drivers/decocass.c
r7356r7357
789789MACHINE_DRIVER_END
790790
791791
792static MACHINE_DRIVER_START( cgraplp2 )
792static MACHINE_DRIVER_START( cgraplop2 )
793793
794794   /* basic machine hardware */
795795   MDRV_IMPORT_FROM(decocass)
796   MDRV_MACHINE_RESET(cgraplp2)
796   MDRV_MACHINE_RESET(cgraplop2)
797797MACHINE_DRIVER_END
798798
799799
r7356r7357
11701170   ROM_LOAD( "cgraplop.pro", 0x0000, 0x1000, CRC(ee93787d) SHA1(0c753d62fdce2fdbd5b329a5aa259a967d07a651) ) /* is this right for this set? */
11711171
11721172   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
1173   ROM_LOAD( "cgraplp2.cas", 0x0000, 0x8000, CRC(2e728981) SHA1(83ba90d95858d647315a1c311b8643672afea5f7) )
1173   ROM_LOAD( "cgraplop2.cas", 0x0000, 0x8000, CRC(2e728981) SHA1(83ba90d95858d647315a1c311b8643672afea5f7) )
11741174ROM_END
11751175
11761176ROM_START( clapapa )
r7356r7357
14041404/* 27 */ GAME( 1982, cburnrub2,cburnrub, cburnrub, decocass, decocass, ROT270, "Data East Corporation", "Burnin' Rubber (Cassette, set 2)", 0 )
14051405/* 27 */ GAME( 1982, cbnj,     cburnrub, cbnj,     decocass, decocass, ROT270, "Data East Corporation", "Bump N Jump (Cassette)", 0 )
14061406/* 28 */ GAME( 1983, cgraplop, decocass, cgraplop, cgraplop, decocass, ROT270, "Data East Corporation", "Cluster Buster / Graplop (Cassette, set 1)", 0 )
1407/* 28 */ GAME( 1983, cgraplop2,cgraplop, cgraplp2, cgraplop, decocass, ROT270, "Data East Corporation", "Cluster Buster / Graplop (Cassette, set 2)", GAME_NOT_WORKING )
1407/* 28 */ GAME( 1983, cgraplop2,cgraplop, cgraplop2,cgraplop, decocass, ROT270, "Data East Corporation", "Cluster Buster / Graplop (Cassette, set 2)", GAME_NOT_WORKING )
14081408/* 29 */ GAME( 1983, clapapa,  decocass, clapapa,  decocass, decocass, ROT270, "Data East Corporation", "Rootin' Tootin' / La-Pa-Pa (Cassette)" , 0) /* Displays 'La-Pa-Pa during attract */
14091409/* 29 */ GAME( 1983, clapapa2, clapapa,  clapapa,  decocass, decocass, ROT270, "Data East Corporation", "Rootin' Tootin' (Cassette)" , 0) /* Displays 'Rootin' Tootin' during attract */
14101410/* 31 */ GAME( 1983, cprobowl, decocass, cprobowl, decocass, decocass, ROT270, "Data East Corporation", "Pro Bowling (Cassette)", 0 )
src/mame/drivers/irobot.c
r7356r7357
7272    Notes:
7373    - There is no flip screen nor cocktail mode in the original game
7474
7502/2010 - Added XTAL values based on the parts listing the manual.  The
76          divisors for the cpus make sense, however, they are not verified.
77
7578****************************************************************************/
7679
7780#include "emu.h"
r7356r7357
7982#include "sound/pokey.h"
8083#include "includes/irobot.h"
8184
85#define MAIN_CLOCK      XTAL_12_096MHz
86#define VIDEO_CLOCK      XTAL_20MHz
8287
83
8488/*************************************
8589 *
8690 *  NVRAM handler
r7356r7357
153157
154158static INPUT_PORTS_START( irobot )
155159   PORT_START("IN0")   /* IN0 */
156    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
157    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
158    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
159    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
160    PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
161    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 )
162    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
163    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
160   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
161   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
162   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
163   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
164   PORT_SERVICE( 0x10, IP_ACTIVE_LOW )
165   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 )
166   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
167   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
164168
165169   PORT_START("IN1")   /* IN1 */
166    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
167    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
168    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
169    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
170    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
171    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
172    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
173    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
170   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
171   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
172   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
173   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
174   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
175   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
176   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
177   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
174178
175179   PORT_START("IN2")   /* IN2 */
176    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
177    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
178    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
179    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
180    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
181    PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* MB DONE */
182    PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* EXT DONE */
183    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
180   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
181   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
182   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
183   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
184   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
185   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* MB DONE */
186   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* EXT DONE */
187   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
184188
185   PORT_START("DSW1") /* DSW1 */
186   PORT_DIPNAME(    0x03, 0x00, "Coins Per Credit" )
189   PORT_START("DSW2") /* DSW2 - 5E*/
190   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Language ) )  PORT_DIPLOCATION("SW5E:1")
191   PORT_DIPSETTING(   0x01, DEF_STR( English ) )
192   PORT_DIPSETTING(   0x00, DEF_STR( German ) )
193//  Printed Manual States Dip (0x01) adjusts Doodle City playtime:  ON=2M10S / OFF=3M5S
194   PORT_DIPNAME( 0x02, 0x02, "Minimum Game Time" )  PORT_DIPLOCATION("SW5E:2")
195   PORT_DIPSETTING(   0x00, "90 Seconds on Level 1" )
196   PORT_DIPSETTING(   0x02, DEF_STR( None ) )
197   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )  PORT_DIPLOCATION("SW5E:3,4")
198   PORT_DIPSETTING(   0x08, DEF_STR( None ) )
199   PORT_DIPSETTING(   0x0c, "20000" )
200   PORT_DIPSETTING(   0x00, "30000" )
201   PORT_DIPSETTING(   0x04, "50000" )
202   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )  PORT_DIPLOCATION("SW5E:5,6")
203   PORT_DIPSETTING(   0x20, "2" )
204   PORT_DIPSETTING(   0x30, "3" )
205   PORT_DIPSETTING(   0x00, "4" )
206   PORT_DIPSETTING(   0x10, "5" )
207   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )  PORT_DIPLOCATION("SW5E:7")
208   PORT_DIPSETTING(   0x00, DEF_STR( Easy ) )
209   PORT_DIPSETTING(   0x40, DEF_STR( Medium ) )
210   PORT_DIPNAME( 0x80, 0x80, "Demo Mode" )  PORT_DIPLOCATION("SW5E:8")
211   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
212   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
213
214   PORT_START("DSW1") /* DSW1 - 3J */
215   PORT_DIPNAME(    0x03, 0x00, "Coins Per Credit" )  PORT_DIPLOCATION("SW3J:!1,!2")
187216   PORT_DIPSETTING( 0x00, "1 Coin 1 Credit" )
188217   PORT_DIPSETTING( 0x01, "2 Coins 1 Credit" )
189218   PORT_DIPSETTING( 0x02, "3 Coins 1 Credit" )
190219   PORT_DIPSETTING( 0x03, "4 Coins 1 Credit" )
191   PORT_DIPNAME(    0x0c, 0x00, "Right Coin" )
220   PORT_DIPNAME(    0x0c, 0x00, "Right Coin" )  PORT_DIPLOCATION("SW3J:!3,!4")
192221   PORT_DIPSETTING( 0x00, "1 Coin for 1 Coin Unit" )
193222   PORT_DIPSETTING( 0x04, "1 Coin for 4 Coin Units" )
194223   PORT_DIPSETTING( 0x08, "1 Coin for 5 Coin Units" )
195224   PORT_DIPSETTING( 0x0c, "1 Coin for 6 Coin Units" )
196   PORT_DIPNAME(    0x10, 0x00, "Left Coin" )
225   PORT_DIPNAME(    0x10, 0x00, "Left Coin" )  PORT_DIPLOCATION("SW3J:!5")
197226   PORT_DIPSETTING( 0x00, "1 Coin for 1 Coin Unit" )
198227   PORT_DIPSETTING( 0x10, "1 Coin for 2 Coin Units" )
199   PORT_DIPNAME(    0xe0, 0x00, "Bonus Adder" )
228   PORT_DIPNAME(    0xe0, 0x00, "Bonus Adder" )  PORT_DIPLOCATION("SW3J:!6,!7,!8")
200229   PORT_DIPSETTING( 0x00, DEF_STR( None ) )
201230   PORT_DIPSETTING( 0x20, "1 Credit for 2 Coin Units" )
202231   PORT_DIPSETTING( 0xa0, "1 Credit for 3 Coin Units" )
r7356r7357
205234   PORT_DIPSETTING( 0x60, "2 Credits for 4 Coin Units" )
206235   PORT_DIPSETTING( 0xe0, DEF_STR( Free_Play ) )
207236
208   PORT_START("DSW2") /* DSW2 */
209   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Language ) )
210   PORT_DIPSETTING(   0x01, DEF_STR( English ) )
211   PORT_DIPSETTING(   0x00, DEF_STR( German ) )
212   PORT_DIPNAME( 0x02, 0x02, "Min Game Time" )
213   PORT_DIPSETTING(   0x00, "90 Sec" )
214   PORT_DIPSETTING(   0x02, "3 Lives" )
215   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
216   PORT_DIPSETTING(   0x08, DEF_STR( None ) )
217   PORT_DIPSETTING(   0x0c, "20000" )
218   PORT_DIPSETTING(   0x00, "30000" )
219   PORT_DIPSETTING(   0x04, "50000" )
220   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
221   PORT_DIPSETTING(   0x20, "2" )
222   PORT_DIPSETTING(   0x30, "3" )
223   PORT_DIPSETTING(   0x00, "4" )
224   PORT_DIPSETTING(   0x10, "5" )
225   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
226   PORT_DIPSETTING(   0x00, DEF_STR( Easy ) )
227   PORT_DIPSETTING(   0x40, DEF_STR( Medium ) )
228   PORT_DIPNAME( 0x80, 0x80, "Demo Mode" )
229   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
230   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
231
232237   PORT_START("AN0")   /* IN4 */
233238   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(96,163) PORT_SENSITIVITY(70) PORT_KEYDELTA(50)
234239
r7356r7357
285290static MACHINE_DRIVER_START( irobot )
286291
287292   /* basic machine hardware */
288   MDRV_CPU_ADD("maincpu", M6809,1500000)
293   MDRV_CPU_ADD("maincpu", M6809, MAIN_CLOCK/8)
289294   MDRV_CPU_PROGRAM_MAP(irobot_map)
290295
291296   MDRV_MACHINE_RESET(irobot)
r7356r7357
312317   /* sound hardware */
313318   MDRV_SPEAKER_STANDARD_MONO("mono")
314319
315   MDRV_SOUND_ADD("pokey1", POKEY, 1250000)
320   MDRV_SOUND_ADD("pokey1", POKEY, MAIN_CLOCK/8)
316321   MDRV_SOUND_CONFIG(pokey_config)
317322   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
318323
319   MDRV_SOUND_ADD("pokey2", POKEY, 1250000)
324   MDRV_SOUND_ADD("pokey2", POKEY, MAIN_CLOCK/8)
320325   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
321326
322   MDRV_SOUND_ADD("pokey3", POKEY, 1250000)
327   MDRV_SOUND_ADD("pokey3", POKEY, MAIN_CLOCK/8)
323328   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
324329
325   MDRV_SOUND_ADD("pokey4", POKEY, 1250000)
330   MDRV_SOUND_ADD("pokey4", POKEY, MAIN_CLOCK/8)
326331   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
327332MACHINE_DRIVER_END
328333
src/mame/drivers/klax.c
r7356r7357
227227   ROM_LOAD( "136075-1015.14b", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
228228   ROM_LOAD( "136075-1016.12b", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
229229
230    ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
231    ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
232    ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
233    ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
234    ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
235    ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
230   ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
231   ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
232   ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
233   ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
234   ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
235   ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
236236ROM_END
237237
238238
r7356r7357
257257   ROM_LOAD( "136075-1015.14b", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
258258   ROM_LOAD( "136075-1016.12b", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
259259
260    ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
261    ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
262    ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
263    ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
264    ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
265    ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
260   ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
261   ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
262   ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
263   ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
264   ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
265   ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
266266ROM_END
267267
268268
r7356r7357
287287   ROM_LOAD( "136075-1015.14b", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
288288   ROM_LOAD( "136075-1016.12b", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
289289
290    ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
291    ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
292    ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
293    ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
294    ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
295    ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
290   ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
291   ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
292   ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
293   ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
294   ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
295   ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
296296ROM_END
297297
298298
r7356r7357
317317   ROM_LOAD( "136075-1015.14b", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
318318   ROM_LOAD( "136075-1016.12b", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
319319
320    ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
321    ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
322    ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
323    ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
324    ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
325    ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
320   ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
321   ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
322   ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
323   ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
324   ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
325   ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
326326ROM_END
327327
328328
r7356r7357
347347   ROM_LOAD( "136075-1015.14b", 0x00000, 0x10000, CRC(4d24c768) SHA1(da102105a4d8c552e3594b8ffb1903ecbaa69415) )
348348   ROM_LOAD( "136075-1016.12b", 0x10000, 0x10000, CRC(12e9b4b7) SHA1(2447f116cd865e46e61022143a2668beca99d5d1) )
349349
350    ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
351    ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
352    ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
353    ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
354    ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
355    ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
350   ROM_REGION( 0x00573, "pals", 0 ) /* Lattice GAL16V8A-25LP GAL's */
351   ROM_LOAD( "136075-1000.11c.bin", 0x0000, 0x0117, CRC(fb86e94a) SHA1(b16f037c49766ab734e47c8e1b16b5178809b8a3) )
352   ROM_LOAD( "136075-1001.18l.bin", 0x0000, 0x0117, CRC(cd21acfe) SHA1(14bd9e2f1b50a1da550933e3fdc16e3f09b65e92) )
353   ROM_LOAD( "136075-1002.8w.bin",  0x0000, 0x0117, CRC(4a7b6c44) SHA1(9579e098af3e5cd19bd14c361d3b1c5cb9047171) )
354   ROM_LOAD( "136075-1003.9w.bin",  0x0000, 0x0117, CRC(72f7f904) SHA1(f792b5bcc313c5f3338a569a6f376a3ebb1eabf7) )
355   ROM_LOAD( "136075-1004.6w.bin",  0x0000, 0x0117, CRC(6cd3270d) SHA1(84854b5beee539a80fc94f6e4637aa1c2543a1cb) )
356356ROM_END
357357
358358
src/mame/drivers/segas24.c
r7356r7357
338338#include "sound/dac.h"
339339#include "sound/2151intf.h"
340340#include "video/segaic24.h"
341#include "includes/system16.h"
342341#include "includes/segas24.h"
343342
344343#define MASTER_CLOCK      XTAL_20MHz
src/mame/drivers/konamigx.c
r7356r7357
19701970#define _64_WORD_ROM_LOAD(name,offset,length,crc)   ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(6))
19711971
19721972
1973/* Gokujou Parodius */
1973/* Gokujou Parodius version JAD (Japan) */
19741974ROM_START( gokuparo )
19751975   /* main program */
19761976   ROM_REGION( 0x800000, "maincpu", 0 )
19771977   GX_BIOS
1978   ROM_LOAD32_WORD_SWAP( "321jad02.31b", 0x200002, 512*1024, CRC(c2e548c0) SHA1(48fbcc96d1f56bb3abb5098400536a18a676d934) )
1978   ROM_LOAD32_WORD_SWAP( "321jad02.21b", 0x200002, 512*1024, CRC(c2e548c0) SHA1(48fbcc96d1f56bb3abb5098400536a18a676d934) )
19791979   ROM_LOAD32_WORD_SWAP( "321jad04.27b", 0x200000, 512*1024, CRC(916a7951) SHA1(d6f56ff5f6c6708939767e69a3ebc7c7eddb6003) )
19801980
19811981   /* sound program */
19821982   ROM_REGION( 0x40000, "soundcpu", 0 )
1983   ROM_LOAD16_BYTE("321_b06.9c", 0x000000, 128*1024, CRC(da810554) SHA1(f253e1aa137eecf283d8b083ef2b3b049e8366f4) )
1984   ROM_LOAD16_BYTE("321_b07.7c", 0x000001, 128*1024, CRC(c47634c0) SHA1(20e4105df5bbc33edd01894e78f74ed5f173576e) )
1983   ROM_LOAD16_BYTE("321b06.9c", 0x000000, 128*1024, CRC(da810554) SHA1(f253e1aa137eecf283d8b083ef2b3b049e8366f4) )
1984   ROM_LOAD16_BYTE("321b07.7c", 0x000001, 128*1024, CRC(c47634c0) SHA1(20e4105df5bbc33edd01894e78f74ed5f173576e) )
19851985
19861986   /* tiles */
19871987   ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
1988   TILE_WORD_ROM_LOAD( "fj-jap.17h", 0x000000, 2*1024*1024, CRC(437d0057) SHA1(30c449200e0510dc664289b527bade6e10dbe57a) )
1988   TILE_WORD_ROM_LOAD( "321b14.17h", 0x000000, 2*1024*1024, CRC(437d0057) SHA1(30c449200e0510dc664289b527bade6e10dbe57a) )
19891989   TILE_BYTE_ROM_LOAD( "321b12.13g", 0x000004, 512*1024, CRC(5f9edfa0) SHA1(36d54c5fe498a4d0fa64757cef11c56c67518258) )
19901990
19911991   /* sprites */
19921992   ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
1993   ROM_LOAD32_WORD( "fj-jap.25g", 0x000000, 2*1024*1024, CRC(c6e2e74d) SHA1(3875a50923e46e2986dbe2573453af5c7fa726f7) )
1994   ROM_LOAD32_WORD( "fj-jap.28g", 0x000002, 2*1024*1024, CRC(ea9f8c48) SHA1(b5e880015887308a5f1c1c623011d9b0903e848f) )
1993   ROM_LOAD32_WORD( "321b11.25g", 0x000000, 2*1024*1024, CRC(c6e2e74d) SHA1(3875a50923e46e2986dbe2573453af5c7fa726f7) )
1994   ROM_LOAD32_WORD( "321b10.28g", 0x000002, 2*1024*1024, CRC(ea9f8c48) SHA1(b5e880015887308a5f1c1c623011d9b0903e848f) )
19951995   ROM_LOAD( "321b09.30g", 0x400000, 1*1024*1024, CRC(94add237) SHA1(9a6d0a9727e7fa02d91ece220b145074a6741a95) )
19961996
19971997   /* sound data */
r7356r7357
20002000   ROM_LOAD( "321b18.7g", 0x200000, 2*1024*1024, CRC(2c561ad0) SHA1(6265054072ba1c2837dd96e0259b20bc50457160) )
20012001ROM_END
20022002
2003/* Fantastic Journey (version) */
2003/* Fantastic Journey version EAA (Euro) */
20042004ROM_START( fantjour )
20052005   /* main program */
20062006   ROM_REGION( 0x800000, "maincpu", 0 )
20072007   GX_BIOS
2008   ROM_LOAD32_WORD_SWAP( "fsus31b.bin", 0x200002, 512*1024, CRC(afaf9d17) SHA1(a12214c6e634862d6507f56719b55d4a23a0ef0f) )
2009   ROM_LOAD32_WORD_SWAP( "fsus27b.bin", 0x200000, 512*1024, CRC(b2cfe225) SHA1(7fd43acb1dd853a7980e7fcf48971ae28175e421) )
2008   ROM_LOAD32_WORD_SWAP( "321eaa02.21b", 0x200002, 512*1024, CRC(afaf9d17) SHA1(a12214c6e634862d6507f56719b55d4a23a0ef0f) )
2009   ROM_LOAD32_WORD_SWAP( "321eaa04.27b", 0x200000, 512*1024, CRC(b2cfe225) SHA1(7fd43acb1dd853a7980e7fcf48971ae28175e421) )
20102010
20112011   /* sound program */
20122012   ROM_REGION( 0x40000, "soundcpu", 0 )
2013   ROM_LOAD16_BYTE("321_b06.9c", 0x000000, 128*1024, CRC(da810554) SHA1(f253e1aa137eecf283d8b083ef2b3b049e8366f4) )
2014   ROM_LOAD16_BYTE("321_b07.7c", 0x000001, 128*1024, CRC(c47634c0) SHA1(20e4105df5bbc33edd01894e78f74ed5f173576e) )
2013   ROM_LOAD16_BYTE("321b06.9c", 0x000000, 128*1024, CRC(da810554) SHA1(f253e1aa137eecf283d8b083ef2b3b049e8366f4) )
2014   ROM_LOAD16_BYTE("321b07.7c", 0x000001, 128*1024, CRC(c47634c0) SHA1(20e4105df5bbc33edd01894e78f74ed5f173576e) )
20152015
20162016   /* tiles */
20172017   ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
2018   TILE_WORD_ROM_LOAD( "fj-jap.17h", 0x000000, 2*1024*1024, CRC(437d0057) SHA1(30c449200e0510dc664289b527bade6e10dbe57a) )
2018   TILE_WORD_ROM_LOAD( "321b14.17h", 0x000000, 2*1024*1024, CRC(437d0057) SHA1(30c449200e0510dc664289b527bade6e10dbe57a) )
20192019   TILE_BYTE_ROM_LOAD( "321b12.13g", 0x000004, 512*1024, CRC(5f9edfa0) SHA1(36d54c5fe498a4d0fa64757cef11c56c67518258) )
20202020
20212021   /* sprites */
20222022   ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
2023   ROM_LOAD32_WORD( "fj-jap.25g", 0x000000, 2*1024*1024, CRC(c6e2e74d) SHA1(3875a50923e46e2986dbe2573453af5c7fa726f7) )
2024   ROM_LOAD32_WORD( "fj-jap.28g", 0x000002, 2*1024*1024, CRC(ea9f8c48) SHA1(b5e880015887308a5f1c1c623011d9b0903e848f) )
2023   ROM_LOAD32_WORD( "321b11.25g", 0x000000, 2*1024*1024, CRC(c6e2e74d) SHA1(3875a50923e46e2986dbe2573453af5c7fa726f7) )
2024   ROM_LOAD32_WORD( "321b10.28g", 0x000002, 2*1024*1024, CRC(ea9f8c48) SHA1(b5e880015887308a5f1c1c623011d9b0903e848f) )
20252025   ROM_LOAD( "321b09.30g", 0x400000, 1*1024*1024, CRC(94add237) SHA1(9a6d0a9727e7fa02d91ece220b145074a6741a95) )
20262026
20272027   /* sound data */
r7356r7357
20302030   ROM_LOAD( "321b18.7g", 0x200000, 2*1024*1024, CRC(2c561ad0) SHA1(6265054072ba1c2837dd96e0259b20bc50457160) )
20312031ROM_END
20322032
2033/* Fantastic Journey version AAA (Asia) */
2034ROM_START( fantjoura )
2035   /* main program */
2036   ROM_REGION( 0x800000, "maincpu", 0 )
2037   GX_BIOS
2038   ROM_LOAD32_WORD_SWAP( "321aaa02.21b", 0x200002, 512*1024, CRC(5efb62f8) SHA1(637ea9809bd49c865f6d565d2707ddb110f9bea2) )
2039   ROM_LOAD32_WORD_SWAP( "321aaa04.27b", 0x200000, 512*1024, CRC(507becce) SHA1(feaced6562569679ea3813546cbcb8fa40709dd5) )
2040
2041   /* sound program */
2042   ROM_REGION( 0x40000, "soundcpu", 0 )
2043   ROM_LOAD16_BYTE("321b06.9c", 0x000000, 128*1024, CRC(da810554) SHA1(f253e1aa137eecf283d8b083ef2b3b049e8366f4) )
2044   ROM_LOAD16_BYTE("321b07.7c", 0x000001, 128*1024, CRC(c47634c0) SHA1(20e4105df5bbc33edd01894e78f74ed5f173576e) )
2045
2046   /* tiles */
2047   ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
2048   TILE_WORD_ROM_LOAD( "321b14.17h", 0x000000, 2*1024*1024, CRC(437d0057) SHA1(30c449200e0510dc664289b527bade6e10dbe57a) )
2049   TILE_BYTE_ROM_LOAD( "321b12.13g", 0x000004, 512*1024, CRC(5f9edfa0) SHA1(36d54c5fe498a4d0fa64757cef11c56c67518258) )
2050
2051   /* sprites */
2052   ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
2053   ROM_LOAD32_WORD( "321b11.25g", 0x000000, 2*1024*1024, CRC(c6e2e74d) SHA1(3875a50923e46e2986dbe2573453af5c7fa726f7) )
2054   ROM_LOAD32_WORD( "321b10.28g", 0x000002, 2*1024*1024, CRC(ea9f8c48) SHA1(b5e880015887308a5f1c1c623011d9b0903e848f) )
2055   ROM_LOAD( "321b09.30g", 0x400000, 1*1024*1024, CRC(94add237) SHA1(9a6d0a9727e7fa02d91ece220b145074a6741a95) )
2056
2057   /* sound data */
2058   ROM_REGION( 0x400000, "shared", 0 )
2059   ROM_LOAD( "321b17.9g", 0x000000, 2*1024*1024, CRC(b3e8d5d8) SHA1(6644a414e7f0e69ded9aa1bf892566002cebae26) )
2060   ROM_LOAD( "321b18.7g", 0x200000, 2*1024*1024, CRC(2c561ad0) SHA1(6265054072ba1c2837dd96e0259b20bc50457160) )
2061ROM_END
2062
20332063/* Salamander 2 version JAA (Japan) */
20342064ROM_START( salmndr2 )
20352065   /* main program */
r7356r7357
30643094   /* main program */
30653095   ROM_REGION( 0x800000, "maincpu", 0 )
30663096   GX_BIOS
3067    ROM_LOAD32_WORD_SWAP( "627aaa03.29m", 0x200000, 0x080000, CRC(50e23a50) SHA1(82cf1b051cfb2f94567c5a4199802960798c1152) )
3068    ROM_LOAD32_WORD_SWAP( "627aaa02.31m", 0x200002, 0x080000, CRC(e3d21afe) SHA1(28c213106087da425f85bb7f3398aca98964ea38) )
3097   ROM_LOAD32_WORD_SWAP( "627aaa03.29m", 0x200000, 0x080000, CRC(50e23a50) SHA1(82cf1b051cfb2f94567c5a4199802960798c1152) )
3098   ROM_LOAD32_WORD_SWAP( "627aaa02.31m", 0x200002, 0x080000, CRC(e3d21afe) SHA1(28c213106087da425f85bb7f3398aca98964ea38) )
30693099
30703100   ROM_LOAD32_WORD_SWAP( "627a05.29r", 0x400000, 1024*1024, CRC(be4e7b3c) SHA1(f44e7b1913aa54f759bd31bb86fdedbb9747b2d5) )
30713101   ROM_LOAD32_WORD_SWAP( "627a04.31r", 0x400002, 1024*1024, CRC(17334e9a) SHA1(82cdba016c29160550c43feee7a4feff6e1184aa) )
r7356r7357
37083738GAME( 1994, le2,      konamigx, le2,      le2,      konamigx, ROT0, "Konami", "Lethal Enforcers II: Gun Fighters (ver EAA)", GAME_IMPERFECT_GRAPHICS )
37093739GAME( 1994, le2u,     le2,      le2,      le2,      konamigx, ROT0, "Konami", "Lethal Enforcers II: Gun Fighters (ver UAA)", GAME_IMPERFECT_GRAPHICS )
37103740GAME( 1994, le2j,     le2,      le2,      le2,      konamigx, ROT0, "Konami", "Lethal Enforcers II: Gun Fighters (ver JAA)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING)
3711GAME( 1994, gokuparo, konamigx, konamigx, gokuparo, konamigx, ROT0, "Konami", "Gokujyou Parodius (ver JAD)", GAME_IMPERFECT_GRAPHICS )
3712GAME( 1994, fantjour, gokuparo, konamigx, gokuparo, konamigx, ROT0, "Konami", "Fantastic Journey", GAME_IMPERFECT_GRAPHICS )
3741GAME( 1994, fantjour, konamigx, konamigx, gokuparo, konamigx, ROT0, "Konami", "Fantastic Journey (ver EAA)", GAME_IMPERFECT_GRAPHICS )
3742GAME( 1994, fantjoura,fantjour, konamigx, gokuparo, konamigx, ROT0, "Konami", "Fantastic Journey (ver AAA)", GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION )
3743GAME( 1994, gokuparo, fantjour, konamigx, gokuparo, konamigx, ROT0, "Konami", "Gokujyou Parodius (ver JAD)", GAME_IMPERFECT_GRAPHICS )
37133744GAME( 1994, puzldama, konamigx, konamigx, puzldama, konamigx, ROT0, "Konami", "Taisen Puzzle-dama (ver JAA)", GAME_IMPERFECT_GRAPHICS )
37143745GAME( 1995, tbyahhoo, konamigx, konamigx, gokuparo, konamigx, ROT0, "Konami", "Twin Bee Yahhoo! (ver JAA)", GAME_IMPERFECT_GRAPHICS )
37153746GAME( 1995, tkmmpzdm, konamigx, konamigx_6bpp, puzldama, konamigx, ROT0, "Konami", "Tokimeki Memorial Taisen Puzzle-dama (ver JAB)", GAME_IMPERFECT_GRAPHICS )
r7356r7357
37263757GAME( 1997, winspikej,winspike, winspike, konamigx, konamigx, ROT0, "Konami", "Winning Spike (ver JAA)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS )
37273758
37283759/* Type 3: dual monitor output and 53936 on the ROM board, external palette RAM */
3729GAME( 1994, soccerss, konamigx, gxtype3,  type3, konamigx, ROT0, "Konami", "Soccer Superstars (ver EAA)", GAME_IMPERFECT_GRAPHICS )
3730GAME( 1994, soccerssj,soccerss, gxtype3,  type3, konamigx, ROT0, "Konami", "Soccer Superstars (ver JAC)", GAME_IMPERFECT_GRAPHICS ) // writes JAB to EEPROM, but should be version JAC according to labels
3760GAME( 1994, soccerss,  konamigx, gxtype3,  type3, konamigx, ROT0, "Konami", "Soccer Superstars (ver EAA)", GAME_IMPERFECT_GRAPHICS )
3761GAME( 1994, soccerssj, soccerss, gxtype3,  type3, konamigx, ROT0, "Konami", "Soccer Superstars (ver JAC)", GAME_IMPERFECT_GRAPHICS ) // writes JAB to EEPROM, but should be version JAC according to labels
37313762GAME( 1994, soccerssja,soccerss, gxtype3,  type3, konamigx, ROT0, "Konami", "Soccer Superstars (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3732GAME( 1994, soccerssa,soccerss, gxtype3,  type3, konamigx, ROT0, "Konami", "Soccer Superstars (ver AAA)", GAME_IMPERFECT_GRAPHICS )
3763GAME( 1994, soccerssa, soccerss, gxtype3,  type3, konamigx, ROT0, "Konami", "Soccer Superstars (ver AAA)", GAME_IMPERFECT_GRAPHICS )
37333764
37343765/* Type 4: dual monitor output and 53936 on the ROM board, external palette RAM, DMA protection */
37353766GAME( 1996, vsnetscr,  konamigx, gxtype4_vsn, type3, konamigx, ROT0, "Konami", "Versus Net Soccer (ver EAD)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
r7356r7357
37373768GAME( 1996, vsnetscru, vsnetscr, gxtype4_vsn, type3, konamigx, ROT0, "Konami", "Versus Net Soccer (ver UAB)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
37383769GAME( 1996, vsnetscra, vsnetscr, gxtype4_vsn, type3, konamigx, ROT0, "Konami", "Versus Net Soccer (ver AAA)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
37393770GAME( 1996, vsnetscrj, vsnetscr, gxtype4_vsn, type3, konamigx, ROT0, "Konami", "Versus Net Soccer (ver JAB)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3740GAME( 1996, rungun2,   konamigx, gxtype4sd2, type3, konamigx, ROT0, "Konami", "Run and Gun 2 (ver UAA)", GAME_IMPERFECT_GRAPHICS )
3741GAME( 1996, slamdnk2,  rungun2,  gxtype4sd2, type3, konamigx, ROT0, "Konami", "Slam Dunk 2 (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3742GAME( 1996, rushhero,  konamigx, gxtype4, type3, konamigx, ROT0, "Konami", "Rushing Heroes (ver UAB)", GAME_IMPERFECT_GRAPHICS  )
3771GAME( 1996, rungun2,   konamigx, gxtype4sd2,  type3, konamigx, ROT0, "Konami", "Run and Gun 2 (ver UAA)", GAME_IMPERFECT_GRAPHICS )
3772GAME( 1996, slamdnk2,  rungun2,  gxtype4sd2,  type3, konamigx, ROT0, "Konami", "Slam Dunk 2 (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3773GAME( 1996, rushhero,  konamigx, gxtype4,     type3, konamigx, ROT0, "Konami", "Rushing Heroes (ver UAB)", GAME_IMPERFECT_GRAPHICS  )
src/mame/drivers/segac2.c
r7356r7357
7373#include "sound/2612intf.h"
7474#include "sound/upd7759.h"
7575
76#include "megadriv.h"
76#include "includes/megadriv.h"
7777
7878#define XL1_CLOCK         640000
7979#define XL2_CLOCK         53693175
src/mame/drivers/exidy.c
r7356r7357
14821482GAME( 1980, rallys,   spectar, rallys,   rallys,   rallys,   ROT0, "Novar", "Rallys (bootleg of Spectar)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
14831483GAME( 1980, panzer,   spectar, rallys,   rallys,   rallys,   ROT0, "Proel", "Panzer (bootleg of Spectar)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
14841484GAME( 1980, phantoma, spectar, rallys,   phantoma, phantoma, ROT0, "Jeutel","Phantomas (bootleg of Spectar)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1485GAME( 1980, phantom,  spectar, rallys,   phantoma, phantoma, ROT0, "Proel","Phantom (bootleg of Spectar)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1485GAME( 1980, phantom,  spectar, rallys,   phantoma, phantoma, ROT0, "Proel", "Phantom (bootleg of Spectar)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
14861486
14871487GAME( 1981, mtrap,    0,       mtrap,    mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 5)", GAME_SUPPORTS_SAVE )
14881488GAME( 1981, mtrap3,   mtrap,   mtrap,    mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 3)", GAME_SUPPORTS_SAVE )
src/mame/drivers/puckpkmn.c
r7356r7357
4848#include "sound/sn76496.h"
4949#include "sound/2612intf.h"
5050
51#include "megadriv.h"
51#include "includes/megadriv.h"
5252
5353
5454/* Puckman Pockimon Input Ports */
src/mame/drivers/gamecstl.c
r7356r7357
777777
778778/*****************************************************************************/
779779
780GAME(2002, gamecstl, 0,   gamecstl, gamecstl, gamecstl,   ROT0,   "Cristaltec", "GameCristal", GAME_NOT_WORKING | GAME_NO_SOUND)
780GAME(2002, gamecstl, 0,        gamecstl, gamecstl, gamecstl, ROT0, "Cristaltec", "GameCristal", GAME_NOT_WORKING | GAME_NO_SOUND)
781781GAME(2002, gamecst2, gamecstl, gamecstl, gamecstl, gamecstl, ROT0, "Cristaltec", "GameCristal (version 2.613)", GAME_NOT_WORKING | GAME_NO_SOUND)
src/mame/drivers/cidelsa.c
r7356r7357
236236   AM_RANGE(0xf800, 0xffff) AM_DEVREADWRITE(CDP1869_TAG, cdp1869_pageram_r, cdp1869_pageram_w)
237237ADDRESS_MAP_END
238238
239static ADDRESS_MAP_START( destryea_map, ADDRESS_SPACE_PROGRAM, 8 )
239static ADDRESS_MAP_START( destryera_map, ADDRESS_SPACE_PROGRAM, 8 )
240240   AM_RANGE(0x0000, 0x1fff) AM_ROM
241241   AM_RANGE(0x3000, 0x30ff) AM_RAM AM_BASE_SIZE_GENERIC(nvram)
242242   AM_RANGE(0xf400, 0xf7ff) AM_DEVREADWRITE(CDP1869_TAG, cdp1869_charram_r, cdp1869_charram_w)
r7356r7357
526526   MDRV_IMPORT_FROM(destryer_video)
527527MACHINE_DRIVER_END
528528
529static MACHINE_DRIVER_START( destryea )
529static MACHINE_DRIVER_START( destryera )
530530   MDRV_DRIVER_DATA(cidelsa_state)
531531
532532   /* basic system hardware */
533533   MDRV_CPU_ADD(CDP1802_TAG, CDP1802, DESTRYER_CHR1)
534   MDRV_CPU_PROGRAM_MAP(destryea_map)
534   MDRV_CPU_PROGRAM_MAP(destryera_map)
535535   MDRV_CPU_IO_MAP(destryer_io_map)
536536   MDRV_CPU_CONFIG(cidelsa_cdp1802_config)
537537   MDRV_NVRAM_HANDLER(generic_0fill)
r7356r7357
605605ROM_END
606606
607607// this was destroyer2.rom in standalone emu..
608ROM_START( destryea )
608ROM_START( destryera )
609609   ROM_REGION( 0x10000, CDP1802_TAG, 0 )
610   ROM_LOAD( "destryea_1", 0x0000, 0x0800, CRC(421428e9) SHA1(0ac3a1e7f61125a1cd82145fa28cbc4b93505dc9) )
611   ROM_LOAD( "destryea_2", 0x0800, 0x0800, CRC(55dc8145) SHA1(a0066d3f3ac0ae56273485b74af90eeffea5e64e) )
612   ROM_LOAD( "destryea_3", 0x1000, 0x0800, CRC(5557bdf8) SHA1(37a9cbc5d25051d3bed7535c58aac937cd7c64e1) )
613   ROM_LOAD( "destryea_4", 0x1800, 0x0800, CRC(608b779c) SHA1(8fd6cc376c507680777553090329cc66be42a934) )
610   ROM_LOAD( "destryera_1", 0x0000, 0x0800, CRC(421428e9) SHA1(0ac3a1e7f61125a1cd82145fa28cbc4b93505dc9) )
611   ROM_LOAD( "destryera_2", 0x0800, 0x0800, CRC(55dc8145) SHA1(a0066d3f3ac0ae56273485b74af90eeffea5e64e) )
612   ROM_LOAD( "destryera_3", 0x1000, 0x0800, CRC(5557bdf8) SHA1(37a9cbc5d25051d3bed7535c58aac937cd7c64e1) )
613   ROM_LOAD( "destryera_4", 0x1800, 0x0800, CRC(608b779c) SHA1(8fd6cc376c507680777553090329cc66be42a934) )
614614ROM_END
615615
616616ROM_START( altair )
r7356r7357
640640
641641/* Game Drivers */
642642
643GAME( 1980, destryer, 0,      destryer, destryer, 0, ROT90, "Cidelsa", "Destroyer (Cidelsa) (set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
644GAME( 1980, destryea, destryer, destryea, destryer, 0, ROT90, "Cidelsa", "Destroyer (Cidelsa) (set 2)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
645GAME( 1981, altair,   0,      altair,   altair,   0, ROT90, "Cidelsa", "Altair", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
646GAME( 1981, draco,    0,      draco,    draco,    0, ROT90, "Cidelsa", "Draco", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
643GAME( 1980, destryer, 0,        destryer, destryer, 0, ROT90, "Cidelsa", "Destroyer (Cidelsa) (set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
644GAME( 1980, destryera,destryer, destryera,destryer, 0, ROT90, "Cidelsa", "Destroyer (Cidelsa) (set 2)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
645GAME( 1981, altair,   0,        altair,   altair,   0, ROT90, "Cidelsa", "Altair", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
646GAME( 1981, draco,    0,        draco,    draco,    0, ROT90, "Cidelsa", "Draco", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
src/mame/drivers/segas16b.c
r7356r7357
871871#include "cpu/z80/z80.h"
872872#include "cpu/m68000/m68000.h"
873873#include "cpu/mcs51/mcs51.h"
874#include "includes/system16.h"
874#include "includes/segas16.h"
875875#include "machine/segaic16.h"
876876#include "machine/fd1089.h"
877877#include "machine/fd1094.h"
r7356r7357
879879#include "sound/2151intf.h"
880880#include "sound/2413intf.h"
881881#include "sound/upd7759.h"
882#include "video/segaic16.h"
882883
883884
884885/*************************************
r7356r7357
891892#define MASTER_CLOCK_8MHz      XTAL_8MHz
892893#define MASTER_CLOCK_25MHz      XTAL_25_1748MHz
893894
894#define ROM_BOARD_171_5358_SMALL (0)   /* 171-5358 with smaller ROMs */
895#define ROM_BOARD_171_5358      (1)      /* 171-5358 */
896#define ROM_BOARD_171_5521      (2)      /* 171-5521 */
897#define ROM_BOARD_171_5704      (2)      /* 171-5704 - don't know any diff between this and 171-5521 */
898#define ROM_BOARD_ATOMICP      (3)      /* (custom Korean) */
899#define ROM_BOARD_171_5797      (4)      /* 171-5797 */
895#define ROM_BOARD_171_5358_SMALL    (0)   /* 171-5358 with smaller ROMs */
896#define ROM_BOARD_171_5358          (1)      /* 171-5358 */
897#define ROM_BOARD_171_5521          (2)      /* 171-5521 */
898#define ROM_BOARD_171_5704          (2)      /* 171-5704 - don't know any diff between this and 171-5521 */
899#define ROM_BOARD_ATOMICP           (3)      /* (custom Korean) */
900#define ROM_BOARD_171_5797          (4)      /* 171-5797 */
900901
901902
902
903903/*************************************
904904 *
905905 *  Statics
r7356r7357
908908
909909static UINT16 *workram;
910910
911static UINT8 rom_board;
912static UINT8 atomicp_sound_divisor;
913static UINT8 atomicp_sound_count;
914911
915static UINT8 has_sound_cpu;
916
917static read16_space_func custom_io_r;
918static write16_space_func custom_io_w;
919
920static UINT8 disable_screen_blanking;
921static UINT8 mj_input_num;
922static UINT8 hwc_input_value;
923
924static void (*i8751_vblank_hook)(running_machine *machine);
925static const UINT8 *i8751_initial_config;
926
927
928
929912/*************************************
930913 *
931914 *  Prototypes
r7356r7357
956939   { 0x35/2, 0x00000, 0x10000, 0xfe0000,      ~0, NULL,      "bank11", segaic16_tileram_0_w,  NULL,     &segaic16_tileram_0,   "tile RAM" },
957940   { 0x35/2, 0x10000, 0x01000, 0xfef000,      ~0, NULL,      "bank12", segaic16_textram_0_w,  NULL,     &segaic16_textram_0,   "text RAM" },
958941   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, NULL,      "bank13", NULL,                  "bank13", &segaic16_spriteram_0, "object RAM" },
959   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, NULL,      "bank14", NULL,                  "bank14", &workram,              "work RAM" },
942   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, NULL,      "bank14", NULL,                  "bank14", &workram,     "work RAM" },
960943   { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x20000, NULL,      "bank15", NULL,                  NULL,     NULL,                  "ROM 2" },
961944   { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x10000, NULL,      "bank16", NULL,                  NULL,     NULL,                  "ROM 1" },
962945   { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, NULL,      "bank17", NULL,                  NULL,     NULL,                  "ROM 0" },
r7356r7357
970953   { 0x35/2, 0x00000, 0x10000, 0xfe0000,      ~0, NULL,      "bank11", segaic16_tileram_0_w,  NULL,     &segaic16_tileram_0,   "tile RAM" },
971954   { 0x35/2, 0x10000, 0x01000, 0xfef000,      ~0, NULL,      "bank12", segaic16_textram_0_w,  NULL,     &segaic16_textram_0,   "text RAM" },
972955   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, NULL,      "bank13", NULL,                  "bank13", &segaic16_spriteram_0, "object RAM" },
973   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, NULL,      "bank14", NULL,                  "bank14", &workram,              "work RAM" },
956   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, NULL,      "bank14", NULL,                  "bank14", &workram,     "work RAM" },
974957   { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x40000, NULL,      "bank15", NULL,                  NULL,     NULL,                  "ROM 2" },
975958   { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x20000, NULL,      "bank16", NULL,                  NULL,     NULL,                  "ROM 1" },
976959   { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, NULL,      "bank17", NULL,                  NULL,     NULL,                  "ROM 0" },
r7356r7357
984967   { 0x35/2, 0x00000, 0x10000, 0xfe0000,      ~0, NULL,      "bank11", segaic16_tileram_0_w,  NULL,     &segaic16_tileram_0,   "tile RAM" },
985968   { 0x35/2, 0x10000, 0x01000, 0xfef000,      ~0, NULL,      "bank12", segaic16_textram_0_w,  NULL,     &segaic16_textram_0,   "text RAM" },
986969   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, NULL,      "bank13", NULL,                  "bank13", &segaic16_spriteram_0, "object RAM" },
987   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, NULL,      "bank14", NULL,                  "bank14", &workram,              "work RAM" },
970   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, NULL,      "bank14", NULL,                  "bank14", &workram,     "work RAM" },
988971   { 0x29/2, 0x00000, 0x10000, 0xff0000,      ~0, NULL,      NULL,     rom_5704_bank_w,       NULL,     NULL,                  "tile bank" },
989972   { 0x25/2, 0x00000, 0x80000, 0xfc0000, 0x80000, NULL,      "bank16", NULL,                  NULL,     NULL,                  "ROM 1" },
990973   { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, NULL,      "bank17", NULL,                  NULL,     NULL,                  "ROM 0" },
r7356r7357
998981   { 0x35/2, 0x00000, 0x10000, 0xfe0000,      ~0, NULL,      "bank11", segaic16_tileram_0_w,  NULL,     &segaic16_tileram_0,   "tile RAM" },
999982   { 0x35/2, 0x10000, 0x01000, 0xfef000,      ~0, NULL,      "bank12", segaic16_textram_0_w,  NULL,     &segaic16_textram_0,   "text RAM" },
1000983   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, NULL,      "bank13", NULL,                  "bank13", &segaic16_spriteram_0, "object RAM" },
1001   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, NULL,      "bank14", NULL,                  "bank14", &workram,              "work RAM" },
984   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, NULL,      "bank14", NULL,                  "bank14", &workram,     "work RAM" },
1002985   { 0x29/2, 0x00000, 0x10000, 0xff0000,      ~0, NULL,      NULL,     rom_5704_bank_w,       NULL,     NULL,                  "tile bank" },
1003986   { 0x25/2, 0x00000, 0x10000, 0xff0000,      ~0, NULL,      NULL,     atomicp_sound_w,       NULL,     NULL,                  "sound" },
1004987   { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, NULL,      "bank17", NULL,                  NULL,     NULL,                  "ROM 0" },
r7356r7357
1012995   { 0x35/2, 0x00000, 0x10000, 0xfe0000,      ~0, NULL,                 "bank11", segaic16_tileram_0_w,  NULL,     &segaic16_tileram_0,   "tile RAM" },
1013996   { 0x35/2, 0x10000, 0x01000, 0xfef000,      ~0, NULL,                 "bank12", segaic16_textram_0_w,  NULL,     &segaic16_textram_0,   "text RAM" },
1014997   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, NULL,                 "bank13", NULL,                  "bank13", &segaic16_spriteram_0, "object RAM" },
1015   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, NULL,                 "bank14", NULL,                  "bank14", &workram,              "work RAM" },
998   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, NULL,                 "bank14", NULL,                  "bank14", &workram,     "work RAM" },
1016999   { 0x29/2, 0x00000, 0x10000, 0xff0000,      ~0, unknown_rgn2_r,       NULL,     unknown_rgn2_w,        NULL,     NULL,                  "???" },
10171000   { 0x25/2, 0x00000, 0x04000, 0xffc000,      ~0, rom_5797_bank_math_r, NULL,     rom_5797_bank_math_w,  NULL,     NULL,                  "tile bank/math" },
10181001   { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, NULL,                 "bank17", NULL,                  NULL,     NULL,                  "ROM 0" },
r7356r7357
10381021
10391022static void sound_w(running_machine *machine, UINT8 data)
10401023{
1041   if (has_sound_cpu)
1024   segas1x_state *state = (segas1x_state *)machine->driver_data;
1025
1026   if (state->soundcpu != NULL)
10421027   {
1043      const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
1028      const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
10441029      soundlatch_w(space, 0, data & 0xff);
1045      cputag_set_input_line(machine, "soundcpu", 0, HOLD_LINE);
1030      cpu_set_input_line(state->soundcpu, 0, HOLD_LINE);
10461031   }
10471032}
10481033
10491034
10501035static void system16b_generic_init(running_machine *machine, int _rom_board)
10511036{
1037   segas1x_state *state = (segas1x_state *)machine->driver_data;
1038
10521039   /* set the ROM board */
1053   rom_board = _rom_board;
1040   state->rom_board = _rom_board;
10541041
10551042   /* allocate memory for regions not autmatically assigned */
1056   segaic16_spriteram_0 = auto_alloc_array(machine, UINT16, 0x00800/2);
1057   segaic16_paletteram  = auto_alloc_array(machine, UINT16, 0x01000/2);
1058   segaic16_tileram_0   = auto_alloc_array(machine, UINT16, 0x10000/2);
1059   segaic16_textram_0   = auto_alloc_array(machine, UINT16, 0x01000/2);
1060   workram              = auto_alloc_array(machine, UINT16, 0x04000/2);
1043   segaic16_spriteram_0 = auto_alloc_array(machine, UINT16, 0x00800 / 2);
1044   segaic16_paletteram  = auto_alloc_array(machine, UINT16, 0x01000 / 2);
1045   segaic16_tileram_0   = auto_alloc_array(machine, UINT16, 0x10000 / 2);
1046   segaic16_textram_0   = auto_alloc_array(machine, UINT16, 0x01000 / 2);
1047   workram              = auto_alloc_array(machine, UINT16, 0x04000 / 2);
10611048
10621049   /* init the memory mapper */
1063   segaic16_memory_mapper_init(devtag_get_device(machine, "maincpu"), region_info_list[rom_board], sound_w, NULL);
1050   segaic16_memory_mapper_init(devtag_get_device(machine, "maincpu"), region_info_list[state->rom_board], sound_w, NULL);
10641051
10651052   /* init the FD1094 */
10661053   fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted);
10671054
10681055   /* reset the custom handlers and other pointers */
1069   custom_io_r = NULL;
1070   custom_io_w = NULL;
1071   i8751_vblank_hook = NULL;
1072   i8751_initial_config = NULL;
1073   disable_screen_blanking = 0;
1056   state->custom_io_r = NULL;
1057   state->custom_io_w = NULL;
1058   state->i8751_vblank_hook = NULL;
1059   state->i8751_initial_config = NULL;
1060   state->disable_screen_blanking = 0;
10741061
1075   /* see if we have a sound CPU and a UPD7759 chip */
1076   has_sound_cpu = (devtag_get_device(machine, "soundcpu") != NULL);
1062   state->maincpu = devtag_get_device(machine, "maincpu");
1063   state->soundcpu = devtag_get_device(machine, "soundcpu");
1064   state->mcu = devtag_get_device(machine, "mcu");
1065   state->ymsnd = devtag_get_device(machine, "ymsnd");
1066   state->_315_5248_1 = devtag_get_device(machine, "315_5248");
1067   state->_315_5250_1 = devtag_get_device(machine, "315_5250_1");
1068   state->_315_5250_2 = devtag_get_device(machine, "315_5250_2");
1069
1070   state_save_register_global(machine, state->disable_screen_blanking);
1071   state_save_register_global(machine, state->mj_input_num);
1072   state_save_register_global(machine, state->mj_last_val);
1073   state_save_register_global(machine, state->hwc_input_value);
1074   state_save_register_global(machine, state->atomicp_sound_divisor);
1075   state_save_register_global(machine, state->atomicp_sound_count);
1076   state_save_register_global_pointer(machine, segaic16_spriteram_0, 0x00800/2);
1077   state_save_register_global_pointer(machine, segaic16_paletteram,  0x01000/2);
1078   state_save_register_global_pointer(machine, segaic16_tileram_0,   0x10000/2);
1079   state_save_register_global_pointer(machine, segaic16_textram_0,   0x01000/2);
1080   state_save_register_global_pointer(machine, workram,              0x04000/2);
10771081}
10781082
10791083
10801084static TIMER_CALLBACK( suspend_i8751 )
10811085{
1082   cpu_suspend(devtag_get_device(machine, "mcu"), SUSPEND_REASON_DISABLE, 1);
1086   segas1x_state *state = (segas1x_state *)machine->driver_data;
1087   cpu_suspend(state->mcu, SUSPEND_REASON_DISABLE, 1);
10831088}
10841089
10851090
r7356r7357
10921097
10931098static MACHINE_RESET( system16b )
10941099{
1100   segas1x_state *state = (segas1x_state *)machine->driver_data;
10951101   static const UINT8 default_banklist[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
10961102   static const UINT8 alternate_banklist[] = { 0,255,255,255, 255,255,255,3, 255,255,255,2, 255,1,0,255 };
10971103   int i;
10981104
10991105   segaic16_memory_mapper_reset(machine);
1100   if (i8751_initial_config != NULL)
1101      segaic16_memory_mapper_config(machine, i8751_initial_config);
1106   if (state->i8751_initial_config != NULL)
1107      segaic16_memory_mapper_config(machine, state->i8751_initial_config);
11021108   segaic16_tilemap_reset(machine, 0);
11031109
11041110   fd1094_machine_init(devtag_get_device(machine, "maincpu"));
11051111
11061112   /* if we have a fake i8751 handler, disable the actual 8751 */
1107   if (i8751_vblank_hook != NULL)
1113   if (state->i8751_vblank_hook != NULL)
11081114      timer_call_after_resynch(machine, NULL, 0, suspend_i8751);
11091115
11101116   /* configure sprite banks */
11111117   for (i = 0; i < 16; i++)
1112      segaic16_sprites_set_bank(machine, 0, i, (rom_board == ROM_BOARD_171_5358 || rom_board == ROM_BOARD_171_5358_SMALL) ? alternate_banklist[i] : default_banklist[i]);
1118      segaic16_sprites_set_bank(machine, 0, i, (state->rom_board == ROM_BOARD_171_5358 || state->rom_board == ROM_BOARD_171_5358_SMALL) ? alternate_banklist[i] : default_banklist[i]);
11131119}
11141120
11151121
11161122static TIMER_DEVICE_CALLBACK( atomicp_sound_irq )
11171123{
1118   if (++atomicp_sound_count >= atomicp_sound_divisor)
1124   segas1x_state *state = (segas1x_state *)timer->machine->driver_data;
1125
1126   if (++state->atomicp_sound_count >= state->atomicp_sound_divisor)
11191127   {
1120      cputag_set_input_line(timer->machine, "maincpu", 2, HOLD_LINE);
1121      atomicp_sound_count = 0;
1128      cpu_set_input_line(state->maincpu, 2, HOLD_LINE);
1129      state->atomicp_sound_count = 0;
11221130   }
11231131}
11241132
r7356r7357
11451153         return input_port_read(space->machine, (offset & 1) ? "DSW1" : "DSW2");
11461154   }
11471155   logerror("%06X:standard_io_r - unknown read access to address %04X\n", cpu_get_pc(space->cpu), offset * 2);
1148   return segaic16_open_bus_r(space,0,mem_mask);
1156   return segaic16_open_bus_r(space, 0, mem_mask);
11491157}
11501158
11511159
11521160static WRITE16_HANDLER( standard_io_w )
11531161{
1162   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
1163
11541164   offset &= 0x1fff;
11551165   switch (offset & (0x3000/2))
11561166   {
r7356r7357
11671177            */
11681178         segaic16_tilemap_set_flip(space->machine, 0, data & 0x40);
11691179         segaic16_sprites_set_flip(space->machine, 0, data & 0x40);
1170         if (!disable_screen_blanking)
1180         if (!state->disable_screen_blanking)
11711181            segaic16_set_display_enable(space->machine, data & 0x20);
11721182         set_led_status(space->machine, 1, data & 0x08);
11731183         set_led_status(space->machine, 0, data & 0x04);
r7356r7357
11811191
11821192static READ16_HANDLER( misc_io_r )
11831193{
1184   if (custom_io_r)
1185      return (*custom_io_r)(space, offset, mem_mask);
1194   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
1195
1196   if (state->custom_io_r)
1197      return (*state->custom_io_r)(space, offset, mem_mask);
11861198   else
11871199      return standard_io_r(space, offset, mem_mask);
11881200}
r7356r7357
11901202
11911203static WRITE16_HANDLER( misc_io_w )
11921204{
1193   if (custom_io_w)
1194      (*custom_io_w)(space, offset, data, mem_mask);
1205   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
1206
1207   if (state->custom_io_w)
1208      (*state->custom_io_w)(space, offset, data, mem_mask);
11951209   else
11961210      standard_io_w(space, offset, data, mem_mask);
11971211}
r7356r7357
12131227
12141228static READ16_HANDLER( rom_5797_bank_math_r )
12151229{
1230   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
1231
12161232   offset &= 0x1fff;
12171233   switch (offset & (0x3000/2))
12181234   {
12191235      case 0x0000/2:
12201236         /* multiply registers */
1221         return segaic16_multiply_0_r(space, offset & 3, mem_mask);
1237         return segaic16_multiply_r(state->_315_5248_1, offset & 3, mem_mask);
12221238
12231239      case 0x1000/2:
12241240         /* compare registers */
1225         return segaic16_compare_timer_0_r(space, offset & 7, mem_mask);
1241         return segaic16_compare_timer_r(state->_315_5250_1, offset & 7, mem_mask);
12261242   }
1227   return segaic16_open_bus_r(space,0,mem_mask);
1243   return segaic16_open_bus_r(space, 0, mem_mask);
12281244}
12291245
12301246
12311247static WRITE16_HANDLER( rom_5797_bank_math_w )
12321248{
1249   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
1250
12331251   offset &= 0x1fff;
12341252   switch (offset & (0x3000/2))
12351253   {
12361254      case 0x0000/2:
12371255         /* multiply registers */
1238         segaic16_multiply_0_w(space, offset & 3, data, mem_mask);
1256         segaic16_multiply_w(state->_315_5248_1, offset & 3, data, mem_mask);
12391257         break;
12401258
12411259      case 0x1000/2:
12421260         /* compare registers */
1243         segaic16_compare_timer_0_w(space, offset & 7, data, mem_mask);
1261         segaic16_compare_timer_w(state->_315_5250_1, offset & 7, data, mem_mask);
12441262         break;
12451263
12461264      case 0x2000/2:
r7356r7357
12531271
12541272static READ16_HANDLER( unknown_rgn2_r )
12551273{
1274   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
1275
12561276   logerror("Region 2: read from %04X\n", offset * 2);
1257   return segaic16_compare_timer_1_r(space, offset & 7, mem_mask);
1277   return segaic16_compare_timer_r(state->_315_5250_2, offset & 7, mem_mask);
12581278}
12591279
12601280
12611281static WRITE16_HANDLER( unknown_rgn2_w )
12621282{
1283   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
1284
12631285   logerror("Region 2: write to %04X = %04X & %04X\n", offset * 2, data, mem_mask);
1264   segaic16_compare_timer_1_w(space, offset & 7, data, mem_mask);
1286   segaic16_compare_timer_w(state->_315_5250_2, offset & 7, data, mem_mask);
12651287}
12661288
12671289
r7356r7357
12741296
12751297static WRITE8_DEVICE_HANDLER( upd7759_control_w )
12761298{
1299   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
12771300   int size = memory_region_length(device->machine, "soundcpu") - 0x10000;
12781301   if (size > 0)
12791302   {
r7356r7357
12851308      upd7759_reset_w(device, data & 0x40);
12861309
12871310      /* banking depends on the ROM board */
1288      switch (rom_board)
1311      switch (state->rom_board)
12891312      {
12901313         case ROM_BOARD_171_5358:
12911314         case ROM_BOARD_171_5358_SMALL:
r7356r7357
13441367
13451368static void upd7759_generate_nmi(running_device *device, int state)
13461369{
1370   segas1x_state *driver = (segas1x_state *)device->machine->driver_data;
1371
13471372   if (state)
1348      cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
1373      cpu_set_input_line(driver->soundcpu, INPUT_LINE_NMI, PULSE_LINE);
13491374}
13501375
13511376
13521377#if 0
13531378static WRITE8_HANDLER( mcu_data_w )
13541379{
1355   mcu_data = data;
1356   generic_pulse_irq_line(devtag_get_device(space->machine, "mcu"), 1);
1380   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
1381   state->mcu_data = data;
1382   generic_pulse_irq_line(state->mcu, 1);
13571383}
13581384#endif
13591385
r7356r7357
13661392
13671393static INTERRUPT_GEN( i8751_main_cpu_vblank )
13681394{
1395   segas1x_state *state = (segas1x_state *)device->machine->driver_data;
1396
13691397   /* if we have a fake 8751 handler, call it on VBLANK */
1370   if (i8751_vblank_hook != NULL)
1371      (*i8751_vblank_hook)(device->machine);
1398   if (state->i8751_vblank_hook != NULL)
1399      (*state->i8751_vblank_hook)(device->machine);
13721400}
13731401
13741402
r7356r7357
13811409
13821410static void altbeast_common_i8751_sim(running_machine *machine, offs_t soundoffs, offs_t inputoffs)
13831411{
1384   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
1412   segas1x_state *state = (segas1x_state *)machine->driver_data;
1413   const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
13851414   UINT16 temp;
13861415
13871416   /* signal a VBLANK to the main CPU */
1388   cputag_set_input_line(machine, "maincpu", 4, HOLD_LINE);
1417   cpu_set_input_line(state->maincpu, 4, HOLD_LINE);
13891418
13901419   /* set tile banks */
13911420   rom_5704_bank_w(space, 1, workram[0x3094/2] & 0x00ff, 0x00ff);
r7356r7357
14201449
14211450static void ddux_i8751_sim(running_machine *machine)
14221451{
1423   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
1452   segas1x_state *state = (segas1x_state *)machine->driver_data;
1453   const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
14241454   UINT16 temp;
14251455
14261456   /* signal a VBLANK to the main CPU */
1427   cputag_set_input_line(machine, "maincpu", 4, HOLD_LINE);
1457   cpu_set_input_line(state->maincpu, 4, HOLD_LINE);
14281458
14291459   /* process any new sound data */
14301460   temp = workram[0x0bd0/2];
r7356r7357
14381468
14391469static void goldnaxe_i8751_init(running_machine *machine)
14401470{
1471   segas1x_state *state = (segas1x_state *)machine->driver_data;
14411472   static const UINT8 memory_control_5704[0x10] =
14421473      { 0x02,0x00, 0x02,0x08, 0x00,0x1f, 0x00,0xff, 0x00,0x20, 0x01,0x10, 0x00,0x14, 0x00,0xc4 };
14431474   static const UINT8 memory_control_5797[0x10] =
14441475      { 0x02,0x00, 0x00,0x1f, 0x00,0x1e, 0x00,0xff, 0x00,0x20, 0x01,0x10, 0x00,0x14, 0x00,0xc4 };
14451476
1446   switch (rom_board)
1477   switch (state->rom_board)
14471478   {
14481479      case ROM_BOARD_171_5704:
1449         i8751_initial_config = memory_control_5704;
1480         state->i8751_initial_config = memory_control_5704;
14501481         break;
14511482      case ROM_BOARD_171_5797:
1452         i8751_initial_config = memory_control_5797;
1483         state->i8751_initial_config = memory_control_5797;
14531484         break;
14541485   }
14551486}
14561487
14571488static void goldnaxe_i8751_sim(running_machine *machine)
14581489{
1459   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
1490   segas1x_state *state = (segas1x_state *)machine->driver_data;
1491   const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
14601492   UINT16 temp;
14611493
14621494   /* signal a VBLANK to the main CPU */
1463   cputag_set_input_line(machine, "maincpu", 4, HOLD_LINE);
1495   cpu_set_input_line(state->maincpu, 4, HOLD_LINE);
14641496
14651497   /* they periodically clear the data at 2cd8,2cda,2cdc,2cde and expect the MCU to fill it in */
14661498   if (workram[0x2cd8/2] == 0 && workram[0x2cda/2] == 0 && workram[0x2cdc/2] == 0 && workram[0x2cde/2] == 0)
r7356r7357
14871519
14881520static void tturf_i8751_sim(running_machine *machine)
14891521{
1490   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
1522   segas1x_state *state = (segas1x_state *)machine->driver_data;
1523   const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
14911524   UINT16 temp;
14921525
14931526   /* signal a VBLANK to the main CPU */
1494   cputag_set_input_line(machine, "maincpu", 4, HOLD_LINE);
1527   cpu_set_input_line(state->maincpu, 4, HOLD_LINE);
14951528
14961529   /* process any new sound data */
14971530   temp = workram[0x01d0/2];
r7356r7357
15101543
15111544static void wb3_i8751_sim(running_machine *machine)
15121545{
1513   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
1546   segas1x_state *state = (segas1x_state *)machine->driver_data;
1547   const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
15141548   UINT16 temp;
15151549
15161550   /* signal a VBLANK to the main CPU */
1517   cputag_set_input_line(machine, "maincpu", 4, HOLD_LINE);
1551   cpu_set_input_line(state->maincpu, 4, HOLD_LINE);
15181552
15191553   /* process any new sound data */
15201554   temp = workram[0x0008/2];
r7356r7357
15281562
15291563static void wrestwar_i8751_sim(running_machine *machine)
15301564{
1531   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
1565   segas1x_state *state = (segas1x_state *)machine->driver_data;
1566   const address_space *space = cpu_get_address_space(state->maincpu, ADDRESS_SPACE_PROGRAM);
15321567   UINT16 temp;
15331568
15341569   /* signal a VBLANK to the main CPU */
1535   cputag_set_input_line(machine, "maincpu", 4, HOLD_LINE);
1570   cpu_set_input_line(state->maincpu, 4, HOLD_LINE);
15361571
15371572   /* process any new sound data */
15381573   temp = workram[0x208e/2];
r7356r7357
15561591
15571592static MACHINE_START( atomicp )
15581593{
1559   state_save_register_global(machine, atomicp_sound_count);
1594   segas1x_state *state = (segas1x_state *)machine->driver_data;
1595   state_save_register_global(machine, state->atomicp_sound_count);
15601596}
15611597
15621598
15631599static WRITE16_HANDLER( atomicp_sound_w )
15641600{
1565   ym2413_w(devtag_get_device(space->machine, "ymsnd"), offset, data >> 8);
1601   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
1602   ym2413_w(state->ymsnd, offset, data >> 8);
15661603}
15671604
15681605
r7356r7357
16041641
16051642static READ16_HANDLER( hwchamp_custom_io_r )
16061643{
1644   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
16071645   UINT16 result;
16081646
16091647   switch (offset & (0x3000/2))
r7356r7357
16121650         switch (offset & 0x30/2)
16131651         {
16141652            case 0x20/2:
1615               result = (hwc_input_value & 0x80) >> 7;
1616               hwc_input_value <<= 1;
1653               result = (state->hwc_input_value & 0x80) >> 7;
1654               state->hwc_input_value <<= 1;
16171655               return result;
16181656         }
16191657         break;
r7356r7357
16241662
16251663static WRITE16_HANDLER( hwchamp_custom_io_w )
16261664{
1665   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
16271666   static const char *const portname[4] = { "MONITOR", "LEFT", "RIGHT", "DUMMY" };
16281667   switch (offset & (0x3000/2))
16291668   {
r7356r7357
16311670         switch (offset & 0x30/2)
16321671         {
16331672            case 0x20/2:
1634               hwc_input_value = input_port_read_safe(space->machine, portname[offset & 3], 0xff);
1673               state->hwc_input_value = input_port_read_safe(space->machine, portname[offset & 3], 0xff);
16351674               break;
16361675
16371676            case 0x30/2:
r7356r7357
17081747
17091748static READ16_HANDLER( sjryuko_custom_io_r )
17101749{
1750   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
17111751   static const char *const portname[] = { "MJ0", "MJ1", "MJ2", "MJ3", "MJ4", "MJ5" };
1752
17121753   switch (offset & (0x3000/2))
17131754   {
17141755      case 0x1000/2:
17151756         switch (offset & 3)
17161757         {
17171758            case 1:
1718               if (input_port_read_safe(space->machine, portname[mj_input_num], 0xff) != 0xff)
1719                  return 0xff & ~(1 << mj_input_num);
1759               if (input_port_read_safe(space->machine, portname[state->mj_input_num], 0xff) != 0xff)
1760                  return 0xff & ~(1 << state->mj_input_num);
17201761               return 0xff;
17211762
17221763            case 2:
1723               return input_port_read_safe(space->machine, portname[mj_input_num], 0xff);
1764               return input_port_read_safe(space->machine, portname[state->mj_input_num], 0xff);
17241765         }
17251766         break;
17261767   }
r7356r7357
17301771
17311772static WRITE16_HANDLER( sjryuko_custom_io_w )
17321773{
1733   static UINT8 last_val;
1774   segas1x_state *state = (segas1x_state *)space->machine->driver_data;
1775
17341776   switch (offset & (0x3000/2))
17351777   {
17361778      case 0x0000/2:
1737         if (((last_val ^ data) & 4) && (data & 4))
1738            mj_input_num = (mj_input_num + 1) % 6;
1779         if (((state->mj_last_val ^ data) & 4) && (data & 4))
1780         {
1781            state->mj_input_num = (state->mj_input_num + 1) % 6;
1782            state->mj_last_val = data;
1783         }
17391784         break;
17401785   }
17411786   standard_io_w(space, offset, data, mem_mask);
r7356r7357
32423287
32433288static MACHINE_DRIVER_START( system16b )
32443289
3290   /* driver data */
3291   MDRV_DRIVER_DATA(segas1x_state)
3292
32453293   /* basic machine hardware */
32463294   MDRV_CPU_ADD("maincpu", M68000, MASTER_CLOCK_10MHz)
32473295   MDRV_CPU_PROGRAM_MAP(system16b_map)
r7356r7357
32873335   MDRV_CPU_VBLANK_INT("screen", irq0_line_pulse)
32883336MACHINE_DRIVER_END
32893337
3338/* same as the above, but with custom Sega ICs */
32903339
3340static const ic_315_5250_interface sys16b_5250_intf =
3341{
3342   NULL, NULL
3343};
32913344
3345static MACHINE_DRIVER_START( system16b_5248 )
3346   MDRV_IMPORT_FROM(system16b)
3347
3348   MDRV_315_5248_ADD("315_5248")
3349   MDRV_315_5250_ADD("315_5250_1", sys16b_5250_intf)
3350   MDRV_315_5250_ADD("315_5250_2", sys16b_5250_intf)
3351MACHINE_DRIVER_END
3352
3353static MACHINE_DRIVER_START( system16b_8751_5248 )
3354   MDRV_IMPORT_FROM(system16b_8751)
3355
3356   MDRV_315_5248_ADD("315_5248")
3357   MDRV_315_5250_ADD("315_5250_1", sys16b_5250_intf)
3358   MDRV_315_5250_ADD("315_5250_2", sys16b_5250_intf)
3359MACHINE_DRIVER_END
3360
3361
3362
32923363/*************************************
32933364 *
32943365 *  Game-specific machine drivers
r7356r7357
62006271
62016272static DRIVER_INIT( altbeast_5521 )
62026273{
6274   segas1x_state *state = (segas1x_state *)machine->driver_data;
6275
62036276   DRIVER_INIT_CALL(generic_5521);
6204   i8751_vblank_hook = altbeast_i8751_sim;
6277   state->i8751_vblank_hook = altbeast_i8751_sim;
62056278}
62066279
62076280
62086281static DRIVER_INIT( altbeasj_5521 )
62096282{
6283   segas1x_state *state = (segas1x_state *)machine->driver_data;
6284
62106285   DRIVER_INIT_CALL(generic_5521);
6211   i8751_vblank_hook = altbeasj_i8751_sim;
6286   state->i8751_vblank_hook = altbeasj_i8751_sim;
62126287}
62136288
62146289
62156290static DRIVER_INIT( altbeas5_5521 )
62166291{
6292   segas1x_state *state = (segas1x_state *)machine->driver_data;
6293
62176294   DRIVER_INIT_CALL(generic_5521);
6218   i8751_vblank_hook = altbeas5_i8751_sim;
6295   state->i8751_vblank_hook = altbeas5_i8751_sim;
62196296}
62206297
62216298
r7356r7357
62426319
62436320static DRIVER_INIT( ddux_5704 )
62446321{
6322   segas1x_state *state = (segas1x_state *)machine->driver_data;
6323
62456324   DRIVER_INIT_CALL(generic_5704);
6246   i8751_vblank_hook = ddux_i8751_sim;
6325   state->i8751_vblank_hook = ddux_i8751_sim;
62476326}
62486327
62496328
62506329static DRIVER_INIT( dunkshot_5358 )
62516330{
6331   segas1x_state *state = (segas1x_state *)machine->driver_data;
6332
62526333   DRIVER_INIT_CALL(generic_5358);
62536334   fd1089a_decrypt(machine);
6254   custom_io_r = dunkshot_custom_io_r;
6335   state->custom_io_r = dunkshot_custom_io_r;
62556336}
62566337
62576338
62586339static DRIVER_INIT( exctleag_5358 )
62596340{
6341   segas1x_state *state = (segas1x_state *)machine->driver_data;
6342
62606343   DRIVER_INIT_CALL(generic_5358);
6261   custom_io_r = sdi_custom_io_r;
6344   state->custom_io_r = sdi_custom_io_r;
62626345}
62636346
62646347
62656348static DRIVER_INIT( goldnaxe_5704 )
62666349{
6350   segas1x_state *state = (segas1x_state *)machine->driver_data;
6351
62676352   DRIVER_INIT_CALL(generic_5704);
62686353   goldnaxe_i8751_init(machine);
6269   i8751_vblank_hook = goldnaxe_i8751_sim;
6354   state->i8751_vblank_hook = goldnaxe_i8751_sim;
62706355}
62716356
62726357
62736358static DRIVER_INIT( goldnaxe_5797 )
62746359{
6360   segas1x_state *state = (segas1x_state *)machine->driver_data;
6361
62756362   DRIVER_INIT_CALL(generic_5797);
62766363   goldnaxe_i8751_init(machine);
6277   i8751_vblank_hook = goldnaxe_i8751_sim;
6364   state->i8751_vblank_hook = goldnaxe_i8751_sim;
62786365}
62796366
62806367
62816368static DRIVER_INIT( hwchamp_5521 )
62826369{
6370   segas1x_state *state = (segas1x_state *)machine->driver_data;
6371
62836372   DRIVER_INIT_CALL(generic_5521);
6284   custom_io_r = hwchamp_custom_io_r;
6285   custom_io_w = hwchamp_custom_io_w;
6373   state->custom_io_r = hwchamp_custom_io_r;
6374   state->custom_io_w = hwchamp_custom_io_w;
62866375}
62876376
62886377
62896378static DRIVER_INIT( sdi_5358 )
62906379{
6380   segas1x_state *state = (segas1x_state *)machine->driver_data;
6381
62916382   DRIVER_INIT_CALL(generic_5358);
6292   custom_io_r = sdi_custom_io_r;
6383   state->custom_io_r = sdi_custom_io_r;
62936384}
62946385
62956386static DRIVER_INIT( defense_5358 )
62966387{
6388   segas1x_state *state = (segas1x_state *)machine->driver_data;
6389
62976390   DRIVER_INIT_CALL(generic_5358);
62986391   fd1089a_decrypt(machine);
6299   custom_io_r = sdi_custom_io_r;
6392   state->custom_io_r = sdi_custom_io_r;
63006393}
63016394
63026395
r7356r7357
63166409
63176410static DRIVER_INIT( sjryuko_5358 )
63186411{
6412   segas1x_state *state = (segas1x_state *)machine->driver_data;
6413
63196414   DRIVER_INIT_CALL(generic_5358);
63206415   fd1089b_decrypt(machine);
6321   custom_io_r = sjryuko_custom_io_r;
6322   custom_io_w = sjryuko_custom_io_w;
6416   state->custom_io_r = sjryuko_custom_io_r;
6417   state->custom_io_w = sjryuko_custom_io_w;
63236418}
63246419
63256420
63266421static DRIVER_INIT( passshtj_5358 )
63276422{
6423   segas1x_state *state = (segas1x_state *)machine->driver_data;
6424
63286425   DRIVER_INIT_CALL(generic_5358);
6329   custom_io_r = passshtj_custom_io_r;
6426   state->custom_io_r = passshtj_custom_io_r;
63306427}
63316428
63326429static DRIVER_INIT( tturf_5704 )
63336430{
6431   segas1x_state *state = (segas1x_state *)machine->driver_data;
6432
63346433   DRIVER_INIT_CALL(generic_5704);
6335   i8751_vblank_hook = tturf_i8751_sim;
6434   state->i8751_vblank_hook = tturf_i8751_sim;
63366435}
63376436
63386437
63396438static DRIVER_INIT( tturf_5358 )
63406439{
6440   segas1x_state *state = (segas1x_state *)machine->driver_data;
6441
63416442   DRIVER_INIT_CALL(generic_5358);
6342   i8751_vblank_hook = tturf_i8751_sim;
6443   state->i8751_vblank_hook = tturf_i8751_sim;
63436444}
63446445
63456446
63466447static DRIVER_INIT( wb3_5704 )
63476448{
6449   segas1x_state *state = (segas1x_state *)machine->driver_data;
6450
63486451   DRIVER_INIT_CALL(generic_5704);
6349   i8751_vblank_hook = wb3_i8751_sim;
6452   state->i8751_vblank_hook = wb3_i8751_sim;
63506453}
63516454
63526455
63536456static DRIVER_INIT( wrestwar_8751 )
63546457{
6458   segas1x_state *state = (segas1x_state *)machine->driver_data;
6459
63556460   DRIVER_INIT_CALL(generic_5704);
6356   i8751_vblank_hook = wrestwar_i8751_sim;
6461   state->i8751_vblank_hook = wrestwar_i8751_sim;
63576462}
63586463
63596464
63606465static DRIVER_INIT( atomicp )
63616466{
6467   segas1x_state *state = (segas1x_state *)machine->driver_data;
6468
63626469   system16b_generic_init(machine, ROM_BOARD_ATOMICP);
6363   disable_screen_blanking = 1;
6470   state->disable_screen_blanking = 1;
6471   state->atomicp_sound_divisor = 1;
6472
63646473   segaic16_display_enable = 1;
6365   atomicp_sound_divisor = 1;
63666474}
63676475
63686476
63696477static DRIVER_INIT( snapper )
63706478{
6479   segas1x_state *state = (segas1x_state *)machine->driver_data;
6480
63716481   system16b_generic_init(machine, ROM_BOARD_ATOMICP);
6372   disable_screen_blanking = 1;
6482   state->disable_screen_blanking = 1;
6483   state->atomicp_sound_divisor = 4;
6484
63736485   segaic16_display_enable = 1;
6374   atomicp_sound_divisor = 4;
63756486}
63766487
63776488
r7356r7357
64156526
64166527GAME( 1986, dunkshot,   0,        timescan,       dunkshot, dunkshot_5358,      ROT0,   "Sega",           "Dunk Shot (FD1089A 317-0022)", 0 )
64176528
6418GAME( 1989, eswat,      0,        system16b,      eswat,    generic_5797,       ROT0,   "Sega",           "E-Swat - Cyber Police (set 3, World, FD1094 317-0130)", 0 )
6419GAME( 1989, eswatu,     eswat,    system16b,      eswat,    generic_5797,       ROT0,   "Sega",           "E-Swat - Cyber Police (set 2, US, FD1094 317-0129)", 0 )
6420GAME( 1989, eswatj,     eswat,    system16b,      eswat,    generic_5797,       ROT0,   "Sega",           "E-Swat - Cyber Police (set 1, Japan, FD1094 317-0128)", 0 )
6529GAME( 1989, eswat,      0,        system16b_5248, eswat,    generic_5797,       ROT0,   "Sega",           "E-Swat - Cyber Police (set 3, World, FD1094 317-0130)", 0 )
6530GAME( 1989, eswatu,     eswat,    system16b_5248, eswat,    generic_5797,       ROT0,   "Sega",           "E-Swat - Cyber Police (set 2, US, FD1094 317-0129)", 0 )
6531GAME( 1989, eswatj,     eswat,    system16b_5248, eswat,    generic_5797,       ROT0,   "Sega",           "E-Swat - Cyber Police (set 1, Japan, FD1094 317-0128)", 0 )
64216532
64226533GAME( 1988, exctleag,   0,        system16b,      exctleag, exctleag_5358,      ROT0,   "Sega",           "Excite League (FD1094 317-0079)", 0 )
64236534
64246535GAME( 1989, fpoint,     0,        system16b,      fpoint,   generic_5358,       ROT0,   "Sega",           "Flash Point (set 2, Japan, FD1094 317-0127A)", 0 )
64256536GAME( 1989, fpoint1,    fpoint,   system16b,      fpoint,   generic_5704,       ROT0,   "Sega",           "Flash Point (set 1, Japan, FD1094 317-0127A)", 0 )
64266537
6427GAME( 1989, goldnaxe,   0,        system16b_8751, goldnaxe, goldnaxe_5797,      ROT0,   "Sega",           "Golden Axe (set 6, US, 8751 317-123A)", 0 )
6428GAME( 1989, goldnaxeu,  goldnaxe, system16b,      goldnaxe, generic_5797,       ROT0,   "Sega",           "Golden Axe (set 5, US, FD1094 317-0122)", 0 )
6538GAME( 1989, goldnaxe,   0,        system16b_8751_5248, goldnaxe, goldnaxe_5797, ROT0,   "Sega",           "Golden Axe (set 6, US, 8751 317-123A)", 0 )
6539GAME( 1989, goldnaxeu,  goldnaxe, system16b_5248, goldnaxe, generic_5797,       ROT0,   "Sega",           "Golden Axe (set 5, US, FD1094 317-0122)", 0 )
64296540GAME( 1989, goldnaxej,  goldnaxe, system16b,      goldnaxe, generic_5704,       ROT0,   "Sega",           "Golden Axe (set 4, Japan, FD1094 317-0121)", 0 )
64306541GAME( 1989, goldnaxe3,  goldnaxe, system16b,      goldnaxe, generic_5704,       ROT0,   "Sega",           "Golden Axe (set 3, World, FD1094 317-0120)" , 0) // set was labeled japan but doesn't seem to be
64316542GAME( 1989, goldnaxe2,  goldnaxe, system16b_8751, goldnaxe, goldnaxe_5704,      ROT0,   "Sega",           "Golden Axe (set 2, US, 8751 317-0112)", 0 )
6432GAME( 1989, goldnaxe1,  goldnaxe, system16b,      goldnaxe, generic_5797,       ROT0,   "Sega",           "Golden Axe (set 1, World, FD1094 317-0110)", 0 )
6543GAME( 1989, goldnaxe1,  goldnaxe, system16b_5248, goldnaxe, generic_5797,       ROT0,   "Sega",           "Golden Axe (set 1, World, FD1094 317-0110)", 0 )
64336544
64346545GAME( 1987, hwchamp,    0,        system16b,      hwchamp,  hwchamp_5521,       ROT0,   "Sega",           "Heavyweight Champ", 0 )
64356546
6436GAME( 1989, mvp,        0,        system16b,      mvp,      generic_5797,       ROT0,   "Sega",           "MVP (set 2, US, FD1094 317-0143)", 0 )
6547GAME( 1989, mvp,        0,        system16b_5248, mvp,      generic_5797,       ROT0,   "Sega",           "MVP (set 2, US, FD1094 317-0143)", 0 )
64376548GAME( 1989, mvpj,       mvp,      system16b,      mvp,      generic_5704,       ROT0,   "Sega",           "MVP (set 1, Japan, FD1094 317-0142)", 0 )
64386549
64396550GAME( 1988, passsht,    0,        system16b,      passsht,  generic_5358,       ROT270, "Sega",           "Passing Shot (World, 2 Players, FD1094 317-0080)", 0 )
r7356r7357
64646575
64656576GAME( 1987, timescan,   0,        timescan,       timescan, generic_5358,       ROT270, "Sega",           "Time Scanner (set 2, System 16B)", 0 )
64666577
6467GAME( 1994, toryumon,   0,        system16b,      toryumon, generic_5797,       ROT0,   "Sega",           "Toryumon", 0 )
6578GAME( 1994, toryumon,   0,        system16b_5248, toryumon, generic_5797,       ROT0,   "Sega",           "Toryumon", 0 )
64686579
64696580GAME( 1989, tturf,      0,        system16b_8751, tturf,    tturf_5704,         ROT0,   "Sega / Sunsoft", "Tough Turf (set 2, Japan, 8751 317-0104)", GAME_NO_SOUND /* due to missing ROM only */)
64706581GAME( 1989, tturfu,     tturf,    system16b_8751, tturf,    tturf_5358,         ROT0,   "Sega / Sunsoft", "Tough Turf (set 1, US, 8751 317-0099)", 0)
src/mame/drivers/nwk-tr.c
r7356r7357
216216#include "cpu/m68000/m68000.h"
217217#include "cpu/powerpc/ppc.h"
218218#include "cpu/sharc/sharc.h"
219#include "machine/konppc.h"
220219#include "machine/adc1213x.h"
221#include "sound/rf5c400.h"
222#include "video/voodoo.h"
220#include "machine/k033906.h"
221#include "machine/konppc.h"
223222#include "machine/timekpr.h"
223#include "sound/rf5c400.h"
224224#include "sound/k056800.h"
225#include "machine/k033906.h"
225#include "video/voodoo.h"
226#include "video/konicdev.h"
226227
227228static UINT8 led_reg0, led_reg1;
228229
r7356r7357
236237   palette_set_color_rgb(space->machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
237238}
238239
239
240
241/* K001604 Tilemap chip (move to konamiic.c ?) */
242
243#define MAX_K001604_CHIPS   2
244
245static UINT32 *K001604_tile_ram[MAX_K001604_CHIPS];
246static UINT32 *K001604_char_ram[MAX_K001604_CHIPS];
247static int K001604_gfx_index[MAX_K001604_CHIPS][2];
248static tilemap_t *K001604_layer_8x8[MAX_K001604_CHIPS][2];
249static int K001604_tilemap_offset;
250static tilemap_t *K001604_layer_roz[MAX_K001604_CHIPS][2];
251static int K001604_roz_size[MAX_K001604_CHIPS];
252
253static UINT32 *K001604_reg[MAX_K001604_CHIPS];
254
255static int K001604_layer_size;
256
257#define K001604_NUM_TILES_LAYER0      16384
258#define K001604_NUM_TILES_LAYER1      4096
259
260static const gfx_layout K001604_char_layout_layer_8x8 =
261{
262   8, 8,
263   K001604_NUM_TILES_LAYER0,
264   8,
265   { 8,9,10,11,12,13,14,15 },
266   { 1*16, 0*16, 3*16, 2*16, 5*16, 4*16, 7*16, 6*16 },
267   { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128 },
268   8*128
269};
270
271static const gfx_layout K001604_char_layout_layer_16x16 =
272{
273   16, 16,
274   K001604_NUM_TILES_LAYER1,
275   8,
276   { 8,9,10,11,12,13,14,15 },
277   { 1*16, 0*16, 3*16, 2*16, 5*16, 4*16, 7*16, 6*16, 9*16, 8*16, 11*16, 10*16, 13*16, 12*16, 15*16, 14*16 },
278   { 0*256, 1*256, 2*256, 3*256, 4*256, 5*256, 6*256, 7*256, 8*256, 9*256, 10*256, 11*256, 12*256, 13*256, 14*256, 15*256 },
279   16*256
280};
281
282
283static TILEMAP_MAPPER( K001604_scan_layer_8x8_0 )
284{
285   /* logical (col,row) -> memory offset */
286   int width = K001604_layer_size ? 256 : 128;
287   return K001604_tilemap_offset + (row * width) + col;
288}
289
290static TILEMAP_MAPPER( K001604_scan_layer_8x8_1 )
291{
292   /* logical (col,row) -> memory offset */
293   int width = K001604_layer_size ? 256 : 128;
294   return K001604_tilemap_offset + (row * width) + col + 64;
295}
296
297static TILEMAP_MAPPER( K001604_scan_layer_roz_0 )
298{
299   /* logical (col,row) -> memory offset */
300   int width = K001604_layer_size ? 256 : 128;
301   return (row * width) + col + (K001604_layer_size ? 128 : 0);
302}
303
304static TILEMAP_MAPPER( K001604_scan_layer_roz_1 )
305{
306   /* logical (col,row) -> memory offset */
307   int width = K001604_layer_size ? 256 : 128;
308   return (row * width) + col + (K001604_layer_size ? 192 : 64);
309}
310
311static TILE_GET_INFO( K001604_0_tile_info_layer_8x8 )
312{
313   UINT32 val = K001604_tile_ram[0][tile_index];
314   int color = (val >> 17) & 0x1f;
315   int tile = (val & 0x7fff);
316   int flags = 0;
317
318   if (val & 0x400000)
319      flags |= TILE_FLIPX;
320   if (val & 0x800000)
321      flags |= TILE_FLIPY;
322
323   SET_TILE_INFO(K001604_gfx_index[0][0], tile, color, flags);
324}
325
326static TILE_GET_INFO( K001604_0_tile_info_layer_roz )
327{
328   UINT32 val = K001604_tile_ram[0][tile_index];
329   int flags = 0;
330   int color = (val >> 17) & 0x1f;
331   int tile = val & 0x7ff;
332
333   if (val & 0x400000)
334      flags |= TILE_FLIPX;
335   if (val & 0x800000)
336      flags |= TILE_FLIPY;
337
338   tile += K001604_roz_size[0] ? 0x800 : 0x2000;
339
340   SET_TILE_INFO(K001604_gfx_index[0][K001604_roz_size[0]], tile, color, flags);
341}
342
343static TILE_GET_INFO( K001604_1_tile_info_layer_8x8 )
344{
345   UINT32 val = K001604_tile_ram[1][tile_index];
346   int color = (val >> 17) & 0x1f;
347   int tile = (val & 0x7fff);
348   int flags = 0;
349
350   if (val & 0x400000)
351      flags |= TILE_FLIPX;
352   if (val & 0x800000)
353      flags |= TILE_FLIPY;
354
355   SET_TILE_INFO(K001604_gfx_index[1][0], tile, color, flags);
356}
357
358static TILE_GET_INFO( K001604_1_tile_info_layer_roz )
359{
360   UINT32 val = K001604_tile_ram[1][tile_index];
361   int flags = 0;
362   int color = (val >> 17) & 0x1f;
363   int tile = (val & 0x7ff);
364
365   if (val & 0x400000)
366      flags |= TILE_FLIPX;
367   if (val & 0x800000)
368      flags |= TILE_FLIPY;
369
370   tile += K001604_roz_size[1] ? 0x800 : 0x2000;
371
372   SET_TILE_INFO(K001604_gfx_index[1][K001604_roz_size[1]], tile, color, flags);
373}
374
375int K001604_vh_start(running_machine *machine, int chip)
376{
377   const char *gamename = machine->gamedrv->name;
378
379   /* HACK !!! To be removed */
380   if (mame_stricmp(gamename, "racingj") == 0 || mame_stricmp(gamename, "racingj2") == 0
381      || mame_stricmp(gamename, "hangplt") == 0 || mame_stricmp(gamename, "slrasslt") == 0
382      || mame_stricmp(gamename, "jetwave") == 0)
383   {
384      K001604_layer_size = 0;      // width = 128 tiles
385   }
386   else
387   {
388      K001604_layer_size = 1;      // width = 256 tiles
389   }
390
391   /* HACK !!! To be removed */
392   if (mame_stricmp(gamename, "slrasslt") == 0)
393   {
394      K001604_tilemap_offset = 16384;
395
396      K001604_roz_size[chip] = 0;      // 8x8
397   }
398   else
399   {
400      K001604_tilemap_offset = 0;
401
402      K001604_roz_size[chip] = 1;      // 16x16
403   }
404
405   for (K001604_gfx_index[chip][0] = 0; K001604_gfx_index[chip][0] < MAX_GFX_ELEMENTS; K001604_gfx_index[chip][0]++)
406      if (machine->gfx[K001604_gfx_index[chip][0]] == 0)
407         break;
408   if (K001604_gfx_index[chip][0] == MAX_GFX_ELEMENTS)
409   {
410      return 1;
411   }
412
413   for (K001604_gfx_index[chip][1] = K001604_gfx_index[chip][0] + 1; K001604_gfx_index[chip][1] < MAX_GFX_ELEMENTS; K001604_gfx_index[chip][1]++)
414      if (machine->gfx[K001604_gfx_index[chip][1]] == 0)
415         break;
416   if (K001604_gfx_index[chip][1] == MAX_GFX_ELEMENTS)
417   {
418      return 1;
419   }
420
421   K001604_char_ram[chip] = auto_alloc_array(machine, UINT32, 0x200000/4);
422
423   K001604_tile_ram[chip] = auto_alloc_array(machine, UINT32, 0x20000/4);
424
425   K001604_reg[chip] = auto_alloc_array(machine, UINT32, 0x400/4);
426
427   if (chip == 0)
428   {
429      int roz_tile_size = K001604_roz_size[chip] ? 16 : 8;
430      int roz_width = K001604_layer_size ? 64 : 128;
431      K001604_layer_8x8[chip][0] = tilemap_create(machine, K001604_0_tile_info_layer_8x8, K001604_scan_layer_8x8_0, 8, 8, 64, 64);
432      K001604_layer_8x8[chip][1] = tilemap_create(machine, K001604_0_tile_info_layer_8x8, K001604_scan_layer_8x8_1, 8, 8, 64, 64);
433
434      K001604_layer_roz[chip][0] = tilemap_create(machine, K001604_0_tile_info_layer_roz, K001604_scan_layer_roz_0, roz_tile_size, roz_tile_size, roz_width, 64);
435      K001604_layer_roz[chip][1] = tilemap_create(machine, K001604_0_tile_info_layer_roz, K001604_scan_layer_roz_1, roz_tile_size, roz_tile_size, 64, 64);
436   }
437   else
438   {
439      int roz_tile_size = K001604_roz_size[chip] ? 16 : 8;
440      int roz_width = K001604_layer_size ? 64 : 128;
441      K001604_layer_8x8[chip][0] = tilemap_create(machine, K001604_1_tile_info_layer_8x8, K001604_scan_layer_8x8_0, 8, 8, 64, 64);
442      K001604_layer_8x8[chip][1] = tilemap_create(machine, K001604_1_tile_info_layer_8x8, K001604_scan_layer_8x8_1, 8, 8, 64, 64);
443
444      K001604_layer_roz[chip][0] = tilemap_create(machine, K001604_1_tile_info_layer_roz, K001604_scan_layer_roz_0, roz_tile_size, roz_tile_size, roz_width, 64);
445      K001604_layer_roz[chip][1] = tilemap_create(machine, K001604_1_tile_info_layer_roz, K001604_scan_layer_roz_1, roz_tile_size, roz_tile_size, 64, 64);
446   }
447
448   tilemap_set_transparent_pen(K001604_layer_8x8[chip][0], 0);
449   tilemap_set_transparent_pen(K001604_layer_8x8[chip][1], 0);
450
451   memset(K001604_char_ram[chip], 0, 0x200000);
452   memset(K001604_tile_ram[chip], 0, 0x10000);
453   memset(K001604_reg[chip], 0, 0x400);
454
455
456   machine->gfx[K001604_gfx_index[chip][0]] = gfx_element_alloc(machine, &K001604_char_layout_layer_8x8, (UINT8*)&K001604_char_ram[chip][0], machine->config->total_colors / 16, 0);
457   machine->gfx[K001604_gfx_index[chip][1]] = gfx_element_alloc(machine, &K001604_char_layout_layer_16x16, (UINT8*)&K001604_char_ram[chip][0], machine->config->total_colors / 16, 0);
458
459   return 0;
460}
461
462void K001604_draw_back_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect)
463{
464   int layer;
465   int num_layers;
466   bitmap_fill(bitmap, cliprect, 0);
467
468   num_layers = K001604_layer_size ? 2 : 1;
469
470   for (layer=0; layer < num_layers; layer++)
471   {
472      int reg = 0x08;
473
474      INT32 x  = (INT16)((K001604_reg[chip][reg+0] >> 16) & 0xffff);
475      INT32 y  = (INT16)((K001604_reg[chip][reg+0] >>  0) & 0xffff);
476      INT32 xx = (INT16)((K001604_reg[chip][reg+1] >>  0) & 0xffff);
477      INT32 xy = (INT16)((K001604_reg[chip][reg+1] >> 16) & 0xffff);
478      INT32 yx = (INT16)((K001604_reg[chip][reg+2] >>  0) & 0xffff);
479      INT32 yy = (INT16)((K001604_reg[chip][reg+2] >> 16) & 0xffff);
480
481      x  = (x + 320) * 256;
482      y  = (y + 208) * 256;
483      xx = (xx);
484      xy = (-xy);
485      yx = (-yx);
486      yy = (yy);
487
488      if ((K001604_reg[chip][0x6c/4] & (0x08 >> layer)) != 0)
489      {
490         tilemap_draw_roz(bitmap, cliprect, K001604_layer_roz[chip][layer],
491                      x << 5, y << 5, xx << 5, xy << 5, yx << 5, yy << 5, 1, 0, 0);
492      }
493   }
494}
495
496void K001604_draw_front_layer(int chip, bitmap_t *bitmap, const rectangle *cliprect)
497{
498   //tilemap_draw(bitmap, cliprect, K001604_layer_8x8[chip][1], 0,0);
499   tilemap_draw(bitmap, cliprect, K001604_layer_8x8[chip][0], 0,0);
500}
501
502READ32_HANDLER(K001604_tile_r)
503{
504   int chip = get_cgboard_id();
505
506   return K001604_tile_ram[chip][offset];
507}
508
509READ32_HANDLER(K001604_char_r)
510{
511   int chip = get_cgboard_id();
512
513   int set, bank;
514   UINT32 addr;
515
516   set = (K001604_reg[chip][0x60/4] & 0x1000000) ? 0x100000 : 0;
517
518   if (set)
519   {
520      bank = (K001604_reg[chip][0x60/4] >> 8) & 0x3;
521   }
522   else
523   {
524      bank = (K001604_reg[chip][0x60/4] & 0x3);
525   }
526
527   addr = offset + ((set + (bank * 0x40000)) / 4);
528
529   return K001604_char_ram[chip][addr];
530}
531
532WRITE32_HANDLER(K001604_tile_w)
533{
534   int chip = get_cgboard_id();
535
536   int x, y;
537   COMBINE_DATA(K001604_tile_ram[chip] + offset);
538
539   if (K001604_layer_size)
540   {
541      x = offset & 0xff;
542      y = offset / 256;
543   }
544   else
545   {
546      x = offset & 0x7f;
547      y = offset / 128;
548   }
549
550   if (K001604_layer_size)
551   {
552      if (x < 64)
553      {
554         tilemap_mark_tile_dirty(K001604_layer_8x8[chip][0], offset);
555      }
556      else if (x < 128)
557      {
558         tilemap_mark_tile_dirty(K001604_layer_8x8[chip][1], offset);
559      }
560      else if (x < 192)
561      {
562         tilemap_mark_tile_dirty(K001604_layer_roz[chip][0], offset);
563      }
564      else
565      {
566         tilemap_mark_tile_dirty(K001604_layer_roz[chip][1], offset);
567      }
568   }
569   else
570   {
571      if (x < 64)
572      {
573         tilemap_mark_tile_dirty(K001604_layer_8x8[chip][0], offset);
574
575         tilemap_mark_tile_dirty(K001604_layer_roz[chip][0], offset);
576      }
577      else
578      {
579         tilemap_mark_tile_dirty(K001604_layer_8x8[chip][1], offset);
580
581         tilemap_mark_tile_dirty(K001604_layer_roz[chip][1], offset);
582      }
583   }
584}
585
586WRITE32_HANDLER(K001604_char_w)
587{
588   int chip = get_cgboard_id();
589
590   int set, bank;
591   UINT32 addr;
592
593   set = (K001604_reg[chip][0x60/4] & 0x1000000) ? 0x100000 : 0;
594
595   if (set)
596   {
597      bank = (K001604_reg[chip][0x60/4] >> 8) & 0x3;
598   }
599   else
600   {
601      bank = (K001604_reg[chip][0x60/4] & 0x3);
602   }
603
604   addr = offset + ((set + (bank * 0x40000)) / 4);
605
606   COMBINE_DATA(K001604_char_ram[chip] + addr);
607
608   gfx_element_mark_dirty(space->machine->gfx[K001604_gfx_index[chip][0]], addr / 32);
609   gfx_element_mark_dirty(space->machine->gfx[K001604_gfx_index[chip][1]], addr / 128);
610}
611
612
613
614WRITE32_HANDLER(K001604_reg_w)
615{
616   int chip = get_cgboard_id();
617
618   COMBINE_DATA(K001604_reg[chip] + offset);
619
620   switch (offset)
621   {
622      case 0x8:
623      case 0x9:
624      case 0xa:
625         //printf("K001604_reg_w %02X, %08X, %08X\n", offset, data, mem_mask);
626         break;
627   }
628
629   if (offset != 0x08 && offset != 0x09 && offset != 0x0a /*&& offset != 0x17 && offset != 0x18*/)
630   {
631      //printf("K001604_reg_w (%d), %02X, %08X, %08X at %08X\n", chip, offset, data, mem_mask, cpu_get_pc(space->cpu));
632   }
633}
634
635READ32_HANDLER(K001604_reg_r)
636{
637   int chip = get_cgboard_id();
638
639   switch (offset)
640   {
641      case 0x54/4:   return mame_rand(space->machine) << 16; break;
642      case 0x5c/4:   return mame_rand(space->machine) << 16 | mame_rand(space->machine); break;
643   }
644
645   return K001604_reg[chip][offset];
646}
647
648
649
650
651240static void voodoo_vblank_0(running_device *device, int param)
652241{
653242   cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE);
654243}
655244
656static VIDEO_START( nwktr )
657{
658   K001604_vh_start(machine, 0);
659}
660245
661
662246static VIDEO_UPDATE( nwktr )
663247{
664248   running_device *voodoo = devtag_get_device(screen->machine, "voodoo");
249   running_device *k001604 = devtag_get_device(screen->machine, "k001604");
665250
666251   bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
667252
668253   voodoo_update(voodoo, bitmap, cliprect);
669254
670   K001604_draw_front_layer(0, bitmap, cliprect);
255   k001604_draw_front_layer(k001604, bitmap, cliprect);
671256
672257   draw_7segment_led(bitmap, 3, 3, led_reg0);
673258   draw_7segment_led(bitmap, 9, 3, led_reg1);
r7356r7357
886471
887472static ADDRESS_MAP_START( nwktr_map, ADDRESS_SPACE_PROGRAM, 32 )
888473   AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_BASE(&work_ram)      /* Work RAM */
889   AM_RANGE(0x74000000, 0x740000ff) AM_READWRITE(K001604_reg_r, K001604_reg_w)
474   AM_RANGE(0x74000000, 0x740000ff) AM_DEVREADWRITE("k001604", k001604_reg_r, k001604_reg_w)
890475   AM_RANGE(0x74010000, 0x74017fff) AM_RAM_WRITE(paletteram32_w) AM_BASE_GENERIC(paletteram)
891   AM_RANGE(0x74020000, 0x7403ffff) AM_READWRITE(K001604_tile_r, K001604_tile_w)
892   AM_RANGE(0x74040000, 0x7407ffff) AM_READWRITE(K001604_char_r, K001604_char_w)
476   AM_RANGE(0x74020000, 0x7403ffff) AM_DEVREADWRITE("k001604", k001604_tile_r, k001604_tile_w)
477   AM_RANGE(0x74040000, 0x7407ffff) AM_DEVREADWRITE("k001604", k001604_char_r, k001604_char_w)
893478   AM_RANGE(0x78000000, 0x7800ffff) AM_READWRITE(cgboard_dsp_shared_r_ppc, cgboard_dsp_shared_w_ppc)
894479   AM_RANGE(0x780c0000, 0x780c0003) AM_READWRITE(cgboard_dsp_comm_r_ppc, cgboard_dsp_comm_w_ppc)
895480   AM_RANGE(0x7d000000, 0x7d00ffff) AM_READ(sysreg_r)
r7356r7357
1048633   "voodoo"
1049634};
1050635
636static const k001604_interface racingj_k001604_intf =
637{
638   0, 1,   /* gfx index 1 & 2 */
639   0, 1,      /* layer_size, roz_size */
640   0      /* slrasslt hack */
641};
642
643static const k001604_interface thrilld_k001604_intf =
644{
645   0, 1,   /* gfx index 1 & 2 */
646   1, 1,      /* layer_size, roz_size */
647   0      /* slrasslt hack */
648};
649
1051650static MACHINE_RESET( nwktr )
1052651{
1053652   cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE);
r7356r7357
1088687
1089688   MDRV_PALETTE_LENGTH(65536)
1090689
1091   MDRV_VIDEO_START(nwktr)
1092690   MDRV_VIDEO_UPDATE(nwktr)
1093691
692   MDRV_K001604_ADD("k001604", racingj_k001604_intf)
693
1094694   MDRV_K056800_ADD("k056800", nwktr_k056800_interface)
1095695
1096696   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r7356r7357
1104704   MDRV_ADC12138_ADD( "adc12138", nwktr_adc_interface )
1105705MACHINE_DRIVER_END
1106706
707static MACHINE_DRIVER_START( thrilld )
708   MDRV_IMPORT_FROM(nwktr)
709
710   MDRV_DEVICE_REMOVE("k001604")
711   MDRV_K001604_ADD("k001604", thrilld_k001604_intf)
712MACHINE_DRIVER_END
713
714
1107715/*****************************************************************************/
1108716
1109717static DRIVER_INIT(nwktr)
r7356r7357
1192800
1193801/*****************************************************************************/
1194802
1195GAME( 1998, racingj,    0,       nwktr, nwktr, nwktr, ROT0, "Konami", "Racing Jam", GAME_NOT_WORKING|GAME_NO_SOUND )
1196GAME( 1999, racingj2,   racingj, nwktr, nwktr, nwktr, ROT0, "Konami", "Racing Jam: Chapter 2", GAME_NOT_WORKING|GAME_NO_SOUND )
1197GAME( 1998, thrilld,    0,       nwktr, nwktr, nwktr, ROT0, "Konami", "Thrill Drive", GAME_NOT_WORKING|GAME_IMPERFECT_SOUND )
803GAME( 1998, racingj,    0,       nwktr,   nwktr, nwktr, ROT0, "Konami", "Racing Jam", GAME_NOT_WORKING | GAME_NO_SOUND )
804GAME( 1999, racingj2,   racingj, nwktr,   nwktr, nwktr, ROT0, "Konami", "Racing Jam: Chapter 2", GAME_NOT_WORKING | GAME_NO_SOUND )
805GAME( 1998, thrilld,    0,       thrilld, nwktr, nwktr, ROT0, "Konami", "Thrill Drive", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND )
src/mame/drivers/gaelco2.c
r7356r7357
14291429   ROM_LOAD( "palce16v8h.u29",  0x0000, 0x0117, BAD_DUMP CRC(4a0a6f39) SHA1(57351e471649391c9abf110828fe2f128fe84eee) )
14301430ROM_END
14311431
1432GAME( 1994, aligator,   0,        alighunt, alighunt, alighunt, ROT0, "Gaelco", "Alligator Hunt", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
1433GAME( 1994, aligatorun, aligator, alighunt, alighunt, alighunt, ROT0, "Gaelco", "Alligator Hunt (unprotected)", 0 )
1432GAME( 1994, aligator,  0,       alighunt, alighunt, alighunt, ROT0, "Gaelco", "Alligator Hunt", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
1433GAME( 1994, aligatorun,aligator,alighunt, alighunt, alighunt, ROT0, "Gaelco", "Alligator Hunt (unprotected)", 0 )
14341434GAME( 1995, touchgo,  0,        touchgo,  touchgo,  touchgo,  ROT0, "Gaelco", "Touch & Go (World)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
14351435GAME( 1995, touchgon, touchgo,  touchgo,  touchgo,  touchgo,  ROT0, "Gaelco", "Touch & Go (Non North America)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
14361436GAME( 1995, touchgoe, touchgo,  touchgo,  touchgo,  touchgo,  ROT0, "Gaelco", "Touch & Go (earlier revision)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
src/mame/drivers/champbas.c
r7356r7357
272272   AM_RANGE(0x6800, 0x68ff) AM_READ(champbja_alt_protection_r)
273273ADDRESS_MAP_END
274274
275static ADDRESS_MAP_START( exctsccb_main_map, ADDRESS_SPACE_PROGRAM, 8 )
275static ADDRESS_MAP_START( exctsccrb_main_map, ADDRESS_SPACE_PROGRAM, 8 )
276276   AM_RANGE(0x0000, 0x5fff) AM_ROM
277277//  AM_RANGE(0x6000, 0x63ff) AM_RAM AM_SHARE("share1") // MCU not used (though it's present on the board)
278278   AM_RANGE(0x7000, 0x7001) AM_DEVWRITE("aysnd", ay8910_data_address_w)
r7356r7357
753753MACHINE_DRIVER_END
754754
755755/* Bootleg running on a modified Champion Baseball board */
756static MACHINE_DRIVER_START( exctsccb )
756static MACHINE_DRIVER_START( exctsccrb )
757757
758758   /* driver data */
759759   MDRV_DRIVER_DATA(champbas_state)
760760
761761   /* basic machine hardware */
762762   MDRV_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6)
763   MDRV_CPU_PROGRAM_MAP(exctsccb_main_map)
763   MDRV_CPU_PROGRAM_MAP(exctsccrb_main_map)
764764   MDRV_CPU_VBLANK_INT("screen", irq0_line_assert)
765765
766766   MDRV_CPU_ADD("sub", Z80, XTAL_18_432MHz/6)
r7356r7357
12181218GAME( 1983, exctsccra,  exctsccr, exctsccr, exctsccr, exctsccr, ROT270, "Alpha Denshi Co.", "Exciting Soccer (alternate music)", GAME_SUPPORTS_SAVE )
12191219GAME( 1983, exctsccrj,  exctsccr, exctsccr, exctsccr, exctsccr, ROT270, "Alpha Denshi Co.", "Exciting Soccer (Japan)", GAME_SUPPORTS_SAVE )
12201220GAME( 1983, exctsccrj2, exctsccr, exctsccr, exctsccr, exctsccr, ROT270, "Alpha Denshi Co.", "Exciting Soccer (Japan set 2)", GAME_SUPPORTS_SAVE )
1221GAME( 1983, exctsccrb,  exctsccr, exctsccb, exctsccr, exctsccr, ROT270, "bootleg",          "Exciting Soccer (bootleg)", GAME_SUPPORTS_SAVE )
1221GAME( 1983, exctsccrb,  exctsccr, exctsccrb,exctsccr, exctsccr, ROT270, "bootleg",          "Exciting Soccer (bootleg)", GAME_SUPPORTS_SAVE )
12221222GAME( 1984, exctscc2,   0,        exctsccr, exctsccr, exctsccr, ROT270, "Alpha Denshi Co.", "Exciting Soccer II", GAME_SUPPORTS_SAVE )
src/mame/drivers/arkanoid.c
r7356r7357
88    Here are the versions we have:
99
1010    arkanoid    World version, probably an earlier revision
11    arknoidu    USA version, probably a later revision; There has been code
11    arkanoidu   USA version, probably a later revision; There has been code
1212                inserted, NOT patched, so I don't think it's a bootleg
1313                The 68705 code for this one was not available; I made it up from
1414                the World version changing the level data pointer table.
15    arknoiuo    USA version, probably an earlier revision
15    arkanoiduo  USA version, probably an earlier revision
1616                ROM a75-10.bin should be identical to the real World one.
1717                (It only differs in the country byte from A75-11.ROM)
1818                This version works fine with the real MCU ROM
1919    arkatour    Tournament version
2020                The 68705 code for this one was not available; I made it up from
2121                the World version changing the level data pointer table.
22    arknoidj    Japanese version with level selector.
22    arkanoidj   Japanese version with level selector.
2323                The 68705 code for this one was not available; I made it up from
2424                the World version changing the level data pointer table.
2525    arkbl2      Bootleg of the early Japanese version.
r7356r7357
224224      * affects ball speed at start of level (0x06 or 0x08)
225225      * affects level 2 (same as normal version or same as level 30)
226226  - You can select your starting level (between 1 and 30)
227    but they aren't displayed like in the original Japanese set we have ('arknoidj').
227    but they aren't displayed like in the original Japanese set we have ('arkanoidj').
228228  - Level 30 differs from original Japanese version
229229  - There seems to be code to edit levels (check code at 0x8082), but the routines
230230    don't seem to be called anymore.
r7356r7357
247247      * affects ball speed at start of level (0x04 or 0x06)
248248      * affects level 2 (same as normal version or same as level 30)
249249  - You can select your starting level (between 1 and 30)
250    but they aren't displayed like in the original Japanese set we have ('arknoidj').
250    but they aren't displayed like in the original Japanese set we have ('arkanoidj').
251251    No "What round do you want to start from ?" message though.
252252  - Level 30 differs from original Japanese version (it also differs from 'arkangc')
253253  - The routine to handle the paddle is completely different as in 'arkangc'
r7356r7357
278278  - "Continue" Dip Switch has been replaced by sort of "Debug" Dip Switch as in 'arkangc';
279279    however, this has no effect due to newly patched code at 0x06e9 !
280280  - You can select your starting level (between 1 and 30)
281    but they aren't displayed like in the original Japanese set we have ('arknoidj').
281    but they aren't displayed like in the original Japanese set we have ('arkanoidj').
282282  - Levels 1, 2, 3, 4, 6, 7, 11, 14, 30, 31 and 32 differ from original Japanese version;
283283    level 1 starts at a different offset (0x90a8 instead of 0xbf15).
284284  - Complerely different initials on high-scores table, but scores and rounds
285    are the same as in the original Japanese set we have ('arknoidj').
285    are the same as in the original Japanese set we have ('arkanoidj').
286286  - There seems to be code to edit levels (check code at 0x8082), but the routines
287287    don't seem to be called anymore.
288288  - Known bugs :
r7356r7357
317317  - All reads from 0xf002 are patched.
318318  - Reads bit 5 from 0xd008.
319319  - You can select your starting level (between 1 and 30) but they aren't displayed
320    like in the original Japanese set we have ('arknoidj').
320    like in the original Japanese set we have ('arkanoidj').
321321  - "Continue" Dip Switch has been replaced by sort of "Debug" Dip Switch :
322322      * affects ball speed at start of level (0x06 or 0x08)
323323      * affects level 2 (same as normal version or same as level 30)
324324  - You can select your starting level (between 1 and 30)
325    but they aren't displayed like in the original Japanese set we have ('arknoidj').
325    but they aren't displayed like in the original Japanese set we have ('arkanoidj').
326326  - Level 30 differs from original Japanese version (same as the one from 'arkangc2')
327327  - Known bugs :
328328      * You can go from one side of the screen to the other through the walls
r7356r7357
345345  - Different "Lives" Dip Switch (check table at 0x9a28)
346346  - Specific coinage (always 2C_1C)
347347  - If Dip Switch is set, you can select your starting level (between 1 and 30)
348    but they aren't displayed like in the original Japanese set we have ('arknoidj').
348    but they aren't displayed like in the original Japanese set we have ('arkanoidj').
349349  - Same level 30 as original Japanese version
350350  - Known bugs :
351351      * You can go from one side of the screen to the other through the walls
r7356r7357
373373      * "20K 60K 60K+"  or "20K" when you continue
374374  - Different "Lives" Dip Switch (check table at 0x9a28)
375375  - If Dip Switch is set, you can select your starting level (between 1 and 30)
376    but they aren't displayed like in the original Japanese set we have ('arknoidj').
376    but they aren't displayed like in the original Japanese set we have ('arkanoidj').
377377  - Levels are based on the ones from "Arkanoid II".
378378  - Known bugs :
379379      * You can go from one side of the screen to the other through the walls
r7356r7357
424424TO DO (2006.09.12) :
425425
426426  - Check the following Taito sets (adresses, routines and Dip Switches) :
427      * 'arkanoid' = 'arknoiuo'
428      * 'arknoidj'
429      * 'arknoidu'
427      * 'arkanoid' = 'arkanoiduo'
428      * 'arkanoidj'
429      * 'arkanoidu'
430430      * 'arkatour'
431431  - Add more notes about main addresses and routines in the Z80
432432  - Try to understand the problem with the MCU in the following sets :
r7356r7357
498498***************************************************************************
499499
500500DIP locations verified for:
501  - arknoidj
501  - arkanoidj
502502  - arkanoid
503503
504504***************************************************************************/
r7356r7357
613613INPUT_PORTS_END
614614
615615/* Different coinage and additional "Cabinet" Dip Switch */
616static INPUT_PORTS_START( arknoidj )
616static INPUT_PORTS_START( arkanoidj )
617617   PORT_INCLUDE( arkanoid )
618618
619619   PORT_MODIFY("DSW")
r7356r7357
626626INPUT_PORTS_END
627627
628628static INPUT_PORTS_START( ark1ball )
629   PORT_INCLUDE( arknoidj )
629   PORT_INCLUDE( arkanoidj )
630630
631631   PORT_MODIFY("DSW")
632632   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:4") /* "ld a,$60" at 0x93bd and "ld a,$60" at 0x9c7f and 0x9c9b */
r7356r7357
639639
640640/* Bootlegs do not read from the MCU */
641641static INPUT_PORTS_START( arkatayt )
642   PORT_INCLUDE( arknoidj )
642   PORT_INCLUDE( arkanoidj )
643643
644644   PORT_MODIFY("SYSTEM")
645645   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL )      /* Some bootlegs need it to be 1 */
r7356r7357
13821382GAME( 1986, arkanoid,   0,        arkanoid, arkanoid, 0,        ROT90, "Taito Corporation Japan", "Arkanoid (World)", GAME_SUPPORTS_SAVE )
13831383GAME( 1986, arkanoidu,  arkanoid, arkanoid, arkanoid, 0,        ROT90, "Taito America Corporation (Romstar license)", "Arkanoid (US)", GAME_SUPPORTS_SAVE )
13841384GAME( 1986, arkanoiduo, arkanoid, arkanoid, arkanoid, 0,        ROT90, "Taito America Corporation (Romstar license)", "Arkanoid (US, older)", GAME_SUPPORTS_SAVE )
1385GAME( 1986, arkanoidj,  arkanoid, arkanoid, arknoidj, 0,        ROT90, "Taito Corporation", "Arkanoid (Japan)", GAME_SUPPORTS_SAVE )
1386GAME( 1986, arkmcubl,   arkanoid, arkanoid, arknoidj, 0,        ROT90, "bootleg", "Arkanoid (bootleg with MCU)", GAME_SUPPORTS_SAVE )
1385GAME( 1986, arkanoidj,  arkanoid, arkanoid, arkanoidj,0,        ROT90, "Taito Corporation", "Arkanoid (Japan)", GAME_SUPPORTS_SAVE )
1386GAME( 1986, arkmcubl,   arkanoid, arkanoid, arkanoidj,0,        ROT90, "bootleg", "Arkanoid (bootleg with MCU)", GAME_SUPPORTS_SAVE )
13871387GAME( 1986, ark1ball,   arkanoid, arkanoid, ark1ball, 0,        ROT90, "bootleg", "Arkanoid (bootleg with MCU, harder)", GAME_SUPPORTS_SAVE )
13881388GAME( 1986, arkangc,    arkanoid, bootleg,  arkangc,  arkangc,  ROT90, "bootleg", "Arkanoid (Game Corporation bootleg, set 1)", GAME_SUPPORTS_SAVE )
13891389GAME( 1986, arkangc2,   arkanoid, bootleg,  arkangc2, arkangc2, ROT90, "bootleg", "Arkanoid (Game Corporation bootleg, set 2)", GAME_SUPPORTS_SAVE )
src/mame/drivers/megasys1.c
r7356r7357
15221522   MDRV_CPU_PROGRAM_MAP(megasys1B_sound_map)
15231523MACHINE_DRIVER_END
15241524
1525
1526static MACHINE_DRIVER_START( system_Bbl )
1527
1528   /* basic machine hardware */
1529   MDRV_CPU_ADD("maincpu", M68000, SYS_B_CPU_CLOCK)
1530   MDRV_CPU_PROGRAM_MAP(megasys1B_map)
1531   MDRV_CPU_VBLANK_INT_HACK(interrupt_B,INTERRUPT_NUM_B)
1532
1533   MDRV_MACHINE_RESET(megasys1)
1534
1535   /* video hardware */
1536   MDRV_SCREEN_ADD("screen", RASTER)
1537   MDRV_SCREEN_REFRESH_RATE(60)
1538   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1539   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1540   MDRV_SCREEN_SIZE(32*8, 32*8)
1541   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
1542
1543   MDRV_GFXDECODE(ABC)
1544   MDRV_PALETTE_LENGTH(1024)
1545
1546   MDRV_PALETTE_INIT(megasys1)
1547   MDRV_VIDEO_START(megasys1)
1548   MDRV_VIDEO_UPDATE(megasys1)
1549   MDRV_VIDEO_EOF(megasys1)
1550
1551   /* sound hardware */
1552   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
1553
1554   /* just the one OKI, used for sound and music */
1555   MDRV_SOUND_ADD("oki1", OKIM6295, OKI4_SOUND_CLOCK)
1556   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
1557   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
1558   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
1559MACHINE_DRIVER_END
1560
15251561static MACHINE_DRIVER_START( system_B_hayaosi1 )
15261562
15271563   /* basic machine hardware */
r7356r7357
23322368   ROM_LOAD( "rd.20n",    0x0000, 0x0200, CRC(1d877538) SHA1(a5be0dc65dcfc36fbba10d1fddbe155e24b6122f) )
23332369ROM_END
23342370
2335
23362371ROM_START( edfu )
23372372   ROM_REGION( 0xc0000, "maincpu", 0 )      /* Main CPU Code: 00000-3ffff & 80000-bffff */
23382373   ROM_LOAD16_BYTE( "edf5.b5",  0x000000, 0x020000, CRC(105094d1) SHA1(e962164836756bc20c2b5dc0032042a0219e82d8) )
r7356r7357
23702405ROM_END
23712406
23722407
2408ROM_START( edfbl )
2409   ROM_REGION( 0xc0000, "maincpu", 0 )      /* Main CPU Code: 00000-3ffff & 80000-bffff */
2410   ROM_LOAD16_BYTE( "02.bin",  0x000000, 0x020000, CRC(19a0dfa0) SHA1(acd020fa42de9cd98e51fe92377a46846859797b) )
2411   ROM_CONTINUE (               0x080000, 0x020000 )
2412   ROM_LOAD16_BYTE( "01.bin",  0x000001, 0x020000, CRC(fc893ad0) SHA1(6d7be560e2343f3943f52ccdae7bd255b7720b6e) )
2413   ROM_CONTINUE (                  0x080001, 0x020000 )
2414
2415   /* no 2nd 68k on this bootleg */
2416
2417   ROM_REGION( 0x080000, "gfx1", 0 ) /* Scroll 0 */
2418   ROM_LOAD( "07.bin",  0x000000, 0x040000, CRC(4495c228) SHA1(2193561e193e696c66f27fa186f27ffbbdcb1826) )
2419   ROM_LOAD( "06.bin",  0x040000, 0x040000, CRC(3e37f226) SHA1(b789c1d2159f54d7464239e111bd729e0582b89b) )
2420
2421   ROM_REGION( 0x080000, "gfx2", 0 ) /* Scroll 1 */
2422   ROM_LOAD( "03.bin",  0x000000, 0x040000, CRC(eea24345) SHA1(1ed690eb62b28cf6bbcb6fec7e8e39daaa340af3) )
2423   ROM_LOAD( "04.bin",  0x040000, 0x040000, CRC(2cfe9439) SHA1(c953f1cf16be444eef3dc389305733ac351559b6) )
2424
2425   ROM_REGION( 0x020000, "gfx3", 0 ) /* Scroll 2 */
2426   ROM_LOAD( "05.bin",   0x000000, 0x020000, CRC(96e38983) SHA1(a4fb94f15d9a9f7df1645be66fe3e179d0ebf765) )
2427
2428   ROM_REGION( 0x080000, "gfx4", 0 ) /* Sprites */
2429   ROM_LOAD( "09.bin",  0x000000, 0x040000, CRC(e89d27c0) SHA1(b95d7988f13c578f501dc6cf2a5109dbef2a4d6c) )
2430   ROM_LOAD( "08.bin",  0x040000, 0x040000, CRC(603ac969) SHA1(193144080d2cb5536980e5f0f7173fba470ab79f) )
2431
2432   ROM_REGION( 0x040000, "oki1", 0 ) /* Samples - non-banked sfx? */
2433   ROM_LOAD( "12.bin",  0x000000, 0x010000, CRC(e645f447) SHA1(5de3acc32a2211995ed1e9b4577063124b0db45a) )
2434
2435   ROM_REGION( 0x080000, "okibanks", 0 ) /* Samples - banked music? */
2436   ROM_LOAD( "11.bin",  0x000000, 0x040000, CRC(5a8896cb) SHA1(ffa529acc1842868d51c22acf2b6b5a6aa1a79b2) )
2437   ROM_LOAD( "10.bin",  0x040000, 0x040000, CRC(baa7c91b) SHA1(1f4d240a4059fad1d09d624275dfe2dffe950a47) )
2438
2439   ROM_REGION( 0x0200, "proms", 0 ) /* the bootleg has an 82s131 prom like the original, but it isn't confirmed to be the same yet */
2440   ROM_LOAD( "rd.20n",    0x0000, 0x0200, CRC(1d877538) SHA1(a5be0dc65dcfc36fbba10d1fddbe155e24b6122f) )
2441ROM_END
2442
23732443/***************************************************************************
23742444
23752445                                [ Hachoo! ]
r7356r7357
37383808   ip_select_values[4] = 0x24;
37393809}
37403810
3811static READ16_HANDLER( edfbl_input_r )
3812{
3813   return 0xffff;
3814}
3815
3816static DRIVER_INIT( edfbl )
3817{
3818   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xe0002, 0xe000b, 0, 0, edfbl_input_r);
3819}
3820
3821
37413822static DRIVER_INIT( hachoo )
37423823{
37433824   UINT16 *RAM;
r7356r7357
39093990GAME( 1990, monkelf,  avspirit, system_B,          avspirit, monkelf,  ROT0,   "bootleg", "Monky Elf (Korean bootleg of Avenging Spirit)", GAME_NOT_WORKING )
39103991GAME( 1991, edf,      0,        system_B,          edf,      edf,      ROT0,   "Jaleco", "E.D.F. : Earth Defense Force", 0 )
39113992GAME( 1991, edfu,     edf,      system_B,          edf,      edf,      ROT0,   "Jaleco", "E.D.F. : Earth Defense Force (North America)", 0 )
3993GAME( 1991, edfbl,    edf,      system_Bbl,        edf,      edfbl,    ROT0,   "Jaleco", "E.D.F. : Earth Defense Force (bootleg)", GAME_NOT_WORKING | GAME_NO_SOUND )
39123994GAME( 1991, 64street, 0,        system_C,          64street, 64street, ROT0,   "Jaleco", "64th. Street - A Detective Story (World)", 0 )
39133995GAME( 1991, 64streetj,64street, system_C,          64street, 64street, ROT0,   "Jaleco", "64th. Street - A Detective Story (Japan)", 0 )
39143996GAME( 1992, soldam,   0,        system_A,          soldam,   soldam,   ROT0,   "Jaleco", "Soldam", 0 )
src/mame/drivers/crshrace.c
r7356r7357
8989    to the "test mode" (code at 0x0040de).
9090
9191
922) 'crshrac2'
922) 'crshrace2'
9393
9494  - Even if there is code for it, there is NO possibility to select a 3 players
9595    game due to code at 0x003796 which "invalidates" the previous reading of DSW 3 :
r7356r7357
374374INPUT_PORTS_END
375375
376376/* Same as 'crshrace', but additional "unknown" Dip Switch (see notes) */
377static INPUT_PORTS_START( crshrac2 )
377static INPUT_PORTS_START( crshrace2 )
378378   PORT_INCLUDE( crshrace )
379379
380380   PORT_MODIFY("DSW0")
r7356r7357
603603   #endif
604604}
605605
606static DRIVER_INIT( crshrac2 )
606static DRIVER_INIT( crshrace2 )
607607{
608608   #if CRSHRACE_3P_HACK
609609   crshrace_patch_code(0x003796);
r7356r7357
611611}
612612
613613
614GAME( 1993, crshrace, 0,        crshrace, crshrace, crshrace, ROT270, "Video System Co.", "Lethal Crash Race (set 1)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
615GAME( 1993, crshrace2,crshrace, crshrace, crshrac2, crshrac2, ROT270, "Video System Co.", "Lethal Crash Race (set 2)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
614GAME( 1993, crshrace,  0,        crshrace, crshrace,  crshrace,  ROT270, "Video System Co.", "Lethal Crash Race (set 1)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
615GAME( 1993, crshrace2, crshrace, crshrace, crshrace2, crshrace2, ROT270, "Video System Co.", "Lethal Crash Race (set 2)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
src/mame/drivers/airbustr.c
r7356r7357
488488   PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW2:8" )
489489INPUT_PORTS_END
490490
491static INPUT_PORTS_START( airbustj )
491static INPUT_PORTS_START( airbustrj )
492492   PORT_INCLUDE(airbustr)
493493
494494   PORT_MODIFY("DSW1")
r7356r7357
688688   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
689689MACHINE_DRIVER_END
690690
691static MACHINE_DRIVER_START( airbusb )
691static MACHINE_DRIVER_START( airbustrb )
692692   MDRV_IMPORT_FROM(airbustr)
693693   MDRV_WATCHDOG_TIME_INIT(SEC(0)) // no protection device or watchdog
694694MACHINE_DRIVER_END
r7356r7357
809809/* Game Drivers */
810810
811811GAME( 1990, airbustr,   0,        airbustr, airbustr, airbustr, ROT0, "Kaneko (Namco license)", "Air Buster: Trouble Specialty Raid Unit (World)", GAME_SUPPORTS_SAVE )   // 891220
812GAME( 1990, airbustrj,  airbustr, airbustr, airbustj, airbustr, ROT0, "Kaneko (Namco license)", "Air Buster: Trouble Specialty Raid Unit (Japan)", GAME_SUPPORTS_SAVE)    // 891229
813GAME( 1990, airbustrb,  airbustr, airbusb,  airbustj, 0,        ROT0, "bootleg", "Air Buster: Trouble Specialty Raid Unit (bootleg)", GAME_SUPPORTS_SAVE)   // based on Japan set (891229)
812GAME( 1990, airbustrj,  airbustr, airbustr, airbustrj,airbustr, ROT0, "Kaneko (Namco license)", "Air Buster: Trouble Specialty Raid Unit (Japan)", GAME_SUPPORTS_SAVE)    // 891229
813GAME( 1990, airbustrb,  airbustr, airbustrb,airbustrj,0,        ROT0, "bootleg", "Air Buster: Trouble Specialty Raid Unit (bootleg)", GAME_SUPPORTS_SAVE)   // based on Japan set (891229)
src/mame/drivers/cball.c
r7356r7357
226226   MDRV_DRIVER_DATA(cball_state)
227227
228228   /* basic machine hardware */
229   MDRV_CPU_ADD("maincpu", M6800, 12096000 / 16) /* ? */
229   MDRV_CPU_ADD("maincpu", M6800, XTAL_12_096MHz / 16) /* ? */
230230   MDRV_CPU_PROGRAM_MAP(cpu_map)
231231
232232   MDRV_MACHINE_START(cball)
src/mame/drivers/cave.c
r7356r7357
252595  Sailor Moon     Banpresto     BP945A      038 9437WX711   013 9346E7002   Z80
262695  Donpachi        Atlus         AT-C01DP-2  038 9429WX727   013 8647-01     NMK 112
272796  Air Gallet      Banpresto     BP962A      038 9437WX711   013 9346E7002   Z80
2896  Hotdog Storm    Marble        ?          ?                               Z80
2896  Hotdog Storm    Marble        ASTC9501    038 9341EX702                   Z80
292997  Dodonpachi      Atlus         ATC03D2     ?
303098  Dangun Feveron  Nihon System  CV01        038 9808WX003   013 9807EX004
313198  ESP Ra.De.      Atlus         ATC04       ?
r7356r7357
40894089}
40904090
40914091
4092static DRIVER_INIT( pwrins2j )
4092static DRIVER_INIT( pwrinst2j )
40934093{
40944094   cave_state *state = (cave_state *)machine->driver_data;
40954095   UINT8 *ROM = memory_region(machine, "audiocpu");
r7356r7357
41274127{
41284128   /* this patch fixes on of the moves, why is it needed? is the rom bad or is there another
41294129       problem? does the Japan set need it or not? */
4130   DRIVER_INIT_CALL(pwrins2j);
4130   DRIVER_INIT_CALL(pwrinst2j);
41314131
41324132#if 1      //ROM PATCH
41334133   {
r7356r7357
42134213***************************************************************************/
42144214
42154215GAME( 1994, pwrinst2,   0,        pwrinst2, metmqstr, pwrinst2, ROT0,   "Atlus/Cave",                           "Power Instinct 2 (US, Ver. 94/04/08)"         , 0 )
4216GAME( 1994, pwrinst2j,  pwrinst2, pwrinst2, metmqstr, pwrins2j, ROT0,   "Atlus/Cave",                           "Gouketsuji Ichizoku 2 (Japan, Ver. 94/04/08)"      , 0 )
4216GAME( 1994, pwrinst2j,  pwrinst2, pwrinst2, metmqstr, pwrinst2j,ROT0,   "Atlus/Cave",                           "Gouketsuji Ichizoku 2 (Japan, Ver. 94/04/08)"      , 0 )
42174217GAME( 1994, mazinger,   0,        mazinger, mazinger, mazinger, ROT90,  "Banpresto/Dynamic Pl. Toei Animation", "Mazinger Z (International/Japan)"         , 0 ) // region in eeprom
42184218GAME( 1995, donpachi,   0,        donpachi, cave,     donpachi, ROT270, "Atlus/Cave",                           "DonPachi (US)"                  , 0 )
42194219GAME( 1995, donpachij,  donpachi, donpachi, cave,     donpachi, ROT270, "Atlus/Cave",                           "DonPachi (Japan)"               , 0 )
r7356r7357
42214221GAME( 1995, donpachihk, donpachi, donpachi, cave,     donpachi, ROT270, "Atlus/Cave",                           "DonPachi (Hong Kong)"               , 0 )
42224222GAME( 1995, metmqstr,   0,        metmqstr, metmqstr, metmqstr, ROT0,   "Banpresto/Pandorabox",                 "Metamoqester (International)"            , 0 )
42234223GAME( 1995, nmaster,    metmqstr, metmqstr, metmqstr, metmqstr, ROT0,   "Banpresto/Pandorabox",                 "Oni - The Ninja Master (Japan)"            , 0 )
4224GAME( 1995, plegends,   0,        pwrinst2, metmqstr, pwrins2j, ROT0,   "Atlus/Cave",                           "Power Instinct Legends (US, Ver. 95/06/20)"      , 0 )
4225GAME( 1995, plegendsj,  plegends, pwrinst2, metmqstr, pwrins2j, ROT0,   "Atlus/Cave",                           "Gouketsuji Ichizoku Saikyou Densetsu (Japan, Ver. 95/06/20)", 0 )
4224GAME( 1995, plegends,   0,        pwrinst2, metmqstr, pwrinst2j,ROT0,   "Atlus/Cave",                           "Power Instinct Legends (US, Ver. 95/06/20)"      , 0 )
4225GAME( 1995, plegendsj,  plegends, pwrinst2, metmqstr, pwrinst2j,ROT0,   "Atlus/Cave",                           "Gouketsuji Ichizoku Saikyou Densetsu (Japan, Ver. 95/06/20)", 0 )
42264226GAME( 1995, sailormn,   0,        sailormn, sailormn, sailormn, ROT0,   "Banpresto",                            "Pretty Soldier Sailor Moon (JUEHTK, Ver. 95/03/22B)"   , 0 ) // region in eeprom
42274227GAME( 1995, sailormno,  sailormn, sailormn, sailormn, sailormn, ROT0,   "Banpresto",                            "Pretty Soldier Sailor Moon (JUEHTK, Ver. 95/03/22)"   , 0 ) // region in eeprom
42284228GAME( 1996, agallet,    0,        sailormn, sailormn, agallet,  ROT270, "Banpresto / Gazelle",                  "Air Gallet (JUEHTK)"               , 0 ) // board was taiwan, region in eeprom
src/mame/drivers/dec8.c
r7356r7357
295295         ((((state->coin1 / 10) << 4) | (state->coin1 % 10)) << 8); /* Coins */
296296}
297297
298static WRITE8_HANDLER( lastmiss_i8751_w )
298static WRITE8_HANDLER( lastmisn_i8751_w )
299299{
300300   dec8_state *state = (dec8_state *)space->machine->driver_data;
301301   state->i8751_return = 0;
r7356r7357
681681   AM_RANGE(0x4000, 0xffff) AM_ROM
682682ADDRESS_MAP_END
683683
684static ADDRESS_MAP_START( lastmiss_map, ADDRESS_SPACE_PROGRAM, 8 )
684static ADDRESS_MAP_START( lastmisn_map, ADDRESS_SPACE_PROGRAM, 8 )
685685   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1")
686686   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("share3") AM_BASE_GENERIC(paletteram)
687687   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("share4") AM_BASE_GENERIC(paletteram2)
r7356r7357
694694   AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */
695695   AM_RANGE(0x1806, 0x1806) AM_READ(i8751_h_r)
696696   AM_RANGE(0x1807, 0x1807) AM_READWRITE(i8751_l_r, flip_screen_w)
697   AM_RANGE(0x1809, 0x1809) AM_WRITE(lastmiss_scrollx_w) /* Scroll LSB */
698   AM_RANGE(0x180b, 0x180b) AM_WRITE(lastmiss_scrolly_w) /* Scroll LSB */
697   AM_RANGE(0x1809, 0x1809) AM_WRITE(lastmisn_scrollx_w) /* Scroll LSB */
698   AM_RANGE(0x180b, 0x180b) AM_WRITE(lastmisn_scrolly_w) /* Scroll LSB */
699699   AM_RANGE(0x180c, 0x180c) AM_WRITE(dec8_sound_w)
700   AM_RANGE(0x180d, 0x180d) AM_WRITE(lastmiss_control_w) /* Bank switch + Scroll MSB */
701   AM_RANGE(0x180e, 0x180f) AM_WRITE(lastmiss_i8751_w)
700   AM_RANGE(0x180d, 0x180d) AM_WRITE(lastmisn_control_w) /* Bank switch + Scroll MSB */
701   AM_RANGE(0x180e, 0x180f) AM_WRITE(lastmisn_i8751_w)
702702   AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(dec8_videoram_w) AM_BASE_SIZE_MEMBER(dec8_state, videoram, videoram_size)
703703   AM_RANGE(0x2800, 0x2fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
704704   AM_RANGE(0x3000, 0x37ff) AM_RAM AM_SHARE("share2")
r7356r7357
707707   AM_RANGE(0x8000, 0xffff) AM_ROM
708708ADDRESS_MAP_END
709709
710static ADDRESS_MAP_START( lastmiss_sub_map, ADDRESS_SPACE_PROGRAM, 8 )
710static ADDRESS_MAP_START( lastmisn_sub_map, ADDRESS_SPACE_PROGRAM, 8 )
711711   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1")
712712   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_SHARE("share3")
713713   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_SHARE("share4")
r7356r7357
739739   AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w)
740740   AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */
741741   AM_RANGE(0x1807, 0x1807) AM_WRITE(flip_screen_w)
742   AM_RANGE(0x1809, 0x1809) AM_WRITE(lastmiss_scrollx_w) /* Scroll LSB */
743   AM_RANGE(0x180b, 0x180b) AM_WRITE(lastmiss_scrolly_w) /* Scroll LSB */
742   AM_RANGE(0x1809, 0x1809) AM_WRITE(lastmisn_scrollx_w) /* Scroll LSB */
743   AM_RANGE(0x180b, 0x180b) AM_WRITE(lastmisn_scrolly_w) /* Scroll LSB */
744744   AM_RANGE(0x180c, 0x180c) AM_WRITE(dec8_sound_w)
745745   AM_RANGE(0x180d, 0x180d) AM_WRITE(shackled_control_w) /* Bank switch + Scroll MSB */
746746   AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(dec8_videoram_w)
r7356r7357
764764   AM_RANGE(0x1805, 0x1805) AM_WRITE(buffer_spriteram_w) /* DMA */
765765   AM_RANGE(0x1806, 0x1806) AM_READ(i8751_h_r)
766766   AM_RANGE(0x1807, 0x1807) AM_READWRITE(i8751_l_r, flip_screen_w)
767   AM_RANGE(0x1809, 0x1809) AM_WRITE(lastmiss_scrollx_w) /* Scroll LSB */
768   AM_RANGE(0x180b, 0x180b) AM_WRITE(lastmiss_scrolly_w) /* Scroll LSB */
767   AM_RANGE(0x1809, 0x1809) AM_WRITE(lastmisn_scrollx_w) /* Scroll LSB */
768   AM_RANGE(0x180b, 0x180b) AM_WRITE(lastmisn_scrolly_w) /* Scroll LSB */
769769   AM_RANGE(0x180c, 0x180c) AM_WRITE(dec8_sound_w)
770770   AM_RANGE(0x180d, 0x180d) AM_WRITE(shackled_control_w) /* Bank switch + Scroll MSB */
771771   AM_RANGE(0x180e, 0x180f) AM_WRITE(shackled_i8751_w)
r7356r7357
14931493   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
14941494INPUT_PORTS_END
14951495
1496static INPUT_PORTS_START( lastmsnj )
1496static INPUT_PORTS_START( lastmisnj )
14971497   PORT_START("IN0")
14981498   PLAYER1_JOYSTICK
14991499   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
r7356r7357
22942294   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
22952295MACHINE_DRIVER_END
22962296
2297static MACHINE_DRIVER_START( lastmiss )
2297static MACHINE_DRIVER_START( lastmisn )
22982298
22992299   /* driver data */
23002300   MDRV_DRIVER_DATA(dec8_state)
23012301
23022302   /* basic machine hardware */
23032303   MDRV_CPU_ADD("maincpu", M6809, 2000000)
2304   MDRV_CPU_PROGRAM_MAP(lastmiss_map)
2304   MDRV_CPU_PROGRAM_MAP(lastmisn_map)
23052305
23062306   MDRV_CPU_ADD("sub", M6809, 2000000)
2307   MDRV_CPU_PROGRAM_MAP(lastmiss_sub_map)
2307   MDRV_CPU_PROGRAM_MAP(lastmisn_sub_map)
23082308
23092309   MDRV_CPU_ADD("audiocpu", M6502, 1500000)
23102310   MDRV_CPU_PROGRAM_MAP(ym3526_s_map)
r7356r7357
23272327   MDRV_GFXDECODE(shackled)
23282328   MDRV_PALETTE_LENGTH(1024)
23292329
2330   MDRV_VIDEO_START(lastmiss)
2331   MDRV_VIDEO_UPDATE(lastmiss)
2330   MDRV_VIDEO_START(lastmisn)
2331   MDRV_VIDEO_UPDATE(lastmisn)
23322332
23332333   /* sound hardware */
23342334   MDRV_SPEAKER_STANDARD_MONO("mono")
r7356r7357
24282428   MDRV_GFXDECODE(shackled)
24292429   MDRV_PALETTE_LENGTH(1024)
24302430
2431   MDRV_VIDEO_START(lastmiss)
2432   MDRV_VIDEO_UPDATE(lastmiss)
2431   MDRV_VIDEO_START(lastmisn)
2432   MDRV_VIDEO_UPDATE(lastmisn)
24332433
24342434   /* sound hardware */
24352435   MDRV_SPEAKER_STANDARD_MONO("mono")
r7356r7357
36033603   DRIVER_INIT_CALL( dec8 );
36043604}
36053605
3606static DRIVER_INIT( lastmiss )
3606static DRIVER_INIT( lastmisn )
36073607{
36083608   UINT8 *ROM = memory_region(machine, "maincpu");
36093609   memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
r7356r7357
36343634GAME( 1987, oscaru,   oscar,    oscar,    oscaru,   oscar,       ROT0,   "Data East USA", "Psycho-Nics Oscar (US)", GAME_SUPPORTS_SAVE )
36353635GAME( 1987, oscarj1,  oscar,    oscar,    oscaru,   oscar,       ROT0,   "Data East Corporation", "Psycho-Nics Oscar (Japan revision 1)", GAME_SUPPORTS_SAVE )
36363636GAME( 1987, oscarj2,  oscar,    oscar,    oscaru,   oscar,       ROT0,   "Data East Corporation", "Psycho-Nics Oscar (Japan revision 2)", GAME_SUPPORTS_SAVE )
3637GAME( 1986, lastmisn, 0,        lastmiss, lastmisn, lastmiss,    ROT270, "Data East USA", "Last Mission (US revision 6)", GAME_SUPPORTS_SAVE )
3638GAME( 1986, lastmisno,lastmisn, lastmiss, lastmisn, lastmiss,    ROT270, "Data East USA", "Last Mission (US revision 5)", GAME_SUPPORTS_SAVE )
3639GAME( 1986, lastmisnj,lastmisn, lastmiss, lastmsnj, lastmiss,    ROT270, "Data East Corporation", "Last Mission (Japan)", GAME_SUPPORTS_SAVE )
3637GAME( 1986, lastmisn, 0,        lastmisn, lastmisn, lastmisn,    ROT270, "Data East USA", "Last Mission (US revision 6)", GAME_SUPPORTS_SAVE )
3638GAME( 1986, lastmisno,lastmisn, lastmisn, lastmisn, lastmisn,    ROT270, "Data East USA", "Last Mission (US revision 5)", GAME_SUPPORTS_SAVE )
3639GAME( 1986, lastmisnj,lastmisn, lastmisn, lastmisnj, lastmisn,    ROT270, "Data East Corporation", "Last Mission (Japan)", GAME_SUPPORTS_SAVE )
36403640GAME( 1986, shackled, 0,        shackled, shackled, shackled,    ROT0,   "Data East USA", "Shackled (US)", GAME_SUPPORTS_SAVE )
36413641GAME( 1986, breywood, shackled, shackled, shackled, shackled,    ROT0,   "Data East Corporation", "Breywood (Japan revision 2)", GAME_SUPPORTS_SAVE )
36423642GAME( 1987, csilver,  0,        csilver,  csilver,  csilver,     ROT0,   "Data East Corporation", "Captain Silver (World)", GAME_SUPPORTS_SAVE )
src/mame/drivers/crimfght.c
r7356r7357
180180   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 )
181181INPUT_PORTS_END
182182
183static INPUT_PORTS_START( crimfgtj )
183static INPUT_PORTS_START( crimfghtj )
184184   PORT_INCLUDE( crimfght )
185185
186186   PORT_MODIFY("DSW1")
r7356r7357
427427}
428428
429429GAME( 1989, crimfght,  0,        crimfght, crimfght, 0, ROT0, "Konami", "Crime Fighters (US 4 players)", GAME_SUPPORTS_SAVE )
430GAME( 1989, crimfght2, crimfght, crimfght, crimfgtj, 0, ROT0, "Konami", "Crime Fighters (World 2 Players)", GAME_SUPPORTS_SAVE )
431GAME( 1989, crimfghtj, crimfght, crimfght, crimfgtj, 0, ROT0, "Konami", "Crime Fighters (Japan 2 Players)", GAME_SUPPORTS_SAVE )
430GAME( 1989, crimfght2, crimfght, crimfght, crimfghtj,0, ROT0, "Konami", "Crime Fighters (World 2 Players)", GAME_SUPPORTS_SAVE )
431GAME( 1989, crimfghtj, crimfght, crimfght, crimfghtj,0, ROT0, "Konami", "Crime Fighters (Japan 2 Players)", GAME_SUPPORTS_SAVE )
src/mame/drivers/asuka.c
r7356r7357
7676
7777Stephh's notes (based on the game M68000 code and some tests) :
7878
791) 'bonzeadv', 'jigkmgri' and 'bonzeadu'
791) 'bonzeadv', 'jigkmgri' and 'bonzeadvu'
8080
8181  - Region stored at 0x03fffe.w
8282  - Sets :
8383      * 'bonzeadv' : region = 0x0002
8484      * 'jigkmgri' : region = 0x0000
85      * 'bonzeadu' : region = 0x0001
85      * 'bonzeadvu': region = 0x0001
8686  - These 3 games are 100% the same, only region differs !
8787  - Coinage relies on the region (code at 0x02d344) :
8888      * 0x0000 (Japan) and 0x0001 (US) use TAITO_COINAGE_JAPAN_OLD_LOC()
r7356r7357
107107    but it is now unused due to "bra" instruction at 0x007572
108108
109109
1102) 'bonzeado'
1102) 'bonzeadvo'
111111
112112  - Region stored at 0x03fffe.w
113113  - Sets :
114      * 'bonzeado' : region = 0x0002
114      * 'bonzeadvo' : region = 0x0002
115115  - The only difference is that the following code is missing :
116116
117117      00D218: 08AD 0004 15DE             bclr    #$4, ($15de,A5)
src/mame/drivers/wrally.c
r7356r7357
155155
156156static INPUT_PORTS_START( wrally )
157157   PORT_START("DSW")
158   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
158   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("SW2:7,8")
159159   PORT_DIPSETTING(      0x0003, DEF_STR( Normal ) )
160160   PORT_DIPSETTING(      0x0002, DEF_STR( Easy ) )
161161   PORT_DIPSETTING(      0x0001, DEF_STR( Hard ) )
162162   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
163   PORT_DIPNAME( 0x0004, 0x0004, "Number of Joysticks" )
163   PORT_DIPNAME( 0x0004, 0x0004, "Number of Joysticks" )      PORT_DIPLOCATION("SW2:6")
164164   PORT_DIPSETTING(      0x0004, "2" )
165165   PORT_DIPSETTING(      0x0000, "1" )
166   PORT_DIPNAME( 0x0018, 0x0018, "Control Configuration" )
166   PORT_DIPNAME( 0x0018, 0x0018, "Control Configuration" )    PORT_DIPLOCATION("SW2:4,5")
167167   PORT_DIPSETTING(      0x0018, DEF_STR( Joystick ) )
168168   PORT_DIPSETTING(      0x0010, "Pot Wheel" )
169   PORT_DIPSETTING(      0x0000, "Opt Wheel" )
170   PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Demo_Sounds ) )
169   PORT_DIPSETTING(      0x0000, "Optical Wheel" )
170   PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Demo_Sounds ) )     PORT_DIPLOCATION("SW2:3")
171171   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
172172   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
173   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Cabinet ) )
173   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Cabinet ) )         PORT_DIPLOCATION("SW2:2")
174174   PORT_DIPSETTING(      0x0040, DEF_STR( Upright ) )
175175   PORT_DIPSETTING(      0x0000, DEF_STR( Cocktail ) )
176   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
177   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )
176   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )                      PORT_DIPLOCATION("SW2:1")
177   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )          PORT_DIPLOCATION("SW1:6,7,8")
178178   PORT_DIPSETTING(      0x0700, DEF_STR( 1C_1C ) )
179179   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_4C ) )
180180   PORT_DIPSETTING(      0x0100, DEF_STR( 2C_3C ) )
r7356r7357
183183   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
184184   PORT_DIPSETTING(      0x0300, DEF_STR( 1C_5C ) )
185185   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_6C ) )
186   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )
186   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )          PORT_DIPLOCATION("SW1:3,4,5")
187187   PORT_DIPSETTING(      0x1000, DEF_STR( 6C_1C ) )
188188   PORT_DIPSETTING(      0x1800, DEF_STR( 5C_1C ) )
189189   PORT_DIPSETTING(      0x2000, DEF_STR( 4C_1C ) )
r7356r7357
192192   PORT_DIPSETTING(      0x0800, DEF_STR( 3C_2C ) )
193193   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_3C ) )
194194   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )
195   PORT_DIPNAME( 0x4000, 0x4000, "Credit configuration" )
195   PORT_DIPNAME( 0x4000, 0x4000, "Credit configuration" )     PORT_DIPLOCATION("SW1:2")
196196   PORT_DIPSETTING(      0x4000, "Start 1C/Continue 1C" )
197197   PORT_DIPSETTING(      0x0000, "Start 2C/Continue 1C" )
198   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Free_Play ) )
198   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Free_Play ) )       PORT_DIPLOCATION("SW1:1")
199199   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
200200   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
201201
src/osd/sdl/sdlos_macosx.c
r7356r7357
207207   return setenv(name, value, overwrite);
208208}
209209
210
211210//============================================================
212211//  osd_get_clipboard_text
213212//============================================================
r7356r7357
308307}
309308
310309//============================================================
310//  MESS specific code below
311//============================================================
312
313#ifdef MESS
314
315//============================================================
311316//  osd_stat
312317//============================================================
313318
r7356r7357
383388
384389   return err;
385390}
391
392#endif
src/osd/sdl/sdlos_win32.c
r7356r7357
273273   return result;
274274}
275275
276//============================================================
277//  MESS specific code below
278//============================================================
276279
277280//============================================================
278281//  get_clipboard_text_by_format
r7356r7357
314317}
315318
316319
317
318320//============================================================
319321//  convert_wide
320322//============================================================
r7356r7357
356358   return result;
357359}
358360
361#ifdef MESS
362
359363//============================================================
360364//  astring_from_utf8
361365//============================================================
r7356r7357
548552      free(t_path);
549553   return err;
550554}
555
556#endif
src/osd/sdl/sdlos_os2.c
r7356r7357
227227{
228228   return setenv(name, value, overwrite);
229229}
230
231
232//============================================================
233//  osd_get_clipboard_text
234//    - used in MESS
235//============================================================
236
237char *osd_get_clipboard_text(void)
238{
239   char *result = NULL;
240
241   return result;
242}
src/osd/sdl/sdl.mak
r7356r7357
476476$(OBJ)/emu/cpu/h6280/6280dasm.o : CDEFS += -D__STRICT_ANSI__
477477endif # OS2
478478
479ifeq ($(TARGETOS),solaris)
480# solaris only has gcc-4.3 by default and is reporting a false positive
481$(OBJ)/emu/video/tms9927.o : CCOMFLAGS += -Wno-error
482endif # solaris
483
479484# drawSDL depends on the core software renderer, so make sure it exists
480485$(SDLOBJ)/drawsdl.o : $(SRC)/emu/rendersw.c $(SDLSRC)/drawogl.c $(SDLSRC)/texcopy.c
481486
src/osd/sdl/sdlos_unix.c
r7356r7357
124124   return setenv(name, value, overwrite);
125125}
126126
127
128127#if defined(SDL_VIDEO_DRIVER_X11) && defined(SDLMAME_X11)
129128
130129//============================================================
r7356r7357
228227#endif
229228
230229//============================================================
230//  MESS specific code below
231//============================================================
232
233#ifdef MESS
234
235//============================================================
231236//  osd_stat
232237//============================================================
233238
r7356r7357
241246   struct stat64 st;
242247   #endif
243248
244   #if defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD)
249   #if defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD)
245250   err = stat(path, &st);
246251   #else
247252   err = stat64(path, &st);
r7356r7357
303308
304309   return err;
305310}
311
312#endif
src/osd/sdl/video.c
r7356r7357
350350   sdlinput_poll(machine);
351351   check_osd_inputs(machine);
352352
353   if (machine->debug_flags & DEBUG_FLAG_ENABLED)
353   if ((machine->debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0)
354354      debugwin_update_during_game(machine);
355355}
356356
r7356r7357
631631   #endif
632632
633633
634   if (options_get_bool(mame_options(), OPTION_DEBUG))
634   if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
635635      video_config.windowed = TRUE;
636636
637637   stemp = options_get_string(mame_options(), SDLOPTION_EFFECT);
src/osd/sdl/sdlfile.c
r7356r7357
2727#include <fcntl.h>
2828#include <unistd.h>
2929#include <stdio.h>
30#include <stdlib.h>
3130#include <errno.h>
3231
3332// MAME headers
r7356r7357
5655struct _osd_file
5756{
5857   int      handle;
59   char      filename[1];
58   char   filename[1];
6059};
6160
6261
6362//============================================================
64//  Static variables
63//  Prototypes
6564//============================================================
6665
6766static UINT32 create_path_recursive(char *path);
r7356r7357
109108   UINT32 access;
110109   const char *src;
111110   char *dst;
112        #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
111   #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
113112   struct stat st;
114113   #else
115114   struct stat64 st;
r7356r7357
193192   #endif
194193
195194   // attempt to open the file
196        #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
195   #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
197196   (*file)->handle = open(tmpstr, access, 0666);
198197   #else
199198   (*file)->handle = open64(tmpstr, access, 0666);
r7356r7357
216215            // attempt to reopen the file
217216            if (error == NO_ERROR)
218217            {
219                              #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
218               #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
220219               (*file)->handle = open(tmpstr, access, 0666);
221220               #else
222221               (*file)->handle = open64(tmpstr, access, 0666);
r7356r7357
236235   }
237236
238237   // get the file size
239        #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
238   #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
240239   fstat((*file)->handle, &st);
241240   #else
242241   fstat64((*file)->handle, &st);
r7356r7357
384383   return FALSE;      // no, no way, huh-uh, forget it
385384}
386385
387/*============================================================ */
388/*      osd_is_path_separator */
389/*============================================================ */
386//============================================================
387//  osd_is_path_separator
388//============================================================
390389
391390static int osd_is_path_separator(char c)
392391{
393        return (c == '/') || (c == '\\');
392   return (c == '/') || (c == '\\');
394393}
395394
396/*============================================================ */
397/*      osd_is_absolute_path */
398/*============================================================ */
395//============================================================
396//  osd_is_absolute_path
397//============================================================
398
399399int osd_is_absolute_path(const char *path)
400400{
401        int result;
401   int result;
402402
403        if (osd_is_path_separator(path[0]))
404                result = TRUE;
403   if (osd_is_path_separator(path[0]))
404      result = TRUE;
405405#if !defined(SDLMAME_WIN32) && !defined(SDLMAME_OS2)
406        else if (path[0] == '.')
407                result = TRUE;
406   else if (path[0] == '.')
407      result = TRUE;
408408#else
409409   #ifndef UNDER_CE
410410   else if (*path && path[1] == ':')
411411      result = TRUE;
412412   #endif
413413#endif
414        else
415                result = FALSE;
416        return result;
414   else
415      result = FALSE;
416
417   return result;
417418}
src/osd/sdl/sdlmain.c
r7356r7357
1414#include <SDL/SDL_version.h>
1515
1616// standard includes
17#ifdef MESS
18#include <unistd.h>
19#endif
20#ifdef SDLMAME_OS2
21#define INCL_DOS
22#include <os2.h>
23#endif
1724
1825// MAME headers
1926#include "osdepend.h"
r7356r7357
3643#include <X11/Xutil.h>
3744#endif
3845
39#ifdef SDLMAME_OS2
40#define INCL_DOS
41#include <os2.h>
42
43void MorphToPM()
44{
45  PPIB pib;
46  PTIB tib;
47
48  DosGetInfoBlocks(&tib, &pib);
49
50  // Change flag from VIO to PM:
51  if (pib->pib_ultype==2) pib->pib_ultype = 3;
52}
53#endif
54
5546//============================================================
56//  LOCAL VARIABLES
57//============================================================
58
59#include <unistd.h>
60
61//============================================================
6247//  OPTIONS
6348//============================================================
6449
r7356r7357
7459#endif // MACOSX
7560#endif // INI_PATH
7661
62
63//============================================================
64//  Global variables
65//============================================================
66
67//============================================================
68//  Local variables
69//============================================================
70
7771static const options_entry mame_sdl_options[] =
7872{
7973   { SDLOPTION_INIPATH,                     INI_PATH,     0,                "path to ini files" },
r7356r7357
233227};
234228
235229//============================================================
230//  OS2 specific
231//============================================================
232
233#ifdef SDLMAME_OS2
234void MorphToPM()
235{
236  PPIB pib;
237  PTIB tib;
238
239  DosGetInfoBlocks(&tib, &pib);
240
241  // Change flag from VIO to PM:
242  if (pib->pib_ultype==2) pib->pib_ultype = 3;
243}
244#endif
245
246//============================================================
236247//  main
237248//============================================================
238249
r7356r7357
527538   defines_verbose();
528539
529540   if (!SDLMAME_HAS_DEBUGGER)
530      if (options_get_bool(mame_options(), OPTION_DEBUG))
541      if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
531542      {
532543         mame_printf_error("sdlmame: -debug not supported on X11-less builds\n\n");
533544         osd_exit(machine);
src/osd/sdl/osdsdl.h
r7356r7357
11#ifndef _osdsdl_h_
22#define _osdsdl_h_
33
4/* Notes
5
6    - Known bugs:
7
8      * SDL1.3/X11: Some compound keys, e.g. "'" are not supported by SDL driver
9      * SDL1.3: sdlvideofps does not take -numscreens>1 into account.
10      * SDL1.3/WIN32: crashes with -rd d3d
11      * SDL1.3/WIN32: resizing does not work
12
13    - fixed returning (w,h) = (0,0) in get_max_bounds
14    - new video driver "sdl13" utilitizing SDL texture and line
15      drawing support. Accelerated drivers like directfb now
16      may attain opengl speed. DirectFB does with a radeon card.
17      The driver determines which pixel formats perform best and
18      converts textures to these pixel formats.
19      Supported options:
20      -waitvsync
21      -filter
22      -prescale
23      Supported renderdrivers:
24      X11: opengl, software, x11 (no artwork!)
25      DirectFB: directfb, software, opengl (special setup, slow)
26      Windows: software, gdi (no artwork)
27    - SDL1.3: Clear bck when moving
28    - SDL1.3: now compiles on win32
29    - SDL1.3: Support screen refresh rates, provided the sdl video
30      layer supports them (e.g. X11).
31    - Use video_config.waitvsync (previously option was queried)
32    - -video soft / -sm  now supports -prescale
33    - removed reqwidth, reqheight from sdl_monitor_info; not used anywhere
34    - removed layerconfig from sdl_video_config; not used anywhere
35
36    - fixed yuv issues (firefox) / this was a bug I introduced
37    - removed deprecat.h from output.c
38    - Separated keyboard and mouse initialization into separate functions
39    - added _FORTIFY_SOURCE to verbose compiler define output.
40    - remove MAX_CPU from debugwin.c
41    - fixed vsync handling in SDL1.3 in soft/opengl drivers
42    - "waitvsync" also supported by "soft" driver in SDL1.3
43    - multiple mice and keyboards supported in SDL1.3
44    - support for DISTRO= make option
45    - got rid of "-joymap" and "-joymap_file"
46    - add -joy_idx[0-7] -keyb_idx[0-7] -mouse_idx[0-7] which
47      specify, which device is allocated to to e.g. Mouse 1, Mouse 2, ...
48    - moved define of THREAD_COOPERATIVE into sdl.mak and renamed to
49      NO_THREAD_COOPERATIVE. Changed references to #ifndef
50    - define NO_DEBUGGER in sdl.mak
51    - Solaris now uses -DNO_AFFINITY_NP
52    - added machine to window_info, removed deprecat.h from drawogl.c
53
54    - For DEBUG=1 builds, disable input grapping while windowed
55    - Fixed WIN32 compile
56      Wrote setenv function since mingw does not provide one.
57      Implemented osd_event_* as inline functions for win32 build.
58      We should at some point merge sdlwork.c and winwork.c and push it
59      to the core, letting sdlsync.c provide the necessary details.
60    - Removed keybled.c and references
61    - Added output.c and output.h. These will look for a fifo or file
62      /tmp/sdlmame_out and write output notifiers to it.
63      Added a sample client ledutil.sh to src/osd/sdl which turns
64      leds on and off and provides a debug (log) facility.
65    - removed os2work.c
66
67    - replaced window->render_lock with event window->rendered_event
68      For multiple windows and "-mt", the old code would allow filling up
69      the workqueue with 1000s of entries, since the lock would not block while
70      another window is rendered. The osd_event establishes a barrier which
71      is only freed if the last window blit operation has finished.
72    - Set SDL_VIDEO_GL_DRIVER if -gl_lib is given. The SDL directfb driver is picky about
73      this. Added reminder: FIXME: move lib loading code from drawogl.c here. This may be
74      used to disable opengl if no library was loaded.
75    - SDL1.3/video=opengl: Fixed windows not being updated after another window was resized
76    - for -verbose, output some information about renderer (-video soft)
77    - initialize mouse_enabled with option "-mouse". Affects both SDL1.2 and SDL1.3
78      This will hide the mouse if you specify "-mouse".
79    - SDL1.2: added blitmode "async" which sets SDL_ASYNCBLIT
80    - SDL1.2: removed blitmodes "hwbest" and "hwblit"
81    - added blitmode "hwbest" for antialiased and smoothed scaling now that the
82      directfb driver supports it. This is also supported by the 1.3 opengl
83      render backend
84    - added sdlinput_release_keys to cope with lost keyboard events in SDL1.3
85    - some identing in drawogl.c
86    - rename SDL_* macros to SDLMAME_* (avoid name clashes)
87    - got rid of VIDEO_SCALE_MODE constants. Scale modes are now handled in drawsdl.c.
88      Starting mame with eg. -video soft -sm yuy2 on X11 no longer crashes.
89    - some more changes to input.c to avoid resize loops (issue for directfb)
90
91    - working ui mouse inputs for SDL1.2 and SDL1.3 incl. yuv modes
92    - added blitmode "hwblit" (SDL1.3) for rgb hardware scaling
93    - rename "-yuvmode" option to "-scalemode"
94    - rename yuv_mode and derivatives to scale_mode
95    - moved extra_flags into sdl_info
96    - moved callbacks indow sdl_window_info
97    - made a number of flags (e.g. yuvmode) window relative
98         - changing of yuvmodes and opengl scale effects is working with SDL 1.3
99    - improved fullscreen handling
100    - removed HAS_WINDOW_MENU - this has no effect nowhere
101    - removed underscores in header defines, e.g. __SDL_SYNC__ ==> __SDLSYNC__
102    - added SDLMAME_HAS_DEBUGGER define
103    - removed #if 0 inw window.c
104    - added option "-audiodriver" to specify the SDL audio driver
105    - added option "-videodriver" to specify the SDL video driver
106    - added option "-renderdriver" to specify the SDL renderer driver
107    - changed environment SDLMAME_GL_LIB into option -gl_lib
108    - added some more SDL_ENV defines
109    - move keymap reading into separate function
110    - SDL_EnableUNICODE for all builds (not only MESS)
111    - SDL1.3 : Mouse & text input for ui
112
113    - removed  osd_event_wait_multiple from sdlsync.h
114    - removed some includes not needed
115    - reorganized texcopy/scale2x
116    - removed effect.h
117    - removed effect_func.h
118    - indenting
119    - put osd_copyfile, osd_stat into #ifdef MESS
120    - added code which implements events without the need
121      for pthreads. This is commented out, since
122      owever, it horribly fails, if
123      threads > num processors as is the case if you
124      enable "-mt"
125    - rename mame_bitmap to bitmap_t
126    - introduced define OSDWORK_CALLBACK to prototype and
127      define functions to be passed to sdlwork.c
128
129    - fixes from judge for warnings / may reappear (glade)
130    - more warnings fixed / may reappear (glade)
131    - moved osdefs.h into sdlprefix.h
132    - removed osdefs.h
133    - finally removed sdlmisc.h
134
135    - create drawogl.c and moved ogl relevant stuff there
136    - draw.window_init() now called after window creation
137    - removed window.opengl flag
138    - added sdl_window_info as parameter to all functions in window.h
139    - rename SDL_VERSIONNUM to SDL_VERSION_ATLEAST
140    - removed all uclock stuff in sdlmisc.[ch]
141    - minor cleanups
142
143    - fixed compile issues against SDL13
144    - fixed input issues with SDL13
145    - stricter checks for USE_OPENGL, e.g. for options
146    - move sdlvideo_loadgl to window.c, rename it to sdlwindow_loadgl and make it static
147    - moved yuv_blit.c into drawsdl.c
148    - renamed compute_blit_surface_size to sdlwindow_blit_surface_size
149    - renamed drawsdl_destroy_all_textures to drawogl_destroy_all_textures and
150      moved it to _sdl_draw_callbacks
151    - removed print_colums
152    - rename misc.h to sdlmisc.h
153    - moved some includes from .h to .c
154    - rename led_init to sdlled_init for consistency
155    - rename sdl_init_audio to sdlaudio_init for consistency
156    - fixed some indentation issues
157    - removed ticker.h & dirty.h
158
159    - changed all [f]printf to mame_printf_verbose|error|warning
160    - removed obsolete frameskipping code
161    - removed obsolete throttle code
162    - removed fastforward
163    - removed framestorun
164    - introduced SDLOPTION constants for a number of options
165    - add more verbose info for YUV
166
167    - removed dirty.h
168    - removed ticker.h
169
170    - remove win_trying_to_quit
171    - changed win_use_mouse to static use_mouse
172    - removed win_key_trans_table
173    - removed keyboard typematic definitions from input.h
174    - made sdl_monitor_list static
175    - removed hwstretch (sdl_video_config)
176    - removed syncrefresh (sdl_video_config)
177    - removed triplebuf (sdl_video_config)
178    - removed sdl_has_menu
179    - fixed memory_leak (window.c)
180
181    - moved prototypes from drawsdl.c to window.h
182    - removed joystick calibration code
183    - "#if 0" code which is unreachable
184    - "#if 0" code which is never used
185    - moved pick_best_mode to window.c
186    - removed pause_brightness option
187    - added more SDLOPTION_ defines
188
189    - renamed void yuv_lookup_init to drawsdl_yuv_init (global namespace)
190    - rmoved some obsolete code
191    - add SDL1.3 compatibility
192
193    - fixed some compile issues
194    - moved clear_surface into window thread
195    - got SDL1.3 -mt working - still crashing on exit
196
197    - removed "digital" option
198    - removed device selection options
199    - added more SDLOPTION defines
200*/
201
2024//============================================================
2035//  System dependent defines
2046//============================================================
src/osd/sdl/dview.c
r7356r7357
214214      vsize.x = size.x-pos.x;
215215   }
216216
217   /* FIXME: This does not really work */
217218   {
218219      GdkGeometry x;
219220      x.max_width = size.x*dvc->fixedfont_width;
src/osd/sdl/sdldir.c
r7356r7357
4343#define INVPATHSEPCH '\\'
4444#endif
4545
46struct _osd_directory
47{
48   osd_directory_entry ent;
4946#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
50   struct dirent *data;
47typedef struct dirent sdl_dirent;
48typedef struct stat sdl_stat;
49#define sdl_readdir readdir
50#define sdl_stat_fn stat
5151#else
52   struct dirent64 *data;
52typedef struct dirent64 sdl_dirent;
53typedef struct stat64 sdl_stat;
54#define sdl_readdir readdir64
55#define sdl_stat_fn stat64
5356#endif
57
58#define HAS_DT_XXX defined(SDLMAME_LINUX) || defined(SDLMAME_BSD) || defined(SDLMAME_DARWIN)
59
60struct _osd_directory
61{
62   osd_directory_entry ent;
63   sdl_dirent *data;
5464   DIR *fd;
5565   char *path;
5666};
r7356r7357
6171   char *p = ret;
6272
6373   strcpy(p, path);
64   p += strlen(path);   
74   p += strlen(path);
6575   *p++ = PATHSEPCH;
6676   strcpy(p, file);
67   return ret;
77   return ret;
6878}
6979
7080
71#if defined (SDLMAME_LINUX) || defined (SDLMAME_BSD) || defined(SDLMAME_DARWIN)
81#if HAS_DT_XXX
7282static osd_dir_entry_type get_attributes_enttype(int attributes)
7383{
7484   if (attributes == DT_DIR)
r7356r7357
8090
8191static osd_dir_entry_type get_attributes_stat(const char *file)
8292{
83#if defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_OS2)
84   struct stat st;
85   if(stat(file, &st))
93   sdl_stat st;
94   if(sdl_stat_fn(file, &st))
8695      return (osd_dir_entry_type) 0;
87#else
88   struct stat64 st;
89   if(stat64(file, &st))
90      return ENTTYPE_NONE;
91#endif
9296
9397   if (S_ISDIR(st.st_mode))
9498      return ENTTYPE_DIR;
r7356r7357
99103
100104static UINT64 osd_get_file_size(const char *file)
101105{
102#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
103   struct stat st;
104   if(stat(file, &st))
106   sdl_stat st;
107   if(sdl_stat_fn(file, &st))
105108      return 0;
106#else
107   struct stat64 st;
108   if(stat64(file, &st))
109      return 0;
110#endif
111109   return st.st_size;
112110}
113111
r7356r7357
186184const osd_directory_entry *osd_readdir(osd_directory *dir)
187185{
188186   char *temp;
189   #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
190   dir->data = readdir(dir->fd);
191   #else
192   dir->data = readdir64(dir->fd);
193   #endif
187   dir->data = sdl_readdir(dir->fd);
194188
195189   if (dir->data == NULL)
196190      return NULL;
197191
198192   dir->ent.name = dir->data->d_name;
199193   temp = build_full_path(dir->path, dir->data->d_name);
200   #if defined (SDLMAME_LINUX) || defined (SDLMAME_BSD) || defined(SDLMAME_DARWIN)
194   #if HAS_DT_XXX
201195   dir->ent.type = get_attributes_enttype(dir->data->d_type);
202196   #else
203197   dir->ent.type = get_attributes_stat(temp);
src/osd/sdl/texcopy.c
r7356r7357
4545#else
4646
4747
48static int clamp[256+128+128] = { 255 };
48static int clamp_lu[256+128+128] = { 255 };
4949static int coff_cr[256][2] = {  {0, 0} };
5050static int coff_cb[256][2] = { {0, 0} };
5151
r7356r7357
5454   int i;
5555   for (i=0;i<128;i++)
5656   {
57      clamp[i] = 0;
58      clamp[i + 256 + 128] = 255;
57      clamp_lu[i] = 0;
58      clamp_lu[i + 256 + 128] = 255;
5959   }
6060   for (i=0;i<256;i++)
6161   {
62      clamp[i + 128] = i;
62      clamp_lu[i + 128] = i;
6363
6464      coff_cr[i][0] =              + 409 * i     - 56992;
6565      coff_cr[i][1] =              - 208 * i;
r7356r7357
6868   }
6969}
7070
71INLINE int CLSH(int x)   {   return (const int) clamp[(x >> 8) + 128] ; }
71INLINE int clamp(int x)   {   return (const int) clamp_lu[(x >> 8) + 128] ; }
7272
7373INLINE UINT32 ycc_to_rgb(unsigned y, unsigned cb, unsigned cr)
7474{
r7356r7357
7878   r = (const int) coff_cr[cr][0]; //             409 * cr - 56992;
7979   g = (const int) coff_cb[cb][0] + (const int) coff_cr[cr][1]; //- 100 * cb - 208 * cr + 34784;
8080   b = (const int) coff_cb[cb][1]; //+ 516 * cb - 70688;
81   return 0xff000000 | (CLSH(r + common)<<16) | (CLSH(g + common)<<8) | (CLSH(b + common));
81   return 0xff000000 | (clamp(r + common)<<16) | (clamp(g + common)<<8) | (clamp(b + common));
8282}
8383
8484#endif
r7356r7357
135135   UINT32 *dst;
136136   UINT16 *src;
137137
138   if (clamp[0]>0)
138   if (clamp_lu[0]>0)
139139      init_clamp();
140140
141141   // loop over Y
r7356r7357
176176   UINT16 *src;
177177   int lookup[256];
178178
179   if (clamp[0]>0)
179   if (clamp_lu[0]>0)
180180      init_clamp();
181181
182182   /* preprocess lookup */
r7356r7357
212212         int y2 = (const int) lookup[(srcpix1 >> 8)];
213213
214214
215         *dst++ = 0xff000000 | (CLSH(r + y1)<<16) | (CLSH(g + y1)<<8) | (CLSH(b + y1));
216         *dst++ = 0xff000000 | (CLSH(r + y2)<<16) | (CLSH(g + y2)<<8) | (CLSH(b + y2));
215         *dst++ = 0xff000000 | (clamp(r + y1)<<16) | (clamp(g + y1)<<8) | (clamp(b + y1));
216         *dst++ = 0xff000000 | (clamp(r + y2)<<16) | (clamp(g + y2)<<8) | (clamp(b + y2));
217217#endif
218218      }
219219
r7356r7357
224224      #endif
225225   }
226226}
227#undef CLSH
228227
229228#endif
230229
src/osd/sdl/input.c
r7356r7357
11161116   // register the mice
11171117   sdlinput_register_mice(machine);
11181118
1119   if (machine->debug_flags & DEBUG_FLAG_ENABLED)
1119   if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
11201120   {
11211121      mame_printf_warning("Debug Build: Disabling input grab for -debug\n");
11221122      mouse_enabled = 0;
r7356r7357
15921592      switch (typedesc->type)
15931593      {
15941594         // configurable UI mode switch
1595         case IPT_UI_TOGGLE_UI:           
1595         case IPT_UI_TOGGLE_UI:
15961596            uimode = (const char *)options_get_string(mame_options(), SDLOPTION_UIMODEKEY);
15971597            if(!strcmp(uimode,"auto")) {
15981598               #if defined(__APPLE__) && defined(__MACH__)
src/osd/sdl/README_SDL13.txt
r7356r7357
55  work.
66- if you are using wine on unix be sure to disable wintab32.dll
77
8Known bugs:
9===========
10
11* SDL1.3/X11: Some compound keys, e.g. "'" are not supported by SDL driver
12* SDL1.3: sdlvideofps does not take -numscreens>1 into account.
13* SDL1.3/WIN32: crashes with -rd d3d
14* SDL1.3/WIN32: resizing does not work
15     
816Build SDL 1.3 from SVN
917======================
1018
src/osd/sdl/window.c
r7356r7357
506506   ASSERT_WINDOW_THREAD();
507507
508508   // if we are in debug mode, never go full screen
509   if (options_get_bool(mame_options(), OPTION_DEBUG))
509   if (window->machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
510510      return NULL;
511511
512512   // If we are going fullscreen (leaving windowed) remember our windowed size
r7356r7357
638638#if (SDL_VERSION_ATLEAST(1,3,0))
639639   // do not do mouse capture if the debugger's enabled to avoid
640640   // the possibility of losing control
641   if (!options_get_bool(mame_options(), OPTION_DEBUG))
641   if (!(machine->debug_flags & DEBUG_FLAG_OSD_ENABLED))
642642   {
643643      //FIXME: SDL1.3: really broken: the whole SDL code
644644      //       will only work correct with relative mouse movements ...
r7356r7357
661661#else
662662   // do not do mouse capture if the debugger's enabled to avoid
663663   // the possibility of losing control
664   if (!options_get_bool(mame_options(), OPTION_DEBUG))
664   if (!(machine->debug_flags & DEBUG_FLAG_OSD_ENABLED))
665665   {
666666      if ( window->fullscreen || sdlinput_should_hide_mouse(machine) )
667667      {
src/osd/osdcore.h
r7356r7357
810810void osd_break_into_debugger(const char *message);
811811
812812
813/*-----------------------------------------------------------------------------
814  MESS specific code below
815-----------------------------------------------------------------------------*/
816
817/*-----------------------------------------------------------------------------
818    osd_get_clipboard_text: retrieves text from the clipboard
819
820    Return value:
821
822        the returned string needs to be free()-ed!
823
824-----------------------------------------------------------------------------*/
825char *osd_get_clipboard_text(void);
826
827
828#ifdef MESS
813829/***************************************************************************
814830    DIRECTORY INTERFACES
815831***************************************************************************/
r7356r7357
854870***************************************************************************/
855871
856872/*-----------------------------------------------------------------------------
857    osd_get_clipboard_text: retrieves text from the clipboard
858
859    Return value:
860
861        the returned string needs to be free()-ed!
862
863-----------------------------------------------------------------------------*/
864char *osd_get_clipboard_text(void);
865
866/*-----------------------------------------------------------------------------
867873    osd_get_volume_name: retrieves the volume name
868874
869875    Parameters:
r7356r7357
876882
877883-----------------------------------------------------------------------------*/
878884const char *osd_get_volume_name(int idx);
885#endif
879886
880887#endif   /* __OSDEPEND_H__ */
src/osd/windows/winmain.c
r7356r7357
339339   const char *stemp;
340340
341341   // thread priority
342   if (!options_get_bool(mame_options(), OPTION_DEBUG))
342   if (!(machine->debug_flags & DEBUG_FLAG_OSD_ENABLED))
343343      SetThreadPriority(GetCurrentThread(), options_get_int(mame_options(), WINOPTION_PRIORITY));
344344
345345   // ensure we get called on the way out
src/osd/windows/video.c
r7356r7357
137137      SetForegroundWindow(win_window_list->hwnd);
138138
139139   // possibly create the debug window, but don't show it yet
140   if (options_get_bool(mame_options(), OPTION_DEBUG))
140   if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
141141      debugwin_init_windows();
142142}
143143
r7356r7357
406406   video_config.numscreens    = options_get_int(mame_options(), WINOPTION_NUMSCREENS);
407407
408408   // if we are in debug mode, never go full screen
409   if (options_get_bool(mame_options(), OPTION_DEBUG))
409   if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
410410      video_config.windowed = TRUE;
411411   stemp                      = options_get_string(mame_options(), WINOPTION_EFFECT);
412412   if (strcmp(stemp, "none") != 0)
src/osd/windows/window.c
r7356r7357
301301   assert(GetCurrentThreadId() == main_threadid);
302302
303303   // possibly kill the debug window
304   if (options_get_bool(mame_options(), OPTION_DEBUG))
304   if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
305305      debugwin_destroy_windows();
306306
307307   // free all the windows
r7356r7357
386386   assert(GetCurrentThreadId() == main_threadid);
387387
388388   // if we're running, disable some parts of the debugger
389   if (ingame && (machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
389   if (ingame && (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0)
390390      debugwin_update_during_game(machine);
391391
392392   // remember the last time we did this
r7356r7357
514514   assert(GetCurrentThreadId() == main_threadid);
515515
516516   // if we are in debug mode, never go full screen
517   if (options_get_bool(mame_options(), OPTION_DEBUG))
518      return;
517   for (window = win_window_list; window != NULL; window = window->next)
518      if (window->machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
519         return;
519520
520521   // toggle the window mode
521522   video_config.windowed = !video_config.windowed;
src/emu/debug/debugcpu.c
r7356r7357
2424#include "express.h"
2525#include "debugvw.h"
2626#include "debugger.h"
27#include "debugint/debugint.h"
2728#include "uiinput.h"
2829#include <ctype.h>
2930
r7356r7357
674675
675676         /* clear the memory modified flag and wait */
676677         global->memory_modified = FALSE;
677         osd_wait_for_debugger(device, firststop);
678         if (device->machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
679            osd_wait_for_debugger(device, firststop);
680         else if (device->machine->debug_flags & DEBUG_FLAG_ENABLED)
681            debugint_wait_for_debugger(device, firststop);
678682         firststop = FALSE;
679683
680684         /* if something modified memory, update the screen */
r7356r7357
20002004   running_machine *machine = device->machine;
20012005   debugcpu_private *global = machine->debugcpu_data;
20022006
2003   /* clear out all global flags by default */
2004   machine->debug_flags = DEBUG_FLAG_ENABLED;
2007   /* clear out global flags by default, keep DEBUG_FLAG_OSD_ENABLED */
2008   machine->debug_flags &= DEBUG_FLAG_OSD_ENABLED;
2009   machine->debug_flags |= DEBUG_FLAG_ENABLED;
20052010
20062011   /* if we are ignoring this CPU, or if events are pending, we're done */
20072012   if ((info->flags & DEBUG_FLAG_OBSERVING) == 0 || mame_is_scheduled_event_pending(machine) || mame_is_save_or_load_pending(machine))
src/emu/cpu/am29000/am29000.c
r7356r7357
274274   {
275275      fatalerror("Am29000 instruction MMU translation enabled!");
276276   }
277   return 0;
277278}
278279
279280/***************************************************************************
src/emu/cpu/mcs48/mcs48.h
r7356r7357
116116***************************************************************************/
117117
118118/* Official Intel MCS-48 parts */
119CPU_GET_INFO( i8021 );         /* 1k internal ROM,       64 bytes internal RAM */
120CPU_GET_INFO( i8022 );         /* 2k internal ROM,      128 bytes internal RAM */
119CPU_GET_INFO( i8021 );         /* 1k internal ROM,      64 bytes internal RAM */
120CPU_GET_INFO( i8022 );         /* 2k internal ROM,     128 bytes internal RAM */
121121CPU_GET_INFO( i8035 );         /* external ROM,         64 bytes internal RAM */
122122CPU_GET_INFO( i8048 );         /* 1k internal ROM,      64 bytes internal RAM */
123123CPU_GET_INFO( i8648 );         /* 1k internal OTP ROM,  64 bytes internal RAM */
src/emu/cpu/cpu.mak
r7356r7357
12361236
12371237
12381238#-------------------------------------------------
1239# Panasonic MN10200
1240#-------------------------------------------------
1241
1242ifneq ($(filter MN10200,$(CPUS)),)
1243OBJDIRS += $(CPUOBJ)/mn10200
1244CPUOBJS += $(CPUOBJ)/mn10200/mn10200.o
1245DASMOBJS += $(CPUOBJ)/mn10200/mn102dis.o
1246endif
1247
1248$(CPUOBJ)/mn10200/mn10200.o:   $(CPUSRC)/mn10200/mn10200.c \
1249                        $(CPUSRC)/mn10200/mn10200.h
1250
1251
1252#-------------------------------------------------
12391253# Saturn
12401254#-------------------------------------------------
12411255
src/emu/cpu/i386/i386op16.c
r7356r7357
28132813{
28142814   UINT32 address, ea;
28152815   UINT8 modrm = FETCH(cpustate);
2816   I386_SREG seg;
28172816
28182817   switch( (modrm >> 3) & 0x7 )
28192818   {
r7356r7357
28652864               CYCLES(cpustate,CYCLES_LLDT_MEM);
28662865            }
28672866            cpustate->ldtr.segment = READ16(cpustate,ea);
2868            memset(&seg, 0, sizeof(seg));
2869            seg.selector = cpustate->ldtr.segment;
2870            i386_load_protected_mode_segment(cpustate,&seg);
2871            cpustate->ldtr.limit = seg.limit;
2872            cpustate->ldtr.base = seg.base;
28732867         }
28742868         else
28752869         {
src/emu/cpu/i386/i386op32.c
r7356r7357
26522652{
26532653   UINT32 address, ea;
26542654   UINT8 modrm = FETCH(cpustate);
2655   I386_SREG seg;
26562655
26572656   switch( (modrm >> 3) & 0x7 )
26582657   {
r7356r7357
27042703               CYCLES(cpustate,CYCLES_LLDT_MEM);
27052704            }
27062705            cpustate->ldtr.segment = READ32(cpustate,ea);
2707            memset(&seg, 0, sizeof(seg));
2708            seg.selector = cpustate->ldtr.segment;
2709            i386_load_protected_mode_segment(cpustate,&seg);
2710            cpustate->ldtr.limit = seg.limit;
2711            cpustate->ldtr.base = seg.base;
27122706         }
27132707         else
27142708         {
src/emu/cpu/mn10200/mn10200.h
r0r7357
1/*
2    Panasonic MN10200 emulator
3
4    Written by Olivier Galibert
5    MAME conversion by R. Belmont
6
7*/
8
9#pragma once
10
11#ifndef MN10200_H
12#define MN10200_H
13
14enum
15{
16   MN10200_PC,
17   MN10200_PSW,
18   MN10200_MDR,
19   MN10200_D0,
20   MN10200_D1,
21   MN10200_D2,
22   MN10200_D3,
23   MN10200_A0,
24   MN10200_A1,
25   MN10200_A2,
26   MN10200_A3,
27   MN10200_NMICR,
28   MN10200_IAGR
29};
30
31enum
32{
33   MN10200_PORT0,
34   MN10200_PORT1,
35   MN10200_PORT2,
36   MN10200_PORT3,
37   MN10200_PORT4
38};
39
40CPU_GET_INFO( mn10200 );
41#define CPU_MN10200 CPU_GET_INFO_NAME( mn10200 )
42
43CPU_DISASSEMBLE( mn10200 );
44
45#endif
src/emu/cpu/mn10200/mn10200.c
r0r7357
1/*
2    Panasonic MN10200 emulator
3
4    Written by Olivier Galibert
5    MAME conversion by R. Belmont
6
7*/
8
9#include "emu.h"
10#include "debugger.h"
11#include "mn10200.h"
12
13#define log_write(...)
14#define log_event(...)
15
16#define MEM_BYTE (0)
17#define MEM_WORD (1)
18
19extern int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom);
20
21typedef struct _mn102_info mn102_info;
22struct _mn102_info
23{
24   // The UINT32s are really UINT24
25   UINT32 pc;
26   UINT32 d[4];
27   UINT32 a[4];
28
29   UINT8 nmicr, iagr;
30   UINT8 icrl[31], icrh[31];
31   UINT16 psw;
32   UINT16 mdr;
33
34   struct {
35   UINT8 mode;
36   UINT8 base;
37   UINT8 cur;
38   } simple_timer[10];
39
40   struct {
41   UINT8 mode;
42   UINT8 base;
43   UINT8 cur;
44   } prescaler[2];
45
46   struct {
47   UINT32 adr;
48   UINT32 count;
49   UINT16 iadr;
50   UINT8 ctrll, ctrlh, irq;
51   } dma[8];
52
53   struct {
54   UINT8 ctrll, ctrlh;
55   UINT8 buf;
56   } serial[2];
57
58   UINT8 ddr[8];
59
60   int cycles;
61
62   running_device *device;
63   const address_space *program;
64   const address_space *io;
65};
66
67static void mn10200_w(mn102_info *mn102, UINT32 adr, UINT32 data, int type);
68static UINT32 mn10200_r(mn102_info *mn102, UINT32 adr, int type);
69
70INLINE UINT8 mn102_read_byte(mn102_info *mn102, UINT32 address)
71{
72   if (address >= 0xfc00 && address < 0x10000)
73   {
74      return mn10200_r(mn102, address-0xfc00, MEM_BYTE);
75   }
76
77   return memory_read_byte_16le(mn102->program, address);
78}
79
80INLINE UINT16 mn102_read_word(mn102_info *mn102, UINT32 address)
81{
82   if (address >= 0xfc00 && address < 0x10000)
83   {
84      return mn10200_r(mn102, address-0xfc00, MEM_WORD);
85   }
86
87   if (address & 1)
88   {
89      return memory_read_byte_16le(mn102->program, address) | (memory_read_byte_16le(mn102->program, address+1)<<8);
90   }
91
92   return memory_read_word_16le(mn102->program, address);
93}
94
95INLINE void mn102_write_byte(mn102_info *mn102, UINT32 address, UINT8 data)
96{
97   if (address >= 0xfc00 && address < 0x10000)
98   {
99      mn10200_w(mn102, address-0xfc00, data, MEM_BYTE);
100      return;
101   }
102
103   memory_write_byte_16le(mn102->program, address, data);
104}
105
106INLINE void mn102_write_word(mn102_info *mn102, UINT32 address, UINT16 data)
107{
108   if (address >= 0xfc00 && address < 0x10000)
109   {
110      mn10200_w(mn102, address-0xfc00, data, MEM_WORD);
111      return;
112   }
113
114   if (address & 1)
115   {
116      memory_write_byte_16le(mn102->program, address, data&0xff);
117      memory_write_byte_16le(mn102->program, address+1, (data>>8)&0xff);
118      return;
119   }
120
121   memory_write_word_16le(mn102->program, address, data);
122}
123
124INLINE mn102_info *get_safe_token(running_device *device)
125{
126   assert(device != NULL);
127   assert(device->token != NULL);
128   assert(device->type == CPU);
129   assert(cpu_get_type(device) == CPU_MN10200);
130
131   return (mn102_info *)device->token;
132}
133
134static CPU_INIT(mn10200)
135{
136   mn102_info *cpustate = get_safe_token(device);
137
138   memset(cpustate, 0, sizeof(mn102_info));
139
140   cpustate->device = device;
141   cpustate->program = device->space(AS_PROGRAM);
142   cpustate->io = device->space(AS_IO);
143}
144
145static CPU_RESET(mn10200)
146{
147   mn102_info *cpustate = get_safe_token(device);
148
149   memset(cpustate->d, 0, sizeof(cpustate->d));
150   memset(cpustate->a, 0, sizeof(cpustate->a));
151   cpustate->pc = 0x80000;
152   cpustate->psw = 0;
153   cpustate->nmicr = 0;
154   memset(cpustate->icrl, 0, sizeof(cpustate->icrl));
155   memset(cpustate->icrh, 0, sizeof(cpustate->icrh));
156}
157
158static CPU_EXIT(mn10200)
159{
160}
161
162static void unemul(mn102_info *mn102)
163{
164   fatalerror("MN10200: unknown opcode @ PC=%x\n", mn102->pc);
165}
166
167INLINE INT32 r24u(mn102_info *mn102, offs_t adr)
168{
169   return mn102_read_word(mn102, adr)|(mn102_read_byte(mn102, adr+2)<<16);
170}
171
172INLINE void w24(mn102_info *mn102, offs_t adr, UINT32 val)
173{
174   if(adr == 0x4075aa || adr == 0x40689a || adr == 0x4075a2)
175   log_write("TRACE", adr, val, MEM_LONG);
176   mn102_write_byte(mn102, adr, val);
177   mn102_write_byte(mn102, adr+1, val>>8);
178   mn102_write_byte(mn102, adr+2, val>>16);
179}
180
181static UINT32 do_add(mn102_info *mn102, UINT32 a, UINT32 b)
182{
183   UINT32 r24, r16;
184   r24 = (a & 0xffffff) + (b & 0xffffff);
185   r16 = (a & 0xffff)   + (b & 0xffff);
186
187   mn102->psw &= 0xff00;
188   if((~(a^b)) & (a^r24) & 0x00800000)
189   mn102->psw |= 0x80;
190   if(r24 & 0x01000000)
191   mn102->psw |= 0x40;
192   if(r24 & 0x00800000)
193   mn102->psw |= 0x20;
194   if(!(r24 & 0x00ffffff))
195   mn102->psw |= 0x10;
196   if((~(a^b)) & (a^r16) & 0x00008000)
197   mn102->psw |= 0x08;
198   if(r16 & 0x00010000)
199   mn102->psw |= 0x04;
200   if(r16 & 0x00008000)
201   mn102->psw |= 0x02;
202   if(!(r16 & 0x0000ffff))
203   mn102->psw |= 0x01;
204   return r24 & 0xffffff;
205}
206
207static UINT32 do_addc(mn102_info *mn102, UINT32 a, UINT32 b)
208{
209   UINT32 r24, r16;
210   r24 = (a & 0xffffff) + (b & 0xffffff);
211   r16 = (a & 0xffff)   + (b & 0xffff);
212
213   if(mn102->psw & 0x04) {
214   r24++;
215   r16++;
216   }
217
218   mn102->psw &= 0xff00;
219   if((~(a^b)) & (a^r24) & 0x00800000)
220   mn102->psw |= 0x80;
221   if(r24 & 0x01000000)
222   mn102->psw |= 0x40;
223   if(r24 & 0x00800000)
224   mn102->psw |= 0x20;
225   if(!(r24 & 0x00ffffff))
226   mn102->psw |= 0x10;
227   if((~(a^b)) & (a^r16) & 0x00008000)
228   mn102->psw |= 0x08;
229   if(r16 & 0x00010000)
230   mn102->psw |= 0x04;
231   if(r16 & 0x00008000)
232   mn102->psw |= 0x02;
233   if(!(r16 & 0x0000ffff))
234   mn102->psw |= 0x01;
235   return r24 & 0xffffff;
236}
237
238static UINT32 do_sub(mn102_info *mn102, UINT32 a, UINT32 b)
239{
240   UINT32 r24, r16;
241   r24 = (a & 0xffffff) - (b & 0xffffff);
242   r16 = (a & 0xffff)   - (b & 0xffff);
243
244   mn102->psw &= 0xff00;
245   if((a^b) & (a^r24) & 0x00800000)
246      mn102->psw |= 0x80;
247   if(r24 & 0x01000000)
248      mn102->psw |= 0x40;
249   if(r24 & 0x00800000)
250      mn102->psw |= 0x20;
251   if(!(r24 & 0x00ffffff))
252      mn102->psw |= 0x10;
253   if((a^b) & (a^r16) & 0x00008000)
254      mn102->psw |= 0x08;
255   if(r16 & 0x00010000)
256      mn102->psw |= 0x04;
257   if(r16 & 0x00008000)
258      mn102->psw |= 0x02;
259   if(!(r16 & 0x0000ffff))
260      mn102->psw |= 0x01;
261   return r24 & 0xffffff;
262}
263
264static UINT32 do_subc(mn102_info *mn102, UINT32 a, UINT32 b)
265{
266   UINT32 r24, r16;
267   r24 = (a & 0xffffff) - (b & 0xffffff);
268   r16 = (a & 0xffff)   - (b & 0xffff);
269
270   if(mn102->psw & 0x04) {
271   r24--;
272   r16--;
273   }
274
275   mn102->psw &= 0xff00;
276   if(r24 >= 0x00800000 && r24 < 0xff800000)
277      mn102->psw |= 0x80;
278   if(r24 & 0x01000000)
279      mn102->psw |= 0x40;
280   if(r24 & 0x00800000)
281      mn102->psw |= 0x20;
282   if(!(r24 & 0x00ffffff))
283      mn102->psw |= 0x10;
284   if(r16 >= 0x00008000 && r16 < 0xffff8000)
285      mn102->psw |= 0x08;
286   if(r16 & 0x00010000)
287      mn102->psw |= 0x04;
288   if(r16 & 0x00008000)
289      mn102->psw |= 0x02;
290   if(!(r16 & 0x0000ffff))
291      mn102->psw |= 0x01;
292   return r24 & 0xffffff;
293}
294
295INLINE void test_nz16(mn102_info *mn102, UINT16 v)
296{
297   mn102->psw &= 0xfff0;
298   if(v & 0x8000)
299      mn102->psw |= 2;
300   if(!v)
301      mn102->psw |= 1;
302}
303
304INLINE void mn102_change_pc(mn102_info *mn102, UINT32 pc)
305{
306    mn102->pc = pc & 0xffffff;
307}
308
309INLINE void do_jsr(mn102_info *mn102, UINT32 to, UINT32 ret)
310{
311   mn102_change_pc(mn102, to & 0xffffff);
312   mn102->a[3] -= 4;
313   w24(mn102, mn102->a[3], ret);
314}
315
316#if 0
317  log_event("MN102", "PSW change S=%d irq=%s im=%d %c%c%c%c %c%c%c%c",
318       (psw >> 12) & 3,
319       psw & 0x0800 ? "on" : "off",
320       (psw >> 8) & 7,
321       psw & 0x0080 ? 'V' : '-',
322       psw & 0x0040 ? 'C' : '-',
323       psw & 0x0020 ? 'N' : '-',
324       psw & 0x0010 ? 'Z' : '-',
325       psw & 0x0008 ? 'v' : '-',
326       psw & 0x0004 ? 'c' : '-',
327       psw & 0x0002 ? 'n' : '-',
328       psw & 0x0001 ? 'z' : '-');
329#endif
330
331void mn102_force_irq(mn102_info *mn102, int level, int group, int entry)
332{
333   if(!(mn102->psw & 0x800))
334   {
335      if(group != 1 || entry != 3)
336         log_event("MN102", "Dropping irq %d %d %d, pc=%x, a3=%x", level, group, entry, mn102->pc, mn102->a[3]);
337      return;
338   }
339
340   if(group != 1 || entry != 3)
341      log_event("MN102", "Taking irq %d %d %d, pc=%x, a3=%x", level, group, entry, mn102->pc, mn102->a[3]);
342   mn102->a[3] -= 6;
343   w24(mn102, mn102->a[3]+2, mn102->pc);
344   mn102_write_word(mn102, mn102->a[3], mn102->psw);
345   mn102_change_pc(mn102, 0x80008);
346   mn102->psw = (mn102->psw & 0xf0ff) | (level << 8);
347   mn102->iagr = group << 1;
348   if(group != 0)
349      mn102->icrl[group-1] |= 1 << entry;
350}
351
352static CPU_EXECUTE(mn10200)
353{
354   mn102_info *mn102 = get_safe_token(device);
355
356   mn102->cycles = cycles;
357
358   while(mn102->cycles > 0)
359   {
360      UINT8 opcode;
361
362      debugger_instruction_hook(device, mn102->pc);
363
364      opcode = mn102_read_byte(mn102, mn102->pc);
365      switch(opcode) {
366      // mov dm, (an)
367      case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07:
368      case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f:
369         mn102->cycles -= 1;
370         mn102_write_word(mn102, mn102->a[(opcode>>2)&3], (UINT16)mn102->d[opcode & 3]);
371         mn102->pc += 1;
372         break;
373
374      // movb dm, (an)
375      case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
376      case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f:
377         mn102->cycles -= 1;
378         mn102_write_byte(mn102, mn102->a[(opcode>>2)&3], (UINT8)mn102->d[opcode & 3]);
379         mn102->pc += 1;
380         break;
381
382      // mov (an), dm
383      case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27:
384      case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f:
385         mn102->cycles -= 1;
386         mn102->d[opcode & 3] = (INT16)mn102_read_word(mn102, mn102->a[(opcode>>2)&3]);
387         mn102->pc += 1;
388         break;
389
390      // movbu (an), dm
391      case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37:
392      case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f:
393         mn102->cycles -= 1;
394         mn102->d[opcode & 3] = mn102_read_byte(mn102, mn102->a[(opcode>>2)&3]);
395         mn102->pc += 1;
396         break;
397
398      // mov dm, (d8, an)
399      case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47:
400      case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f:
401         mn102->cycles -= 1;
402         mn102_write_word(mn102, (mn102->a[(opcode>>2)&3]+(INT8)mn102_read_byte(mn102, mn102->pc+1)) & 0xffffff, (UINT16)mn102->d[opcode & 3]);
403         mn102->pc += 2;
404         break;
405
406      // mov am, (d8, an)
407      case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57:
408      case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f:
409         mn102->cycles -= 2;
410         w24(mn102, (mn102->a[(opcode>>2)&3]+(INT8)mn102_read_byte(mn102, mn102->pc+1)) & 0xffffff, mn102->a[opcode & 3]);
411         mn102->pc += 2;
412         break;
413
414      // mov (d8, an), dm
415      case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67:
416      case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f:
417         mn102->cycles -= 1;
418         mn102->d[opcode & 3] = (INT16)mn102_read_word(mn102, (mn102->a[(opcode>>2) & 3] + (INT8)mn102_read_byte(mn102, mn102->pc+1)) & 0xffffff);
419         mn102->pc += 2;
420         break;
421
422      // mov (d8, an), am
423      case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77:
424      case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f:
425         mn102->cycles -= 2;
426         mn102->a[opcode & 3] = r24u(mn102, (mn102->a[(opcode>>2) & 3] + (INT8)mn102_read_byte(mn102, mn102->pc+1)) & 0xffffff);
427         mn102->pc += 2;
428         break;
429
430      // mov dm, dn
431      case 0x81: case 0x82: case 0x83: case 0x84: case 0x86: case 0x87:
432      case 0x88: case 0x89: case 0x8b: case 0x8c: case 0x8d: case 0x8e:
433         mn102->cycles -= 1;
434         mn102->d[opcode & 3] = mn102->d[(opcode>>2) & 3];
435         mn102->pc += 1;
436         break;
437
438      // mov imm8, dn
439      case 0x80: case 0x85: case 0x8a: case 0x8f:
440         mn102->cycles -= 1;
441         mn102->d[opcode & 3] = (INT8)mn102_read_byte(mn102, mn102->pc+1);
442         mn102->pc += 2;
443         break;
444
445      // add dn, dm
446      case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97:
447      case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
448         mn102->cycles -= 1;
449         mn102->d[opcode & 3] = do_add(mn102, mn102->d[opcode & 3], mn102->d[(opcode >> 2) & 3]);
450         mn102->pc += 1;
451         break;
452
453      // sub dn, dm
454      case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7:
455      case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf:
456         mn102->cycles -= 1;
457         mn102->d[opcode & 3] = do_sub(mn102, mn102->d[opcode & 3], mn102->d[(opcode >> 2) & 3]);
458         mn102->pc += 1;
459         break;
460
461      // extx dn
462      case 0xb0: case 0xb1: case 0xb2: case 0xb3:
463         mn102->cycles -= 1;
464         mn102->d[opcode & 3] = (INT16)mn102->d[opcode & 3] & 0xffffff;
465         mn102->pc += 1;
466         break;
467
468      // extxu dn
469      case 0xb4: case 0xb5: case 0xb6: case 0xb7:
470         mn102->cycles -= 1;
471         mn102->d[opcode & 3] = (UINT16)mn102->d[opcode & 3];
472         mn102->pc += 1;
473         break;
474
475      // extxb dn
476      case 0xb8: case 0xb9: case 0xba: case 0xbb:
477         mn102->cycles -= 1;
478         mn102->d[opcode & 3] = (INT8)mn102->d[opcode & 3] & 0xffffff;
479         mn102->pc += 1;
480         break;
481
482      // extxbu dn
483      case 0xbc: case 0xbd: case 0xbe: case 0xbf:
484         mn102->cycles -= 1;
485         mn102->d[opcode & 3] = (UINT8)mn102->d[opcode & 3];
486         mn102->pc += 1;
487         break;
488
489      // mov dn, (imm16)
490      case 0xc0: case 0xc1: case 0xc2: case 0xc3:
491         mn102->cycles -= 2;
492         mn102_write_word(mn102, mn102_read_word(mn102, mn102->pc+1), (UINT16)mn102->d[opcode & 3]);
493         mn102->pc += 3;
494         break;
495
496      // movb dn, (imm16)
497      case 0xc4: case 0xc5: case 0xc6: case 0xc7:
498         mn102->cycles -= 1;
499         mn102_write_byte(mn102, mn102_read_word(mn102, mn102->pc+1), (UINT8)mn102->d[opcode & 3]);
500         mn102->pc += 3;
501         break;
502
503      // mov (abs16), dn
504      case 0xc8: case 0xc9: case 0xca: case 0xcb:
505         mn102->cycles -= 1;
506         mn102->d[opcode & 3] = (INT16)mn102_read_word(mn102, mn102_read_word(mn102, mn102->pc+1));
507         mn102->pc += 3;
508         break;
509
510      // movbu (abs16), dn
511      case 0xcc: case 0xcd: case 0xce: case 0xcf:
512         mn102->cycles -= 2;
513         mn102->d[opcode & 3] = mn102_read_byte(mn102, mn102_read_word(mn102, mn102->pc+1));
514         mn102->pc += 3;
515         break;
516
517      // add imm8, an
518      case 0xd0: case 0xd1: case 0xd2: case 0xd3:
519         mn102->cycles -= 1;
520         mn102->a[opcode & 3] = do_add(mn102, mn102->a[opcode & 3], (INT8)mn102_read_byte(mn102, mn102->pc+1));
521         mn102->pc += 2;
522         break;
523
524      // add imm8, dn
525      case 0xd4: case 0xd5: case 0xd6: case 0xd7:
526         mn102->cycles -= 1;
527         mn102->d[opcode & 3] = do_add(mn102, mn102->d[opcode & 3], (INT8)mn102_read_byte(mn102, mn102->pc+1));
528         mn102->pc += 2;
529         break;
530
531      // cmp imm8, dn
532      case 0xd8: case 0xd9: case 0xda: case 0xdb:
533         mn102->cycles -= 1;
534         do_sub(mn102, mn102->d[opcode & 3], (INT8)mn102_read_byte(mn102, mn102->pc+1));
535         mn102->pc += 2;
536         break;
537
538      // mov imm16, an
539      case 0xdc: case 0xdd: case 0xde: case 0xdf:
540         mn102->cycles -= 1;
541         mn102->a[opcode & 3] = mn102_read_word(mn102, mn102->pc+1);
542         mn102->pc += 3;
543         break;
544
545      // blt label8
546      case 0xe0:
547         if(((mn102->psw & 0x0a) == 2) || ((mn102->psw & 0x0a) == 8))
548         {
549            mn102->cycles -= 2;
550            mn102_change_pc(mn102, mn102->pc+2+(INT8)mn102_read_byte(mn102, mn102->pc+1));
551         }
552         else
553         {
554            mn102->cycles -= 1;
555            mn102->pc += 2;
556         }
557         break;
558
559      // bgt label8
560      case 0xe1:
561         if(((mn102->psw & 0x0b) == 0) || ((mn102->psw & 0x0b) == 0xa))
562         {
563            mn102->cycles -= 2;
564            mn102_change_pc(mn102, mn102->pc+2+(INT8)mn102_read_byte(mn102, mn102->pc+1));
565         }
566         else
567         {
568            mn102->cycles -= 1;
569            mn102->pc += 2;
570         }
571         break;
572
573      // bge label8
574      case 0xe2:
575         if(((mn102->psw & 0x0a) == 0) || ((mn102->psw & 0x0a) == 0xa))
576         {
577            mn102->cycles -= 2;
578            mn102_change_pc(mn102, mn102->pc+2+(INT8)mn102_read_byte(mn102, mn102->pc+1));
579         }
580         else
581         {
582            mn102->cycles -= 1;
583            mn102->pc += 2;
584         }
585         break;
586
587      // ble label8
588      case 0xe3:
589         if((mn102->psw & 0x01) || ((mn102->psw & 0x0a) == 2) || ((mn102->psw & 0x0a) == 8))
590         {
591            mn102->cycles -= 2;
592            mn102_change_pc(mn102, mn102->pc+2+(INT8)mn102_read_byte(mn102, mn102->pc+1));
593         }
594         else
595         {
596         mn102->cycles -= 1;
597         mn102->pc += 2;
598         }
599         break;
600
601      // bcs label8
602      case 0xe4:
603         if(mn102->psw & 0x04)
604         {
605            mn102->cycles -= 2;
606            mn102_change_pc(mn102, mn102->pc+2+(INT8)mn102_read_byte(mn102, mn102->pc+1));
607         }
608         else
609         {
610            mn102->cycles -= 1;
611            mn102->pc += 2;
612         }
613         break;
614
615      // bhi label8
616      case 0xe5:
617         if(!(mn102->psw & 0x05))
618         {
619            mn102->cycles -= 2;
620            mn102_change_pc(mn102, mn102->pc+2+(INT8)mn102_read_byte(mn102, mn102->pc+1));
621         }
622         else
623         {
624            mn102->cycles -= 1;
625            mn102->pc += 2;
626         }
627         break;
628
629      // bcc label8
630      case 0xe6:
631         if(!(mn102->psw & 0x04))
632         {
633            mn102->cycles -= 2;
634            mn102_change_pc(mn102, mn102->pc+2+(INT8)mn102_read_byte(mn102, mn102->pc+1));
635         }
636         else
637         {
638            mn102->cycles -= 1;
639            mn102->pc += 2;
640         }
641         break;
642
643      // bls label8
644      case 0xe7:
645         if(mn102->psw & 0x05)
646         {
647            mn102->cycles -= 2;
648            mn102_change_pc(mn102, mn102->pc+2+(INT8)mn102_read_byte(mn102, mn102->pc+1));
649         }
650         else
651         {
652            mn102->cycles -= 1;
653            mn102->pc += 2;
654         }
655         break;
656
657      // beq label8
658      case 0xe8:
659         if(mn102->psw & 0x01)
660         {
661            mn102->cycles -= 2;
662            mn102_change_pc(mn102, mn102->pc+2+(INT8)mn102_read_byte(mn102, mn102->pc+1));
663         }
664         else
665         {
666            mn102->cycles -= 1;
667            mn102->pc += 2;
668         }
669         break;
670
671      // bne label8
672      case 0xe9:
673         if(!(mn102->psw & 0x01))
674         {
675            mn102->cycles -= 2;
676            mn102_change_pc(mn102, mn102->pc+2+(INT8)mn102_read_byte(mn102, mn102->pc+1));
677         }
678         else
679         {
680            mn102->cycles -= 1;
681            mn102->pc += 2;
682         }
683         break;
684
685      // bra label8
686      case 0xea:
687         mn102->cycles -= 2;
688         mn102_change_pc(mn102, mn102->pc+2+(INT8)mn102_read_byte(mn102, mn102->pc+1));
689         break;
690
691      // rti
692      case 0xeb:
693         mn102->cycles -= 6;
694         mn102->psw = mn102_read_word(mn102, mn102->a[3]);
695         mn102_change_pc(mn102, r24u(mn102, mn102->a[3]+2));
696         mn102->a[3] += 6;
697         break;
698
699      // cmp imm16, an
700      case 0xec: case 0xed: case 0xee: case 0xef:
701         mn102->cycles -= 1;
702         do_sub(mn102, mn102->a[opcode & 3], mn102_read_word(mn102, mn102->pc+1));
703         mn102->pc += 3;
704         break;
705
706      case 0xf0:
707         opcode = mn102_read_byte(mn102, mn102->pc+1);
708         switch(opcode) {
709            // jmp (an)
710            case 0x00: case 0x04: case 0x08: case 0x0c:
711            mn102->cycles -= 3;
712            mn102_change_pc(mn102, mn102->a[(opcode>>2) & 3]);
713            break;
714
715            // jsr (an)
716            case 0x01: case 0x05: case 0x09: case 0x0d:
717            mn102->cycles -= 5;
718            do_jsr(mn102, mn102->a[(opcode>>2) & 3], mn102->pc+2);
719            break;
720
721            // bset dm, (an)
722            case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27:
723            case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: {
724            UINT8 v;
725            mn102->cycles -= 5;
726            v = mn102_read_byte(mn102, mn102->a[(opcode>>2) & 3]);
727            test_nz16(mn102, v & mn102->d[opcode & 3]);
728            mn102_write_byte(mn102, mn102->a[(opcode>>2) & 3], v | mn102->d[opcode & 3]);
729            mn102->pc += 2;
730            break;
731            }
732
733            // bclr dm, (an)
734            case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37:
735            case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f: {
736            UINT8 v;
737            mn102->cycles -= 5;
738            v = mn102_read_byte(mn102, mn102->a[(opcode>>2) & 3]);
739            test_nz16(mn102, v & mn102->d[opcode & 3]);
740            mn102_write_byte(mn102, mn102->a[(opcode>>2) & 3], v & ~mn102->d[opcode & 3]);
741            mn102->pc += 2;
742            break;
743            }
744
745            // movb (di, an), dm
746            case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47:
747            case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f:
748            case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57:
749            case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f:
750            case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67:
751            case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f:
752            case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77:
753            case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f:
754            mn102->cycles -= 2;
755            mn102->d[opcode & 3] = (INT8)mn102_read_byte(mn102, (mn102->a[(opcode>>2) & 3] + mn102->d[(opcode>>4) & 3]) & 0xffffff);
756            mn102->pc += 2;
757            break;
758
759            // movbu (di, an), dm
760            case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87:
761            case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f:
762            case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97:
763            case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
764            case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7:
765            case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf:
766            case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7:
767            case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf:
768            mn102->cycles -= 2;
769            mn102->d[opcode & 3] = mn102_read_byte(mn102, (mn102->a[(opcode>>2) & 3] + mn102->d[(opcode>>4) & 3]) & 0xffffff);
770            mn102->pc += 2;
771            break;
772
773            // movb dm, (di, an)
774            case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7:
775            case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf:
776            case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7:
777            case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf:
778            case 0xe0: case 0xe1: case 0xe2: case 0xe3: case 0xe4: case 0xe5: case 0xe6: case 0xe7:
779            case 0xe8: case 0xe9: case 0xea: case 0xeb: case 0xec: case 0xed: case 0xee: case 0xef:
780            case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7:
781            case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff:
782            mn102->cycles -= 2;
783            mn102_write_byte(mn102, (mn102->a[(opcode>>2) & 3] + mn102->d[(opcode>>4) & 3]) & 0xffffff, mn102->d[opcode & 3]);
784            mn102->pc += 2;
785            break;
786
787            default:
788            unemul(mn102);
789            break;
790         }
791         break;
792
793      case 0xf1:
794         opcode = mn102_read_byte(mn102, mn102->pc+1);
795         switch(opcode>>6) {
796
797            // mov (di, an), am
798            case 0:
799            mn102->cycles -= 3;
800            mn102->a[opcode & 3] = r24u(mn102, (mn102->a[(opcode>>2) & 3] + mn102->d[(opcode>>4) & 3]) & 0xffffff);
801            mn102->pc += 2;
802            break;
803
804            // mov (di, an), dm
805            case 1:
806            mn102->cycles -= 2;
807            mn102->d[opcode & 3] = mn102_read_word(mn102, (mn102->a[(opcode>>2) & 3] + mn102->d[(opcode>>4) & 3]) & 0xffffff);
808            mn102->pc += 2;
809            break;
810
811            // mov am, (di, an)
812            case 2:
813            mn102->cycles -= 3;
814            w24(mn102, (mn102->a[(opcode>>2) & 3] + mn102->d[(opcode>>4) & 3]) & 0xffffff, mn102->a[opcode & 3]);
815            mn102->pc += 2;
816            break;
817
818            // mov dm, (di, an)
819            case 3:
820            mn102->cycles -= 2;
821            mn102_write_word(mn102, (mn102->a[(opcode>>2) & 3] + mn102->d[(opcode>>4) & 3]) & 0xffffff, mn102->d[opcode & 3]);
822            mn102->pc += 2;
823            break;
824
825            default:
826            unemul(mn102);
827            break;
828            }
829         break;
830
831      case 0xf2:
832         opcode = mn102_read_byte(mn102, mn102->pc+1);
833         switch(opcode>>4) {
834            // add dm, an
835            case 0x0:
836            mn102->cycles -= 2;
837            mn102->a[opcode & 3] = do_add(mn102, mn102->a[opcode & 3], mn102->d[(opcode>>2) & 3]);
838            mn102->pc += 2;
839            break;
840
841            // sub dm, an
842            case 0x1:
843            mn102->cycles -= 2;
844            mn102->a[opcode & 3] = do_sub(mn102, mn102->a[opcode & 3], mn102->d[(opcode>>2) & 3]);
845            mn102->pc += 2;
846            break;
847
848            // cmp dm, an
849            case 0x2:
850            mn102->cycles -= 2;
851            do_sub(mn102, mn102->a[opcode & 3], mn102->d[(opcode>>2) & 3]);
852            mn102->pc += 2;
853            break;
854
855            // mov am, dn
856            case 0x3:
857            mn102->cycles -= 2;
858            mn102->a[opcode & 3] = mn102->d[(opcode>>2) & 3];
859            mn102->pc += 2;
860            break;
861
862            // add am, an
863            case 0x4:
864            mn102->cycles -= 2;
865            mn102->a[opcode & 3] = do_add(mn102, mn102->a[opcode & 3], mn102->a[(opcode>>2) & 3]);
866            mn102->pc += 2;
867            break;
868
869            // sub am, an
870            case 0x5:
871            mn102->cycles -= 2;
872            mn102->a[opcode & 3] = do_sub(mn102, mn102->a[opcode & 3], mn102->a[(opcode>>2) & 3]);
873            mn102->pc += 2;
874            break;
875
876            // cmp am, an
877            case 0x6:
878            mn102->cycles -= 2;
879            do_sub(mn102, mn102->a[opcode & 3], mn102->a[(opcode>>2) & 3]);
880            mn102->pc += 2;
881            break;
882
883            // mov am, an
884            case 0x7:
885            mn102->cycles -= 2;
886            mn102->a[opcode & 3] = mn102->a[(opcode>>2) & 3];
887            mn102->pc += 2;
888            break;
889
890            // addc dm, dn
891            case 0x8:
892            mn102->cycles -= 2;
893            mn102->d[opcode & 3] = do_addc(mn102, mn102->d[opcode & 3], mn102->d[(opcode>>2) & 3]);
894            mn102->pc += 2;
895            break;
896
897            // subc dm, dn
898            case 0x9:
899            mn102->cycles -= 2;
900            mn102->d[opcode & 3] = do_subc(mn102, mn102->d[opcode & 3], mn102->d[(opcode>>2) & 3]);
901            mn102->pc += 2;
902            break;
903
904            // add am, dn
905            case 0xc:
906            mn102->cycles -= 2;
907            mn102->d[opcode & 3] = do_add(mn102, mn102->d[opcode & 3], mn102->a[(opcode>>2) & 3]);
908            mn102->pc += 2;
909            break;
910
911            // sub am, dn
912            case 0xd:
913            mn102->cycles -= 2;
914            mn102->d[opcode & 3] = do_sub(mn102, mn102->d[opcode & 3], mn102->a[(opcode>>2) & 3]);
915            mn102->pc += 2;
916            break;
917
918            // cmp am, dn
919            case 0xe:
920            mn102->cycles -= 2;
921            do_sub(mn102, mn102->d[opcode & 3], mn102->a[(opcode>>2) & 3]);
922            mn102->pc += 2;
923            break;
924
925            // mov an, dm
926            case 0xf:
927            mn102->cycles -= 2;
928            mn102->d[opcode & 3] = mn102->a[(opcode>>2) & 3];
929            mn102->pc += 2;
930            break;
931
932            default:
933            unemul(mn102);
934            break;
935            }
936         break;
937
938      case 0xf3:
939         opcode = mn102_read_byte(mn102, mn102->pc+1);
940         switch(opcode) {
941            // and dm, dn
942            case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07:
943            case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f:
944            mn102->cycles -= 2;
945            test_nz16(mn102, mn102->d[opcode & 3] &= 0xff0000|mn102->d[(opcode>>2) & 3]);
946            mn102->pc += 2;
947            break;
948
949            // or dm, dn
950            case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
951            case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f:
952            mn102->cycles -= 2;
953            test_nz16(mn102, mn102->d[opcode & 3] |= 0x00ffff&mn102->d[(opcode>>2) & 3]);
954            mn102->pc += 2;
955            break;
956
957            // xor dm, dn
958            case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27:
959            case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f:
960            mn102->cycles -= 2;
961            test_nz16(mn102, mn102->d[opcode & 3] ^= 0x00ffff&mn102->d[(opcode>>2) & 3]);
962            mn102->pc += 2;
963            break;
964
965            // rol dn
966            case 0x30: case 0x31: case 0x32: case 0x33: {
967            UINT32 d = mn102->d[opcode & 3];
968            mn102->cycles -= 2;
969            test_nz16(mn102, mn102->d[opcode & 3] = (d & 0xff0000) | ((d << 1) & 0x00fffe) | ((mn102->psw & 0x04) ? 1 : 0));
970            if(d & 0x8000)
971            mn102->psw |= 0x04;
972            mn102->pc += 2;
973            break;
974            }
975
976            // ror dn
977            case 0x34: case 0x35: case 0x36: case 0x37: {
978            UINT32 d = mn102->d[opcode & 3];
979            mn102->cycles -= 2;
980            test_nz16(mn102, mn102->d[opcode & 3] = (d & 0xff0000) | ((d >> 1) & 0x007fff) | ((mn102->psw & 0x04) ? 0x8000 : 0));
981            if(d & 1)
982            mn102->psw |= 0x04;
983            mn102->pc += 2;
984            break;
985            }
986
987            // asr dn
988            case 0x38: case 0x39: case 0x3a: case 0x3b: {
989            UINT32 d = mn102->d[opcode & 3];
990            mn102->cycles -= 2;
991            test_nz16(mn102, mn102->d[opcode & 3] = (d & 0xff8000) | ((d >> 1) & 0x007fff));
992            if(d & 1)
993            mn102->psw |= 0x04;
994            mn102->pc += 2;
995            break;
996            }
997
998            // lsr dn
999            case 0x3c: case 0x3d: case 0x3e: case 0x3f: {
1000            UINT32 d = mn102->d[opcode & 3];
1001            mn102->cycles -= 2;
1002            test_nz16(mn102, mn102->d[opcode & 3] = (d & 0xff0000) | ((d >> 1) & 0x007fff));
1003            if(d & 1)
1004            mn102->psw |= 0x04;
1005            mn102->pc += 2;
1006            break;
1007            }
1008
1009            // mul dn, dm
1010            case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47:
1011            case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: {
1012            UINT32 res;
1013            mn102->cycles -= 12;
1014            res = ((INT16)mn102->d[opcode & 3])*((INT16)mn102->d[(opcode>>2) & 3]);
1015            mn102->d[opcode & 3] = res & 0xffffff;
1016            mn102->psw &= 0xff00;
1017            if(res & 0x80000000)
1018            mn102->psw |= 2;
1019            if(!res)
1020            mn102->psw |= 1;
1021            mn102->mdr = res >> 16;
1022            mn102->pc += 2;
1023            break;
1024            }
1025
1026            // mulu dn, dm
1027            case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57:
1028            case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: {
1029            UINT32 res;
1030            mn102->cycles -= 12;
1031            res = ((UINT16)mn102->d[opcode & 3])*((UINT16)mn102->d[(opcode>>2) & 3]);
1032            mn102->d[opcode & 3] = res & 0xffffff;
1033            mn102->psw &= 0xff00;
1034            if(res & 0x80000000)
1035            mn102->psw |= 2;
1036            if(!res)
1037            mn102->psw |= 1;
1038            mn102->mdr = res >> 16;
1039            mn102->pc += 2;
1040            break;
1041            }
1042
1043            // divu dn, dm
1044            case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67:
1045            case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: {
1046            UINT32 n, d, q, r;
1047            mn102->cycles -= 13;
1048            mn102->pc += 2;
1049            mn102->psw &= 0xff00;
1050
1051            n = (mn102->mdr<<16)|(UINT16)mn102->d[opcode & 3];
1052            d = (UINT16)mn102->d[(opcode>>2) & 3];
1053            if(!d) {
1054            mn102->psw |= 8;
1055            break;
1056            }
1057            q = n/d;
1058            r = n%d;
1059            if(q >= 0x10000) {
1060            mn102->psw |= 8;
1061            break;
1062            }
1063            mn102->d[opcode & 3] = q;
1064            mn102->mdr = r;
1065            if(!q)
1066            mn102->psw |= 0x11;
1067            if(q & 0x8000)
1068            mn102->psw |= 2;
1069            break;
1070            }
1071
1072            // cmp dm, dn
1073            case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97:
1074            case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
1075            mn102->cycles -= 2;
1076            do_sub(mn102, mn102->d[opcode & 3], mn102->d[(opcode>>2) & 3]);
1077            mn102->pc += 2;
1078            break;
1079
1080            // mov mdr, dn
1081            case 0xc0: case 0xc4: case 0xc8: case 0xcc:
1082            mn102->cycles -= 2;
1083            mn102->mdr = mn102->d[(opcode>>2) & 3];
1084            mn102->pc += 2;
1085            break;
1086
1087            // ext dn
1088            case 0xc1: case 0xc5: case 0xc9: case 0xcd:
1089            mn102->cycles -= 3;
1090            mn102->mdr = mn102->d[(opcode>>2) & 3] & 0x8000 ? 0xffff : 0x0000;
1091            mn102->pc += 2;
1092            break;
1093
1094            // mov dn, psw
1095            case 0xd0: case 0xd4: case 0xd8: case 0xdc:
1096            mn102->cycles -= 3;
1097            mn102->psw = mn102->d[(opcode>>2) & 3];
1098            mn102->pc += 2;
1099            break;
1100
1101            // mov dn, mdr
1102            case 0xe0: case 0xe1: case 0xe2: case 0xe3:
1103            mn102->cycles -= 2;
1104            mn102->d[opcode & 3] = mn102->mdr;
1105            mn102->pc += 2;
1106            break;
1107
1108            // not dn
1109            case 0xe4: case 0xe5: case 0xe6: case 0xe7:
1110            mn102->cycles -= 2;
1111            test_nz16(mn102, mn102->d[opcode & 3] ^= 0x00ffff);
1112            mn102->pc += 2;
1113            break;
1114
1115            // mov psw, dn
1116            case 0xf0: case 0xf1: case 0xf2: case 0xf3:
1117            mn102->cycles -= 3;
1118            mn102->d[(opcode>>2) & 3] = mn102->psw;
1119            mn102->pc += 2;
1120            break;
1121
1122            default:
1123            unemul(mn102);
1124            break;
1125            }
1126         break;
1127
1128      case 0xf4:
1129         opcode = mn102_read_byte(mn102, mn102->pc+1);
1130         switch(opcode) {
1131            // mov dm, (abs24, an)
1132            case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07:
1133            case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f:
1134            mn102->cycles -= 3;
1135            mn102_write_word(mn102, (r24u(mn102, mn102->pc+2) + mn102->a[(opcode>>2) & 3]) & 0xffffff, mn102->d[opcode & 3]);
1136            mn102->pc += 5;
1137            break;
1138
1139            // mov am, (abs24, an)
1140            case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
1141            case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f:
1142            mn102->cycles -= 4;
1143            w24(mn102, (r24u(mn102, mn102->pc+2) + mn102->a[(opcode>>2) & 3]) & 0xffffff, mn102->a[opcode & 3]);
1144            mn102->pc += 5;
1145            break;
1146
1147            // movb dm, (abs24, an)
1148            case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27:
1149            case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f:
1150            mn102->cycles -= 3;
1151            mn102_write_byte(mn102, (r24u(mn102, mn102->pc+2) + mn102->a[(opcode>>2) & 3]) & 0xffffff, mn102->d[opcode & 3]);
1152            mn102->pc += 5;
1153            break;
1154
1155            // movx dm, (abs24, an)
1156            case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37:
1157            case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f:
1158            mn102->cycles -= 4;
1159            w24(mn102, (r24u(mn102, mn102->pc+2) + mn102->a[(opcode>>2) & 3]) & 0xffffff, mn102->d[opcode & 3]);
1160            mn102->pc += 5;
1161            break;
1162
1163            // mov dn, (abs24)
1164            case 0x40: case 0x41: case 0x42: case 0x43:
1165            mn102->cycles -= 3;
1166            mn102_write_word(mn102, r24u(mn102, mn102->pc+2), mn102->d[opcode & 3]);
1167            mn102->pc += 5;
1168            break;
1169
1170            // movb dn, (abs24)
1171            case 0x44: case 0x45: case 0x46: case 0x47:
1172            mn102->cycles -= 3;
1173            mn102_write_byte(mn102, r24u(mn102, mn102->pc+2), mn102->d[opcode & 3]);
1174            mn102->pc += 5;
1175            break;
1176
1177            // mov an, (abs24)
1178            case 0x50: case 0x51: case 0x52: case 0x53:
1179            mn102->cycles -= 4;
1180            w24(mn102, r24u(mn102, mn102->pc+2), mn102->a[opcode & 3]);
1181            mn102->pc += 5;
1182            break;
1183
1184            // add abs24, dn
1185            case 0x60: case 0x61: case 0x62: case 0x63:
1186            mn102->cycles -= 3;
1187            mn102->d[opcode & 3] = do_add(mn102, mn102->d[opcode & 3], r24u(mn102, mn102->pc+2));
1188            mn102->pc += 5;
1189            break;
1190
1191            // add abs24, an
1192            case 0x64: case 0x65: case 0x66: case 0x67:
1193            mn102->cycles -= 3;
1194            mn102->a[opcode & 3] = do_add(mn102, mn102->a[opcode & 3], r24u(mn102, mn102->pc+2));
1195            mn102->pc += 5;
1196            break;
1197
1198            // sub abs24, dn
1199            case 0x68: case 0x69: case 0x6a: case 0x6b:
1200            mn102->cycles -= 3;
1201            mn102->d[opcode & 3] = do_sub(mn102, mn102->d[opcode & 3], r24u(mn102, mn102->pc+2));
1202            mn102->pc += 5;
1203            break;
1204
1205            // sub abs24, an
1206            case 0x6c: case 0x6d: case 0x6e: case 0x6f:
1207            mn102->cycles -= 3;
1208            mn102->a[opcode & 3] = do_sub(mn102, mn102->a[opcode & 3], r24u(mn102, mn102->pc+2));
1209            mn102->pc += 5;
1210            break;
1211
1212            // mov imm24, dn
1213            case 0x70: case 0x71: case 0x72: case 0x73:
1214            mn102->cycles -= 3;
1215            mn102->d[opcode & 3] = r24u(mn102, mn102->pc+2);
1216            mn102->pc += 5;
1217            break;
1218
1219            // mov imm24, an
1220            case 0x74: case 0x75: case 0x76: case 0x77:
1221            mn102->cycles -= 3;
1222            mn102->a[opcode & 3] = r24u(mn102, mn102->pc+2);
1223            mn102->pc += 5;
1224            break;
1225
1226            // cmp abs24, dn
1227            case 0x78: case 0x79: case 0x7a: case 0x7b:
1228            mn102->cycles -= 3;
1229            do_sub(mn102, mn102->d[opcode & 3], r24u(mn102, mn102->pc+2));
1230            mn102->pc += 5;
1231            break;
1232
1233            // cmp abs24, an
1234            case 0x7c: case 0x7d: case 0x7e: case 0x7f:
1235            mn102->cycles -= 3;
1236            do_sub(mn102, mn102->a[opcode & 3], r24u(mn102, mn102->pc+2));
1237            mn102->pc += 5;
1238            break;
1239
1240            // mov (abs24, an), dm
1241            case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87:
1242            case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f:
1243            mn102->cycles -= 3;
1244            mn102->d[opcode & 3] = (INT16)mn102_read_word(mn102, (mn102->a[(opcode>>2) & 3] + r24u(mn102, mn102->pc+2)) & 0xffffff);
1245            mn102->pc += 5;
1246            break;
1247
1248            // movbu (abs24, an), dm
1249            case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97:
1250            case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
1251            mn102->cycles -= 3;
1252            mn102->d[opcode & 3] = mn102_read_byte(mn102, (mn102->a[(opcode>>2) & 3] + r24u(mn102, mn102->pc+2)) & 0xffffff);
1253            mn102->pc += 5;
1254            break;
1255
1256            // movb (abs24, an), dm
1257            case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7:
1258            case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf:
1259            mn102->cycles -= 3;
1260            mn102->d[opcode & 3] = (INT8)mn102_read_byte(mn102, (mn102->a[(opcode>>2) & 3] + r24u(mn102, mn102->pc+2)) & 0xffffff);
1261            mn102->pc += 5;
1262            break;
1263
1264            // movx (abs24, an), dm
1265            case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7:
1266            case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf:
1267            mn102->cycles -= 4;
1268            mn102->d[opcode & 3] = r24u(mn102, (mn102->a[(opcode>>2) & 3] + r24u(mn102, mn102->pc+2)) & 0xffffff);
1269            mn102->pc += 5;
1270            break;
1271
1272            // mov (abs24), dn
1273            case 0xc0: case 0xc1: case 0xc2: case 0xc3:
1274            mn102->cycles -= 3;
1275            mn102->d[opcode & 3] = (INT16)mn102_read_word(mn102, r24u(mn102, mn102->pc+2));
1276            mn102->pc += 5;
1277            break;
1278
1279            // movb (abs24), dn
1280            case 0xc4: case 0xc5: case 0xc6: case 0xc7:
1281            mn102->cycles -= 3;
1282            mn102->d[opcode & 3] = (INT8)mn102_read_byte(mn102, r24u(mn102, mn102->pc+2));
1283            mn102->pc += 5;
1284            break;
1285
1286            // movbu (abs24), dn
1287            case 0xc8: case 0xc9: case 0xca: case 0xcb:
1288            mn102->cycles -= 3;
1289            mn102->d[opcode & 3] = mn102_read_byte(mn102, r24u(mn102, mn102->pc+2));
1290            mn102->pc += 5;
1291            break;
1292
1293            // mov (abs24), an
1294            case 0xd0: case 0xd1: case 0xd2: case 0xd3:
1295            mn102->cycles -= 4;
1296            mn102->a[opcode & 3] = r24u(mn102, r24u(mn102, mn102->pc+2));
1297            mn102->pc += 5;
1298            break;
1299
1300            // jmp imm24
1301            case 0xe0:
1302            mn102->cycles -= 4;
1303            mn102_change_pc(mn102, mn102->pc+5+r24u(mn102, mn102->pc+2));
1304            break;
1305
1306            // jsr label24
1307            case 0xe1:
1308            mn102->cycles -= 5;
1309            do_jsr(mn102, mn102->pc+5+r24u(mn102, mn102->pc+2), mn102->pc+5);
1310            break;
1311
1312
1313            // mov (abs24, an), am
1314            case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7:
1315            case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff:
1316            mn102->cycles -= 4;
1317            mn102->a[opcode & 3] = r24u(mn102, (mn102->a[(opcode>>2) & 3] + r24u(mn102, mn102->pc+2)) & 0xffffff);
1318            mn102->pc += 5;
1319            break;
1320
1321            default:
1322            unemul(mn102);
1323            break;
1324            }
1325         break;
1326
1327      case 0xf5:
1328         opcode = mn102_read_byte(mn102, mn102->pc+1);
1329         switch(opcode) {
1330
1331            // and imm8, dn
1332            case 0x00: case 0x01: case 0x02: case 0x03:
1333            mn102->cycles -= 2;
1334            test_nz16(mn102, mn102->d[opcode & 3] &= 0xff0000|mn102_read_byte(mn102, mn102->pc+2));
1335            mn102->pc += 3;
1336            break;
1337
1338            // btst imm8, dn
1339            case 0x04: case 0x05: case 0x06: case 0x07:
1340            mn102->cycles -= 2;
1341            test_nz16(mn102, mn102->d[opcode & 3] & mn102_read_byte(mn102, mn102->pc+2));
1342            mn102->pc += 3;
1343            break;
1344
1345            // or imm8, dn
1346            case 0x08: case 0x09: case 0x0a: case 0x0b:
1347            mn102->cycles -= 2;
1348            test_nz16(mn102, mn102->d[opcode & 3] |= mn102_read_byte(mn102, mn102->pc+2));
1349            mn102->pc += 3;
1350            break;
1351
1352            // addnf imm8, an
1353            case 0x0c: case 0x0d: case 0x0e: case 0x0f:
1354            mn102->cycles -= 2;
1355            mn102->a[opcode & 3] = mn102->a[opcode & 3] +(INT8)mn102_read_byte(mn102, mn102->pc+2);
1356            mn102->pc += 3;
1357            break;
1358
1359            // movb dm, (d8, an)
1360            case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
1361            case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f:
1362            mn102->cycles -= 2;
1363            mn102_write_byte(mn102, (mn102->a[(opcode>>2) & 3]+(INT8)mn102_read_byte(mn102, mn102->pc+2)) & 0xffffff, mn102->d[opcode & 3]);
1364            mn102->pc += 3;
1365            break;
1366
1367            // movb (d8, an), dm
1368            case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27:
1369            case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f:
1370            mn102->cycles -= 2;
1371            mn102->d[opcode & 3] = (INT8)mn102_read_byte(mn102, (mn102->a[(opcode>>2) & 3]+(INT8)mn102_read_byte(mn102, mn102->pc+2)) & 0xffffff);
1372            mn102->pc += 3;
1373            break;
1374
1375            // movbu (d8, an), dm
1376            case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37:
1377            case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f:
1378            mn102->cycles -= 2;
1379            mn102->d[opcode & 3] = mn102_read_byte(mn102, (mn102->a[(opcode>>2) & 3]+(INT8)mn102_read_byte(mn102, mn102->pc+2)) & 0xffffff);
1380            mn102->pc += 3;
1381            break;
1382
1383            // movx dm, (d8, an)
1384            case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57:
1385            case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f:
1386            mn102->cycles -= 3;
1387            w24(mn102, (mn102->a[(opcode>>2) & 3]+(INT8)mn102_read_byte(mn102, mn102->pc+2)) & 0xffffff, mn102->d[opcode & 3]);
1388            mn102->pc += 3;
1389            break;
1390
1391            // movx (d8, an), dm
1392            case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77:
1393            case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f:
1394            mn102->cycles -= 3;
1395            mn102->d[opcode & 3] = r24u(mn102, (mn102->a[(opcode>>2) & 3]+(INT8)mn102_read_byte(mn102, mn102->pc+2)) & 0xffffff);
1396            mn102->pc += 3;
1397            break;
1398
1399            // bltx label8
1400            case 0xe0:
1401            if(((mn102->psw & 0xa0) == 0x20) || ((mn102->psw & 0xa0) == 0x80)) {
1402            mn102->cycles -= 3;
1403            mn102_change_pc(mn102, mn102->pc+3+(INT8)mn102_read_byte(mn102, mn102->pc+2));
1404            } else {
1405            mn102->cycles -= 2;
1406            mn102->pc += 3;
1407            }
1408            break;
1409
1410            // bgtx label8
1411            case 0xe1:
1412            if(((mn102->psw & 0xb0) == 0) || ((mn102->psw & 0xb0) == 0xa0)) {
1413            mn102->cycles -= 3;
1414            mn102_change_pc(mn102, mn102->pc+3+(INT8)mn102_read_byte(mn102, mn102->pc+2));
1415            } else {
1416            mn102->cycles -= 2;
1417            mn102->pc += 3;
1418            }
1419            break;
1420
1421            // bgex label8
1422            case 0xe2:
1423            if(((mn102->psw & 0xa0) == 0) || ((mn102->psw & 0xa0) == 0xa0)) {
1424            mn102->cycles -= 3;
1425            mn102_change_pc(mn102, mn102->pc+3+(INT8)mn102_read_byte(mn102, mn102->pc+2));
1426            } else {
1427            mn102->cycles -= 2;
1428            mn102->pc += 3;
1429            }
1430            break;
1431
1432            // blex label8
1433            case 0xe3:
1434            if((mn102->psw & 0x10) || ((mn102->psw & 0xa0) == 0x20) || ((mn102->psw & 0xa0) == 0x80)) {
1435            mn102->cycles -= 3;
1436            mn102_change_pc(mn102, mn102->pc+3+(INT8)mn102_read_byte(mn102, mn102->pc+2));
1437            } else {
1438            mn102->cycles -= 2;
1439            mn102->pc += 3;
1440            }
1441            break;
1442
1443            // bcsx label8
1444            case 0xe4:
1445            if(mn102->psw & 0x40) {
1446            mn102->cycles -= 3;
1447            mn102_change_pc(mn102, mn102->pc+3+(INT8)mn102_read_byte(mn102, mn102->pc+2));
1448            } else {
1449            mn102->cycles -= 2;
1450            mn102->pc += 3;
1451            }
1452            break;
1453
1454            // bhix label8
1455            case 0xe5:
1456            if(!(mn102->psw & 0x50)) {
1457            mn102->cycles -= 3;
1458            mn102_change_pc(mn102, mn102->pc+3+(INT8)mn102_read_byte(mn102, mn102->pc+2));
1459            } else {
1460            mn102->cycles -= 2;
1461            mn102->pc += 3;
1462            }
1463            break;
1464
1465            // bccx label8
1466            case 0xe6:
1467            if(!(mn102->psw & 0x40)) {
1468            mn102->cycles -= 3;
1469            mn102_change_pc(mn102, mn102->pc+3+(INT8)mn102_read_byte(mn102, mn102->pc+2));
1470            } else {
1471            mn102->cycles -= 2;
1472            mn102->pc += 3;
1473            }
1474            break;
1475
1476            // blsx label8
1477            case 0xe7:
1478            if(mn102->psw & 0x50) {
1479            mn102->cycles -= 3;
1480            mn102_change_pc(mn102, mn102->pc+3+(INT8)mn102_read_byte(mn102, mn102->pc+2));
1481            } else {
1482            mn102->cycles -= 2;
1483            mn102->pc += 3;
1484            }
1485            break;
1486
1487            // beqx label8
1488            case 0xe8:
1489            if(mn102->psw & 0x10) {
1490            mn102->cycles -= 3;
1491            mn102_change_pc(mn102, mn102->pc+3+(INT8)mn102_read_byte(mn102, mn102->pc+2));
1492            } else {
1493            mn102->cycles -= 2;
1494            mn102->pc += 3;
1495            }
1496            break;
1497
1498            // bnex label8
1499            case 0xe9:
1500            if(!(mn102->psw & 0x10)) {
1501            mn102->cycles -= 3;
1502            mn102_change_pc(mn102, mn102->pc+3+(INT8)mn102_read_byte(mn102, mn102->pc+2));
1503            } else {
1504            mn102->cycles -= 2;
1505            mn102->pc += 3;
1506            }
1507            break;
1508
1509
1510            // bnc label8
1511            case 0xfe:
1512            if(!(mn102->psw & 0x02)) {
1513            mn102->cycles -= 3;
1514            mn102_change_pc(mn102, mn102->pc+3+(INT8)mn102_read_byte(mn102, mn102->pc+2));
1515            } else {
1516            mn102->cycles -= 2;
1517            mn102->pc += 3;
1518            }
1519            break;
1520
1521            default:
1522            unemul(mn102);
1523            break;
1524            }
1525         break;
1526
1527      case 0xf7:
1528         opcode = mn102_read_byte(mn102, mn102->pc+1);
1529         switch(opcode) {
1530            // and imm16, dn
1531            case 0x00: case 0x01: case 0x02: case 0x03:
1532            mn102->cycles -= 2;
1533            test_nz16(mn102, mn102->d[opcode & 3] &= 0xff0000|mn102_read_word(mn102, mn102->pc+2));
1534            mn102->pc += 4;
1535            break;
1536
1537            // btst imm16, dn
1538            case 0x04: case 0x05: case 0x06: case 0x07:
1539            mn102->cycles -= 2;
1540            test_nz16(mn102, mn102->d[opcode & 3] & mn102_read_word(mn102, mn102->pc+2));
1541            mn102->pc += 4;
1542            break;
1543
1544            // add imm16, an
1545            case 0x08: case 0x09: case 0x0a: case 0x0b:
1546            mn102->cycles -= 2;
1547            mn102->a[opcode & 3] = do_add(mn102, mn102->a[opcode & 3], (INT16)mn102_read_word(mn102, mn102->pc+2));
1548            mn102->pc += 4;
1549            break;
1550
1551            // sub imm16, an
1552            case 0x0c: case 0x0d: case 0x0e: case 0x0f:
1553            mn102->cycles -= 2;
1554            mn102->a[opcode & 3] = do_sub(mn102, mn102->a[opcode & 3], (INT16)mn102_read_word(mn102, mn102->pc+2));
1555            mn102->pc += 4;
1556            break;
1557
1558            // and imm16, psw
1559            case 0x10:
1560            mn102->cycles -= 3;
1561            mn102->psw &= mn102_read_word(mn102, mn102->pc+2);
1562            mn102->pc += 4;
1563            break;
1564
1565            // or imm16, psw
1566            case 0x14:
1567            mn102->cycles -= 3;
1568            mn102->psw |= mn102_read_word(mn102, mn102->pc+2);
1569            mn102->pc += 4;
1570            break;
1571
1572            // add imm16, dn
1573            case 0x18: case 0x19: case 0x1a: case 0x1b:
1574            mn102->cycles -= 2;
1575            mn102->d[opcode & 3] = do_add(mn102, mn102->d[opcode & 3], (INT16)mn102_read_word(mn102, mn102->pc+2));
1576            mn102->pc += 4;
1577            break;
1578
1579            // sub imm16, dn
1580            case 0x1c: case 0x1d: case 0x1e: case 0x1f:
1581            mn102->cycles -= 2;
1582            mn102->d[opcode & 3] = do_sub(mn102, mn102->d[opcode & 3], (INT16)mn102_read_word(mn102, mn102->pc+2));
1583            mn102->pc += 4;
1584            break;
1585
1586            // or imm16, dn
1587            case 0x40: case 0x41: case 0x42: case 0x43:
1588            mn102->cycles -= 3;
1589            test_nz16(mn102, mn102->d[opcode & 3] |= mn102_read_word(mn102, mn102->pc+2));
1590            mn102->pc += 4;
1591            break;
1592
1593            // cmp imm16, dn
1594            case 0x48: case 0x49: case 0x4a: case 0x4b:
1595            mn102->cycles -= 2;
1596            do_sub(mn102, mn102->d[opcode & 3], (INT16)mn102_read_word(mn102, mn102->pc+2));
1597            mn102->pc += 4;
1598            break;
1599
1600            // xor imm16, dn
1601            case 0x4c: case 0x4d: case 0x4e: case 0x4f:
1602            mn102->cycles -= 3;
1603            test_nz16(mn102, mn102->d[opcode & 3] ^= mn102_read_word(mn102, mn102->pc+2));
1604            mn102->pc += 4;
1605            break;
1606
1607            // mov dm, (imm16, an)
1608            case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87:
1609            case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f:
1610            mn102->cycles -= 2;
1611            mn102_write_word(mn102, (mn102->a[(opcode>>2)&3]+(INT16)mn102_read_word(mn102, mn102->pc+2)) & 0xffffff, (UINT16)mn102->d[opcode & 3]);
1612            mn102->pc += 4;
1613            break;
1614
1615            // mov (imm16, an), dm
1616            case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7:
1617            case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf:
1618            mn102->cycles -= 2;
1619            mn102->d[opcode & 3] = (INT16)mn102_read_word(mn102, (mn102->a[(opcode>>2) & 3] + (INT16)mn102_read_byte(mn102, mn102->pc+2)) & 0xffffff) & 0xffffff;
1620            mn102->pc += 4;
1621            break;
1622
1623
1624            default:
1625            unemul(mn102);
1626            break;
1627            }
1628         break;
1629
1630      // mov imm16, dn
1631      case 0xf8: case 0xf9: case 0xfa: case 0xfb:
1632         mn102->cycles -= 1;
1633         mn102->d[opcode & 3] = (INT16)mn102_read_word(mn102, mn102->pc+1);
1634         mn102->pc += 3;
1635         break;
1636
1637      // jmp label16
1638      case 0xfc:
1639         mn102->cycles -= 2;
1640         mn102_change_pc(mn102, mn102->pc+3+(INT16)mn102_read_word(mn102, mn102->pc+1));
1641         break;
1642
1643      // jsr label16
1644      case 0xfd:
1645         mn102->cycles -= 4;
1646         do_jsr(mn102, mn102->pc+3+(INT16)mn102_read_word(mn102, mn102->pc+1), mn102->pc+3);
1647         break;
1648
1649      // rts
1650      case 0xfe:
1651         mn102->cycles -= 5;
1652         mn102_change_pc(mn102, r24u(mn102, mn102->a[3]));
1653         mn102->a[3] += 4;
1654         break;
1655
1656      default:
1657         unemul(mn102);
1658         break;
1659      }
1660   }
1661
1662   return cycles - mn102->cycles;
1663}
1664
1665const char *inames[10][4] = {
1666  { "timer0", "timer1", "timer2", "timer3" },
1667  { "timer4", "timer5", "timer6", "timer7" },
1668  { "timer8", "timer9", "timer12a", "timer12b" },
1669  { "timer10u", "timer10a", "timer10b", "?" },
1670  { "timer11u", "timer11a", "timer11b", "?" },
1671  { "dma0", "dma1", "dma2", "dma3" },
1672  { "dma4", "dma5", "dma6", "dma7" },
1673  { "X0", "X1", "X2", "X3" },
1674  { "ser0tx", "ser0rx", "ser1tx", "ser1rx" },
1675  { "key", "a/d", "?", "?" }
1676};
1677
1678static void mn10200_w(mn102_info *mn102, UINT32 adr, UINT32 data, int type)
1679{
1680  if(type == MEM_WORD) {
1681    mn10200_w(mn102, adr, data & 0xff, MEM_BYTE);
1682    mn10200_w(mn102, adr+1, (data>>8) & 0xff, MEM_BYTE);
1683    return;
1684  }
1685
1686  switch(adr) {
1687  case 0x000:
1688    if(data & 12)
1689      log_event("CPU", "Stop request");
1690    break;
1691  case 0x001:
1692    log_event("WATCHDOG", "Write %d", data>>7);
1693    break;
1694
1695  case 0x002: case 0x003: // Memory control
1696    break;
1697
1698  case 0x030: case 0x031: // Memory mode reg 0
1699  case 0x032: case 0x033: // Memory mode reg 1
1700  case 0x034: case 0x035: // Memory mode reg 2
1701  case 0x036: case 0x037: // Memory mode reg 3
1702    break;
1703
1704    // Non-Maskable irqs
1705  case 0x040:
1706    mn102->nmicr = data & 6;
1707    break;
1708  case 0x041:
1709    break;
1710
1711    // Maskable irq control
1712  case 0x042: case 0x044: case 0x046: case 0x048: case 0x04a:
1713  case 0x04c: case 0x04e: case 0x050: case 0x052: case 0x054:
1714    mn102->icrl[((adr & 0x3f)>>1)-1] = data;
1715    break;
1716
1717  case 0x043: case 0x045: case 0x047: case 0x049: case 0x04b:
1718  case 0x04d: case 0x04f: case 0x051: case 0x053: case 0x055: {
1719    int irq = ((adr & 0x3f)>>1)-1;
1720    if((mn102->icrh[irq] != data) && (data & 15))
1721      log_event("MN102", "irq %d enabled, level=%x, enable= %s %s %s %s", irq+1, (data >> 4) & 7,
1722      data & 1 ? inames[irq][0] : "-",
1723      data & 2 ? inames[irq][1] : "-",
1724      data & 4 ? inames[irq][2] : "-",
1725      data & 8 ? inames[irq][3] : "-");
1726
1727    if((mn102->icrh[irq] != data) && !(data & 15))
1728      log_event("MN102", "irq %d disabled", irq+1);
1729    mn102->icrh[irq] = data;
1730    break;
1731  }
1732
1733  case 0x056: {
1734//    const char *modes[4] = { "l", "h", "fall", "rise" };
1735//    log_event("MN102", "irq3=%s irq2=%s irq1=%s irq0=%s",
1736//        modes[(data >> 6) & 3], modes[(data >> 4) & 3], modes[(data >> 2) & 3], modes[data & 3]);
1737    break;
1738  }
1739
1740  case 0x057: {
1741//    const char *modes[4] = { "l", "1", "fall", "3" };
1742//    log_event("MN102", "irq_ki=%s", modes[data & 3]);
1743    break;
1744  }
1745
1746  case 0x100: case 0x101: // DRAM control reg
1747  case 0x102: case 0x103: // Refresh counter
1748    break;
1749
1750  case 0x180: case 0x190: {
1751    int ser = (adr-0x180) >> 4;
1752//    const char *parity[8] = { "no", "1", "2", "3", "l", "h", "even", "odd" };
1753//    const char *source[4] = { "sbt0", "timer 8", "2", "timer 9" };
1754    mn102->serial[ser].ctrll = data;
1755
1756//    log_event("MN102", "Serial %d length=%c, parity=%s, stop=%c, source=%s",
1757//        ser,
1758//        data & 0x80 ? '8' : '7', parity[(data >> 4) & 7],
1759//        data & 8 ? '2' : '1', source[data & 3]);
1760    break;
1761  }
1762
1763  case 0x181: case 0x191: {
1764    int ser = (adr-0x180) >> 4;
1765    mn102->serial[ser].ctrlh = data;
1766//    log_event("MN102", "Serial %d transmit=%s, recieve=%s, break=%s, proto=%s, order=%s",
1767//        ser,
1768//        data & 0x80 ? "on" : "off", data & 0x40 ? "on" : "off",
1769//        data & 0x20 ? "on" : "off", data & 8 ? "sync" : "async",
1770//        data & 2 ? "msb" : "lsb");
1771    break;
1772  }
1773
1774  case 0x182: case 0x192: {
1775    int ser = (adr-0x180) >> 4;
1776    mn102->serial[ser].buf = data;
1777    log_event("MN102", "Serial %d buffer=%02x", ser, data);
1778    break;
1779  }
1780
1781  case 0x1a0:
1782    log_event("MN102", "AN %s timer7=%s /%d %s %s",
1783         data & 0x80 ? "on" : "off", data & 0x40 ? "on" : "off",
1784         1 << ((data >> 2) & 3), data & 2 ? "continuous" : "single", data & 1 ? "one" : "multi");
1785    break;
1786
1787  case 0x1a1:
1788    log_event("MN102", "AN chans=0-%d current=%d", (data >> 4) & 7, data & 7);
1789    break;
1790
1791  case 0x210: case 0x211: case 0x212: case 0x213: case 0x214:
1792  case 0x215: case 0x216: case 0x217: case 0x218: case 0x219:
1793    log_event("MN102", "Timer %d value set %02x", adr-0x210, data);
1794    break;
1795
1796  case 0x21a:
1797    log_event("MN102", "Prescale 0 cycle count %02x", data);
1798    break;
1799
1800  case 0x21b:
1801    log_event("MN102", "Prescale 1 cycle count %02x", data);
1802    break;
1803
1804  case 0x220: case 0x221: case 0x222: case 0x223: case 0x224:
1805  case 0x225: case 0x226: case 0x227: case 0x228: case 0x229: {
1806//    const char *source[4] = { "TMxIO", "cascade", "prescale 0", "prescale 1" };
1807//    log_event("MN102", "Timer %d %s b6=%d, source=%s", adr-0x220, data & 0x80 ? "on" : "off", (data & 0x40) != 0, source[data & 3]);
1808    break;
1809  }
1810
1811  case 0x22a:
1812    log_event("MN102", "Prescale 0 %s, ps0bc %s",
1813         data & 0x80 ? "on" : "off", data & 0x40 ? "-> ps0br" : "off");
1814    break;
1815
1816  case 0x22b:
1817    log_event("MN102", "Prescale 1 %s, ps1bc %s",
1818         data & 0x80 ? "on" : "off", data & 0x40 ? "-> ps1br" : "off");
1819    break;
1820
1821  case 0x230: case 0x240: case 0x250: {
1822//    const char *modes[4] = { "single", "double", "ioa", "iob" };
1823//    const char *sources[8] = { "pres.0", "pres.1", "iob", "sysclk", "*4", "*1", "6", "7" };
1824//    log_event("MN102", "Timer %d comp=%s on_1=%s on_match=%s phase=%s source=%s",
1825//        10 + ((adr-0x230) >> 4),
1826//        modes[data >> 6], data & 0x20 ? "cleared" : "not cleared",  data & 0x10 ? "cleared" : "not cleared",
1827//        data & 8 ? "tff" : "rsff", sources[data & 7]);
1828    break;
1829  }
1830
1831  case 0x231: case 0x241: case 0x251: {
1832//    const char *modes[4] = { "up", "down", "up on ioa", "up on iob" };
1833//    log_event("MN102", "Timer %d %s ff=%s op=%s ext_trig=%s %s",
1834//        10 + ((adr-0x230) >> 4),
1835//        data & 0x80 ? "enable" : "disable", data & 0x40 ? "operate" : "clear",
1836//        modes[(data >> 4) & 3], data & 2 ? "on" : "off", data & 1 ? "one-shot" : "repeat");
1837
1838    break;
1839  }
1840
1841  case 0x234: case 0x244: case 0x254:
1842    log_event("MN102", "Timer %d ca=--%02x", 10 + ((adr-0x230) >> 4), data);
1843    break;
1844
1845  case 0x235: case 0x245: case 0x255:
1846    log_event("MN102", "Timer %d ca=%02x--", 10 + ((adr-0x230) >> 4), data);
1847    break;
1848
1849  case 0x236: case 0x246: case 0x256:
1850    log_event("MN102", "Timer %d ca read trigger", 10 + ((adr-0x230) >> 4));
1851    break;
1852
1853  case 0x237: case 0x247: case 0x257: break;
1854
1855  case 0x238: case 0x248: case 0x258:
1856    log_event("MN102", "Timer %d cb=--%02x", 10 + ((adr-0x230) >> 4), data);
1857    break;
1858
1859  case 0x239: case 0x249: case 0x259:
1860    log_event("MN102", "Timer %d cb=%02x--", 10 + ((adr-0x230) >> 4), data);
1861    break;
1862
1863  case 0x23a: case 0x24a: case 0x25a:
1864    log_event("MN102", "Timer %d cb read trigger", 10 + ((adr-0x230) >> 4));
1865    break;
1866
1867  case 0x23b: case 0x24b: case 0x25b: break;
1868
1869  case 0x260: case 0x261: {
1870//    const char *mode[4] = { "sysbuf", "4-phase", "4-phase 1/2", "3" };
1871//    log_event("MN102", "Sync Output %c timing=%s out=%s dir=%s mode=%s",
1872//        adr == 0x261 ? 'B' : 'A',
1873//        data & 0x10 ? "12A" : "1", data & 8 ? "sync a" :"P13-10",
1874//        data & 4 ? "ccw" : "cw", mode[data & 3]);
1875    break;
1876  }
1877
1878  case 0x262:
1879    log_event("MN102", "Sync Output buffer = %02x", data);
1880    break;
1881
1882  case 0x264:
1883   memory_write_byte_8le(mn102->io, MN10200_PORT1, data);
1884    break;
1885
1886  case 0x280: case 0x290: case 0x2a0: case 0x2b0: case 0x2c0: case 0x2d0: case 0x2e0: case 0x2f0: {
1887    int dma = (adr-0x280) >> 4;
1888    mn102->dma[dma].adr = (mn102->dma[dma].adr & 0x00ffff00) | data;
1889    log_event("MN102", "DMA %d adr=%06x", dma, mn102->dma[dma].adr);
1890    break;
1891  }
1892
1893  case 0x281: case 0x291: case 0x2a1: case 0x2b1: case 0x2c1: case 0x2d1: case 0x2e1: case 0x2f1: {
1894    int dma = (adr-0x280) >> 4;
1895    mn102->dma[dma].adr = (mn102->dma[dma].adr & 0x00ff00ff) | (data << 8);
1896    log_event("MN102", "DMA %d adr=%06x", dma, mn102->dma[dma].adr);
1897    break;
1898  }
1899
1900  case 0x282: case 0x292: case 0x2a2: case 0x2b2: case 0x2c2: case 0x2d2: case 0x2e2: case 0x2f2: {
1901    int dma = (adr-0x280) >> 4;
1902    mn102->dma[dma].adr = (mn102->dma[dma].adr & 0x0000ffff) | (data << 16);
1903    log_event("MN102", "DMA %d adr=%06x", dma, mn102->dma[dma].adr);
1904    break;
1905  }
1906
1907  case 0x283: case 0x293: case 0x2a3: case 0x2b3: case 0x2c3: case 0x2d3: case 0x2e3: case 0x2f3:
1908    break;
1909
1910  case 0x284: case 0x294: case 0x2a4: case 0x2b4: case 0x2c4: case 0x2d4: case 0x2e4: case 0x2f4: {
1911    int dma = (adr-0x280) >> 4;
1912    mn102->dma[dma].count = (mn102->dma[dma].count & 0x00ffff00) | data;
1913    log_event("MN102", "DMA %d count=%06x", dma, mn102->dma[dma].count);
1914    break;
1915  }
1916
1917  case 0x285: case 0x295: case 0x2a5: case 0x2b5: case 0x2c5: case 0x2d5: case 0x2e5: case 0x2f5: {
1918    int dma = (adr-0x280) >> 4;
1919    mn102->dma[dma].count = (mn102->dma[dma].count & 0x00ff00ff) | (data << 8);
1920    log_event("MN102", "DMA %d count=%06x", dma, mn102->dma[dma].count);
1921    break;
1922  }
1923
1924  case 0x286: case 0x296: case 0x2a6: case 0x2b6: case 0x2c6: case 0x2d6: case 0x2e6: case 0x2f6: {
1925    int dma = (adr-0x280) >> 4;
1926    mn102->dma[dma].count = (mn102->dma[dma].count & 0x0000ffff) | (data << 16);
1927    log_event("MN102", "DMA %d count=%06x", dma, mn102->dma[dma].count);
1928    break;
1929  }
1930
1931  case 0x287: case 0x297: case 0x2a7: case 0x2b7: case 0x2c7: case 0x2d7: case 0x2e7: case 0x2f7:
1932    break;
1933
1934  case 0x288: case 0x298: case 0x2a8: case 0x2b8: case 0x2c8: case 0x2d8: case 0x2e8: case 0x2f8: {
1935    int dma = (adr-0x280) >> 4;
1936    mn102->dma[dma].iadr = (mn102->dma[dma].iadr & 0xff00) | data;
1937    log_event("MN102", "DMA %d iadr=%03x", dma, mn102->dma[dma].iadr);
1938    break;
1939  }
1940
1941  case 0x289: case 0x299: case 0x2a9: case 0x2b9: case 0x2c9: case 0x2d9: case 0x2e9: case 0x2f9: {
1942    int dma = (adr-0x280) >> 4;
1943    mn102->dma[dma].iadr = (mn102->dma[dma].iadr & 0x00ff) | ((data & 3) << 8);
1944    log_event("MN102", "DMA %d iadr=%03x", dma, mn102->dma[dma].iadr);
1945    break;
1946  }
1947
1948  case 0x28a: case 0x29a: case 0x2aa: case 0x2ba: case 0x2ca: case 0x2da: case 0x2ea: case 0x2fa: {
1949/*    static const char *trans[4] = { "M-IO", "M-M", "M-X1", "m-X2" };
1950    static const char *start[32] = {
1951      "soft", "a/d", "ser0tx", "set0rx", "ser1tx", "ser1rx",
1952      "timer0", "timer1", "timer2", "timer3", "timer4", "timer5", "timer6", "timer7", "timer8", "timer9",
1953      "timer10u", "timer10a", "timer10b",
1954      "timer11u", "timer11a", "timer12b",
1955      "timer12a", "timer12b",
1956      "irq0", "irq1", "irq2", "irq3",
1957      "X0e", "X1e", "X0l", "X1l"
1958    }; */
1959
1960    int dma = (adr-0x280) >> 4;
1961    mn102->dma[dma].ctrll = data;
1962    log_event("MN102", "DMA %d control ack=%s, trans=%s, start=%s",
1963         dma,
1964         data & 0x80 ? "level" : "pulse",
1965         trans[(data >> 5) & 3],
1966         start[data & 31]);
1967    break;
1968  }
1969
1970  case 0x28b: case 0x29b: case 0x2ab: case 0x2bb: case 0x2cb: case 0x2db: case 0x2eb: case 0x2fb: {
1971//    static const char *tradr[4] = { "inc", "dec", "fixed", "reserved" };
1972    int dma = (adr-0x280) >> 4;
1973    mn102->dma[dma].ctrlh = data;
1974/*    log_event("MN102", "DMA %d control %s irq=%s %s %s dir=%s %s %s",
1975          dma,
1976          data & 0x80 ? "enable" : "disable",
1977          data & 0x40 ? "off" : "on",
1978          data & 0x20 ? "byte" : "word",
1979          data & 0x10 ? "burst" : "single",
1980          data & 0x08 ? "dst" : "src",
1981          data & 0x04 ? "continue" : "normal",
1982          tradr[data & 3]);*/
1983    break;
1984  }
1985
1986  case 0x28c: case 0x29c: case 0x2ac: case 0x2bc: case 0x2cc: case 0x2dc: case 0x2ec: case 0x2fc: {
1987    int dma = (adr-0x280) >> 4;
1988    mn102->dma[dma].irq = data & 7;
1989    log_event("MN102", "DMA %d irq=%d", dma, data & 7);
1990    break;
1991  }
1992
1993  case 0x28d: case 0x29d: case 0x2ad: case 0x2bd: case 0x2cd: case 0x2dd: case 0x2ed: case 0x2fd:
1994    break;
1995
1996  case 0x3b0:
1997    log_event("MN102", "Pull-ups 0-7 = -%c%c%c%c%c%c%c",
1998         data & 0x40 ? '#' : '.',
1999         data & 0x20 ? '#' : '.',
2000         data & 0x10 ? '#' : '.',
2001         data & 0x08 ? '#' : '.',
2002         data & 0x04 ? '#' : '.',
2003         data & 0x02 ? '#' : '.',
2004         data & 0x01 ? '#' : '.');
2005    break;
2006
2007  case 0x3b1:
2008    log_event("MN102", "Pull-ups 8-f = --%c%c%c%c%c%c",
2009         data & 0x20 ? '#' : '.',
2010         data & 0x10 ? '#' : '.',
2011         data & 0x08 ? '#' : '.',
2012         data & 0x04 ? '#' : '.',
2013         data & 0x02 ? '#' : '.',
2014         data & 0x01 ? '#' : '.');
2015    break;
2016
2017  case 0x3b2:
2018    log_event("MN102", "Timer I/O 4-0 = %c%c%c%c%c",
2019         data & 0x10 ? 'o' : 'i',
2020         data & 0x08 ? 'o' : 'i',
2021         data & 0x04 ? 'o' : 'i',
2022         data & 0x02 ? 'o' : 'i',
2023         data & 0x01 ? 'o' : 'i');
2024    break;
2025
2026  case 0x3b3:
2027    log_event("MN102", "Timer I/O 12b/a-10b/a = %c%c %c%c %c%c",
2028         data & 0x20 ? 'o' : 'i',
2029         data & 0x10 ? 'o' : 'i',
2030         data & 0x08 ? 'o' : 'i',
2031         data & 0x04 ? 'o' : 'i',
2032         data & 0x02 ? 'o' : 'i',
2033         data & 0x01 ? 'o' : 'i');
2034    break;
2035
2036   case 0x3c0:   // port 0 data
2037      memory_write_byte_8le(mn102->io, MN10200_PORT0, data);
2038      break;
2039
2040   case 0x3c2:   // port 2 data
2041      memory_write_byte_8le(mn102->io, MN10200_PORT2, data);
2042      break;
2043
2044   case 0x3c3:   // port 3 data
2045      memory_write_byte_8le(mn102->io, MN10200_PORT3, data);
2046      break;
2047
2048   case 0x3e0:   // port0 ddr
2049      mn102->ddr[0] = data;
2050      break;
2051
2052   case 0x3e1:   // port1 ddr
2053      mn102->ddr[1] = data;
2054      break;
2055
2056   case 0x3e2:   // port2 ddr
2057      mn102->ddr[2] = data;
2058      break;
2059
2060   case 0x3e3:   // port3 ddr
2061      mn102->ddr[3] = data;
2062      break;
2063
2064  case 0x3f3:
2065/*    log_event("MN102", "Port 3 bits 4=%s 3=%s 2=%s 1=%s 0=%s",
2066          data & 0x10 ? data & 0x40 ? "serial_1" : "tm9" : "p34",
2067          data & 0x08 ? data & 0x20 ? "serial_0" : "tm8" : "p33",
2068          data & 0x04 ? "tm7" : "p32",
2069          data & 0x04 ? "tm6" : "p31",
2070          data & 0x04 ? "tm5" : "p30");*/
2071    break;
2072
2073
2074  default:
2075    log_event("MN102", "internal_w %04x, %02x (%03x)", adr+0xfc00, data, adr);
2076    break;
2077  }
2078}
2079
2080static UINT32 mn10200_r(mn102_info *mn102, UINT32 adr, int type)
2081{
2082  if(type == MEM_WORD)
2083    return mn10200_r(mn102, adr, MEM_BYTE) | (mn10200_r(mn102, adr+1, MEM_BYTE) << 8);
2084
2085  switch(adr) {
2086  case 0x00e:
2087    return mn102->iagr;
2088
2089  case 0x00f:
2090    return 0;
2091
2092  case 0x042: case 0x044: case 0x046: case 0x048: case 0x04a:
2093  case 0x04c: case 0x04e: case 0x050: case 0x052: case 0x054:
2094    return mn102->icrl[((adr & 0x3f)>>1)-1];
2095
2096  case 0x043: case 0x045: case 0x047: case 0x049: case 0x04b:
2097  case 0x04d: case 0x04f: case 0x051: case 0x053: case 0x055:
2098    return mn102->icrh[((adr & 0x3f)>>1)-1];
2099
2100  case 0x056:
2101    return 0;
2102
2103    // p4i1 = tms empty line
2104  case 0x057:
2105    return 0x20;
2106
2107  case 0x180: case 0x190:
2108    return mn102->serial[(adr-0x180) >> 4].ctrll;
2109
2110  case 0x181: case 0x191:
2111    return mn102->serial[(adr-0x180) >> 4].ctrlh;
2112
2113  case 0x182: {
2114    static int zz;
2115    return zz++;
2116  }
2117
2118  case 0x183:
2119    return 0x10;
2120
2121  case 0x200: case 0x201: case 0x202: case 0x203: case 0x204:
2122  case 0x205: case 0x206: case 0x207: case 0x208: case 0x209:
2123    log_event("MN102", "timer %d value read", adr-0x200);
2124    break;
2125
2126   case 0x264:   // port 1 data
2127      return memory_read_byte_8le(mn102->io, MN10200_PORT1);
2128
2129   case 0x3c0:   // port 0 data
2130      return memory_read_byte_8le(mn102->io, MN10200_PORT0);
2131
2132   case 0x3c2:   // port 2 data
2133      return memory_read_byte_8le(mn102->io, MN10200_PORT2);
2134
2135   case 0x3c3:   // port 3 data
2136      return memory_read_byte_8le(mn102->io, MN10200_PORT3);
2137
2138  default:
2139    log_event("MN102", "internal_r %04x (%03x)", adr+0xfc00, adr);
2140  }
2141
2142  return 0;
2143}
2144
2145static CPU_SET_INFO(mn10200)
2146{
2147   mn102_info *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
2148
2149   switch (state)
2150   {
2151           /* --- the following bits of info are set as 64-bit signed integers --- */
2152           case CPUINFO_INT_PC:    /* intentional fallthrough */
2153           case CPUINFO_INT_REGISTER + MN10200_PC:            cpustate->pc = info->i;                         break;
2154      case CPUINFO_INT_REGISTER + MN10200_PSW:           cpustate->psw = info->i;  break;
2155      case CPUINFO_INT_REGISTER + MN10200_MDR:           cpustate->mdr = info->i;  break;
2156      case CPUINFO_INT_REGISTER + MN10200_D0:            cpustate->d[0] = info->i;   break;
2157      case CPUINFO_INT_REGISTER + MN10200_D1:            cpustate->d[1] = info->i;   break;
2158      case CPUINFO_INT_REGISTER + MN10200_D2:            cpustate->d[2] = info->i;   break;
2159      case CPUINFO_INT_REGISTER + MN10200_D3:            cpustate->d[3] = info->i;   break;
2160      case CPUINFO_INT_REGISTER + MN10200_A0:            cpustate->a[0] = info->i;   break;
2161      case CPUINFO_INT_REGISTER + MN10200_A1:            cpustate->a[1] = info->i;   break;
2162      case CPUINFO_INT_REGISTER + MN10200_A2:            cpustate->a[2] = info->i;   break;
2163      case CPUINFO_INT_REGISTER + MN10200_A3:            cpustate->a[3] = info->i;   break;
2164      case CPUINFO_INT_REGISTER + MN10200_NMICR:         cpustate->nmicr = info->i;   break;
2165      case CPUINFO_INT_REGISTER + MN10200_IAGR:          cpustate->iagr = info->i;   break;
2166   }
2167}
2168
2169CPU_GET_INFO( mn10200 )
2170{
2171   mn102_info *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
2172
2173   switch(state)
2174   {
2175      /* --- the following bits of info are returned as 64-bit signed integers --- */
2176      case CPUINFO_INT_CONTEXT_SIZE:          info->i = sizeof(mn102_info);   break;
2177      case CPUINFO_INT_INPUT_LINES:           info->i = 0;                    break;
2178      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:    info->i = 0;                    break;
2179      case DEVINFO_INT_ENDIANNESS:            info->i = ENDIANNESS_LITTLE;    break;
2180      case CPUINFO_INT_CLOCK_MULTIPLIER:      info->i = 1;                    break;
2181      case CPUINFO_INT_CLOCK_DIVIDER:         info->i = 1;                    break;
2182      case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 1;                    break;
2183      case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 4;                    break;
2184      case CPUINFO_INT_MIN_CYCLES:            info->i = 1;                    break;
2185      case CPUINFO_INT_MAX_CYCLES:            info->i = 8;                    break;
2186
2187      case DEVINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16;                   break;
2188      case DEVINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 24;                   break;
2189      case DEVINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0;                    break;
2190      case DEVINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA:    info->i = 0;                    break;
2191      case DEVINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:    info->i = 0;                    break;
2192      case DEVINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA:    info->i = 0;                    break;
2193      case DEVINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 8;                    break;
2194      case DEVINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 8;                    break;
2195      case DEVINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO:      info->i = 0;                    break;
2196
2197      case CPUINFO_INT_PC:    /* intentional fallthrough */
2198      case CPUINFO_INT_REGISTER + MN10200_PC:    info->i = cpustate->pc;                      break;
2199      case CPUINFO_INT_REGISTER + MN10200_PSW:   info->i = cpustate->psw;          break;
2200
2201      /* --- the following bits of info are returned as pointers to data or functions --- */
2202      case CPUINFO_FCT_SET_INFO:              info->setinfo = CPU_SET_INFO_NAME(mn10200);        break;
2203      case CPUINFO_FCT_INIT:                  info->init = CPU_INIT_NAME(mn10200);               break;
2204      case CPUINFO_FCT_RESET:                 info->reset = CPU_RESET_NAME(mn10200);             break;
2205      case CPUINFO_FCT_EXIT:                  info->exit = CPU_EXIT_NAME(mn10200);               break;
2206      case CPUINFO_FCT_EXECUTE:               info->execute = CPU_EXECUTE_NAME(mn10200);         break;
2207      case CPUINFO_FCT_BURN:                  info->burn = NULL;                              break;
2208      case CPUINFO_FCT_DISASSEMBLE:           info->disassemble = CPU_DISASSEMBLE_NAME(mn10200); break;
2209      case CPUINFO_PTR_INSTRUCTION_COUNTER:   info->icount = &cpustate->cycles;               break;
2210
2211      /* --- the following bits of info are returned as NULL-terminated strings --- */
2212      case DEVINFO_STR_NAME:                          strcpy(info->s, "Panasonic MN10200");     break;
2213      case DEVINFO_STR_FAMILY:                   strcpy(info->s, "MN10200");                break;
2214      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                 break;
2215      case DEVINFO_STR_SOURCE_FILE:                     strcpy(info->s, __FILE__);              break;
2216      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
2217
2218      case CPUINFO_STR_FLAGS:                    // intentional fallthrough
2219      case CPUINFO_STR_REGISTER + MN10200_PSW:   sprintf(info->s, "S=%d irq=%s im=%d %c%c%c%c %c%c%c%c",
2220                           (cpustate->psw >> 12) & 3,
2221                           cpustate->psw & 0x0800 ? "on" : "off",
2222                           (cpustate->psw >> 8) & 7,
2223                           cpustate->psw & 0x0080 ? 'V' : '-',
2224                           cpustate->psw & 0x0040 ? 'C' : '-',
2225                           cpustate->psw & 0x0020 ? 'N' : '-',
2226                           cpustate->psw & 0x0010 ? 'Z' : '-',
2227                           cpustate->psw & 0x0008 ? 'v' : '-',
2228                           cpustate->psw & 0x0004 ? 'c' : '-',
2229                           cpustate->psw & 0x0002 ? 'n' : '-',
2230                           cpustate->psw & 0x0001 ? 'z' : '-');
2231                           break;
2232
2233      case CPUINFO_STR_REGISTER + MN10200_MDR:           sprintf(info->s, "MDR:  %04x", cpustate->mdr); break;
2234
2235      case CPUINFO_STR_REGISTER + MN10200_D0:            sprintf(info->s, "D0:  %08x", cpustate->d[0]); break;
2236      case CPUINFO_STR_REGISTER + MN10200_D1:            sprintf(info->s, "D1:  %08x", cpustate->d[1]); break;
2237      case CPUINFO_STR_REGISTER + MN10200_D2:            sprintf(info->s, "D2:  %08x", cpustate->d[2]); break;
2238      case CPUINFO_STR_REGISTER + MN10200_D3:            sprintf(info->s, "D3:  %08x", cpustate->d[3]); break;
2239      case CPUINFO_STR_REGISTER + MN10200_A0:            sprintf(info->s, "A0:  %08x", cpustate->a[0]); break;
2240      case CPUINFO_STR_REGISTER + MN10200_A1:            sprintf(info->s, "A1:  %08x", cpustate->a[1]); break;
2241      case CPUINFO_STR_REGISTER + MN10200_A2:            sprintf(info->s, "A2:  %08x", cpustate->a[2]); break;
2242      case CPUINFO_STR_REGISTER + MN10200_A3:            sprintf(info->s, "A3:  %08x", cpustate->a[3]); break;
2243
2244      case CPUINFO_STR_REGISTER + MN10200_NMICR:         sprintf(info->s, "MNICR:  %02x", cpustate->nmicr); break;
2245      case CPUINFO_STR_REGISTER + MN10200_IAGR:          sprintf(info->s, "IAGR:  %02x", cpustate->iagr); break;
2246   }
2247}
src/emu/cpu/mn10200/mn102dis.c
r0r7357
1#include "emu.h"
2
3#include <stdio.h>
4
5static const UINT8 *sOpROM;   // current opROM pointer
6static UINT32 sBasePC;
7
8UINT8 program_read_byte(offs_t pc)
9{
10   return sOpROM[pc - sBasePC];
11}
12
13static UINT32 r16u(offs_t pc)
14{
15   return sOpROM[pc - sBasePC] | (sOpROM[pc - sBasePC + 1]<<8);
16}
17
18static INT32 r16s(offs_t pc)
19{
20   return (INT16)(sOpROM[pc - sBasePC] | (sOpROM[pc - sBasePC + 1]<<8));
21}
22
23static INT32 r24u(offs_t pc)
24{
25   return sOpROM[pc - sBasePC] | (sOpROM[pc - sBasePC + 1]<<8) | (sOpROM[pc - sBasePC + 2]<<16);
26}
27
28static INT32 r24s(offs_t pc)
29{
30   return sOpROM[pc - sBasePC] | (sOpROM[pc - sBasePC + 1]<<8) | ((INT8)sOpROM[pc - sBasePC + 2]<<16);
31}
32
33static const char *i8str(INT8 v)
34{
35  static char res[4];
36  if(v>=0)
37    sprintf(res, "%x", v);
38  else
39    sprintf(res, "-%x", (UINT8)(-v));
40  return res;
41}
42
43static const char *i16str(INT16 v)
44{
45  static char res[6];
46  if(v>=0)
47    sprintf(res, "%x", v);
48  else
49    sprintf(res, "-%x", (UINT16)(-v));
50  return res;
51}
52
53static const char *i24str(INT32 v)
54{
55  static char res[8];
56  if(v>=0)
57    sprintf(res, "%x", v);
58  else
59    sprintf(res, "-%x", -v);
60  return res;
61}
62
63
64int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom)
65{
66   UINT8 opcode;
67
68   sOpROM = oprom;
69   sBasePC = pc;
70
71   opcode = program_read_byte(pc);
72   switch(opcode) {
73   case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07:
74   case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f:
75      sprintf(buffer, "mov d%d, (a%d)", opcode & 3, (opcode>>2) & 3);
76      return 1;
77
78   case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
79   case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f:
80      sprintf(buffer, "movb d%d, (a%d)", opcode & 3, (opcode>>2) & 3);
81      return 1;
82
83   case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27:
84   case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f:
85      sprintf(buffer, "mov (a%d), d%d", (opcode>>2) & 3, opcode & 3);
86      return 1;
87
88   case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37:
89   case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f:
90      sprintf(buffer, "movbu (a%d), d%d", (opcode>>2) & 3, opcode & 3);
91      return 1;
92
93   case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47:
94   case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f:
95      sprintf(buffer, "mov d%d, (%s, a%d)", opcode & 3, i8str(program_read_byte(pc+1)), (opcode>>2) & 3);
96      return 2;
97
98   case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57:
99   case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f:
100      sprintf(buffer, "mov a%d, (%s, a%d)", opcode & 3, i8str(program_read_byte(pc+1)), (opcode>>2) & 3);
101      return 2;
102
103   case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67:
104   case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f:
105      sprintf(buffer, "mov (%s, a%d), d%d", i8str(program_read_byte(pc+1)), (opcode>>2) & 3, opcode & 3);
106      return 2;
107
108   case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77:
109   case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f:
110      sprintf(buffer, "mov (%s, a%d), a%d", i8str(program_read_byte(pc+1)), (opcode>>2) & 3, opcode & 3);
111      return 2;
112
113   case 0x81: case 0x82: case 0x83: case 0x84: case 0x86: case 0x87:
114   case 0x88: case 0x89: case 0x8b: case 0x8c: case 0x8d: case 0x8e:
115      sprintf(buffer, "mov d%d, d%d", (opcode>>2) & 3, opcode & 3);
116      return 1;
117
118   case 0x80: case 0x85: case 0x8a: case 0x8f:
119      sprintf(buffer, "mov %s, d%d", i8str(program_read_byte(pc+1)), opcode & 3);
120      return 2;
121
122   case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97:
123   case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
124      sprintf(buffer, "add d%d, d%d", (opcode>>2) & 3, opcode & 3);
125      return 1;
126
127   case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7:
128   case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf:
129      sprintf(buffer, "sub d%d, d%d", (opcode>>2) & 3, opcode & 3);
130      return 1;
131
132   case 0xb0: case 0xb1: case 0xb2: case 0xb3:
133      sprintf(buffer, "extx d%d", opcode & 3);
134      return 1;
135
136   case 0xb4: case 0xb5: case 0xb6: case 0xb7:
137      sprintf(buffer, "extxu d%d", opcode & 3);
138      return 1;
139
140   case 0xb8: case 0xb9: case 0xba: case 0xbb:
141      sprintf(buffer, "extxb d%d", opcode & 3);
142      return 1;
143
144   case 0xbc: case 0xbd: case 0xbe: case 0xbf:
145      sprintf(buffer, "extxbu d%d", opcode & 3);
146      return 1;
147
148   case 0xc0: case 0xc1: case 0xc2: case 0xc3:
149      sprintf(buffer, "mov d%d, (%x)", opcode & 3, r16u(pc+1));
150      return 3;
151
152   case 0xc4: case 0xc5: case 0xc6: case 0xc7:
153      sprintf(buffer, "movb d%d, (%04x)", opcode & 3, r16u(pc+1));
154      return 3;
155
156   case 0xc8: case 0xc9: case 0xca: case 0xcb:
157      sprintf(buffer, "mov (%04x), d%d", r16u(pc+1), opcode & 3);
158      return 3;
159
160   case 0xcc: case 0xcd: case 0xce: case 0xcf:
161      sprintf(buffer, "movbu (%04x), d%d", r16u(pc+1), opcode & 3);
162      return 3;
163
164   case 0xd0: case 0xd1: case 0xd2: case 0xd3:
165      sprintf(buffer, "add %s, a%d", i8str(program_read_byte(pc+1)), opcode & 3);
166      return 2;
167
168   case 0xd4: case 0xd5: case 0xd6: case 0xd7:
169      sprintf(buffer, "add %s, d%d", i8str(program_read_byte(pc+1)), opcode & 3);
170      return 2;
171
172   case 0xd8: case 0xd9: case 0xda: case 0xdb:
173      sprintf(buffer, "cmp %s, d%d", i8str(program_read_byte(pc+1)), opcode & 3);
174      return 2;
175
176   case 0xdc: case 0xdd: case 0xde: case 0xdf:
177      sprintf(buffer, "move %x, a%d", r16u(pc+1), opcode & 3);
178      return 3;
179
180   case 0xe0:
181      sprintf(buffer, "blt %x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff);
182      return 2;
183
184   case 0xe1:
185      sprintf(buffer, "bgt %x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff);
186      return 2;
187
188   case 0xe2:
189      sprintf(buffer, "bge %x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff);
190      return 2;
191
192   case 0xe3:
193      sprintf(buffer, "ble %x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff);
194      return 2;
195
196   case 0xe4:
197      sprintf(buffer, "bcs %x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff);
198      return 2;
199
200   case 0xe5:
201      sprintf(buffer, "bhi %x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff);
202      return 2;
203
204   case 0xe6:
205      sprintf(buffer, "bcc %x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff);
206      return 2;
207
208   case 0xe7:
209      sprintf(buffer, "bls %x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff);
210      return 2;
211
212   case 0xe8:
213      sprintf(buffer, "beq %x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff);
214      return 2;
215
216   case 0xe9:
217      sprintf(buffer, "bne %x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff);
218      return 2;
219
220   case 0xea:
221      sprintf(buffer, "bra %x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff);
222      return 2;
223
224   case 0xeb:
225      sprintf(buffer, "rti");
226      return 1;
227
228   case 0xec: case 0xed: case 0xee: case 0xef:
229      sprintf(buffer, "cmp %x, a%d", r16u(pc+1), opcode & 3);
230      return 3;
231
232   case 0xf0:
233      opcode = program_read_byte(pc+1);
234      switch(opcode) {
235      case 0x00: case 0x04: case 0x08: case 0x0c:
236         sprintf(buffer, "jmp (a%d)", (opcode>>2) & 3);
237         return 2;
238
239      case 0x01: case 0x05: case 0x09: case 0x0d:
240         sprintf(buffer, "jsr (a%d)", (opcode>>2) & 3);
241         return 2;
242
243      case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27:
244      case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f:
245         sprintf(buffer, "bset d%d, (a%d)", opcode & 3, (opcode>>2) & 3);
246         return 2;
247
248      case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37:
249      case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f:
250         sprintf(buffer, "bclr d%d, (a%d)", opcode & 3, (opcode>>2) & 3);
251         return 2;
252
253      case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47:
254      case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f:
255      case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57:
256      case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f:
257      case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67:
258      case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f:
259      case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77:
260      case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f:
261         sprintf(buffer, "movb (d%d, a%d), d%d", (opcode>>4) & 3, (opcode>>2) & 3, opcode & 3);
262         return 2;
263
264      case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87:
265      case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f:
266      case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97:
267      case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
268      case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7:
269      case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf:
270      case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7:
271      case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf:
272         sprintf(buffer, "movbu (d%d, a%d), d%d", (opcode>>4) & 3, (opcode>>2) & 3, opcode & 3);
273         return 2;
274
275      case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7:
276      case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf:
277      case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7:
278      case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf:
279      case 0xe0: case 0xe1: case 0xe2: case 0xe3: case 0xe4: case 0xe5: case 0xe6: case 0xe7:
280      case 0xe8: case 0xe9: case 0xea: case 0xeb: case 0xec: case 0xed: case 0xee: case 0xef:
281      case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7:
282      case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff:
283         sprintf(buffer, "movb d%d, (d%d, a%d)", opcode & 3, (opcode>>4) & 3, (opcode>>2) & 3);
284         return 2;
285
286      default:
287         goto illegal2;
288      }
289      break;
290
291   case 0xf1:
292      opcode = program_read_byte(pc+1);
293      switch(opcode>>6) {
294      case 0x00:
295         sprintf(buffer, "mov (d%d, a%d), a%d", (opcode>>4) & 3, (opcode>>2) & 3, opcode & 3);
296         return 2;
297
298      case 0x01:
299         sprintf(buffer, "mov (d%d, a%d), d%d", (opcode>>4) & 3, (opcode>>2) & 3, opcode & 3);
300         return 2;
301
302      case 0x02:
303         sprintf(buffer, "mov a%d, (d%d, a%d)", opcode & 3, (opcode>>4) & 3, (opcode>>2) & 3);
304         return 2;
305
306      case 0x03:
307         sprintf(buffer, "mov d%d, (d%d, a%d)", opcode & 3, (opcode>>4) & 3, (opcode>>2) & 3);
308         return 2;
309
310      default:
311         goto illegal2;
312      }
313      break;
314
315   case 0xf2:
316      opcode = program_read_byte(pc+1);
317      switch(opcode>>4) {
318      case 0x0:
319         sprintf(buffer, "add d%d, a%d", (opcode>>2) & 3, opcode & 3);
320         return 2;
321
322      case 0x1:
323         sprintf(buffer, "sub d%d, a%d", (opcode>>2) & 3, opcode & 3);
324         return 2;
325
326      case 0x2:
327         sprintf(buffer, "cmp d%d, a%d", (opcode>>2) & 3, opcode & 3);
328         return 2;
329
330      case 0x3:
331         sprintf(buffer, "mov d%d, a%d", (opcode>>2) & 3, opcode & 3);
332         return 2;
333
334      case 0x4:
335         sprintf(buffer, "add a%d, a%d", (opcode>>2) & 3, opcode & 3);
336         return 2;
337
338      case 0x5:
339         sprintf(buffer, "sub a%d, a%d", (opcode>>2) & 3, opcode & 3);
340         return 2;
341
342      case 0x6:
343         sprintf(buffer, "cmp a%d, a%d", (opcode>>2) & 3, opcode & 3);
344         return 2;
345
346      case 0x7:
347         sprintf(buffer, "mov a%d, a%d", (opcode>>2) & 3, opcode & 3);
348         return 2;
349
350      case 0x8:
351         sprintf(buffer, "addc d%d, d%d", (opcode>>2) & 3, opcode & 3);
352         return 2;
353
354      case 0x9:
355         sprintf(buffer, "subc d%d, d%d", (opcode>>2) & 3, opcode & 3);
356         return 2;
357
358      case 0xc:
359         sprintf(buffer, "add a%d, d%d", (opcode>>2) & 3, opcode & 3);
360         return 2;
361
362      case 0xd:
363         sprintf(buffer, "sub a%d, d%d", (opcode>>2) & 3, opcode & 3);
364         return 2;
365
366      case 0xe:
367         sprintf(buffer, "cmp a%d, d%d", (opcode>>2) & 3, opcode & 3);
368         return 2;
369
370      case 0xf:
371         sprintf(buffer, "mov a%d, d%d", (opcode>>2) & 3, opcode & 3);
372         return 2;
373
374      default:
375         goto illegal2;
376      }
377      break;
378
379   case 0xf3:
380      opcode = program_read_byte(pc+1);
381      switch(opcode) {
382      case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07:
383      case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f:
384         sprintf(buffer, "and d%d, d%d", (opcode>>2) & 3, opcode & 3);
385         return 2;
386
387      case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
388      case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f:
389         sprintf(buffer, "or d%d, d%d", (opcode>>2) & 3, opcode & 3);
390         return 2;
391
392      case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27:
393      case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f:
394         sprintf(buffer, "xor d%d, d%d", (opcode>>2) & 3, opcode & 3);
395         return 2;
396
397      case 0x30: case 0x31: case 0x32: case 0x33:
398         sprintf(buffer, "rol d%d", opcode & 3);
399         return 2;
400
401      case 0x34: case 0x35: case 0x36: case 0x37:
402         sprintf(buffer, "ror d%d", opcode & 3);
403         return 2;
404
405      case 0x38: case 0x39: case 0x3a: case 0x3b:
406         sprintf(buffer, "asr d%d", opcode & 3);
407         return 2;
408
409      case 0x3c: case 0x3d: case 0x3e: case 0x3f:
410         sprintf(buffer, "lsr d%d", opcode & 3);
411         return 2;
412
413      case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47:
414      case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f:
415         sprintf(buffer, "mul d%d, d%d", (opcode>>2) & 3, opcode & 3);
416         return 2;
417
418      case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57:
419      case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f:
420         sprintf(buffer, "mulu d%d, d%d", (opcode>>2) & 3, opcode & 3);
421         return 2;
422
423      case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67:
424      case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f:
425         sprintf(buffer, "divu d%d, d%d", (opcode>>2) & 3, opcode & 3);
426         return 2;
427
428      case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97:
429      case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
430         sprintf(buffer, "cmp d%d, d%d", (opcode>>2) & 3, opcode & 3);
431         return 2;
432
433      case 0xc0: case 0xc4: case 0xc8: case 0xcc:
434         sprintf(buffer, "mov d%d, mdr", (opcode>>2) & 3);
435         return 2;
436
437      case 0xc1: case 0xc5: case 0xc9: case 0xcd:
438         sprintf(buffer, "ext d%d", (opcode>>2) & 3);
439         return 2;
440
441      case 0xd0: case 0xd4: case 0xd8: case 0xdc:
442         sprintf(buffer, "mov d%d, psw", (opcode>>2) & 3);
443         return 2;
444
445      case 0xe0: case 0xe1: case 0xe2: case 0xe3:
446         sprintf(buffer, "mov mdr, d%d", opcode & 3);
447         return 2;
448
449      case 0xe4: case 0xe5: case 0xe6: case 0xe7:
450         sprintf(buffer, "not d%d", opcode & 3);
451         return 2;
452
453      case 0xf0: case 0xf1: case 0xf2: case 0xf3:
454         sprintf(buffer, "mov psw, d%d", opcode & 3);
455         return 2;
456
457      case 0xfc:
458         sprintf(buffer, "pxst");
459         return 2;
460
461      case 0xfe:
462         opcode = program_read_byte(pc+2);
463         switch(opcode) {
464         case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7:
465            sprintf(buffer, "tbz (%x) %d, %x", r24u(pc+3), opcode & 7,
466               (pc+7+(INT8)program_read_byte(pc+6)) & 0xffffff);
467            return 7;
468
469         case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf:
470            sprintf(buffer, "tbnz (%x) %d, %x", r24u(pc+3), opcode & 7,
471               (pc+7+(INT8)program_read_byte(pc+6)) & 0xffffff);
472            return 7;
473
474         case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7:
475            sprintf(buffer, "bset (%x) %d", r24u(pc+2), opcode & 7);
476            return 6;
477
478         case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf:
479            sprintf(buffer, "bclr (%x) %d", r24u(pc+2), opcode & 7);
480            return 6;
481
482         default:
483            goto illegal3;
484         }
485         break;
486
487      case 0xff:
488         opcode = program_read_byte(pc+2);
489         switch(opcode) {
490         case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87:
491         case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f:
492            sprintf(buffer, "tbz (%s, a%d) %d, %x", i8str(program_read_byte(pc+3)), 2+((opcode>>3)&1), opcode & 7,
493               (pc+5+(INT8)program_read_byte(pc+4)) & 0xffffff);
494            return 5;
495
496         case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97:
497         case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
498            sprintf(buffer, "bset (%s, a%d) %d", i8str(program_read_byte(pc+3)), 2+((opcode>>3)&1), opcode & 7);
499            return 4;
500
501         case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7:
502         case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf:
503            sprintf(buffer, "tbnz (%s, a%d) %d, %x", i8str(program_read_byte(pc+3)), 2+((opcode>>3)&1), opcode & 7,
504               (pc+5+(INT8)program_read_byte(pc+4)) & 0xffffff);
505            return 5;
506
507         case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7:
508         case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf:
509            sprintf(buffer, "bclr (%s, a%d) %d", i8str(program_read_byte(pc+3)), 2+((opcode>>3)&1), opcode & 7);
510            return 4;
511
512         default:
513            goto illegal3;
514         }
515         break;
516
517      default:
518         goto illegal2;
519      }
520      break;
521
522   case 0xf4:
523      opcode = program_read_byte(pc+1);
524      switch(opcode) {
525      case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07:
526      case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f:
527         sprintf(buffer, "mov d%d, (%s, a%d)", opcode & 3, i24str(r24s(pc+2)), (opcode>>2) & 3);
528         return 5;
529
530      case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
531      case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f:
532         sprintf(buffer, "mov a%d, (%s, a%d)", opcode & 3, i24str(r24s(pc+2)), (opcode>>2) & 3);
533         return 5;
534
535      case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27:
536      case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f:
537         sprintf(buffer, "movb d%d, (%s, a%d)", opcode & 3, i24str(r24s(pc+2)), (opcode>>2) & 3);
538         return 5;
539
540      case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37:
541      case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f:
542         sprintf(buffer, "movx d%d, (%s, a%d)", opcode & 3, i24str(r24s(pc+2)), (opcode>>2) & 3);
543         return 5;
544
545      case 0x40: case 0x41: case 0x42: case 0x43:
546         sprintf(buffer, "mov d%d, (%x)", opcode & 3, r24u(pc+2));
547         return 5;
548
549      case 0x44: case 0x45: case 0x46: case 0x47:
550         sprintf(buffer, "movb d%d, (%x)", opcode & 3, r24u(pc+2));
551         return 5;
552
553      #if 0 // huh?
554      case 0x4b:
555         sprintf(buffer, "bset %02x, (%x)", program_read_byte(pc+5), r24u(pc+2));
556         return 6;
557
558      case 0x4f:
559         sprintf(buffer, "bclr %02x, (%x)", program_read_byte(pc+5), r24u(pc+2));
560         return 6;
561      #endif
562
563      case 0x50: case 0x51: case 0x52: case 0x53:
564         sprintf(buffer, "mov a%d, (%x)", opcode & 3, r24u(pc+2));
565         return 5;
566
567      case 0x60: case 0x61: case 0x62: case 0x63:
568         sprintf(buffer, "add %s, d%d", i24str(r24s(pc+2)), opcode & 3);
569         return 5;
570
571      case 0x64: case 0x65: case 0x66: case 0x67:
572         sprintf(buffer, "add %s, a%d", i24str(r24s(pc+2)), opcode & 3);
573         return 5;
574
575      case 0x68: case 0x69: case 0x6a: case 0x6b:
576         sprintf(buffer, "sub %s, d%d", i24str(r24s(pc+2)), opcode & 3);
577         return 5;
578
579      case 0x6c: case 0x6d: case 0x6e: case 0x6f:
580         sprintf(buffer, "sub %s, a%d", i24str(r24s(pc+2)), opcode & 3);
581         return 5;
582
583      case 0x70: case 0x71: case 0x72: case 0x73:
584         sprintf(buffer, "mov %s, d%d", i24str(r24s(pc+2)), opcode & 3);
585         return 5;
586
587      case 0x74: case 0x75: case 0x76: case 0x77:
588         sprintf(buffer, "mov %x, a%d", r24u(pc+2), opcode & 3);
589         return 5;
590
591      case 0x78: case 0x79: case 0x7a: case 0x7b:
592         sprintf(buffer, "cmp %s, d%d", i24str(r24s(pc+2)), opcode & 3);
593         return 5;
594
595      case 0x7c: case 0x7d: case 0x7e: case 0x7f:
596         sprintf(buffer, "cmp %x, a%d", r24u(pc+2), opcode & 3);
597         return 5;
598
599      case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87:
600      case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f:
601         sprintf(buffer, "mov (%s, a%d), d%d", i24str(r24s(pc+2)), (opcode>>2) & 3, opcode & 3);
602         return 5;
603
604      case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97:
605      case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
606         sprintf(buffer, "movbu (%s, a%d), d%d", i24str(r24s(pc+2)), (opcode>>2) & 3, opcode & 3);
607         return 5;
608
609      case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7:
610      case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf:
611         sprintf(buffer, "movb (%s, a%d), d%d", i24str(r24s(pc+2)), (opcode>>2) & 3, opcode & 3);
612         return 5;
613
614      case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7:
615      case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf:
616         sprintf(buffer, "movx (%s, a%d), d%d", i24str(r24s(pc+2)), (opcode>>2) & 3, opcode & 3);
617         return 5;
618
619      case 0xc0: case 0xc1: case 0xc2: case 0xc3:
620         sprintf(buffer, "mov (%x), d%d", r24u(pc+2), opcode & 3);
621         return 5;
622
623      case 0xc4: case 0xc5: case 0xc6: case 0xc7:
624         sprintf(buffer, "movb (%x), d%d", r24u(pc+2), opcode & 3);
625         return 5;
626
627      case 0xc8: case 0xc9: case 0xca: case 0xcb:
628         sprintf(buffer, "movbu (%x), d%d", r24u(pc+2), opcode & 3);
629         return 5;
630
631      case 0xd0: case 0xd1: case 0xd2: case 0xd3:
632         sprintf(buffer, "mov (%x), a%d", r24u(pc+2), opcode & 3);
633         return 5;
634
635      case 0xe0:
636         sprintf(buffer, "jmp %x", (pc+5+r24s(pc+2)) & 0xffffff);
637         return 5;
638
639      case 0xe1:
640         sprintf(buffer, "jsr %x", (pc+5+r24s(pc+2)) & 0xffffff);
641         return 5;
642
643      case 0xe3:
644         sprintf(buffer, "bset %02x, (%x)", program_read_byte(pc+4), r16u(pc+2));
645         return 6;
646
647      case 0xe7:
648         sprintf(buffer, "bclr %02x, (%x)", program_read_byte(pc+4), r16u(pc+2));
649         return 6;
650
651      case 0xe8: case 0xe9: case 0xea: case 0xeb:
652         sprintf(buffer, "bset %02x, (%s, a%d)", program_read_byte(pc+3), i8str(program_read_byte(pc+2)), opcode & 3);
653         return 4;
654
655      case 0xec: case 0xed: case 0xee: case 0xef:
656         sprintf(buffer, "bclr %02x, (%s, a%d)", program_read_byte(pc+3), i8str(program_read_byte(pc+2)), opcode & 3);
657         return 4;
658
659      case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7:
660      case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff:
661         sprintf(buffer, "mov (%s, a%d), a%d", i24str(r24s(pc+2)), (opcode>>2) & 3, opcode & 3);
662         return 5;
663
664      default:
665         goto illegal2;
666      }
667      break;
668
669   case 0xf5:
670      opcode = program_read_byte(pc+1);
671      switch(opcode) {
672      case 0x00: case 0x01: case 0x02: case 0x03:
673         sprintf(buffer, "and %02x, d%d", program_read_byte(pc+2), opcode & 3);
674         return 3;
675
676      case 0x04: case 0x05: case 0x06: case 0x07:
677         sprintf(buffer, "btst %02x, d%d", program_read_byte(pc+2), opcode & 3);
678         return 3;
679
680      case 0x08: case 0x09: case 0x0a: case 0x0b:
681         sprintf(buffer, "or %02x, d%d", program_read_byte(pc+2), opcode & 3);
682         return 3;
683
684      case 0x0c: case 0x0d: case 0x0e: case 0x0f:
685         sprintf(buffer, "addnf %s, a%d", i8str(program_read_byte(pc+2)), opcode & 3);
686         return 3;
687
688      case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
689      case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f:
690         sprintf(buffer, "movb d%d, (%s, a%d)", opcode & 3, i8str(program_read_byte(pc+2)), (opcode>>2) & 3);
691         return 3;
692
693      case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27:
694      case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f:
695         sprintf(buffer, "movb (%s, a%d), d%d", i8str(program_read_byte(pc+2)), (opcode>>2) & 3, opcode & 3);
696         return 3;
697
698      case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37:
699      case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f:
700         sprintf(buffer, "movbu (%s, a%d), d%d", i8str(program_read_byte(pc+2)), (opcode>>2) & 3, opcode & 3);
701         return 3;
702
703      case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47:
704      case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: {
705         UINT8 opcode2 = program_read_byte(pc+2);
706         switch(opcode2) {
707         case 0x00:
708            sprintf(buffer, "mulql d%d, d%d", (opcode>>3) & 3, opcode & 3);
709            return 3;
710
711         case 0x01:
712            sprintf(buffer, "mulqh d%d, d%d", (opcode>>3) & 3, opcode & 3);
713            return 3;
714
715         default:
716            goto illegal3;
717         }
718         break;
719      }
720
721      case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57:
722      case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f:
723         sprintf(buffer, "movx d%d, (%s, a%d)", opcode & 3, i8str(program_read_byte(pc+2)), (opcode>>2) & 3);
724         return 3;
725
726      case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67:
727      case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: {
728         UINT8 opcode2 = program_read_byte(pc+2);
729         switch(opcode2) {
730         case 0x10:
731            sprintf(buffer, "mulq d%d, d%d", (opcode>>3) & 3, opcode & 3);
732            return 3;
733
734         default:
735            goto illegal3;
736         }
737         break;
738      }
739
740      case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77:
741      case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f:
742         sprintf(buffer, "movx (%s, a%d), d%d", i8str(program_read_byte(pc+2)), (opcode>>2) & 3, opcode & 3);
743         return 3;
744
745      case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87:
746      case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f:
747         sprintf(buffer, "tbz (%s, a%d) %d, %x", i8str(program_read_byte(pc+2)), (opcode>>3)&1, opcode & 7,
748               (pc+4+(INT8)program_read_byte(pc+3)) & 0xffffff);
749         return 4;
750
751      case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97:
752      case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
753         sprintf(buffer, "bset (%s, a%d) %d", i8str(program_read_byte(pc+2)), (opcode>>3)&1, opcode & 7);
754         return 3;
755
756      case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7:
757      case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf:
758         sprintf(buffer, "tbnz (%s, a%d) %d, %x", i8str(program_read_byte(pc+2)), (opcode>>3)&1, opcode & 7,
759               (pc+4+(INT8)program_read_byte(pc+3)) & 0xffffff);
760         return 4;
761
762      case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7:
763      case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf:
764         sprintf(buffer, "bclr (%s, a%d) %d", i8str(program_read_byte(pc+2)), (opcode>>3)&1, opcode & 7);
765         return 3;
766
767      case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7:
768         sprintf(buffer, "tbz (%x) %d, %x", r16u(pc+2), opcode & 7,
769               (pc+5+(INT8)program_read_byte(pc+4)) & 0xffffff);
770         return 5;
771
772      case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf:
773         sprintf(buffer, "tbnz (%x) %d, %x", r16u(pc+2), opcode & 7,
774               (pc+5+(INT8)program_read_byte(pc+4)) & 0xffffff);
775         return 5;
776
777      case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7:
778         sprintf(buffer, "bset (%x) %d", r16u(pc+2), opcode & 7);
779         return 4;
780
781      case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf:
782         sprintf(buffer, "bclr (%x) %d", r16u(pc+2), opcode & 7);
783         return 4;
784
785      case 0xe0:
786         sprintf(buffer, "bltx %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
787         return 3;
788
789      case 0xe1:
790         sprintf(buffer, "bgtx %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
791         return 3;
792
793      case 0xe2:
794         sprintf(buffer, "bgex %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
795         return 3;
796
797      case 0xe3:
798         sprintf(buffer, "blex %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
799         return 3;
800
801      case 0xe4:
802         sprintf(buffer, "bcsx %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
803         return 3;
804
805      case 0xe5:
806         sprintf(buffer, "bhix %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
807         return 3;
808
809      case 0xe6:
810         sprintf(buffer, "bccx %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
811         return 3;
812
813      case 0xe7:
814         sprintf(buffer, "blsx %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
815         return 3;
816
817      case 0xe8:
818         sprintf(buffer, "beqx %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
819         return 3;
820
821      case 0xe9:
822         sprintf(buffer, "bnex %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
823         return 3;
824
825      case 0xec:
826         sprintf(buffer, "bvcx %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
827         return 3;
828
829      case 0xed:
830         sprintf(buffer, "bvsx %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
831         return 3;
832
833      case 0xee:
834         sprintf(buffer, "bncx %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
835         return 3;
836
837      case 0xef:
838         sprintf(buffer, "bnsx %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
839         return 3;
840
841      case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7: {
842         UINT8 opcode2 = program_read_byte(pc+2);
843         switch(opcode2) {
844         case 0x04:
845            sprintf(buffer, "mulql %s, d%d", i8str(program_read_byte(pc+3)), opcode & 3);
846            return 4;
847
848         case 0x05:
849            sprintf(buffer, "mulqh %s, d%d", i8str(program_read_byte(pc+3)), opcode & 3);
850            return 4;
851
852         case 0x08:
853            sprintf(buffer, "mulql %s, d%d", i16str(r16s(pc+3)), opcode & 3);
854            return 5;
855
856         case 0x09:
857            sprintf(buffer, "mulqh %s, d%d", i16str(r16s(pc+3)), opcode & 3);
858            return 5;
859
860         default:
861            goto illegal3;
862         }
863         break;
864      }
865
866      case 0xfc:
867         sprintf(buffer, "bvc %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
868         return 3;
869
870      case 0xfd:
871         sprintf(buffer, "bvs %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
872         return 3;
873
874      case 0xfe:
875         sprintf(buffer, "bnc %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
876         return 3;
877
878      case 0xff:
879         sprintf(buffer, "bns %x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff);
880         return 3;
881
882      default:
883         goto illegal2;
884      }
885      break;
886
887   case 0xf6:
888      sprintf(buffer, "nop");
889      return 1;
890
891   case 0xf7:
892      opcode = program_read_byte(pc+1);
893      switch(opcode) {
894      case 0x00: case 0x01: case 0x02: case 0x03:
895         sprintf(buffer, "and %04x, d%d", r16u(pc+2), opcode & 3);
896         return 4;
897
898      case 0x04: case 0x05: case 0x06: case 0x07:
899         sprintf(buffer, "btst %04x, d%d", r16u(pc+2), opcode & 3);
900         return 4;
901
902      case 0x08: case 0x09: case 0x0a: case 0x0b:
903         sprintf(buffer, "add %s, a%d", i16str(r16s(pc+2)), opcode & 3);
904         return 4;
905
906      case 0x0c: case 0x0d: case 0x0e: case 0x0f:
907         sprintf(buffer, "sub %s, a%d", i16str(r16s(pc+2)), opcode & 3);
908         return 4;
909
910      case 0x10:
911         sprintf(buffer, "and %04x, psw", r16u(pc+2));
912         return 4;
913
914      case 0x14:
915         sprintf(buffer, "or %04x, psw", r16u(pc+2));
916         return 4;
917
918      case 0x18: case 0x19: case 0x1a: case 0x1b:
919         sprintf(buffer, "add %s, d%d", i16str(r16u(pc+2)), opcode & 3);
920         return 4;
921
922      case 0x1c: case 0x1d: case 0x1e: case 0x1f:
923         sprintf(buffer, "sub %s, d%d", i16str(r16s(pc+2)), opcode & 3);
924         return 4;
925
926      case 0x20: case 0x21: case 0x22: case 0x23:
927         sprintf(buffer, "move a%d, (%x)", opcode & 3, r16u(pc+2));
928         return 4;
929
930      case 0x30: case 0x31: case 0x32: case 0x33:
931         sprintf(buffer, "move (%x), a%d", r16u(pc+2), opcode & 3);
932         return 4;
933
934      case 0x40: case 0x41: case 0x42: case 0x43:
935         sprintf(buffer, "or %04x, d%d", r16u(pc+2), opcode & 3);
936         return 4;
937
938      case 0x48: case 0x49: case 0x4a: case 0x4b:
939         sprintf(buffer, "cmp %s, d%d", i16str(r16u(pc+2)), opcode & 3);
940         return 4;
941
942      case 0x4c: case 0x4d: case 0x4e: case 0x4f:
943         sprintf(buffer, "xor %04x, d%d", r16u(pc+2), opcode & 3);
944         return 4;
945
946      case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57:
947      case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f:
948         sprintf(buffer, "movbu (%s, a%d), d%d", i16str(r16s(pc+2)), (opcode>>2) & 3, opcode & 3);
949         return 4;
950
951      case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67:
952      case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f:
953         sprintf(buffer, "movx d%d, (%s, a%d)", opcode & 3, i16str(r16s(pc+2)), (opcode>>2) & 3);
954         return 4;
955
956      case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77:
957      case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f:
958         sprintf(buffer, "movx (%s, a%d), d%d", i16str(r16s(pc+2)), (opcode>>2) & 3, opcode & 3);
959         return 4;
960
961      case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87:
962      case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f:
963         sprintf(buffer, "mov d%d, (%s, a%d)", opcode & 3, i16str(r16s(pc+2)), (opcode>>2) & 3);
964         return 4;
965
966      case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97:
967      case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
968         sprintf(buffer, "movb d%d, (%s, a%d)", opcode & 3, i16str(r16s(pc+2)), (opcode>>2) & 3);
969         return 4;
970
971      case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7:
972      case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf:
973         sprintf(buffer, "mov a%d, (%s, a%d)", opcode & 3, i16str(r16s(pc+2)), (opcode>>2) & 3);
974         return 4;
975
976      case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7:
977      case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf:
978         sprintf(buffer, "mov (%s, a%d), a%d", i16str(r16s(pc+2)), (opcode>>2) & 3, opcode & 3);
979         return 4;
980
981      case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7:
982      case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf:
983         sprintf(buffer, "mov (%s, a%d), d%d", i16str(r16s(pc+2)), (opcode>>2) & 3, opcode & 3);
984         return 4;
985
986      case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7:
987      case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf:
988         sprintf(buffer, "movb (%s, a%d), d%d", i16str(r16s(pc+2)), (opcode>>2) & 3, opcode & 3);
989         return 4;
990
991      default:
992         goto illegal2;
993      }
994      break;
995
996   case 0xf8: case 0xf9: case 0xfa: case 0xfb:
997      sprintf(buffer, "mov %s, d%d", i16str(r16s(pc+1)), opcode & 3);
998      return 3;
999
1000   case 0xfc:
1001      sprintf(buffer, "jmp %x", (pc+3+r16s(pc+1)) & 0xffffff);
1002      return 3;
1003
1004   case 0xfd:
1005      sprintf(buffer, "jsr %x", (pc+3+r16s(pc+1)) & 0xffffff);
1006      return 3;
1007
1008   case 0xfe:
1009      sprintf(buffer, "rts");
1010      return 1;
1011
1012   default:
1013      goto illegal1;
1014   };
1015
1016   illegal1:
1017      sprintf(buffer, "dc.b %02x", program_read_byte(pc));
1018      return 1;
1019
1020   illegal2:
1021      sprintf(buffer, "dc.b %02x %02x", program_read_byte(pc), program_read_byte(pc+1));
1022      return 2;
1023
1024   illegal3:
1025      sprintf(buffer, "dc.b %02x %02x %02x", program_read_byte(pc), program_read_byte(pc+1), program_read_byte(pc+2));
1026      return 3;
1027}
1028
1029CPU_DISASSEMBLE( mn10200 )
1030{
1031   return mn102_disassemble(buffer, pc, oprom);
1032}
1033
src/emu/cpu/apexc/apexcdsm.c
r7356r7357
5252    For vector instructions, replace the first space on the right of the mnemonic
5353    with a 'v'.
5454
55   01-Feb-2010 (Robbbert):
56   I've added the actual address, (as shown in the extreme left of the debugger
57   output), so that you can see much easier how the program will flow. Example:
55    01-Feb-2010 (Robbbert):
56    I've added the actual address, (as shown in the extreme left of the debugger
57    output), so that you can see much easier how the program will flow. Example:
5858
59   +C  XXX(##/##)   XXX(##/##)
59    +C  XXX(##/##)   XXX(##/##)
6060
61   The X value shows where the data word is located, and the Y value is the
62   address of the next instruction.
61    The X value shows where the data word is located, and the Y value is the
62    address of the next instruction.
6363*/
6464enum _format_type {branch, shiftl, shiftr, multiply, store, swap, one_address, two_address};
6565typedef enum _format_type format_type;
src/emu/video/hd63484.c
r7356r7357
66  This chip is used in:
77  - shanghai.c
88  - adp.c
9  - sigmab52.c
910
11  ACRTC memory map:
12
13  00000-3ffff = RAM
14  40000-7ffff = ROM     handled with a hack in the drivers
15  80000-bffff = unused
16  c0000-fffff = unused
17
1018***************************************************************************/
1119
1220#include "emu.h"
src/emu/emuopts.c
r7356r7357
130130   { "joystick_deadzone;joy_deadzone;jdz",      "0.3",  0,          "center deadzone range for joystick where change is ignored (0.0 center, 1.0 end)" },
131131   { "joystick_saturation;joy_saturation;jsat", "0.85", 0,          "end of axis saturation range for joystick where change is ignored (0.0 center, 1.0 end)" },
132132   { "natural;nat",             "0",        OPTION_BOOLEAN,    "specifies whether to use a natural keyboard or not" },
133   { "uimodekey;umk",               "auto",       0,               "specifies the key used to toggle between full and partial UI mode" },
134   
133   { "uimodekey;umk",             "auto",     0,              "specifies the key used to toggle between full and partial UI mode" },
135134
135
136136   /* input autoenable options */
137137   { NULL,                          NULL,        OPTION_HEADER,     "CORE INPUT AUTOMATIC ENABLE OPTIONS" },
138138   { "paddle_device;paddle",        "keyboard",  0,                 "enable (none|keyboard|mouse|lightgun|joystick) if a paddle control is present" },
r7356r7357
151151   { "update_in_pause",             "0",         OPTION_BOOLEAN,    "keep calling video updates while in pause" },
152152   { "debug;d",                     "0",         OPTION_BOOLEAN,    "enable/disable debugger" },
153153   { "debugscript",                 NULL,        0,                 "script for debugger" },
154   { "debug_internal;di",           "0",         OPTION_BOOLEAN,    "use the internal debugger for debugging" },
154155
155156   /* misc options */
156157   { NULL,                          NULL,        OPTION_HEADER,     "CORE MISC OPTIONS" },
src/emu/uiinput.c
r7356r7357
5959    FUNCTION PROTOYPES
6060***************************************************************************/
6161
62static void ui_input_frame_update(running_machine *machine);
62//static void ui_input_frame_update(running_machine *machine);
6363
6464
6565
r7356r7357
9595    corresponding IPT_UI_* events
9696-------------------------------------------------*/
9797
98static void ui_input_frame_update(running_machine *machine)
98void ui_input_frame_update(running_machine *machine)
9999{
100100   ui_input_private *uidata = machine->ui_input_data;
101101   int code;
src/emu/emuopts.h
r7356r7357
144144#define OPTION_VERBOSE            "verbose"
145145#define OPTION_LOG               "log"
146146#define OPTION_DEBUG            "debug"
147#define OPTION_DEBUG_INTERNAL      "debug_internal"
147148#define OPTION_DEBUGSCRIPT         "debugscript"
148149#define OPTION_UPDATEINPAUSE      "update_in_pause"
149150
src/emu/uiinput.h
r7356r7357
6161
6262/* ----- event handling ----- */
6363
64void ui_input_frame_update(running_machine *machine);
65
6466/* pushes a single event onto the queue */
6567int ui_input_push_event(running_machine *machine, ui_event event);
6668
src/emu/uimenu.c
r7356r7357
15351535   ui_mess_main_menu_populate(machine, menu);
15361536#endif /* MESS */
15371537
1538     /* add keyboard mode menu */
1539     if (input_machine_has_keyboard(machine) && inputx_can_post(machine))
1538   /* add keyboard mode menu */
1539   if (input_machine_has_keyboard(machine) && inputx_can_post(machine))
15401540      ui_menu_item_append(menu, "Keyboard Mode", NULL, 0, (void *)ui_menu_keyboard_mode);
15411541
15421542   /* add sliders menu */
src/emu/video.c
r7356r7357
1414#include "profiler.h"
1515#include "png.h"
1616#include "debugger.h"
17#include "debugint/debugint.h"
1718#include "rendutil.h"
1819#include "ui.h"
1920#include "aviio.h"
r7356r7357
13011302   /* draw the user interface */
13021303   ui_update_and_render(machine, render_container_get_ui());
13031304
1305   /* update the internal render debugger */
1306   debugint_update_during_game(machine);
1307
13041308   /* if we're throttling, synchronize before rendering */
13051309   if (!debug && !skipped_it && effective_throttle(machine))
13061310      update_throttle(machine, current_time);
src/emu/emu.mak
r7356r7357
2323   $(EMUOBJ)/cpu \
2424   $(EMUOBJ)/sound \
2525   $(EMUOBJ)/debug \
26   $(EMUOBJ)/debugint \
2627   $(EMUOBJ)/audio \
2728   $(EMUOBJ)/drivers \
2829   $(EMUOBJ)/machine \
r7356r7357
8687   $(EMUOBJ)/debug/debughlp.o \
8788   $(EMUOBJ)/debug/debugvw.o \
8889   $(EMUOBJ)/debug/express.o \
89   $(EMUOBJ)/debug/textbuf.o
90   $(EMUOBJ)/debug/textbuf.o \
91   $(EMUOBJ)/debugint/debugint.o
9092
9193ifdef PROFILER
9294EMUOBJS += \
r7356r7357
182184
183185EMUVIDEOOBJS = \
184186   $(EMUVIDEO)/generic.o \
187   $(EMUVIDEO)/hd63484.o \
185188   $(EMUVIDEO)/mc6845.o \
186189   $(EMUVIDEO)/poly.o \
187190   $(EMUVIDEO)/resnet.o \
src/emu/inptport.c
r7356r7357
25242524
25252525      /* hook for MESS's natural keyboard support */
25262526      input_port_update_hook(machine, port, &port->state->digital);
2527     
2527
25282528      /* handle playback/record */
25292529      playback_port(port);
25302530      record_port(port);
r7356r7357
53035303void inputx_post_utf8_rate(running_machine *machine, const char *text, attotime rate)
53045304{
53055305   inputx_postn_utf8_rate(machine, text, strlen(text), rate);
5306} 
5306}
53075307
53085308/***************************************************************************
53095309
src/emu/mame.c
r7356r7357
13161316
13171317      /* fetch core options */
13181318      sample_rate = options_get_int(mame_options(), OPTION_SAMPLERATE);
1319      debug_flags = options_get_bool(mame_options(), OPTION_DEBUG) ? (DEBUG_FLAG_ENABLED | DEBUG_FLAG_CALL_HOOK) : 0;
1319      if (options_get_bool(mame_options(), OPTION_DEBUG))
1320         debug_flags = (DEBUG_FLAG_ENABLED | DEBUG_FLAG_CALL_HOOK) | (options_get_bool(mame_options(), OPTION_DEBUG_INTERNAL) ? 0 : DEBUG_FLAG_OSD_ENABLED);
1321      else
1322         debug_flags = 0;
13201323   }
13211324   catch (std::bad_alloc &)
13221325   {
src/emu/machine/i8255a.c
r7356r7357
588588   i8255a->inte[PORT_A] = 0;
589589   i8255a->inte1 = 0;
590590   i8255a->inte2 = 0;
591   
591
592592   if (port_mode(i8255a, PORT_A) == MODE_OUTPUT)
593593   {
594594      devcb_call_write8(&i8255a->out_port_func[PORT_A], 0, i8255a->output[PORT_A]);
r7356r7357
612612   i8255a->ibf[PORT_B] = 0;
613613   i8255a->obf[PORT_B] = 1;
614614   i8255a->inte[PORT_B] = 0;
615   
615
616616   if (port_mode(i8255a, PORT_B) == MODE_OUTPUT)
617617   {
618618      devcb_call_write8(&i8255a->out_port_func[PORT_B], 0, i8255a->output[PORT_B]);
src/emu/mame.h
r7356r7357
6262#define DEBUG_FLAG_WPW_PROGRAM   0x00000100      /* watchpoints are enabled for PROGRAM memory writes */
6363#define DEBUG_FLAG_WPW_DATA      0x00000200      /* watchpoints are enabled for DATA memory writes */
6464#define DEBUG_FLAG_WPW_IO      0x00000400      /* watchpoints are enabled for IO memory writes */
65#define DEBUG_FLAG_OSD_ENABLED   0x00001000      /* The OSD debugger is enabled */
6566
6667
6768/* MESS vs. MAME abstractions */
src/emu/sound/zsg2.c
r0r7357
1/*
2    ZOOM ZSG-2 custom wavetable synthesizer
3
4    Written by Olivier Galibert
5    MAME conversion by R. Belmont
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10    ---------------------------------------------------------
11
12    Additional notes on the sample format, reverse-engineered
13    by Olivier Galibert and David Haywood:
14
15    The zoom sample rom is decomposed in 0x40000 bytes pages.  Each page
16    starts by a header and is followed by compressed samples.
17
18    The header is a vector of 16 bytes structures composed of 4 32bits
19    little-endian values representing:
20    - sample start position in bytes, always a multiple of 4
21    - sample end position in bytes, minus 4, always...
22    - loop position in bytes, always....
23    - flags, probably
24
25    It is interesting to note that this header is *not* parsed by the
26    ZSG.  The main program reads the rom through appropriate ZSG
27    commands, and use the results in subsequent register setups.  It's
28    not even obvious that the ZSG cares about the pages, it may just
29    see the address space as linear.  In the same line, the
30    interpretation of the flags is obviously dependant on the main
31    program, not the ZSG, but some of the bits are directly copied to
32    some of the registers.
33
34    The samples are compressed with a 2:1 ratio.  Each bloc of 4-bytes
35    becomes 4 16-bits samples.  Reading the 4 bytes as a *little-endian*
36    32bits values, the structure is:
37
38    1444 4444 1333 3333 1222 2222 ssss1111
39
40    's' is a 4-bit scale value.  '1', '2', '3', '4' are signed 7-bits
41    values corresponding to the 4 samples.  To compute the final 16bits
42    value just shift left by (9-s).  Yes, that simple.
43
44*/
45
46#include "emu.h"
47#include "streams.h"
48#include "zsg2.h"
49
50// 16 registers per channel, 48 channels
51typedef struct _zchan zchan;
52struct _zchan
53{
54   UINT16 v[16];
55};
56
57typedef struct _zsg2_state zsg2_state;
58struct _zsg2_state
59{
60   zchan zc[48];
61   UINT16 act[3];
62   UINT16 alow, ahigh;
63   UINT8 *bank_samples;
64
65   int sample_rate;
66   sound_stream *stream;
67};
68
69INLINE zsg2_state *get_safe_token(running_device *device)
70{
71   assert(device != NULL);
72   assert(device->token != NULL);
73   assert(device->type == SOUND);
74   assert(sound_get_type(device) == SOUND_ZSG2);
75   return (zsg2_state *)device->token;
76}
77
78static STREAM_UPDATE( update_stereo )
79{
80//  zsg2_state *info = (zsg2_state *)param;
81   stream_sample_t *dest1 = outputs[0];
82   stream_sample_t *dest2 = outputs[1];
83
84   memset(dest1, 0, sizeof(stream_sample_t) * samples);
85   memset(dest2, 0, sizeof(stream_sample_t) * samples);
86}
87
88static void chan_w(zsg2_state *info, int chan, int reg, UINT16 data)
89{
90  info->zc[chan].v[reg] = data;
91  //  log_event("ZOOMCHAN", "chan %02x reg %x = %04x", chan, reg, data);
92}
93
94static UINT16 chan_r(zsg2_state *info, int chan, int reg)
95{
96  //  log_event("ZOOMCHAN", "chan %02x read reg %x: %04x", chan, reg, zc[chan].v[reg]);
97  return info->zc[chan].v[reg];
98}
99
100static void check_channel(zsg2_state *info, int chan)
101{
102  //  log_event("ZOOM", "chan %02x e=%04x f=%04x", chan, zc[chan].v[14], zc[chan].v[15]);
103}
104
105static void keyon(zsg2_state *info, int chan)
106{
107#if 0
108  log_event("ZOOM", "keyon %02x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x",
109       chan,
110       info->zc[chan].v[0x0], info->zc[chan].v[0x1], info->zc[chan].v[0x2], info->zc[chan].v[0x3],
111       info->zc[chan].v[0x4], info->zc[chan].v[0x5], info->zc[chan].v[0x6], info->zc[chan].v[0x7],
112       info->zc[chan].v[0x8], info->zc[chan].v[0x9], info->zc[chan].v[0xa], info->zc[chan].v[0xb],
113       info->zc[chan].v[0xc], info->zc[chan].v[0xd], info->zc[chan].v[0xe], info->zc[chan].v[0xf]);
114#endif
115}
116
117static void control_w(zsg2_state *info, int reg, UINT16 data)
118{
119   switch(reg)
120   {
121      case 0x00: case 0x02: case 0x04:
122      {
123         int base = (reg & 6) << 3;
124         int i;
125         for(i=0; i<16; i++)
126            if(data & (1<<i))
127               keyon(info, base+i);
128         break;
129      }
130
131      case 0x08: case 0x0a: case 0x0c:
132      {
133         int base = (reg & 6) << 3;
134         int i;
135         for(i=0; i<16; i++)
136            if(data & (1<<i))
137               check_channel(info, base+i);
138         break;
139      }
140
141      case 0x30:
142         break;
143
144      case 0x38:
145         info->alow = data;
146         break;
147
148      case 0x3a:
149         info->ahigh = data;
150         break;
151
152      default:
153      //      log_event("ZOOMCTRL", "%02x = %04x", reg, data);
154         break;
155   }
156}
157
158static UINT16 control_r(zsg2_state *info, int reg)
159{
160   switch(reg)
161   {
162      case 0x28:
163         return 0xff00;
164
165      case 0x3c: case 0x3e:
166      {
167         UINT32 adr = (info->ahigh << 16) | info->alow;
168         UINT32 val = *(unsigned int *)(info->bank_samples+adr);
169//          log_event("ZOOMCTRL", "rom read.%c %06x = %08x", reg == 0x3e ? 'h' : 'l', adr, val);
170         return (reg == 0x3e) ? (val >> 16) : val;
171      }
172   }
173
174//  log_event("ZOOMCTRL", "read %02x", reg);
175
176   return 0xffff;
177}
178
179WRITE16_DEVICE_HANDLER( zsg2_w )
180{
181   zsg2_state *info = get_safe_token(device);
182   int adr = offset * 2;
183
184   assert(mem_mask == 0xffff);   // we only support full 16-bit accesses
185
186   stream_update(info->stream);
187
188   if (adr < 0x600)
189   {
190      int chan = adr >> 5;
191      int reg = (adr >> 1) & 15;
192
193      chan_w(info, chan, reg, data);
194   }
195   else
196   {
197      control_w(info, adr - 0x600, data);
198   }
199}
200
201READ16_DEVICE_HANDLER( zsg2_r )
202{
203   zsg2_state *info = get_safe_token(device);
204   int adr = offset * 2;
205
206   assert(mem_mask == 0xffff);   // we only support full 16-bit accesses
207
208   if (adr < 0x600)
209   {
210      int chan = adr >> 5;
211      int reg = (adr >> 1) & 15;
212      return chan_r(info, chan, reg);
213   }
214   else
215   {
216      return control_r(info, adr - 0x600);
217   }
218
219   return 0;
220}
221
222static DEVICE_START( zsg2 )
223{
224   const zsg2_interface *intf = (const zsg2_interface *)device->baseconfig().static_config;
225   zsg2_state *info = get_safe_token(device);
226
227   info->sample_rate = device->clock;
228
229   memset(&info->zc, 0, sizeof(info->zc));
230   memset(&info->act, 0, sizeof(info->act));
231
232   info->stream = stream_create(device, 0, 2, info->sample_rate, info, update_stereo);
233
234   info->bank_samples = memory_region(device->machine, intf->samplergn);
235}
236
237/**************************************************************************
238 * Generic get_info
239 **************************************************************************/
240
241DEVICE_GET_INFO( zsg2 )
242{
243   switch (state)
244   {
245      /* --- the following bits of info are returned as 64-bit signed integers --- */
246      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(zsg2_state);         break;
247
248      /* --- the following bits of info are returned as pointers to data or functions --- */
249      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( zsg2 );      break;
250      case DEVINFO_FCT_STOP:                     /* nothing */                        break;
251      case DEVINFO_FCT_RESET:                     /* nothing */                        break;
252
253      /* --- the following bits of info are returned as NULL-terminated strings --- */
254      case DEVINFO_STR_NAME:                  strcpy(info->s, "ZSG-2");               break;
255      case DEVINFO_STR_FAMILY:               strcpy(info->s, "Zoom custom");            break;
256      case DEVINFO_STR_VERSION:               strcpy(info->s, "1.0");                  break;
257      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);               break;
258      case DEVINFO_STR_CREDITS:               strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
259   }
260}
261
src/emu/sound/zsg2.h
r0r7357
1/*
2    ZOOM ZSG-2 custom wavetable synthesizer
3*/
4
5#pragma once
6
7#ifndef __ZSG2_H__
8#define __ZSG2_H__
9
10READ16_DEVICE_HANDLER( zsg2_r );
11WRITE16_DEVICE_HANDLER( zsg2_w );
12
13typedef struct _zsg2_interface zsg2_interface;
14struct _zsg2_interface
15{
16   const char *samplergn;
17};
18
19DEVICE_GET_INFO( zsg2 );
20#define SOUND_ZSG2 DEVICE_GET_INFO_NAME( zsg2 )
21
22#endif   /* __ZSG2_H__ */
src/emu/sound/sound.mak
r7356r7357
648648ifneq ($(filter YMZ280B,$(SOUNDS)),)
649649SOUNDOBJS += $(SOUNDOBJ)/ymz280b.o
650650endif
651
652#-------------------------------------------------
653# ZOOM ZSG-2
654#-------------------------------------------------
655
656ifneq ($(filter ZSG2,$(SOUNDS)),)
657SOUNDOBJS += $(SOUNDOBJ)/zsg2.o
658endif
659
src/emu/sound/segapcm.c
r7356r7357
1414   const UINT8 *rom;
1515   int bankshift;
1616   int bankmask;
17   int rgnmask;
1718   sound_stream * stream;
1819};
1920
r7356r7357
2930static STREAM_UPDATE( SEGAPCM_update )
3031{
3132   segapcm_state *spcm = (segapcm_state *)param;
33   int rgnmask = spcm->rgnmask;
3234   int ch;
3335
3436   /* clear the buffers */
r7356r7357
7072            }
7173
7274            /* fetch the sample */
73            v = rom[addr >> 8] - 0x80;
75            v = rom[(addr >> 8) & rgnmask] - 0x80;
7476
7577            /* apply panning and advance */
7678            outputs[0][i] += v * voll;
r7356r7357
103105      mask = BANK_MASK7>>16;
104106
105107   len = device->region->bytes();
108   spcm->rgnmask = len - 1;
109
106110   for(rom_mask = 1; rom_mask < len; rom_mask *= 2);
111
107112   rom_mask--;
108113
109114   spcm->bankmask = mask & (rom_mask >> spcm->bankshift);
src/emu/ui.c
r7356r7357
125125static int ui_active;
126126/* natural keyboard info */
127127static int ui_use_natural_keyboard;
128static UINT8 non_char_keys_down[(ARRAY_LENGTH(non_char_keys) + 7) / 8];   
128static UINT8 non_char_keys_down[(ARRAY_LENGTH(non_char_keys) + 7) / 8];
129129
130130
131131/***************************************************************************
r7356r7357
254254
255255   /* reset globals */
256256   single_step = FALSE;
257   ui_set_handler(handler_messagebox, 0);   
257   ui_set_handler(handler_messagebox, 0);
258258   ui_active = 0;
259259   /* retrieve options */
260260   ui_use_natural_keyboard = options_get_bool(mame_options(), OPTION_NATURAL_KEYBOARD);
261   
261
262262   return 0;
263263}
264264
src/emu/debugger.c
r7356r7357
1717#include "debug/debugcon.h"
1818#include "debug/express.h"
1919#include "debug/debugvw.h"
20#include "debugint/debugint.h"
2021#include <ctype.h>
2122
2223
r7356r7357
7374      debug_view_init(machine);
7475      debug_comment_init(machine);
7576
77      /* always initialize the internal render debugger */
78      debugint_init(machine);
79
7680      /* allocate a new entry for our global list */
7781      add_exit_callback(machine, debugger_exit);
7882      entry = global_alloc(machine_entry);
src/emu/layout/vertical.lay
r7356r7357
2121         <bounds x="0" y="0" width="3" height="4" />
2222      </screen>
2323   </view>
24
25   <element name="dbgdis">
26   </element>
27
28   <view name="Debug">
29      <screen index="0">
30         <bounds left="0" top="0" right="3" bottom="4" />
31      </screen>
32      <bezel element="dbgdis">
33         <bounds x="-2.5" y="0" width="8" height="6" />
34      </bezel>
35   </view>
36
2437</mamelayout>
src/emu/driver.h
r7356r7357
4343#define GAME_IS_BIOS_ROOT            0x00001000   /* this driver entry is a BIOS root */
4444#define GAME_NO_STANDALONE            0x00002000   /* this driver cannot stand alone */
4545#define GAME_REQUIRES_ARTWORK         0x00004000   /* the driver requires external artwork for key elements of the game */
46#define GAME_UNOFFICIAL               0x00008000   /* unofficial hardware change */
46#define GAME_UNOFFICIAL              0x00008000   /* unofficial hardware change */
4747#define GAME_NO_SOUND_HW            0x00010000   /* sound hardware not available */
4848
4949
src/emu/render.c
r7356r7357
114114   float            xscale, yscale;      /* scale transforms */
115115   render_color      color;            /* color transform */
116116   int               orientation;      /* orientation transform */
117   int               no_center;         /* center the container? */
117118};
118119
119120
r7356r7357
166167   int               base_layerconfig;   /* the layer configuration at the time of first frame */
167168   int               maxtexwidth;      /* maximum width of a texture */
168169   int               maxtexheight;      /* maximum height of a texture */
170   render_container *   debug_containers;
169171};
170172
171173
r7356r7357
16401642      }
16411643   }
16421644
1645   /* process the debug containers */
1646   for (render_container *debug = target->debug_containers; debug != NULL; debug = debug->next)
1647   {
1648      ui_xform.xoffs = 0;
1649      ui_xform.yoffs = 0;
1650      ui_xform.xscale = (float) target->width;
1651      ui_xform.yscale = (float) target->height;
1652      ui_xform.color.r = ui_xform.color.g = ui_xform.color.b = ui_xform.color.a = 1.0f;
1653      ui_xform.color.a = 0.9;
1654      ui_xform.orientation = target->orientation;
1655      ui_xform.no_center = TRUE;
1656
1657      /* add UI elements */
1658      add_container_primitives(target, &target->primlist[listnum], &ui_xform, debug, BLENDMODE_ALPHA);
1659   }
1660
16431661   /* process the UI if we are the UI target */
16441662   if (target == render_get_ui_target())
16451663   {
r7356r7357
19091927      if (container_xform.orientation & ORIENTATION_FLIP_Y) yoffs = -yoffs;
19101928      container_xform.xscale = xform->xscale * xscale;
19111929      container_xform.yscale = xform->yscale * yscale;
1912      container_xform.xoffs = xform->xscale * (0.5f - 0.5f * xscale + xoffs) + xform->xoffs;
1913      container_xform.yoffs = xform->yscale * (0.5f - 0.5f * yscale + yoffs) + xform->yoffs;
1930      if (xform->no_center)
1931      {
1932         container_xform.xoffs = xform->xscale * (xoffs) + xform->xoffs;
1933         container_xform.yoffs = xform->yscale * (yoffs) + xform->yoffs;
1934      }
1935      else
1936      {
1937         container_xform.xoffs = xform->xscale * (0.5f - 0.5f * xscale + xoffs) + xform->xoffs;
1938         container_xform.yoffs = xform->yscale * (0.5f - 0.5f * yscale + yoffs) + xform->yoffs;
1939      }
19141940      container_xform.color = xform->color;
19151941   }
19161942
r7356r7357
31523178      }
31533179   }
31543180}
3181
3182
3183render_container *render_debug_alloc(render_target *target)
3184{
3185   render_container *container = render_container_alloc(target->machine);
3186
3187   container->next = target->debug_containers;
3188   target->debug_containers = container;
3189
3190   return container;
3191}
3192
3193
3194void render_debug_free(render_target *target, render_container *container)
3195{
3196   if (container == target->debug_containers)
3197   {
3198      target->debug_containers = container->next;
3199   }
3200   else
3201   {
3202      render_container *c;
3203
3204      for (c = target->debug_containers; c != NULL; c = c->next)
3205         if (c->next == container)
3206            break;
3207      c->next = container->next;
3208   }
3209   render_container_free(container);
3210}
3211
3212
3213void render_debug_top(render_target *target, render_container *container)
3214{
3215   /* remove */
3216   if (container == target->debug_containers)
3217   {
3218      target->debug_containers = container->next;
3219   }
3220   else
3221   {
3222      render_container *c;
3223
3224      for (c = target->debug_containers; c != NULL; c = c->next)
3225         if (c->next == container)
3226            break;
3227      c->next = container->next;
3228   }
3229   /* add to end */
3230   if (target->debug_containers == NULL)
3231      target->debug_containers = container;
3232   else
3233   {
3234      render_container *c;
3235
3236      for (c = target->debug_containers; c != NULL; c = c->next)
3237         if (c->next == NULL)
3238            break;
3239      c->next = container;
3240   }
3241   container->next = NULL;
3242}
3243
3244
src/emu/debugint/debugint.c
r0r7357
1/*********************************************************************
2
3    debugint.c
4
5    Internal debugger frontend using render interface.
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10*********************************************************************/
11
12#include "emu.h"
13#include "ui.h"
14#include "rendfont.h"
15#include "uimenu.h"
16#include "uiinput.h"
17#include "video.h"
18#include "osdepend.h"
19
20#include "debug/debugvw.h"
21#include "debug/debugcon.h"
22#include "debug/debugcpu.h"
23
24
25/***************************************************************************
26    CONSTANTS
27***************************************************************************/
28
29#define BORDER_YTHICKNESS 1
30#define BORDER_XTHICKNESS 1
31#define HSB_HEIGHT 20
32#define VSB_WIDTH 20
33#define TITLE_HEIGHT 20
34
35enum
36{
37   RECT_DVIEW,
38   RECT_DVIEW_CLIENT,
39   RECT_DVIEW_TITLE,
40   RECT_DVIEW_HSB,
41   RECT_DVIEW_VSB,
42   RECT_DVIEW_SIZE,
43};
44
45enum
46{
47   VIEW_STATE_BUTTON         = 0x01,
48   VIEW_STATE_MOVING         = 0x02,
49   VIEW_STATE_SIZING         = 0x04,
50   VIEW_STATE_NEEDS_UPDATE    = 0x08,
51   VIEW_STATE_FOLLOW_CPU      = 0x10,
52};
53
54/***************************************************************************
55    MACROS
56***************************************************************************/
57
58//#define NX(_dv, _x) ((float) (_x)/(float)rect_get_width(&(_dv)->bounds))
59//#define NY(_dv, _y) ((float) (_y)/(float)rect_get_height(&(_dv)->bounds))
60#define NX(_dv, _x) ((float) (_x)/(float) (dv)->rt_width)
61#define NY(_dv, _y) ((float) (_y)/(float) (dv)->rt_height)
62
63
64#define LIST_ADD_FRONT(_list, _elem, _type) \
65   do { \
66      (_elem)->next = _list; \
67      _list = _elem; \
68   } while (0)
69
70#define LIST_GET_PREVIOUS(_list, _elem, _prev) \
71   do { \
72      _prev = NULL; \
73      if (_list != _elem) \
74         for (_prev = _list; _prev != NULL; _prev = _prev->next) \
75            if ((_prev)->next == _elem) \
76               break; \
77   } while (0)
78
79#define LIST_GET_LAST(_list, _last) \
80   do { \
81      for (_last = _list; _last != NULL; _last = _last->next) \
82         if ((_last)->next == NULL) \
83            break; \
84   } while (0)
85
86#define LIST_REMOVE(_list, _elem, _type) \
87   do { \
88      _type *_hlp; \
89      LIST_GET_PREVIOUS(_list, _elem, _hlp); \
90      if (_hlp != NULL) \
91         (_hlp)->next = (_elem)->next; \
92      else \
93         _list = (_elem)->next; \
94   } while (0)
95
96#define LIST_ADD_BACK(_list, _elem, _type) \
97   do { \
98      _type *_hlp; \
99      LIST_GET_LAST(_list, _hlp); \
100      if (_hlp != NULL) \
101         (_hlp)->next = _elem; \
102      else \
103         _list = _elem; \
104   } while (0)
105
106/***************************************************************************
107    TYPE DEFINITIONS
108***************************************************************************/
109
110typedef struct _adjustment adjustment;
111struct _adjustment
112{
113   int      visible;
114   int      lower;
115   int      upper;
116   int      value;
117   int      step_increment;
118   int      page_increment;
119   int      page_size;
120};
121
122class DView;
123
124class DView_edit
125{
126   DISABLE_COPYING(DView_edit);
127
128public:
129   DView_edit()
130   { }
131   ~DView_edit()
132   { }
133   int               active;
134   render_container *   container;
135   astring            str;
136};
137
138/***************************************************************************
139    FUNCTION PROTOTYPES
140***************************************************************************/
141
142static void dview_update(debug_view *dw, void *osdprivate);
143static int map_point(DView *dv, INT32 target_x, INT32 target_y, INT32 *mapped_x, INT32 *mapped_y);
144
145class DView
146{
147   DISABLE_COPYING(DView);
148
149public:
150   DView(render_target *target, running_machine *machine, int type, int flags)
151      : next(NULL),
152        type(0),
153        state(0),
154        ofs_x(0),
155        ofs_y(0)
156     {
157      this->target = target;
158      //dv->container = render_target_get_component_container(target, name, &pos);
159      this->container = render_debug_alloc(target);
160      this->view = debug_view_alloc(machine, type, dview_update, this);
161      this->type = type;
162      this->machine = machine;
163      this->state = flags | VIEW_STATE_NEEDS_UPDATE;
164
165      // initial size
166      this->bounds.min_x = 0;
167      this->bounds.min_y = 0;
168      this->bounds.max_x = 300;
169      this->bounds.max_y = 300;
170
171      /* specials */
172      switch (type)
173      {
174      case DVT_DISASSEMBLY:
175         /* set up disasm view */
176         debug_view_begin_update(this->view);
177         disasm_view_set_expression(this->view, "curpc");
178         //debug_view_  property_UINT32(dv->view, DVP_DASM_TRACK_LIVE, 1);
179         debug_view_end_update(this->view);
180         break;
181      }
182     }
183   ~DView()
184   {
185      render_debug_free(this->target, this->container);
186      debug_view_free(this->view);
187   }
188
189   DView *            next;
190
191   int             type;
192   debug_view *      view;
193   render_container *   container;
194   render_target *      target;
195   running_machine *   machine;
196   int               state;
197   // drawing
198   rectangle         bounds;
199   int               ofs_x;
200   int               ofs_y;
201   astring            title;
202   int               last_x;
203   int               last_y;
204   // Scrollbars
205   adjustment         hsb;
206   adjustment         vsb;
207   // render target tracking
208   INT32            rt_width;
209   INT32            rt_height;
210   //optional
211   DView_edit         editor;
212};
213
214
215/***************************************************************************
216    INLINE FUNCTIONS
217***************************************************************************/
218
219INLINE int rect_get_width(rectangle *r)
220{
221   return r->max_x - r->min_x + 1;
222}
223
224INLINE int rect_get_height(rectangle *r)
225{
226   return r->max_y - r->min_y + 1;
227}
228
229INLINE void rect_set_width(rectangle *r, int width)
230{
231   r->max_x = r->min_x + width - 1;
232}
233
234INLINE void rect_set_height(rectangle *r, int height)
235{
236   r->max_y = r->min_y + height - 1;
237}
238
239INLINE void rect_move(rectangle *r, int x, int y)
240{
241   int dx = x - r->min_x;
242   int dy = y - r->min_y;
243
244   r->min_x += dx;
245   r->max_x += dx;
246   r->min_y += dy;
247   r->max_y += dy;
248}
249
250INLINE int dview_is_state(DView *dv, int state)
251{
252   return ((dv->state & state) ? TRUE : FALSE);
253}
254
255INLINE int dview_is_state_all(DView *dv, int state)
256{
257   return ((dv->state & state) == state ? TRUE : FALSE);
258}
259
260INLINE void dview_set_state(DView *dv, int state, int onoff)
261{
262   if (onoff)
263      dv->state |= state;
264   else
265      dv->state &= ~state;
266}
267
268/***************************************************************************
269    LOCAL VARIABLES
270***************************************************************************/
271
272static render_font *   debug_font;
273static int            debug_font_width;
274static int            debug_font_height;
275static float         debug_font_aspect;
276static DView *         list;
277static DView *         focus_view;
278
279static ui_menu *      menu;
280static DView_edit *      cur_editor;
281
282static void set_focus_view(DView *dv)
283{
284   if (focus_view != NULL)
285      dview_set_state(focus_view, VIEW_STATE_NEEDS_UPDATE, TRUE);
286
287   if (dv != NULL)
288      dview_set_state(dv, VIEW_STATE_NEEDS_UPDATE, TRUE);
289
290   if (focus_view != dv)
291   {
292      focus_view = dv;
293      LIST_REMOVE(list, dv, DView);
294      LIST_ADD_FRONT(list, dv, DView);
295      render_debug_top(dv->target, dv->container);
296   }
297}
298
299static DView *dview_alloc(render_target *target, running_machine *machine, int type, int flags)
300{
301   DView *dv;
302
303   dv = auto_alloc(machine, DView(target, machine, type, flags));
304
305   /* add to list */
306
307   LIST_ADD_BACK(list, dv, DView);
308
309   return dv;
310}
311
312static void dview_free(DView *dv)
313{
314   //astring_free(dv->title);
315   LIST_REMOVE(list, dv, DView);
316   auto_free(dv->machine, dv);
317}
318
319static void dview_get_rect(DView *dv, int type, rectangle *rect)
320{
321   *rect = dv->bounds;
322   switch (type)
323   {
324   case RECT_DVIEW:
325      break;
326   case RECT_DVIEW_CLIENT:
327      rect->min_x += BORDER_XTHICKNESS;
328      rect->max_x -= (BORDER_XTHICKNESS + dv->vsb.visible * VSB_WIDTH);
329      rect->min_y += 2 * BORDER_YTHICKNESS + TITLE_HEIGHT;
330      rect->max_y -= (BORDER_YTHICKNESS + dv->hsb.visible * HSB_HEIGHT);
331      break;
332   case RECT_DVIEW_HSB:
333      rect->min_x += 0;
334      rect->max_x -= /* dv->vsb.visible * */ VSB_WIDTH;
335      rect->min_y = dv->bounds.max_y - HSB_HEIGHT;
336      rect->max_y -= 0;
337      break;
338   case RECT_DVIEW_VSB:
339      rect->min_x = dv->bounds.max_x - VSB_WIDTH;
340      rect->max_x -= 0;
341      rect->min_y += TITLE_HEIGHT;
342      rect->max_y -= /* dv->hsb.visible * */ HSB_HEIGHT;
343      break;
344   case RECT_DVIEW_SIZE:
345      rect->min_x = dv->bounds.max_x - VSB_WIDTH;
346      rect->max_x -= 0;
347      rect->min_y = dv->bounds.max_y - HSB_HEIGHT;
348      rect->max_y -= 0;
349      break;
350   case RECT_DVIEW_TITLE:
351      rect->min_x += 0;
352      rect->max_x -= 0;
353      rect->min_y += 0;
354      rect->max_y = rect->min_y + TITLE_HEIGHT - 1;
355      break;
356   default:
357      assert_always(FALSE, "unknown rectangle type");
358   }
359}
360
361
362static void dview_clear(DView *dv)
363{
364   render_container_empty(dv->container);
365}
366
367static void dview_draw_outlined_box(DView *dv, int rtype, int x, int y, int w, int h, rgb_t bg)
368{
369   rectangle r;
370
371   dview_get_rect(dv, rtype, &r);
372   ui_draw_outlined_box(dv->container, NX(dv, x + r.min_x), NY(dv, y + r.min_y),
373         NX(dv, x + r.min_x + w), NY(dv, y + r.min_y + h), bg);
374}
375
376static void dview_draw_box(DView *dv, int rtype, int x, int y, int w, int h, rgb_t col)
377{
378   rectangle r;
379
380   dview_get_rect(dv, rtype, &r);
381   render_container_add_rect(dv->container, NX(dv, x + r.min_x), NY(dv, y + r.min_y),
382         NX(dv, x + r.min_x + w), NY(dv, y + r.min_y + h), col,
383         PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
384}
385
386static void dview_draw_char(DView *dv, int rtype, int x, int y, int h, rgb_t col, UINT16 ch)
387{
388   rectangle r;
389
390   dview_get_rect(dv, rtype, &r);
391   render_container_add_char(dv->container,
392         NX(dv, x + r.min_x),
393         NY(dv, y + r.min_y),
394         NY(dv, h),
395         debug_font_aspect,
396         //(float) rect_get_height(&dv->bounds) / (float) rect_get_width(&dv->bounds), //render_get_ui_aspect(),
397         col,
398         debug_font,
399         ch);
400}
401
402static int dview_xy_in_rect(DView *dv, int type, int x, int y)
403{
404   rectangle r;
405
406   dview_get_rect(dv, type, &r);
407   if (x >= r.min_x && x <= r.max_x && y >= r.min_y && y <= r.max_y)
408      return TRUE;
409   return FALSE;
410}
411
412static void dview_draw_hsb(DView *dv)
413{
414   int vt;
415   int ts;
416   //int sz = SLIDER_SIZE;
417   int sz;
418   rectangle r;
419   adjustment *sb = &dv->hsb;
420
421   dview_get_rect(dv, RECT_DVIEW_HSB, &r);
422
423   dview_draw_outlined_box(dv, RECT_DVIEW_HSB, 0, 0, VSB_WIDTH,HSB_HEIGHT, MAKE_ARGB(0xff, 0xff, 0x00, 0x00));
424   dview_draw_outlined_box(dv, RECT_DVIEW_HSB, rect_get_width(&r) - VSB_WIDTH, 0, VSB_WIDTH, HSB_HEIGHT, MAKE_ARGB(0xff, 0xff, 0x00, 0x00));
425
426   ts = (r.max_x - r.min_x + 1) - 2 * VSB_WIDTH;
427
428   sz = (ts * (sb->page_size)) / (sb->upper - sb->lower);
429   ts = ts - sz;
430
431   vt = (ts * (sb->value - sb->lower)) / (sb->upper - sb->lower - sb->page_size) + sz / 2 + r.min_x + VSB_WIDTH;
432
433   dview_draw_outlined_box(dv, RECT_DVIEW_HSB, vt - sz / 2, 0, sz, HSB_HEIGHT, MAKE_ARGB(0xff, 0xff, 0x00, 0x00));
434}
435
436static void dview_draw_vsb(DView *dv)
437{
438   int vt;
439   int ts;
440   //int sz = SLIDER_SIZE;
441   int sz;
442   rectangle r;
443   adjustment *sb = &dv->vsb;
444
445   dview_get_rect(dv, RECT_DVIEW_VSB, &r);
446
447   dview_draw_outlined_box(dv, RECT_DVIEW_VSB, 0, rect_get_height(&r) - HSB_HEIGHT, VSB_WIDTH, HSB_HEIGHT, MAKE_ARGB(0xff, 0xff, 0x00, 0x00));
448   dview_draw_outlined_box(dv, RECT_DVIEW_VSB, 0, 0,               VSB_WIDTH, HSB_HEIGHT, MAKE_ARGB(0xff, 0xff, 0x00, 0x00));
449
450   ts = (r.max_y - r.min_y + 1) - 2 * HSB_HEIGHT;
451
452   sz = (ts * (sb->page_size)) / (sb->upper - sb->lower);
453   ts = ts - sz;
454
455   vt = (ts * (sb->value - sb->lower)) / (sb->upper - sb->lower - sb->page_size) + sz / 2 + HSB_HEIGHT;
456
457   dview_draw_outlined_box(dv, RECT_DVIEW_VSB, 0, vt - sz / 2, VSB_WIDTH, sz, MAKE_ARGB(0xff, 0xff, 0x00, 0x00));
458}
459
460static void dview_draw_size(DView *dv)
461{
462   rectangle r;
463
464   dview_get_rect(dv, RECT_DVIEW_SIZE, &r);
465
466   dview_draw_outlined_box(dv, RECT_DVIEW_SIZE, 0, 0,
467         rect_get_width(&r),rect_get_height(&r), MAKE_ARGB(0xff, 0xff, 0xff, 0x00));
468}
469
470static void dview_set_title(DView *dv, astring title)
471{
472   if (dv->title.cmp(title) != 0)
473   {
474      dv->title = title;
475      dview_set_state(dv, VIEW_STATE_NEEDS_UPDATE, TRUE);
476   }
477}
478
479static void dview_draw_title(DView *dv)
480{
481   int i;
482   rgb_t col = MAKE_ARGB(0xff,0x00,0x00,0xff);
483   rectangle r;
484
485   dview_get_rect(dv, RECT_DVIEW_TITLE, &r);
486
487   if (dv == focus_view)
488      col = MAKE_ARGB(0xff,0x00,0x7f,0x00);
489
490   dview_draw_outlined_box(dv, RECT_DVIEW_TITLE, 0, 0, rect_get_width(&dv->bounds), TITLE_HEIGHT, col);
491
492   if (dv->title == NULL)
493      return;
494
495   for (i=0; i<strlen(dv->title); i++)
496   {
497      dview_draw_char(dv, RECT_DVIEW_TITLE, i * debug_font_width + BORDER_XTHICKNESS,
498            BORDER_YTHICKNESS, debug_font_height, //r.max_y - 2 * BORDER_YTHICKNESS,
499            MAKE_ARGB(0xff,0xff,0xff,0xff), (UINT16) dv->title[i] );
500   }
501}
502
503static int dview_on_mouse(DView *dv, int mx, int my, int button)
504{
505   int clicked = (button && !dview_is_state(dv, VIEW_STATE_BUTTON));
506   int handled = TRUE;
507   int x,y;
508
509   if (button && dview_is_state_all(dv, VIEW_STATE_BUTTON | VIEW_STATE_MOVING))
510   {
511      int dx = mx - dv->last_x;
512      int dy = my - dv->last_y;
513
514      dv->ofs_x += dx;
515      dv->ofs_y += dy;
516      dv->last_x = mx;
517      dv->last_y = my;
518      dview_set_state(dv, VIEW_STATE_NEEDS_UPDATE, TRUE);
519      return TRUE;
520   }
521   else if (button && dview_is_state_all(dv, VIEW_STATE_BUTTON | VIEW_STATE_SIZING))
522   {
523      int dx = mx - dv->last_x;
524      int dy = my - dv->last_y;
525
526      dv->bounds.max_x += dx;
527      dv->bounds.max_y += dy;
528      dv->last_x = mx;
529      dv->last_y = my;
530      dview_set_state(dv, VIEW_STATE_NEEDS_UPDATE, TRUE);
531      return TRUE;
532   }
533   else
534      dview_set_state(dv, VIEW_STATE_MOVING | VIEW_STATE_SIZING, FALSE);
535
536   if (!map_point(dv, mx, my, &x, &y))
537      return FALSE;
538
539   if (dview_xy_in_rect(dv, RECT_DVIEW_TITLE, x, y))
540   {
541      /* on title, do nothing */
542      if (clicked) {
543         dv->last_x = mx;
544         dv->last_y = my;
545         set_focus_view(dv);
546         dview_set_state(dv, VIEW_STATE_MOVING, TRUE);
547      }
548   }
549   else if (dview_xy_in_rect(dv, RECT_DVIEW_HSB, x, y))
550   {
551      /* on horizontal scrollbar */
552      debug_view_xy pos;
553      adjustment *sb = &dv->hsb;
554
555      if (clicked)
556      {
557         rectangle r;
558         int xt;
559
560         dview_get_rect(dv, RECT_DVIEW_HSB, &r);
561         x -= r.min_x;
562
563         xt = (x - VSB_WIDTH) * (sb->upper - sb->lower) / (rect_get_width(&r) - 2 * dv->vsb.visible * VSB_WIDTH) + sb->lower;
564         if (x < VSB_WIDTH)
565            sb->value -= sb->step_increment;
566         else if (x > rect_get_width(&r) - VSB_WIDTH)
567            sb->value += sb->step_increment;
568         else if (xt < sb->value)
569            sb->value -= sb->page_increment;
570         else if (xt > sb->value)
571            sb->value += sb->page_increment;
572
573         if (sb->value < sb->lower)
574            sb->value = sb->lower;
575         if (sb->value > sb->upper)
576            sb->value = sb->upper;
577      }
578
579      pos = debug_view_get_visible_position(dv->view);
580
581      if (sb->value != pos.x)
582      {
583         pos.x = sb->value;
584         debug_view_set_visible_position(dv->view, pos);
585         dview_set_state(dv, VIEW_STATE_NEEDS_UPDATE, TRUE);
586      }
587   }
588   else if (dview_xy_in_rect(dv, RECT_DVIEW_VSB, x, y) )
589   {
590      /* on vertical scrollbar */
591      debug_view_xy pos;
592      adjustment *sb = &dv->vsb;
593
594      if (clicked)
595      {
596         rectangle r;
597         int yt;
598
599         dview_get_rect(dv, RECT_DVIEW_VSB, &r);
600         y -= r.min_y;
601         yt = (y - HSB_HEIGHT) * (sb->upper - sb->lower) / (rect_get_height(&r) - 2 * HSB_HEIGHT) + sb->lower;
602
603         if (y < HSB_HEIGHT)
604            sb->value -= sb->step_increment;
605         else if (y > rect_get_height(&r) - HSB_HEIGHT)
606            sb->value += sb->step_increment;
607         else if (yt < sb->value)
608            sb->value -= sb->page_increment;
609         else if (yt > sb->value)
610            sb->value += sb->page_increment;
611
612         if (sb->value < sb->lower)
613            sb->value = sb->lower;
614         if (sb->value > sb->upper)
615            sb->value = sb->upper;
616      }
617
618      pos = debug_view_get_visible_position(dv->view);
619
620      if (sb->value != pos.y)
621      {
622         pos.y = sb->value;
623         debug_view_set_visible_position(dv->view, pos);
624         dview_set_state(dv, VIEW_STATE_NEEDS_UPDATE, TRUE);
625      }
626   }
627   else if (dview_xy_in_rect(dv, RECT_DVIEW_SIZE, x, y))
628   {
629      /* on sizing area */
630      if (clicked)
631      {
632         dv->last_x = mx;
633         dv->last_y = my;
634         set_focus_view(dv);
635         dview_set_state(dv, VIEW_STATE_SIZING, TRUE);
636      }
637   }
638   else if (dview_xy_in_rect(dv, RECT_DVIEW_CLIENT, x, y))
639   {
640      y -= TITLE_HEIGHT;
641      if (debug_view_get_cursor_supported(dv->view) && clicked && y >= 0)
642      {
643         debug_view_xy topleft = debug_view_get_visible_position(dv->view);
644         debug_view_xy newpos;
645         newpos.x = topleft.x + x / debug_font_width;
646         newpos.y = topleft.y + y / debug_font_height;
647         debug_view_set_cursor_position(dv->view, newpos);
648         debug_view_set_cursor_visible(dv->view, TRUE);
649      }
650      if (clicked)
651         set_focus_view(dv);
652   }
653   else
654   {
655      handled = FALSE;
656   }
657   dview_set_state(dv, VIEW_STATE_BUTTON, button);
658   return handled;
659
660}
661
662INLINE void map_attr_to_fg_bg(unsigned char attr, rgb_t *fg, rgb_t *bg)
663{
664
665   *bg = MAKE_ARGB(0xff,0xff,0xff,0xff);
666   *fg = MAKE_ARGB(0xff,0x00,0x00,0x00);
667
668   if(attr & DCA_ANCILLARY)
669      *bg = MAKE_ARGB(0xff,0xe0,0xe0,0xe0);
670   if(attr & DCA_SELECTED) {
671      *bg = MAKE_ARGB(0xff,0xff,0x80,0x80);
672   }
673   if(attr & DCA_CURRENT) {
674      *bg = MAKE_ARGB(0xff,0xff,0xff,0x00);
675   }
676   if(attr & DCA_CHANGED) {
677      *fg = MAKE_ARGB(0xff,0xff,0x00,0x00);
678   }
679   if(attr & DCA_INVALID) {
680      *fg = MAKE_ARGB(0xff,0x00,0x00,0xff);
681   }
682   if(attr & DCA_DISABLED) {
683      *fg = MAKE_ARGB(RGB_ALPHA(*fg),
684            (RGB_RED(*fg)+RGB_RED(*bg)) >> 1,
685            (RGB_GREEN(*fg)+RGB_GREEN(*bg)) >> 1,
686            (RGB_BLUE(*fg)+RGB_BLUE(*bg)) >> 1);
687   }
688   if(attr & DCA_COMMENT) {
689      *fg = MAKE_ARGB(0xff,0x00,0x80,0x00);
690   }
691}
692
693static void dview_draw(DView *dv)
694{
695   const debug_view_char *viewdata;
696   debug_view_xy vsize;
697   UINT32 i, j, xx, yy;
698   rgb_t bg_base, bg, fg;
699   rectangle r;
700
701   vsize = debug_view_get_visible_size(dv->view);
702
703   bg_base = MAKE_ARGB(0xff,0xff,0xff,0xff);
704
705   /* always start clean */
706   dview_clear(dv);
707
708   dview_draw_title(dv);
709
710   dview_get_rect(dv, RECT_DVIEW_CLIENT, &r);
711
712   dview_draw_outlined_box(dv, RECT_DVIEW_CLIENT, 0, 0,
713         rect_get_width(&r) /*- (dv->vs ? VSB_WIDTH : 0)*/,
714         rect_get_height(&r) /*- (dv->hsb.visible ? HSB_HEIGHT : 0)*/, bg_base);
715
716   /* background first */
717   viewdata = debug_view_get_chars(dv->view);
718
719   yy = BORDER_YTHICKNESS;
720   for(j=0; j<vsize.y; j++)
721   {
722      xx = BORDER_XTHICKNESS;
723      for(i=0; i<vsize.x; i++)
724      {
725         map_attr_to_fg_bg(viewdata->attrib, &fg, &bg);
726
727         if (bg != bg_base)
728            dview_draw_box(dv, RECT_DVIEW_CLIENT, xx, yy,
729                  debug_font_width, debug_font_height, bg);
730         xx += debug_font_width;
731         viewdata++;
732      }
733      yy += debug_font_height;
734   }
735
736   /* now the text */
737   viewdata = debug_view_get_chars(dv->view);
738
739   yy = BORDER_YTHICKNESS;
740   for(j=0; j<vsize.y; j++)
741   {
742      xx = BORDER_XTHICKNESS;
743      for(i=0; i<vsize.x; i++)
744      {
745         UINT16 s;
746         unsigned char v = viewdata->byte;
747
748         if (v != ' ')
749         {
750            if(v < 128) {
751               s = v;
752            } else {
753               s = 0xc0 | (v>>6);
754               s |= (0x80 | (v & 0x3f));
755            }
756            map_attr_to_fg_bg(viewdata->attrib, &fg, &bg);
757
758            dview_draw_char(dv, RECT_DVIEW_CLIENT, xx, yy, debug_font_height, fg, s);
759         }
760         xx += debug_font_width;
761         viewdata++;
762      }
763      yy += debug_font_height;
764   }
765
766   if(dv->hsb.visible)
767      dview_draw_hsb(dv);
768   if(dv->vsb.visible)
769      dview_draw_vsb(dv);
770   dview_draw_size(dv);
771}
772
773
774static void dview_size_allocate(DView *dv)
775{
776   debug_view_xy size, pos, col, vsize;
777   render_container_user_settings rcus;
778   rectangle r;
779
780   render_container_get_user_settings(dv->container, &rcus);
781   rcus.xoffset = (float) dv->ofs_x / (float) dv->rt_width;
782   rcus.yoffset = (float) dv->ofs_y / (float) dv->rt_height;
783   rcus.xscale = 1.0; //(float) rect_get_width(&dv->bounds) / (float) dv->rt_width;
784   rcus.yscale = 1.0; //(float) rect_get_height(&dv->bounds) / (float) dv->rt_height;
785   render_container_set_user_settings(dv->container, &rcus);
786   //printf("%d %d %d %d\n", wpos.min_x, wpos.max_x, wpos.min_y, wpos.max_y);
787
788   pos = debug_view_get_visible_position(dv->view);
789   size = debug_view_get_total_size(dv->view);
790
791   dv->hsb.visible = 0;
792   dv->vsb.visible = 0;
793   dview_get_rect(dv, RECT_DVIEW_CLIENT, &r);
794
795   dv->hsb.visible = (size.x * debug_font_width > rect_get_width(&r) ? 1 : 0);
796   dv->vsb.visible = (size.y * debug_font_height > rect_get_height(&r) ? 1 : 0);
797   dview_get_rect(dv, RECT_DVIEW_CLIENT, &r);
798
799   dv->hsb.visible = (size.x * debug_font_width > rect_get_width(&r) ? 1 : 0);
800   dv->vsb.visible = (size.y * debug_font_height > rect_get_height(&r) ? 1 : 0);
801   dview_get_rect(dv, RECT_DVIEW_CLIENT, &r);
802
803   col.y = (rect_get_height(&r) - 2 * BORDER_YTHICKNESS /*+ debug_font_height  - 1*/) / debug_font_height;
804   col.x = (rect_get_width(&r) - 2 * BORDER_XTHICKNESS /*+ debug_font_width - 1*/) / debug_font_width;
805
806   vsize.y = size.y - pos.y;
807   vsize.x = size.x - pos.x;
808   if(vsize.y > col.y)
809      vsize.y = col.y;
810   else if(vsize.y < col.y) {
811      pos.y = size.y-col.y;
812      if(pos.y < 0)
813         pos.y = 0;
814      vsize.y = size.y-pos.y;
815   }
816   if(vsize.x > col.x)
817      vsize.x = col.x;
818   else if(vsize.x < col.x) {
819      pos.x = size.x-col.x;
820      if(pos.x < 0)
821         pos.x = 0;
822      vsize.x = size.x-pos.x;
823   }
824
825   debug_view_set_visible_position(dv->view, pos);
826   debug_view_set_visible_size(dv->view, vsize);
827
828   if(dv->hsb.visible) {
829      int span = (rect_get_width(&r) - 2 * BORDER_XTHICKNESS) / debug_font_width;
830
831      if(pos.x + span > size.x)
832         pos.x = size.x - span;
833      if(pos.x < 0)
834         pos.x = 0;
835      dv->hsb.lower = 0;
836      dv->hsb.upper = size.x;
837      dv->hsb.value = pos.x;
838      dv->hsb.step_increment = 1;
839      dv->hsb.page_increment = span;
840      dv->hsb.page_size = span;
841
842      debug_view_set_visible_position(dv->view, pos);
843   }
844
845   if(dv->vsb.visible) {
846      int span = (rect_get_height(&r) - 2 * BORDER_YTHICKNESS) / debug_font_height;
847
848      if(pos.y + span > size.y)
849         pos.y = size.y - span;
850      if(pos.y < 0)
851         pos.y = 0;
852      dv->vsb.lower = 0;
853      dv->vsb.upper = size.y;
854      dv->vsb.value = pos.y;
855      dv->vsb.step_increment = 1;
856      dv->vsb.page_increment = span;
857      dv->vsb.page_size = span;
858
859      debug_view_set_visible_position(dv->view, pos);
860   }
861}
862
863static void dview_update(debug_view *dw, void *osdprivate)
864{
865   DView *dv = (DView *) osdprivate;
866
867   dview_set_state(dv, VIEW_STATE_NEEDS_UPDATE, TRUE);
868
869#if 0
870   debug_view_xy size = debug_view_get_total_size(dw);
871
872   if((dv->tr != size.y) || (dv->tc != size.x))
873      gtk_widget_queue_resize(GTK_WIDGET(dv));
874   else
875      gtk_widget_queue_draw(GTK_WIDGET(dv));
876#endif
877}
878
879static void debugint_exit(running_machine *machine)
880{
881   for (DView *ndv = list; ndv != NULL; )
882   {
883      DView *temp = ndv;
884      ndv = ndv->next;
885      dview_free(temp);
886   }
887   if (debug_font != NULL)
888   {
889      render_font_free(debug_font);
890      debug_font = NULL;
891   }
892
893}
894
895void debugint_init(running_machine *machine)
896{
897   unicode_char ch;
898   int chw;
899   debug_font = render_font_alloc("ui.bdf"); //ui_get_font();
900   debug_font_width = 0;
901   debug_font_height = 15;
902
903   menu = NULL;
904   cur_editor = NULL;
905   list = NULL;
906   focus_view = NULL;
907
908   debug_font_aspect = render_get_ui_aspect();
909
910   for (ch=0;ch<=127;ch++)
911   {
912      chw = render_font_get_char_width(debug_font, debug_font_height, debug_font_aspect, ch);
913      if (chw>debug_font_width)
914         debug_font_width = chw;
915   }
916   debug_font_width++;
917   /* FIXME: above does not really work */
918   debug_font_width = 10;
919   add_exit_callback(machine, debugint_exit);
920}
921
922#if 0
923static void set_view_by_name(render_target *target, const char *name)
924{
925   int i = 0;
926   const char *s;
927
928   for (i = 0; ; i++ )
929   {
930      s = render_target_get_view_name(target, i);
931      if (s == NULL)
932         return;
933      //printf("%d %s\n", i, s);
934      if (strcmp(name, s) == 0)
935      {
936         render_target_set_view(target, i);
937         //printf("%d\n", render_target_get_view(target) );
938         return;
939      }
940   }
941}
942#endif
943
944/*-------------------------------------------------
945    Menu Callbacks
946  -------------------------------------------------*/
947
948static void process_string(DView *dv, const char *str)
949{
950   switch (dv->type)
951   {
952   case DVT_DISASSEMBLY:
953      disasm_view_set_expression(dv->view, str);
954      break;
955   case DVT_CONSOLE:
956      if(!dv->editor.str[0])
957         debug_cpu_single_step(dv->machine, 1);
958      else
959         debug_console_execute_command(dv->machine, str, 1);
960      break;
961   case DVT_MEMORY:
962      memory_view_set_expression(dv->view, str);
963      break;
964   }
965}
966
967void on_memory_window_activate(DView *dv, const ui_menu_event *event)
968{
969}
970
971void on_disassembly_window_activate(DView *dv, const ui_menu_event *event)
972{
973   DView *ndv;
974   render_target *target;
975   const disasm_subview_item *dasmsubitem;
976
977   target = render_get_ui_target();
978
979   ndv = dview_alloc(target, dv->machine, DVT_DISASSEMBLY, 0);
980   ndv->editor.active = TRUE;
981   ndv->editor.container = render_container_get_ui();
982   dasmsubitem = disasm_view_get_current_subview(ndv->view);
983   dview_set_title(ndv, dasmsubitem->name);
984   set_focus_view(ndv);
985
986}
987
988void on_disasm_cpu_activate(DView *dv, const ui_menu_event *event)
989{
990   const disasm_subview_item *subview;
991   int current = disasm_view_get_subview(dv->view);
992
993   if (event->iptkey == IPT_UI_RIGHT)
994   {
995      current++;
996      subview = disasm_view_get_subview_by_index(disasm_view_get_subview_list(dv->view), current);
997      if (subview == NULL)
998      {
999         current = 0;
1000         subview = disasm_view_get_subview_by_index(disasm_view_get_subview_list(dv->view), current);
1001      }
1002      disasm_view_set_subview(dv->view, current);
1003      dview_set_state(dv, VIEW_STATE_NEEDS_UPDATE, TRUE);
1004      dview_set_title(dv, subview->name);
1005   }
1006}
1007
1008void on_log_window_activate(DView *dv, const ui_menu_event *event)
1009{
1010   DView *ndv;
1011   render_target *target;
1012
1013   target = render_get_ui_target();
1014   ndv = dview_alloc(target, dv->machine, DVT_LOG, 0);
1015   dview_set_title(ndv, "Log");
1016   set_focus_view(ndv);
1017}
1018
1019void on_close_activate(DView *dv, const ui_menu_event *event)
1020{
1021   if (focus_view == dv)
1022      set_focus_view(dv->next);
1023   dview_free(dv);
1024}
1025
1026void on_run_activate(DView *dv, const ui_menu_event *event)
1027{
1028   debug_cpu_go(dv->machine, ~0);
1029}
1030
1031#if 0
1032void on_run_h_activate(DView *dv, const ui_menu_event *event)
1033{
1034   debugwin_show(0);
1035   debug_cpu_go(dv->machine, ~0);
1036}
1037#endif
1038
1039void on_run_cpu_activate(DView *dv, const ui_menu_event *event)
1040{
1041   debug_cpu_next_cpu(dv->machine);
1042}
1043
1044void on_run_irq_activate(DView *dv, const ui_menu_event *event)
1045{
1046   debug_cpu_go_interrupt(dv->machine, -1);
1047}
1048
1049void on_run_vbl_activate(DView *dv, const ui_menu_event *event)
1050{
1051   debug_cpu_go_vblank(dv->machine);
1052}
1053
1054void on_step_into_activate(DView *dv, const ui_menu_event *event)
1055{
1056   debug_cpu_single_step(dv->machine, 1);
1057}
1058
1059void on_step_over_activate(DView *dv, const ui_menu_event *event)
1060{
1061   debug_cpu_single_step_over(dv->machine, 1);
1062}
1063
1064void on_step_out_activate(DView *dv, const ui_menu_event *event)
1065{
1066   debug_cpu_single_step_out(dv->machine);
1067}
1068
1069void on_hard_reset_activate(DView *dv, const ui_menu_event *event)
1070{
1071   mame_schedule_hard_reset(dv->machine);
1072}
1073
1074void on_soft_reset_activate(DView *dv, const ui_menu_event *event)
1075{
1076   mame_schedule_soft_reset(dv->machine);
1077   debug_cpu_go(dv->machine, ~0);
1078}
1079
1080void on_exit_activate(DView *dv, const ui_menu_event *event)
1081{
1082   mame_schedule_exit(dv->machine);
1083}
1084
1085void on_view_opcodes_activate(DView *dv, const ui_menu_event *event)
1086{
1087   disasm_right_column rc = disasm_view_get_right_column(focus_view->view);
1088   disasm_right_column new_rc = DASM_RIGHTCOL_NONE;
1089
1090   if (event->iptkey == IPT_UI_RIGHT)
1091   {
1092      switch (rc)
1093      {
1094      case DASM_RIGHTCOL_RAW:         new_rc = DASM_RIGHTCOL_ENCRYPTED; break;
1095      case DASM_RIGHTCOL_ENCRYPTED:   new_rc = DASM_RIGHTCOL_COMMENTS; break;
1096      case DASM_RIGHTCOL_COMMENTS:   new_rc = DASM_RIGHTCOL_RAW; break;
1097      default:                  break;
1098      }
1099      disasm_view_set_right_column(dv->view, new_rc);
1100      dview_set_state(dv, VIEW_STATE_NEEDS_UPDATE, TRUE);
1101   }
1102}
1103
1104void on_run_to_cursor_activate(DView *dv, const ui_menu_event *event)
1105{
1106   char command[64];
1107
1108   if (debug_view_get_cursor_visible(dv->view))
1109   {
1110      const address_space *space = disasm_view_get_current_subview(dv->view)->space;
1111      if (debug_cpu_get_visible_cpu(dv->machine) == space->cpu)
1112      {
1113         offs_t address = disasm_view_get_selected_address(dv->view);
1114         sprintf(command, "go %X", address);
1115         debug_console_execute_command(dv->machine, command, 1);
1116      }
1117   }
1118}
1119
1120/*-------------------------------------------------
1121    editor
1122  -------------------------------------------------*/
1123
1124static void render_editor(DView_edit *editor)
1125{
1126   float width, maxwidth;
1127   float x1, y1, x2, y2;
1128
1129   render_container_empty(editor->container);
1130   /* get the size of the text */
1131   ui_draw_text_full(editor->container, editor->str, 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
1132                 DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, NULL);
1133   width += 2 * UI_BOX_LR_BORDER;
1134   maxwidth = MAX(width, 0.5);
1135
1136   /* compute our bounds */
1137   x1 = 0.5f - 0.5f * maxwidth;
1138   x2 = x1 + maxwidth;
1139   y1 = 0.25;
1140   y2 = 0.45 - UI_BOX_TB_BORDER;
1141
1142   /* draw a box */
1143   ui_draw_outlined_box(editor->container, x1, y1, x2, y2, UI_BACKGROUND_COLOR);
1144
1145   /* take off the borders */
1146   x1 += UI_BOX_LR_BORDER;
1147   x2 -= UI_BOX_LR_BORDER;
1148   y1 += UI_BOX_TB_BORDER;
1149   y2 -= UI_BOX_TB_BORDER;
1150
1151   /* draw the text within it */
1152   ui_draw_text_full(editor->container, editor->str, x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
1153                 DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, NULL);
1154
1155}
1156
1157/*-------------------------------------------------
1158    menu_main_populate - populate the main menu
1159  -------------------------------------------------*/
1160
1161static void CreateMainMenu(running_machine *machine)
1162{
1163   const char *subtext = "";
1164   int rc;
1165   astring title;
1166
1167   if (menu != NULL)
1168      ui_menu_free(menu);
1169   menu = ui_menu_alloc(machine, render_container_get_ui(),NULL,NULL);
1170
1171   switch (focus_view->type)
1172   {
1173   case DVT_DISASSEMBLY:
1174      title = "Disassembly:";
1175      break;
1176   case DVT_CONSOLE:
1177      title = "Console:";
1178      break;
1179   case DVT_LOG:
1180      title = "Log:";
1181      break;
1182   case DVT_MEMORY:
1183      title = "Memory:";
1184      break;
1185   case DVT_REGISTERS:
1186      title = "Registers:";
1187      break;
1188   }
1189
1190   ui_menu_item_append(menu, title.cat(focus_view->title), NULL, MENU_FLAG_DISABLE, NULL);
1191   ui_menu_item_append(menu, MENU_SEPARATOR_ITEM, NULL, 0, NULL);
1192
1193   switch (focus_view->type)
1194   {
1195   case DVT_DISASSEMBLY:
1196      rc = disasm_view_get_right_column(focus_view->view);
1197      switch(rc)
1198      {
1199      case DASM_RIGHTCOL_RAW:         subtext = "Raw Opcodes"; break;
1200      case DASM_RIGHTCOL_ENCRYPTED:   subtext = "Enc Opcodes"; break;
1201      case DASM_RIGHTCOL_COMMENTS:      subtext = "Comments"; break;
1202      }
1203      ui_menu_item_append(menu, "View", subtext, MENU_FLAG_RIGHT_ARROW, (void *)on_view_opcodes_activate);
1204      ui_menu_item_append(menu, "Run to cursor", NULL, 0, (void *)on_run_to_cursor_activate);
1205
1206      if (!dview_is_state(focus_view, VIEW_STATE_FOLLOW_CPU))
1207      {
1208         const disasm_subview_item *      dsi;
1209         dsi = disasm_view_get_current_subview(focus_view->view);
1210         ui_menu_item_append(menu, "CPU", dsi->name, MENU_FLAG_RIGHT_ARROW, (void *)on_disasm_cpu_activate);
1211      }
1212      ui_menu_item_append(menu, MENU_SEPARATOR_ITEM, NULL, 0, NULL);
1213      break;
1214   }
1215
1216   /* add input menu items */
1217
1218   ui_menu_item_append(menu, "New Memory Window", NULL, 0, (void *)on_memory_window_activate);
1219   ui_menu_item_append(menu, "New Disassembly Window", NULL, 0, (void *)on_disassembly_window_activate);
1220   ui_menu_item_append(menu, "New Error Log Window", NULL, 0, (void *)on_log_window_activate);
1221   ui_menu_item_append(menu, MENU_SEPARATOR_ITEM, NULL, 0, NULL);
1222   ui_menu_item_append(menu, "Run", NULL, 0, (void *)on_run_activate);
1223   ui_menu_item_append(menu, "Run to Next CPU", NULL, 0, (void *)on_run_cpu_activate);
1224   ui_menu_item_append(menu, "Run until Next Interrupt on This CPU", NULL, 0, (void *)on_run_irq_activate);
1225   ui_menu_item_append(menu, "Run until Next VBLANK", NULL, 0, (void *)on_run_vbl_activate);
1226   ui_menu_item_append(menu, MENU_SEPARATOR_ITEM, NULL, 0, NULL);
1227   ui_menu_item_append(menu, "Step Into", NULL, 0, (void *)on_step_into_activate);
1228   ui_menu_item_append(menu, "Step Over", NULL, 0, (void *)on_step_over_activate);
1229   ui_menu_item_append(menu, MENU_SEPARATOR_ITEM, NULL, 0, NULL);
1230   ui_menu_item_append(menu, "Soft Reset", NULL, 0, (void *)on_soft_reset_activate);
1231   ui_menu_item_append(menu, "Hard Reset", NULL, 0, (void *)on_hard_reset_activate);
1232   ui_menu_item_append(menu, MENU_SEPARATOR_ITEM, NULL, 0, NULL);
1233   if (!dview_is_state(focus_view, VIEW_STATE_FOLLOW_CPU))
1234      ui_menu_item_append(menu, "Close Window", NULL, 0, (void *)on_close_activate);
1235   ui_menu_item_append(menu, "Exit", NULL, 0, (void *)on_exit_activate);
1236}
1237
1238static int map_point(DView *dv, INT32 target_x, INT32 target_y, INT32 *mapped_x, INT32 *mapped_y)
1239{
1240   rectangle pos;
1241
1242   /* default to point not mapped */
1243   *mapped_x = -1;
1244   *mapped_y = -1;
1245
1246   pos = dv->bounds;
1247   pos.min_x += dv->ofs_x;
1248   pos.max_x += dv->ofs_x;
1249   pos.min_y += dv->ofs_y;
1250   pos.max_y += dv->ofs_y;
1251   //render_target_get_component_container(target, name, &pos);
1252
1253   if (target_x >= pos.min_x && target_x <= pos.max_x && target_y >= pos.min_y && target_y <= pos.max_y)
1254   {
1255      *mapped_x = target_x - pos.min_x;
1256      *mapped_y = target_y - pos.min_y;
1257      return TRUE;
1258   }
1259   return FALSE;
1260}
1261
1262static void handle_mouse(running_machine *machine)
1263{
1264   render_target *   mouse_target;
1265   INT32         x,y;
1266   int            button;
1267
1268   if (menu != NULL)
1269      return;
1270
1271   mouse_target = ui_input_find_mouse(machine, &x, &y, &button);
1272
1273   if (mouse_target == NULL)
1274      return;
1275   //printf("mouse %d %d %d\n", x, y, button);
1276
1277   for (DView *dv = list; dv != NULL; dv = dv->next)
1278   {
1279      if (mouse_target == dv->target)
1280      {
1281         if (dview_on_mouse(dv, x, y, button))
1282            break;
1283      }
1284   }
1285}
1286
1287
1288/*-------------------------------------------------
1289    handle_editor - handle the editor
1290-------------------------------------------------*/
1291
1292static void handle_editor(running_machine *machine)
1293{
1294   if (focus_view->editor.active)
1295   {
1296      ui_event event;
1297
1298      /* loop while we have interesting events */
1299      while (ui_input_pop_event(machine, &event))
1300      {
1301         switch (event.event_type)
1302         {
1303         case UI_EVENT_CHAR:
1304            /* if it's a backspace and we can handle it, do so */
1305            if ((event.ch == 8 || event.ch == 0x7f) && focus_view->editor.str.len() > 0)
1306            {
1307               /* autoschow */
1308               cur_editor = &focus_view->editor;
1309               cur_editor->str = cur_editor->str.substr(0, cur_editor->str.len());
1310            }
1311            /* if it's any other key and we're not maxed out, update */
1312            else if (event.ch >= ' ' && event.ch < 0x7f)
1313            {
1314               char buf[10];
1315               int ret;
1316               /* autoschow */
1317               cur_editor = &focus_view->editor;
1318               ret = utf8_from_uchar(buf, 10, event.ch);
1319               buf[ret] = 0;
1320               cur_editor->str = cur_editor->str.cat(buf);
1321            }
1322            break;
1323         default:
1324            break;
1325         }
1326      }
1327      if (cur_editor != NULL)
1328      {
1329         render_editor(cur_editor);
1330         if (ui_input_pressed(machine, IPT_UI_SELECT))
1331         {
1332            process_string(focus_view, focus_view->editor.str);
1333            focus_view->editor.str = "";
1334            cur_editor = NULL;
1335         }
1336         if (ui_input_pressed(machine, IPT_UI_CANCEL))
1337            cur_editor = NULL;
1338      }
1339   }
1340
1341}
1342
1343
1344/*-------------------------------------------------
1345    menu_main - handle the main menu
1346-------------------------------------------------*/
1347
1348static void handle_menus(running_machine *machine)
1349{
1350   const ui_menu_event *event;
1351
1352   render_container_empty(render_container_get_ui());
1353   ui_input_frame_update(machine);
1354   if (menu != NULL)
1355   {
1356      /* process the menu */
1357      event = ui_menu_process(machine, menu, 0);
1358      if (event != NULL && (event->iptkey == IPT_UI_SELECT || (event->iptkey == IPT_UI_RIGHT)))
1359      {
1360         //ui_menu_free(menu);
1361         //menu = NULL;
1362         ((void (*)(DView *, const ui_menu_event *)) event->itemref)(focus_view, event);
1363         //ui_menu_stack_push(ui_menu_alloc(machine, menu->container, (ui_menu_handler_func)event->itemref, NULL));
1364         CreateMainMenu(machine);
1365      }
1366      else if (ui_input_pressed(machine, IPT_UI_CONFIGURE))
1367      {
1368         ui_menu_free(menu);
1369         menu = NULL;
1370      }
1371   }
1372   else
1373   {
1374      /* turn on menus if requested */
1375      if (ui_input_pressed(machine, IPT_UI_CONFIGURE))
1376         CreateMainMenu(machine);
1377      /* turn on editor if requested */
1378      //if (ui_input_pressed(machine, IPT_UI_UP) && focus_view->editor.active)
1379      //  cur_editor = &focus_view->editor;
1380      handle_editor(machine);
1381   }
1382}
1383
1384//============================================================
1385//  followers_set_cpu
1386//============================================================
1387
1388static void followers_set_cpu(running_device *device)
1389{
1390   const registers_subview_item *regsubitem = NULL;
1391   const disasm_subview_item *dasmsubitem;
1392   char title[256];
1393
1394   for (DView *dv = list; dv != NULL; dv = dv->next)
1395   {
1396      if (dview_is_state(dv, VIEW_STATE_FOLLOW_CPU))
1397      {
1398         switch (dv->type)
1399         {
1400         case DVT_DISASSEMBLY:
1401            for (dasmsubitem = disasm_view_get_subview_list(dv->view); dasmsubitem != NULL; dasmsubitem = dasmsubitem->next)
1402               if (dasmsubitem->space->cpu == device)
1403               {
1404                  disasm_view_set_subview(dv->view, dasmsubitem->index);
1405                  snprintf(title, ARRAY_LENGTH(title), "%s", dasmsubitem->name.cstr());
1406                  dview_set_title(dv, title);
1407                  break;
1408               }
1409            break;
1410         case DVT_REGISTERS:
1411            for (regsubitem = registers_view_get_subview_list(dv->view); regsubitem != NULL; regsubitem = regsubitem->next)
1412               if (regsubitem->device == device)
1413               {
1414                  registers_view_set_subview(dv->view, regsubitem->index);
1415                  snprintf(title, ARRAY_LENGTH(title), "%s", regsubitem->name.cstr());
1416                  dview_set_title(dv, title);
1417                  break;
1418               }
1419            break;
1420         }
1421      }
1422   }
1423   // and recompute the children
1424   //console_recompute_children(main_console);
1425}
1426
1427
1428static void dview_update_view(DView *dv)
1429{
1430   INT32 old_rt_width = dv->rt_width;
1431   INT32 old_rt_height = dv->rt_height;
1432
1433   render_target_get_bounds(dv->target, &dv->rt_width, &dv->rt_height, NULL);
1434   if (dview_is_state(dv, VIEW_STATE_NEEDS_UPDATE) || dv->rt_width != old_rt_width || dv->rt_height != old_rt_height)
1435   {
1436      dview_size_allocate(dv);
1437      dview_draw(dv);
1438      dview_set_state(dv, VIEW_STATE_NEEDS_UPDATE, FALSE);
1439   }
1440}
1441
1442
1443static void update_views(void)
1444{
1445   DView *dv, *prev;
1446
1447   LIST_GET_LAST(list, dv);
1448   while (dv != NULL)
1449   {
1450      dview_update_view(dv);
1451      LIST_GET_PREVIOUS(list, dv, prev);
1452      dv = prev;
1453   }
1454}
1455
1456
1457void debugint_wait_for_debugger(running_device *device, int firststop)
1458{
1459
1460   if (firststop && list == NULL)
1461   {
1462      DView *dv;
1463      render_target *target;
1464
1465      target = render_get_ui_target();
1466
1467      //set_view_by_name(target, "Debug");
1468
1469      dv = dview_alloc(target, device->machine, DVT_DISASSEMBLY, VIEW_STATE_FOLLOW_CPU);
1470      dv->editor.active = TRUE;
1471      dv->editor.container = render_container_get_ui();
1472      dv = dview_alloc(target, device->machine, DVT_REGISTERS, VIEW_STATE_FOLLOW_CPU);
1473      dv = dview_alloc(target, device->machine, DVT_CONSOLE, VIEW_STATE_FOLLOW_CPU);
1474      dview_set_title(dv, "Console");
1475      dv->editor.active = TRUE;
1476      dv->editor.container = render_container_get_ui();
1477      set_focus_view(dv);
1478   }
1479
1480   followers_set_cpu(device);
1481
1482   //ui_update_and_render(device->machine, render_container_get_ui());
1483   update_views();
1484   osd_update(device->machine, FALSE);
1485   handle_menus(device->machine);
1486   handle_mouse(device->machine);
1487   //osd_sleep(osd_ticks_per_second()/60);
1488
1489}
1490
1491void debugint_update_during_game(running_machine *machine)
1492{
1493   if (!debug_cpu_is_stopped(machine) && mame_get_phase(machine) == MAME_PHASE_RUNNING)
1494   {
1495      update_views();
1496   }
1497}
src/emu/debugint/debugint.h
r0r7357
1/*********************************************************************
2
3    debugint.c
4
5    Internal debugger frontend using render interface.
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10*********************************************************************/
11
12#pragma once
13
14#ifndef __DEBUGINT_H__
15#define __DEBUGINT_H__
16
17
18/***************************************************************************
19    CONSTANTS
20***************************************************************************/
21
22
23/***************************************************************************
24    TYPE DEFINITIONS
25***************************************************************************/
26
27
28
29/***************************************************************************
30    GLOBAL VARIABLES
31***************************************************************************/
32
33
34/***************************************************************************
35    FUNCTION PROTOTYPES
36***************************************************************************/
37
38/* initialize the internal debugger */
39void debugint_init(running_machine *machine);
40
41/* process events for internal debugger */
42void debugint_wait_for_debugger(running_device *device, int firststop);
43
44/* update the  internal debugger during a game */
45void debugint_update_during_game(running_machine *machine);
46
47#endif
src/emu/render.h
r7356r7357
460460/* add a char item to the specified container */
461461void render_container_add_char(render_container *container, float x0, float y0, float height, float aspect, rgb_t argb, render_font *font, UINT16 ch);
462462
463/* "drawable" handling for internal debugger */
464render_container *render_debug_alloc(render_target *target);
465void render_debug_free(render_target *target, render_container *container);
466void render_debug_top(render_target *target, render_container *container);
463467
464
465468#endif   /* __RENDER_H__ */
src/emu/validity.c
r7356r7357
405405      mame_printf_error("%s: both compatible_with and clone_of are specified\n", driver->name);
406406      error = TRUE;
407407   }
408     
408
409409   /* find any recursive dependencies on the current driver */
410410   for (other_drv = driver_get_compatible(driver); other_drv != NULL; other_drv = driver_get_compatible(other_drv))
411411   {
r7356r7357
443443   int error = FALSE;
444444
445445   /* check for duplicate ROM entries */
446/*   
447   if (driver->rom != NULL && (driver->flags & GAME_NO_STANDALONE) == 0)
448   {
449      char romaddr[20];
450      sprintf(romaddr, "%p", driver->rom);
451      if (roms.add(romaddr, driver, FALSE) == TMERR_DUPLICATE)
452      {
453         const game_driver *match = roms.find(romaddr);
454         mame_printf_error("%s: %s uses the same ROM set as (%s, %s)\n", driver->source_file, driver->description, match->source_file, match->name);
455         error = TRUE;
456      }
457   }
446/*
447    if (driver->rom != NULL && (driver->flags & GAME_NO_STANDALONE) == 0)
448    {
449        char romaddr[20];
450        sprintf(romaddr, "%p", driver->rom);
451        if (roms.add(romaddr, driver, FALSE) == TMERR_DUPLICATE)
452        {
453            const game_driver *match = roms.find(romaddr);
454            mame_printf_error("%s: %s uses the same ROM set as (%s, %s)\n", driver->source_file, driver->description, match->source_file, match->name);
455            error = TRUE;
456        }
457    }
458458*/
459459   /* iterate, starting with the driver's ROMs and continuing with device ROMs */
460460   for (const rom_source *source = rom_first_source(driver, config); source != NULL; source = rom_next_source(driver, config, source))
r7356r7357
11921192               }
11931193            }
11941194      }
1195     
1195
11961196   error = error || validate_natural_keyboard_statics();
1197   
1198   /* free the config */   
1197
1198   /* free the config */
11991199   return error;
12001200}
12011201
r7356r7357
15751575
15761576      machine_config_free(config);
15771577   }
1578   
1578
15791579#if (REPORT_TIMES)
15801580   mame_printf_info("Prep:      %8dm\n", (int)(prep / 1000000));
15811581   mame_printf_info("Expansion: %8dm\n", (int)(expansion / 1000000));
src/emu/drivers/xtal.h
r7356r7357
7070   XTAL_7_3728MHz     = 7372800,
7171   XTAL_7_8643MHz      = 7864300,      /* Used on InterFlip games as video clock */
7272   XTAL_8MHz         = 8000000,      /* Extremely common, used on 100's of PCBs */
73   XTAL_8_2MHz         = 8200000,      /* Universal Mr. Do - Model 8021 PCB */
7374   XTAL_8_4672MHz      = 8467200,      /* Subsino's Ying Hua Lian */
7475   XTAL_8_664MHz      = 8664000,      /* Touchmaster */
7576   XTAL_8_867238MHz   = 8867238,      /* ETI-660 */
r7356r7357
9394   XTAL_12MHz        = 12000000,      /* Extremely common, used on 100's of PCBs */
9495   XTAL_12_096MHz      = 12096000,      /* Some early 80's Atari games */
9596   XTAL_12_288MHz     = 12288000,      /* Sega Model 3 digital audio board */
96   XTAL_12_48MHz        = 12480000,      /* TRS-80 Model II */
97   XTAL_12_48MHz      = 12480000,      /* TRS-80 Model II */
9798   XTAL_12_5MHz      = 12500000,      /* Red Alert audio board */
9899   XTAL_12_9792MHz      = 12979200,      /* Exidy 440 */
99100   XTAL_13_3MHz      = 13300000,      /* BMC bowling */
r7356r7357
114115   XTAL_18MHz        = 18000000,      /* S.A.R, Ikari Warriors 3 */
115116   XTAL_18_432MHz     = 18432000,      /* Extremely common, used on 100's of PCBs */
116117   XTAL_18_720MHz     = 18720000,      /* Nokia MikroMikko 1 */
118   XTAL_19_6MHz      = 19600000,      /* Universal Mr. Do - Model 8021 PCB */
117119   XTAL_19_6608MHz      = 19660800,      /* Euro League (bootleg), labeled as "UKI 19.6608 20PF" */
118120   XTAL_19_923MHz      = 19923000,      /* Cinematronics vectors */
119121   XTAL_19_968MHz     = 19968000,      /* Used mostly by some Taito games */
src/mess/mess.mak
r7356r7357
7373CPUS += CCPU
7474CPUS += ADSP21XX
7575CPUS += ASAP
76#CPUS += AM29000
7677CPUS += UPD7810
7778CPUS += ARM
7879CPUS += ARM7
r7356r7357
127128CPUS += Z8
128129CPUS += I8008
129130CPUS += SCMP
131#CPUS += MN10200
130132CPUS += UNSP
131133
132134#-------------------------------------------------
r7356r7357
227229#SOUNDS += DIGITALKER
228230SOUNDS += CDP1863
229231SOUNDS += CDP1864
232#SOUNDS += ZSG2
230233SOUNDS += SOCRATES
231234SOUNDS += TMC0285
232235SOUNDS += TMS5200
docs/messnew.txt
r7356r7357
8282
8383Source Changes:
8484----------------
85- The core is based on MAME 0.136u2.  This incorporates all features of the
85- The core is based on MAME 0.136u3.  This incorporates all features of the
8686  update to this core.  [MAME team]
8787
8888- [CIA6526] Refactored interface, added SP/CNT callbacks, and fixed serial
makefile
r7356r7357
6969ifneq ($(CROSSBUILD),1)
7070
7171ifneq ($(OS2_SHELL),)
72TARGETOS = win32
72TARGETOS = os2
7373else
7474
7575UNAME = $(shell uname -a)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team