Previous 15994 Revisions Next

r7883 Thursday 22nd April, 2010 at 10:43:09 UTC by Nathan Woods
Updated to MAME 0.137u3 core
[ROOT]makefile
[docs]messnew.txt
[src/emu/machine]6840ptm.c 6840ptm.h 6850acia.c
[src/emu/sound]tms5110r.c tms5220.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]atarijsa.c exidy.c snes_snd.c
[src/mame/drivers]aladbl.c atarisy1.c atarisy2.c cave.c cojag.c ddragon.c eolith.c finalizr.c funworld.c gaiden.c ghosteo.c lasso.c m58.c megadriv.c merit.c meritm.c midas.c mpu4drvr.c naomi.c playch10.c playmark.c powerbal.c pushman.c pzletime.c sauro.c ssf2md.c ssgbl.c starwars.c subsino.c tmaster.c tmnt.c vicdual.c vmetal.c vsnes.c
[src/mame/includes]atarisy1.h atarisy2.h megadriv.h naomi.h playmark.h pushman.h* snes.h vsnes.h
[src/mame/layout]jollycrd.lay sharkpye.lay*
[src/mame/machine]dc.c naomi.c naomibd.c snes.c vsnes.c
[src/mame/video]dc.c funworld.c gaiden.c lasso.c nemesis.c playch10.c playmark.c ppu2c0x.c ppu2c0x.h pushman.c vsnes.c
[src/tools]chdman.c romcmp.c

src/mame/audio/atarijsa.c
r7882r7883
2828Banked Program ROM (4 pages)              3000-3FFF   R    D0-D7
2929Static Program ROM (48K bytes)            4000-FFFF   R    D0-D7
3030
31TODO:
32JSA-i: stereo gating for POKEY/TMS5220C is currently only mono, only looking at ym2151_ct1;
33  the two commented-out lines would be correct if stereo volume-set functions were written.
34ALL: the LPF (low pass filter) bit which selectively places a lowpass filter in the output
35  path for all channels is currently unimplemented; someone who knows analog magic will need
36  to handle this.
37
3138****************************************************************************/
3239
3340#include "emu.h"
r7882r7883
4653static UINT8 *bank_base;
4754static UINT8 *bank_source_data;
4855
49static UINT8 speech_data;
50static UINT8 last_ctl;
51
5256static running_device *jsacpu;
5357static const char *test_port;
5458static UINT16 test_mask;
r7882r7883
6468static UINT8 ym2151_volume;
6569static UINT8 tms5220_volume;
6670static UINT8 oki6295_volume;
71static UINT8 ym2151_ct1;
72static UINT8 ym2151_ct2;
6773
6874static void update_all_volumes(running_machine *machine);
6975
r7882r7883
101107
102108static void init_save_state(running_machine *machine)
103109{
104   state_save_register_global(machine, speech_data);
105   state_save_register_global(machine, last_ctl);
106
107110   state_save_register_global(machine, overall_volume);
108111   state_save_register_global(machine, pokey_volume);
109112   state_save_register_global(machine, ym2151_volume);
r7882r7883
178181   atarigen_sound_io_reset(jsacpu);
179182
180183   /* reset the static states */
181   speech_data = 0;
182   last_ctl = 0;
183184   overall_volume = 100;
184185   pokey_volume = 100;
185186   ym2151_volume = 100;
186187   tms5220_volume = 100;
187188   oki6295_volume = 100;
189   ym2151_ct1 = 0;
190   ym2151_ct2 = 0;
188191
189192   /* Guardians of the Hood assumes we're reset to bank 0 on startup */
190193   memcpy(bank_base, &bank_source_data[0x0000], 0x1000);
r7882r7883
228231         if (!(input_port_read(space->machine, test_port) & test_mask)) result ^= 0x80;
229232         if (atarigen->cpu_to_sound_ready) result ^= 0x40;
230233         if (atarigen->sound_to_cpu_ready) result ^= 0x20;
231         if (tms5220 == NULL || !tms5220_readyq_r(tms5220)) result ^= 0x10;
234         if ((tms5220 != NULL) && (tms5220_readyq_r(tms5220) == 0))
235            result |= 0x10;
236         else
237            result &= ~0x10;
232238         break;
233239
234240      case 0x006:      /* /IRQACK */
r7882r7883
262268         break;
263269
264270      case 0x200:      /* /VOICE */
265         speech_data = data;
271         if (tms5220 != NULL)
272            tms5220_data_w(tms5220, 0, data);
266273         break;
267274
268275      case 0x202:      /* /WRP */
r7882r7883
275282                0x20 = coin counter 2
276283                0x10 = coin counter 1
277284                0x08 = squeak (tweaks the 5220 frequency)
278                0x04 = TMS5220 reset (active low)
285                0x04 = TMS5220 reset (actually the read strobe) (active low)
279286                0x02 = TMS5220 write strobe (active low)
280287                0x01 = YM2151 reset (active low)
281288            */
r7882r7883
284291         if (tms5220 != NULL)
285292         {
286293            int count;
287
288            if (((data ^ last_ctl) & 0x02) && (data & 0x02))
289               tms5220_data_w(tms5220, 0, speech_data);
294            tms5220_wsq_w(tms5220, (data&0x02)>>1);
295            tms5220_rsq_w(tms5220, (data&0x04)>>2);
290296            count = 5 | ((data >> 2) & 2);
291297            tms5220_set_frequency(tms5220, JSA_MASTER_CLOCK*2 / (16 - count));
292298         }
293299
300         /* reset the YM2151 if needed */
301         if ((data&1) == 0) devtag_reset(space->machine, "ymsnd");
302
294303         /* coin counters */
295304         coin_counter_w(space->machine, 1, (data >> 5) & 1);
296305         coin_counter_w(space->machine, 0, (data >> 4) & 1);
297306
298307         /* update the bank */
299308         memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
300         last_ctl = data;
301309         break;
302310
303311      case 0x206:      /* MIX */
r7882r7883
410418                0x01 = YM2151 reset (active low)
411419            */
412420
421         /* reset the YM2151 if needed */
422         if ((data&1) == 0) devtag_reset(space->machine, "ymsnd");
423
413424         /* update the bank */
414425         memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
415         last_ctl = data;
416426
417427         /* coin counters */
418428         coin_counter_w(space->machine, 1, (data >> 5) & 1);
r7882r7883
533543                0x01 = YM2151 reset (active low)
534544            */
535545
546         /* reset the YM2151 if needed */
547         if ((data&1) == 0) devtag_reset(space->machine, "ymsnd");
548
536549         /* update the OKI bank */
537550         if (oki6295 != NULL)
538551            memory_set_bank(space->machine, "bank12", (memory_get_bank(space->machine, "bank12") & 2) | ((data >> 1) & 1));
539552
540553         /* update the bank */
541554         memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
542         last_ctl = data;
543555
544556         /* coin counters */
545557         coin_counter_w(space->machine, 1, (data >> 5) & 1);
r7882r7883
665677                0x01 = YM2151 reset (active low)
666678            */
667679
680         /* reset the YM2151 if needed */
681         if ((data&1) == 0) devtag_reset(space->machine, "ymsnd");
682
668683         /* update the OKI bank */
669684         memory_set_bank(space->machine, "bank12", (memory_get_bank(space->machine, "bank12") & 2) | ((data >> 1) & 1));
670685
671686         /* update the bank */
672687         memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
673         last_ctl = data;
674688
675689         /* coin counters */
676690         coin_counter_w(space->machine, 1, (data >> 5) & 1);
r7882r7883
702716   }
703717}
704718
719static WRITE8_DEVICE_HANDLER( ym2151_ctl_w )
720{
721   ym2151_ct1 = data&0x1;
722   ym2151_ct2 = (data&0x2)>>1;
723   update_all_volumes(device->machine);
724}
705725
706726
707727/*************************************
r7882r7883
712732
713733static void update_all_volumes(running_machine *machine )
714734{
715   if (pokey != NULL) atarigen_set_pokey_vol(machine, overall_volume * pokey_volume / 100);
735   if (pokey != NULL) atarigen_set_pokey_vol(machine, (overall_volume * pokey_volume / 100) * ym2151_ct1);
736   //if (pokey != NULL) atarigen_set_pokey_stereo_vol(machine, (overall_volume * pokey_volume / 100) * ym2151_ct1, (overall_volume * pokey_volume / 100) * ym2151_ct2);
716737   if (ym2151 != NULL) atarigen_set_ym2151_vol(machine, overall_volume * ym2151_volume / 100);
717   if (tms5220 != NULL) atarigen_set_tms5220_vol(machine, overall_volume * tms5220_volume / 100);
738   if (tms5220 != NULL) atarigen_set_tms5220_vol(machine, (overall_volume * tms5220_volume / 100) * ym2151_ct1);
739   //if (tms5220 != NULL) atarigen_set_tms5220_stereo_vol(machine, (overall_volume * tms5220_volume / 100) * ym2151_ct1, (overall_volume * tms5220_volume / 100) * ym2151_ct2);
718740   if (oki6295 != NULL || oki6295_l != NULL || oki6295_r != NULL) atarigen_set_oki6295_vol(machine, overall_volume * oki6295_volume / 100);
719741}
720742
r7882r7883
768790
769791static const ym2151_interface ym2151_config =
770792{
771   atarigen_ym2151_irq_gen
793   atarigen_ym2151_irq_gen,
794   ym2151_ctl_w
772795};
773796
774797
src/mame/audio/exidy.c
r7882r7883
7272};
7373static struct sh6840_timer_channel sh6840_timer[3];
7474static INT16 sh6840_volume[3];
75static UINT8 sh6840_MSB;
75static UINT8 sh6840_MSB_latch;
76static UINT8 sh6840_LSB_latch;
7677static UINT8 sh6840_LFSR_oldxor = 0;
7778static UINT32 sh6840_LFSR_0;
7879static UINT32 sh6840_LFSR_1;
r7882r7883
225226static void sh6840_register_state_globals(running_machine *machine)
226227{
227228    state_save_register_global_array(machine, sh6840_volume);
228    state_save_register_global(machine, sh6840_MSB);
229    state_save_register_global(machine, sh6840_MSB_latch);
230   state_save_register_global(machine, sh6840_LSB_latch);
229231    state_save_register_global(machine, sh6840_LFSR_oldxor);
230232    state_save_register_global(machine, sh6840_LFSR_0);
231233    state_save_register_global(machine, sh6840_LFSR_1);
r7882r7883
263265
264266static STREAM_UPDATE( exidy_stream_update )
265267{
268   /* hack to skip the expensive lfsr noise generation unless at least one of the 3 channels actually depends on it being generated */
266269   int noisy = ((sh6840_timer[0].cr & sh6840_timer[1].cr & sh6840_timer[2].cr & 0x02) == 0);
267270   stream_sample_t *buffer = outputs[0];
268271
r7882r7883
272275      struct sh6840_timer_channel *t;
273276      struct sh8253_timer_channel *c;
274277      int clocks_this_sample;
278      int clocks;
275279      INT16 sample = 0;
276280
277281      /* determine how many 6840 clocks this sample */
r7882r7883
292296         /* handle timer 0 if enabled */
293297         t = &sh6840_timer[0];
294298         chan0_clocks = t->clocks;
295         if (t->cr & 0x80)
296         {
297            int clocks = (t->cr & 0x02) ? clocks_this_sample : noise_clocks_this_sample;
298            sh6840_apply_clock(t, clocks);
299            if (t->state && !(exidy_sfxctrl & 0x02))
300               sample += sh6840_volume[0];
301         }
299         clocks = (t->cr & 0x02) ? clocks_this_sample : noise_clocks_this_sample;
300         sh6840_apply_clock(t, clocks);
301         if (t->state && !(exidy_sfxctrl & 0x02) && (t->cr & 0x80))
302            sample += sh6840_volume[0];
302303
303304         /* generate channel 0-clocked noise if configured to do so */
304305         if (noisy && (exidy_sfxctrl & 0x01))
r7882r7883
306307
307308         /* handle timer 1 if enabled */
308309         t = &sh6840_timer[1];
309         if (t->cr & 0x80)
310         {
311            int clocks = (t->cr & 0x02) ? clocks_this_sample : noise_clocks_this_sample;
312            sh6840_apply_clock(t, clocks);
313            if (t->state)
314               sample += sh6840_volume[1];
315         }
310         clocks = (t->cr & 0x02) ? clocks_this_sample : noise_clocks_this_sample;
311         sh6840_apply_clock(t, clocks);
312         if (t->state && (t->cr & 0x80))
313            sample += sh6840_volume[1];
316314
317315         /* handle timer 2 if enabled */
318316         t = &sh6840_timer[2];
319         if (t->cr & 0x80)
317         clocks = (t->cr & 0x02) ? clocks_this_sample : noise_clocks_this_sample;
318         /* prescale */
319         if (t->cr & 0x01)
320320         {
321            int clocks = (t->cr & 0x02) ? clocks_this_sample : noise_clocks_this_sample;
322
323            /* prescale */
324            if (t->cr & 0x01)
325            {
326               clocks += t->leftovers;
327               t->leftovers = clocks % 8;
328               clocks /= 8;
329            }
330            sh6840_apply_clock(t, clocks);
331            if (t->state)
332               sample += sh6840_volume[2];
321            clocks += t->leftovers;
322            t->leftovers = clocks % 8;
323            clocks /= 8;
333324         }
325         sh6840_apply_clock(t, clocks);
326         if (t->state && (t->cr & 0x80))
327            sample += sh6840_volume[2];
334328      }
335329
336330      /* music (if present) */
r7882r7883
410404{
411405   /* 6840 */
412406   memset(sh6840_timer, 0, sizeof(sh6840_timer));
413   sh6840_MSB = 0;
407   sh6840_MSB_latch = 0;
408   sh6840_LSB_latch = 0;
414409   sh6840_volume[0] = 0;
415410   sh6840_volume[1] = 0;
416411   sh6840_volume[2] = 0;
r7882r7883
606601
607602READ8_HANDLER( exidy_sh6840_r )
608603{
609   logerror("%04X:exidy_sh6840_r - unexpected read\n", cpu_get_pc(space->cpu));
610   return 0;
604   /* force an update of the stream */
605   stream_update(exidy_stream);
606
607   switch (offset)
608   {
609      /* offset 0: Motorola datasheet says it isn't used, Hitachi datasheet says it reads as 0s always*/
610      case 0:
611      return 0;
612      /* offset 1 reads the status register: bits 2 1 0 correspond to ints on channels 2,1,0, and bit 7 is an 'OR' of bits 2,1,0 */
613      case 1:
614      logerror("%04X:exidy_sh6840_r - unexpected read, status register is TODO!\n", cpu_get_pc(space->cpu));
615      return 0;
616      /* offsets 2,4,6 read channel 0,1,2 MSBs and latch the LSB*/
617      case 2: case 4: case 6:
618      sh6840_LSB_latch = sh6840_timer[((offset<<1)-1)].counter.b.l;
619      return sh6840_timer[((offset<<1)-1)].counter.b.h;
620      /* offsets 3,5,7 read the LSB latch*/
621      default: /* case 3,5,7 */
622      return sh6840_LSB_latch;
623   }
611624}
612625
613626
r7882r7883
643656      case 2:
644657      case 4:
645658      case 6:
646         sh6840_MSB = data;
659         sh6840_MSB_latch = data;
647660         break;
648661
649662      /* offsets 3/5/7 write to the LSB controls */
r7882r7883
653666      {
654667         /* latch the timer value */
655668         int ch = (offset - 3) / 2;
656         sh6840_timer[ch].timer = (sh6840_MSB << 8) | (data & 0xff);
669         sh6840_timer[ch].timer = (sh6840_MSB_latch << 8) | (data & 0xff);
657670
658671         /* if CR4 is clear, the value is loaded immediately */
659672         if (!(sh6840_timer[ch].cr & 0x10))
src/mame/audio/snes_snd.c
r7882r7883
234234INLINE snes_sound_state *get_safe_token( running_device *device )
235235{
236236   assert(device != NULL);
237   assert(device->token != NULL);   
237   assert(device->token != NULL);
238238   assert(device->type == SOUND);
239239   assert(sound_get_type(device) == SNES_SPC);
240240
src/mame/machine/naomi.c
r7882r7883
22
33Per-game specific JVS settings / idle loop skips for the MAME Naomi driver.
44
5suchie3: check bp c0a6458
6
7vtennis2: check bp c020130 / wpset c013ff0,f,w,wpdata==0x3f800000 -> 0xc020434 (test mode)
8
59***************************************************************************/
610
711#include "emu.h"
r7882r7883
250254   DRIVER_INIT_CALL(naomi2);
251255   actel_id = 0; //FIXME: correct value
252256}
257
258DRIVER_INIT( kick4csh )
259{
260   DRIVER_INIT_CALL(naomi2);
261   actel_id = 0; //FIXME: correct value
262}
263
src/mame/machine/dc.c
r7882r7883
153153static UINT8 maple0x86data2[0x400];
154154static emu_timer *dc_rtc_timer;
155155
156static const UINT32 maple0x82answer[]=
156static const UINT32 maple0x82answer_15kHz[]=
157157{
158   0x07200083,0x2d353133,0x39343136,0x20202020,0x59504f43,0x48474952,0x45532054,0x45204147,
158   0x07200083,0x2d353133,0x39343136,0x20202020,0x59504f43,0x48474952,0x45532054,0x45204147,   // 15 kHz
159159   0x05200083,0x5245544e,0x53495250,0x43205345,0x544c2c4f,0x20202e44,0x38393931,0x5c525043
160160};
161161
162static const UINT32 maple0x82answer_31kHz[]=
163{
164   0x07200083,0x2d353133,0x39313136,0x20202020,0x59504f43,0x48474952,0x45532054,0x45204147,   // 31 kHz (req. for Strike Fighter)
165   0x05200083,0x5245544e,0x53495250,0x43205345,0x544c2c4f,0x20202e44,0x38393931,0x5c525043
166};
167
162168// register decode helpers
163169
164170// this accepts only 32-bit accesses
r7882r7883
653659                        break;
654660                     case 0x82: // get license string
655661                        for (a=0;a < 16;a++)
656                        {
657                           buff[a]=maple0x82answer[a];
658                        }
662                           buff[a] = (input_port_read(space->machine, "DSW") & 1) ? maple0x82answer_31kHz[a] : maple0x82answer_15kHz[a];
659663                        ddtdata.length=16;
660664                        break;
661665                     case 0x86:
r7882r7883
738742                                 case 0xf1: // set address
739743                                    break;
740744                                 case 0x10:
741                                    strcpy((char *)(maple0x86data2+0x11+10), "SEGA ENTERPRISES,LTD.\nI/O BD JVS\n837-13551"); // name
745                                    strcpy((char *)(maple0x86data2+0x11+10), "SEGA ENTERPRISES,LTD.;I/O BD JVS;837-13551"); // name
742746                                    maple0x86data2[pos+7]=24+21+2;
743747                                    tocopy += 24+21;
744748                                    break;
r7882r7883
12551259
12561260      default:
12571261         /* might access the unhandled DMAs, so tell us if this happens. */
1258         printf("Unhandled G2 register [%08x] -> %08x\n",reg,dat);
1262         //printf("Unhandled G2 register [%08x] -> %08x\n",reg,dat);
12591263         break;
12601264   }
12611265}
src/mame/machine/vsnes.c
r7882r7883
1212#include "includes/vsnes.h"
1313
1414/* Globals */
15static int vsnes_gun_controller;
1615static int vsnes_do_vrom_bank;
1716
1817/* Locals */
1918static int input_latch[4];
20static const UINT8 *remapped_colortable;
2119
2220static int sound_fix=0;
2321static UINT8 last_bank;
r7882r7883
4341
4442/*************************************
4543 *
46 *  Color Mapping
47 *
48 *************************************/
49
50/* RP2C04-001 */
51/* check 0x08 */
52static const UINT8 rp2c04001_colortable[] =
53{
54   0x35, 0xff, 0x16, 0x22, 0x1c, 0xff, 0xff, 0x15, /* 0x00 - 0x07 */
55   0x20, 0x00, 0x27, 0x05, 0x04, 0x27, 0x08, 0x30, /* 0x08 - 0x0f */
56   0x21, 0xff, 0xff, 0x29, 0x3c, 0xff, 0x36, 0x12, /* 0x10 - 0x17 */
57   0xff, 0x2b, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, /* 0x18 - 0x1f */
58   0xff, 0x31, 0xff, 0x2a, 0x2c, 0x0c, 0xff, 0xff, /* 0x20 - 0x27 */
59   0xff, 0x07, 0x34, 0x06, 0x13, 0xff, 0x26, 0x0f, /* 0x28 - 0x2f */
60   0xff, 0x19, 0x10, 0x0a, 0xff, 0xff, 0xff, 0x17, /* 0x30 - 0x37 */
61   0xff, 0x11, 0x09, 0xff, 0xff, 0x25, 0x18, 0xff  /* 0x38 - 0x3f */
62};
63
64/* RP2C04-002 */
65/* 0x04, 0x24 */
66static const UINT8 rp2c04002_colortable[] =
67{
68   0xff, 0x27, 0x18, 0xff, 0x3a, 0x25, 0x2b, 0x31, /* 0x00 - 0x07 */
69   0x15, 0x13, 0x38, 0x34, 0x20, 0x23, 0xff, 0x0b, /* 0x08 - 0x0f */
70   0xff, 0x21, 0x06, 0xff, 0x1b, 0x29, 0xff, 0x22, /* 0x10 - 0x17 */
71   0xff, 0x24, 0xff, 0xff, 0xff, 0x08, 0xff, 0x03, /* 0x18 - 0x1f */
72   0xff, 0x36, 0x26, 0x33, 0x11, 0xff, 0x10, 0x02, /* 0x20 - 0x27 */
73   0x14, 0xff, 0x10, 0x09, 0x12, 0x0f, 0xff, 0x30, /* 0x28 - 0x2f */
74   0xff, 0xff, 0x2a, 0x17, 0x0c, 0x11, 0x15, 0x19, /* 0x30 - 0x37 */
75   0xff, 0x2c, 0x07, 0x37, 0xff, 0x05, 0x3a, 0xff  /* 0x38 - 0x3f */
76};
77
78/* RP2C04-003 */
79/* check 0x0f, 0x2e, 0x34 */
80static const UINT8 rp2c04003_colortable[] =
81{
82   0xff, 0xff, 0xff, 0x10, 0x1a, 0x30, 0x31, 0x09, /* 0x00 - 0x07 */
83   0x01, 0x0f, 0x36, 0x08, 0x15, 0xff, 0xff, 0x30, /* 0x08 - 0x0f */
84   0x22, 0x1c, 0xff, 0x12, 0x19, 0x18, 0x17, 0x2a, /* 0x10 - 0x17 */
85   0x00, 0xff, 0xff, 0x02, 0x06, 0x07, 0xff, 0x35, /* 0x18 - 0x1f */
86   0x23, 0xff, 0x8b, 0xf7, 0xff, 0x27, 0x26, 0x20, /* 0x20 - 0x27 */
87   0x29, 0x03, 0x21, 0x24, 0x11, 0xff, 0xff, 0xff, /* 0x28 - 0x2f */
88   0x2c, 0xff, 0xff, 0xff, 0x07, 0xf9, 0x28, 0xff, /* 0x30 - 0x37 */
89   0x0a, 0xff, 0x32, 0x37, 0x13, 0x3a, 0xff, 0x0b  /* 0x38 - 0x3f */
90};
91
92/* RP2C05-004 */
93/* check 0x03 0x1d, 0x38, 0x3b*/
94static const UINT8 rp2c05004_colortable[] =
95{
96   0x18, 0xff, 0x1c, 0x89, 0xff, 0xff, 0x01, 0x17, /* 0x00 - 0x07 */
97   0x10, 0x0f, 0x2a, 0xff, 0x36, 0x37, 0x1a, 0xff, /* 0x08 - 0x0f */
98   0x25, 0xff, 0x12, 0xff, 0x0f, 0xff, 0xff, 0x26, /* 0x10 - 0x17 */
99   0xff, 0xff, 0x22, 0xff, 0xff, 0x0f, 0x3a, 0x21, /* 0x18 - 0x1f */
100   0x05, 0x0a, 0x07, 0xc2, 0x13, 0xff, 0x00, 0x15, /* 0x20 - 0x27 */
101   0x0c, 0xff, 0x11, 0xff, 0xff, 0x38, 0xff, 0xff, /* 0x28 - 0x2f */
102   0xff, 0xff, 0x08, 0x45, 0xff, 0xff, 0x30, 0x3c, /* 0x30 - 0x37 */
103   0x0f, 0x27, 0xff, 0x60, 0x29, 0xff, 0x30, 0x09  /* 0x38 - 0x3f */
104};
105
106
107
108/* remap callback */
109static int remap_colors( running_device *device, int addr, int data )
110{
111   /* this is the protection. color codes are shuffled around */
112   /* the ones with value 0xff are unknown */
113
114   if (addr >= 0x3f00)
115   {
116      int newdata = remapped_colortable[data & 0x3f];
117
118      if (newdata != 0xff)
119         data = newdata;
120
121      #ifdef MAME_DEBUG
122      else
123         popmessage("Unmatched color %02x, at address %04x", data & 0x3f, addr);
124      #endif
125   }
126
127   return data;
128}
129
130/*************************************
131 *
13244 *  Input Ports
13345 *
13446 *************************************/
r7882r7883
239151
240152MACHINE_RESET( vsnes )
241153{
242   running_device *ppu = devtag_get_device(machine, "ppu1");
243154
244155   last_bank = 0xff;
245156   sound_fix = 0;
246157   input_latch[0] = input_latch[1] = 0;
247158   input_latch[2] = input_latch[3] = 0;
248159
249   /* if we need to remap, install the callback */
250   if (remapped_colortable)
251      ppu2c0x_set_vidaccess_callback(ppu, remap_colors);
252160}
253161
254162/*************************************
r7882r7883
259167
260168MACHINE_RESET( vsdual )
261169{
262   running_device *ppu1 = devtag_get_device(machine, "ppu1");
263   running_device *ppu2 = devtag_get_device(machine, "ppu2");
264170
265171   input_latch[0] = input_latch[1] = 0;
266172   input_latch[2] = input_latch[3] = 0;
267173
268   /* if we need to remap, install the callback */
269   if (remapped_colortable)
270   {
271      ppu2c0x_set_vidaccess_callback(ppu1, remap_colors);
272      ppu2c0x_set_vidaccess_callback(ppu2, remap_colors);
273   }
274174}
275175
276176/*************************************
r7882r7883
427327   }
428328}
429329
430/*************************************
431 *
432 *  Common init for all games
433 *
434 *************************************/
435
436static void init_vsnes(running_machine *machine)
437{
438   /* set the controller to default */
439   vsnes_gun_controller = 0;
440
441   /* no color remapping */
442   remapped_colortable = 0;
443}
444
445330/**********************************************************************************
446331 *
447332 *  Game and Board-specific initialization
448333 *
449334 **********************************************************************************/
450335
336/**********************************************************************************/
337/* Most games: VROM Banking in controller 0 write */
338
451339static WRITE8_HANDLER( vsnormal_vrom_banking )
452340{
453341   /* switch vrom */
r7882r7883
459347   vsnes_in0_w(space, offset, data);
460348}
461349
462/* Most games switch VROM Banks in controller 0 write */
463/* they dont do any other trickery */
464350DRIVER_INIT( vsnormal )
465351{
466352   /* vrom switching is enabled with bit 2 of $4016 */
467353   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4016, 0x4016, 0, 0, vsnormal_vrom_banking);
468354}
469355
470static WRITE8_HANDLER( ppuRC2C05_protection )
471{
472   running_device *ppu1 = devtag_get_device(space->machine, "ppu1");
473
474   /* This PPU has registers mapped at $2000 and $2001 inverted */
475   /* and no remapped color */
476   if (offset == 0)
477   {
478      ppu2c0x_w(ppu1, 1, data);
479      return;
480   }
481
482   ppu2c0x_w(ppu1, 0, data);
483}
484
485356/**********************************************************************************/
486/* Super Mario Bros. Extra ram at $6000 (NV?) and remapped colors */
357/* Gun games: VROM Banking in controller 0 write */
487358
488DRIVER_INIT( suprmrio )
489{
490   /* common init */
491   init_vsnes(machine);
492
493   /* normal banking */
494   DRIVER_INIT_CALL(vsnormal);
495
496   /* extra ram at $6000 is enabled with bit 1 of $4016 */
497   memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL);
498
499   /* now override the vidaccess callback */
500   /* we need to remap color tables */
501   /* this *is* the VS games protection, I guess */
502   remapped_colortable = rp2c05004_colortable;
503}
504
505/**********************************************************************************/
506/* Gun Games - VROM Banking in controller 0 write */
507
508359static WRITE8_HANDLER( gun_in0_w )
509360{
510361   running_device *ppu1 = devtag_get_device(space->machine, "ppu1");
r7882r7883
524375      input_latch[0] = input_port_read(space->machine, "IN0");
525376
526377      /* do the gun thing */
527      if (vsnes_gun_controller)
528      {
529         int x = input_port_read(space->machine, "GUNX");
530         int y = input_port_read(space->machine, "GUNY");
531         UINT32 pix, color_base;
378      int x = input_port_read(space->machine, "GUNX");
379      int y = input_port_read(space->machine, "GUNY");
380      UINT32 pix, color_base;
532381
533         /* get the pixel at the gun position */
534         pix = ppu2c0x_get_pixel(ppu1, x, y);
382      /* get the pixel at the gun position */
383      pix = ppu2c0x_get_pixel(ppu1, x, y);
535384
536         /* get the color base from the ppu */
537         color_base = ppu2c0x_get_colorbase(ppu1);
385      /* get the color base from the ppu */
386      color_base = ppu2c0x_get_colorbase(ppu1);
538387
539         /* look at the screen and see if the cursor is over a bright pixel */
540         if ((pix == color_base + 0x20 ) || (pix == color_base + 0x30) ||
541            (pix == color_base + 0x33 ) || (pix == color_base + 0x34))
542         {
543            input_latch[0] |= 0x40;
544         }
388      /* look at the screen and see if the cursor is over a bright pixel */
389      if ((pix == color_base + 0x20 ) || (pix == color_base + 0x30) ||
390         (pix == color_base + 0x33 ) || (pix == color_base + 0x34))
391      {
392         input_latch[0] |= 0x40;
545393      }
546394
547395      input_latch[1] = input_port_read(space->machine, "IN1");
r7882r7883
556404    zapstore = data;
557405}
558406
559DRIVER_INIT( duckhunt )
407DRIVER_INIT( vsgun )
560408{
561   /* vrom switching is enabled with bit 2 of $4016 */
409   /* VROM switching is enabled with bit 2 of $4016 */
562410   memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4016, 0x4016, 0, 0, gun_in0_r, gun_in0_w);
563
564   /* common init */
565   init_vsnes(machine);
566
567   /* enable gun controller */
568   vsnes_gun_controller = 1;
569411   vsnes_do_vrom_bank = 1;
570412}
571413
572414/**********************************************************************************/
573/* The Goonies, VS Gradius: ROMs bankings at $8000-$ffff */
415/* Konami games: ROMs bankings at $8000-$ffff */
574416
575static WRITE8_HANDLER( goonies_rom_banking )
417static WRITE8_HANDLER( vskonami_rom_banking )
576418{
577419   int reg = (offset >> 12) & 0x07;
578420   int bankoffset = (data & 7) * 0x2000 + 0x10000;
r7882r7883
598440   }
599441}
600442
601DRIVER_INIT( goonies )
443DRIVER_INIT( vskonami )
602444{
603445   /* We do manual banking, in case the code falls through */
604446   /* Copy the initial banks */
r7882r7883
606448   memcpy(&prg[0x08000], &prg[0x18000], 0x8000);
607449
608450   /* banking is done with writes to the $8000-$ffff area */
609   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, goonies_rom_banking);
610
611   /* common init */
612   init_vsnes(machine);
613
614   /* now override the vidaccess callback */
615   remapped_colortable = rp2c04003_colortable;
451   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, vskonami_rom_banking);
616452}
617453
618DRIVER_INIT( vsgradus )
619{
620   /* We do manual banking, in case the code falls through */
621   /* Copy the initial banks */
622   UINT8 *prg = memory_region(machine, "maincpu");
623   memcpy(&prg[0x08000], &prg[0x18000], 0x8000);
624
625   /* banking is done with writes to the $8000-$ffff area */
626   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, goonies_rom_banking);
627
628   /* common init */
629   init_vsnes(machine);
630
631   /* now override the vidaccess callback */
632   remapped_colortable = rp2c04001_colortable;
633}
634
635DRIVER_INIT( vspinbal )
636{
637   /* common init */
638   init_vsnes(machine);
639
640   /* normal banking */
641   DRIVER_INIT_CALL(vsnormal);
642
643   /* now override the vidaccess callback */
644   remapped_colortable = rp2c04001_colortable;
645
646}
647
648DRIVER_INIT( hogalley )
649{
650
651   /* vrom switching is enabled with bit 2 of $4016 */
652   memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4016, 0x4016, 0, 0, gun_in0_r, gun_in0_w);
653
654   /* common init */
655   init_vsnes(machine);
656
657   /* enable gun controller */
658   vsnes_gun_controller = 1;
659   vsnes_do_vrom_bank = 1;
660
661   /* now override the vidaccess callback */
662   remapped_colortable = rp2c04001_colortable;
663}
664
665454/***********************************************************************/
666455/* Vs. Gumshoe */
667456
668static READ8_HANDLER( vsgshoe_security_r )
669{
670   /* low part must be 0x1c */
671   return ppu2c0x_r(devtag_get_device(space->machine, "ppu1"), 2) | 0x1c;
672}
673
674457static WRITE8_HANDLER( vsgshoe_gun_in0_w )
675458{
676459   static int old_bank = 0;
r7882r7883
692475   UINT8 *prg = memory_region(machine, "maincpu");
693476   memcpy (&prg[0x08000], &prg[0x12000], 0x2000);
694477
695   /* Protection */
696   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2002, 0x2002, 0, 0, vsgshoe_security_r);
697   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2000, 0x2001, 0, 0, ppuRC2C05_protection);
698
699478   /* vrom switching is enabled with bit 2 of $4016 */
700479   memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4016, 0x4016, 0, 0, gun_in0_r, vsgshoe_gun_in0_w);
701480
702   /* common init */
703   init_vsnes(machine);
704
705   vsnes_gun_controller = 1;
706481   vsnes_do_vrom_bank = 1;
707482}
708483
r7882r7883
837612
838613   drmario_shiftreg = 0;
839614   drmario_shiftcount = 0;
840
841   /* common init */
842   init_vsnes(machine);
843
844   /* now override the vidaccess callback */
845   remapped_colortable = rp2c04003_colortable;
846615}
847616
848/***********************************************************************/
849/* Excite Bike */
850
851DRIVER_INIT( excitebk )
852{
853   /* common init */
854   init_vsnes(machine);
855
856   /* normal banking */
857   DRIVER_INIT_CALL(vsnormal);
858
859   /* now override the vidaccess callback */
860   /* we need to remap color tables */
861   /* this *is* the VS games protection, I guess */
862   remapped_colortable = rp2c04003_colortable;
863}
864
865DRIVER_INIT( excitbkj )
866{
867   /* common init */
868   init_vsnes(machine);
869
870   /* normal banking */
871   DRIVER_INIT_CALL(vsnormal);
872
873   /* now override the vidaccess callback */
874   /* we need to remap color tables */
875   /* this *is* the VS games protection, I guess */
876   remapped_colortable = rp2c05004_colortable;
877}
878
879617/**********************************************************************************/
880/* Mach Rider */
618/* Games with VRAM instead of graphics ROMs: ROMs bankings at $8000-$ffff */
881619
882DRIVER_INIT( machridr )
620static WRITE8_HANDLER( vsvram_rom_banking )
883621{
884
885   /* common init */
886   init_vsnes(machine);
887
888   /* normal banking */
889   DRIVER_INIT_CALL(vsnormal);
890
891   /* now override the vidaccess callback */
892   /* we need to remap color tables */
893   /* this *is* the VS games protection, I guess */
894   remapped_colortable = rp2c04002_colortable;
895}
896
897/**********************************************************************************/
898/* VS Slalom */
899
900DRIVER_INIT( vsslalom )
901{
902   /* common init */
903   init_vsnes(machine);
904
905   /* now override the vidaccess callback */
906   /* we need to remap color tables */
907   /* this *is* the VS games protection, I guess */
908   remapped_colortable = rp2c04002_colortable;
909}
910
911/**********************************************************************************/
912/* Castelvania: ROMs bankings at $8000-$ffff */
913
914static WRITE8_HANDLER( castlevania_rom_banking )
915{
916622   int rombank = 0x10000 + (data & 7) * 0x4000;
917623   UINT8 *prg = memory_region(space->machine, "maincpu");
918624
919625   memcpy(&prg[0x08000], &prg[rombank], 0x4000);
920626}
921627
922DRIVER_INIT( cstlevna )
628DRIVER_INIT( vsvram )
923629{
924630   /* when starting the game, the 1st 16k and the last 16k are loaded into the 2 banks */
925631   UINT8 *prg = memory_region(machine, "maincpu");
926632   memcpy(&prg[0x08000], &prg[0x28000], 0x8000);
927633
928634   /* banking is done with writes to the $8000-$ffff area */
929   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, castlevania_rom_banking);
635   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, vsvram_rom_banking);
930636
931   /* common init */
932   init_vsnes(machine);
933
934   /* now override the vidaccess callback */
935   /* we need to remap color tables */
936   /* this *is* the VS games protection, I guess */
937   remapped_colortable = rp2c04002_colortable;
938
939637   /* allocate vram */
940638   vram = auto_alloc_array(machine, UINT8, 0x2000);
941639}
942640
943641/**********************************************************************************/
944/* VS Top Gun: ROMs bankings at $8000-$ffff, plus some protection */
945642
946static READ8_HANDLER( topgun_security_r )
947{
948   /* low part must be 0x1b */
949   return ppu2c0x_r(devtag_get_device(space->machine, "ppu1"), 2) | 0x1b;
950}
951
952DRIVER_INIT( topgun )
953{
954   /* when starting the game, the 1st 16k and the last 16k are loaded into the 2 banks */
955   UINT8 *prg = memory_region(machine, "maincpu");
956   memcpy(&prg[0x08000], &prg[0x28000], 0x8000);
957
958   /* banking is done with writes to the $8000-$ffff area */
959   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, castlevania_rom_banking);
960
961   /* tap on the PPU, due to some tricky protection */
962   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2002, 0x2002, 0, 0, topgun_security_r);
963   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2000, 0x2001, 0, 0, ppuRC2C05_protection);
964
965   /* common init */
966   init_vsnes(machine);
967
968   /* allocate vram */
969   vram = auto_alloc_array(machine, UINT8, 0x2000);
970
971}
972
973/**********************************************************************************/
974
975643static int MMC3_cmd;
976644static int MMC3_prg_bank[4];
977645static int MMC3_chr_bank[6];
r7882r7883
1132800
1133801   /* extra ram at $6000-$7fff */
1134802   memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL);
1135
1136   /* common init */
1137   init_vsnes(machine);
1138803}
1139804
1140805/* Vs. RBI Baseball */
r7882r7883
1173838
1174839   /* RBI Base ball hack */
1175840   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x5e00, 0x5e01, 0, 0, rbi_hack_r) ;
1176
1177   remapped_colortable = rp2c04003_colortable;
1178841}
1179842
1180843/* Vs. Super Xevious */
r7882r7883
1226889   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x5678, 0x5678, 0, 0, supxevs_read_prot_2_r);
1227890   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x578f, 0x578f, 0, 0, supxevs_read_prot_3_r);
1228891   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x5567, 0x5567, 0, 0, supxevs_read_prot_4_r);
1229
1230   remapped_colortable = rp2c04001_colortable;
1231892}
1232893
1233894/* Vs. TKO Boxing */
r7882r7883
1258919
1259920   /* security device at $5e00-$5e01 */
1260921   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x5e00, 0x5e01, 0, 0, tko_security_r);
1261
1262   /* now override the vidaccess callback */
1263   /* we need to remap color tables */
1264   /* this *is* the VS games protection, I guess */
1265   remapped_colortable = rp2c04003_colortable;
1266922}
1267923
1268924/* Vs. Freedom Force */
r7882r7883
1273929
1274930   memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4016, 0x4016, 0, 0, gun_in0_r, gun_in0_w);
1275931
1276   vsnes_gun_controller = 1;
1277932   vsnes_do_vrom_bank = 0;
1278
1279   remapped_colortable = rp2c04001_colortable;
1280933}
1281934
1282935/**********************************************************************************/
r7882r7883
1325978   memcpy(&prg[0x0c000], &prg[0x2c000], 0x4000);
1326979
1327980   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, mapper68_rom_banking);
1328
1329   init_vsnes(machine);
1330
1331   remapped_colortable = rp2c04001_colortable;
1332
1333981}
1334982
1335983/**********************************************************************************/
r7882r7883
13581006
13591007   ret = 0;
13601008
1361   /* common init */
1362   init_vsnes(machine);
1363
13641009   /* normal banking */
13651010   DRIVER_INIT_CALL(vsnormal);
1366
1367   remapped_colortable = rp2c04002_colortable;
13681011}
13691012
13701013/**********************************************************************************/
1371/* Vs. Ninja Jajamaru Kun */
1014/* VS Dualsystem */
13721015
1373static READ8_HANDLER( jajamaru_security_r )
1016static WRITE8_HANDLER( vsdual_vrom_banking )
13741017{
1375   /* low part must be 0x40 */
1376   return ppu2c0x_r(devtag_get_device(space->machine, "ppu1"), 2) | 0x40;
1377}
1378
1379DRIVER_INIT( jajamaru )
1380{
1381   // It executes an illegal opcode: 0x04 at 0x9e67 and 0x9e1c
1382   // At 0x9e5d and 0x9e12 there is a conditional jump to it
1383   // Maybe it should be a DOP (double NOP)
1384
1385   /* Protection */
1386   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2002, 0x2002, 0, 0, jajamaru_security_r);
1387   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2000, 0x2001, 0, 0, ppuRC2C05_protection);
1388
1389   /* common init */
1390   init_vsnes(machine);
1391
1392   /* normal banking */
1393   DRIVER_INIT_CALL(vsnormal);
1394}
1395
1396/***********************************************************************/
1397/* Vs. Mighty Bomb Jack */
1398
1399static READ8_HANDLER( mightybj_security_r )
1400{
1401   /* low part must be 0x3d */
1402   return ppu2c0x_r(devtag_get_device(space->machine, "ppu1"), 2) | 0x3d;
1403}
1404
1405DRIVER_INIT( mightybj )
1406{
1407   /* Protection */
1408   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2002, 0x2002, 0, 0, mightybj_security_r);
1409   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x2000, 0x2001, 0, 0, ppuRC2C05_protection);
1410
1411   /* common init */
1412   init_vsnes(machine);
1413}
1414
1415/**********************************************************************************/
1416/* VS Tennis */
1417
1418static WRITE8_HANDLER( vstennis_vrom_banking )
1419{
14201018   running_device *other_cpu = (space->cpu == devtag_get_device(space->machine, "maincpu")) ? devtag_get_device(space->machine, "sub") : devtag_get_device(space->machine, "maincpu");
14211019
14221020   /* switch vrom */
r7882r7883
14321030      vsnes_in0_1_w(space, offset, data);
14331031}
14341032
1435DRIVER_INIT( vstennis )
1033DRIVER_INIT( vsdual )
14361034{
14371035   UINT8 *prg = memory_region(machine, "maincpu");
14381036
14391037   /* vrom switching is enabled with bit 2 of $4016 */
1440   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4016, 0x4016, 0, 0, vstennis_vrom_banking);
1441   memory_install_write8_handler(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x4016, 0x4016, 0, 0, vstennis_vrom_banking);
1038   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4016, 0x4016, 0, 0, vsdual_vrom_banking);
1039   memory_install_write8_handler(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x4016, 0x4016, 0, 0, vsdual_vrom_banking);
14421040
14431041   /* shared ram at $6000 */
14441042   memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, &prg[0x6000]);
14451043   memory_install_ram(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, &prg[0x6000]);
14461044}
14471045
1448/**********************************************************************/
1449/* VS Wrecking Crew */
1450
1451DRIVER_INIT( wrecking )
1452{
1453   /* only differance between this and vstennis is the colors */
1454   DRIVER_INIT_CALL(vstennis);
1455   remapped_colortable = rp2c04002_colortable;
1456}
1457
1458/**********************************************************************/
1459/* VS Balloon Fight */
1460
1461DRIVER_INIT( balonfgt )
1462{
1463   /* only differance between this and vstennis is the colors */
1464   DRIVER_INIT_CALL(vstennis);
1465
1466   remapped_colortable = rp2c04003_colortable;
1467}
1468
1469
1470/**********************************************************************/
1471/* VS Baseball */
1472
1473DRIVER_INIT( vsbball )
1474{
1475   /* only differance between this and vstennis is the colors */
1476   DRIVER_INIT_CALL(vstennis);
1477
1478   remapped_colortable = rp2c04001_colortable;
1479}
1480
1481
1482/**********************************************************************/
1483/* Dual Ice Climber Jpn */
1484
1485DRIVER_INIT( iceclmrj )
1486{
1487   /* only differance between this and vstennis is the colors */
1488   DRIVER_INIT_CALL(vstennis);
1489
1490   remapped_colortable = rp2c05004_colortable;
1491}
1492
1493/**********************************************************************/
1494/* Battle City */
1495
1496DRIVER_INIT( btlecity )
1497{
1498   init_vsnes(machine);
1499   DRIVER_INIT_CALL(vsnormal);
1500   remapped_colortable = rp2c04003_colortable;
1501}
1502
1503/***********************************************************************/
1504/* Tetris */
1505
1506DRIVER_INIT( vstetris )
1507{
1508   /* extra ram at $6000 is enabled with bit 1 of $4016 */
1509   memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x7fff, 0, 0, NULL);
1510
1511   init_vsnes(machine);
1512   DRIVER_INIT_CALL(vsnormal);
1513   remapped_colortable = rp2c04003_colortable;
1514}
src/mame/machine/snes.c
r7882r7883
572572   // APU is mirrored from 2140 to 217f
573573   if (offset >= APU00 && offset < WMDATA)
574574   {
575//        printf("816: %02x to APU @ %d (PC=%06x)\n", data, offset & 3,cpu_get_pc(space->cpu));
575//      printf("816: %02x to APU @ %d (PC=%06x)\n", data, offset & 3,cpu_get_pc(space->cpu));
576576      spc_port_in(state->spc700, offset & 0x3, data);
577577      cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(20));
578578      return;
r7882r7883
22002200         /* Number of bytes to transfer */
22012201         length = state->dma_channel[i].trans_size;
22022202
2203//         printf( "DMA-Ch %d: len: %X, abus: %X, bbus: %X, incr: %d, dir: %s, type: %d\n", i, length, abus | abus_bank, bbus, increment, state->dma_channel[i].dmap & 0x80 ? "PPU->CPU" : "CPU->PPU", state->dma_channel[i].dmap & 0x07);
2203//          printf( "DMA-Ch %d: len: %X, abus: %X, bbus: %X, incr: %d, dir: %s, type: %d\n", i, length, abus | abus_bank, bbus, increment, state->dma_channel[i].dmap & 0x80 ? "PPU->CPU" : "CPU->PPU", state->dma_channel[i].dmap & 0x07);
22042204
22052205#ifdef SNES_DBG_DMA
22062206         mame_printf_debug( "DMA-Ch %d: len: %X, abus: %X, bbus: %X, incr: %d, dir: %s, type: %d\n", i, length, abus | abus_bank, bbus, increment, state->dma_channel[i].dmap & 0x80 ? "PPU->CPU" : "CPU->PPU", state->dma_channel[i].dmap & 0x07);
src/mame/machine/naomibd.c
r7882r7883
242242   { "alpiltdx", 0, 0x70e41, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
243243   { "capsnk", 0, 0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
244244   { "capsnka", 0, 0, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
245   { "crackndj", 0, 0xc2347, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
245246   { "crzytaxi", 0, 0xd2f45, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
246247   { "csmash", 1, 0x03347, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
247248   { "csmasho", 1, 0x03347, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
r7882r7883
262263   { "slasho", 0, 0xa66ca, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
263264   { "smlg99", 0, 0x48a01, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
264265   { "spawn", 0, 0x78d01, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
266   { "sstrkfgt", 0, 0x32303, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
265267   { "suchie3", 0, 0x368e1, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
266268   { "toyfight", 0, 0x2ca85, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
267269   { "vtennis", 0, 0x3eb15, { 0, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } },
src/mame/mamedriv.c
r7882r7883
14931493   DRIVER( 10yardj )   /* (c) 1983 */
14941494   DRIVER( vs10yard )   /* (c) 1983/1984 */
14951495   DRIVER( vs10yardj )   /* (c) 1983/1984 */
1496   DRIVER( vs10yardu ) /* (c) 1983/1984 */
1497   DRIVER( 10yard85 )   /* (c) 1985 */
14961498   DRIVER( travrusa )   /* (c) 1983 */
14971499   DRIVER( motorace )   /* (c) 1983 Williams license */
14981500   DRIVER( shtrider )   /* (c) 1984 Seibu Kaihatsu */
r7882r7883
36173619   DRIVER( spacetrkc )   /* (c) 1980 Sega */
36183620   DRIVER( carnival )   /* 651-666 (c) 1980 Sega */
36193621   DRIVER( carnivalc )   /* 501-516 (c) 1980 Sega */
3622   DRIVER( carnivalh )
3623   DRIVER( carnivalha )
36203624   DRIVER( brdrline )   /* (c) 1980 Sega */
36213625   DRIVER( brdrlins )   /* Sidam bootleg */
36223626   DRIVER( brdrlinb )   /* Karateco bootleg */
r7882r7883
45144518   DRIVER( jambo )      /* 1999.09 Jambo! Safari */
45154519                  /* 1999.09 Super Major League 99 */
45164520   DRIVER( sgtetris )   /* 1999.10 Sega Tetris */
4517   DRIVER( derbyoc )   /* 1999.10 Derby Owners Club */
4521   DRIVER( derbyoc )   /* 1999.10 Derby Owners Club (Ver. C) */
4522   DRIVER( derbyocb )   /* 1999.10 Derby Owners Club (Ver. B) */
45184523   DRIVER( doa2 )      /* 1999.11 Dead or Alive 2 */
45194524   DRIVER( otrigger )   /* 1999.11 Out Trigger */
45204525   DRIVER( dybb99 )   /* 1999.11 Dynamite Baseball '99 */
r7882r7883
45484553                  /* 2000.09 Nittere Shiki! Mirai Yosou Studio */
45494554   DRIVER( crackndj )   /* 2000.10 Crackin' DJ */
45504555   DRIVER( cspike )   /* 2000.10 Gun Spike */
4551                  /* 2000.10 Sega Strike Fighter */
4556   DRIVER( sstrkfgt )   /* 2000.10 Sega Strike Fighter */
45524557   DRIVER( deathcox )   /* 2000.10 Death Crimson OX */
45534558                  /* 2000.11 Ninja Assault */
45544559   DRIVER( confmiss )   /* 2000.11 Confidential Mission */                                 /* First GD-ROM game? */
r7882r7883
45914596   DRIVER( luptype )   /* 2002.04 Lupin the Third: the Typing */
45924597   DRIVER( ggxx )      /* 2002.05 Guilty Gear XX */
45934598   DRIVER( mok )      /* 2002.05 The Maze of the Kings */
4594                  /* 2002.05 Cleopatra Fortune + */
4599   DRIVER( cleoftp )   /* 2002.05 Cleopatra Fortune + */
45954600   DRIVER( chocomk )   /* 2002.06 Musapey no Choco Marker */
45964601                  /* 2002.07 Mazan */
45974602                  /* 2002.09 Yonin Uchi Mahjong MJ */
r7882r7883
46084613   DRIVER( puyofev )   /* 2003.11 Puyopuyo Fever */
46094614   DRIVER( shootopl )   /* Shootout Pool */
46104615   DRIVER( shootpl )   /* 2003.xx Shootout Pool / Shootout Pool Prize */
4616   DRIVER( kick4csh )   /* 2004.xx Kick '4' Cash */
46114617   DRIVER( tetkiwam )   /* 2004.06 Tetris Kiwamemichi (Arcade TV Game List - P.88, Right, 11 from bottom) */
46124618   DRIVER( cfield )   /* 2004.06 Chaos Field */
46134619   DRIVER( trizeal )   /* 2004.09 Trizeal */
46144620                  /* 2005.03 Melty Blood Act Cadenza */
4615   DRIVER( ss2005 )   /* 2005.04 Super Shanghai 2005 */
4621   DRIVER( ss2005 )   /* 2005.03 Super Shanghai 2005 */
4622   DRIVER( ss2005a )   /* 2005.04 Super Shanghai 2005 */
46164623   DRIVER( senkoo )   /* 2005.04 Senkou no Rondo */
46174624   DRIVER( senko )      /* 2005.08 Senkou no Rondo NEW ver. */
46184625   DRIVER( meltybld )   /* 2005.08 Melty Blood Act Cadenza ver.A */
r7882r7883
46234630   DRIVER( kurucham )   /* 2006.03 Kurukuru Chameleon */
46244631   DRIVER( trgheart )   /* 2006.05 Trigger Heart Exelica */
46254632                  /* 2006.07 Touch de Zunou */
4626                  /* 2006.08 Senkou no Rondo SP */
4633   DRIVER( senkosp )   /* 2006.08 Senkou no Rondo SP */
46274634   DRIVER( jingystm )   /* 2006.09 Jingi Storm */
46284635   DRIVER( karous )   /* 2006.11 Karous */
4629                  /* 2006.12 Guilty Gear XX Accent Core */
4636   DRIVER( ggxxac  )   /* 2006.11 Guilty Gear XX Accent Core */
46304637   DRIVER( meltyb )   /* 2006.12 Melty Blood Act Cadenza ver.B */
46314638   DRIVER( meltyba )   /* 2006.12 Melty Blood Act Cadenza ver.B (Rev A) */
46324639   DRIVER( takoron )   /* 2006.12.16 Noukone Puzzle Takoron */
r7882r7883
55105517   DRIVER( tmntu )      /* GX963 (c) 1989 (US) */
55115518   DRIVER( tmntua )   /* GX963 (c) 1989 (US) */
55125519   DRIVER( tmht )      /* GX963 (c) 1989 (UK) */
5520   DRIVER( tmhta )      /* GX963 (c) 1989 (UK) */
55135521   DRIVER( tmntj )      /* GX963 (c) 1990 (Japan) */
55145522   DRIVER( tmht2p )   /* GX963 (c) 1989 (UK) */
55155523   DRIVER( tmht2pa )   /* GX963 (c) 1989 (UK) */
r7882r7883
67286736   DRIVER( ddragon )   /* TA-0021 (c) 1987 */
67296737   DRIVER( ddragonu )   /* TA-0021 (c) 1987 Taito America */
67306738   DRIVER( ddragonua )   /* TA-0021 (c) 1987 Taito America */
6739   DRIVER( ddragonub )   /* TA-0021 (c) 1987 Taito America */
67316740   DRIVER( ddragonw )   /* TA-0021 (c) 1987 Taito */
67326741   DRIVER( ddragonw1 )   /* TA-0021 (c) 1987 Taito */
67336742   DRIVER( ddragonb )   /* bootleg */
r7882r7883
70537062   DRIVER( tm )      /* (c) 1996 Midway Games */
70547063   DRIVER( tmdo )      /* (c) 1996 Midway Games */
70557064   DRIVER( tm2k )      /* (c) 1996 Midway Games */
7065   DRIVER( tm2ka )      /* (c) 1996 Midway Games */
70567066   DRIVER( tm3k )      /* (c) 1997 Midway Games */
70577067   DRIVER( tm3ka )      /* (c) 1997 Midway Games */
70587068   DRIVER( tm4k )      /* (c) 1998 Midway Games */
r7882r7883
86638673   /* MPU4+Video Board Games */
86648674   DRIVER( bctvidbs )
86658675   DRIVER( dealem )   /* 1987 */
8676   DRIVER( adders )   /* 1989 */
86668677   DRIVER( timemchn )   /* 1990 */
8678   DRIVER( turnover )   /* 199? */
8679   DRIVER( skiltrek )   /* 1990 */
86678680   DRIVER( crmaze )   /* 1994 */
8668   DRIVER( crmazea )   /* 1994 */
8669   DRIVER( crmazeb )   /* 1994 */
8670   DRIVER( turnover )   /* 199? */
8671   DRIVER( skiltrek )   /* 1992 */
8681   DRIVER( crmazea )   /* 1993 */
8682   DRIVER( crmazeb )   /* 1993 */
86728683   DRIVER( mating )   /* 199? */
8673   DRIVER( matinga )   /* 199? */
8684   DRIVER( matingd )   /* 199? */
8685
8686   DRIVER( strikeit )   /* 199? */
8687   DRIVER( strikeitd )   /* 199? */
8688   DRIVER( strikeit2 )   /* 199? */
8689   DRIVER( strikeit2d )/* 199? */
8690
8691   DRIVER( quidgrid )   /* 199? */
8692   DRIVER( quidgridd )   /* 199? */
8693   DRIVER( quidgrid2 )   /* 199? */
8694   DRIVER( quidgrid2d )/* 199? */
8695
8696   DRIVER( eyesdown )   /* 199? */
8697   DRIVER( eyesdownd )   /* 199? */
8698
8699   DRIVER( blox )      /* 199? */
8700   DRIVER( bloxd )      /* 199? */
8701   DRIVER( prizeinv )   /* 199? */
86748702   DRIVER( vgpoker )   /* 199? */
86758703
86768704   /* ADP games */
r7882r7883
89328960   DRIVER( mrdig )      /* (c) 2000 Sun */
89338961   DRIVER( hidnctch )   /* (c) 1998 Eolith */
89348962   DRIVER( ironfort )   /* (c) 1998 Eolith */
8963   DRIVER( ironfortj )   /* (c) 1998 Eolith */
89358964   DRIVER( puzzlekg )   /* (c) 1998 Eolith */
89368965   DRIVER( hidctch2 )   /* (c) 1999 Eolith */
89378966   DRIVER( nhidctch )   /* (c) 1999 Eolith */
r7882r7883
89448973   DRIVER( hidctch3 )   /* (c) 2000 Eolith */
89458974   DRIVER( crazywar )   /* (c) 2002 Eolith */
89468975   DRIVER( bballoon )   /* (c) 2003 Eolith */
8976   DRIVER( hapytour )   /* (c) 2005 GAV Company (on Eolith's Ghost hardware) */
89478977   DRIVER( xfiles )   /* (c) 1999 dgPIX Entertainment Inc */
89488978   DRIVER( kdynastg )   /* (c) 1999 EZ Graphics */
89498979   DRIVER( fmaniac3 )   /* (c) 2002 Saero Entertainment */
r7882r7883
90259055   DRIVER( tictac )   /* (c) 1985 Merit */
90269056   DRIVER( phrcraze )   /* (c) 1986 Merit */
90279057   DRIVER( phrcrazea )   /* (c) 1986 Merit */
9028   DRIVER( phrcrazes )   /* (c) 1986 Merit */
9058   DRIVER( phrcrazeb )   /* (c) 1986 Merit */
9059   DRIVER( phrcrazec )   /* (c) 1986 Merit */
9060   DRIVER( phrcrazev )   /* (c) 1986 Merit */
90299061   DRIVER( bigappg )   /* (c) 1986 Merit */
90309062   DRIVER( dodge )      /* (c) 1986 Merit */
90319063   DRIVER( couple )   /* (c) 1988 Merit */
r7882r7883
90479079   DRIVER( megat4a )   /* (c) 1996 Merit */
90489080   DRIVER( megat4sn )   /* (c) 1996 Merit */
90499081   DRIVER( megat4te )   /* (c) 1996 Merit */
9082   DRIVER( megat4tea )   /* (c) 1996 Merit */
90509083   DRIVER( megat4st )   /* (c) 1996 Merit */
90519084   DRIVER( megat5 )   /* (c) 1997 Merit */
90529085   DRIVER( megat5a )   /* (c) 1997 Merit */
r7882r7883
91179150   DRIVER( bottle10 )   /* (c) 1996 C.M.C. */
91189151   DRIVER( bottl10b )   /* (c) 1996 C.M.C. */
91199152   DRIVER( royalcrd )   /* (c) 1991 TAB-Austria */
9120   DRIVER( royalcdb )   /* (c) 1991 TAB-Austria */
9121   DRIVER( royalcdc )   /* (c) 1991 Evona Electronic */
9122   DRIVER( royalcdp )   /* (c) 1993 Digital Dreams */
9153   DRIVER( royalcrda )   /* (c) 1991 TAB-Austria */
9154   DRIVER( royalcrdb )   /* (c) 1991 TAB-Austria */
9155   DRIVER( royalcrdc )   /* (c) 1991 TAB-Austria */
9156   DRIVER( royalcrdd )   /* (c) 1991 TAB-Austria */
9157   DRIVER( royalcrde )   /* (c) 1991 TAB-Austria */
9158   DRIVER( royalcrdf )   /* (c) 1991 Evona Electronic */
9159   DRIVER( royalcrdp )   /* (c) 1993 Digital Dreams */
91239160   DRIVER( lluck3x3 )   /* (c) 1991 TAB-Austria */
91249161   DRIVER( lluck4x1 )   /* (c) 1991 TAB-Austria */
91259162   DRIVER( magicrd2 )   /* (c) 1996 Impera */
r7882r7883
92139250   DRIVER( victor5 )   /* (c) 1990 Subsino */
92149251   DRIVER( victor21 )   /* (c) 1990 Subsino */
92159252   DRIVER( crsbingo )   /* (c) 1991 Subsino */
9216   DRIVER( tisub )      /* (c) 1991 Subsino */
9253   DRIVER( tisub )      /* (c) 1992 Subsino */
9254   DRIVER( tisuba )   /* (c) 1992 Subsino */
9255   DRIVER( stisub )   /* (c) 1995 Subsino (Alpha license) */
92179256   DRIVER( sharkpy )   /* (c) 1996 Subsino */
92189257   DRIVER( sharkpya )   /* (c) 1996 Subsino */
9219   DRIVER( sharkpye )   /* (c) 1996 Subsino */
9258   DRIVER( sharkpye )   /* (c) 1996 Subsino (Alpha license) */
92209259   DRIVER( smoto20 )   /* (c) 1996 Subsino */
92219260   DRIVER( smoto16 )   /* (c) 1996 Subsino */
92229261   DRIVER( saklove )   /* (c) 1998 Subsino */
r7882r7883
93489387   DRIVER( madzoo )   /* (c) 1995 Bordun International */
93499388   DRIVER( leader )   /* Bootleg? */
93509389   DRIVER( livequiz )   /* (c) 1999 Andamiro */
9390   DRIVER( hammer )   /* (c) 2000 Andamiro */
93519391   DRIVER( cowrace )   /* (c) 20?? hack */
93529392   DRIVER( kingdrbb )  /* (c) 199? hack */
93539393   DRIVER( discoboy )   /* (c) 1993 Soft Art Co. */
src/mame/includes/megadriv.h
r7882r7883
1313INPUT_PORTS_EXTERN( md_common );
1414INPUT_PORTS_EXTERN( megadriv );
1515INPUT_PORTS_EXTERN( aladbl );
16INPUT_PORTS_EXTERN( ssgbl );
1617INPUT_PORTS_EXTERN( megadri6 );
1718INPUT_PORTS_EXTERN( ssf2ghw );
1819INPUT_PORTS_EXTERN( mk3ghw );
src/mame/includes/pushman.h
r0r7883
1/*************************************************************************
2
3    Pushman
4
5*************************************************************************/
6
7class pushman_state
8{
9public:
10   static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, pushman_state(machine)); }
11
12   pushman_state(running_machine &machine) { }
13
14   /* memory pointers */
15   UINT16 *   videoram;
16   UINT16 *   spriteram;
17//  UINT16 *   paletteram;    // currently this uses generic palette handling
18
19   /* video-related */
20   tilemap_t  *bg_tilemap, *tx_tilemap;
21   UINT16     control[2];
22
23   /* misc */
24   UINT8      shared_ram[8];
25   UINT16     latch, new_latch;
26
27   /* devices */
28   running_device *maincpu;
29   running_device *audiocpu;
30   running_device *mcu;
31};
32
33
34/*----------- defined in video/pushman.c -----------*/
35
36WRITE16_HANDLER( pushman_scroll_w );
37WRITE16_HANDLER( pushman_videoram_w );
38
39VIDEO_START( pushman );
40
41VIDEO_UPDATE( pushman );
src/mame/includes/playmark.h
r7882r7883
1
2class playmark_state
3{
4public:
5   static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, playmark_state(machine)); }
6
7   playmark_state(running_machine &machine) { }
8
9   /* memory pointers */
10   UINT16 *     bgvideoram;
11   UINT16 *     videoram1;
12   UINT16 *     videoram2;
13   UINT16 *     videoram3;
14   UINT16 *     rowscroll;
15   UINT16 *     spriteram;
16//      UINT16 *     paletteram;    // currently this uses generic palette handling
17   size_t       spriteram_size;
18
19   /* video-related */
20   tilemap_t   *tx_tilemap, *fg_tilemap, *bg_tilemap;
21   int         bgscrollx, bgscrolly, bg_enable, bg_full_size;
22   int         fgscrollx, fg_rowscroll_enable;
23
24   int         xoffset;
25   int         yoffset;
26   int         txt_tile_offset;
27   int         pri_masks[3];
28   UINT16      scroll[7];
29
30   /* powerbal-specific */
31   int         tilebank;
32   int         bg_yoffset;
33
34   /* misc */
35   UINT16      snd_command;
36   UINT16      snd_flag;
37   UINT8       oki_control;
38   UINT8       oki_command;
39   int         old_oki_bank;
40
41   /* devices */
42   running_device *oki;
43   running_device *eeprom;
44};
45
146/*----------- defined in video/playmark.c -----------*/
247
3extern UINT16 *bigtwin_bgvideoram;
4extern UINT16 *wbeachvl_videoram1,*wbeachvl_videoram2,*wbeachvl_videoram3;
5extern UINT16 *wbeachvl_rowscroll;
6
7VIDEO_START( bigtwin );
8VIDEO_START( wbeachvl );
9VIDEO_START( excelsr );
10VIDEO_START( hotmind );
11VIDEO_START( hrdtimes );
1248WRITE16_HANDLER( wbeachvl_txvideoram_w );
1349WRITE16_HANDLER( wbeachvl_fgvideoram_w );
1450WRITE16_HANDLER( wbeachvl_bgvideoram_w );
r7882r7883
2056WRITE16_HANDLER( wbeachvl_scroll_w );
2157WRITE16_HANDLER( excelsr_scroll_w );
2258WRITE16_HANDLER( hrdtimes_scroll_w );
59
60VIDEO_START( bigtwin );
61VIDEO_START( wbeachvl );
62VIDEO_START( excelsr );
63VIDEO_START( hotmind );
64VIDEO_START( hrdtimes );
65
2366VIDEO_UPDATE( bigtwin );
2467VIDEO_UPDATE( wbeachvl );
2568VIDEO_UPDATE( excelsr );
src/mame/includes/snes.h
r7882r7883
2323#define DOTCLK_NTSC   (MCLK_NTSC/4)
2424#define DOTCLK_PAL   (MCLK_PAL/4)
2525
26#define SNES_LAYER_DEBUG  1
26#define SNES_LAYER_DEBUG 
2727
2828/* Debug definitions */
2929#ifdef MAME_DEBUG
src/mame/includes/atarisy1.h
r7882r7883
2525   UINT8         joystick_int_enable;
2626   UINT8         joystick_value;
2727
28   UINT8         tms5220_out_data;
29   UINT8         tms5220_in_data;
30   UINT8         tms5220_ctl;
31
3228   /* playfield parameters */
3329   UINT16         playfield_lookup[256];
3430   UINT8         playfield_tile_bank;
src/mame/includes/atarisy2.h
r7882r7883
2323   INT8         pedal_count;
2424
2525   UINT8         has_tms5220;
26   UINT8         tms5220_data;
27   UINT8         tms5220_data_strobe;
2826
2927   UINT8         which_adc;
3028
src/mame/includes/naomi.h
r7882r7883
3333
3434extern DRIVER_INIT( vf4evoct );
3535
36extern DRIVER_INIT( kick4csh );
37
3638extern UINT64 *naomi_ram64;
3739
3840extern int jvsboard_type;
src/mame/includes/vsnes.h
r7882r7883
1717MACHINE_RESET( vsdual );
1818MACHINE_START( vsnes );
1919MACHINE_START( vsdual );
20DRIVER_INIT( suprmrio );
21DRIVER_INIT( excitebk );
22DRIVER_INIT( excitbkj );
20
2321DRIVER_INIT( vsnormal );
24DRIVER_INIT( duckhunt );
25DRIVER_INIT( hogalley );
26DRIVER_INIT( goonies );
27DRIVER_INIT( machridr );
28DRIVER_INIT( vsslalom );
29DRIVER_INIT( cstlevna );
22DRIVER_INIT( vsgun );
23DRIVER_INIT( vskonami );
24DRIVER_INIT( vsvram );
3025DRIVER_INIT( drmario );
3126DRIVER_INIT( rbibb );
3227DRIVER_INIT( tkoboxng );
33DRIVER_INIT( topgun );
34DRIVER_INIT( vsgradus );
35DRIVER_INIT( vspinbal );
3628DRIVER_INIT( MMC3 );
3729DRIVER_INIT( platoon );
38DRIVER_INIT( vstennis );
39DRIVER_INIT( wrecking );
40DRIVER_INIT( balonfgt );
41DRIVER_INIT( vsbball );
42DRIVER_INIT( iceclmrj );
4330DRIVER_INIT( supxevs );
44DRIVER_INIT( btlecity );
45DRIVER_INIT( vstetris );
4631DRIVER_INIT( bnglngby );
47DRIVER_INIT( jajamaru);
4832DRIVER_INIT( vsgshoe );
4933DRIVER_INIT( vsfdf );
50DRIVER_INIT( mightybj);
34DRIVER_INIT( vsdual );
5135
5236READ8_HANDLER( vsnes_in0_r );
5337READ8_HANDLER( vsnes_in1_r );
src/mame/mame.mak
r7882r7883
18231823                  $(LAYOUT)/tisub.lh \
18241824                  $(LAYOUT)/crsbingo.lh \
18251825                  $(LAYOUT)/sharkpy.lh \
1826                  $(LAYOUT)/sharkpye.lh \
18261827                  $(LAYOUT)/smoto.lh
18271828
18281829$(DRIVERS)/superchs.o:   $(LAYOUT)/superchs.lh
src/mame/video/gaiden.c
r7882r7883
7575VIDEO_START( gaiden )
7676{
7777   gaiden_state *state = (gaiden_state *)machine->driver_data;
78   int width = video_screen_get_width(machine->primary_screen);
79   int height = video_screen_get_height(machine->primary_screen);
7880
7981   /* set up tile layers */
82   state->tile_bitmap_bg = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
83   state->tile_bitmap_fg = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
84
8085   state->background = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
81   state->foreground = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
86   state->foreground = tilemap_create(machine, get_fg_tile_info_raiga, tilemap_scan_rows, 16, 16, 64, 32);
8287   state->text_layer = tilemap_create(machine, get_tx_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
8388
8489   tilemap_set_transparent_pen(state->background, 0);
8590   tilemap_set_transparent_pen(state->foreground, 0);
8691   tilemap_set_transparent_pen(state->text_layer, 0);
92
93   /* set up sprites */
94   state->sprite_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
8795}
8896
8997VIDEO_START( mastninj )
9098{
99
91100   gaiden_state *state = (gaiden_state *)machine->driver_data;
101   int width = video_screen_get_width(machine->primary_screen);
102   int height = video_screen_get_height(machine->primary_screen);
92103
93104   /* set up tile layers */
105   state->tile_bitmap_bg = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
106   state->tile_bitmap_fg = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
107
94108   state->background = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
95   state->foreground = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
109   state->foreground = tilemap_create(machine, get_fg_tile_info_raiga, tilemap_scan_rows, 16, 16, 64, 32);
96110   state->text_layer = tilemap_create(machine, get_tx_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
97111
98112//  tilemap_set_transparent_pen(state->background, 15);
99113   tilemap_set_transparent_pen(state->foreground, 15);
100114   tilemap_set_transparent_pen(state->text_layer, 15);
101115
116   /* set up sprites */
117   state->sprite_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
118
102119   tilemap_set_scrolldx(state->background, -248, 248);
103120   tilemap_set_scrolldx(state->foreground, -252, 252);
104121}
r7882r7883
302319
303320#define NUM_SPRITES 256
304321
305static void gaiden_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
322static void gaiden_draw_sprites( running_machine *machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle *cliprect )
306323{
307324   static const UINT8 layout[8][8] =
308325   {
r7882r7883
344361         int ypos = source[3] & 0x01ff;
345362         int xpos = source[4] & 0x01ff;
346363
347         if ((attributes & 0x20) && (video_screen_get_frame_number(machine->primary_screen) & 1))
348            goto skip_sprite;
349
350364         color = (color >> 4) & 0x0f;
351365
352366         /* wraparound */
r7882r7883
379393            case 0x3: priority_mask = 0xf0 | 0xcc | 0xaa;   break;   /* obscured by bg and fg  */
380394         }
381395
382         for (row = 0; row < sizey; row++)
396
397         /* blending */
398         if (attributes & 0x20)
383399         {
384            for (col = 0; col < sizex; col++)
400            color |= 0x80;
401
402            for (row = 0; row < sizey; row++)
385403            {
386               int sx = xpos + 8 * (flipx ? (sizex - 1 - col) : col);
387               int sy = ypos + 8 * (flipy ? (sizey - 1 - row) : row);
404               for (col = 0; col < sizex; col++)
405               {
406                  int sx = xpos + 8 * (flipx ? (sizex - 1 - col) : col);
407                  int sy = ypos + 8 * (flipy ? (sizey - 1 - row) : row);
388408
389               pdrawgfx_transpen_raw(bitmap, cliprect, gfx,
390                  number + layout[row][col],
391                  gfx->color_base + color * gfx->color_granularity,
392                  flipx, flipy,
393                  sx, sy,
394                  machine->priority_bitmap, priority_mask, 0);
409                  pdrawgfx_transpen_raw(bitmap_sp, cliprect, gfx,
410                     number + layout[row][col],
411                     gfx->color_base + color * gfx->color_granularity,
412                     flipx, flipy,
413                     sx, sy,
414                     machine->priority_bitmap, priority_mask, 0);
415               }
395416            }
396417         }
418         else
419         {
420            bitmap_t *bitmap = (priority >= 2) ? bitmap_bg : bitmap_fg;
421
422            for (row = 0; row < sizey; row++)
423            {
424               for (col = 0; col < sizex; col++)
425               {
426                  int sx = xpos + 8 * (flipx ? (sizex - 1 - col) : col);
427                  int sy = ypos + 8 * (flipy ? (sizey - 1 - row) : row);
428
429                  pdrawgfx_transpen_raw(bitmap, cliprect, gfx,
430                     number + layout[row][col],
431                     gfx->color_base + color * gfx->color_granularity,
432                     flipx, flipy,
433                     sx, sy,
434                     machine->priority_bitmap, priority_mask, 0);
435               }
436            }
437         }
397438      }
398skip_sprite:
399439      source -= 8;
400440   }
401441}
r7882r7883
585625VIDEO_UPDATE( gaiden )
586626{
587627   gaiden_state *state = (gaiden_state *)screen->machine->driver_data;
588   bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
589   bitmap_fill(bitmap, cliprect, 0x200);
628   bitmap_fill(screen->machine->priority_bitmap,    cliprect, 0);
590629
591   tilemap_draw(bitmap, cliprect, state->background, 0, 1);
592   tilemap_draw(bitmap, cliprect, state->foreground, 0, 2);
593   tilemap_draw(bitmap, cliprect, state->text_layer, 0, 4);
630   bitmap_fill(state->tile_bitmap_bg, cliprect, 0x200);
631   bitmap_fill(state->tile_bitmap_fg, cliprect, 0);
632   bitmap_fill(state->sprite_bitmap, cliprect, 0);
594633
595   gaiden_draw_sprites(screen->machine, bitmap, cliprect);
634   /* draw tilemaps into a 16-bit bitmap */
635   tilemap_draw(state->tile_bitmap_bg, cliprect, state->background, 0, 1);
636   tilemap_draw(state->tile_bitmap_fg, cliprect, state->foreground, 0, 2);
637   /* draw the blended tiles at a lower priority
638       so sprites covered by them will still be drawn */
639   tilemap_draw(state->tile_bitmap_fg, cliprect, state->foreground, 1, 0);
640   tilemap_draw(state->tile_bitmap_fg, cliprect, state->text_layer, 0, 4);
641
642   /* draw sprites into a 16-bit bitmap */
643   gaiden_draw_sprites(screen->machine, state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, cliprect);
644
645   /* mix & blend the tilemaps and sprites into a 32-bit bitmap */
646   blendbitmaps(screen->machine, bitmap, state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, 0, 0, cliprect);
596647   return 0;
648
597649}
598650
599651VIDEO_UPDATE( raiga )
src/mame/video/pushman.c
r7882r7883
11#include "emu.h"
2#include "includes/pushman.h"
23
3static tilemap_t *bg_tilemap,*tx_tilemap;
4static UINT16 control[2];
5
6
74/***************************************************************************
85
96  Callbacks for the TileMap code
r7882r7883
1310static TILEMAP_MAPPER( background_scan_rows )
1411{
1512   /* logical (col,row) -> memory offset */
16   return ((col & 0x7)) + ((7-(row & 0x7)) << 3) + ((col & 0x78) <<3) + ((0x38-(row&0x38))<<7);
13   return ((col & 0x7)) + ((7 - (row & 0x7)) << 3) + ((col & 0x78) << 3) + ((0x38 - (row & 0x38)) << 7);
1714}
1815
1916static TILE_GET_INFO( get_back_tile_info )
2017{
21   UINT8 *bgMap = memory_region(machine, "gfx4");
18   UINT8 *bg_map = memory_region(machine, "gfx4");
2219   int tile;
2320
24   tile=bgMap[tile_index<<1]+(bgMap[(tile_index<<1)+1]<<8);
21   tile = bg_map[tile_index << 1] + (bg_map[(tile_index << 1) + 1] << 8);
2522   SET_TILE_INFO(
2623         2,
27         (tile&0xff)|((tile&0x4000)>>6),
28         (tile>>8)&0xf,
29         (tile&0x2000)?TILE_FLIPX:0);
24         (tile & 0xff) | ((tile & 0x4000) >> 6),
25         (tile >> 8) & 0xf,
26         (tile & 0x2000) ? TILE_FLIPX : 0);
3027}
3128
3229static TILE_GET_INFO( get_text_tile_info )
3330{
34   int tile = machine->generic.videoram.u16[tile_index];
31   pushman_state *state = (pushman_state *)machine->driver_data;
32
33   int tile = state->videoram[tile_index];
3534   SET_TILE_INFO(
3635         0,
37         (tile&0xff)|((tile&0xc000)>>6)|((tile&0x2000)>>3),
38         (tile>>8)&0xf,
39         (tile&0x1000)?TILE_FLIPY:0);   /* not used? from Tiger Road */
36         (tile & 0xff) | ((tile & 0xc000) >> 6) | ((tile & 0x2000) >> 3),
37         (tile >> 8) & 0xf,
38         (tile & 0x1000) ? TILE_FLIPY : 0);   /* not used? from Tiger Road */
4039}
4140
4241
r7882r7883
4948
5049VIDEO_START( pushman )
5150{
52   bg_tilemap = tilemap_create(machine, get_back_tile_info,background_scan_rows,     32,32,128,64);
53   tx_tilemap = tilemap_create(machine, get_text_tile_info,tilemap_scan_rows,    8, 8, 32,32);
51   pushman_state *state = (pushman_state *)machine->driver_data;
5452
55   tilemap_set_transparent_pen(tx_tilemap,3);
53   state->bg_tilemap = tilemap_create(machine, get_back_tile_info, background_scan_rows, 32, 32, 128, 64);
54   state->tx_tilemap = tilemap_create(machine, get_text_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
55
56   tilemap_set_transparent_pen(state->tx_tilemap, 3);
5657}
5758
5859
r7882r7883
6566
6667WRITE16_HANDLER( pushman_scroll_w )
6768{
68   COMBINE_DATA(&control[offset]);
69   pushman_state *state = (pushman_state *)space->machine->driver_data;
70   COMBINE_DATA(&state->control[offset]);
6971}
7072
7173WRITE16_HANDLER( pushman_videoram_w )
7274{
73   COMBINE_DATA(&space->machine->generic.videoram.u16[offset]);
74   tilemap_mark_tile_dirty(tx_tilemap,offset);
75   pushman_state *state = (pushman_state *)space->machine->driver_data;
76   COMBINE_DATA(&state->videoram[offset]);
77   tilemap_mark_tile_dirty(state->tx_tilemap, offset);
7578}
7679
7780
r7882r7883
8285
8386***************************************************************************/
8487
85static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
88static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
8689{
87   UINT16 *spriteram16 = machine->generic.spriteram.u16;
88   int offs,x,y,color,sprite,flipx,flipy;
90   pushman_state *state = (pushman_state *)machine->driver_data;
91   UINT16 *spriteram = state->spriteram;
92   int offs, x, y, color, sprite, flipx, flipy;
8993
90   for (offs = 0x0800-4;offs >=0;offs -= 4)
94   for (offs = 0x0800 - 4; offs >=0; offs -= 4)
9195   {
9296      /* Don't draw empty sprite table entries */
93      x = spriteram16[offs+3]&0x1ff;
94      if (x==0x180) continue;
95      if (x>0xff) x=0-(0x200-x);
96      y = 240-spriteram16[offs+2];
97      color = ((spriteram16[offs+1]>>2)&0xf);
98      sprite = spriteram16[offs]&0x7ff;
97      x = spriteram[offs + 3] & 0x1ff;
98      if (x == 0x180)
99         continue;
100      if (x > 0xff)
101         x = 0 - (0x200 - x);
102
103      y = 240 - spriteram[offs + 2];
104      color = ((spriteram[offs + 1] >> 2) & 0xf);
105      sprite = spriteram[offs] & 0x7ff;
99106      /* ElSemi - Sprite flip info */
100      flipx=spriteram16[offs+1]&2;
101      flipy=spriteram16[offs+1]&1;   /* flip y untested */
107      flipx = spriteram[offs + 1] & 2;
108      flipy = spriteram[offs + 1] & 1;   /* flip y untested */
102109
103110      if (flip_screen_get(machine))
104111      {
r7882r7883
108115         flipy = !flipy;
109116      }
110117
111      drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
112            sprite,
113                color,flipx,flipy,x,y,15);
118      drawgfx_transpen(bitmap,cliprect,machine->gfx[1], sprite,
119                color, flipx, flipy, x, y, 15);
114120   }
115121}
116122
117123VIDEO_UPDATE( pushman )
118124{
125   pushman_state *state = (pushman_state *)screen->machine->driver_data;
126
119127   /* Setup the tilemaps */
120   tilemap_set_scrollx( bg_tilemap,0, control[0] );
121   tilemap_set_scrolly( bg_tilemap,0, 0xf00-control[1] );
128   tilemap_set_scrollx(state->bg_tilemap, 0, state->control[0]);
129   tilemap_set_scrolly(state->bg_tilemap, 0, 0xf00 - state->control[1]);
122130
123   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
124   draw_sprites(screen->machine,bitmap,cliprect);
125   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
131   tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
132   draw_sprites(screen->machine, bitmap, cliprect);
133   tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
126134   return 0;
127135}
src/mame/video/dc.c
r7882r7883
2121
2222#define NUM_BUFFERS 4
2323
24/* PVR TA macro defines */
25/*
26SPG_HBLANK_INT
27---- --xx xxxx xxxx ---- ---- ---- ---- hblank_in_interrupt
28---- ---- ---- ---- --xx ---- ---- ---- hblank_int_mode
29---- ---- ---- ---- ---- --xx xxxx xxxx line_comp_val
30*/
31#define spg_hblank_in_irq   ((pvrta_regs[SPG_HBLANK_INT] & 0x03ff0000) >> 16)
32#define spg_hblank_int_mode ((pvrta_regs[SPG_HBLANK_INT] & 0x00003000) >> 12)
33#define spg_line_comp_val   ((pvrta_regs[SPG_HBLANK_INT] & 0x000003ff) >> 0)
34
35/*
36SPG_VBLANK_INT
37---- --xx xxxx xxxx ---- ---- ---- ---- vblank_out_interrupt_line_number
38---- ---- ---- ---- ---- --xx xxxx xxxx vblank_in_interrupt_line_number
39*/
40#define spg_vblank_out_irq_line_num ((pvrta_regs[SPG_VBLANK_INT] & 0x03ff0000) >> 16)
41#define spg_vblank_in_irq_line_num  ((pvrta_regs[SPG_VBLANK_INT] & 0x000003ff) >> 0)
42
43
44/*
45VO_BORDER_COL
46---- ---x ---- ---- ---- ---- ---- ---- Chroma ;suchie3 sets 0xff there, maybe it's 8 bits too?
47---- ---- xxxx xxxx ---- ---- ---- ---- Red
48---- ---- ---- ---- xxxx xxxx ---- ---- Green
49---- ---- ---- ---- ---- ---- xxxx xxxx Blue
50*/
51#define vo_border_K ((pvrta_regs[VO_BORDER_COL] & 0x01000000) >> 24)
52#define vo_border_R ((pvrta_regs[VO_BORDER_COL] & 0x00ff0000) >> 16)
53#define vo_border_G ((pvrta_regs[VO_BORDER_COL] & 0x0000ff00) >> 8)
54#define vo_border_B ((pvrta_regs[VO_BORDER_COL] & 0x000000ff) >> 0)
55
56/*
57SPG_HBLANK
58---- ---- --xx xxxx xxxx ---- ---- ---- vbend
59---- ---- ---- ---- ---- --xx xxxx xxxx vbstart
60*/
61#define spg_hbend    ((pvrta_regs[SPG_HBLANK] & 0x03ff0000) >> 16)
62#define spg_hbstart  ((pvrta_regs[SPG_HBLANK] & 0x000003ff) >> 0)
63
64
65/*
66SPG_LOAD
67---- ---- --xx xxxx xxxx ---- ---- ---- vcount
68---- ---- ---- ---- ---- --xx xxxx xxxx hcount
69*/
70#define spg_vcount   ((pvrta_regs[SPG_LOAD] & 0x03ff0000) >> 16)
71#define spg_hcount   ((pvrta_regs[SPG_LOAD] & 0x000003ff) >> 0)
72
73/*
74SPG_VBLANK
75---- ---- --xx xxxx xxxx ---- ---- ---- vbend
76---- ---- ---- ---- ---- --xx xxxx xxxx vbstart
77*/
78#define spg_vbend    ((pvrta_regs[SPG_VBLANK] & 0x03ff0000) >> 16)
79#define spg_vbstart  ((pvrta_regs[SPG_VBLANK] & 0x000003ff) >> 0)
80
81
82/*
83VO_CONTROL
84---- ---- --xx xxxx ---- ---- ---- ---- pclk_delay
85---- ---- ---- ---- ---- ---x ---- ---- pixel_double ;used in test mode
86---- ---- ---- ---- ---- ---- xxxx ---- field_mode
87---- ---- ---- ---- ---- ---- ---- x--- blank_video
88---- ---- ---- ---- ---- ---- ---- -x-- blank_pol
89---- ---- ---- ---- ---- ---- ---- --x- vsync_pol
90---- ---- ---- ---- ---- ---- ---- ---x hsync_pol
91*/
92#define spg_pclk_delay   ((pvrta_regs[VO_CONTROL] & 0x003f0000) >> 16)
93#define spg_pixel_double ((pvrta_regs[VO_CONTROL] & 0x00000100) >> 8)
94#define spg_field_mode   ((pvrta_regs[VO_CONTROL] & 0x000000f0) >> 4)
95#define spg_blank_video  ((pvrta_regs[VO_CONTROL] & 0x00000008) >> 3)
96#define spg_blank_pol    ((pvrta_regs[VO_CONTROL] & 0x00000004) >> 2)
97#define spg_vsync_pol    ((pvrta_regs[VO_CONTROL] & 0x00000002) >> 1)
98#define spg_hsync_pol    ((pvrta_regs[VO_CONTROL] & 0x00000001) >> 0)
99
100/*
101VO_STARTX
102---- ---- ---- ---- ---- ---x xxxx xxxx horzontal start position
103*/
104#define vo_horz_start_pos ((pvrta_regs[VO_STARTX] & 0x000003ff) >> 0)
105
106/*
107VO_STARTY
108---- ---x xxxx xxxx ---- ---- ---- ---- vertical start position on field 2
109---- ---- ---- ---- ---- ---x xxxx xxxx vertical start position on field 1
110*/
111
112#define vo_vert_start_pos_f2 ((pvrta_regs[VO_STARTY] & 0x03ff0000) >> 16)
113#define vo_vert_start_pos_f1 ((pvrta_regs[VO_STARTY] & 0x000003ff) >> 0)
114
115
116
24117UINT32 pvrctrl_regs[0x100/4];
25118static UINT32 pvrta_regs[0x2000/4];
26119static const int pvr_parconfseq[] = {1,2,3,2,3,4,5,6,5,6,7,8,9,10,11,12,13,14,13,14,15,16,17,16,17,0,0,0,0,0,18,19,20,19,20,21,22,23,22,23};
r7882r7883
44137static emu_timer *endofrender_timer_tsp;
45138static emu_timer *endofrender_timer_video;
46139
47static int scanline;
140static int scanline,next_y;
48141
49142// the real accumulation buffer is a 32x32x8bpp buffer into which tiles get rendered before they get copied to the framebuffer
50143//  our implementation is not currently tile based, and thus the accumulation buffer is screen sized
r7882r7883
9891082   switch (reg)
9901083   {
9911084   case SPG_STATUS:
992      pvrta_regs[reg] = (video_screen_get_vblank(space->machine->primary_screen) << 13) | (video_screen_get_hblank(space->machine->primary_screen) << 12) | (video_screen_get_vpos(space->machine->primary_screen) & 0x3ff);
1085      {
1086         UINT8 fieldnum,vsync,hsync,blank;
1087
1088         fieldnum = (video_screen_get_frame_number(space->machine->primary_screen) & 1) ? 1 : 0;
1089
1090         vsync = video_screen_get_vblank(space->machine->primary_screen) ? 1 : 0;
1091         if(spg_vsync_pol) { vsync^=1; }
1092
1093         hsync = video_screen_get_hblank(space->machine->primary_screen) ? 1 : 0;
1094         if(spg_hsync_pol) { hsync^=1; }
1095
1096         /* FIXME: following is just a wild guess */
1097         blank = (video_screen_get_vblank(space->machine->primary_screen) | video_screen_get_hblank(space->machine->primary_screen)) ? 0 : 1;
1098         if(spg_blank_pol) { blank^=1; }
1099
1100         pvrta_regs[reg] = (vsync << 13) | (hsync << 12) | (blank << 11) | (fieldnum << 10) | (video_screen_get_vpos(space->machine->primary_screen) & 0x1ff);
1101         break;
1102      }
1103   case SPG_TRIGGER_POS:
1104      printf("Warning: read at h/v counter ext latches\n");
9931105      break;
9941106   }
9951107
r7882r7883
12321344      state_ta.tafifo_listtype= -1; // no list being received
12331345      state_ta.listtype_used |= (1+4);
12341346      break;
1347   case SPG_VBLANK:
1348   case SPG_HBLANK:
1349   case SPG_LOAD:
1350   case VO_STARTX:
1351   case VO_STARTY:
1352      {
1353         rectangle visarea = *video_screen_get_visible_area(space->machine->primary_screen);
1354         /* FIXME: right visible area calculations aren't known yet*/
1355         visarea.min_x = 0;
1356         visarea.max_x = ((spg_hbstart - spg_hbend - vo_horz_start_pos) <= 0x180 ? 320 : 640) - 1;
1357         visarea.min_y = 0;
1358         visarea.max_y = ((spg_vbstart - spg_vbend - vo_vert_start_pos_f1) <= 0x100 ? 240 : 480) - 1;
1359
1360         video_screen_configure(space->machine->primary_screen, spg_hbstart, spg_vbstart, &visarea, video_screen_get_frame_period(space->machine->primary_screen).attoseconds );
1361      }
1362      break;
12351363   }
12361364
12371365   #if DEBUG_PVRTA_REGS
r7882r7883
19692097
19702098   switch (packmode)
19712099   {
2100      case 0x00:
2101         printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x (0555 KRGB)\n",x,y,packmode);
2102         break;
2103
2104      // used by cleoftp
19722105      case 0x01: //565 RGB 16 bit
19732106      {
19742107         int xcnt,ycnt;
r7882r7883
19802113
19812114            for (xcnt=0;xcnt<32;xcnt++)
19822115            {
2116               // data starts in 8888 format, downsample it
2117               UINT32 data = src[xcnt];
2118               UINT16 newdat = ((((data & 0x000000f8) >> 3)) << 0)   |
2119                               ((((data & 0x0000fc00) >> 10)) << 5)  |
2120                           ((((data & 0x00f80000) >> 19)) << 11);
2121
2122               memory_write_word(space,realwriteoffs+xcnt*2, newdat);
2123            }
2124         }
2125      }
2126      break;
2127
2128      case 0x02:
2129         printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x (4444 ARGB)\n",x,y,packmode);
2130         break;
2131
2132      case 0x03: // 1555 ARGB 16 bit
2133      {
2134         int xcnt,ycnt;
2135         for (ycnt=0;ycnt<32;ycnt++)
2136         {
2137            UINT32 realwriteoffs = 0x05000000 + writeoffs + (y+ycnt) * (stride<<3) + (x*2);
2138            src = BITMAP_ADDR32(fake_accumulationbuffer_bitmap, y+ycnt, x);
2139
2140
2141            for (xcnt=0;xcnt<32;xcnt++)
2142            {
2143               // data starts in 8888 format, downsample it
2144               UINT32 data = src[xcnt];
2145               UINT16 newdat = ((((data & 0x000000f8) >> 3)) << 0)   |
2146                               ((((data & 0x0000f800) >> 11)) << 5)  |
2147                           ((((data & 0x00f80000) >> 19)) << 10);
2148               // alpha?
2149
2150               memory_write_word(space,realwriteoffs+xcnt*2, newdat);
2151            }
2152         }
2153      }
2154      break;
2155
2156      // used by Suchie3
2157      case 0x04: // 888 RGB 24-bit (HACK! should not downconvert and pvr_drawframebuffer should change accordingly)
2158      {
2159         int xcnt,ycnt;
2160         for (ycnt=0;ycnt<32;ycnt++)
2161         {
2162            UINT32 realwriteoffs = 0x05000000 + writeoffs + (y+ycnt) * (stride<<3) + (x*2);
2163            src = BITMAP_ADDR32(fake_accumulationbuffer_bitmap, y+ycnt, x);
2164
2165
2166            for (xcnt=0;xcnt<32;xcnt++)
2167            {
19832168               // data is 8888 format
19842169               UINT32 data = src[xcnt];
19852170               UINT16 newdat = ((((data & 0x000000f8) >> 3)) << 0)   |
r7882r7883
19922177      }
19932178      break;
19942179
2180      case 0x05:
2181         printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x (0888 KGB 32-bit)\n",x,y,packmode);
2182         break;
2183
19952184      case 0x06: // 8888 ARGB 32 bit (HACK! should not downconvert and pvr_drawframebuffer should change accordingly)
19962185      {
19972186         int xcnt,ycnt;
r7882r7883
20152204      }
20162205      break;
20172206
2018
2019      case 0x00:
2020
2021      case 0x02:
2022      case 0x03:
2023      case 0x04:
2024      case 0x05:
20252207      case 0x07:
2026      default:
2027
2028         printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x\n",x,y,packmode);
2208         printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x (Reserved! Don't Use!)\n",x,y,packmode);
2209         break;
20292210   }
20302211
20312212
r7882r7883
20402221   UINT32 c;
20412222   UINT32 r,g,b;
20422223
2224   UINT32 wc = pvrta_regs[FB_R_CTRL];
2225   UINT8 unpackmode = (wc & 0x0000000c) >>2;  // aka fb_depth
2226   UINT8 enable = (wc & 0x00000001);
2227
2228   // ??
2229   if (!enable) return;
2230
20432231   // only for rgb565 framebuffer
20442232   xi=((pvrta_regs[FB_R_SIZE] & 0x3ff)+1) << 1;
20452233   dy=((pvrta_regs[FB_R_SIZE] >> 10) & 0x3ff)+1;
20462234
2235//  dy++;
20472236   dy*=2; // probably depends on interlace mode, fields etc...
20482237
2049
2050   for (y=0;y < dy;y++)
2238   switch (unpackmode)
20512239   {
2052      addrp=pvrta_regs[FB_R_SOF1]+y*xi*2;
2053      for (x=0;x < xi;x++)
2054      {
2055         fbaddr=BITMAP_ADDR32(bitmap,y,x);
2056         c=*(((UINT16 *)dc_framebuffer_ram) + (WORD2_XOR_LE(addrp) >> 1));
2240      case 0x00: // 0555 RGB 16-bit, Cleo Fortune Plus
2241         // should upsample back to 8-bit output using fb_concat
2242         for (y=0;y < dy;y++)
2243         {
2244            addrp=pvrta_regs[FB_R_SOF1]+y*xi*2;
2245            if(spg_pixel_double)
2246            {
2247               for (x=0;x < xi;x++)
2248               {
2249                  fbaddr=BITMAP_ADDR32(bitmap,y,x*2+0);
2250                  c=*(((UINT16 *)dc_framebuffer_ram) + (WORD2_XOR_LE(addrp) >> 1));
20572251
2058         b = (c & 0x001f) << 3;
2059         g = (c & 0x07e0) >> 3;
2060         r = (c & 0xf800) >> 8;
2252                  b = (c & 0x001f) << 3;
2253                  g = (c & 0x03e0) >> 2;
2254                  r = (c & 0x7c00) >> 7;
20612255
2062         if (y<cliprect->max_y)
2063            *fbaddr = b | (g<<8) | (r<<16);
2064         addrp+=2;
2065      }
2256                  if (y<=cliprect->max_y)
2257                     *fbaddr = b | (g<<8) | (r<<16);
2258
2259                  fbaddr=BITMAP_ADDR32(bitmap,y,x*2+1);
2260                  if (y<=cliprect->max_y)
2261                     *fbaddr = b | (g<<8) | (r<<16);
2262                  addrp+=2;
2263               }
2264            }
2265            else
2266            {
2267               for (x=0;x < xi;x++)
2268               {
2269                  fbaddr=BITMAP_ADDR32(bitmap,y,x);
2270                  c=*(((UINT16 *)dc_framebuffer_ram) + (WORD2_XOR_LE(addrp) >> 1));
2271
2272                  b = (c & 0x001f) << 3;
2273                  g = (c & 0x03e0) >> 2;
2274                  r = (c & 0x7c00) >> 7;
2275
2276                  if (y<=cliprect->max_y)
2277                     *fbaddr = b | (g<<8) | (r<<16);
2278                  addrp+=2;
2279               }
2280            }
2281         }
2282
2283         break;
2284      case 0x01: // 0565 RGB 16-bit
2285         // should upsample back to 8-bit output using fb_concat
2286         for (y=0;y < dy;y++)
2287         {
2288            addrp=pvrta_regs[FB_R_SOF1]+y*xi*2;
2289            if(spg_pixel_double)
2290            {
2291               for (x=0;x < xi;x++)
2292               {
2293                  fbaddr=BITMAP_ADDR32(bitmap,y,x*2+0);
2294                  c=*(((UINT16 *)dc_framebuffer_ram) + (WORD2_XOR_LE(addrp) >> 1));
2295
2296                  b = (c & 0x001f) << 3;
2297                  g = (c & 0x07e0) >> 3;
2298                  r = (c & 0xf800) >> 8;
2299
2300                  if (y<=cliprect->max_y)
2301                     *fbaddr = b | (g<<8) | (r<<16);
2302
2303                  fbaddr=BITMAP_ADDR32(bitmap,y,x*2+1);
2304
2305                  if (y<=cliprect->max_y)
2306                     *fbaddr = b | (g<<8) | (r<<16);
2307
2308                  addrp+=2;
2309               }
2310            }
2311            else
2312            {
2313               for (x=0;x < xi;x++)
2314               {
2315                  fbaddr=BITMAP_ADDR32(bitmap,y,x);
2316                  c=*(((UINT16 *)dc_framebuffer_ram) + (WORD2_XOR_LE(addrp) >> 1));
2317
2318                  b = (c & 0x001f) << 3;
2319                  g = (c & 0x07e0) >> 3;
2320                  r = (c & 0xf800) >> 8;
2321
2322                  if (y<=cliprect->max_y)
2323                     *fbaddr = b | (g<<8) | (r<<16);
2324                  addrp+=2;
2325               }
2326            }
2327         }
2328         break;
2329
2330      case 0x02: ; // 888 RGB 24-bit - suchie3 - HACKED, see pvr_accumulationbuffer_to_framebuffer!
2331         for (y=0;y < dy;y++)
2332         {
2333            addrp=pvrta_regs[FB_R_SOF1]+y*xi*2;
2334            if(spg_pixel_double)
2335            {
2336               for (x=0;x < xi;x++)
2337               {
2338                  fbaddr=BITMAP_ADDR32(bitmap,y,x*2+0);
2339                  c=*(((UINT16 *)dc_framebuffer_ram) + (WORD2_XOR_LE(addrp) >> 1));
2340
2341                  b = (c & 0x001f) << 3;
2342                  g = (c & 0x07e0) >> 3;
2343                  r = (c & 0xf800) >> 8;
2344
2345                  if (y<=cliprect->max_y)
2346                     *fbaddr = b | (g<<8) | (r<<16);
2347
2348                  fbaddr=BITMAP_ADDR32(bitmap,y,x*2+1);
2349
2350                  if (y<=cliprect->max_y)
2351                     *fbaddr = b | (g<<8) | (r<<16);
2352                  addrp+=2;
2353               }
2354            }
2355            else
2356            {
2357               for (x=0;x < xi;x++)
2358               {
2359                  fbaddr=BITMAP_ADDR32(bitmap,y,x);
2360                  c=*(((UINT16 *)dc_framebuffer_ram) + (WORD2_XOR_LE(addrp) >> 1));
2361
2362                  b = (c & 0x001f) << 3;
2363                  g = (c & 0x07e0) >> 3;
2364                  r = (c & 0xf800) >> 8;
2365
2366                  if (y<=cliprect->max_y)
2367                     *fbaddr = b | (g<<8) | (r<<16);
2368                  addrp+=2;
2369               }
2370            }
2371         }
2372         break;
2373
2374      case 0x03:        // 0888 ARGB 32-bit - HACKED, see pvr_accumulationbuffer_to_framebuffer!
2375         for (y=0;y < dy;y++)
2376         {
2377            addrp=pvrta_regs[FB_R_SOF1]+y*xi*2;
2378            if(spg_pixel_double)
2379            {
2380               for (x=0;x < xi;x++)
2381               {
2382                  fbaddr=BITMAP_ADDR32(bitmap,y,x*2+0);
2383                  c=*(((UINT16 *)dc_framebuffer_ram) + (WORD2_XOR_LE(addrp) >> 1));
2384
2385                  b = (c & 0x001f) << 3;
2386                  g = (c & 0x07e0) >> 3;
2387                  r = (c & 0xf800) >> 8;
2388
2389                  if (y<=cliprect->max_y)
2390                     *fbaddr = b | (g<<8) | (r<<16);
2391
2392                  fbaddr=BITMAP_ADDR32(bitmap,y,x*2+1);
2393                  if (y<=cliprect->max_y)
2394                     *fbaddr = b | (g<<8) | (r<<16);
2395
2396                  addrp+=2;
2397               }
2398            }
2399            else
2400            {
2401               for (x=0;x < xi;x++)
2402               {
2403                  fbaddr=BITMAP_ADDR32(bitmap,y,x);
2404                  c=*(((UINT16 *)dc_framebuffer_ram) + (WORD2_XOR_LE(addrp) >> 1));
2405
2406                  b = (c & 0x001f) << 3;
2407                  g = (c & 0x07e0) >> 3;
2408                  r = (c & 0xf800) >> 8;
2409
2410                  if (y<=cliprect->max_y)
2411                     *fbaddr = b | (g<<8) | (r<<16);
2412                  addrp+=2;
2413               }
2414            }
2415         }
2416         break;
20662417   }
20672418}
20682419
r7882r7883
21652516   dc_update_interrupt_status(machine);
21662517
21672518   scanline = 0;
2519   next_y = spg_line_comp_val;
21682520   timer_adjust_oneshot(vbout_timer, attotime_never, 0);
2169   timer_adjust_oneshot(hbin_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 640), 0);
2521   timer_adjust_oneshot(hbin_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, spg_hblank_in_irq-1), 0);
21702522}
21712523
21722524static TIMER_CALLBACK(hbin)
21732525{
2174   dc_sysctrl_regs[SB_ISTNRM] |= IST_HBL_IN; // H Blank-in interrupt
2175   dc_update_interrupt_status(machine);
2526   if(spg_hblank_int_mode & 1)
2527   {
2528      if(scanline == next_y)
2529      {
2530         dc_sysctrl_regs[SB_ISTNRM] |= IST_HBL_IN; // H Blank-in interrupt
2531         dc_update_interrupt_status(machine);
2532         next_y+=spg_line_comp_val;
2533      }
2534   }
2535   else if((scanline == spg_line_comp_val) || (spg_hblank_int_mode & 2))
2536   {
2537      dc_sysctrl_regs[SB_ISTNRM] |= IST_HBL_IN; // H Blank-in interrupt
2538      dc_update_interrupt_status(machine);
2539   }
21762540
21772541//  printf("hbin on scanline %d\n",scanline);
21782542
21792543   scanline++;
21802544
2181   timer_adjust_oneshot(hbin_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 640), 0);
2545   timer_adjust_oneshot(hbin_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, spg_hblank_in_irq-1), 0);
21822546}
21832547
21842548
r7882r7883
22192583   // if the next 2 registers do not have the correct values, the naomi bios will hang
22202584   pvrta_regs[PVRID]=0x17fd11db;
22212585   pvrta_regs[REVISION]=0x11;
2222   pvrta_regs[VO_CONTROL]=0xC;
2223   pvrta_regs[SOFTRESET]=0x7;
2586   /* FIXME: move the following regs inside MACHINE_RESET */
2587   pvrta_regs[VO_CONTROL]=      0x00000108;
2588   pvrta_regs[SOFTRESET]=      0x00000007;
2589   pvrta_regs[VO_STARTX]=      0x0000009d;
2590   pvrta_regs[VO_STARTY]=      0x00150015;
2591   pvrta_regs[SPG_HBLANK]=      0x007e0345;
2592   pvrta_regs[SPG_LOAD]=      0x01060359;
2593   pvrta_regs[SPG_VBLANK]=      0x01500104;
2594   pvrta_regs[SPG_HBLANK_INT]=   0x031d0000;
2595   pvrta_regs[SPG_VBLANK_INT]=   0x01500104;
2596
22242597   state_ta.tafifo_pos=0;
22252598   state_ta.tafifo_mask=7;
22262599   state_ta.tafifo_vertexwords=8;
r7882r7883
22372610   hbin_timer = timer_alloc(machine, hbin, 0);
22382611   timer_adjust_oneshot(hbin_timer, attotime_never, 0);
22392612   scanline = 0;
2613   next_y = 0;
22402614
22412615   endofrender_timer_isp = timer_alloc(machine, endofrender_isp, 0);
22422616   endofrender_timer_tsp = timer_alloc(machine, endofrender_tsp, 0);
r7882r7883
22872661   }
22882662#endif
22892663
2290   pvr_drawframebuffer(bitmap,cliprect);
2664   bitmap_fill(bitmap,cliprect,MAKE_ARGB(0xff,vo_border_R,vo_border_G,vo_border_B)); //FIXME: Chroma bit?
22912665
2666   if(!spg_blank_video)
2667      pvr_drawframebuffer(bitmap,cliprect);
2668
22922669   // update this here so we only do string lookup once per frame
22932670   debug_dip_status = input_port_read(screen->machine, "MAMEDEBUG");
22942671
src/mame/video/playmark.c
r7882r7883
22#include "includes/playmark.h"
33
44
5UINT16 *bigtwin_bgvideoram;
6UINT16 *wbeachvl_videoram1,*wbeachvl_videoram2,*wbeachvl_videoram3;
7UINT16 *wbeachvl_rowscroll;
8
9static int bgscrollx,bgscrolly,bg_enable,bg_full_size;
10static int fgscrollx,fg_rowscroll_enable;
11static tilemap_t *tx_tilemap,*fg_tilemap,*bg_tilemap;
12
13static int xoffset = 0;
14static int yoffset = 0;
15static int txt_tile_offset = 0;
16static int pri_masks[3];
17static UINT16 playmark_scroll[7];
18
19
205/***************************************************************************
216
227  Callbacks for the TileMap code
r7882r7883
2510
2611static TILE_GET_INFO( bigtwin_get_tx_tile_info )
2712{
28   UINT16 code = wbeachvl_videoram1[2*tile_index];
29   UINT16 color = wbeachvl_videoram1[2*tile_index+1];
13   playmark_state *state = (playmark_state *)machine->driver_data;
14   UINT16 code = state->videoram1[2 * tile_index];
15   UINT16 color = state->videoram1[2 * tile_index + 1];
3016   SET_TILE_INFO(
3117         2,
3218         code,
r7882r7883
3622
3723static TILE_GET_INFO( bigtwin_get_fg_tile_info )
3824{
39   UINT16 code = wbeachvl_videoram2[2*tile_index];
40   UINT16 color = wbeachvl_videoram2[2*tile_index+1];
25   playmark_state *state = (playmark_state *)machine->driver_data;
26   UINT16 code = state->videoram2[2 * tile_index];
27   UINT16 color = state->videoram2[2 * tile_index + 1];
4128   SET_TILE_INFO(
4229         1,
4330         code,
r7882r7883
4734
4835static TILE_GET_INFO( wbeachvl_get_tx_tile_info )
4936{
50   UINT16 code = wbeachvl_videoram1[2*tile_index];
51   UINT16 color = wbeachvl_videoram1[2*tile_index+1];
37   playmark_state *state = (playmark_state *)machine->driver_data;
38   UINT16 code = state->videoram1[2 * tile_index];
39   UINT16 color = state->videoram1[2 * tile_index + 1];
5240
5341   SET_TILE_INFO(
5442         2,
r7882r7883
5947
6048static TILE_GET_INFO( wbeachvl_get_fg_tile_info )
6149{
62   UINT16 code = wbeachvl_videoram2[2*tile_index];
63   UINT16 color = wbeachvl_videoram2[2*tile_index+1];
50   playmark_state *state = (playmark_state *)machine->driver_data;
51   UINT16 code = state->videoram2[2 * tile_index];
52   UINT16 color = state->videoram2[2 * tile_index + 1];
6453
6554   SET_TILE_INFO(
6655         1,
r7882r7883
7160
7261static TILE_GET_INFO( wbeachvl_get_bg_tile_info )
7362{
74   UINT16 code = wbeachvl_videoram3[2*tile_index];
75   UINT16 color = wbeachvl_videoram3[2*tile_index+1];
63   playmark_state *state = (playmark_state *)machine->driver_data;
64   UINT16 code = state->videoram3[2 * tile_index];
65   UINT16 color = state->videoram3[2 * tile_index + 1];
7666
7767   SET_TILE_INFO(
7868         1,
r7882r7883
8373
8474static TILE_GET_INFO( hrdtimes_get_tx_tile_info )
8575{
86   int code = wbeachvl_videoram1[tile_index] & 0x03ff;
87   int colr = wbeachvl_videoram1[tile_index] & 0xe000;
76   playmark_state *state = (playmark_state *)machine->driver_data;
77   int code = state->videoram1[tile_index] & 0x03ff;
78   int colr = state->videoram1[tile_index] & 0xe000;
8879
89   SET_TILE_INFO(2,code + txt_tile_offset,colr >> 13,0);
80   SET_TILE_INFO(2,code + state->txt_tile_offset, colr >> 13, 0);
9081}
9182
9283static TILE_GET_INFO( hrdtimes_get_fg_tile_info )
9384{
94   int code = wbeachvl_videoram2[tile_index] & 0x1fff;
95   int colr = wbeachvl_videoram2[tile_index] & 0xe000;
85   playmark_state *state = (playmark_state *)machine->driver_data;
86   int code = state->videoram2[tile_index] & 0x1fff;
87   int colr = state->videoram2[tile_index] & 0xe000;
9688
9789   SET_TILE_INFO(1,code + 0x2000,(colr >> 13) + 8,0);
9890}
9991
10092static TILE_GET_INFO( hrdtimes_get_bg_tile_info )
10193{
102   int code = wbeachvl_videoram3[tile_index] & 0x1fff;
103   int colr = wbeachvl_videoram3[tile_index] & 0xe000;
94   playmark_state *state = (playmark_state *)machine->driver_data;
95   int code = state->videoram3[tile_index] & 0x1fff;
96   int colr = state->videoram3[tile_index] & 0xe000;
10497
105   SET_TILE_INFO(1,code,colr >> 13,0);
98   SET_TILE_INFO(1, code, colr >> 13, 0);
10699}
107100
108101/***************************************************************************
r7882r7883
113106
114107VIDEO_START( bigtwin )
115108{
116   tx_tilemap = tilemap_create(machine, bigtwin_get_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
117   fg_tilemap = tilemap_create(machine, bigtwin_get_fg_tile_info,tilemap_scan_rows,     16,16,32,32);
109   playmark_state *state = (playmark_state *)machine->driver_data;
118110
119   tilemap_set_transparent_pen(tx_tilemap,0);
111   state->tx_tilemap = tilemap_create(machine, bigtwin_get_tx_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
112   state->fg_tilemap = tilemap_create(machine, bigtwin_get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
120113
121   pri_masks[0] = 0;
122   pri_masks[1] = 0;
123   pri_masks[2] = 0;
114   tilemap_set_transparent_pen(state->tx_tilemap, 0);
115
116   state->xoffset = 0;
117   state->yoffset = 0;
118   state->txt_tile_offset = 0;
119
120   state->pri_masks[0] = 0;
121   state->pri_masks[1] = 0;
122   state->pri_masks[2] = 0;
124123}
125124
126125
127126VIDEO_START( wbeachvl )
128127{
129   tx_tilemap = tilemap_create(machine, wbeachvl_get_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
130   fg_tilemap = tilemap_create(machine, wbeachvl_get_fg_tile_info,tilemap_scan_rows,16,16,64,32);
131   bg_tilemap = tilemap_create(machine, wbeachvl_get_bg_tile_info,tilemap_scan_rows,     16,16,64,32);
128   playmark_state *state = (playmark_state *)machine->driver_data;
132129
133   tilemap_set_transparent_pen(tx_tilemap,0);
134   tilemap_set_transparent_pen(fg_tilemap,0);
130   state->tx_tilemap = tilemap_create(machine, wbeachvl_get_tx_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
131   state->fg_tilemap = tilemap_create(machine, wbeachvl_get_fg_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
132   state->bg_tilemap = tilemap_create(machine, wbeachvl_get_bg_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
135133
136   pri_masks[0] = 0xfff0;
137   pri_masks[1] = 0xfffc;
138   pri_masks[2] = 0;
134   tilemap_set_transparent_pen(state->tx_tilemap, 0);
135   tilemap_set_transparent_pen(state->fg_tilemap, 0);
136
137   state->xoffset = 0;
138   state->yoffset = 0;
139   state->txt_tile_offset = 0;
140
141   state->pri_masks[0] = 0xfff0;
142   state->pri_masks[1] = 0xfffc;
143   state->pri_masks[2] = 0;
139144}
140145
141146VIDEO_START( excelsr )
142147{
143   tx_tilemap = tilemap_create(machine, bigtwin_get_tx_tile_info,tilemap_scan_rows,16,16,32,32);
144   fg_tilemap = tilemap_create(machine, bigtwin_get_fg_tile_info,tilemap_scan_rows,     16,16,32,32);
148   playmark_state *state = (playmark_state *)machine->driver_data;
145149
146   tilemap_set_transparent_pen(tx_tilemap,0);
150   state->tx_tilemap = tilemap_create(machine, bigtwin_get_tx_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
151   state->fg_tilemap = tilemap_create(machine, bigtwin_get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
147152
148   pri_masks[0] = 0;
149   pri_masks[1] = 0xfffc;
150   pri_masks[2] = 0xfff0;
153   tilemap_set_transparent_pen(state->tx_tilemap, 0);
154
155   state->xoffset = 0;
156   state->yoffset = 0;
157   state->txt_tile_offset = 0;
158
159   state->pri_masks[0] = 0;
160   state->pri_masks[1] = 0xfffc;
161   state->pri_masks[2] = 0xfff0;
151162}
152163
153164VIDEO_START( hotmind )
154165{
155   tx_tilemap = tilemap_create(machine, hrdtimes_get_tx_tile_info,tilemap_scan_rows, 8, 8,64,64);
156   fg_tilemap = tilemap_create(machine, hrdtimes_get_fg_tile_info,tilemap_scan_rows,16,16,32,32);
157   bg_tilemap = tilemap_create(machine, hrdtimes_get_bg_tile_info,tilemap_scan_rows,     16,16,32,32);
166   playmark_state *state = (playmark_state *)machine->driver_data;
158167
159   tilemap_set_transparent_pen(tx_tilemap,0);
160   tilemap_set_transparent_pen(fg_tilemap,0);
168   state->tx_tilemap = tilemap_create(machine, hrdtimes_get_tx_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
169   state->fg_tilemap = tilemap_create(machine, hrdtimes_get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
170   state->bg_tilemap = tilemap_create(machine, hrdtimes_get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
161171
162   tilemap_set_scrolldx(tx_tilemap, -14, -14);
163   tilemap_set_scrolldx(fg_tilemap, -14, -14);
164   tilemap_set_scrolldx(bg_tilemap, -14, -14);
172   tilemap_set_transparent_pen(state->tx_tilemap, 0);
173   tilemap_set_transparent_pen(state->fg_tilemap, 0);
165174
166   xoffset = -9;
167   yoffset = -8;
168   txt_tile_offset = 0x9000;
175   tilemap_set_scrolldx(state->tx_tilemap, -14, -14);
176   tilemap_set_scrolldx(state->fg_tilemap, -14, -14);
177   tilemap_set_scrolldx(state->bg_tilemap, -14, -14);
169178
170   pri_masks[0] = 0xfff0;
171   pri_masks[1] = 0xfffc;
172   pri_masks[2] = 0;
179   state->xoffset = -9;
180   state->yoffset = -8;
181   state->txt_tile_offset = 0x9000;
182
183   state->pri_masks[0] = 0xfff0;
184   state->pri_masks[1] = 0xfffc;
185   state->pri_masks[2] = 0;
173186}
174187
175188VIDEO_START( hrdtimes )
176189{
177   tx_tilemap = tilemap_create(machine, hrdtimes_get_tx_tile_info,tilemap_scan_rows, 8, 8,64,64);
178   fg_tilemap = tilemap_create(machine, hrdtimes_get_fg_tile_info,tilemap_scan_rows,16,16,32,32);
179   bg_tilemap = tilemap_create(machine, hrdtimes_get_bg_tile_info,tilemap_scan_rows,     16,16,32,32);
190   playmark_state *state = (playmark_state *)machine->driver_data;
180191
181   tilemap_set_transparent_pen(tx_tilemap,0);
182   tilemap_set_transparent_pen(fg_tilemap,0);
192   state->tx_tilemap = tilemap_create(machine, hrdtimes_get_tx_tile_info,tilemap_scan_rows, 8, 8, 64, 64);
193   state->fg_tilemap = tilemap_create(machine, hrdtimes_get_fg_tile_info,tilemap_scan_rows, 16, 16, 32, 32);
194   state->bg_tilemap = tilemap_create(machine, hrdtimes_get_bg_tile_info,tilemap_scan_rows, 16, 16, 32, 32);
183195
184   tilemap_set_scrolldx(tx_tilemap, -14, -14);
185   tilemap_set_scrolldx(fg_tilemap, -10, -10);
186   tilemap_set_scrolldx(bg_tilemap, -12, -12);
196   tilemap_set_transparent_pen(state->tx_tilemap, 0);
197   tilemap_set_transparent_pen(state->fg_tilemap, 0);
187198
188   xoffset = -8;
189   yoffset = -8;
190   txt_tile_offset = 0xfc00;
199   tilemap_set_scrolldx(state->tx_tilemap, -14, -14);
200   tilemap_set_scrolldx(state->fg_tilemap, -10, -10);
201   tilemap_set_scrolldx(state->bg_tilemap, -12, -12);
191202
192   pri_masks[0] = 0xfff0;
193   pri_masks[1] = 0xfffc;
194   pri_masks[2] = 0;
203   state->xoffset = -8;
204   state->yoffset = -8;
205   state->txt_tile_offset = 0xfc00;
206
207   state->pri_masks[0] = 0xfff0;
208   state->pri_masks[1] = 0xfffc;
209   state->pri_masks[2] = 0;
195210}
196211
197212/***************************************************************************
r7882r7883
202217
203218WRITE16_HANDLER( wbeachvl_txvideoram_w )
204219{
205   COMBINE_DATA(&wbeachvl_videoram1[offset]);
206   tilemap_mark_tile_dirty(tx_tilemap,offset / 2);
220   playmark_state *state = (playmark_state *)space->machine->driver_data;
221
222   COMBINE_DATA(&state->videoram1[offset]);
223   tilemap_mark_tile_dirty(state->tx_tilemap, offset / 2);
207224}
208225
209226WRITE16_HANDLER( wbeachvl_fgvideoram_w )
210227{
211   COMBINE_DATA(&wbeachvl_videoram2[offset]);
212   tilemap_mark_tile_dirty(fg_tilemap,offset / 2);
228   playmark_state *state = (playmark_state *)space->machine->driver_data;
229
230   COMBINE_DATA(&state->videoram2[offset]);
231   tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
213232}
214233
215234WRITE16_HANDLER( wbeachvl_bgvideoram_w )
216235{
217   COMBINE_DATA(&wbeachvl_videoram3[offset]);
218   tilemap_mark_tile_dirty(bg_tilemap,offset / 2);
236   playmark_state *state = (playmark_state *)space->machine->driver_data;
237
238   COMBINE_DATA(&state->videoram3[offset]);
239   tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
219240}
220241
221242WRITE16_HANDLER( hrdtimes_txvideoram_w )
222243{
223   COMBINE_DATA(&wbeachvl_videoram1[offset]);
224   tilemap_mark_tile_dirty(tx_tilemap,offset);
244   playmark_state *state = (playmark_state *)space->machine->driver_data;
245
246   COMBINE_DATA(&state->videoram1[offset]);
247   tilemap_mark_tile_dirty(state->tx_tilemap, offset);
225248}
226249
227250WRITE16_HANDLER( hrdtimes_fgvideoram_w )
228251{
229   COMBINE_DATA(&wbeachvl_videoram2[offset]);
230   tilemap_mark_tile_dirty(fg_tilemap,offset);
252   playmark_state *state = (playmark_state *)space->machine->driver_data;
253
254   COMBINE_DATA(&state->videoram2[offset]);
255   tilemap_mark_tile_dirty(state->fg_tilemap, offset);
231256}
232257
233258WRITE16_HANDLER( hrdtimes_bgvideoram_w )
234259{
235   COMBINE_DATA(&wbeachvl_videoram3[offset]);
236   tilemap_mark_tile_dirty(bg_tilemap,offset);
260   playmark_state *state = (playmark_state *)space->machine->driver_data;
261
262   COMBINE_DATA(&state->videoram3[offset]);
263   tilemap_mark_tile_dirty(state->bg_tilemap, offset);
237264}
238265
239266
240267WRITE16_HANDLER( bigtwin_paletteram_w )
241268{
242   int r,g,b,val;
269   int r, g, b, val;
243270
244271   COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
245272
r7882r7883
252279   g |= ((val & 0x04) >> 2);
253280   b |= ((val & 0x02) >> 1);
254281
255   palette_set_color_rgb(space->machine,offset,pal5bit(r),pal5bit(g),pal5bit(b));
282   palette_set_color_rgb(space->machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
256283}
257284
258285WRITE16_HANDLER( bigtwin_scroll_w )
259286{
260   data = COMBINE_DATA(&playmark_scroll[offset]);
287   playmark_state *state = (playmark_state *)space->machine->driver_data;
261288
289   data = COMBINE_DATA(&state->scroll[offset]);
290
262291   switch (offset)
263292   {
264      case 0: tilemap_set_scrollx(tx_tilemap,0,data+2); break;
265      case 1: tilemap_set_scrolly(tx_tilemap,0,data);   break;
266      case 2: bgscrollx = -(data+4);                    break;
267      case 3: bgscrolly = (-data) & 0x1ff;
268            bg_enable = data & 0x0200;
269            bg_full_size = data & 0x0400;
293      case 0:    tilemap_set_scrollx(state->tx_tilemap, 0, data + 2); break;
294      case 1:    tilemap_set_scrolly(state->tx_tilemap, 0, data);   break;
295      case 2:    state->bgscrollx = -(data + 4);                    break;
296      case 3:    state->bgscrolly = (-data) & 0x1ff;
297            state->bg_enable = data & 0x0200;
298            state->bg_full_size = data & 0x0400;
270299            break;
271      case 4: tilemap_set_scrollx(fg_tilemap,0,data+6); break;
272      case 5: tilemap_set_scrolly(fg_tilemap,0,data);   break;
300      case 4:    tilemap_set_scrollx(state->fg_tilemap, 0, data + 6); break;
301      case 5:    tilemap_set_scrolly(state->fg_tilemap, 0, data);   break;
273302   }
274303}
275304
276305WRITE16_HANDLER( wbeachvl_scroll_w )
277306{
278   data = COMBINE_DATA(&playmark_scroll[offset]);
307   playmark_state *state = (playmark_state *)space->machine->driver_data;
279308
309   data = COMBINE_DATA(&state->scroll[offset]);
310
280311   switch (offset)
281312   {
282      case 0: tilemap_set_scrollx(tx_tilemap,0,data+2); break;
283      case 1: tilemap_set_scrolly(tx_tilemap,0,data);   break;
284      case 2: fgscrollx = data+4;break;
285      case 3: tilemap_set_scrolly(fg_tilemap,0,data & 0x3ff);
286            fg_rowscroll_enable = data & 0x0800;
313      case 0:    tilemap_set_scrollx(state->tx_tilemap, 0, data + 2); break;
314      case 1:    tilemap_set_scrolly(state->tx_tilemap, 0, data);   break;
315      case 2:    state->fgscrollx = data + 4;break;
316      case 3:    tilemap_set_scrolly(state->fg_tilemap, 0, data & 0x3ff);
317            state->fg_rowscroll_enable = data & 0x0800;
287318            break;
288      case 4: tilemap_set_scrollx(bg_tilemap,0,data+6); break;
289      case 5: tilemap_set_scrolly(bg_tilemap,0,data);   break;
319      case 4:    tilemap_set_scrollx(state->bg_tilemap, 0, data + 6); break;
320      case 5:    tilemap_set_scrolly(state->bg_tilemap, 0, data);   break;
290321   }
291322}
292323
293324WRITE16_HANDLER( excelsr_scroll_w )
294325{
295   data = COMBINE_DATA(&playmark_scroll[offset]);
326   playmark_state *state = (playmark_state *)space->machine->driver_data;
296327
328   data = COMBINE_DATA(&state->scroll[offset]);
329
297330   switch (offset)
298331   {
299      case 0:   tilemap_set_scrollx(tx_tilemap,0,data+2); break;
300      case 1: tilemap_set_scrolly(tx_tilemap,0,data);   break;
301      case 2: bgscrollx = -data;                        break;
302      case 3: bgscrolly = (-data+2)& 0x1ff;
303            bg_enable = data & 0x0200;
304            bg_full_size = data & 0x0400;
332      case 0:   tilemap_set_scrollx(state->tx_tilemap, 0, data + 2); break;
333      case 1:    tilemap_set_scrolly(state->tx_tilemap, 0, data);   break;
334      case 2:    state->bgscrollx = -data;   break;
335      case 3:    state->bgscrolly = (-data + 2)& 0x1ff;
336            state->bg_enable = data & 0x0200;
337            state->bg_full_size = data & 0x0400;
305338            break;
306      case 4:   tilemap_set_scrollx(fg_tilemap,0,data+6); break;
307      case 5:   tilemap_set_scrolly(fg_tilemap,0,data);   break;
339      case 4:   tilemap_set_scrollx(state->fg_tilemap, 0, data + 6); break;
340      case 5:   tilemap_set_scrolly(state->fg_tilemap, 0, data);   break;
308341   }
309342}
310343
311344WRITE16_HANDLER( hrdtimes_scroll_w )
312345{
313   data = COMBINE_DATA(&playmark_scroll[offset]);
346   playmark_state *state = (playmark_state *)space->machine->driver_data;
314347
348   data = COMBINE_DATA(&state->scroll[offset]);
349
315350   switch (offset)
316351   {
317      case 0: tilemap_set_scrollx(tx_tilemap,0,data); break;
318      case 1: tilemap_set_scrolly(tx_tilemap,0,data); break;
319      case 2: tilemap_set_scrollx(fg_tilemap,0,data); break;
320      case 3: tilemap_set_scrolly(fg_tilemap,0,data);   break;
321      case 4: tilemap_set_scrollx(bg_tilemap,0,data); break;
322      case 5: tilemap_set_scrolly(bg_tilemap,0,data); break;
352      case 0: tilemap_set_scrollx(state->tx_tilemap, 0, data); break;
353      case 1: tilemap_set_scrolly(state->tx_tilemap, 0, data); break;
354      case 2: tilemap_set_scrollx(state->fg_tilemap, 0, data); break;
355      case 3: tilemap_set_scrolly(state->fg_tilemap, 0, data); break;
356      case 4: tilemap_set_scrollx(state->bg_tilemap, 0, data); break;
357      case 5: tilemap_set_scrolly(state->bg_tilemap, 0, data); break;
323358   }
324359}
325360
r7882r7883
329364
330365***************************************************************************/
331366
332static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int codeshift)
367static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int codeshift )
333368{
334   int offs, start_offset = machine->generic.spriteram_size/2 - 4;
369   playmark_state *state = (playmark_state *)machine->driver_data;
370   int offs, start_offset = state->spriteram_size / 2 - 4;
335371   int height = machine->gfx[0]->height;
336372   int colordiv = machine->gfx[0]->color_granularity / 16;
337   UINT16 *spriteram16 = machine->generic.spriteram.u16;
373   UINT16 *spriteram = state->spriteram;
338374
339375   // find the "end of list" to draw the sprites in reverse order
340   for (offs = 4;offs < machine->generic.spriteram_size/2;offs += 4)
376   for (offs = 4; offs < state->spriteram_size / 2; offs += 4)
341377   {
342      if (spriteram16[offs+3-4] == 0x2000) /* end of list marker */
378      if (spriteram[offs + 3 - 4] == 0x2000) /* end of list marker */
343379      {
344380         start_offset = offs - 4;
345381         break;
346382      }
347383   }
348384
349   for (offs = start_offset;offs >= 4;offs -= 4)
385   for (offs = start_offset; offs >= 4; offs -= 4)
350386   {
351      int sx,sy,code,color,flipx,pri;
387      int sx, sy, code, color, flipx, pri;
352388
353      sy = spriteram16[offs+3-4];   /* -4? what the... ??? */
389      sy = spriteram[offs + 3 - 4];   /* -4? what the... ??? */
354390
355391      flipx = sy & 0x4000;
356      sx = (spriteram16[offs+1] & 0x01ff) - 16-7;
357      sy = (256-8-height - sy) & 0xff;
358      code = spriteram16[offs+2] >> codeshift;
359      color = ((spriteram16[offs+1] & 0x3e00) >> 9) / colordiv;
360      pri = (spriteram16[offs+1] & 0x8000) >> 15;
392      sx = (spriteram[offs + 1] & 0x01ff) - 16 - 7;
393      sy = (256 - 8 - height - sy) & 0xff;
394      code = spriteram[offs + 2] >> codeshift;
395      color = ((spriteram[offs + 1] & 0x3e00) >> 9) / colordiv;
396      pri = (spriteram[offs + 1] & 0x8000) >> 15;
361397
362398      if(!pri && (color & 0x0c) == 0x0c)
363399         pri = 2;
r7882r7883
366402             code,
367403             color,
368404             flipx,0,
369             sx + xoffset,sy + yoffset,
370             machine->priority_bitmap,pri_masks[pri],0);
405             sx + state->xoffset,sy + state->yoffset,
406             machine->priority_bitmap,state->pri_masks[pri],0);
371407   }
372408}
373409
374static void draw_bitmap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
410static void draw_bitmap( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
375411{
376   int x,y,count;
412   playmark_state *state = (playmark_state *)machine->driver_data;
413   int x, y, count;
377414   int color;
378415   UINT8 *pri;
379416
380417   count = 0;
381   for (y=0;y<512;y++)
418   for (y = 0; y < 512; y++)
382419   {
383      for (x=0;x<512;x++)
420      for (x = 0; x < 512; x++)
384421      {
385         color = bigtwin_bgvideoram[count] & 0xff;
422         color = state->bgvideoram[count] & 0xff;
386423
387         if(color)
424         if (color)
388425         {
389            if(bg_full_size)
426            if (state->bg_full_size)
390427            {
391               *BITMAP_ADDR16(bitmap, (y + bgscrolly) & 0x1ff, (x + bgscrollx) & 0x1ff) = 0x100 + color;
428               *BITMAP_ADDR16(bitmap, (y + state->bgscrolly) & 0x1ff, (x + state->bgscrollx) & 0x1ff) = 0x100 + color;
392429
393               pri = BITMAP_ADDR8(machine->priority_bitmap, (y + bgscrolly) & 0x1ff, 0);
394               pri[(x + bgscrollx) & 0x1ff] |= 2;
430               pri = BITMAP_ADDR8(machine->priority_bitmap, (y + state->bgscrolly) & 0x1ff, 0);
431               pri[(x + state->bgscrollx) & 0x1ff] |= 2;
395432            }
396433            else
397434            {
398435               /* 50% size */
399436               if(!(x % 2) && !(y % 2))
400437               {
401                  *BITMAP_ADDR16(bitmap, (y / 2 + bgscrolly) & 0x1ff, (x / 2 + bgscrollx) & 0x1ff) = 0x100 + color;
438                  *BITMAP_ADDR16(bitmap, (y / 2 + state->bgscrolly) & 0x1ff, (x / 2 + state->bgscrollx) & 0x1ff) = 0x100 + color;
402439
403                  pri = BITMAP_ADDR8(machine->priority_bitmap, (y / 2 + bgscrolly) & 0x1ff, 0);
404                  pri[(x / 2 + bgscrollx) & 0x1ff] |= 2;
440                  pri = BITMAP_ADDR8(machine->priority_bitmap, (y / 2 + state->bgscrolly) & 0x1ff, 0);
441                  pri[(x / 2 + state->bgscrollx) & 0x1ff] |= 2;
405442               }
406443            }
407444         }
r7882r7883
413450
414451VIDEO_UPDATE( bigtwin )
415452{
416   bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
453   playmark_state *state = (playmark_state *)screen->machine->driver_data;
417454
418   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
419   if (bg_enable)
455   bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
456
457   tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
458   if (state->bg_enable)
420459      draw_bitmap(screen->machine, bitmap, cliprect);
421   draw_sprites(screen->machine, bitmap,cliprect,4);
422   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
460   draw_sprites(screen->machine, bitmap, cliprect, 4);
461   tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
423462   return 0;
424463}
425464
426465VIDEO_UPDATE( excelsr )
427466{
428   bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
467   playmark_state *state = (playmark_state *)screen->machine->driver_data;
429468
430   tilemap_draw(bitmap,cliprect,fg_tilemap,0,1);
431   if (bg_enable)
469   bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
470
471   tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 1);
472   if (state->bg_enable)
432473      draw_bitmap(screen->machine, bitmap, cliprect);
433   tilemap_draw(bitmap,cliprect,tx_tilemap,0,4);
434   draw_sprites(screen->machine,bitmap,cliprect,2);
474   tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 4);
475   draw_sprites(screen->machine, bitmap, cliprect, 2);
435476   return 0;
436477}
437478
438479VIDEO_UPDATE( wbeachvl )
439480{
440   if (fg_rowscroll_enable)
481   playmark_state *state = (playmark_state *)screen->machine->driver_data;
482
483   if (state->fg_rowscroll_enable)
441484   {
442485      int i;
443486
444      tilemap_set_scroll_rows(fg_tilemap,512);
445      for (i = 0;i < 256;i++)
446         tilemap_set_scrollx(fg_tilemap,i+1,wbeachvl_rowscroll[8*i]);
487      tilemap_set_scroll_rows(state->fg_tilemap, 512);
488      for (i = 0; i < 256; i++)
489         tilemap_set_scrollx(state->fg_tilemap, i + 1, state->rowscroll[8 * i]);
447490   }
448491   else
449492   {
450      tilemap_set_scroll_rows(fg_tilemap,1);
451      tilemap_set_scrollx(fg_tilemap,0,fgscrollx);
493      tilemap_set_scroll_rows(state->fg_tilemap, 1);
494      tilemap_set_scrollx(state->fg_tilemap, 0, state->fgscrollx);
452495   }
453496
454   bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
497   bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
455498
456   tilemap_draw(bitmap,cliprect,bg_tilemap,0,1);
457   tilemap_draw(bitmap,cliprect,fg_tilemap,0,2);
458   draw_sprites(screen->machine,bitmap,cliprect,0);
459   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
499   tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 1);
500   tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 2);
501   draw_sprites(screen->machine, bitmap, cliprect, 0);
502   tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
460503   return 0;
461504}
462505
463506VIDEO_UPDATE( hrdtimes )
464507{
465   bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
508   playmark_state *state = (playmark_state *)screen->machine->driver_data;
466509
510   bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
511
467512   // video enabled
468   if(playmark_scroll[6] & 1)
513   if (state->scroll[6] & 1)
469514   {
470      tilemap_draw(bitmap,cliprect,bg_tilemap,0,1);
471      tilemap_draw(bitmap,cliprect,fg_tilemap,0,2);
472      draw_sprites(screen->machine,bitmap,cliprect,2);
473      tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
515      tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 1);
516      tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 2);
517      draw_sprites(screen->machine, bitmap, cliprect, 2);
518      tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
474519   }
475520   else
476      bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
521      bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
477522   return 0;
478523}
src/mame/video/nemesis.c
r7882r7883
200200   bit4 = BIT(data, 3);
201201   bit5 = BIT(data, 4);
202202   r = MULTIPLIER;
203   r = pow(r/255.0, 2)*255;
204203   bit1 = BIT(data, 5);
205204   bit2 = BIT(data, 6);
206205   bit3 = BIT(data, 7);
207206   bit4 = BIT(data, 8);
208207   bit5 = BIT(data, 9);
209208   g = MULTIPLIER;
210   g = pow(g/255.0, 2)*255;
211209   bit1 = BIT(data, 10);
212210   bit2 = BIT(data, 11);
213211   bit3 = BIT(data, 12);
214212   bit4 = BIT(data, 13);
215213   bit5 = BIT(data, 14);
216214   b = MULTIPLIER;
217   b = pow(b/255.0, 2)*255;
218215
219216   palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
220217}
src/mame/video/lasso.c
r7882r7883
108108   int i;
109109
110110   /* the last palette entries can be changed */
111   for (i = 0; i < 4; i++)
112      colortable_palette_set_color(colortable, 0x3f - i, get_color(state->last_colors[i]));
111   for(i = 0; i < 3; i++)
112      colortable_palette_set_color(colortable, 0x3d + i, get_color(state->last_colors[i]));
113113}
114114
115115
src/mame/video/vsnes.c
r7882r7883
55
66PALETTE_INIT( vsnes )
77{
8   ppu2c0x_init_palette(machine, 0 );
8   ppu2c0x_init_palette_rgb(machine, 0 );
99}
1010
1111PALETTE_INIT( vsdual )
1212{
13   ppu2c0x_init_palette(machine, 0 );
14   ppu2c0x_init_palette(machine, 8*4*16 );
13   ppu2c0x_init_palette_rgb(machine, 0 );
14   ppu2c0x_init_palette_rgb(machine, 8*4*16 );
1515}
1616
1717static void ppu_irq_1( running_device *device, int *ppu_regs )
r7882r7883
3737const ppu2c0x_interface vsnes_ppu_interface_2 =
3838{
3939   1,               /* gfxlayout num */
40   64,               /* color base */
40   512,            /* color base */
4141   PPU_MIRROR_NONE,   /* mirroring */
4242   ppu_irq_2         /* irq */
4343};
src/mame/video/funworld.c
r7882r7883
11/**********************************************************************************
22
3
43  FUNWORLD / TAB.
54  Video Hardware.
65
r7882r7883
3635  * Bottle 10 (italian, set 2),                       C.M.C.,             1996.
3736  * Royal Card (austrian, set 1),                     TAB-Austria,        1991.
3837  * Royal Card (austrian, set 2),                     TAB-Austria,        1991.
38  * Royal Card (austrian/polish, set 3),              TAB-Austria,        1991.
39  * Royal Card (austrian, set 4),                     TAB-Austria,        1991.
40  * Royal Card (austrian, set 5),                     TAB-Austria,        1991.
41  * Royal Card (austrian, set 6),                     TAB-Austria,        1991.
3942  * Royal Card (slovak, encrypted),                   Evona Electronic,   1991.
4043  * Royal Card Professional 2.0,                      Digital Dreams,     1993.
4144  * Lucky Lady (3x3 deal),                            TAB-Austria,        1991.
r7882r7883
5861  * Fun World Quiz (austrian),                        Funworld,           198?.
5962
6063
64***********************************************************************************
65
66  TAB/Impera/FunWorld color system circuitry
67  ------------------------------------------
68
69  74HC174 - Hex D-type flip-flops with reset; positive-edge trigger.
70  N82S147 - 4K-bit TTL Bipolar PROM.
71  74LS374 - 3-STATE Octal D-Type transparent latches and edge-triggered flip-flops.
72
73                   N82S147         74LS374       RESNET        PULL-DOWN
74   74HC174        .-------.       .-------.
75  .-------.   (1)-|01   20|--VCC--|20   02|------[(1K)]---+              .-----.
76  |       |   (1)-|02   06|-------|03   05|------[(470)]--+--+-----------| RED |
77  |16: VCC|   (1)-|03   07|-------|04   06|------[(220)]--+  |           '-----'
78  |       |   (1)-|04   08|-------|07     |                  '--[(100)]--GND
79  |     02|-------|05   09|-------|08   09|------[(1K)]---+              .------.
80  |     05|-------|16   11|-------|13   12|------[(470)]--+--+-----------| BLUE |
81  |     07|-------|17   12|-------|14   15|------[(220)]--+  |           '------'
82  |     10|-------|18   13|-------|17     |                  '--[(100)]--GND
83  |     12|-------|19   14|-------|18   16|------[(470)]--+              .-------.
84  |     13|---+---|15   10|---+---|10   19|------[(220)]--+--+-----------| GREEN |
85  |15 08  |   |   |       |   |   |   01  |                  |           '-------'
86  '-+--+--'   |   '-------'   |   '----+--'                  '--[(100)]--GND
87    |  |      |               |        |
88    |  '------+------GND------'        |
89    '----------------------------------'
90
91  (1): Connected either to:
92       - A custom 40-pin GFX IC
93       - 2x HYxxx devices (TAB blue PCB).
94       - A little board with 4x 74LS138 or 74LS137 (Impera green PCB).
95
96  NOTE: The 74LS374 could be replaced by a 74HCT373.
97
6198***********************************************************************************/
6299
63100
r7882r7883
69106UINT8 *funworld_videoram;
70107
71108
72/***** RESISTORS *****
73
74            74LS373
75           +-------+
76  bit 0 -->|03   02|--> 1  KOhms resistor --> \
77  bit 1 -->|04   05|--> 470 Ohms resistor -->  | 100 Ohms pulldown resistor --> RED
78  bit 2 -->|07   06|--> 220 Ohms resistor --> /
79  bit 3 -->|08   09|--> 1  KOhms resistor --> \
80  bit 4 -->|13   12|--> 470 Ohms resistor -->  | 100 Ohms pulldown resistor --> BLUE
81  bit 5 -->|14   15|--> 220 Ohms resistor --> /
82  bit 6 -->|17   16|--> 470 Ohms resistor --> \  100 Ohms pulldown resistor --> GREEN
83  bit 7 -->|18   19|--> 220 Ohms resistor --> /
84           +-------+
85  (G pulldown is silk labeled 220 Ohms, but a 100 Ohms resistor is there)
86
87*/
88
89109PALETTE_INIT(funworld)
90110{
91111   int i;
src/mame/video/playch10.c
r7882r7883
5454      color_prom++;
5555   }
5656
57   ppu2c0x_init_palette(machine, 256 );
57   ppu2c0x_init_palette_rgb(machine, 256 );
5858}
5959
6060static void ppu_irq( running_device *device, int *ppu_regs )
src/mame/video/ppu2c0x.c
r7882r7883
111111   int                         scan_scale;         /* scan scale */
112112   int                         scanlines_per_frame;   /* number of scanlines per frame */
113113   rgb_t                       palette[64*4];      /* palette for this chip */
114   int                         security_value;      /* 2C05 protection */
114115};
115116
116117/***************************************************************************
r7882r7883
138139{
139140   assert(device != NULL);
140141   assert((device->type == PPU_2C02) || (device->type == PPU_2C03B)
141       || (device->type == PPU_2C04) || (device->type == PPU_2C05)
142       || (device->type == PPU_2C07));
142       || (device->type == PPU_2C04) || (device->type == PPU_2C05_01)
143       || (device->type == PPU_2C05_02) || (device->type == PPU_2C05_03)
144       || (device->type == PPU_2C05_04) || (device->type == PPU_2C07));
143145   return (ppu2c0x_state *) device->token;
144146}
145147
r7882r7883
148150{
149151   assert(device != NULL);
150152   assert((device->type == PPU_2C02) || (device->type == PPU_2C03B)
151       || (device->type == PPU_2C04) || (device->type == PPU_2C05)
152       || (device->type == PPU_2C07));
153       || (device->type == PPU_2C04) || (device->type == PPU_2C05_01)
154       || (device->type == PPU_2C05_02) || (device->type == PPU_2C05_03)
155       || (device->type == PPU_2C05_04) || (device->type == PPU_2C07));
153156   return (const ppu2c0x_interface *) device->baseconfig().static_config;
154157}
155158
r7882r7883
285288   /* color tables are modified at run-time, and are initialized on 'ppu2c0x_reset' */
286289}
287290
291void ppu2c0x_init_palette_rgb( running_machine *machine, int first_entry )
292{
293   int color_emphasis, color_num;
294
295   int R, G, B;
296
297   UINT8 *palette_data = memory_region(machine, "palette");
298
299   /* Loop through the emphasis modes (8 total) */
300   for (color_emphasis = 0; color_emphasis < 8; color_emphasis++)
301   {
302      for (color_num = 0; color_num < 64; color_num++)
303         {
304            R = ((color_emphasis & 1) ? 7 : palette_data[color_num * 3]);
305            G = ((color_emphasis & 2) ? 7 : palette_data[color_num * 3 + 1]);
306            B = ((color_emphasis & 4) ? 7 : palette_data[color_num * 3 + 2]);
307
308            palette_set_color_rgb(machine, first_entry++, pal3bit(R), pal3bit(G), pal3bit(B));
309         }
310   }
311
312   /* color tables are modified at run-time, and are initialized on 'ppu2c0x_reset' */
313}
314
288315/* the charlayout we use for the chargen */
289316static const gfx_layout ppu_charlayout =
290317{
r7882r7883
946973   {
947974      case PPU_STATUS:
948975         // The top 3 bits of the status register are the only ones that report data. The
949         // remainder contain whatever was last in the PPU data latch.
950         ppu2c0x->data_latch = ppu2c0x->regs[PPU_STATUS] | (ppu2c0x->data_latch & 0x1f);
976         // remainder contain whatever was last in the PPU data latch, except on the RC2C05 (protection)
977         if (ppu2c0x->security_value)
978            ppu2c0x->data_latch = (ppu2c0x->regs[PPU_STATUS] & 0xc0) | ppu2c0x->security_value;
979         else
980            ppu2c0x->data_latch = ppu2c0x->regs[PPU_STATUS] | (ppu2c0x->data_latch & 0x1f);
951981
952982         // Reset hi/lo scroll toggle
953983         ppu2c0x->toggle = 0;
r7882r7883
10151045   }
10161046#endif
10171047
1048   /* on the RC2C05, PPU_CONTROL0 and PPU_CONTROL1 are swapped (protection) */
1049   if ((ppu2c0x->security_value) && !(offset & 6))
1050      offset ^= 1;
1051
10181052   switch (offset & 7)
10191053   {
10201054      case PPU_CONTROL0:
r7882r7883
12411275   memset(ppu2c0x, 0, sizeof(*ppu2c0x));
12421276   ppu2c0x->scanlines_per_frame = (int) device->get_config_int(PPU2C0XINFO_INT_SCANLINES_PER_FRAME);
12431277
1278   ppu2c0x->security_value = 0;
1279
1280   if (device->type == PPU_2C05_01)
1281      ppu2c0x->security_value = 0x1b;   // game (jajamaru) doesn't seem to ever actually check it
1282
1283   if (device->type == PPU_2C05_02)
1284      ppu2c0x->security_value = 0x3d;
1285
1286   if (device->type == PPU_2C05_03)
1287      ppu2c0x->security_value = 0x1c;
1288
1289   if (device->type == PPU_2C05_04)
1290      ppu2c0x->security_value = 0x1b;
1291
12441292   /* initialize the scanline handling portion */
12451293   ppu2c0x->scanline_timer = timer_alloc(device->machine, scanline_callback, (void *) device);
12461294   timer_adjust_oneshot(ppu2c0x->scanline_timer, video_screen_get_time_until_pos(device->machine->primary_screen, 1, 0), 0);
src/mame/video/ppu2c0x.h
r7882r7883
7272   // are non-rendering and non-vblank.
7373};
7474
75#define PPU_2C02   DEVICE_GET_INFO_NAME(ppu2c02)   // NTSC NES
76#define PPU_2C03B   DEVICE_GET_INFO_NAME(ppu2c03b)   // Playchoice 10
77#define PPU_2C04   DEVICE_GET_INFO_NAME(ppu2c04)   // Vs. Unisystem
78#define PPU_2C05   DEVICE_GET_INFO_NAME(ppu2c05)   // Vs. Unisystem, Famicom Titler
79#define PPU_2C07   DEVICE_GET_INFO_NAME(ppu2c07)   // PAL NES
75#define PPU_2C02   DEVICE_GET_INFO_NAME(ppu2c02)      // NTSC NES, Famicom
76#define PPU_2C03B   DEVICE_GET_INFO_NAME(ppu2c03b)      // Vs. Unisystem, Playchoice 10
77#define PPU_2C04   DEVICE_GET_INFO_NAME(ppu2c04)      // Vs. Unisystem (four versions with different colors)
78/* The PPU_2C05 variants have different protection value, set at DEVICE_START, but otherwise are all the same... */
79#define PPU_2C05_01   DEVICE_GET_INFO_NAME(ppu2c05)   // Vs. Unisystem (Ninja Jajamaru Kun)
80#define PPU_2C05_02   DEVICE_GET_INFO_NAME(ppu2c05)   // Vs. Unisystem (Mighty Bomb Jack)
81#define PPU_2C05_03   DEVICE_GET_INFO_NAME(ppu2c05)   // Vs. Unisystem (Gumshoe)
82#define PPU_2C05_04   DEVICE_GET_INFO_NAME(ppu2c05)   // Vs. Unisystem (Top Gun)
83#define PPU_2C07   DEVICE_GET_INFO_NAME(ppu2c07)      // PAL NES
8084
8185/* callback datatypes */
8286typedef void (*ppu2c0x_scanline_cb)( running_device *device, int scanline, int vblank, int blanked );
r7882r7883
106110
107111/* routines */
108112void ppu2c0x_init_palette(running_machine *machine, int first_entry ) ATTR_NONNULL(1);
113void ppu2c0x_init_palette_rgb(running_machine *machine, int first_entry ) ATTR_NONNULL(1);
109114
110115void ppu2c0x_spriteram_dma(const address_space *space, running_device *device, const UINT8 page ) ATTR_NONNULL(1);
111116void ppu2c0x_render( running_device *device, bitmap_t *bitmap, int flipx, int flipy, int sx, int sy ) ATTR_NONNULL(1);
r7882r7883
140145   MDRV_DEVICE_ADD(_tag, PPU_2C04, 0) \
141146   MDRV_DEVICE_CONFIG(_intrf)
142147
143#define MDRV_PPU2C05_ADD(_tag, _intrf)   \
144   MDRV_DEVICE_ADD(_tag, PPU_2C05, 0) \
148#define MDRV_PPU2C05_01_ADD(_tag, _intrf) \
149   MDRV_DEVICE_ADD(_tag, PPU_2C05_01, 0) \
145150   MDRV_DEVICE_CONFIG(_intrf)
146151
152#define MDRV_PPU2C05_02_ADD(_tag, _intrf) \
153   MDRV_DEVICE_ADD(_tag, PPU_2C05_02, 0) \
154   MDRV_DEVICE_CONFIG(_intrf)
155
156#define MDRV_PPU2C05_03_ADD(_tag, _intrf) \
157   MDRV_DEVICE_ADD(_tag, PPU_2C05_03, 0) \
158   MDRV_DEVICE_CONFIG(_intrf)
159
160#define MDRV_PPU2C05_04_ADD(_tag, _intrf) \
161   MDRV_DEVICE_ADD(_tag, PPU_2C05_04, 0) \
162   MDRV_DEVICE_CONFIG(_intrf)
163
147164#define MDRV_PPU2C07_ADD(_tag, _intrf)   \
148165   MDRV_DEVICE_ADD(_tag, PPU_2C07, 0) \
149166   MDRV_DEVICE_CONFIG(_intrf)
src/mame/layout/sharkpye.lay
r0r7883
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.1" width="1" height="0.4" />
13      </text>
14      <text string="BET">
15         <color red="0.0" green="0.0" blue="0.0" />
16         <bounds x="0" y="0.5" width="1" height="0.4" />
17      </text>
18   </element>
19
20   <element name="hold2" defstate="0">
21      <rect state="1">
22         <color red="1.0" green="0.0" blue="0.0" />
23      </rect>
24      <rect state="0">
25         <color red="0.3" green="0.0" blue="0.0" />
26      </rect>
27      <text string="HOLD 2">
28         <color red="0.0" green="0.0" blue="0.0" />
29         <bounds x="0" y="0.1" width="1" height="0.4" />
30      </text>
31      <text string="TAKE">
32         <color red="0.0" green="0.0" blue="0.0" />
33         <bounds x="0" y="0.5" width="1" height="0.4" />
34      </text>
35   </element>
36
37   <element name="hold3" defstate="0">
38      <rect state="1">
39         <color red="1.0" green="0.0" blue="0.0" />
40      </rect>
41      <rect state="0">
42         <color red="0.3" green="0.0" blue="0.0" />
43      </rect>
44      <text string="HOLD 3">
45         <color red="0.0" green="0.0" blue="0.0" />
46         <bounds x="0" y="0.1" width="1" height="0.4" />
47      </text>
48      <text string="D-UP">
49         <color red="0.0" green="0.0" blue="0.0" />
50         <bounds x="0" y="0.5" width="1" height="0.4" />
51      </text>
52   </element>
53
54   <element name="hold4" defstate="0">
55      <rect state="1">
56         <color red="1.0" green="0.0" blue="0.0" />
57      </rect>
58      <rect state="0">
59         <color red="0.3" green="0.0" blue="0.0" />
60      </rect>
61      <text string="HOLD 4">
62         <color red="0.0" green="0.0" blue="0.0" />
63         <bounds x="0" y="0.1" width="1" height="0.4" />
64      </text>
65      <text string="SMALL">
66         <color red="0.0" green="0.0" blue="0.0" />
67         <bounds x="0" y="0.5" width="1" height="0.4" />
68      </text>
69   </element>
70
71   <element name="hold5" defstate="0">
72      <rect state="1">
73         <color red="1.0" green="0.0" blue="0.0" />
74      </rect>
75      <rect state="0">
76         <color red="0.3" green="0.0" blue="0.0" />
77      </rect>
78      <text string="HOLD 5">
79         <color red="0.0" green="0.0" blue="0.0" />
80         <bounds x="0" y="0.1" width="1" height="0.4" />
81      </text>
82      <text string="BIG">
83         <color red="0.0" green="0.0" blue="0.0" />
84         <bounds x="0" y="0.5" width="1" height="0.4" />
85      </text>
86   </element>
87
88   <element name="start" defstate="0">
89      <rect state="1">
90         <color red="0.0" green="1.0" blue="0.0" />
91      </rect>
92      <rect state="0">
93         <color red="0.0" green="0.3" blue="0.0" />
94      </rect>
95      <text string="START">
96         <color red="0.0" green="0.0" blue="0.0" />
97         <bounds x="0" y="0.2" width="1" height="0.6" />
98      </text>
99   </element>
100
101   <element name="unknown" defstate="0">
102      <rect state="1">
103         <color red="1.0" green="1.0" blue="0.0" />
104      </rect>
105      <rect state="0">
106         <color red="0.2" green="0.2" blue="0.0" />
107      </rect>
108      <text string="?">
109         <color red="0.0" green="0.0" blue="0.0" />
110         <bounds x="0" y="0.2" width="1" height="0.6" />
111      </text>
112   </element>
113
114   <view name="Button Lamps">
115      <screen index="0">
116         <bounds left="0" top="0" right="4" bottom="3" />
117      </screen>
118      <bezel name="lamp0" element="unknown">
119         <bounds x="3.25" y="3.13" width="0.10" height="0.24" />
120      </bezel>
121      <bezel name="lamp1" element="hold3">
122         <bounds x="1.3" y="3.13" width="0.55" height="0.24" />
123      </bezel>
124      <bezel name="lamp2" element="start">
125         <bounds x="3.45" y="3.13" width="0.55" height="0.24" />
126      </bezel>
127      <bezel name="lamp3" element="hold1">
128         <bounds x="0" y="3.13" width="0.55" height="0.24" />
129      </bezel>
130      <bezel name="lamp4" element="unknown">
131         <bounds x="3.25" y="3.13" width="0.10" height="0.24" />
132      </bezel>
133      <bezel name="lamp5" element="hold2">
134         <bounds x="0.65" y="3.13" width="0.55" height="0.24" />
135      </bezel>
136      <bezel name="lamp6" element="unknown">
137         <bounds x="3.25" y="3.13" width="0.10" height="0.24" />
138      </bezel>
139      <bezel name="lamp7" element="hold4">
140         <bounds x="1.95" y="3.13" width="0.55" height="0.24" />
141      </bezel>
142      <bezel name="lamp7" element="hold5">
143         <bounds x="2.6" y="3.13" width="0.55" height="0.24" />
144      </bezel>
145   </view>
146</mamelayout>
src/mame/layout/jollycrd.lay
r7882r7883
7171         <color red="0.0" green="0.0" blue="0.0" />
7272         <bounds x="0" y="0.1" width="1" height="0.4" />
7373      </text>
74      <text string="HALF">
74      <text string="BET/HALF">
7575         <color red="0.0" green="0.0" blue="0.0" />
7676         <bounds x="0" y="0.5" width="1" height="0.4" />
7777      </text>
src/mame/drivers/aladbl.c
r7882r7883
154154   ROM_CONTINUE(            0x300000, 0x040000)
155155ROM_END
156156
157// this should be correct, the areas of the rom that differ to the original
158// after this decode look like intentional changes
159static DRIVER_INIT( mk3ghw )
160{
161   DRIVER_INIT_CALL(megadriv);
162157
163   UINT8 *ROM = memory_region(machine, "maincpu");
164   int x;
165
166   for (x=0x000001;x<0x100001;x+=2)
167   {
168      if (x&0x80000)
169      {
170         ROM[x] = ROM[x]^0xff;
171         ROM[x] = BITSWAP8(ROM[x], 0,3,2,5,4,6,7,1);
172      }
173      else
174      {
175         ROM[x] = ROM[x]^0xff;
176         ROM[x] = BITSWAP8(ROM[x], 4,0,7,1,3,6,2,5);
177      }
178   }
179
180   for (x=0x100001;x<0x400000;x+=2)
181   {
182      if (x&0x80000)
183      {
184         ROM[x] = ROM[x]^0xff;
185         ROM[x] = BITSWAP8(ROM[x], 2,7,5,4,1,0,3,6);
186      }
187      else
188      {
189         ROM[x] = BITSWAP8(ROM[x], 6,1,4,2,7,0,3,5);
190      }
191   }
192
193   // boot vectors don't seem to be valid, so they are patched...
194   ROM[1] = 0x01;
195   ROM[0] = 0x00;
196   ROM[3] = 0x00;
197   ROM[2] = 0x00;
198   ROM[5] = 0x00;
199   ROM[4] = 0x00;
200   ROM[7] = 0x02;
201   ROM[6] = 0x10;
202
203   memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770070, 0x770071, 0, 0, "DSWA");
204   memory_install_read_port(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770072, 0x770073, 0, 0, "DSWB");
205}
206
207
208158static WRITE16_HANDLER( aladbl_w )
209159{
210160    /*
r7882r7883
229179   return 0x0000;
230180}
231181
182
183static READ16_HANDLER( mk3ghw_dsw_r )
184{
185   static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
186   return input_port_read(space->machine, dswname[offset]);
187}
188
189
232190static DRIVER_INIT( aladbl )
233191{
234192   // 220000 = writes to mcu? 330000 = reads?
235193   memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x220000, 0x220001, 0, 0, aladbl_w);
236194   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x330000, 0x330001, 0, 0, aladbl_r);
195
237196   DRIVER_INIT_CALL(megadrij);
238197}
239198
240GAME( 1993, aladbl ,  0,   megadriv,    aladbl,       aladbl,  ROT0,   "bootleg / Sega", "Aladdin (bootleg of Japanese Megadrive version)", 0)
241GAME( 1996, mk3ghw ,  0,   megadriv,    mk3ghw,       mk3ghw,  ROT0,   "bootleg / Midway", "Mortal Kombat 3 (bootleg of Megadrive version)", 0)
199// this should be correct, the areas of the rom that differ to the original
200// after this decode look like intentional changes
201static DRIVER_INIT( mk3ghw )
202{
203   int x;
204   UINT8 *rom = memory_region(machine, "maincpu");
205
206   for (x=0x000001;x<0x100001;x+=2)
207   {
208      if (x&0x80000)
209      {
210         rom[x] = rom[x]^0xff;
211         rom[x] = BITSWAP8(rom[x], 0,3,2,5,4,6,7,1);
212      }
213      else
214      {
215         rom[x] = rom[x]^0xff;
216         rom[x] = BITSWAP8(rom[x], 4,0,7,1,3,6,2,5);
217      }
218   }
219
220   for (x=0x100001;x<0x400000;x+=2)
221   {
222      if (x&0x80000)
223      {
224         rom[x] = rom[x]^0xff;
225         rom[x] = BITSWAP8(rom[x], 2,7,5,4,1,0,3,6);
226      }
227      else
228      {
229         rom[x] = BITSWAP8(rom[x], 6,1,4,2,7,0,3,5);
230      }
231   }
232
233   // boot vectors don't seem to be valid, so they are patched...
234   rom[0x01] = 0x01;
235   rom[0x00] = 0x00;
236   rom[0x03] = 0x00;
237   rom[0x02] = 0x00;
238   rom[0x05] = 0x00;
239   rom[0x04] = 0x00;
240   rom[0x07] = 0x02;
241   rom[0x06] = 0x10;
242
243   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770070, 0x770075, 0, 0, mk3ghw_dsw_r );
244
245   DRIVER_INIT_CALL(megadriv);
246}
247
248
249GAME( 1993, aladbl,   0, megadriv, aladbl,   aladbl,   ROT0, "bootleg / Sega", "Aladdin (bootleg of Japanese Megadrive version)", 0)
250GAME( 1996, mk3ghw,   0, megadriv, mk3ghw,   mk3ghw,   ROT0, "bootleg / Midway", "Mortal Kombat 3 (bootleg of Megadrive version)", 0)
src/mame/drivers/pushman.c
r7882r7883
2828#include "cpu/m68000/m68000.h"
2929#include "cpu/z80/z80.h"
3030#include "cpu/m6805/m6805.h"
31#include "includes/pushman.h"
3132#include "sound/2203intf.h"
3233
33VIDEO_UPDATE( pushman );
34WRITE16_HANDLER( pushman_scroll_w );
35WRITE16_HANDLER( pushman_videoram_w );
36VIDEO_START( pushman );
37
38static UINT8 shared_ram[8];
39static UINT16 latch,new_latch=0;
40
41/******************************************************************************/
42
4334static WRITE16_HANDLER( pushman_flipscreen_w )
4435{
4536   if (ACCESSING_BITS_8_15)
r7882r7883
5849
5950static READ16_HANDLER( pushman_68705_r )
6051{
52   pushman_state *state = (pushman_state *)space->machine->driver_data;
53
6154   if (offset == 0)
62      return latch;
55      return state->latch;
6356
64   if (offset == 3 && new_latch) { new_latch = 0; return 0; }
65   if (offset == 3 && !new_latch) return 0xff;
57   if (offset == 3 && state->new_latch)
58   {
59      state->new_latch = 0;
60      return 0;
61   }
62   if (offset == 3 && !state->new_latch)
63      return 0xff;
6664
67   return (shared_ram[2 * offset + 1] << 8) + shared_ram[2 * offset];
65   return (state->shared_ram[2 * offset + 1] << 8) + state->shared_ram[2 * offset];
6866}
6967
7068static WRITE16_HANDLER( pushman_68705_w )
7169{
70   pushman_state *state = (pushman_state *)space->machine->driver_data;
71
7272   if (ACCESSING_BITS_8_15)
73      shared_ram[2 * offset] = data >> 8;
73      state->shared_ram[2 * offset] = data >> 8;
7474   if (ACCESSING_BITS_0_7)
75      shared_ram[2 * offset + 1] = data & 0xff;
75      state->shared_ram[2 * offset + 1] = data & 0xff;
7676
7777   if (offset == 1)
7878   {
79        cputag_set_input_line(space->machine, "mcu", M68705_IRQ_LINE, HOLD_LINE);
79      cpu_set_input_line(state->mcu, M68705_IRQ_LINE, HOLD_LINE);
8080      cpu_spin(space->cpu);
81      new_latch = 0;
81      state->new_latch = 0;
8282   }
8383}
8484
8585/* ElSemi - Bouncing balls protection. */
8686static READ16_HANDLER( bballs_68705_r )
8787{
88   pushman_state *state = (pushman_state *)space->machine->driver_data;
89
8890   if (offset == 0)
89      return latch;
90   if(offset == 3 && new_latch)
91      return state->latch;
92   if (offset == 3 && state->new_latch)
9193   {
92           new_latch = 0;
94      state->new_latch = 0;
9395      return 0;
9496   }
95   if(offset == 3 && !new_latch)
97   if (offset == 3 && !state->new_latch)
9698      return 0xff;
9799
98   return (shared_ram[2 * offset + 1] << 8) + shared_ram[2 * offset];
100   return (state->shared_ram[2 * offset + 1] << 8) + state->shared_ram[2 * offset];
99101}
100102
101103static WRITE16_HANDLER( bballs_68705_w )
102104{
105   pushman_state *state = (pushman_state *)space->machine->driver_data;
106
103107   if (ACCESSING_BITS_8_15)
104      shared_ram[2 * offset] = data >> 8;
108      state->shared_ram[2 * offset] = data >> 8;
105109   if (ACCESSING_BITS_0_7)
106      shared_ram[2 * offset + 1] = data & 0xff;
110      state->shared_ram[2 * offset + 1] = data & 0xff;
107111
108   if(offset == 0)
112   if (offset == 0)
109113   {
110      latch = 0;
111      if(shared_ram[0] <= 0xf)
114      state->latch = 0;
115      if (state->shared_ram[0] <= 0xf)
112116      {
113         latch = shared_ram[0] << 2;
114         if(shared_ram[1])
115            latch |= 2;
116         new_latch = 1;
117         state->latch = state->shared_ram[0] << 2;
118         if (state->shared_ram[1])
119            state->latch |= 2;
120         state->new_latch = 1;
117121      }
118      else if(shared_ram[0])
122      else if (state->shared_ram[0])
119123      {
120         if(shared_ram[1])
121            latch |= 2;
122         new_latch = 1;
124         if (state->shared_ram[1])
125            state->latch |= 2;
126         state->new_latch = 1;
123127      }
124128   }
125129}
r7882r7883
127131
128132static READ8_HANDLER( pushman_68000_r )
129133{
130   return shared_ram[offset];
134   pushman_state *state = (pushman_state *)space->machine->driver_data;
135   return state->shared_ram[offset];
131136}
132137
133138static WRITE8_HANDLER( pushman_68000_w )
134139{
135   if (offset == 2 && (shared_ram[2] & 2) == 0 && data & 2)
140   pushman_state *state = (pushman_state *)space->machine->driver_data;
141
142   if (offset == 2 && (state->shared_ram[2] & 2) == 0 && data & 2)
136143   {
137      latch = (shared_ram[1] << 8) | shared_ram[0];
138      new_latch = 1;
144      state->latch = (state->shared_ram[1] << 8) | state->shared_ram[0];
145      state->new_latch = 1;
139146   }
140   shared_ram[offset] = data;
147   state->shared_ram[offset] = data;
141148}
142149
143static MACHINE_RESET( bballs )
144{
145   latch = 0x400;
146}
147
148150/******************************************************************************/
149151
150152static ADDRESS_MAP_START( pushman_map, ADDRESS_SPACE_PROGRAM, 16 )
151153   AM_RANGE(0x000000, 0x01ffff) AM_ROM
152   AM_RANGE(0x060000, 0x060007) AM_READWRITE(pushman_68705_r,pushman_68705_w)
153   AM_RANGE(0xfe0800, 0xfe17ff) AM_RAM AM_BASE_GENERIC(spriteram)
154   AM_RANGE(0x060000, 0x060007) AM_READWRITE(pushman_68705_r, pushman_68705_w)
155   AM_RANGE(0xfe0800, 0xfe17ff) AM_RAM AM_BASE_MEMBER(pushman_state, spriteram)
154156   AM_RANGE(0xfe4000, 0xfe4001) AM_READ_PORT("INPUTS") AM_WRITE(pushman_flipscreen_w)
155157   AM_RANGE(0xfe4002, 0xfe4003) AM_READ_PORT("SYSTEM") AM_WRITE(pushman_control_w)
156158   AM_RANGE(0xfe4004, 0xfe4005) AM_READ_PORT("DSW")
157159   AM_RANGE(0xfe8000, 0xfe8003) AM_WRITE(pushman_scroll_w)
158160   AM_RANGE(0xfe800e, 0xfe800f) AM_WRITENOP /* ? */
159   AM_RANGE(0xfec000, 0xfec7ff) AM_RAM_WRITE(pushman_videoram_w) AM_BASE_GENERIC(videoram)
161   AM_RANGE(0xfec000, 0xfec7ff) AM_RAM_WRITE(pushman_videoram_w) AM_BASE_MEMBER(pushman_state, videoram)
160162   AM_RANGE(0xff8000, 0xff87ff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE_GENERIC(paletteram)
161163   AM_RANGE(0xffc000, 0xffffff) AM_RAM
162164ADDRESS_MAP_END
163165
164166static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 )
165   AM_RANGE(0x0000, 0x0007) AM_READWRITE(pushman_68000_r,pushman_68000_w)
167   AM_RANGE(0x0000, 0x0007) AM_READWRITE(pushman_68000_r, pushman_68000_w)
166168   AM_RANGE(0x0010, 0x007f) AM_RAM
167169   AM_RANGE(0x0080, 0x0fff) AM_ROM
168170ADDRESS_MAP_END
r7882r7883
182184static ADDRESS_MAP_START( bballs_map, ADDRESS_SPACE_PROGRAM, 16 )
183185   ADDRESS_MAP_GLOBAL_MASK(0xfffff)
184186   AM_RANGE(0x00000, 0x1ffff) AM_ROM
185   AM_RANGE(0x60000, 0x60007) AM_READWRITE(bballs_68705_r,bballs_68705_w)
186   AM_RANGE(0xe0800, 0xe17ff) AM_RAM AM_BASE_GENERIC(spriteram)
187   AM_RANGE(0x60000, 0x60007) AM_READWRITE(bballs_68705_r, bballs_68705_w)
188   AM_RANGE(0xe0800, 0xe17ff) AM_RAM AM_BASE_MEMBER(pushman_state, spriteram)
187189   AM_RANGE(0xe4000, 0xe4001) AM_READ_PORT("INPUTS") AM_WRITE(pushman_flipscreen_w)
188190   AM_RANGE(0xe4002, 0xe4003) AM_READ_PORT("SYSTEM") AM_WRITE(pushman_control_w)
189191   AM_RANGE(0xe4004, 0xe4005) AM_READ_PORT("DSW")
190192   AM_RANGE(0xe8000, 0xe8003) AM_WRITE(pushman_scroll_w)
191193   AM_RANGE(0xe800e, 0xe800f) AM_WRITENOP /* ? */
192   AM_RANGE(0xec000, 0xec7ff) AM_RAM_WRITE(pushman_videoram_w) AM_BASE_GENERIC(videoram)
194   AM_RANGE(0xec000, 0xec7ff) AM_RAM_WRITE(pushman_videoram_w) AM_BASE_MEMBER(pushman_state, videoram)
193195   AM_RANGE(0xf8000, 0xf87ff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE_GENERIC(paletteram)
194196   AM_RANGE(0xfc000, 0xfffff) AM_RAM
195197ADDRESS_MAP_END
r7882r7883
401403
402404static void irqhandler(running_device *device, int irq)
403405{
404   cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
406   pushman_state *state = (pushman_state *)device->machine->driver_data;
407   cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
405408}
406409
407410static const ym2203_interface ym2203_config =
408411{
409412   {
410         AY8910_LEGACY_OUTPUT,
411         AY8910_DEFAULT_LOADS,
412         DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
413      AY8910_LEGACY_OUTPUT,
414      AY8910_DEFAULT_LOADS,
415      DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
413416   },
414417   irqhandler
415418};
416419
417420
421static MACHINE_START( pushman )
422{
423   pushman_state *state = (pushman_state *)machine->driver_data;
424
425   state->maincpu = devtag_get_device(machine, "maincpu");
426   state->audiocpu = devtag_get_device(machine, "audiocpu");
427   state->mcu = devtag_get_device(machine, "mcu");
428
429   state_save_register_global_array(machine, state->control);
430   state_save_register_global_array(machine, state->shared_ram);
431   state_save_register_global(machine, state->latch);
432   state_save_register_global(machine, state->new_latch);
433}
434
435static MACHINE_RESET( pushman )
436{
437   pushman_state *state = (pushman_state *)machine->driver_data;
438
439   state->latch = 0;
440   state->new_latch = 0;
441   state->control[0] = 0;
442   state->control[1] = 0;
443
444   memset(state->shared_ram, 0, ARRAY_LENGTH(state->shared_ram));
445}
446
418447static MACHINE_DRIVER_START( pushman )
419448
449   /* driver data */
450   MDRV_DRIVER_DATA(pushman_state)
451
420452   /* basic machine hardware */
421453   MDRV_CPU_ADD("maincpu", M68000, 8000000)
422454   MDRV_CPU_PROGRAM_MAP(pushman_map)
r7882r7883
432464
433465   MDRV_QUANTUM_TIME(HZ(3600))
434466
467   MDRV_MACHINE_START(pushman)
468   MDRV_MACHINE_RESET(pushman)
469
435470   /* video hardware */
436471   MDRV_SCREEN_ADD("screen", RASTER)
437472   MDRV_SCREEN_REFRESH_RATE(60)
r7882r7883
457492   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
458493MACHINE_DRIVER_END
459494
495static MACHINE_RESET( bballs )
496{
497   pushman_state *state = (pushman_state *)machine->driver_data;
498
499   MACHINE_RESET_CALL(pushman);
500
501   state->latch = 0x400;
502}
503
460504static MACHINE_DRIVER_START( bballs )
461505
506   /* driver data */
507   MDRV_DRIVER_DATA(pushman_state)
508
462509   /* basic machine hardware */
463510   MDRV_CPU_ADD("maincpu", M68000, 8000000)
464511   MDRV_CPU_PROGRAM_MAP(bballs_map)
r7882r7883
470517
471518   MDRV_QUANTUM_TIME(HZ(3600))
472519
520   MDRV_MACHINE_START(pushman)
473521   MDRV_MACHINE_RESET(bballs)
474522
475523   /* video hardware */
r7882r7883
665713   ROM_LOAD( "bb_prom.e9",   0x0000, 0x0100, CRC(ec80ae36) SHA1(397ec8fc1b106c8b8d4bf6798aa429e8768a101a) )   /* priority (not used) N82S129 BPROM */
666714ROM_END
667715
668GAME( 1990, pushman,  0,       pushman, pushman, 0, ROT0, "Comad", "Pushman (Korea, set 1)", 0 )
669GAME( 1990, pushmana, pushman, pushman, pushman, 0, ROT0, "Comad", "Pushman (Korea, set 2)", 0 )
670GAME( 1990, pushmans, pushman, pushman, pushman, 0, ROT0, "Comad (American Sammy license)", "Pushman (American Sammy license)", 0 )
671GAME( 1990, pushmant, pushman, pushman, pushman, 0, ROT0, "Comad (Top Tronic license)", "Pushman (Top Tronic license)", 0 )
672GAME( 1991, bballs,   0,       bballs,  bballs,  0, ROT0, "Comad", "Bouncing Balls", 0 )
716GAME( 1990, pushman,  0,       pushman, pushman, 0, ROT0, "Comad", "Pushman (Korea, set 1)", GAME_SUPPORTS_SAVE )
717GAME( 1990, pushmana, pushman, pushman, pushman, 0, ROT0, "Comad", "Pushman (Korea, set 2)", GAME_SUPPORTS_SAVE )
718GAME( 1990, pushmans, pushman, pushman, pushman, 0, ROT0, "Comad (American Sammy license)", "Pushman (American Sammy license)", GAME_SUPPORTS_SAVE )
719GAME( 1990, pushmant, pushman, pushman, pushman, 0, ROT0, "Comad (Top Tronic license)", "Pushman (Top Tronic license)", GAME_SUPPORTS_SAVE )
720GAME( 1991, bballs,   0,       bballs,  bballs,  0, ROT0, "Comad", "Bouncing Balls", GAME_SUPPORTS_SAVE )
src/mame/drivers/playmark.c
r7882r7883
4747#include "includes/playmark.h"
4848
4949
50static UINT16 playmark_snd_command;
51static UINT16 playmark_snd_flag;
52static UINT8 playmark_oki_control;
53static UINT8 playmark_oki_command;
54
55
5650static WRITE16_HANDLER( coinctrl_w )
5751{
5852   if (ACCESSING_BITS_8_15)
5953   {
60      coin_counter_w(space->machine, 0,data & 0x0100);
61      coin_counter_w(space->machine, 1,data & 0x0200);
54      coin_counter_w(space->machine, 0, data & 0x0100);
55      coin_counter_w(space->machine, 1, data & 0x0200);
6256   }
6357   if (data & 0xfcff)
64      logerror("Writing %04x to unknown coin control bits\n",data);
58      logerror("Writing %04x to unknown coin control bits\n", data);
6559}
6660
6761
r7882r7883
8680
8781static WRITE16_HANDLER( wbeachvl_coin_eeprom_w )
8882{
83   playmark_state *state = (playmark_state *)space->machine->driver_data;
84
8985   if (ACCESSING_BITS_0_7)
9086   {
91      running_device *eeprom = devtag_get_device(space->machine, "eeprom");
92
9387      /* bits 0-3 are coin counters? (only 0 used?) */
94      coin_counter_w(space->machine, 0,data & 0x01);
95      coin_counter_w(space->machine, 1,data & 0x02);
96      coin_counter_w(space->machine, 2,data & 0x04);
97      coin_counter_w(space->machine, 3,data & 0x08);
88      coin_counter_w(space->machine, 0, data & 0x01);
89      coin_counter_w(space->machine, 1, data & 0x02);
90      coin_counter_w(space->machine, 2, data & 0x04);
91      coin_counter_w(space->machine, 3, data & 0x08);
9892
9993      /* bits 5-7 control EEPROM */
100      eeprom_set_cs_line(eeprom, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
101      eeprom_write_bit(eeprom, data & 0x80);
102      eeprom_set_clock_line(eeprom, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
94      eeprom_set_cs_line(state->eeprom, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
95      eeprom_write_bit(state->eeprom, data & 0x80);
96      eeprom_set_clock_line(state->eeprom, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
10397   }
10498}
10599
106100static WRITE16_HANDLER( hotmind_coin_eeprom_w )
107101{
102   playmark_state *state = (playmark_state *)space->machine->driver_data;
103
108104   if (ACCESSING_BITS_0_7)
109105   {
110      running_device *eeprom = devtag_get_device(space->machine, "eeprom");
111106      coin_counter_w(space->machine, 0,data & 0x20);
112107
113      eeprom_set_cs_line(eeprom, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
114      eeprom_write_bit(eeprom, data & 4);
115      eeprom_set_clock_line(eeprom, (data & 2) ? ASSERT_LINE : CLEAR_LINE );
108      eeprom_set_cs_line(state->eeprom, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
109      eeprom_write_bit(state->eeprom, data & 4);
110      eeprom_set_clock_line(state->eeprom, (data & 2) ? ASSERT_LINE : CLEAR_LINE );
116111   }
117112}
118113
119114static WRITE16_HANDLER( hrdtimes_coin_w )
120115{
121   coin_counter_w(space->machine, 0,data & 0x01);
122   coin_counter_w(space->machine, 1,data & 0x02);
116   coin_counter_w(space->machine, 0, data & 0x01);
117   coin_counter_w(space->machine, 1, data & 0x02);
123118}
124119
125120static WRITE16_HANDLER( playmark_snd_command_w )
126121{
127   if (ACCESSING_BITS_0_7) {
128      playmark_snd_command = (data & 0xff);
129      playmark_snd_flag = 1;
122   playmark_state *state = (playmark_state *)space->machine->driver_data;
123
124   if (ACCESSING_BITS_0_7)
125   {
126      state->snd_command = (data & 0xff);
127      state->snd_flag = 1;
130128      cpu_yield(space->cpu);
131129   }
132130}
133131
134132static READ8_HANDLER( playmark_snd_command_r )
135133{
134   playmark_state *state = (playmark_state *)space->machine->driver_data;
136135   int data = 0;
137136
138   if ((playmark_oki_control & 0x38) == 0x30) {
139      data = playmark_snd_command;
140//      logerror("PC$%03x PortB reading %02x from the 68K\n",cpu_get_previouspc(space->cpu),data);
137   if ((state->oki_control & 0x38) == 0x30)
138   {
139      data = state->snd_command;
140      // logerror("PC$%03x PortB reading %02x from the 68K\n", cpu_get_previouspc(space->cpu), data);
141141   }
142   else if ((playmark_oki_control & 0x38) == 0x28) {
143      data = (okim6295_r(devtag_get_device(space->machine, "oki"),0) & 0x0f);
144//      logerror("PC$%03x PortB reading %02x from the OKI status port\n",cpu_get_previouspc(space->cpu),data);
142   else if ((state->oki_control & 0x38) == 0x28)
143   {
144      data = (okim6295_r(state->oki, 0) & 0x0f);
145      // logerror("PC$%03x PortB reading %02x from the OKI status port\n", cpu_get_previouspc(space->cpu), data);
145146   }
146147
147148   return data;
r7882r7883
149150
150151static READ8_HANDLER( playmark_snd_flag_r )
151152{
152   if (playmark_snd_flag) {
153      playmark_snd_flag = 0;
153   playmark_state *state = (playmark_state *)space->machine->driver_data;
154
155   if (state->snd_flag)
156   {
157      state->snd_flag = 0;
154158      return 0x00;
155159   }
156160
r7882r7883
160164
161165static WRITE8_DEVICE_HANDLER( playmark_oki_banking_w )
162166{
163   static int old_bank = 0;
167   playmark_state *state = (playmark_state *)device->machine->driver_data;
164168
165   if(old_bank != (data & 7))
169   if (state->old_oki_bank != (data & 7))
166170   {
167      old_bank = data & 7;
171      state->old_oki_bank = data & 7;
168172
169      if(((old_bank - 1) * 0x40000) < memory_region_length(device->machine, "oki"))
173      if (((state->old_oki_bank - 1) * 0x40000) < memory_region_length(device->machine, "oki"))
170174      {
171         okim6295_set_bank_base(device, 0x40000 * (old_bank - 1));
175         okim6295_set_bank_base(device, 0x40000 * (state->old_oki_bank - 1));
172176      }
173177   }
174178}
175179
176180static WRITE8_HANDLER( playmark_oki_w )
177181{
178   playmark_oki_command = data;
182   playmark_state *state = (playmark_state *)space->machine->driver_data;
183   state->oki_command = data;
179184}
180185
181186static WRITE8_DEVICE_HANDLER( playmark_snd_control_w )
182187{
188   playmark_state *state = (playmark_state *)device->machine->driver_data;
183189//  const address_space *space = cputag_get_address_space(device->machine, "audiocpu", ADDRESS_SPACE_PROGRAM);
184190
185191    /*  This port controls communications to and from the 68K, and the OKI
r7882r7883
195201        1   Not used
196202        0   Not used
197203    */
198   playmark_oki_control = data;
204   state->oki_control = data;
199205
200206   if ((data & 0x38) == 0x18)
201207   {
202//      logerror("PC$%03x Writing %02x to OKI1, PortC=%02x, Code=%02x\n",cpu_get_previouspc(space->cpu),playmark_oki_command,playmark_oki_control,playmark_snd_command);
203      okim6295_w(device, 0, playmark_oki_command);
208      // logerror("PC$%03x Writing %02x to OKI1, PortC=%02x, Code=%02x\n",cpu_get_previouspc(space->cpu),playmark_oki_command,playmark_oki_control,playmark_snd_command);
209      okim6295_w(device, 0, state->oki_command);
204210   }
205211}
206212
r7882r7883
216222static ADDRESS_MAP_START( bigtwin_main_map, ADDRESS_SPACE_PROGRAM, 16 )
217223   AM_RANGE(0x000000, 0x0fffff) AM_ROM
218224   AM_RANGE(0x304000, 0x304001) AM_NOP            /* watchdog? irq ack? */
219   AM_RANGE(0x440000, 0x4403ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
220   AM_RANGE(0x500000, 0x500fff) AM_WRITE(wbeachvl_fgvideoram_w) AM_BASE(&wbeachvl_videoram2)
225   AM_RANGE(0x440000, 0x4403ff) AM_RAM AM_BASE_SIZE_MEMBER(playmark_state, spriteram, spriteram_size)
226   AM_RANGE(0x500000, 0x500fff) AM_WRITE(wbeachvl_fgvideoram_w) AM_BASE_MEMBER(playmark_state, videoram2)
221227   AM_RANGE(0x501000, 0x501fff) AM_WRITENOP   /* unused RAM? */
222   AM_RANGE(0x502000, 0x503fff) AM_WRITE(wbeachvl_txvideoram_w) AM_BASE(&wbeachvl_videoram1)
228   AM_RANGE(0x502000, 0x503fff) AM_WRITE(wbeachvl_txvideoram_w) AM_BASE_MEMBER(playmark_state, videoram1)
223229   AM_RANGE(0x504000, 0x50ffff) AM_WRITENOP   /* unused RAM? */
224230   AM_RANGE(0x510000, 0x51000b) AM_WRITE(bigtwin_scroll_w)
225231   AM_RANGE(0x51000c, 0x51000d) AM_WRITENOP   /* always 3? */
226   AM_RANGE(0x600000, 0x67ffff) AM_RAM AM_BASE(&bigtwin_bgvideoram)
232   AM_RANGE(0x600000, 0x67ffff) AM_RAM AM_BASE_MEMBER(playmark_state, bgvideoram)
227233   AM_RANGE(0x700010, 0x700011) AM_READ_PORT("SYSTEM")
228234   AM_RANGE(0x700012, 0x700013) AM_READ_PORT("P1")
229235   AM_RANGE(0x700014, 0x700015) AM_READ_PORT("P2")
r7882r7883
238244
239245static ADDRESS_MAP_START( wbeachvl_main_map, ADDRESS_SPACE_PROGRAM, 16 )
240246   AM_RANGE(0x000000, 0x07ffff) AM_ROM
241   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
242   AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(wbeachvl_bgvideoram_w) AM_BASE(&wbeachvl_videoram3)
243   AM_RANGE(0x504000, 0x505fff) AM_RAM_WRITE(wbeachvl_fgvideoram_w) AM_BASE(&wbeachvl_videoram2)
244   AM_RANGE(0x508000, 0x509fff) AM_RAM_WRITE(wbeachvl_txvideoram_w) AM_BASE(&wbeachvl_videoram1)
245   AM_RANGE(0x50f000, 0x50ffff) AM_RAM AM_BASE(&wbeachvl_rowscroll)
247   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE_SIZE_MEMBER(playmark_state, spriteram, spriteram_size)
248   AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(wbeachvl_bgvideoram_w) AM_BASE_MEMBER(playmark_state, videoram3)
249   AM_RANGE(0x504000, 0x505fff) AM_RAM_WRITE(wbeachvl_fgvideoram_w) AM_BASE_MEMBER(playmark_state, videoram2)
250   AM_RANGE(0x508000, 0x509fff) AM_RAM_WRITE(wbeachvl_txvideoram_w) AM_BASE_MEMBER(playmark_state, videoram1)
251   AM_RANGE(0x50f000, 0x50ffff) AM_RAM AM_BASE_MEMBER(playmark_state, rowscroll)
246252   AM_RANGE(0x510000, 0x51000b) AM_WRITE(wbeachvl_scroll_w)
247253   AM_RANGE(0x51000c, 0x51000d) AM_WRITENOP   /* 2 and 3 */
248254//  AM_RANGE(0x700000, 0x700001) ?? written on startup
r7882r7883
261267static ADDRESS_MAP_START( excelsr_main_map, ADDRESS_SPACE_PROGRAM, 16 )
262268   AM_RANGE(0x000000, 0x2fffff) AM_ROM
263269   AM_RANGE(0x304000, 0x304001) AM_WRITENOP            /* watchdog? irq ack? */
264   AM_RANGE(0x440000, 0x440cff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
265   AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(wbeachvl_fgvideoram_w) AM_BASE(&wbeachvl_videoram2)
266   AM_RANGE(0x501000, 0x501fff) AM_RAM_WRITE(wbeachvl_txvideoram_w) AM_BASE(&wbeachvl_videoram1)
270   AM_RANGE(0x440000, 0x440cff) AM_RAM AM_BASE_SIZE_MEMBER(playmark_state, spriteram, spriteram_size)
271   AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(wbeachvl_fgvideoram_w) AM_BASE_MEMBER(playmark_state, videoram2)
272   AM_RANGE(0x501000, 0x501fff) AM_RAM_WRITE(wbeachvl_txvideoram_w) AM_BASE_MEMBER(playmark_state, videoram1)
267273   AM_RANGE(0x510000, 0x51000b) AM_WRITE(excelsr_scroll_w)
268274   AM_RANGE(0x51000c, 0x51000d) AM_WRITENOP   /* 2 and 3 */
269   AM_RANGE(0x600000, 0x67ffff) AM_RAM AM_BASE(&bigtwin_bgvideoram)
275   AM_RANGE(0x600000, 0x67ffff) AM_RAM AM_BASE_MEMBER(playmark_state, bgvideoram)
270276   AM_RANGE(0x700010, 0x700011) AM_READ_PORT("SYSTEM")
271277   AM_RANGE(0x700012, 0x700013) AM_READ_PORT("P1")
272278   AM_RANGE(0x700014, 0x700015) AM_READ_PORT("P2")
r7882r7883
280286
281287static ADDRESS_MAP_START( hotmind_main_map, ADDRESS_SPACE_PROGRAM, 16 )
282288   AM_RANGE(0x000000, 0x03ffff) AM_ROM
283   AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(hrdtimes_bgvideoram_w) AM_BASE(&wbeachvl_videoram3)
284   AM_RANGE(0x104000, 0x107fff) AM_RAM_WRITE(hrdtimes_fgvideoram_w) AM_BASE(&wbeachvl_videoram2)
285   AM_RANGE(0x108000, 0x10ffff) AM_RAM_WRITE(hrdtimes_txvideoram_w) AM_BASE(&wbeachvl_videoram1)
289   AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(hrdtimes_bgvideoram_w) AM_BASE_MEMBER(playmark_state, videoram3)
290   AM_RANGE(0x104000, 0x107fff) AM_RAM_WRITE(hrdtimes_fgvideoram_w) AM_BASE_MEMBER(playmark_state, videoram2)
291   AM_RANGE(0x108000, 0x10ffff) AM_RAM_WRITE(hrdtimes_txvideoram_w) AM_BASE_MEMBER(playmark_state, videoram1)
286292   AM_RANGE(0x110000, 0x11000d) AM_WRITE(hrdtimes_scroll_w)
287   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
293   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE_SIZE_MEMBER(playmark_state, spriteram, spriteram_size)
288294   AM_RANGE(0x280000, 0x2807ff) AM_RAM_WRITE(bigtwin_paletteram_w) AM_BASE_GENERIC(paletteram)
289295   AM_RANGE(0x300010, 0x300011) AM_READ_PORT("SYSTEM")
290296   AM_RANGE(0x300012, 0x300013) AM_READ_PORT("P1")
r7882r7883
300306   AM_RANGE(0x000000, 0x07ffff) AM_ROM
301307   AM_RANGE(0x080000, 0x0bffff) AM_RAM
302308   AM_RANGE(0x0c0000, 0x0fffff) AM_ROM AM_REGION("maincpu", 0x0c0000)
303   AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(hrdtimes_bgvideoram_w) AM_BASE(&wbeachvl_videoram3)
304   AM_RANGE(0x104000, 0x107fff) AM_RAM_WRITE(hrdtimes_fgvideoram_w) AM_BASE(&wbeachvl_videoram2)
305   AM_RANGE(0x108000, 0x10ffff) AM_RAM_WRITE(hrdtimes_txvideoram_w) AM_BASE(&wbeachvl_videoram1)
309   AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(hrdtimes_bgvideoram_w) AM_BASE_MEMBER(playmark_state, videoram3)
310   AM_RANGE(0x104000, 0x107fff) AM_RAM_WRITE(hrdtimes_fgvideoram_w) AM_BASE_MEMBER(playmark_state, videoram2)
311   AM_RANGE(0x108000, 0x10ffff) AM_RAM_WRITE(hrdtimes_txvideoram_w) AM_BASE_MEMBER(playmark_state, videoram1)
306312   AM_RANGE(0x110000, 0x11000d) AM_WRITE(hrdtimes_scroll_w)
307   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
313   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE_SIZE_MEMBER(playmark_state, spriteram, spriteram_size)
308314   AM_RANGE(0x280000, 0x2807ff) AM_RAM_WRITE(bigtwin_paletteram_w) AM_BASE_GENERIC(paletteram)
309315   AM_RANGE(0x280800, 0x280fff) AM_RAM // unused
310316   AM_RANGE(0x300010, 0x300011) AM_READ_PORT("SYSTEM")
r7882r7883
894900
895901
896902static GFXDECODE_START( hrdtimes )
897   GFXDECODE_ENTRY( "gfx2", 0, hrdtimes_tilelayout,         0x200, 32 )   /* colors 0x200-0x2ff */
898   GFXDECODE_ENTRY( "gfx1", 0, hrdtimes_tilelayout,         0x000, 16 )   /* colors 0x000-0x0ff */
903   GFXDECODE_ENTRY( "gfx2", 0, hrdtimes_tilelayout, 0x200, 32 )   /* colors 0x200-0x2ff */
904   GFXDECODE_ENTRY( "gfx1", 0, hrdtimes_tilelayout, 0x000, 16 )   /* colors 0x000-0x0ff */
899905   GFXDECODE_ENTRY( "gfx1", 0, hrdtimes_charlayout, 0x100,  8 )   /* colors 0x100-0x17f */
900906GFXDECODE_END
901907
908static MACHINE_START( playmark )
909{
910   playmark_state *state = (playmark_state *)machine->driver_data;
911
912   state->oki = devtag_get_device(machine, "oki");
913   state->eeprom = devtag_get_device(machine, "eeprom");
914
915   state_save_register_global(machine, state->bgscrollx);
916   state_save_register_global(machine, state->bgscrolly);
917   state_save_register_global(machine, state->bg_enable);
918   state_save_register_global(machine, state->bg_full_size);
919   state_save_register_global(machine, state->fgscrollx);
920   state_save_register_global(machine, state->fg_rowscroll_enable);
921   state_save_register_global_array(machine, state->scroll);
922
923   state_save_register_global(machine, state->snd_command);
924   state_save_register_global(machine, state->snd_flag);
925   state_save_register_global(machine, state->oki_control);
926   state_save_register_global(machine, state->oki_command);
927   state_save_register_global(machine, state->old_oki_bank);
928}
929
930static MACHINE_RESET( playmark )
931{
932   playmark_state *state = (playmark_state *)machine->driver_data;
933
934   state->bgscrollx = 0;
935   state->bgscrolly = 0;
936   state->bg_enable = 0;
937   state->bg_full_size = 0;
938   state->fgscrollx = 0;
939   state->fg_rowscroll_enable = 0;
940   memset(state->scroll, 0, ARRAY_LENGTH(state->scroll));
941
942   state->snd_command = 0;
943   state->oki_control = 0;
944   state->oki_command = 0;
945   state->old_oki_bank = 0;
946}
947
902948static MACHINE_DRIVER_START( bigtwin )
903949
950   /* driver data */
951   MDRV_DRIVER_DATA(playmark_state)
952
904953   /* basic machine hardware */
905954   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
906955   MDRV_CPU_PROGRAM_MAP(bigtwin_main_map)
r7882r7883
910959   /* Program and Data Maps are internal to the MCU */
911960   MDRV_CPU_IO_MAP(playmark_sound_io_map)
912961
962   MDRV_MACHINE_START(playmark)
963   MDRV_MACHINE_RESET(playmark)
964
913965   /* video hardware */
914966   MDRV_SCREEN_ADD("screen", RASTER)
915967   MDRV_SCREEN_REFRESH_RATE(58)
r7882r7883
935987
936988static MACHINE_DRIVER_START( wbeachvl )
937989
990   /* driver data */
991   MDRV_DRIVER_DATA(playmark_state)
992
938993   /* basic machine hardware */
939994   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
940995   MDRV_CPU_PROGRAM_MAP(wbeachvl_main_map)
r7882r7883
9471002   MDRV_EEPROM_ADD("eeprom", eeprom_intf)
9481003   MDRV_EEPROM_DEFAULT_VALUE(0)
9491004
1005   MDRV_MACHINE_START(playmark)
1006   MDRV_MACHINE_RESET(playmark)
1007
9501008   /* video hardware */
9511009   MDRV_SCREEN_ADD("screen", RASTER)
9521010   MDRV_SCREEN_REFRESH_RATE(58)
r7882r7883
9711029
9721030static MACHINE_DRIVER_START( excelsr )
9731031
1032   /* driver data */
1033   MDRV_DRIVER_DATA(playmark_state)
1034
9741035   /* basic machine hardware */
9751036   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
9761037   MDRV_CPU_PROGRAM_MAP(excelsr_main_map)
r7882r7883
9801041   /* Program and Data Maps are internal to the MCU */
9811042   MDRV_CPU_IO_MAP(playmark_sound_io_map)
9821043
1044   MDRV_MACHINE_START(playmark)
1045   MDRV_MACHINE_RESET(playmark)
1046
9831047   /* video hardware */
9841048   MDRV_SCREEN_ADD("screen", RASTER)
9851049   MDRV_SCREEN_REFRESH_RATE(58)
r7882r7883
10041068
10051069static MACHINE_DRIVER_START( hotmind )
10061070
1071   /* driver data */
1072   MDRV_DRIVER_DATA(playmark_state)
1073
10071074   /* basic machine hardware */
10081075   MDRV_CPU_ADD("maincpu", M68000, XTAL_24MHz/2)   /* verified on pcb */
10091076   MDRV_CPU_PROGRAM_MAP(hotmind_main_map)
r7882r7883
10161083   MDRV_EEPROM_ADD("eeprom", eeprom_intf)
10171084   MDRV_EEPROM_DEFAULT_VALUE(0)
10181085
1086   MDRV_MACHINE_START(playmark)
1087   MDRV_MACHINE_RESET(playmark)
1088
10191089   /* video hardware */
10201090   MDRV_SCREEN_ADD("screen", RASTER)
10211091   MDRV_SCREEN_REFRESH_RATE(58)
r7882r7883
10401110
10411111static MACHINE_DRIVER_START( hrdtimes )
10421112
1113   /* driver data */
1114   MDRV_DRIVER_DATA(playmark_state)
1115
10431116   /* basic machine hardware */
10441117   MDRV_CPU_ADD("maincpu", M68000, XTAL_24MHz/2)   /* verified on pcb */
10451118   MDRV_CPU_PROGRAM_MAP(hrdtimes_main_map)
r7882r7883
10491122   /* Program and Data Maps are internal to the MCU */
10501123//  MDRV_CPU_IO_MAP(playmark_sound_io_map)
10511124
1125   MDRV_MACHINE_START(playmark)
1126   MDRV_MACHINE_RESET(playmark)
1127
10521128   /* video hardware */
10531129   MDRV_SCREEN_ADD("screen", RASTER)
10541130   MDRV_SCREEN_REFRESH_RATE(58)
r7882r7883
13911467
13921468static DRIVER_INIT( bigtwin )
13931469{
1470   playmark_state *state = (playmark_state *)machine->driver_data;
13941471   UINT8 *playmark_PICROM_HEX = memory_region(machine, "user1");
13951472   UINT16 *playmark_PICROM = (UINT16 *)memory_region(machine, "audiocpu");
1396   INT32   offs, data;
1397   UINT16  src_pos = 0;
1398   UINT16  dst_pos = 0;
1399   UINT8   data_hi, data_lo;
1473   INT32 offs, data;
1474   UINT16 src_pos = 0;
1475   UINT16 dst_pos = 0;
1476   UINT8 data_hi, data_lo;
14001477
1478   state->snd_flag = 0;
14011479
1402   playmark_snd_flag = 0;
1403
14041480   /**** Convert the PIC16C57 ASCII HEX dumps to pure HEX ****/
14051481   do
14061482   {
r7882r7883
14141490         {
14151491            data_hi = playmark_asciitohex((playmark_PICROM_HEX[src_pos + offs + 0]));
14161492            data_lo = playmark_asciitohex((playmark_PICROM_HEX[src_pos + offs + 1]));
1417            if ((data_hi <= 0x0f) && (data_lo <= 0x0f)) {
1418               data =  (data_hi <<  4) | (data_lo << 0);
1493            if ((data_hi <= 0x0f) && (data_lo <= 0x0f))
1494            {
1495               data = (data_hi <<  4) | (data_lo << 0);
14191496               data_hi = playmark_asciitohex((playmark_PICROM_HEX[src_pos + offs + 2]));
14201497               data_lo = playmark_asciitohex((playmark_PICROM_HEX[src_pos + offs + 3]));
14211498
1422               if ((data_hi <= 0x0f) && (data_lo <= 0x0f)) {
1499               if ((data_hi <= 0x0f) && (data_lo <= 0x0f))
1500               {
14231501                  data |= (data_hi << 12) | (data_lo << 8);
14241502                  playmark_PICROM[dst_pos] = data;
14251503                  dst_pos += 1;
r7882r7883
14401518
14411519         data_hi = playmark_asciitohex((playmark_PICROM_HEX[src_pos + 0]));
14421520         data_lo = playmark_asciitohex((playmark_PICROM_HEX[src_pos + 1]));
1443         data = (data_hi <<  4) | (data_lo << 0);
1521         data = (data_hi <<  4) | (data_lo << 0);
14441522         data_hi = playmark_asciitohex((playmark_PICROM_HEX[src_pos + 2]));
14451523         data_lo = playmark_asciitohex((playmark_PICROM_HEX[src_pos + 3]));
14461524         data |= (data_hi << 12) | (data_lo << 8);
r7882r7883
14531531   } while (src_pos < 0x2d4c);      /* 0x2d4c is the size of the HEX rom loaded */
14541532}
14551533
1456GAME( 1995, bigtwin,  0,        bigtwin,  bigtwin,  bigtwin, ROT0, "Playmark", "Big Twin", GAME_NO_COCKTAIL )
1457GAME( 1995, wbeachvl, 0,        wbeachvl, wbeachvl, 0,       ROT0, "Playmark", "World Beach Volley (set 1)", GAME_NO_COCKTAIL | GAME_NO_SOUND )
1458GAME( 1995, wbeachvl2,wbeachvl, wbeachvl, wbeachvl, 0,       ROT0, "Playmark", "World Beach Volley (set 2)",  GAME_NO_COCKTAIL | GAME_NO_SOUND )
1459GAME( 1996, excelsr,  0,        excelsr,  excelsr,  bigtwin, ROT0, "Playmark", "Excelsior", 0 )
1460GAME( 1995, hotmind,  0,        hotmind,  hotmind,  bigtwin, ROT0, "Playmark", "Hot Mind", 0 )
1461GAME( 1994, hrdtimes, 0,        hrdtimes, hrdtimes, 0,       ROT0, "Playmark", "Hard Times (set 1)", GAME_NO_SOUND )
1462GAME( 1994, hrdtimesa,hrdtimes, hrdtimes, hrdtimes, 0,       ROT0, "Playmark", "Hard Times (set 2)", GAME_NO_SOUND )
1534GAME( 1995, bigtwin,   0,        bigtwin,  bigtwin,  bigtwin, ROT0, "Playmark", "Big Twin", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
1535GAME( 1995, wbeachvl,  0,        wbeachvl, wbeachvl, 0,       ROT0, "Playmark", "World Beach Volley (set 1)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
1536GAME( 1995, wbeachvl2, wbeachvl, wbeachvl, wbeachvl, 0,       ROT0, "Playmark", "World Beach Volley (set 2)",  GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
1537GAME( 1996, excelsr,   0,        excelsr,  excelsr,  bigtwin, ROT0, "Playmark", "Excelsior", GAME_SUPPORTS_SAVE )
1538GAME( 1995, hotmind,   0,        hotmind,  hotmind,  bigtwin, ROT0, "Playmark", "Hot Mind", GAME_SUPPORTS_SAVE )
1539GAME( 1994, hrdtimes,  0,        hrdtimes, hrdtimes, 0,       ROT0, "Playmark", "Hard Times (set 1)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
1540GAME( 1994, hrdtimesa, hrdtimes, hrdtimes, hrdtimes, 0,       ROT0, "Playmark", "Hard Times (set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/vicdual.c
r7882r7883
609609INPUT_PORTS_END
610610
611611
612
613
612614static INPUT_PORTS_START( supcrash )
613615   PORT_START("IN0")
614616   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
r7882r7883
15621564   PORT_COIN
15631565INPUT_PORTS_END
15641566
1567/* not verified */
1568static INPUT_PORTS_START( carnivalh )
1569   PORT_START("IN0")
1570   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1571   PORT_DIPSETTING(    0x00, "3" )
1572   PORT_DIPSETTING(    0x01, "4" )
1573   PORT_DIPSETTING(    0x02, "5" )
1574   PORT_DIPSETTING(    0x03, "6" )
1575   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) )
1576   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1577   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1578   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1579   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1580   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
1581   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
1582   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
15651583
1584   PORT_START("IN1")
1585   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_get_64v, NULL)
1586   PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
1587   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(vicdual_read_coin_status, NULL)
1588
1589   PORT_CABINET_COLOR_OR_BW
1590
1591   PORT_COIN
1592INPUT_PORTS_END
1593
1594
15661595static INPUT_PORTS_START( carnvckt )
15671596   PORT_START("IN0")
15681597   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
r7882r7883
19011930
19021931MACHINE_DRIVER_END
19031932
1933static MACHINE_DRIVER_START( carnivalh )
19041934
1935   /* basic machine hardware */
1936   MDRV_IMPORT_FROM(vicdual_dualgame_root)
1937   MDRV_CPU_MODIFY("maincpu")
1938   MDRV_CPU_IO_MAP(headon_io_map)
1939
1940   /* audio hardware */
1941   MDRV_SPEAKER_STANDARD_MONO("mono")
1942   MDRV_IMPORT_FROM(carnival_audio)
1943
1944MACHINE_DRIVER_END
1945
1946
1947
19051948static MACHINE_DRIVER_START( tranqgun )
19061949
19071950   /* basic machine hardware */
r7882r7883
24302473
24312474ROM_START( nsub )
24322475   ROM_REGION( 0x10000, "maincpu", 0 )
2433   ROM_LOAD( "epr268.48",     0x0000, 0x0800, CRC(485b4704) SHA1(d3989cfe5f8d723bc1a6be185614d138666912d2) )
2434   ROM_LOAD( "epr269.47",     0x0800, 0x0800, CRC(32774ac9) SHA1(0a2c209f627a8d703c02e75c361c363272d1f435) )
2435   ROM_LOAD( "epr270.46",     0x1000, 0x0800, CRC(af7ca40a) SHA1(c0f5732079a51979758f3a159084b84be8b2ad3b) )
2436   ROM_LOAD( "epr271.45",     0x1800, 0x0800, CRC(3f9c180b) SHA1(7438454a348b36d1f5ea59f179f715b827244142) )
2437   ROM_LOAD( "epr272.44",     0x2000, 0x0800, CRC(d818aa51) SHA1(1d3ca550f597c4924b9a805fa955a4a8ff557769) )
2438   ROM_LOAD( "epr273.43",     0x2800, 0x0800, CRC(03a6f12a) SHA1(1eefd4607a718c291b29f1b0a6adf0367840b242) )
2439   ROM_LOAD( "epr274.42",     0x3000, 0x0800, CRC(d69eb098) SHA1(fd3e67d18b5891aa65aab5967d49810c5d88dcee) )
2440   ROM_LOAD( "epr275.41",     0x3800, 0x0800, CRC(1c7d90cc) SHA1(8483825d9811c925407328836ae10f98b011c3dd) )
2476   ROM_LOAD( "epr-268.u48", 0x0000, 0x0800, CRC(485b4704) SHA1(d3989cfe5f8d723bc1a6be185614d138666912d2) )
2477   ROM_LOAD( "epr-269.u47", 0x0800, 0x0800, CRC(32774ac9) SHA1(0a2c209f627a8d703c02e75c361c363272d1f435) )
2478   ROM_LOAD( "epr-270.u46", 0x1000, 0x0800, CRC(af7ca40a) SHA1(c0f5732079a51979758f3a159084b84be8b2ad3b) )
2479   ROM_LOAD( "epr-271.u45", 0x1800, 0x0800, CRC(3f9c180b) SHA1(7438454a348b36d1f5ea59f179f715b827244142) )
2480   ROM_LOAD( "epr-272.u44", 0x2000, 0x0800, CRC(d818aa51) SHA1(1d3ca550f597c4924b9a805fa955a4a8ff557769) )
2481   ROM_LOAD( "epr-273.u43", 0x2800, 0x0800, CRC(03a6f12a) SHA1(1eefd4607a718c291b29f1b0a6adf0367840b242) )
2482   ROM_LOAD( "epr-274.u42", 0x3000, 0x0800, CRC(d69eb098) SHA1(fd3e67d18b5891aa65aab5967d49810c5d88dcee) )
2483   ROM_LOAD( "epr-275.u41", 0x3800, 0x0800, CRC(1c7d90cc) SHA1(8483825d9811c925407328836ae10f98b011c3dd) )
24412484
24422485   ROM_REGION( 0x0020, "proms", 0 )
2443   ROM_LOAD( "pr69.11", 0x0000, 0x0020, CRC(c94dd091) SHA1(f88cfb033ff83adb7375652be1fa32ba489d8418) )
2486   ROM_LOAD( "pr-69.u11", 0x0000, 0x0020, CRC(c94dd091) SHA1(f88cfb033ff83adb7375652be1fa32ba489d8418) )
24442487
24452488   ROM_REGION( 0x0040, "user1", 0 )   /* timing PROMs */
24462489   ROM_LOAD( "pr33.u82", 0x0000, 0x0020, CRC(e60a7960) SHA1(b8b8716e859c57c35310efc4594262afedb84823) )   /* control PROM */
r7882r7883
24872530
24882531ROM_START( sspaceat3 )
24892532   ROM_REGION( 0x10000, "maincpu", 0 )
2490   ROM_LOAD( "epr115.u48",   0x0000, 0x0400, CRC(9bc36d80) SHA1(519b3f810b133ac82f066851626b73460956a807) )
2491   ROM_LOAD( "epr116.u47",   0x0400, 0x0400, CRC(2c2750b3) SHA1(eab297678e6ee45d6f723d8ff7e6a29086ad4c78) )
2492   ROM_LOAD( "epr117.u46",   0x0800, 0x0400, CRC(fa7c2cc0) SHA1(26e4f2c8599d16f1c7ec4bfb0a5a3dc709901045) )
2493   ROM_LOAD( "epr118.u45",   0x0c00, 0x0400, CRC(273884ae) SHA1(9efae4acb9ba9bdef0fb58c2a16e0092c6c1a2ba) )
2494   ROM_LOAD( "epr119.u44",   0x1000, 0x0400, CRC(1b53c6de) SHA1(7d8f3f5026e7d1a3b78a54c9c1acbb50a4f02c94) )
2495   ROM_LOAD( "epr120.u43",   0x1400, 0x0400, CRC(60add585) SHA1(01d78d5cbad680b8ad7eb39f53eefad148d48ee2) )
2496   ROM_LOAD( "epr121.u42",   0x1800, 0x0400, CRC(0979f72b) SHA1(244e80552b905df5484bb52100b2e46859fd2cf6) )
2497   ROM_LOAD( "epr122.u41",   0x1c00, 0x0400, CRC(45cb3486) SHA1(0e9d5e8dd43643588989354847483283487b9a75) )
2533   ROM_LOAD( "epr-115.u48",   0x0000, 0x0400, CRC(9bc36d80) SHA1(519b3f810b133ac82f066851626b73460956a807) )
2534   ROM_LOAD( "epr-116.u47",   0x0400, 0x0400, CRC(2c2750b3) SHA1(eab297678e6ee45d6f723d8ff7e6a29086ad4c78) )
2535   ROM_LOAD( "epr-117.u46",   0x0800, 0x0400, CRC(fa7c2cc0) SHA1(26e4f2c8599d16f1c7ec4bfb0a5a3dc709901045) )
2536   ROM_LOAD( "epr-118.u45",   0x0c00, 0x0400, CRC(273884ae) SHA1(9efae4acb9ba9bdef0fb58c2a16e0092c6c1a2ba) )
2537   ROM_LOAD( "epr-119.u44",   0x1000, 0x0400, CRC(1b53c6de) SHA1(7d8f3f5026e7d1a3b78a54c9c1acbb50a4f02c94) )
2538   ROM_LOAD( "epr-120.u43",   0x1400, 0x0400, CRC(60add585) SHA1(01d78d5cbad680b8ad7eb39f53eefad148d48ee2) )
2539   ROM_LOAD( "epr-121.u42",   0x1800, 0x0400, CRC(0979f72b) SHA1(244e80552b905df5484bb52100b2e46859fd2cf6) )
2540   ROM_LOAD( "epr-122.u41",   0x1c00, 0x0400, CRC(45cb3486) SHA1(0e9d5e8dd43643588989354847483283487b9a75) )
24982541
24992542   ROM_REGION( 0x0020, "proms", 0 )
25002543   ROM_LOAD( "316-0138.u44", 0x0000, 0x0020, CRC(67104ea9) SHA1(26b6bd2a1973b83bb9af4e3385d8cb14cb3f62f2) )
r7882r7883
28112854
28122855ROM_START( sspacaho )
28132856   ROM_REGION( 0x10000, "maincpu", 0 )
2814   ROM_LOAD( "epr00001.bin", 0x0000, 0x0800, CRC(ba62f57a) SHA1(7cfc079c6afe317b6c389c06802fdf1f83858510) )
2815   ROM_LOAD( "epr00002.bin", 0x0800, 0x0800, CRC(94b3c59c) SHA1(e6ee1c25fb45d03d514421c231d794f9da05f47f) )
2816   ROM_LOAD( "epr00003.bin", 0x1000, 0x0800, CRC(df13aef2) SHA1(61d210eeb59fe132e14fdd7eb6a39ebc55168097) )
2817   ROM_LOAD( "epr00004.bin", 0x1800, 0x0800, CRC(8431e15e) SHA1(b028e718ee90f37c848e5f83494be61cb90338e2) )
2818   ROM_LOAD( "epr00005.bin", 0x2000, 0x0800, CRC(eec2b6e7) SHA1(4ed830755b4d1da6111afc6c16c7c633521ccb9c) )
2819   ROM_LOAD( "epr00006.bin", 0x2800, 0x0800, CRC(780e47ed) SHA1(533879b8abf0e69644fd8b784dbe9bf10cde6d9f) )
2820   ROM_LOAD( "epr00007.bin", 0x3000, 0x0800, CRC(8189a2fa) SHA1(3c13a394f48adb8f7c6b8203bd0749921461ea06) )
2821   ROM_LOAD( "epr00008.bin", 0x3800, 0x0800, CRC(34a64a80) SHA1(a588fae0ecaa80677887d8c95ef8896a4bdd77ee) )
2857   ROM_LOAD( "epr-0001.bin", 0x0000, 0x0800, CRC(ba62f57a) SHA1(7cfc079c6afe317b6c389c06802fdf1f83858510) )
2858   ROM_LOAD( "epr-0002.bin", 0x0800, 0x0800, CRC(94b3c59c) SHA1(e6ee1c25fb45d03d514421c231d794f9da05f47f) )
2859   ROM_LOAD( "epr-0003.bin", 0x1000, 0x0800, CRC(df13aef2) SHA1(61d210eeb59fe132e14fdd7eb6a39ebc55168097) )
2860   ROM_LOAD( "epr-0004.bin", 0x1800, 0x0800, CRC(8431e15e) SHA1(b028e718ee90f37c848e5f83494be61cb90338e2) )
2861   ROM_LOAD( "epr-0005.bin", 0x2000, 0x0800, CRC(eec2b6e7) SHA1(4ed830755b4d1da6111afc6c16c7c633521ccb9c) )
2862   ROM_LOAD( "epr-0006.bin", 0x2800, 0x0800, CRC(780e47ed) SHA1(533879b8abf0e69644fd8b784dbe9bf10cde6d9f) )
2863   ROM_LOAD( "epr-0007.bin", 0x3000, 0x0800, CRC(8189a2fa) SHA1(3c13a394f48adb8f7c6b8203bd0749921461ea06) )
2864   ROM_LOAD( "epr-0008.bin", 0x3800, 0x0800, CRC(34a64a80) SHA1(a588fae0ecaa80677887d8c95ef8896a4bdd77ee) )
28222865
28232866   ROM_REGION( 0x0020, "proms", 0 )
28242867   ROM_LOAD( "316-0138.u44", 0x0000, 0x0020, CRC(67104ea9) SHA1(26b6bd2a1973b83bb9af4e3385d8cb14cb3f62f2) )
r7882r7883
28292872
28302873ROM_START( samurai )
28312874   ROM_REGION( 0x10000, "maincpu", 0 )
2832   ROM_LOAD( "epr289.u33",   0x0000, 0x0400, CRC(a1a9cb03) SHA1(1875a86ad5938295dd5db6bb045be46eba8638ba) )
2833   ROM_LOAD( "epr290.u32",   0x0400, 0x0400, CRC(49fede51) SHA1(58ab1779d555281ec436ae90dcdf4ada42625892) )
2834   ROM_LOAD( "epr291.u31",   0x0800, 0x0400, CRC(6503dd72) SHA1(e0a3f42418a13f38314ec6e7951cd45c686fecbc) )
2835   ROM_LOAD( "epr292.u30",   0x0c00, 0x0400, CRC(179c224f) SHA1(0a202718a9c2f5f4f1553d1dccd99bebb511363f) )
2836   ROM_LOAD( "epr366.u29",   0x1000, 0x0400, CRC(3df2abec) SHA1(f52182c93026de0f5e7a3c36fe4a35e386c95d0c) )
2837   ROM_LOAD( "epr355.u28",   0x1400, 0x0400, CRC(b24517a4) SHA1(51d613ac21e33c70705f1731b905af72dc561dbf) )
2838   ROM_LOAD( "epr367.u27",   0x1800, 0x0400, CRC(992a6e5a) SHA1(45ae4bf297d7ce52d879d3af5e26960c0dd5034c) )
2839   ROM_LOAD( "epr368.u26",   0x1c00, 0x0400, CRC(403c72ce) SHA1(eaa7a56a28b393db97fd6f1a62b7592cd47060f0) )
2840   ROM_LOAD( "epr369.u8",    0x2000, 0x0400, CRC(3cfd115b) SHA1(58d1d34605b75f0078eb7e61eca8d5897a8b8294) )
2841   ROM_LOAD( "epr370.u7",    0x2400, 0x0400, CRC(2c30db12) SHA1(9dcf8aa5cfdda5b350fc6b70524a15f970d98d91) )
2842   ROM_LOAD( "epr299.u6",    0x2800, 0x0400, CRC(87c71139) SHA1(10c273c2f6a58bba8b5891dfd851e18898b45fd1) )
2843   ROM_LOAD( "epr371.u5",    0x2c00, 0x0400, CRC(761f56cf) SHA1(0d63e8b0ac7bfe9f3cd08cea68eb941b1a5a536c) )
2844   ROM_LOAD( "epr301.u4",    0x3000, 0x0400, CRC(23de1ff7) SHA1(51bf437a62ee770918524c8d0e8b0e007a800021) )
2845   ROM_LOAD( "epr372.u3",    0x3400, 0x0400, CRC(292cfd89) SHA1(a8131f03e8e9f5009508813445bbea559bc27726) )
2875   ROM_LOAD( "epr-289.u33",   0x0000, 0x0400, CRC(a1a9cb03) SHA1(1875a86ad5938295dd5db6bb045be46eba8638ba) )
2876   ROM_LOAD( "epr-290.u32",   0x0400, 0x0400, CRC(49fede51) SHA1(58ab1779d555281ec436ae90dcdf4ada42625892) )
2877   ROM_LOAD( "epr-291.u31",   0x0800, 0x0400, CRC(6503dd72) SHA1(e0a3f42418a13f38314ec6e7951cd45c686fecbc) )
2878   ROM_LOAD( "epr-292.u30",   0x0c00, 0x0400, CRC(179c224f) SHA1(0a202718a9c2f5f4f1553d1dccd99bebb511363f) )
2879   ROM_LOAD( "epr-366.u29",   0x1000, 0x0400, CRC(3df2abec) SHA1(f52182c93026de0f5e7a3c36fe4a35e386c95d0c) )
2880   ROM_LOAD( "epr-355.u28",   0x1400, 0x0400, CRC(b24517a4) SHA1(51d613ac21e33c70705f1731b905af72dc561dbf) )
2881   ROM_LOAD( "epr-367.u27",   0x1800, 0x0400, CRC(992a6e5a) SHA1(45ae4bf297d7ce52d879d3af5e26960c0dd5034c) )
2882   ROM_LOAD( "epr-368.u26",   0x1c00, 0x0400, CRC(403c72ce) SHA1(eaa7a56a28b393db97fd6f1a62b7592cd47060f0) )
2883   ROM_LOAD( "epr-369.u8",    0x2000, 0x0400, CRC(3cfd115b) SHA1(58d1d34605b75f0078eb7e61eca8d5897a8b8294) )
2884   ROM_LOAD( "epr-370.u7",    0x2400, 0x0400, CRC(2c30db12) SHA1(9dcf8aa5cfdda5b350fc6b70524a15f970d98d91) )
2885   ROM_LOAD( "epr-299.u6",    0x2800, 0x0400, CRC(87c71139) SHA1(10c273c2f6a58bba8b5891dfd851e18898b45fd1) )
2886   ROM_LOAD( "epr-371.u5",    0x2c00, 0x0400, CRC(761f56cf) SHA1(0d63e8b0ac7bfe9f3cd08cea68eb941b1a5a536c) )
2887   ROM_LOAD( "epr-301.u4",    0x3000, 0x0400, CRC(23de1ff7) SHA1(51bf437a62ee770918524c8d0e8b0e007a800021) )
2888   ROM_LOAD( "epr-372.u3",    0x3400, 0x0400, CRC(292cfd89) SHA1(a8131f03e8e9f5009508813445bbea559bc27726) )
28462889
28472890   ROM_REGION( 0x0020, "proms", 0 )
28482891   ROM_LOAD( "pr55.clr",     0x0000, 0x0020, CRC(975f5fb0) SHA1(d5917d68ad5549fe5cc997521c3b0a5a279d2231) )
r7882r7883
29773020
29783021ROM_START( carnival )
29793022   ROM_REGION( 0x10000, "maincpu", 0 )
2980   ROM_LOAD( "651u33.cpu",   0x0000, 0x0400, CRC(9f2736e6) SHA1(c3fb9197b5e83dc7d5335de2268e0acb30cf8328) )
2981   ROM_LOAD( "652u32.cpu",   0x0400, 0x0400, CRC(a1f58beb) SHA1(e027beca7bf3ef5ef67e2195f909332fd194b5dc) )
2982   ROM_LOAD( "653u31.cpu",   0x0800, 0x0400, CRC(67b17922) SHA1(46cdfd0371dec61a5440c2111660729c0f0ecdb8) )
2983   ROM_LOAD( "654u30.cpu",   0x0c00, 0x0400, CRC(befb09a5) SHA1(da44b6a869b5eb0705e01fee4478696f6bef9de8) )
2984   ROM_LOAD( "655u29.cpu",   0x1000, 0x0400, CRC(623fcdad) SHA1(35890964f5cf799c141002916641089ccec0fcc9) )
2985   ROM_LOAD( "656u28.cpu",   0x1400, 0x0400, CRC(53040332) SHA1(ff7a06d93cb890abf0616770774668396d128ba3) )
2986   ROM_LOAD( "657u27.cpu",   0x1800, 0x0400, CRC(f2537467) SHA1(262b859098f4f7e5e9bf2f83bda833044824226e) )
2987   ROM_LOAD( "658u26.cpu",   0x1c00, 0x0400, CRC(fcc3854e) SHA1(7adbd6ca6f636dec75fa6eccdf3381686e074bc6) )
2988   ROM_LOAD( "659u8.cpu",    0x2000, 0x0400, CRC(28be8d69) SHA1(2d9ac9a53f00fe2282e4317585e6bddadb676c0f) )
2989   ROM_LOAD( "660u7.cpu",    0x2400, 0x0400, CRC(3873ccdb) SHA1(56be81fdee8947758ba966915c0739e5560a7f94) )
2990   ROM_LOAD( "661u6.cpu",    0x2800, 0x0400, CRC(d9a96dff) SHA1(0366acf3418901bfeeda59d4cd51fe8ceaad4577) )
2991   ROM_LOAD( "662u5.cpu",    0x2c00, 0x0400, CRC(d893ca72) SHA1(564176ab7f3757d51db8eef9fbc4228fa2ce328f) )
2992   ROM_LOAD( "663u4.cpu",    0x3000, 0x0400, CRC(df8c63c5) SHA1(e8d0632b5cb5bd7f698485531f3edeb13efdc685) )
2993   ROM_LOAD( "664u3.cpu",    0x3400, 0x0400, CRC(689a73e8) SHA1(b4134e8d892df7ba3352e4d3f581923decae6e54) )
2994   ROM_LOAD( "665u2.cpu",    0x3800, 0x0400, CRC(28e7b2b6) SHA1(57eb5dd0f11da8ff8001e76036264246d6bc27d2) )
2995   ROM_LOAD( "666u1.cpu",    0x3c00, 0x0400, CRC(4eec7fae) SHA1(cdc858165136c55b01511805c9d4dc6bc598fe1f) )
3023   ROM_LOAD( "epr-651.u33",   0x0000, 0x0400, CRC(9f2736e6) SHA1(c3fb9197b5e83dc7d5335de2268e0acb30cf8328) )
3024   ROM_LOAD( "epr-652.u32",   0x0400, 0x0400, CRC(a1f58beb) SHA1(e027beca7bf3ef5ef67e2195f909332fd194b5dc) )
3025   ROM_LOAD( "epr-653.u31",   0x0800, 0x0400, CRC(67b17922) SHA1(46cdfd0371dec61a5440c2111660729c0f0ecdb8) )
3026   ROM_LOAD( "epr-654.u30",   0x0c00, 0x0400, CRC(befb09a5) SHA1(da44b6a869b5eb0705e01fee4478696f6bef9de8) )
3027   ROM_LOAD( "epr-655.u29",   0x1000, 0x0400, CRC(623fcdad) SHA1(35890964f5cf799c141002916641089ccec0fcc9) )
3028   ROM_LOAD( "epr-656.u28",   0x1400, 0x0400, CRC(53040332) SHA1(ff7a06d93cb890abf0616770774668396d128ba3) )
3029   ROM_LOAD( "epr-657.u27",   0x1800, 0x0400, CRC(f2537467) SHA1(262b859098f4f7e5e9bf2f83bda833044824226e) )
3030   ROM_LOAD( "epr-658.u26",   0x1c00, 0x0400, CRC(fcc3854e) SHA1(7adbd6ca6f636dec75fa6eccdf3381686e074bc6) )
3031   ROM_LOAD( "epr-659.u8",    0x2000, 0x0400, CRC(28be8d69) SHA1(2d9ac9a53f00fe2282e4317585e6bddadb676c0f) )
3032   ROM_LOAD( "epr-660.u7",    0x2400, 0x0400, CRC(3873ccdb) SHA1(56be81fdee8947758ba966915c0739e5560a7f94) )
3033   ROM_LOAD( "epr-661.u6",    0x2800, 0x0400, CRC(d9a96dff) SHA1(0366acf3418901bfeeda59d4cd51fe8ceaad4577) )
3034   ROM_LOAD( "epr-662.u5",    0x2c00, 0x0400, CRC(d893ca72) SHA1(564176ab7f3757d51db8eef9fbc4228fa2ce328f) )
3035   ROM_LOAD( "epr-663.u4",    0x3000, 0x0400, CRC(df8c63c5) SHA1(e8d0632b5cb5bd7f698485531f3edeb13efdc685) )
3036   ROM_LOAD( "epr-664.u3",    0x3400, 0x0400, CRC(689a73e8) SHA1(b4134e8d892df7ba3352e4d3f581923decae6e54) )
3037   ROM_LOAD( "epr-665.u2",    0x3800, 0x0400, CRC(28e7b2b6) SHA1(57eb5dd0f11da8ff8001e76036264246d6bc27d2) )
3038   ROM_LOAD( "epr-666.u1",    0x3c00, 0x0400, CRC(4eec7fae) SHA1(cdc858165136c55b01511805c9d4dc6bc598fe1f) )
29963039
29973040   ROM_REGION( 0x0020, "proms", 0 )
29983041   ROM_LOAD( "316-633",      0x0000, 0x0020, CRC(f0084d80) SHA1(95ec912ac2c64cd58a50c68afc0993746841a531) )
29993042
30003043   ROM_REGION( 0x0800, "audiocpu", 0 )   /* sound ROM */
3001   ROM_LOAD( "crvl.snd",     0x0000, 0x0400, CRC(0dbaa2b0) SHA1(eae7fc362a0ff8f908c42e093c7dbb603659373c) )
3044   ROM_LOAD( "epr-412",     0x0000, 0x0400, CRC(0dbaa2b0) SHA1(eae7fc362a0ff8f908c42e093c7dbb603659373c) )
30023045
30033046   ROM_REGION( 0x0020, "user1", 0 )   /* timing PROM */
30043047   ROM_LOAD( "316-0206.u14", 0x0000, 0x0020, CRC(9617d796) SHA1(7cff2741866095ff42eadd8022bea349ec8d2f39) )   /* control PROM */
r7882r7883
30063049
30073050ROM_START( carnivalc )
30083051   ROM_REGION( 0x10000, "maincpu", 0 )
3009   ROM_LOAD( "epr501",       0x0000, 0x0400, CRC(688503d2) SHA1(a1fe03c23276d458ba74f7473524918eb9b7c7e5) )
3010   ROM_LOAD( "652u32.cpu",   0x0400, 0x0400, CRC(a1f58beb) SHA1(e027beca7bf3ef5ef67e2195f909332fd194b5dc) )
3011   ROM_LOAD( "653u31.cpu",   0x0800, 0x0400, CRC(67b17922) SHA1(46cdfd0371dec61a5440c2111660729c0f0ecdb8) )
3012   ROM_LOAD( "654u30.cpu",   0x0c00, 0x0400, CRC(befb09a5) SHA1(da44b6a869b5eb0705e01fee4478696f6bef9de8) )
3013   ROM_LOAD( "655u29.cpu",   0x1000, 0x0400, CRC(623fcdad) SHA1(35890964f5cf799c141002916641089ccec0fcc9) )
3014   ROM_LOAD( "epr506",       0x1400, 0x0400, CRC(ba916e97) SHA1(87e1ac8bd21bafb815b702048c6be24f410a8998) )
3015   ROM_LOAD( "epr507",       0x1800, 0x0400, CRC(d0bda4a5) SHA1(faf3f3c2a8f962c6c2901e5a4a31b452b506ee22) )
3016   ROM_LOAD( "epr508",       0x1c00, 0x0400, CRC(f0258cad) SHA1(065c90835dadeda7085422295cde09491c94b6e0) )
3017   ROM_LOAD( "epr509",       0x2000, 0x0400, CRC(dcc8a530) SHA1(2d1cac3b40f5afab5423d45ecc3f5565266f9c03) )
3018   ROM_LOAD( "epr510",       0x2400, 0x0400, CRC(92c2ba51) SHA1(c0c0c836d2aa6943bd808acc12161adf23cd0d21) )
3019   ROM_LOAD( "epr511",       0x2800, 0x0400, CRC(3af899a0) SHA1(540cbdc6a912cb325bbea33935bfa06e13f0021a) )
3020   ROM_LOAD( "epr512",       0x2c00, 0x0400, CRC(09f7b3e6) SHA1(18a58680500148e7a031e91230d73b2ce4dc712d) )
3021   ROM_LOAD( "epr513",       0x3000, 0x0400, CRC(8f41974c) SHA1(65e9c2378ad99f804590de36ffba4c60bfa1bfe3) )
3022   ROM_LOAD( "epr514",       0x3400, 0x0400, CRC(2788d140) SHA1(7341c44fb1f7eb8c4d25d3e1e75bcf3bfdb9a89c) )
3023   ROM_LOAD( "epr515",       0x3800, 0x0400, CRC(10decaa9) SHA1(4c980164dde275e1488ae74a7ad61e6acc75e608) )
3024   ROM_LOAD( "epr516",       0x3c00, 0x0400, CRC(7c32b352) SHA1(8cb472a7f71a301417c6a8e4a26a9bdcd43b6062) )
3052   ROM_LOAD( "epr-501.u33", 0x0000, 0x0400, CRC(688503d2) SHA1(a1fe03c23276d458ba74f7473524918eb9b7c7e5) )
3053   ROM_LOAD( "epr-652.u32", 0x0400, 0x0400, CRC(a1f58beb) SHA1(e027beca7bf3ef5ef67e2195f909332fd194b5dc) )
3054   ROM_LOAD( "epr-653.u31", 0x0800, 0x0400, CRC(67b17922) SHA1(46cdfd0371dec61a5440c2111660729c0f0ecdb8) )
3055   ROM_LOAD( "epr-654.u30", 0x0c00, 0x0400, CRC(befb09a5) SHA1(da44b6a869b5eb0705e01fee4478696f6bef9de8) )
3056   ROM_LOAD( "epr-655.u29", 0x1000, 0x0400, CRC(623fcdad) SHA1(35890964f5cf799c141002916641089ccec0fcc9) )
3057   ROM_LOAD( "epr-506.u28", 0x1400, 0x0400, CRC(ba916e97) SHA1(87e1ac8bd21bafb815b702048c6be24f410a8998) )
3058   ROM_LOAD( "epr-507.u27", 0x1800, 0x0400, CRC(d0bda4a5) SHA1(faf3f3c2a8f962c6c2901e5a4a31b452b506ee22) )
3059   ROM_LOAD( "epr-508.u26", 0x1c00, 0x0400, CRC(f0258cad) SHA1(065c90835dadeda7085422295cde09491c94b6e0) )
3060   ROM_LOAD( "epr-509.u8",  0x2000, 0x0400, CRC(dcc8a530) SHA1(2d1cac3b40f5afab5423d45ecc3f5565266f9c03) )
3061   ROM_LOAD( "epr-510.u7",  0x2400, 0x0400, CRC(92c2ba51) SHA1(c0c0c836d2aa6943bd808acc12161adf23cd0d21) )
3062   ROM_LOAD( "epr-511.u6",  0x2800, 0x0400, CRC(3af899a0) SHA1(540cbdc6a912cb325bbea33935bfa06e13f0021a) )
3063   ROM_LOAD( "epr-512.u5",  0x2c00, 0x0400, CRC(09f7b3e6) SHA1(18a58680500148e7a031e91230d73b2ce4dc712d) )
3064   ROM_LOAD( "epr-513.u4",  0x3000, 0x0400, CRC(8f41974c) SHA1(65e9c2378ad99f804590de36ffba4c60bfa1bfe3) )
3065   ROM_LOAD( "epr-514.u3",  0x3400, 0x0400, CRC(2788d140) SHA1(7341c44fb1f7eb8c4d25d3e1e75bcf3bfdb9a89c) )
3066   ROM_LOAD( "epr-515.u2",  0x3800, 0x0400, CRC(10decaa9) SHA1(4c980164dde275e1488ae74a7ad61e6acc75e608) )
3067   ROM_LOAD( "epr-516.u1",  0x3c00, 0x0400, CRC(7c32b352) SHA1(8cb472a7f71a301417c6a8e4a26a9bdcd43b6062) )
30253068
30263069   ROM_REGION( 0x0020, "proms", 0 )
30273070   ROM_LOAD( "316-633",      0x0000, 0x0020, CRC(f0084d80) SHA1(95ec912ac2c64cd58a50c68afc0993746841a531) )
30283071
30293072   ROM_REGION( 0x0800, "audiocpu", 0 )   /* sound ROM */
3030   ROM_LOAD( "crvl.snd",     0x0000, 0x0400, CRC(0dbaa2b0) SHA1(eae7fc362a0ff8f908c42e093c7dbb603659373c) )
3073   ROM_LOAD( "epr-412",     0x0000, 0x0400, CRC(0dbaa2b0) SHA1(eae7fc362a0ff8f908c42e093c7dbb603659373c) )
30313074
30323075   ROM_REGION( 0x0020, "user1", 0 )   /* timing PROM */
30333076   ROM_LOAD( "316-0206.u14", 0x0000, 0x0020, CRC(9617d796) SHA1(7cff2741866095ff42eadd8022bea349ec8d2f39) )   /* control PROM */
30343077ROM_END
30353078
3079ROM_START( carnivalh )
3080   ROM_REGION( 0x10000, "maincpu", 0 )
3081   ROM_LOAD( "epr-155.u48",   0x0000, 0x0800, CRC(0a5f1f65) SHA1(7830157ad378f92a8069debf78d50b9deafb4d40) )
3082   ROM_LOAD( "epr-156.u47",   0x0800, 0x0800, CRC(422221ff) SHA1(57180236dd1cf5838131b35256c3d46cb8015804) )
3083   ROM_LOAD( "epr-157.u46",   0x1000, 0x0800, CRC(1551dffb) SHA1(f91563a14c5febee64b45579acf49518cd54bec3) )
3084   ROM_LOAD( "epr-158.u45",   0x1800, 0x0800, CRC(9238b5c0) SHA1(673f4fedd2e7beef6bc5e6371b2ed7722f3c141c) )
3085   ROM_LOAD( "epr-159.u44",   0x2000, 0x0800, CRC(5c2b9a33) SHA1(2cc57ceebd2938e589c07892b6587b8571678fcc) )
3086   ROM_LOAD( "epr-160.u43",   0x2800, 0x0800, CRC(dd70471f) SHA1(2d987e946873955998c428930592ea7734970b16) )
3087   ROM_LOAD( "epr-161.u42",   0x3000, 0x0800, CRC(42714a0d) SHA1(96f8904912d85b2e7037d129ff2443e90693fe22) )
3088   ROM_LOAD( "epr-162.u41",   0x3800, 0x0800, CRC(56e1c120) SHA1(24816b6a9bc238571ab8ea79bb876cf249ed4d60) )
3089
3090   ROM_REGION( 0x0020, "proms", 0 )
3091   ROM_LOAD( "pr-62.u44",      0x0000, 0x0020, CRC(f0084d80) SHA1(95ec912ac2c64cd58a50c68afc0993746841a531) ) /* Same as 316-633 */
3092
3093   ROM_REGION( 0x0800, "audiocpu", 0 )   /* sound ROM */
3094   ROM_LOAD( "epr-412.u5",     0x0000, 0x0400, CRC(0dbaa2b0) SHA1(eae7fc362a0ff8f908c42e093c7dbb603659373c) )
3095
3096   ROM_REGION( 0x0040, "user1", 0 )   /* misc PROMs (type n82s123) */
3097   ROM_LOAD( "316-043.u65", 0x0000, 0x0020, CRC(e60a7960) SHA1(b8b8716e859c57c35310efc4594262afedb84823) )   /* control PROM */
3098   ROM_LOAD( "316-042.u66", 0x0020, 0x0020, CRC(a1506b9d) SHA1(037c3db2ea40eca459e8acba9d1506dd28d72d10) )   /* sequence PROM */
3099ROM_END
3100
3101ROM_START( carnivalha )
3102   ROM_REGION( 0x10000, "maincpu", 0 )
3103   ROM_LOAD( "epr-155.u48",   0x0000, 0x0800, CRC(0a5f1f65) SHA1(7830157ad378f92a8069debf78d50b9deafb4d40) )
3104   ROM_LOAD( "epr-156.u47",   0x0800, 0x0800, CRC(422221ff) SHA1(57180236dd1cf5838131b35256c3d46cb8015804) )
3105   ROM_LOAD( "epr-157.u46",   0x1000, 0x0800, CRC(1551dffb) SHA1(f91563a14c5febee64b45579acf49518cd54bec3) )
3106   ROM_LOAD( "epr-158.u45",   0x1800, 0x0800, CRC(9238b5c0) SHA1(673f4fedd2e7beef6bc5e6371b2ed7722f3c141c) )
3107   ROM_LOAD( "epr-159.u44",   0x2000, 0x0800, CRC(5c2b9a33) SHA1(2cc57ceebd2938e589c07892b6587b8571678fcc) )
3108   ROM_LOAD( "epr-160.u43",   0x2800, 0x0800, CRC(dd70471f) SHA1(2d987e946873955998c428930592ea7734970b16) )
3109   ROM_LOAD( "epr-161x.u42",  0x3000, 0x0800, CRC(8133ba08) SHA1(fc314e847810140d99ad071667c10a1a57c9f892) ) // rom marked with 161X, probably modified in some way
3110   ROM_LOAD( "epr-162.u41",   0x3800, 0x0800, CRC(56e1c120) SHA1(24816b6a9bc238571ab8ea79bb876cf249ed4d60) )
3111
3112   ROM_REGION( 0x0020, "proms", 0 )
3113   ROM_LOAD( "pr-62.u44",      0x0000, 0x0020, CRC(f0084d80) SHA1(95ec912ac2c64cd58a50c68afc0993746841a531) ) /* Same as 316-633 */
3114
3115   ROM_REGION( 0x0800, "audiocpu", 0 )   /* sound ROM */
3116   ROM_LOAD( "epr-412.u5",     0x0000, 0x0400, CRC(0dbaa2b0) SHA1(eae7fc362a0ff8f908c42e093c7dbb603659373c) )
3117
3118   ROM_REGION( 0x0040, "user1", 0 )   /* misc PROMs (type n82s123) */
3119   ROM_LOAD( "316-043.u65", 0x0000, 0x0020, CRC(e60a7960) SHA1(b8b8716e859c57c35310efc4594262afedb84823) )   /* control PROM */
3120   ROM_LOAD( "316-042.u66", 0x0020, 0x0020, CRC(a1506b9d) SHA1(037c3db2ea40eca459e8acba9d1506dd28d72d10) )   /* sequence PROM */
3121ROM_END
3122
30363123ROM_START( brdrline )
30373124   ROM_REGION( 0x10000, "maincpu", 0 )
30383125   ROM_LOAD( "b1.bin",       0x0000, 0x0400, CRC(df182769) SHA1(2b1b70c6282b32e0a4ed80ab4e6b20f90630e910) )
r7882r7883
32893376GAME( 1980, spacetrkc,spacetrk, spacetrk, sptrekct, 0, ROT270, "Sega", "Space Trek (cocktail)", GAME_NO_SOUND )
32903377GAME( 1980, carnival, 0,        carnival, carnival, 0, ROT270, "Sega", "Carnival (upright)", GAME_IMPERFECT_SOUND )
32913378GAME( 1980, carnivalc,carnival, carnival, carnvckt, 0, ROT270, "Sega", "Carnival (cocktail)",  GAME_IMPERFECT_SOUND )
3379GAME( 1980, carnivalh,carnival, carnivalh,carnivalh,0, ROT270, "Sega", "Carnival (Head On hardware, set 1)",  GAME_IMPERFECT_SOUND )
3380GAME( 1980, carnivalha,carnival,carnivalh,carnivalh,0, ROT270, "Sega", "Carnival (Head On hardware, set 2)",  GAME_IMPERFECT_SOUND )
32923381GAME( 1981, brdrline, 0,        brdrline, brdrline, 0, ROT270, "Sega", "Borderline", GAME_NO_SOUND )
32933382GAME( 1981, brdrlins, brdrline, brdrline, brdrline, 0, ROT270, "[Sega] (Sidam bootleg)", "Borderline (Sidam bootleg)", GAME_NO_SOUND )
32943383GAME( 1981, brdrlinb, brdrline, brdrline, brdrline, 0, ROT270, "[Sega] (Karateco bootleg)", "Borderline (Karateco bootleg)", GAME_NO_SOUND )
src/mame/drivers/eolith.c
r7882r7883
208208   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_UNUSED )
209209
210210   PORT_START("DSW1")
211   PORT_DIPNAME( 0x00000001, 0x00000001, "Show Dip-switch Information" )
211   PORT_DIPNAME( 0x00000001, 0x00000001, "Show Dip-switch Information" ) PORT_DIPLOCATION("SW4:1")
212212   PORT_DIPSETTING(          0x00000001, DEF_STR( Off ) )
213213   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
214   PORT_DIPNAME( 0x00000002, 0x00000000, DEF_STR( Demo_Sounds ) )
214   PORT_DIPNAME( 0x00000002, 0x00000000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW4:2")
215215   PORT_DIPSETTING(          0x00000002, DEF_STR( Off ) )
216216   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
217   PORT_DIPNAME( 0x0000000c, 0x0000000c, DEF_STR( Lives ) )
217   PORT_DIPNAME( 0x0000000c, 0x0000000c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW4:3,4")
218218   PORT_DIPSETTING(          0x00000008, "1" )
219219   PORT_DIPSETTING(          0x00000004, "2" )
220220   PORT_DIPSETTING(          0x0000000c, "3" )
221221   PORT_DIPSETTING(          0x00000000, "4" )
222   PORT_DIPNAME( 0x00000030, 0x00000030, DEF_STR( Coinage ) )
222   PORT_DIPNAME( 0x00000030, 0x00000030, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW3:1,2")
223223   PORT_DIPSETTING(          0x00000010, DEF_STR( 3C_1C ) )
224224   PORT_DIPSETTING(          0x00000020, DEF_STR( 2C_1C ) )
225225   PORT_DIPSETTING(          0x00000030, DEF_STR( 1C_1C ) )
226226   PORT_DIPSETTING(          0x00000000, DEF_STR( Free_Play ) )
227   PORT_DIPNAME( 0x000000c0, 0x000000c0, DEF_STR( Difficulty ) )
227   PORT_DIPNAME( 0x000000c0, 0x000000c0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW3:3,4")
228228   PORT_DIPSETTING(          0x00000000, DEF_STR( Very_Hard ) )
229229   PORT_DIPSETTING(          0x00000040, DEF_STR( Hard ) )
230230   PORT_DIPSETTING(          0x000000c0, DEF_STR( Normal ) )
r7882r7883
237237   PORT_BIT( 0x00000008, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_write_bit)
238238INPUT_PORTS_END
239239
240static INPUT_PORTS_START( ironfortj )
241   PORT_INCLUDE(ironfort)
242
243   PORT_MODIFY("DSW1")
244   PORT_DIPNAME( 0x00000002, 0x00000000, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW4:2")
245   PORT_DIPSETTING(          0x00000002, DEF_STR( Off ) )
246   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
247   PORT_DIPNAME( 0x00000030, 0x00000030, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW3:1,2")
248   PORT_DIPSETTING(          0x00000000, DEF_STR( 4C_1C ) )
249   PORT_DIPSETTING(          0x00000010, DEF_STR( 3C_1C ) )
250   PORT_DIPSETTING(          0x00000020, DEF_STR( 2C_1C ) )
251   PORT_DIPSETTING(          0x00000030, DEF_STR( 1C_1C ) )
252INPUT_PORTS_END
253
240254static INPUT_PORTS_START( hidnctch )
241255   PORT_INCLUDE(common)
242256   PORT_MODIFY("IN0")
r7882r7883
443457   ROM_LOAD( "qs1001a.u96",  0x000000, 0x80000, CRC(d13c6407) SHA1(57b14f97c7d4f9b5d9745d3571a0b7115fbe3176) )
444458ROM_END
445459
460ROM_START( ironfortj )
461   ROM_REGION( 0x80000, "maincpu", 0 ) /* Hyperstone CPU Code */
462   ROM_LOAD( "u43.bin", 0x00000, 0x80000, CRC(f1f19c9a) SHA1(98531ecedd1277e6d10395794a66d615df7ddbd6) ) /* 27C040 eprom with no label */
463
464   ROM_REGION32_BE( 0x2000000, "user1", ROMREGION_ERASE00 ) /* Game Data - banked ROM, swapping necessary */
465   ROM_LOAD32_WORD_SWAP( "if00-00.u39", 0x0000000, 0x400000, CRC(63b74601) SHA1(c111ecf55359e9005a3ec1fe1202a34624f8b242) )
466   ROM_LOAD32_WORD_SWAP( "if00-01.u34", 0x0000002, 0x400000, CRC(890470b3) SHA1(57df122ab01744b47ebd38554eb6a7d780977be2) )
467   ROM_LOAD32_WORD_SWAP( "if00-02.u40", 0x0800000, 0x400000, CRC(63b5cca5) SHA1(4ec8b813c7e465f659a4a2361ddfbad763bf6e6a) )
468   ROM_LOAD32_WORD_SWAP( "if00-03.u35", 0x0800002, 0x400000, CRC(54a76cb5) SHA1(21fb3bedf065079d59f642b19487f76590f97558) )
469
470   ROM_REGION( 0x008000, "cpu1", 0 ) /* QDSP ('51) Code */
471   ROM_LOAD( "u107", 0x0000, 0x8000, CRC(89450a2f) SHA1(d58efa805f497bec179fdbfb8c5860ac5438b4ec) ) /* 27C256 eprom with no label */
472
473   ROM_REGION( 0x08000, "cpu2", 0 ) /* Sound (80c301) CPU Code */
474   ROM_LOAD( "u111", 0x0000, 0x8000, CRC(5d1d1387) SHA1(91c8aa4c7472b91c149bef9da64569a97df35298) ) /* 27C256 eprom with no label */
475
476   ROM_REGION( 0x080000, "music", 0 ) /* Music data */
477   ROM_LOAD( "u108", 0x00000, 0x80000, CRC(89233144) SHA1(74e87679a7559450934b80fcfcb667d9845977a7) ) /* 27C040 eprom with no label */
478
479   ROM_REGION( 0x080000, "sfx", 0 ) /* QDSP samples (SFX) */
480   ROM_LOAD( "u97", 0x00000, 0x80000, CRC(47b9d43a) SHA1(e0bc42892480cb563dc694fcefa8ca0b984749dd) ) /* 27C040 eprom with no label */
481
482   ROM_REGION( 0x080000, "wavetable", 0 ) /* QDSP wavetable rom */
483   ROM_LOAD( "qs1001a.u96",  0x000000, 0x80000, CRC(d13c6407) SHA1(57b14f97c7d4f9b5d9745d3571a0b7115fbe3176) )
484ROM_END
485
446486/* Hidden Catch */
447487
448488ROM_START( hidnctch )
r7882r7883
10421082   init_eolith_speedup(machine);
10431083}
10441084
1045GAME( 1998, ironfort, 0,       ironfort, ironfort, eolith,   ROT0, "Eolith", "Iron Fortress", GAME_NO_SOUND )
1046GAME( 1998, hidnctch, 0,       eolith45, hidnctch, eolith,   ROT0, "Eolith", "Hidden Catch (World) / Tul Lin Gu Lim Chat Ki '98 (Korea) (pcb ver 3.03)",  GAME_NO_SOUND ) // or Teurrin Geurim Chajgi '98
1047GAME( 1998, raccoon,  0,       eolith45, raccoon,  eolith,   ROT0, "Eolith", "Raccoon World", GAME_NO_SOUND )
1048GAME( 1998, puzzlekg, 0,       eolith45, puzzlekg, eolith,   ROT0, "Eolith", "Puzzle King (Dance & Puzzle)",  GAME_NO_SOUND )
1049GAME( 1999, hidctch2, 0,       eolith50, hidnctch, hidctch2, ROT0, "Eolith", "Hidden Catch 2 (pcb ver 3.03)", GAME_NO_SOUND )
1050GAME( 1999, landbrk,  0,       eolith45, landbrk,  landbrk,  ROT0, "Eolith", "Land Breaker (World) / Miss Tang Ja Ru Gi (Korea) (pcb ver 3.02)",  GAME_NO_SOUND ) // or Miss Ttang Jjareugi
1051GAME( 1999, landbrka, landbrk, eolith45, landbrk,  landbrka, ROT0, "Eolith", "Land Breaker (World) / Miss Tang Ja Ru Gi (Korea) (pcb ver 3.03)",  GAME_NO_SOUND ) // or Miss Ttang Jjareugi
1052GAME( 1999, nhidctch, 0,       eolith45, hidnctch, eolith,   ROT0, "Eolith", "New Hidden Catch (World) / New Tul Lin Gu Lim Chat Ki '98 (Korea) (pcb ver 3.02)", GAME_NO_SOUND ) // or New Teurrin Geurim Chajgi '98
1053GAME( 2000, hidctch3, 0,       eolith50, hidctch3, hidctch3, ROT0, "Eolith", "Hidden Catch 3 (ver 1.00 / pcb ver 3.05)", GAME_NO_SOUND )
1054GAME( 2001, fort2b,   0,       eolith50, common,   eolith,   ROT0, "Eolith", "Fortress 2 Blue Arcade (ver 1.01 / pcb ver 3.05)",  GAME_NO_SOUND )
1055GAME( 2001, fort2ba,  fort2b,  eolith50, common,   eolith,   ROT0, "Eolith", "Fortress 2 Blue Arcade (ver 1.00 / pcb ver 3.05)",  GAME_NO_SOUND )
1085GAME( 1998, ironfort,  0,        ironfort, ironfort,  eolith,   ROT0, "Eolith", "Iron Fortress", GAME_NO_SOUND )
1086GAME( 1998, ironfortj, ironfort, ironfort, ironfortj, eolith,   ROT0, "Eolith", "Iron Fortress (Japan)", GAME_NO_SOUND )
1087GAME( 1998, hidnctch,  0,        eolith45, hidnctch,  eolith,   ROT0, "Eolith", "Hidden Catch (World) / Tul Lin Gu Lim Chat Ki '98 (Korea) (pcb ver 3.03)",  GAME_NO_SOUND ) // or Teurrin Geurim Chajgi '98
1088GAME( 1998, raccoon,   0,        eolith45, raccoon,   eolith,   ROT0, "Eolith", "Raccoon World", GAME_NO_SOUND )
1089GAME( 1998, puzzlekg,  0,        eolith45, puzzlekg,  eolith,   ROT0, "Eolith", "Puzzle King (Dance & Puzzle)",  GAME_NO_SOUND )
1090GAME( 1999, hidctch2,  0,        eolith50, hidnctch,  hidctch2, ROT0, "Eolith", "Hidden Catch 2 (pcb ver 3.03)", GAME_NO_SOUND )
1091GAME( 1999, landbrk,   0,        eolith45, landbrk,   landbrk,  ROT0, "Eolith", "Land Breaker (World) / Miss Tang Ja Ru Gi (Korea) (pcb ver 3.02)",  GAME_NO_SOUND ) // or Miss Ttang Jjareugi
1092GAME( 1999, landbrka,  landbrk,  eolith45, landbrk,   landbrka, ROT0, "Eolith", "Land Breaker (World) / Miss Tang Ja Ru Gi (Korea) (pcb ver 3.03)",  GAME_NO_SOUND ) // or Miss Ttang Jjareugi
1093GAME( 1999, nhidctch,  0,        eolith45, hidnctch,  eolith,   ROT0, "Eolith", "New Hidden Catch (World) / New Tul Lin Gu Lim Chat Ki '98 (Korea) (pcb ver 3.02)", GAME_NO_SOUND ) // or New Teurrin Geurim Chajgi '98
1094GAME( 2000, hidctch3,  0,        eolith50, hidctch3,  hidctch3, ROT0, "Eolith", "Hidden Catch 3 (ver 1.00 / pcb ver 3.05)", GAME_NO_SOUND )
1095GAME( 2001, fort2b,    0,        eolith50, common,    eolith,   ROT0, "Eolith", "Fortress 2 Blue Arcade (ver 1.01 / pcb ver 3.05)",  GAME_NO_SOUND )
1096GAME( 2001, fort2ba,   fort2b,   eolith50, common,    eolith,   ROT0, "Eolith", "Fortress 2 Blue Arcade (ver 1.00 / pcb ver 3.05)",  GAME_NO_SOUND )
src/mame/drivers/atarisy2.c
r7882r7883
228228   atarigen_init(machine);
229229
230230   state_save_register_global(machine, state->interrupt_enable);
231   state_save_register_global(machine, state->tms5220_data);
232   state_save_register_global(machine, state->tms5220_data_strobe);
233231   state_save_register_global(machine, state->which_adc);
234232   state_save_register_global(machine, state->p2portwr_state);
235233   state_save_register_global(machine, state->p2portrd_state);
r7882r7883
249247   atarigen_scanline_timer_reset(machine->primary_screen, scanline_update, 64);
250248   memory_set_direct_update_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), atarisy2_direct_handler);
251249
252   state->tms5220_data_strobe = 1;
253
254250   state->p2portwr_state = 0;
255251   state->p2portrd_state = 0;
256252
r7882r7883
381377   atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
382378   int result = input_port_read(space->machine, "1840");
383379
384   if (state->atarigen.cpu_to_sound_ready) result ^= 0x01;
385   if (state->atarigen.sound_to_cpu_ready) result ^= 0x02;
386   if (!state->has_tms5220 || !tms5220_readyq_r(devtag_get_device(space->machine, "tms"))) result ^= 0x04;
387   if (!(input_port_read(space->machine, "1801") & 0x80)) result ^= 0x10;
380   if (state->atarigen.cpu_to_sound_ready) result |= 0x01;
381   if (state->atarigen.sound_to_cpu_ready) result |= 0x02;
382   if ((state->has_tms5220) && (tms5220_readyq_r(devtag_get_device(space->machine, "tms")) == 0))
383      result &= ~0x04;
384   if (!(input_port_read(space->machine, "1801") & 0x80)) result |= 0x10;
388385
389386   return result;
390387}
r7882r7883
628625   /* a large number of signals are reset when this happens */
629626   atarigen_sound_io_reset(devtag_get_device(space->machine, "soundcpu"));
630627   devtag_reset(space->machine, "ymsnd");
628   if (state->has_tms5220)
629   {
630      devtag_reset(space->machine, "tms"); // technically what happens is the tms5220 gets a long stream of 0xFF written to it when sound_reset_state is 0 which halts the chip after a few frames, but this works just as well, even if it isn't exactly true to hardware... The hardware may not have worked either, the resistors to pull input to 0xFF are fighting against the ls263 gate holding the latched value to be sent to the chip.
631   }
631632   mixer_w(space, 0, 0);
632   state->tms5220_data = 0;
633   state->tms5220_data_strobe = 0;
634633}
635634
636635
r7882r7883
683682static WRITE8_HANDLER( tms5220_w )
684683{
685684   atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
686   state->tms5220_data = data;
685   if (state->has_tms5220)
686   {
687      tms5220_data_w(devtag_get_device(space->machine, "tms"), 0, data);
688   }
687689}
688690
689
690691static WRITE8_HANDLER( tms5220_strobe_w )
691692{
692693   atarisy2_state *state = (atarisy2_state *)space->machine->driver_data;
693   if (!(offset & 1) && state->tms5220_data_strobe && state->has_tms5220)
694   if (state->has_tms5220)
694695   {
695      running_device *tms = devtag_get_device(space->machine, "tms");
696      tms5220_data_w(tms, 0, state->tms5220_data);
696      tms5220_wsq_w(devtag_get_device(space->machine, "tms"), 1-(offset & 1));
697697   }
698   state->tms5220_data_strobe = offset & 1;
699698}
700699
701
702
703700/*************************************
704701 *
705702 *  Misc. sound
r7882r7883
11871184   MDRV_SOUND_CONFIG(pokey_interface_2)
11881185   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.35)
11891186
1190   MDRV_SOUND_ADD("tms", TMS5220, MASTER_CLOCK/4/4/2)
1187   MDRV_SOUND_ADD("tms", TMS5220C, MASTER_CLOCK/4/4/2)
11911188   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.75)
11921189   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.75)
11931190MACHINE_DRIVER_END
r7882r7883
30563053
30573054   state->pedal_count = 0;
30583055   state->has_tms5220 = 1;
3056   tms5220_rsq_w(devtag_get_device(machine, "tms"),  1); // /RS is tied high on sys2 hw
30593057}
30603058
30613059
r7882r7883
30963094
30973095   state->pedal_count = -1;
30983096   state->has_tms5220 = 1;
3097   tms5220_rsq_w(devtag_get_device(machine, "tms"),  1); // /RS is tied high on sys2 hw
30993098}
31003099
31013100
r7882r7883
32513250
32523251   state->pedal_count = 2;
32533252   state->has_tms5220 = 1;
3253   tms5220_rsq_w(devtag_get_device(machine, "tms"),  1); // /RS is tied high on sys2 hw
32543254}
32553255
32563256
src/mame/drivers/ssf2md.c
r7882r7883
3030
3131}
3232
33GAME( 1994, ssf2ghw,  0,   megadriv,    ssf2ghw,     ssf2ghw,  ROT0,  "bootleg / Capcom", "Super Street Fighter II - The New Challengers (Arcade bootleg of Japanese MegaDrive version)", 0 )
33GAME( 1994, ssf2ghw,  0, megadriv, ssf2ghw,  ssf2ghw,  ROT0, "bootleg / Capcom", "Super Street Fighter II - The New Challengers (Arcade bootleg of Japanese MegaDrive version)", 0 )
src/mame/drivers/naomi.c
r7882r7883
13071307
13081308   /* Area 3 */
13091309   AM_RANGE(0x0c000000, 0x0dffffff) AM_RAM AM_BASE(&naomi_ram64) AM_SHARE("share4")
1310
13101311   AM_RANGE(0x0e000000, 0x0fffffff) AM_RAM AM_SHARE("share4")// mirror
13111312
13121313   AM_RANGE(0x8c000000, 0x8dffffff) AM_RAM AM_SHARE("share4") // RAM access through cache
13131314
1315   AM_RANGE(0xac000000, 0xadffffff) AM_RAM AM_SHARE("share4") // written here by totd
1316
13141317   /* Area 4 */
13151318   AM_RANGE(0x10000000, 0x107fffff) AM_WRITE( ta_fifo_poly_w )
13161319   AM_RANGE(0x10800000, 0x10ffffff) AM_WRITE( ta_fifo_yuv_w )
r7882r7883
15151518   PORT_DIPSETTING(    0x00, DEF_STR( Off ) ) \
15161519   PORT_DIPSETTING(    0x01, DEF_STR( On ) ) \
15171520
1521#define NAOMI_DIP_SW \
1522   PORT_START("DSW") \
1523   PORT_DIPNAME( 0x01, 0x00, "Monitor" ) PORT_DIPLOCATION("SW1:1") \
1524   PORT_DIPSETTING(    0x01, "31 kHz" ) \
1525   PORT_DIPSETTING(    0x00, "15 kHz" ) \
1526   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") \
1527   PORT_DIPSETTING(    0x02, DEF_STR( Off ) ) \
1528   PORT_DIPSETTING(    0x00, DEF_STR( On ) ) \
1529   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") \
1530   PORT_DIPSETTING(    0x04, DEF_STR( Off ) ) \
1531   PORT_DIPSETTING(    0x00, DEF_STR( On ) ) \
1532   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") \
1533   PORT_DIPSETTING(    0x08, DEF_STR( Off ) ) \
1534   PORT_DIPSETTING(    0x00, DEF_STR( On ) ) \
15181535
15191536/* for now we hardwire a joystick + 6 buttons for every game.*/
15201537static INPUT_PORTS_START( naomi )
1538   NAOMI_DIP_SW
1539
15211540   PORT_START("IN0")
15221541   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service")
15231542   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
r7882r7883
15571576
15581577/* JVS mahjong panel */
15591578static INPUT_PORTS_START( naomi_mp )
1579   NAOMI_DIP_SW
1580
15601581   PORT_START("IN0")
15611582   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service")
15621583   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
r7882r7883
16861707// COIN    (1<<15)
16871708
16881709static INPUT_PORTS_START( aw )
1710   NAOMI_DIP_SW //FIXME: check if it's the same.
1711
16891712   PORT_START("P1L")
16901713   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
16911714   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
r7882r7883
19231946
19241947Airline Pilot specific Naomi BIOS roms:
19251948
1949EPR-21801 - NAOMI BOOT ROM 1999 03/11  1.30 (USA)
19261950EPR-21802 - NAOMI BOOT ROM 1999 03/11  1.30 (Export)
19271951
19520x4D148 is the region byte (only one region byte)
19530x1ffffa-0x1fffff is the BIOS checksum
19281954
1955
19291956Region byte encoding is as follows:
19301957
193119580x00 = Japan
r7882r7883
19431970/* bios e works, the newer japan one gives 'board malfunction' with some games?' */
19441971#define NAOMI_BIOS \
19451972   ROM_SYSTEM_BIOS( 0, "bios0", "epr-21576e (Japan)" ) \
1946   ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-21576e.bin",  0x000000, 0x200000, CRC(08c0add7) SHA1(e7c1a7673cb2ccb21748ef44105e46d1bad7266d) ) \
1973   ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-21576e.ic27",  0x000000, 0x200000, CRC(08c0add7) SHA1(e7c1a7673cb2ccb21748ef44105e46d1bad7266d) ) \
19471974   ROM_SYSTEM_BIOS( 1, "bios1", "epr-21576g (Japan)" ) \
1948   ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-21576g.bin",  0x000000, 0x200000, CRC(d2a1c6bf) SHA1(6d27d71aec4dfba98f66316ae74a1426d567698a) ) \
1975   ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-21576g.ic27",  0x000000, 0x200000, CRC(d2a1c6bf) SHA1(6d27d71aec4dfba98f66316ae74a1426d567698a) ) \
19491976   ROM_SYSTEM_BIOS( 2, "bios2", "epr-21576h (Japan)" ) \
1950   ROM_LOAD16_WORD_SWAP_BIOS( 2, "epr-21576h.bin",  0x000000, 0x200000, CRC(d4895685) SHA1(91424d481ff99a8d3f4c45cea6d3f0eada049a6d) ) \
1977   ROM_LOAD16_WORD_SWAP_BIOS( 2, "epr-21576h.ic27",  0x000000, 0x200000, CRC(d4895685) SHA1(91424d481ff99a8d3f4c45cea6d3f0eada049a6d) ) \
19511978   ROM_SYSTEM_BIOS( 3, "bios3", "epr-21576d (Japan)" ) \
1952   ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-21576d.bin",  0x000000, 0x200000, CRC(3b2afa7b) SHA1(d007e1d321c198a38c5baff86eb2ab84385d150a) ) \
1979   ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-21576d.ic27",  0x000000, 0x200000, CRC(3b2afa7b) SHA1(d007e1d321c198a38c5baff86eb2ab84385d150a) ) \
19531980   ROM_SYSTEM_BIOS( 4, "bios4", "epr-21576b (Japan)" ) \
1954   ROM_LOAD16_WORD_SWAP_BIOS( 4, "epr-21576b.bin",  0x000000, 0x200000, CRC(755a6e07) SHA1(7e8b8ccfc063144d89668e7224dcd8a36c54f3b3) ) \
1981   ROM_LOAD16_WORD_SWAP_BIOS( 4, "epr-21576b.ic27",  0x000000, 0x200000, CRC(755a6e07) SHA1(7e8b8ccfc063144d89668e7224dcd8a36c54f3b3) ) \
19551982   ROM_SYSTEM_BIOS( 5, "bios5", "epr-21576 (Japan)" ) \
1956   ROM_LOAD16_WORD_SWAP_BIOS( 5, "epr-21576.bin", 0x000000, 0x200000, CRC(9dad3495) SHA1(5fb66f9a2b68d120f059c72758e65d34f461044a) ) \
1983   ROM_LOAD16_WORD_SWAP_BIOS( 5, "epr-21576.ic27", 0x000000, 0x200000, CRC(9dad3495) SHA1(5fb66f9a2b68d120f059c72758e65d34f461044a) ) \
19571984   ROM_SYSTEM_BIOS( 6, "bios6", "epr-21578h (Export)" ) \
19581985   ROM_LOAD16_WORD_SWAP_BIOS( 6, "epr-21578h.ic27", 0x000000, 0x200000, CRC(7b452946) SHA1(8e9f153bbada24b37066dc45b64a7bf0d4f26a9b) ) \
19591986   ROM_SYSTEM_BIOS( 7, "bios7", "epr-21578g (Export)" ) \
19601987   ROM_LOAD16_WORD_SWAP_BIOS( 7, "epr-21578g.ic27", 0x000000, 0x200000, CRC(55413214) SHA1(bd2748365a9fc1821c9369aa7155d7c41c4df43e) ) \
19611988   ROM_SYSTEM_BIOS( 8, "bios8", "epr-21578e (Export)" ) \
1962   ROM_LOAD16_WORD_SWAP_BIOS( 8, "epr-21578e.bin",  0x000000, 0x200000, CRC(087f09a3) SHA1(0418eb2cf9766f0b1b874a4e92528779e22c0a4a) ) \
1989   ROM_LOAD16_WORD_SWAP_BIOS( 8, "epr-21578e.ic27",  0x000000, 0x200000, CRC(087f09a3) SHA1(0418eb2cf9766f0b1b874a4e92528779e22c0a4a) ) \
19631990   ROM_SYSTEM_BIOS( 9, "bios9", "epr-21578d (Export)" ) \
1964   ROM_LOAD16_WORD_SWAP_BIOS( 9, "epr-21578d.bin",  0x000000, 0x200000, CRC(dfd5f42a) SHA1(614a0db4743a5e5a206190d6786ade24325afbfd) ) \
1991   ROM_LOAD16_WORD_SWAP_BIOS( 9, "epr-21578d.ic27",  0x000000, 0x200000, CRC(dfd5f42a) SHA1(614a0db4743a5e5a206190d6786ade24325afbfd) ) \
19651992   ROM_SYSTEM_BIOS( 10, "bios10", "epr-21578b (Export)" ) \
1966   ROM_LOAD16_WORD_SWAP_BIOS( 10, "epr-21578b.bin",  0x000000, 0x200000, CRC(6c9aad83) SHA1(555918de76d8dbee2a97d8a95297ef694b3e803f) ) \
1993   ROM_LOAD16_WORD_SWAP_BIOS( 10, "epr-21578b.ic27",  0x000000, 0x200000, CRC(6c9aad83) SHA1(555918de76d8dbee2a97d8a95297ef694b3e803f) ) \
19671994   ROM_SYSTEM_BIOS( 11, "bios11", "epr-21577g (USA)" ) \
1968   ROM_LOAD16_WORD_SWAP_BIOS( 11, "epr-21577g.bin",  0x000000, 0x200000, CRC(25f64af7) SHA1(99f9e6cc0642319bd2da492611220540add573e8) ) \
1995   ROM_LOAD16_WORD_SWAP_BIOS( 11, "epr-21577g.ic27",  0x000000, 0x200000, CRC(25f64af7) SHA1(99f9e6cc0642319bd2da492611220540add573e8) ) \
19691996   ROM_SYSTEM_BIOS( 12, "bios12", "epr-21577e (USA)" ) \
1970   ROM_LOAD16_WORD_SWAP_BIOS( 12, "epr-21577e.bin",  0x000000, 0x200000, CRC(cf36e97b) SHA1(b085305982e7572e58b03a9d35f17ae319c3bbc6) ) \
1997   ROM_LOAD16_WORD_SWAP_BIOS( 12, "epr-21577e.ic27",  0x000000, 0x200000, CRC(cf36e97b) SHA1(b085305982e7572e58b03a9d35f17ae319c3bbc6) ) \
19711998   ROM_SYSTEM_BIOS( 13, "bios13", "epr-21577d (USA)" ) \
1972   ROM_LOAD16_WORD_SWAP_BIOS( 13, "epr-21577d.bin",  0x000000, 0x200000, CRC(60ddcbbe) SHA1(58b15096d269d6df617ca1810b66b47deb184958) ) \
1999   ROM_LOAD16_WORD_SWAP_BIOS( 13, "epr-21577d.ic27",  0x000000, 0x200000, CRC(60ddcbbe) SHA1(58b15096d269d6df617ca1810b66b47deb184958) ) \
19732000   ROM_SYSTEM_BIOS( 14, "bios14", "Naomi Dev BIOS" ) \
19742001   ROM_LOAD16_WORD_SWAP_BIOS( 14,  "dcnaodev.bios", 0x000000, 0x080000, CRC(7a50fab9) SHA1(ef79f448e0bf735d1264ad4f051d24178822110f) ) /* This one comes from a dev / beta board. The eprom was a 27C4096 */
19752002
r7882r7883
19822009
19832010#define F355_BIOS \
19842011   ROM_SYSTEM_BIOS( 0, "bios0", "Ferrari F355 (Export)" ) \
1985   ROM_LOAD16_WORD_SWAP_BIOS( 0,  "epr-22851.bin", 0x000000, 0x200000, CRC(62483677) SHA1(3e3bcacf5f972c376b569f45307ee7fd0b5031b7) ) \
2012   ROM_LOAD16_WORD_SWAP_BIOS( 0,  "epr-22851.ic27", 0x000000, 0x200000, CRC(62483677) SHA1(3e3bcacf5f972c376b569f45307ee7fd0b5031b7) ) \
19862013   ROM_SYSTEM_BIOS( 1, "bios1", "Ferrari F355 (USA)" ) \
1987   ROM_LOAD16_WORD_SWAP_BIOS( 1,  "epr-22850.bin", 0x000000, 0x200000, CRC(28aa539d) SHA1(14485368656af80504b212da620179c49f84c1a2) )
2014   ROM_LOAD16_WORD_SWAP_BIOS( 1,  "epr-22850.ic27", 0x000000, 0x200000, CRC(28aa539d) SHA1(14485368656af80504b212da620179c49f84c1a2) ) \
19882015
19892016#define AIRLINE_BIOS \
19902017   ROM_SYSTEM_BIOS( 0, "bios0", "Airline Pilots Deluxe (Export)" ) \
1991   ROM_LOAD16_WORD_SWAP_BIOS( 0,  "epr-21802.bin", 0x000000, 0x200000, CRC(a77c6b1c) SHA1(bd50a6bb8fa9bac121b076e21ea048a83a240a48) ) \
2018   ROM_LOAD16_WORD_SWAP_BIOS( 0,  "epr-21802.ic27", 0x000000, 0x200000, CRC(a77c6b1c) SHA1(bd50a6bb8fa9bac121b076e21ea048a83a240a48) ) \
2019   ROM_SYSTEM_BIOS( 1, "bios1", "Airline Pilots Deluxe (USA)" ) \
2020   ROM_LOAD16_WORD_SWAP_BIOS( 1,  "epr-21801.ic27", 0x000000, 0x200000, CRC(a21bef24) SHA1(c6c6ed09772b63a9a84ef0678fc1b7527484038a) ) \
19922021
19932022
19942023/* only revisions d and higher support the GDROM, and there is an additional bios (and SH4!) on the DIMM board for the CD Controller */
r7882r7883
25372566
25382567*/
25392568
2540ROM_START( derbyoc )
2569ROM_START( derbyocb )
25412570   ROM_REGION( 0x200000, "maincpu", 0)
25422571   NAOMI_BIOS
25432572   NAOMI_DEFAULT_EEPROM
r7882r7883
25602589   ROM_LOAD("mpr-22098.ic14",  0x7000000, 0x0800000, CRC(f9824d2e) SHA1(f20f8cc2b1bef9077ede1cb874da8f2a335d39de) )
25612590ROM_END
25622591
2592ROM_START( derbyoc )
2593   ROM_REGION( 0x200000, "maincpu", 0)
2594   NAOMI_BIOS
2595   NAOMI_DEFAULT_EEPROM
2596
2597   ROM_REGION( 0x7800000, "user1", ROMREGION_ERASEFF)
2598        ROM_LOAD( "epr-22336c.ic22", 0x000000, 0x400000, CRC(50053f82) SHA1(5b31abb480043ece3645b2479ba566ac6592acd8) )
2599        ROM_LOAD( "mpr-22328.ic1", 0x0800000, 0x1000000, CRC(179cec02) SHA1(cbaba86082370a082d2e9f18427691d5cfa0e4f0) )
2600        ROM_LOAD( "mpr-22329.ic2", 0x1800000, 0x1000000, CRC(e0d5b98c) SHA1(5bf1ac0d895fd7725d170a54f01cd717a5e54110) )
2601        ROM_LOAD( "mpr-22330.ic3", 0x2800000, 0x1000000, CRC(6737cd62) SHA1(08429ca39fef3b36cb491813ddcd0feef3b24372) )
2602        ROM_LOAD( "mpr-22331.ic4", 0x3800000, 0x1000000, CRC(8fb5cbcf) SHA1(c4e6cbbe7d3549e1841654b41b1946b9bc356e74) )
2603        ROM_LOAD( "mpr-22332.ic5", 0x4800000, 0x1000000, CRC(c5e365a8) SHA1(5839ea24b8fd02552931175d35e2ceca75fca089) )
2604        ROM_LOAD( "mpr-22333.ic6", 0x5800000, 0x1000000, CRC(96f324aa) SHA1(bc41e2097c1841771d786ba9ad1a31df1494a856) )
2605        ROM_LOAD( "mpr-22334.ic7", 0x6800000, 0x1000000, CRC(5389b05a) SHA1(e206e4d82d7b1a59c33043ec0812eb69be08d9b3) )
2606ROM_END
2607
25632608/*
25642609SYSTEMID: NAOMI
25652610JAP: DERBY OWNERS CLUB II-----------
r7882r7883
34133458        ROM_LOAD( "epr-23000.ic8", 0x000000, 0x010000, CRC(e3b162f7) SHA1(52c7ad759c3c4a3148764e14d77ba5006bc8af48) )
34143459ROM_END
34153460
3461/* Sega Strike Fighter */
3462ROM_START( sstrkfgt )
3463   ROM_REGION( 0x200000, "maincpu", 0)
3464   NAOMI_BIOS
3465   NAOMI_DEFAULT_EEPROM
3466
3467   ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF)
3468        ROM_LOAD( "epr-23323a.ic22", 0x0000000, 0x400000, CRC(f3fd304b) SHA1(012eefebd857200195d9e2d80c24a793b258d7e2) )
3469        ROM_LOAD( "mpr-23302.ic1",   0x0800000, 0x800000, CRC(3429321b) SHA1(6fc1be2ca71a690a2ceca9dc968183a1222177f7) )
3470        ROM_LOAD( "mpr-23303.ic2",   0x1000000, 0x800000, CRC(f7b3ada2) SHA1(d2caea852241cb0d91243d84d1c5523dfddac721) )
3471        ROM_LOAD( "mpr-23304.ic3",   0x1800000, 0x800000, CRC(3bf145e9) SHA1(a000e135ad640472418de418b92dbdb83dcf872b) )
3472        ROM_LOAD( "mpr-23305.ic4",   0x2000000, 0x800000, CRC(924ee9fd) SHA1(dd56f8cd7e9dda87968abb810694bddeeb31db5c) )
3473        ROM_LOAD( "mpr-23306.ic5",   0x2800000, 0x800000, CRC(4021e805) SHA1(75988ff8d710da6d90608cef87fc8b4408a617fb) )
3474        ROM_LOAD( "mpr-23307.ic6",   0x3000000, 0x800000, CRC(090c1812) SHA1(e3e32d5c1f42191e188f91dbd4a753030894aa6f) )
3475        ROM_LOAD( "mpr-23308.ic7",   0x3800000, 0x800000, CRC(f23d2198) SHA1(9775796a388ab903102126fb190867a0d192903e) )
3476        ROM_LOAD( "mpr-23309.ic8",   0x4000000, 0x800000, CRC(0d6a7c9d) SHA1(0df846289d598efdf5605ca8e09758eb8b5878f9) )
3477        ROM_LOAD( "mpr-23310.ic9",   0x4800000, 0x800000, CRC(f4ec4baa) SHA1(77e2ea1c5747ced4951286142bd429780f9d4115) )
3478        ROM_LOAD( "mpr-23311.ic10",  0x5000000, 0x800000, CRC(a1467573) SHA1(cf38527b0e812ba90e7402aa53e4557ce756cf43) )
3479        ROM_LOAD( "mpr-23312.ic11",  0x5800000, 0x800000, CRC(9b0ae703) SHA1(35f0e3cdbc206b91dad4a97feb3c533bc12a77f1) )
3480        ROM_LOAD( "mpr-23313.ic12s", 0x6000000, 0x800000, CRC(d309fea9) SHA1(2ba2da81976126f0a79b066d855706d800279150) )
3481        ROM_LOAD( "mpr-23314.ic13s", 0x6800000, 0x800000, CRC(0aeedeac) SHA1(5e5086a7a51a9576e786911a2c7f4b509d5bc2f4) )
3482        ROM_LOAD( "mpr-23315.ic14s", 0x7000000, 0x800000, CRC(88f22650) SHA1(3425433d233b458ae73e30cc0c7d25fca2a9d589) )
3483        ROM_LOAD( "mpr-23316.ic15s", 0x7800000, 0x800000, CRC(38ff3a9d) SHA1(56978183fe61fd2ad59ab2979cb61fbf2cde07e6) )
3484        ROM_LOAD( "mpr-23317.ic16s", 0x8000000, 0x800000, CRC(d6d45776) SHA1(102963243f6e127d4c35d150eeb09aa99a3738d4) )
3485        ROM_LOAD( "mpr-23318.ic17s", 0x8800000, 0x800000, CRC(5f33207e) SHA1(6eceb6bb9171da8634fcba9dd7409794447fe069) )
3486        ROM_LOAD( "mpr-23319.ic18s", 0x9000000, 0x800000, CRC(ff42857a) SHA1(adbc025c4e02ad3b15ead9340aee494c16005ad5) )
3487        ROM_LOAD( "mpr-23320.ic19s", 0x9800000, 0x800000, CRC(5ec75a45) SHA1(696e5d14678c794dec67246507bd580f7e5b5043) )
3488        ROM_LOAD( "mpr-23321.ic20s", 0xa000000, 0x800000, CRC(018627d4) SHA1(2519f39ad046d14f602648fed39bc3719185b55e) )
3489ROM_END
3490
3491
34163492/* Sega Tetris */
34173493ROM_START( sgtetris )
34183494   ROM_REGION( 0x200000, "maincpu", 0)
r7882r7883
42724348        ROM_LOAD( "01f169c0.bin", 0x000000, 0x000100, CRC(b0a330f4) SHA1(10c7a7f4d6c7f265a32887beaca73686c4cb1e03) )
42734349ROM_END
42744350
4351ROM_START( kick4csh )
4352   ROM_REGION( 0x200000, "maincpu", 0)
4353   NAOMI_BIOS
4354   NAOMI_DEFAULT_EEPROM
42754355
4356   ROM_REGION( 0x8800000, "user1", ROMREGION_ERASEFF)
4357        ROM_LOAD( "epr-24212.ic11",   0x0000000, 0x400000, CRC(935453e8) SHA1(b34b3ac976229cba941843ffac9db420068999de) )
4358        ROM_LOAD32_WORD( "opr-24213a.ic17s", 0x0800000, 0x800000, CRC(2ea4810b) SHA1(67e6c4b246993ca775120d145e1b129cd743b358) )
4359        ROM_LOAD32_WORD( "opr-24214a.ic18",  0x0800002, 0x800000, CRC(0f574308) SHA1(699be7296650dcdb955048f2f5696a3b6d117afc) )
4360        ROM_LOAD32_WORD( "opr-24215a.ic19s", 0x1800000, 0x800000, CRC(e7fcb265) SHA1(ef05e330206adb0ebdba6df2ff7aaeb570c0c7e4) )
4361        ROM_LOAD32_WORD( "opr-24216a.ic20",  0x1800002, 0x800000, CRC(5101acc8) SHA1(2fbb4c8a450ecd070e2f18792a510e2cd4f7decb) )
4362        ROM_LOAD32_WORD( "opr-24224a.ic21s", 0x2800000, 0x800000, CRC(a5480237) SHA1(a250a45750d3d63428bf73c85cd510e4252da2c9) )
4363        ROM_LOAD32_WORD( "opr-24225a.ic22",  0x2800002, 0x800000, CRC(6b7e2856) SHA1(5b4a107ad654510b8282f4afe0c3856ca5a0fdf0) )
4364        ROM_LOAD32_WORD( "opr-24226a.ic23s", 0x3800000, 0x800000, CRC(5a7b85fa) SHA1(9b7ef6bbff01e83f14513d8ea42cdb66b74303d0) )
4365        ROM_LOAD32_WORD( "opr-24227a.ic24",  0x3800002, 0x800000, CRC(2b174c17) SHA1(9990268baf0091aef6cb3953b4da7fc2525d95af) )
4366        ROM_LOAD32_WORD( "opr-24228a.ic25s", 0x4800000, 0x800000, CRC(92690697) SHA1(5de562751305a385b929702fc3b3dfa4883be23b) )
4367        ROM_LOAD32_WORD( "opr-24229a.ic26",  0x4800002, 0x800000, CRC(fc3a6fbb) SHA1(1da1c011028c5b860a3d30e77a8dbdaabe997b63) )
4368        ROM_LOAD32_WORD( "opr-24230a.ic27s", 0x5800000, 0x800000, CRC(40da73c4) SHA1(c48e5d119f3f5c40cf78f6cc7fb5b62b153743a1) )
4369        ROM_LOAD32_WORD( "opr-24231a.ic28",  0x5800002, 0x800000, CRC(d04e33ec) SHA1(f7ed569bac47056955cb67f4ce0c1d36960f0c63) )
4370        ROM_LOAD32_WORD( "opr-24232a.ic29",  0x6800000, 0x800000, CRC(3bec96c6) SHA1(d228959dec168af1a1800e9b0f03692a68f10b99) )
4371        ROM_LOAD32_WORD( "opr-24233a.ic30s", 0x6800002, 0x800000, CRC(fc5bffec) SHA1(a6d63d80d11536c96d873c4ce492837ed83e3c9e) )
4372        ROM_LOAD32_WORD( "opr-24234a.ic31",  0x7800000, 0x800000, BAD_DUMP CRC(0dc58105) SHA1(524cad7019ba87db5ea13c3370082885fb09dd08) )
4373        ROM_LOAD32_WORD( "opr-24235a.ic32s", 0x7800002, 0x800000, BAD_DUMP CRC(1c55e3eb) SHA1(17a23c28d866b12f6249d513aea201edb2c43a68) )
4374ROM_END
4375
42764376/* GD-ROM titles - a PIC supplies a decryption key
42774377
42784378PIC stuff
r7882r7883
44154515/* 0011C */ GAME( 1999, toyfight, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Toy Fighter", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
44164516/* 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 )
44174517/* 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 )
4418/* 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 )
4518/* 0016C */ GAME( 1999, derbyoc,  naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Derby Owners Club (JPN, USA, EXP, KOR, AUS Ver. C)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
4519/* 0016C */ GAME( 1999, derbyocb, derbyoc,  naomi,    naomi,    naomi, ROT0, "Sega",            "Derby Owners Club (JPN, USA, EXP, KOR, AUS Ver. B)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
44194520/* 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 )
44204521/* 0018C */ GAME( 1999, sgtetris, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Sega Tetris", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
44214522/* 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 )
r7882r7883
44264527/* 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 )
44274528/* 0027C */ GAME( 2000, smarinef, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Sega Marine Fishing", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
44284529/* 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 )
4530/* 0035B */ GAME( 2000, sstrkfgt, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Sega Strike Fighter (rev. A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
44294531/* 0037C */ GAME( 2000, 18wheelr, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "18 Wheeler (JPN)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
44304532/* 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 )
44314533/* 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 )
r7882r7883
44374539/* 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 )
44384540/* 0098C */ GAME( 2001, shootopl, naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Shootout Pool", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
44394541/* 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 )
4542/* 0140B */ GAME( 2004, kick4csh, naomi,    naomi,    naomi,    kick4csh, ROT0, "Sega",         "Kick '4' Cash", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
44404543
44414544/* 841-xxxxx ("Licensed by Sega" games)*/
44424545/* 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 )
r7882r7883
46104713ROM_END
46114714
46124715
4716ROM_START( cleoftp )
4717   NAOMIGD_BIOS
4718   NAOMI_DEFAULT_EEPROM
4719
4720   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
4721
4722   DISK_REGION( "gdrom" )
4723   DISK_IMAGE_READONLY( "gdl-0012", 0, SHA1(aae4c1321fdee37d5405c6cbe648e0596624ed13) )
4724
4725   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
4726
4727   ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
4728   //PIC16C622A (317-5083-COM)
4729   //(sticker 253-5509-5083)
4730   ROM_LOAD("317-5083-com.pic", 0x00, 0x4000, CRC(096a0fc2) SHA1(8498a0d489a8e075268c07e2c076673904b04be9) )
4731ROM_END
4732
4733
46134734ROM_START( moeru )
46144735   NAOMIGD_BIOS
46154736   NAOMI_DEFAULT_EEPROM
r7882r7883
46264747   //PIC16C622A (317-5084-JPN)
46274748   //(sticker 253-5509-5084J)
46284749   ROM_LOAD("317-5084-jpn.pic", 0x00, 0x4000, CRC(db7dac1e) SHA1(b6f7afe9d9d2681005c1abcd4fde24867e65d1e4) )
4629
46304750ROM_END
46314751
46324752
r7882r7883
49005020   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
49015021
49025022   DISK_REGION( "gdrom" )
5023   DISK_IMAGE_READONLY( "gdl-0031", 0, SHA1(83697f45f0ffbb964f0504b19171c554499cd709) )
5024
5025   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
5026   //ROM_LOAD("317-5108-jpn.data", 0x00, 0x50, CRC(6a2eb334) SHA1(cab407d2e994f33aa921d50f399b17e6fbf98eb0) )
5027
5028   ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
5029   //PIC16C622A (317-5108-JPN)
5030   //(sticker 253-5509-5108J)
5031   ROM_LOAD("317-5108-jpn.pic", 0x00, 0x4000, CRC(4fa7dede) SHA1(f9011e951378364a12512d398f76be174dccce69) )
5032ROM_END
5033
5034
5035ROM_START( ss2005a )
5036   NAOMIGD_BIOS
5037   NAOMI_DEFAULT_EEPROM
5038
5039   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5040
5041   DISK_REGION( "gdrom" )
49035042   DISK_IMAGE_READONLY( "gdl-0031a", 0, SHA1(6091525845fc2042ed43cae5a1b60c603e16cf97) )
49045043
49055044   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
r7882r7883
49895128ROM_END
49905129
49915130
4992ROM_START( meltyb )
5131ROM_START( trgheart )
49935132   NAOMIGD_BIOS
49945133   NAOMI_DEFAULT_EEPROM
49955134
49965135   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
49975136
49985137   DISK_REGION( "gdrom" )
4999   DISK_IMAGE_READONLY( "gdl-0039", 0, SHA1(ffc7f6e113ad69422a4f22f318bdf9b1dc5c25db) )
5138   DISK_IMAGE_READONLY( "gdl-0036a", 0, SHA1(91f1e19136997cb1e2edfb1ad342b9427d1d3bfb) )
50005139
50015140   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
5002   //ROM_LOAD("317-5124-jpn.data", 0x00, 0x50, CRC(4d6e2c77) SHA1(3bed734c291140d0a61afa40f221395369a251a9) )
5141   //ROM_LOAD("317-5121-jpn.data", 0x00, 0x50, CRC(a417b20f) SHA1(af6ed7ebf95948bff3e8df915b229189b8de1e46) )
50035142
50045143   ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
5005   //PIC16C622A (317-5124-JPN)
5006   //(sticker 253-5509-5124J)
5007   ROM_LOAD("317-5124-jpn.pic", 0x00, 0x4000, CRC(ad162bfa) SHA1(0e9740ba65a724eb7cd70fb897e5cd9ac17aa55c) )
5144   //PIC16C622A (317-5121-JPN)
5145   //(sticker 253-5509-5121J)
5146   ROM_LOAD("317-5121-jpn.pic", 0x00, 0x4000, CRC(cdb9b179) SHA1(8f7d1e9a99ad90344449c6ebb623e2968f611ec0) )
50085147ROM_END
50095148
5010ROM_START( meltyba )
5149
5150ROM_START( jingystm )
50115151   NAOMIGD_BIOS
50125152   NAOMI_DEFAULT_EEPROM
50135153
50145154   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
50155155
50165156   DISK_REGION( "gdrom" )
5017   DISK_IMAGE_READONLY( "gdl-0039a", 0, SHA1(e6aa3d65b43a20606e6754bcb8665438770a1f8c) )
5157   DISK_IMAGE_READONLY( "gdl-0037", 0, SHA1(99ffe2987e3002b3871daf276d2be45f2e9c6e74) )
50185158
5159
50195160   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
5020   //ROM_LOAD("317-5124-jpn.data", 0x00, 0x50, CRC(4d6e2c77) SHA1(3bed734c291140d0a61afa40f221395369a251a9) )
5161   //ROM_LOAD("317-5122-jpn.data", 0x00, 0x50, CRC(0b85b7e4) SHA1(f4e419682ddc4b98a330e5ae543f9276c9bde030) )
50215162
50225163   ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
5023   //PIC16C622A (317-5124-JPN)
5024   //(sticker 253-5509-5124J)
5025   ROM_LOAD("317-5124-jpn.pic", 0x00, 0x4000, CRC(ad162bfa) SHA1(0e9740ba65a724eb7cd70fb897e5cd9ac17aa55c) )
5164   //PIC16C622A (317-5122-JPN)
5165   //(sticker 253-5509-5122J)
5166   ROM_LOAD("317-5122-jpn.pic", 0x00, 0x4000, CRC(88983220) SHA1(410ee292794c44d2249778c8b6adda023286eb04) )
50265167ROM_END
50275168
50285169
5029ROM_START( trgheart )
5170ROM_START( senkosp )
50305171   NAOMIGD_BIOS
50315172   NAOMI_DEFAULT_EEPROM
50325173
50335174   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
50345175
50355176   DISK_REGION( "gdrom" )
5036   DISK_IMAGE_READONLY( "gdl-0036a", 0, SHA1(91f1e19136997cb1e2edfb1ad342b9427d1d3bfb) )
5177   DISK_IMAGE_READONLY( "gdl-0038", 0, SHA1(430572f7e76c4fe009e2de91bf891d85613366b7) )
50375178
5179
50385180   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
5039   //ROM_LOAD("317-5121-jpn.data", 0x00, 0x50, CRC(a417b20f) SHA1(af6ed7ebf95948bff3e8df915b229189b8de1e46) )
50405181
50415182   ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
5042   //PIC16C622A (317-5121-JPN)
5043   //(sticker 253-5509-5121J)
5044   ROM_LOAD("317-5121-jpn.pic", 0x00, 0x4000, CRC(cdb9b179) SHA1(8f7d1e9a99ad90344449c6ebb623e2968f611ec0) )
5183   //PIC16C622A (317-5123-COM)
5184   //(sticker 253-5509-5123)
5185   ROM_LOAD("317-5123-com.pic", 0x00, 0x4000, CRC(7340df6e) SHA1(003a94e986335e959f9b1e8905fea8cbfdb5b2a1) )
50455186ROM_END
50465187
50475188
5048ROM_START( jingystm )
5189ROM_START( meltyb )
50495190   NAOMIGD_BIOS
50505191   NAOMI_DEFAULT_EEPROM
50515192
50525193   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
50535194
50545195   DISK_REGION( "gdrom" )
5055   DISK_IMAGE_READONLY( "gdl-0037", 0, SHA1(99ffe2987e3002b3871daf276d2be45f2e9c6e74) )
5196   DISK_IMAGE_READONLY( "gdl-0039", 0, SHA1(ffc7f6e113ad69422a4f22f318bdf9b1dc5c25db) )
50565197
5198   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
5199   //ROM_LOAD("317-5124-jpn.data", 0x00, 0x50, CRC(4d6e2c77) SHA1(3bed734c291140d0a61afa40f221395369a251a9) )
50575200
5201   ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
5202   //PIC16C622A (317-5124-JPN)
5203   //(sticker 253-5509-5124J)
5204   ROM_LOAD("317-5124-jpn.pic", 0x00, 0x4000, CRC(ad162bfa) SHA1(0e9740ba65a724eb7cd70fb897e5cd9ac17aa55c) )
5205ROM_END
5206
5207ROM_START( meltyba )
5208   NAOMIGD_BIOS
5209   NAOMI_DEFAULT_EEPROM
5210
5211   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5212
5213   DISK_REGION( "gdrom" )
5214   DISK_IMAGE_READONLY( "gdl-0039a", 0, SHA1(e6aa3d65b43a20606e6754bcb8665438770a1f8c) )
5215
50585216   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
5059   //ROM_LOAD("317-5122-jpn.data", 0x00, 0x50, CRC(0b85b7e4) SHA1(f4e419682ddc4b98a330e5ae543f9276c9bde030) )
5217   //ROM_LOAD("317-5124-jpn.data", 0x00, 0x50, CRC(4d6e2c77) SHA1(3bed734c291140d0a61afa40f221395369a251a9) )
50605218
50615219   ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
5062   //PIC16C622A (317-5122-JPN)
5063   //(sticker 253-5509-5122J)
5064   ROM_LOAD("317-5122-jpn.pic", 0x00, 0x4000, CRC(88983220) SHA1(410ee292794c44d2249778c8b6adda023286eb04) )
5220   //PIC16C622A (317-5124-JPN)
5221   //(sticker 253-5509-5124J)
5222   ROM_LOAD("317-5124-jpn.pic", 0x00, 0x4000, CRC(ad162bfa) SHA1(0e9740ba65a724eb7cd70fb897e5cd9ac17aa55c) )
50655223ROM_END
50665224
50675225
r7882r7883
50835241   ROM_LOAD("317-5125-com.pic", 0x00, 0x4000, CRC(918efc4f) SHA1(e32502b8df0b432eebaf0286176dd3bcd3f65dbb) )
50845242ROM_END
50855243
5244/*
50865245
5246Title             GUILTY GEAR XX ACCENT CORE
5247Media ID          D0D2
5248Media Config      GD-ROM1/1
5249Regions           J
5250Peripheral String 0000000
5251Product Number    GDL-0041
5252Version           V1.002
5253Release Date      20061107
5254
5255TOC         DISC
5256Track       Start Sector  End Sector   Track Size
5257track01.bin          150         599      1058400
5258track02.raw          750        2882      5016816
5259track03.bin        45150      549299   1185760800
5260
5261PIC16C621A-20 (317-5126-JPN)
5262Sticker: 253-5509-5126J
5263VER0001, TEST_OK, BMX.BIN, '70 1F 71 1F' 381F91D9624051F2
5264
5265*/
5266ROM_START( ggxxac )
5267   NAOMIGD_BIOS
5268   NAOMI_DEFAULT_EEPROM
5269
5270   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
5271
5272   DISK_REGION( "gdrom" )
5273   DISK_IMAGE_READONLY( "gdl-0041", 0, SHA1(3a589e1c79ead971c821a7566032b0187e339684) )
5274
5275   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
5276
5277   ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
5278   //PIC16C621A (317-5126-JPN)
5279   //(sticker 253-5509-5126J)
5280   ROM_LOAD("317-5126-jpn.pic", 0x00, 0x4000, CRC(87c44284) SHA1(a53bcead58844fb877bc657dd5b09c1a380872ee) )
5281ROM_END
5282
5283
50875284ROM_START( takoron )
50885285   NAOMIGD_BIOS
50895286   NAOMI_DEFAULT_EEPROM
r7882r7883
55525749//GDL-0009
55535750GAME( 2001, ikaruga,   naomigd,  naomigd,  naomi,    naomi,   ROT270, "Treasure",               "Ikaruga (GDL-0010)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
55545751GAME( 2002, ggxx,      naomigd,  naomigd,  naomi,    ggxx,    ROT0,   "Arc System Works",       "Guilty Gear XX (GDL-0011)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
5555//GDL-0012 Cleopatra Fortune Plus
5752GAME( 2002, cleoftp,   naomigd,  naomigd,  naomi,    naomi,   ROT0,   "Altron",                 "Cleopatra Fortune Plus (GDL-0012)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
55565753GAME( 2002, moeru,     naomigd,  naomigd,  naomi,    naomi,   ROT0,   "Altron",                 "Moeru Casinyo (GDL-0013)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
55575754//GDL-0014 Musapey's Choco Marker
55585755GAME( 2002, chocomk,   naomigd,  naomigd,  naomi,    naomi,   ROT0,   "Ecole Software",         "Musapey's Choco Marker (Rev A) (GDL-0014A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
r7882r7883
55785775//GDL-0029
55795776GAME( 2005, senko,     naomigd,  naomigd,  naomi,    naomi,   ROT0,   "G-Rev",                  "Senko No Ronde NEW ver. (Rev A) (GDL-0030A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
55805777GAME( 2005, senkoo,    senko,    naomigd,  naomi,    naomi,   ROT0,   "G-Rev",                  "Senko No Ronde (GDL-0030)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
5581//GDL-0031 Super Shanghai 2005
5582GAME( 2005, ss2005,    naomigd,  naomigd,  naomi,    naomi,   ROT0,   "Starfish",               "Super Shanghai 2005 (Rev A) (GDL-0031A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
5778GAME( 2005, ss2005,    naomigd,  naomigd,  naomi,    naomi,   ROT0,   "Starfish",               "Super Shanghai 2005 (GDL-0031)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
5779GAME( 2005, ss2005a,   ss2005,   naomigd,  naomi,    naomi,   ROT0,   "Starfish",               "Super Shanghai 2005 (Rev A) (GDL-0031A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
55835780GAME( 2005, radirgy,   naomigd,  naomigd,  naomi,    naomi,   ROT270, "Milestone",              "Radirgy (GDL-0032)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
55845781//GDL-0033 Guilty Gear XX Slash
55855782GAME( 2005, ggxxsla,   naomigd,  naomigd,  naomi,    ggxxsla, ROT0,   "Arc System Works",       "Guilty Gear XX Slash (Rev A) (GDL-0033A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
r7882r7883
55885785//GDL-0036 Trigger Heart Exelica
55895786GAME( 2005, trgheart,  naomigd,  naomigd,  naomi,    naomi,   ROT270, "Warashi",                "Trigger Heart Exelica (Rev A) (GDL-0036A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
55905787GAME( 2005, jingystm,  naomigd,  naomigd,  naomi,    naomi,   ROT0,   "Atrativa Japan",         "Jingi Storm - The Arcade (GDL-0037)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
5591//GDL-0038 Senko No Ronde Special
5788GAME( 2006, senkosp,   naomigd,  naomigd,  naomi,    naomi,   ROT0,   "G-Rev",                  "Senko No Ronde Special (GDL-0038)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
55925789GAME( 2006, meltyb,    naomigd,  naomigd,  naomi,    naomi,   ROT0,   "Ecole Software",         "Melty Blood Act Cadenza Ver B (GDL-0039)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
55935790GAME( 2006, meltyba,   meltyb,   naomigd,  naomi,    naomi,   ROT0,   "Ecole Software",         "Melty Blood Act Cadenza Ver B (Rev A) (GDL-0039A)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
55945791GAME( 2006, karous,    naomigd,  naomigd,  naomi,    naomi,   ROT270, "Milestone",              "Karous (GDL-0040)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
5595//GDL-0041 Guilty Gear XX Accent Core
5792GAME( 2006, ggxxac,    naomigd,  naomigd,  naomi,    naomi,   ROT0,   "Arc System Works",       "Guilty Gear XX Accent Core (GDL-0041)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
55965793GAME( 2006, takoron,   naomigd,  naomigd,  naomi,    naomi,   ROT0,   "Compile",                "Noukone Puzzle Takoron (GDL-0042)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
55975794
55985795
src/mame/drivers/vmetal.c
r7882r7883
5959
6060*****
6161i should fully merge video with metro.c, it uses the same imagetek chip (although with 16x16 tiles)
62this should fix most of the remaining gfx glitches
62this should fix most of the remaining gfx glitches - looks very similar to 'taidoa' (stephh)
6363*****
6464
6565
6666It has Sega and Taito logos in the roms ?!
6767
68whats going on with the dipswitches
69
7068ES8712 sound may not be quite right. Samples are currently looped, but
7169whether they should and how, is unknown.
7270
r7882r7883
9896}
9997
10098
101static READ16_HANDLER ( varia_random )
102{
103   return 0xffff;
104}
105
106
107
10899static void get_vmetal_tlookup(running_machine *machine, UINT16 data, UINT16 *tileno, UINT16 *color)
109100{
110101   metro_state *state = (metro_state *)machine->driver_data;
r7882r7883
225216   AM_RANGE(0x200000, 0x200001) AM_READ_PORT("P1_P2") AM_DEVWRITE8("essnd", vmetal_control_w, 0x00ff)
226217   AM_RANGE(0x200002, 0x200003) AM_READ_PORT("SYSTEM")
227218
228   /* i have no idea whats meant to be going on here .. it seems to read one bit of the dips from some of them, protection ??? */
229   AM_RANGE(0x30fffe, 0x30ffff) AM_READ(varia_random)  // nothing?
230   AM_RANGE(0x317ffe, 0x317fff) AM_READ(varia_random)  // nothing?
231   AM_RANGE(0x31bffe, 0x31bfff) AM_READ(varia_random)  // nothing?
232   AM_RANGE(0x31dffe, 0x31dfff) AM_READ(varia_random)  // nothing?
233   AM_RANGE(0x31effe, 0x31efff) AM_READ(varia_random)  // nothing?
234   AM_RANGE(0x31f7fe, 0x31f7ff) AM_READ(varia_random)  // nothing?
235   AM_RANGE(0x31fbfe, 0x31fbff) AM_READ(varia_random)  // nothing?
236   AM_RANGE(0x31fdfe, 0x31fdff) AM_READ(varia_random)  // nothing?
237   AM_RANGE(0x31fefe, 0x31feff) AM_READ(varia_dips_bit8_r)  // 0x40 = dip1-8 , 0x80 = dip2-8
238   AM_RANGE(0x31ff7e, 0x31ff7f) AM_READ(varia_dips_bit7_r)  // 0x40 = dip1-7 , 0x80 = dip2-7
239   AM_RANGE(0x31ffbe, 0x31ffbf) AM_READ(varia_dips_bit6_r)  // 0x40 = dip1-6 , 0x80 = dip2-6
240   AM_RANGE(0x31ffde, 0x31ffdf) AM_READ(varia_dips_bit5_r)  // 0x40 = dip1-5 , 0x80 = dip2-5
241   AM_RANGE(0x31ffee, 0x31ffef) AM_READ(varia_dips_bit4_r)  // 0x40 = dip1-4 , 0x80 = dip2-4
242   AM_RANGE(0x31fff6, 0x31fff7) AM_READ(varia_dips_bit3_r)  // 0x40 = dip1-3 , 0x80 = dip2-3
243   AM_RANGE(0x31fffa, 0x31fffb) AM_READ(varia_dips_bit2_r)  // 0x40 = dip1-2 , 0x80 = dip2-2
244   AM_RANGE(0x31fffc, 0x31fffd) AM_READ(varia_dips_bit1_r)  // 0x40 = dip1-1 , 0x80 = dip2-1
245   AM_RANGE(0x31fffe, 0x31ffff) AM_READ(varia_random )  // nothing?
219   /* same weird way to read Dip Switches as in many games in metro.c driver - use balcube_dsw_r read handler once the driver is merged */
220   AM_RANGE(0x30fffe, 0x30ffff) AM_READNOP               // 0x40 = dip1-16 -> 0xff0086 (doesn't exist in this game : address is NEVER read back)
221   AM_RANGE(0x317ffe, 0x317fff) AM_READNOP               // 0x40 = dip1-15 -> 0xff0086 (doesn't exist in this game : address is NEVER read back)
222   AM_RANGE(0x31bffe, 0x31bfff) AM_READNOP               // 0x40 = dip1-14 -> 0xff0086 (doesn't exist in this game : address is NEVER read back)
223   AM_RANGE(0x31dffe, 0x31dfff) AM_READNOP               // 0x40 = dip1-13 -> 0xff0086 (doesn't exist in this game : address is NEVER read back)
224   AM_RANGE(0x31effe, 0x31efff) AM_READNOP               // 0x40 = dip1-12 -> 0xff0086 (doesn't exist in this game : address is NEVER read back)
225   AM_RANGE(0x31f7fe, 0x31f7ff) AM_READNOP               // 0x40 = dip1-11 -> 0xff0086 (doesn't exist in this game : address is NEVER read back)
226   AM_RANGE(0x31fbfe, 0x31fbff) AM_READNOP               // 0x40 = dip1-10 -> 0xff0086 (doesn't exist in this game : address is NEVER read back)
227   AM_RANGE(0x31fdfe, 0x31fdff) AM_READNOP               // 0x40 = dip1-9  -> 0xff0086 (doesn't exist in this game : address is NEVER read back)
228   AM_RANGE(0x31fefe, 0x31feff) AM_READ(varia_dips_bit8_r)   // 0x40 = dip1-8  -> 0xff0085 , 0x80 = dip2-8 -> 0xff0084
229   AM_RANGE(0x31ff7e, 0x31ff7f) AM_READ(varia_dips_bit7_r)   // 0x40 = dip1-7  -> 0xff0085 , 0x80 = dip2-7 -> 0xff0084
230   AM_RANGE(0x31ffbe, 0x31ffbf) AM_READ(varia_dips_bit6_r)   // 0x40 = dip1-6  -> 0xff0085 , 0x80 = dip2-6 -> 0xff0084
231   AM_RANGE(0x31ffde, 0x31ffdf) AM_READ(varia_dips_bit5_r)   // 0x40 = dip1-5  -> 0xff0085 , 0x80 = dip2-5 -> 0xff0084
232   AM_RANGE(0x31ffee, 0x31ffef) AM_READ(varia_dips_bit4_r)   // 0x40 = dip1-4  -> 0xff0085 , 0x80 = dip2-4 -> 0xff0084
233   AM_RANGE(0x31fff6, 0x31fff7) AM_READ(varia_dips_bit3_r)   // 0x40 = dip1-3  -> 0xff0085 , 0x80 = dip2-3 -> 0xff0084
234   AM_RANGE(0x31fffa, 0x31fffb) AM_READ(varia_dips_bit2_r)   // 0x40 = dip1-2  -> 0xff0085 , 0x80 = dip2-2 -> 0xff0084
235   AM_RANGE(0x31fffc, 0x31fffd) AM_READ(varia_dips_bit1_r)   // 0x40 = dip1-1  -> 0xff0085 , 0x80 = dip2-1 -> 0xff0084
246236
247237   AM_RANGE(0x400000, 0x400001) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff )
248238   AM_RANGE(0x400002, 0x400003) AM_DEVWRITE8("oki", okim6295_w, 0x00ff)   // Volume/channel info
r7882r7883
252242ADDRESS_MAP_END
253243
254244
255
245/* verified from M68000 code */
256246static INPUT_PORTS_START( varia )
257247   PORT_START("P1_P2")
258   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
259   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
260   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
248   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY PORT_PLAYER(2)
249   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_PLAYER(2)
250   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_PLAYER(2)
261251   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
262252   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
263253   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
264254   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
265   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2  )
266   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
267   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
268   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
255   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 )
256   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY PORT_PLAYER(1)
257   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_PLAYER(1)
258   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_8WAY PORT_PLAYER(1)
269259   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
270260   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
271261   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
r7882r7883
275265   PORT_START("SYSTEM")
276266   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
277267   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
278   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_TILT )
279   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 )
280   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE2 ) // 'Test'
281   PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused?
268   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_TILT )             /* 'Tilt' only in "test mode" - no effect ingame */
269   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 )         /* same coinage as COIN1 and COIN2 */
270   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE2 )         /* 'Test' only in "test mode" - no effect ingame */
271   PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNUSED )
282272
273   /* stored to 0xff0085.b (cpl'ed) */
283274   PORT_START("DSW1")
284   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
275   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) )
285276   PORT_DIPSETTING(      0x0005, DEF_STR( 3C_1C )  )
286277   PORT_DIPSETTING(      0x0006, DEF_STR( 2C_1C )  )
287278   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C )  )
r7882r7883
290281   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_4C )  )
291282   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_5C )  )
292283   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C )  )
293   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
294   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
295   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
296   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
297   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
298   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
284   PORT_DIPUNUSED( 0x0008, IP_ACTIVE_LOW )                 /* 0x01 (OFF) or 0x02 (ON) written to 0xff0112.b but NEVER read back - old credits for 2 players game ? */
285   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Flip_Screen ) )  /* 0x07c1 written to 0x1788ac.w (screen control ?) at first (code at 0x0001b8) */
286   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )          /* 0x07c1 written to 0xff0114.w (then 0x1788ac.w) during initialisation (code at 0x000436) */
287   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )           /* 0x07c0 written to 0xff0114.w (then 0x1788ac.w) during initialisation (code at 0x000436) */
299288   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
300289   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
301290   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
302   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
303   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
304   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
305   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
306   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
307   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
291   PORT_DIPUNUSED( 0x0040, IP_ACTIVE_LOW )
292   PORT_DIPUNUSED( 0x0080, IP_ACTIVE_LOW )
308293
294   /* stored to 0xff0084.b (cpl'ed) */
309295   PORT_START("DSW2")
310   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ))
311   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
312   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
313   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
314   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
315   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
296   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
297   PORT_DIPSETTING(      0x0002, DEF_STR( Easy ) )
298   PORT_DIPSETTING(      0x0003, DEF_STR( Normal ) )
299   PORT_DIPSETTING(      0x0001, DEF_STR( Hard ) )
300   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
316301   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) )
317   PORT_DIPSETTING(      0x0008, "0"  )
318   PORT_DIPSETTING(      0x0004, "1"  )
319   PORT_DIPSETTING(      0x000c, "2"  )
320   PORT_DIPSETTING(      0x0000, "3"  )
321   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
322   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
323   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
324   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
325   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
326   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
327   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
328   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
329   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
302   PORT_DIPSETTING(      0x0008, "1"  )
303   PORT_DIPSETTING(      0x0004, "2"  )
304   PORT_DIPSETTING(      0x000c, "3"  )
305   PORT_DIPSETTING(      0x0000, "4"  )
306   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Bonus_Life ) )   /* code at 0x0004a4 */
307   PORT_DIPSETTING(      0x0010, "Every 30000" )
308   PORT_DIPSETTING(      0x0000, "Every 60000" )
309   PORT_DIPUNUSED( 0x0020, IP_ACTIVE_LOW )
310   PORT_DIPUNUSED( 0x0040, IP_ACTIVE_LOW )
330311   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
331312INPUT_PORTS_END
332313
r7882r7883
516497   ROM_LOAD( "7.u12", 0x00000, 0x200000, CRC(a88c52f1) SHA1(d74a5a11f84ba6b1042b33a2c156a1071b6fbfe1) )
517498ROM_END
518499
519GAME( 1995, vmetal,  0,      varia, varia, 0, ROT270, "Excellent System",                        "Varia Metal",                        GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
520GAME( 1995, vmetaln, vmetal, varia, varia, 0, ROT270, "[Excellent System] New Ways Trading Co.", "Varia Metal (New Ways Trading Co.)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
500
501GAME( 1995, vmetal,  0,      varia, varia, 0, ROT270, "Excellent System",                        "Varia Metal",                        GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
502GAME( 1995, vmetaln, vmetal, varia, varia, 0, ROT270, "[Excellent System] New Ways Trading Co.", "Varia Metal (New Ways Trading Co.)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
src/mame/drivers/meritm.c
r7882r7883
15281528   ROM_LOAD( "sc3981-0a.u51",  0x000, 0x117, CRC(4fc750d0) SHA1(d09ff7a8c66aeb5c49e9fec84bd1521e3f5d8d0a) )
15291529ROM_END
15301530
1531ROM_START( megat4tea ) /* Dallas DS1204V security key at U5 labeled 9255-50-01 U5-B-RO1 C1996 MII */
1532   ROM_REGION( 0x400000, "maincpu", 0 )
1533   ROM_LOAD( "9255-40-01_u32-r0",  0x000000, 0x100000, CRC(08b1b8fe) SHA1(c562f2e065d6d7f753f6fd1d0b8355b01cb089ec) ) /* Location U32 */
1534   ROM_LOAD( "qs9255-02_u36-r0",   0x100000, 0x80000,  CRC(57322328) SHA1(12bc604c9d34cde431ef7cd2aa33c7b12ac01833) ) /* Location U36 */
1535   ROM_RELOAD(                     0x180000, 0x80000)
1536   ROM_LOAD( "qs9255-02_u37-r0",   0x200000, 0x80000,  CRC(f2e8bb4e) SHA1(5c5475b3c176a6aca9b2c6aa4aee422675d20bd1) ) /* Location U37 */
1537   ROM_RELOAD(                     0x280000, 0x80000)
1538   ROM_LOAD( "9255-50-01_u38-r0a", 0x300000, 0x080000, CRC(abf187a5) SHA1(d4d2327b4564f3cafa2640499f8c6ae818ed04b8) ) /* Location U38, 06/06/1996 13:43:39 - Standard Version */
1539   ROM_RELOAD(                     0x380000, 0x080000 )
1540
1541   ROM_REGION( 0x8000, "user1", 0 ) // DS1644 nv ram
1542   ROM_LOAD( "mt4tea_ds1644.u31",  0x00000,  0x8000,   CRC(11e2c7ed) SHA1(99ee83410f7dbf5a259b11193829bb5c706d9fca) ) /* No actual label, so use a unique name for this set */
1543
1544   ROM_REGION( 0x1000, "user2", 0 ) // PALs
1545   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
1546   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
1547   ROM_LOAD( "sc3980.u40",     0x000, 0x117, CRC(ee0cdab5) SHA1(216fef50a8a0f6a33b704d3501a4c5c3cbac2bad) )
1548   ROM_LOAD( "sc3981-0a.u51",  0x000, 0x117, CRC(4fc750d0) SHA1(d09ff7a8c66aeb5c49e9fec84bd1521e3f5d8d0a) )
1549ROM_END
1550
15311551ROM_START( megat4st ) /* Dallas DS1204V security key at U5 labeled 9255-51-01 U5-B-RO1 C1996 MII */
15321552   ROM_REGION( 0x400000, "maincpu", 0 )
15331553   ROM_LOAD( "9255-41-01_u32-r0",  0x000000, 0x100000, CRC(f51ae565) SHA1(99c58063bfa24b4383c8b37a1eab670fa6e4c62c) ) /* Location U32 */
r7882r7883
17471767GAME( 1996, megat4a,   megat4, meritm_crt260, meritm_crt260, megat4,   ROT0, "Merit", "Megatouch IV (9255-40-01 ROD, Standard version)", GAME_IMPERFECT_GRAPHICS )
17481768GAME( 1996, megat4sn,  megat4, meritm_crt260, meritm_crt260, megat4,   ROT0, "Merit", "Super Megatouch IV (9255-41-07 ROG, New Jersey version)", GAME_IMPERFECT_GRAPHICS )
17491769GAME( 1996, megat4te,  megat4, meritm_crt260, meritm_crt260, megat4te, ROT0, "Merit", "Megatouch IV Tournament Edition (9255-50-01 ROD, Standard version)", GAME_IMPERFECT_GRAPHICS )
1770GAME( 1996, megat4tea, megat4, meritm_crt260, meritm_crt260, megat4te, ROT0, "Merit", "Megatouch IV Tournament Edition (9255-50-01 ROA, Standard version)", GAME_IMPERFECT_GRAPHICS )
17501771GAME( 1996, megat4st,  megat4, meritm_crt260, meritm_crt260, megat4st, ROT0, "Merit", "Super Megatouch IV Tournament Edition (9255-51-01 ROB, Standard version)", GAME_IMPERFECT_GRAPHICS )
17511772GAME( 1997, megat5,    0,      meritm_crt260, meritm_crt260, megat5,   ROT0, "Merit", "Megatouch 5 (9255-60-01 ROI, Standard version)", GAME_IMPERFECT_GRAPHICS )
17521773GAME( 1997, megat5a,   megat5, meritm_crt260, meritm_crt260, megat5,   ROT0, "Merit", "Megatouch 5 (9255-60-01 ROC, Standard version)", GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING )
src/mame/drivers/vsnes.c
r7882r7883
55    Portions of this code are heavily based on
66    Brad Oliver's MESS implementation of the NES.
77
8RC2C03B:
9- Duck Hunt
10- Mahjang
11- Pinball (Japan)
12- Star Luster *
13- Stroke & Match Golf (Japan)
14- Tennis
15
816RP2C04-0001:
17- Atari R.B.I. Baseball *
918- Baseball
19- Battle City *
1020- Freedom Force
1121- Gradius
1222- Hogan's Alley
1323- Mach Rider (Japan, Fighting Course)
1424- Pinball
1525- Platoon
16- Super Xevious
26- Super Skykid *
27- Super Xevious *
28- Tetris *
1729
1830RP2C04-0002:
1931- Castlevania
20- Ladies golf
2132- Mach Rider (Endurance Course)
2233- Raid on Bungeling Bay (Japan)
2334- Slalom
24- Stroke N' Match Golf
35- Soccer (Japan)
36- Stroke & Match Golf
37- Stroke & Match Golf (Ladies)
2538- Wrecking Crew
2639
2740RP2C04-0003:
28- Dr mario
29- Excite Bike
41- Balloon Fight
42- Dr. Mario
43- Excitebike
3044- Goonies
3145- Soccer
32- TKO Boxing
46- T.K.O. Boxing *
3347
3448RP2C04-0004:
3549- Clu Clu Land
36- Excite Bike (Japan)
50- Excitebike (Japan)
3751- Ice Climber
3852- Ice Climber Dual (Japan)
3953- Super Mario Bros.
4054
41RC2C03B:
42- Battle City
43- Duck Hunt
44- Mahjang
45- Pinball (Japan)
46- Rbi Baseball
47- Star Luster
48- Stroke and Match Golf (Japan)
49- Super Skykid
50- Tennis
51- Tetris
55   - Games marked with a star are compatible with multiple PPU types,
56     but you need to set dipswitches corresponding to the PPU installed
57     or else the game will display incorrect colors.
58     Here the games are listed under the PPU type that works with the
59     PPU selection dipswitches all set to OFF.
5260
5361RC2C05-01:
5462- Ninja Jajamaru Kun (Japan)
r7882r7883
6371- Top Gun
6472
6573Graphic hack games:
66- Skate Kids                                (by Two-Bit Score, 1988; hack of Vs. Super Mario Bros.)
74- Skate Kids                 (by Two-Bit Score, 1988; hack of Vs. Super Mario Bros.)
6775
6876Needed roms:
69- Babel no Tou                              (by Namco, 1986)
70- Family Boxing                             (by Namco/Woodplace, 1987)
71- Family Stadium '87                        (by Namco, 1987)
72- Family Stadium '88                        (by Namco, 1988)
73- Family Tennis                             (by Namco, 1987)
74- Head to Head Baseball                     (ever finished/released?, by Nintendo, 1986)
75- Lionex                                    (prototype by Sunsoft, 1987)
76- Madura no Tsubasa                         (prototype by Sunsoft, 1987)
77- Predators                                 (prototype by Williams, 1984)
78- Pro Yakyuu Family Stadium                 (by Namco, 1986)
79- Quest of Ki                               (by Namco/Game Studio, 1988)
80- Super Chinese                             (by Namco/Culture Brain, 1988)
81- Toukaidou 53tsugi                         (prototype by Sunsoft, 1985)
82- Trojan                                    (by Capcom, 1987)
83- Urban Champion                            (1984)
84- Volleyball                                (1986)
85- Walkure no Bouken                         (by Namco, 1986)
86- Wild Gunman                               (1984, light gun game)
77- Babel no Tou               (by Namco, 1986)
78- Family Boxing              (by Namco/Woodplace, 1987; Japan version of TKO Boxing)
79- Family Stadium '87         (by Namco, 1987; sequel to RBI Baseball)
80- Family Stadium '88         (by Namco, 1988; sequel to RBI Baseball)
81- Family Tennis              (by Namco, 1987)
82- Head to Head Baseball      (ever finished/released?, by Nintendo, 1986)
83- Lionex                     (prototype by Sunsoft, 1987)
84- Madura no Tsubasa          (prototype by Sunsoft, 1987)
85- Predators                  (prototype by Williams, 1984)
86- Pro Yakyuu Family Stadium  (by Namco, 1986; Japan version of RBI Baseball)
87- Quest of Ki                (by Namco/Game Studio, 1988)
88- Super Chinese              (by Namco/Culture Brain, 1988)
89- Toukaidou 53tsugi          (prototype by Sunsoft, 1985)
90- Trojan                     (by Capcom, 1987)
91- Urban Champion             (1984)
92- Volleyball                 (1986)
93- Walkure no Bouken          (by Namco, 1986)
94- Wild Gunman                (1984, light gun game)
8795
8896TO DO:
97    - Merge mapper implementations in machine/vsnes.c with playch10 and MESS NES
8998    - Check others bits in coin counter
9099    - Check other values in bnglngby irq
91100    - Top Gun: cpu #0 (PC=00008016): unmapped memory byte read from 00007FFF ???
r7882r7883
136145#include "sound/nes_apu.h"
137146#include "includes/vsnes.h"
138147
139#define DUAL_RBI 1
140
141148/******************************************************************************/
142149
143150/* local stuff */
r7882r7883
231238
232239
233240static INPUT_PORTS_START( vsnes )
234   PORT_START("IN0")   /* IN0 */
241   PORT_START("IN0")
235242   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)   /* BUTTON A on a nes */
236243   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)   /* BUTTON B on a nes */
237244   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )            /* SELECT on a nes */
r7882r7883
241248   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
242249   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
243250
244   PORT_START("IN1")   /* IN1 */
251   PORT_START("IN1")
245252   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)   /* BUTTON A on a nes */
246253   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)   /* BUTTON B on a nes */
247254   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 )            /* SELECT on a nes */
r7882r7883
251258   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
252259   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
253260
254   PORT_START("COINS")   /* IN2 */
261   PORT_START("COINS")
255262   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* serial pin from controller */
256263   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
257264   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) /* service credit? */
r7882r7883
267274static INPUT_PORTS_START( vsnes_rev )
268275   PORT_INCLUDE( vsnes )
269276
270   PORT_MODIFY("IN0")   /* IN0 */
277   PORT_MODIFY("IN0")
271278   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)   /* BUTTON A on a nes */
272279   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)   /* BUTTON B on a nes */
273280   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
r7882r7883
275282   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
276283   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
277284
278   PORT_MODIFY("IN1")   /* IN1 */
285   PORT_MODIFY("IN1")
279286   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)   /* BUTTON A on a nes */
280287   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)   /* BUTTON B on a nes */
281288   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
r7882r7883
286293
287294static INPUT_PORTS_START( vsnes_dual )
288295   /* Left Side Controls */
289   PORT_START("IN0")   /* IN0 */
296   PORT_START("IN0")
290297   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)   /* BUTTON A on a nes */
291298   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)   /* BUTTON B on a nes */
292299   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )            /* SELECT on a nes */
r7882r7883
296303   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
297304   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
298305
299   PORT_START("IN1")   /* IN1 */
306   PORT_START("IN1")
300307   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)   /* BUTTON A on a nes */
301308   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)   /* BUTTON B on a nes */
302309   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 )            /* SELECT on a nes */
r7882r7883
306313   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
307314   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
308315
309   PORT_START("COINS")   /* IN2 */
316   PORT_START("COINS")
310317   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* serial pin from controller */
311318   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
312319   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) /* service credit? */
r7882r7883
317324   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) /* this bit masks irqs - dont change */
318325
319326   /* Right Side Controls */
320   PORT_START("IN2")   /* IN3 */
327   PORT_START("IN2")
321328   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3)   /* BUTTON A on a nes */
322329   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3)   /* BUTTON B on a nes */
323330   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("2nd Side 1 Player Start") PORT_CODE(KEYCODE_MINUS)   /* SELECT on a nes */
r7882r7883
327334   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
328335   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
329336
330   PORT_START("IN3")   /* IN4 */
337   PORT_START("IN3")
331338   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4)   /* BUTTON A on a nes */
332339   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4)   /* BUTTON B on a nes */
333340   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("2nd Side 2 Player Start") PORT_CODE(KEYCODE_EQUALS) /* SELECT on a nes */
r7882r7883
337344   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
338345   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
339346
340   PORT_START("COINS2")   /* IN5 */
347   PORT_START("COINS2")
341348   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* serial pin from controller */
342349   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
343350   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_IMPULSE(1) /* service credit? */
r7882r7883
353360static INPUT_PORTS_START( vsnes_dual_rev )
354361   PORT_INCLUDE( vsnes_dual )
355362
356   PORT_MODIFY("IN0")   /* IN0 */
363   PORT_MODIFY("IN0")
357364   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)   /* BUTTON A on a nes */
358365   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)   /* BUTTON B on a nes */
359366   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
r7882r7883
361368   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
362369   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
363370
364   PORT_MODIFY("IN1")   /* IN1 */
371   PORT_MODIFY("IN1")
365372   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)   /* BUTTON A on a nes */
366373   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)   /* BUTTON B on a nes */
367374   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
r7882r7883
369376   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
370377   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
371378
372   PORT_MODIFY("IN2")   /* IN3 */
379   PORT_MODIFY("IN2")
373380   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4)   /* BUTTON A on a nes */
374381   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4)   /* BUTTON B on a nes */
375382   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
r7882r7883
377384   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
378385   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
379386
380   PORT_MODIFY("IN3")   /* IN4 */
387   PORT_MODIFY("IN3")
381388   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3)   /* BUTTON A on a nes */
382389   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3)   /* BUTTON B on a nes */
383390   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
r7882r7883
387394INPUT_PORTS_END
388395
389396static INPUT_PORTS_START( vsnes_zapper )
390   PORT_START("IN0")   /* IN0 */
397   PORT_START("IN0")
391398   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
392399   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
393400   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
r7882r7883
397404   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )   /* sprite hit */
398405   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 )   /* gun trigger */
399406
400   PORT_START("IN1")   /* IN1 */
407   PORT_START("IN1")
401408   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
402409   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
403410   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
r7882r7883
407414   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
408415   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
409416
410   PORT_START("COINS")   /* IN2 */
417   PORT_START("COINS")
411418   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* serial pin from controller */
412419   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
413420   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1) /* service credit? */
r7882r7883
417424   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1)
418425   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
419426
420   PORT_START("GUNX")   /* IN4 - FAKE - Gun X pos */
427   PORT_START("GUNX")   /* FAKE - Gun X pos */
421428   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(30)
422429
423   PORT_START("GUNY")   /* IN5 - FAKE - Gun Y pos */
430   PORT_START("GUNY")   /* FAKE - Gun Y pos */
424431   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(30)
425432INPUT_PORTS_END
426433
r7882r7883
428435static INPUT_PORTS_START( topgun )
429436   PORT_INCLUDE( vsnes )
430437
431   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
438   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
432439   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
433440   PORT_DIPSETTING(   0x03, DEF_STR( 5C_1C ) )
434441   PORT_DIPSETTING(   0x05, DEF_STR( 4C_1C ) )
r7882r7883
457464static INPUT_PORTS_START( platoon )
458465   PORT_INCLUDE( vsnes )
459466
460   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
467   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
461468   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
462469   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
463470   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
r7882r7883
503510static INPUT_PORTS_START( golf )
504511   PORT_INCLUDE( vsnes_rev )
505512
506   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
513   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
507514   PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) )
508515   PORT_DIPSETTING(   0x07, DEF_STR( 4C_1C ) )
509516   PORT_DIPSETTING(   0x03, DEF_STR( 3C_1C ) )
r7882r7883
543550static INPUT_PORTS_START( vstennis )
544551   PORT_INCLUDE( vsnes_dual )
545552
546   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
553   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
547554   PORT_DIPNAME( 0x03, 0x00, "Difficulty Vs. Computer" )
548555   PORT_DIPSETTING(   0x00, DEF_STR( Easy ) )
549556   PORT_DIPSETTING(   0x02, DEF_STR( Normal ) )
r7882r7883
593600static INPUT_PORTS_START( wrecking )
594601   PORT_INCLUDE( vsnes_dual )
595602
596   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
603   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
597604   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
598605   PORT_DIPSETTING(   0x00, "3" )
599606   PORT_DIPSETTING(   0x02, "4" )
r7882r7883
618625   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
619626   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
620627
621   PORT_START("DSW1")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
628   PORT_START("DSW1")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
622629   PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) )
623630   PORT_DIPSETTING(   0x07, DEF_STR( 4C_1C ) )
624631   PORT_DIPSETTING(   0x03, DEF_STR( 3C_1C ) )
r7882r7883
648655static INPUT_PORTS_START( balonfgt )
649656   PORT_INCLUDE( vsnes_dual )
650657
651   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
658   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
652659   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
653660   PORT_DIPSETTING(   0x03, DEF_STR( 4C_1C ) )
654661   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
r7882r7883
672679   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
673680   PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
674681
675   PORT_START("DSW1")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
682   PORT_START("DSW1")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
676683   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
677684   PORT_DIPSETTING(   0x00, "3" )
678685   PORT_DIPSETTING(   0x02, "4" )
r7882r7883
701708static INPUT_PORTS_START( vsmahjng )
702709   PORT_INCLUDE( vsnes_dual )
703710
704   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
711   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
705712   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
706713   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
707714   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
r7882r7883
726733   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
727734   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
728735
729   PORT_START("DSW1")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
736   PORT_START("DSW1")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
730737   PORT_SERVICE( 0x01, IP_ACTIVE_HIGH )
731738   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
732739   PORT_DIPSETTING(   0x02, DEF_STR( 2C_1C ) )
r7882r7883
752759static INPUT_PORTS_START( vsbball )
753760   PORT_INCLUDE( vsnes_dual )
754761
755   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
762   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
756763   PORT_SERVICE( 0x01, IP_ACTIVE_HIGH )
757764   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
758765   PORT_DIPSETTING(   0x02, DEF_STR( 2C_1C ) )
r7882r7883
775782   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
776783   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
777784
778   PORT_START("DSW1")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
785   PORT_START("DSW1")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
779786   PORT_DIPNAME( 0x03, 0x02, "Player Defense Strenght" )
780787   PORT_DIPSETTING(   0x00, "Weak" )
781788   PORT_DIPSETTING(   0x02, DEF_STR( Normal ) )
r7882r7883
801808static INPUT_PORTS_START( vsbballj )
802809   PORT_INCLUDE( vsnes_dual )
803810
804   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
811   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
805812   PORT_DIPNAME( 0x03, 0x02, "Player Defense Strenght" )
806813   PORT_DIPSETTING(   0x00, "Weak" )
807814   PORT_DIPSETTING(   0x02, DEF_STR( Normal ) )
r7882r7883
823830   PORT_DIPSETTING(   0x40, "Strong" )
824831   PORT_DIPSETTING(   0xc0, "Very Strong" )
825832
826   PORT_START("DSW1")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
833   PORT_START("DSW1")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
827834   PORT_SERVICE( 0x01, IP_ACTIVE_HIGH )
828835   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
829836   PORT_DIPSETTING(   0x02, DEF_STR( 2C_1C ) )
r7882r7883
851858static INPUT_PORTS_START( iceclmrj )
852859   PORT_INCLUDE( vsnes_dual_rev )
853860
854   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
861   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
855862   PORT_DIPNAME( 0x07, 0x00, "Coinage (Left Side)" )
856863   PORT_DIPSETTING(   0x03, DEF_STR( 4C_1C ) )
857864   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
r7882r7883
876883   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
877884   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
878885
879   PORT_START("DSW1")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
886   PORT_START("DSW1")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
880887   PORT_DIPNAME( 0x07, 0x00, "Coinage (Right Side)" )
881888   PORT_DIPSETTING(   0x03, DEF_STR( 4C_1C ) )
882889   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
r7882r7883
905912static INPUT_PORTS_START( drmario )
906913   PORT_INCLUDE( vsnes_rev )
907914
908   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
915   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
909916   PORT_DIPNAME( 0x03, 0x00, "Drop Rate Increases After" )
910917   PORT_DIPSETTING(   0x00, "7 Pills" )
911918   PORT_DIPSETTING(   0x01, "8 Pills" )
r7882r7883
932939static INPUT_PORTS_START( rbibb )
933940   PORT_INCLUDE( vsnes_rev )
934941
935   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
942   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
936943   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
937944   PORT_DIPSETTING(   0x03, DEF_STR( 3C_1C ) )
938945   PORT_DIPSETTING(   0x02, DEF_STR( 2C_1C ) )
r7882r7883
946953   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) )
947954   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
948955   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
949   PORT_DIPNAME( 0xe0, 0x80, "Color Palette" )
950   PORT_DIPSETTING(   0x80, DEF_STR( Normal ) )
951   PORT_DIPSETTING(    0x00, "Wrong 1" )
952   PORT_DIPSETTING(    0x40, "Wrong 2" )
953   PORT_DIPSETTING(    0x20, "Wrong 3" )
954   PORT_DIPSETTING(    0xc0, "Wrong 4" )
955   /* 0x60,0xa0,0xe0:again "Wrong 3" */
956   PORT_DIPNAME( 0xe0, 0x00, "PPU Type" )
957   PORT_DIPSETTING(   0x00, "RP2C04-0001" )
958   PORT_DIPSETTING(    0x20, "RP2C03" )
959   PORT_DIPSETTING(   0x40, "RP2C04-0002" )
960//  PORT_DIPSETTING(    0x60, "RP2C03" )
961   PORT_DIPSETTING(   0x80, "RP2C04-0003" )
962//  PORT_DIPSETTING(    0xa0, "RP2C03" )
963   PORT_DIPSETTING(   0xc0, "RP2C04-0004" )
964//  PORT_DIPSETTING(    0xe0, "RP2C03" )
956965INPUT_PORTS_END
957966
958967static INPUT_PORTS_START( btlecity )
959968   PORT_INCLUDE( vsnes_rev )
960969
961   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
970   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
962971   PORT_DIPNAME( 0x01, 0x01, "Credits for 2 Players" )
963972   PORT_DIPSETTING(   0x00, "1" )
964973   PORT_DIPSETTING(   0x01, "2" )
r7882r7883
977986   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
978987   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
979988   PORT_DIPSETTING(   0x20, DEF_STR( On ) )
980   PORT_DIPNAME( 0xc0, 0x80, "Color Palette" )
981   PORT_DIPSETTING(   0x80, DEF_STR( Normal ) )
982   PORT_DIPSETTING(   0x00, "Wrong 1" )
983   PORT_DIPSETTING(   0x40, "Wrong 2" )
984   PORT_DIPSETTING(   0xc0, "Wrong 3" )
989   PORT_DIPNAME( 0xc0, 0x00, "PPU Type" )
990   PORT_DIPSETTING(   0x00, "RP2C04-0001" )
991   PORT_DIPSETTING(   0x40, "RP2C04-0002" )
992   PORT_DIPSETTING(   0x80, "RP2C04-0003" )
993   PORT_DIPSETTING(   0xc0, "RP2C04-0004" )
985994INPUT_PORTS_END
986995
987996static INPUT_PORTS_START( cluclu )
988997   PORT_INCLUDE( vsnes_rev )
989998
990   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
999   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
9911000   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
9921001   PORT_DIPSETTING(   0x03, DEF_STR( 4C_1C ) )
9931002   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
r7882r7883
10161025static INPUT_PORTS_START( cstlevna )
10171026   PORT_INCLUDE( vsnes )
10181027
1019   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1028   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
10201029   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
10211030   PORT_DIPSETTING(   0x03, DEF_STR( 5C_1C ) )
10221031   PORT_DIPSETTING(   0x05, DEF_STR( 4C_1C ) )
r7882r7883
10451054static INPUT_PORTS_START( iceclimb )
10461055   PORT_INCLUDE( vsnes_rev )
10471056
1048   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1057   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
10491058   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
10501059   PORT_DIPSETTING(   0x03, DEF_STR( 4C_1C ) )
10511060   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
r7882r7883
10901099static INPUT_PORTS_START( excitebk )
10911100   PORT_INCLUDE( vsnes )
10921101
1093   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1102   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
10941103   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
10951104   PORT_DIPSETTING(   0x03, DEF_STR( 4C_1C ) )
10961105   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
r7882r7883
11301139   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
11311140   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
11321141
1133   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1142   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
11341143   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
11351144   PORT_DIPSETTING(   0x03, DEF_STR( 4C_1C ) )
11361145   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
r7882r7883
11581167static INPUT_PORTS_START( machridr )
11591168   PORT_INCLUDE( vsnes )
11601169
1161   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1170   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
11621171   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
11631172   PORT_DIPSETTING(   0x03, DEF_STR( 4C_1C ) )
11641173   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
r7882r7883
12001209   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
12011210   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
12021211
1203   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1212   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
12041213   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
12051214   PORT_DIPSETTING(   0x03, DEF_STR( 4C_1C ) )
12061215   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
r7882r7883
12271236static INPUT_PORTS_START( suprmrio )
12281237   PORT_INCLUDE( vsnes )
12291238
1230   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1239   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
12311240   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
12321241   PORT_DIPSETTING(   0x02, DEF_STR( 3C_1C ) )
12331242   PORT_DIPSETTING(   0x04, DEF_STR( 2C_1C ) )
r7882r7883
13711380static INPUT_PORTS_START( vstetris )
13721381   PORT_INCLUDE( vsnes_rev )
13731382
1374   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1383   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
13751384   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
13761385   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
13771386   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
r7882r7883
13861395   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
13871396   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
13881397   PORT_DIPSETTING(   0x10, DEF_STR( On ) )
1389   PORT_DIPNAME( 0xe0, 0x80, "Color Palette" )
1390   PORT_DIPSETTING(   0x80, DEF_STR( Normal ) )
1391   PORT_DIPSETTING(   0x00, "Wrong 1" )
1392   PORT_DIPSETTING(   0x40, "Wrong 2" )
1393   PORT_DIPSETTING(   0x20, "Wrong 3" )
1394   PORT_DIPSETTING(   0xc0, "Wrong 4" )
1395   /* 0x60,0xa0,0xe0:again "Wrong 3" */
1398   PORT_DIPNAME( 0xe0, 0x00, "PPU Type" )
1399   PORT_DIPSETTING(   0x00, "RP2C04-0001" )
1400   PORT_DIPSETTING(    0x20, "RP2C03" )
1401   PORT_DIPSETTING(   0x40, "RP2C04-0002" )
1402//  PORT_DIPSETTING(    0x60, "RP2C03" )
1403   PORT_DIPSETTING(   0x80, "RP2C04-0003" )
1404//  PORT_DIPSETTING(    0xa0, "RP2C03" )
1405   PORT_DIPSETTING(   0xc0, "RP2C04-0004" )
1406//  PORT_DIPSETTING(    0xe0, "RP2C03" )
13961407INPUT_PORTS_END
13971408
13981409/* P2 Start is a different bit */
r7882r7883
14051416   PORT_MODIFY("IN1")
14061417   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )            /* SELECT on a nes */
14071418
1408   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1419   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
14091420   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Difficulty ) )
14101421   PORT_DIPSETTING(   0x00, DEF_STR( Easy ) )
14111422   PORT_DIPSETTING(   0x01, DEF_STR( Normal ) )
r7882r7883
14191430   PORT_DIPSETTING(   0x10, DEF_STR( 2C_1C ) )
14201431   PORT_DIPSETTING(   0x00, DEF_STR( 1C_1C ) )
14211432   PORT_DIPSETTING(   0x08, DEF_STR( 1C_2C ) )
1422   PORT_DIPNAME( 0xe0, 0x20, "Color Palette" ) // marked as MUST BE OFF
1423   PORT_DIPSETTING(   0x20, DEF_STR( Normal ) )
1424   PORT_DIPSETTING(    0x00, "Wrong 1" )
1425   PORT_DIPSETTING(   0x40, "Wrong 2" )
1426   PORT_DIPSETTING(   0x80, "Wrong 3" )
1427   PORT_DIPSETTING(    0xc0, "Wrong 4" )
1428   /* 0x60,0xa0,0xe0:again DEF_STR( Normal ) */
1433   PORT_DIPNAME( 0xe0, 0x00, "PPU Type" )
1434   PORT_DIPSETTING(   0x00, "RP2C04-0001" )
1435   PORT_DIPSETTING(    0x20, "RP2C03" )
1436   PORT_DIPSETTING(   0x40, "RP2C04-0002" )
1437//  PORT_DIPSETTING(    0x60, "RP2C03" )
1438   PORT_DIPSETTING(   0x80, "RP2C04-0003" )
1439//  PORT_DIPSETTING(    0xa0, "RP2C03" )
1440   PORT_DIPSETTING(   0xc0, "RP2C04-0004" )
1441//  PORT_DIPSETTING(    0xe0, "RP2C03" )
14291442INPUT_PORTS_END
14301443
14311444static INPUT_PORTS_START( vspinbal )
14321445   PORT_INCLUDE( vsnes )
14331446
1434   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1447   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
14351448   PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) )
14361449   PORT_DIPSETTING(   0x07, DEF_STR( 4C_1C ) )
14371450   PORT_DIPSETTING(   0x03, DEF_STR( 3C_1C ) )
r7882r7883
14761489static INPUT_PORTS_START( goonies )
14771490   PORT_INCLUDE( vsnes )
14781491
1479   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1492   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
14801493   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
14811494   PORT_DIPSETTING(   0x03, DEF_STR( 5C_1C ) )
14821495   PORT_DIPSETTING(   0x05, DEF_STR( 4C_1C ) )
r7882r7883
15051518static INPUT_PORTS_START( vssoccer )
15061519   PORT_INCLUDE( vsnes_rev )
15071520
1508   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1521   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
15091522   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
15101523   PORT_DIPSETTING(   0x03, DEF_STR( 4C_1C ) )
15111524   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
r7882r7883
15331546static INPUT_PORTS_START( vsgradus )
15341547   PORT_INCLUDE( vsnes_rev )
15351548
1536   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1549   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
15371550   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
15381551   PORT_DIPSETTING(   0x03, DEF_STR( 5C_1C ) )
15391552   PORT_DIPSETTING(   0x05, DEF_STR( 4C_1C ) )
r7882r7883
15621575static INPUT_PORTS_START( vsslalom )
15631576   PORT_INCLUDE( vsnes )
15641577
1565   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1578   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
15661579   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
15671580   PORT_DIPSETTING(   0x03, DEF_STR( 5C_1C ) )
15681581   PORT_DIPSETTING(   0x05, DEF_STR( 4C_1C ) )
r7882r7883
16061619   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
16071620   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
16081621   PORT_DIPSETTING(   0x10, DEF_STR( On ) )
1609   PORT_DIPNAME( 0x60, 0x40, "Palette Color" )
1610   PORT_DIPSETTING(   0x40, "Black" )
1611   PORT_DIPSETTING(   0x20, "Green" )
1612   PORT_DIPSETTING(   0x60, "Grey" )
1613   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1614   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1615   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
1622   PORT_DIPNAME( 0xe0, 0x00, "PPU Type" )
1623   PORT_DIPSETTING(   0x00, "RP2C03" )
1624   PORT_DIPSETTING(    0x20, "RP2C04-0001" )
1625//  PORT_DIPSETTING(    0x40, "RP2C03" )
1626   PORT_DIPSETTING(   0x60, "RP2C04-0002" )
1627//  PORT_DIPSETTING(    0x80, "RP2C03" )
1628   PORT_DIPSETTING(    0xa0, "RP2C04-0003" )
1629//  PORT_DIPSETTING(    0xc0, "RP2C03" )
1630   PORT_DIPSETTING(   0xe0, "RP2C04-0004" )
16161631
16171632   PORT_START("DSW1")   /* no DSW1? */
16181633   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
r7882r7883
16211636static INPUT_PORTS_START( tkoboxng )
16221637   PORT_INCLUDE( vsnes )
16231638
1624   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1639   PORT_MODIFY("COINS")   /* IN2 */
1640   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* service credit? */
1641   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
1642   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
1643
1644   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
16251645   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
16261646   PORT_DIPSETTING(   0x03, DEF_STR( 3C_1C ) )
16271647   PORT_DIPSETTING(   0x02, DEF_STR( 2C_1C ) )
r7882r7883
16361656   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
16371657   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
16381658   PORT_DIPSETTING(   0x10, DEF_STR( On ) )
1639   PORT_DIPNAME( 0x20, 0x00, "Palette Color" )
1640   PORT_DIPSETTING(   0x00, "Black" )
1641   PORT_DIPSETTING(   0x20, "White" )
1642   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1643   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1644   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
1645   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1646   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1647   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
1659   PORT_DIPNAME( 0xe0, 0x00, "PPU Type" )
1660   PORT_DIPSETTING(   0x00, "RP2C04-0003" )
1661//  PORT_DIPSETTING(    0x20, "RP2C03" )
1662//  PORT_DIPSETTING(    0x40, "RP2C03" )
1663//  PORT_DIPSETTING(    0x60, "RP2C03" )
1664//  PORT_DIPSETTING(    0x80, "RP2C03" )
1665//  PORT_DIPSETTING(    0xa0, "RP2C03" )
1666//  PORT_DIPSETTING(    0xc0, "RP2C03" )
1667   PORT_DIPSETTING(   0xe0, "RP2C03" )
16481668INPUT_PORTS_END
16491669
16501670static INPUT_PORTS_START( bnglngby )
r7882r7883
16621682   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
16631683   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_SPECIAL )
16641684
1665   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1685   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
16661686   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
16671687   PORT_DIPSETTING(   0x03, DEF_STR( 4C_1C ) )
16681688   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
r7882r7883
16891709static INPUT_PORTS_START( mightybj )
16901710   PORT_INCLUDE( vsnes )
16911711
1692   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1712   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
16931713   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
16941714   PORT_DIPSETTING(   0x07, DEF_STR( 5C_1C ) )
16951715   PORT_DIPSETTING(   0x03, DEF_STR( 4C_1C ) )
r7882r7883
17261746   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
17271747   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
17281748
1729   PORT_START("DSW0")   /* DSW0 - bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
1749   PORT_START("DSW0")   /* bit 0 and 1 read from bit 3 and 4 on $4016, rest of the bits read on $4017 */
17301750   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
17311751   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
17321752   PORT_DIPSETTING(   0x01, DEF_STR( On ) )
r7882r7883
17441764   PORT_DIPSETTING(   0x20, DEF_STR( 2C_1C ) )
17451765   PORT_DIPSETTING(   0x00, DEF_STR( 1C_1C ) )
17461766   PORT_DIPSETTING(   0x10, DEF_STR( 1C_2C ) )
1747   PORT_DIPNAME( 0xc0, 0x00, "Color Palette" )
1748   PORT_DIPSETTING(   0x00, DEF_STR( Normal ) )
1749   PORT_DIPSETTING(    0x40, "Wrong 1" )
1750   PORT_DIPSETTING(    0x80, "Wrong 2" )
1751   PORT_DIPSETTING(    0xc0, "Wrong 3" )
1767   PORT_DIPNAME( 0xc0, 0x00, "PPU Type" )
1768   PORT_DIPSETTING(   0x00, "RP2C04-0001" )
1769   PORT_DIPSETTING(   0x40, "RP2C04-0002" )
1770   PORT_DIPSETTING(   0x80, "RP2C04-0003" )
1771   PORT_DIPSETTING(   0xc0, "RP2C04-0004" )
17521772INPUT_PORTS_END
17531773
17541774static const nes_interface nes_interface_1 =
r7882r7883
17961816   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
17971817MACHINE_DRIVER_END
17981818
1819static MACHINE_DRIVER_START( jajamaru )
1820   MDRV_IMPORT_FROM( vsnes )
17991821
1822   MDRV_DEVICE_REMOVE( "ppu1" )
1823   MDRV_PPU2C05_01_ADD("ppu1", vsnes_ppu_interface_1)
1824MACHINE_DRIVER_END
1825
1826static MACHINE_DRIVER_START( mightybj )
1827   MDRV_IMPORT_FROM( vsnes )
1828
1829   MDRV_DEVICE_REMOVE( "ppu1" )
1830   MDRV_PPU2C05_02_ADD("ppu1", vsnes_ppu_interface_1)
1831MACHINE_DRIVER_END
1832
1833static MACHINE_DRIVER_START( vsgshoe )
1834   MDRV_IMPORT_FROM( vsnes )
1835
1836   MDRV_DEVICE_REMOVE( "ppu1" )
1837   MDRV_PPU2C05_03_ADD("ppu1", vsnes_ppu_interface_1)
1838MACHINE_DRIVER_END
1839
1840static MACHINE_DRIVER_START( topgun )
1841   MDRV_IMPORT_FROM( vsnes )
1842
1843   MDRV_DEVICE_REMOVE( "ppu1" )
1844   MDRV_PPU2C05_04_ADD("ppu1", vsnes_ppu_interface_1)
1845MACHINE_DRIVER_END
1846
18001847static MACHINE_DRIVER_START( vsdual )
18011848
18021849   /* basic machine hardware */
r7882r7883
18531900
18541901/******************************************************************************/
18551902
1903/*  Palettes were obtained for each RGB PPU type by running a test program
1904    that fills the screen with a single color and analyzing the RGB output.
1905    The output of every PPU neatly quantizes to 8 levels, so the palettes
1906    are assumed to be stored using 3 bits per component in an internal ROM
1907    on each PPU.
1908*/
1909
1910#define PALETTE_STANDARD   \
1911   ROM_REGION( 0xc0, "palette", 0 )   \
1912   ROM_LOAD( "rp2c0x.pal", 0x00, 0xc0, CRC(48de65dc) SHA1(d10acafc8da9ff479c270ec01180cca61efe62f5) )
1913
1914#define PALETTE_2C04_0001   \
1915   ROM_REGION( 0xc0, "palette", 0 )   \
1916   ROM_LOAD( "rp2c04-0001.pal", 0x00, 0xc0, CRC(a6293faa) SHA1(190a410a3d818e124b2b9d2ef9fb3da003bb5d4c) )
1917
1918#define PALETTE_2C04_0002   \
1919   ROM_REGION( 0xc0, "palette", 0 )   \
1920   ROM_LOAD( "rp2c04-0002.pal", 0x00, 0xc0, CRC(fd19ae5e) SHA1(8ed14347c5a0b1a8a4d6365d6727e0951a00131c) )
1921
1922#define PALETTE_2C04_0003   \
1923   ROM_REGION( 0xc0, "palette", 0 )   \
1924   ROM_LOAD( "rp2c04-0003.pal", 0x00, 0xc0, CRC(fd6c578b) SHA1(653182ce0cbaff66a8fc5788e32cc088b6735f2e) )
1925
1926#define PALETTE_2C04_0004   \
1927   ROM_REGION( 0xc0, "palette", 0 )   \
1928   ROM_LOAD( "rp2c04-0004.pal", 0x00, 0xc0, CRC(0c2e8e4d) SHA1(0f9090225eb1f08ae5072d40af3e95547cbce05f) )
1929
18561930/*  correct label format. revision number is stamped(red), other letters are printed(black)
18571931    game code in line 1, ROM position in line 2
18581932    i.e.
r7882r7883
18601934    1B or 6B e
18611935*/
18621936
1863
18641937ROM_START( suprmrio )
18651938   ROM_REGION( 0x10000,"maincpu", 0 ) /* 6502 memory */
18661939   ROM_LOAD( "mds-sm4.1d",  0x8000, 0x2000, CRC(be4d5436) SHA1(08162a7c987f1939d09bebdb676f596c86abf465) )
r7882r7883
18711944   ROM_REGION( 0x4000,"gfx1", 0  ) /* PPU memory */
18721945   ROM_LOAD( "mds-sm4.2b",  0x0000, 0x2000, CRC(42418d40) SHA1(22ab61589742cfa4cc6856f7205d7b4b8310bc4d) )
18731946   ROM_LOAD( "mds-sm4.2a",  0x2000, 0x2000, CRC(15506b86) SHA1(69ecf7a3cc8bf719c1581ec7c0d68798817d416f) )
1947
1948   PALETTE_2C04_0004
18741949ROM_END
18751950
18761951ROM_START( suprmrioa )
r7882r7883
18831958   ROM_REGION( 0x4000,"gfx1", 0  ) /* PPU memory */
18841959   ROM_LOAD( "mds-sm4.2b",  0x0000, 0x2000, CRC(42418d40) SHA1(22ab61589742cfa4cc6856f7205d7b4b8310bc4d) )
18851960   ROM_LOAD( "mds-sm4.2a",  0x2000, 0x2000, CRC(15506b86) SHA1(69ecf7a3cc8bf719c1581ec7c0d68798817d416f) )
1961
1962   PALETTE_2C04_0004
18861963ROM_END
18871964
18881965/* I don't know what the Z80 is for on these (located top-left of the PCB with rom 1) */
r7882r7883
19001977   ROM_REGION( 0x4000,"gfx1", 0  ) /* PPU memory */
19011978   ROM_LOAD( "2-2764.bin",  0x0000, 0x2000, CRC(42418d40) SHA1(22ab61589742cfa4cc6856f7205d7b4b8310bc4d) )
19021979   ROM_LOAD( "5-2764.bin",  0x2000, 0x2000, CRC(15506b86) SHA1(69ecf7a3cc8bf719c1581ec7c0d68798817d416f) )
1980
1981   PALETTE_2C04_0004
19031982ROM_END
19041983
19051984ROM_START( suprmriobl )
r7882r7883
19292008   ROM_LOAD( "pal16r6.5",  0x000, 0x104, CRC(ceff7c7c) SHA1(52fd344c591478469369cd0862d1facfe23e12fb) )
19302009   ROM_LOAD( "pal16r8.6",  0x000, 0x104, CRC(bd76fb53) SHA1(2d0634e8edb3289a103719466465e9777606086e) )
19312010   ROM_LOAD( "pal16r8a.7", 0x000, 0x104, CRC(bd76fb53) SHA1(2d0634e8edb3289a103719466465e9777606086e) )
2011
2012   PALETTE_2C04_0004
19322013ROM_END
19332014
19342015ROM_START( skatekds )
r7882r7883
19412022   ROM_REGION( 0x4000,"gfx1", 0  ) /* PPU memory */
19422023   ROM_LOAD( "mds-sm4.2b",  0x0000, 0x2000,CRC(f3980303) SHA1(b9a25c906d1861c89e2e40e878a34d318daf6619) )
19432024   ROM_LOAD( "mds-sm4.2a",  0x2000, 0x2000,CRC(7a0ab7eb) SHA1(b6c32791481fafddc8504adb4eaed30a2fb3a03e) )
2025
2026   PALETTE_2C04_0004
19442027ROM_END
19452028
19462029ROM_START( iceclimb )
r7882r7883
19532036   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
19542037   ROM_LOAD( "ic-2b",  0x0000, 0x2000, CRC(331460b4) SHA1(4cf94d711cdb5715d14f1ab3cadec245e0adfb1e) )
19552038   ROM_LOAD( "ic-2a",  0x2000, 0x2000, CRC(4ec44fb3) SHA1(676e0ab574dec08df562c6f278e8a9cc7c8afa41) )
2039
2040   PALETTE_2C04_0004
19562041ROM_END
19572042
19582043ROM_START( iceclimbj )
r7882r7883
19652050   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
19662051   ROM_LOAD( "mds-ic4-4_8b b.bin",  0x0000, 0x2000, CRC(331460b4) SHA1(4cf94d711cdb5715d14f1ab3cadec245e0adfb1e) )
19672052   ROM_LOAD( "mds-ic4-4_8a b.bin",  0x2000, 0x2000, CRC(4ec44fb3) SHA1(676e0ab574dec08df562c6f278e8a9cc7c8afa41) )
2053
2054   PALETTE_2C04_0004
19682055ROM_END
19692056
19702057/* Gun games */
r7882r7883
19782065   ROM_REGION( 0x4000, "gfx1", 0 ) /* PPU memory */
19792066   ROM_LOAD( "mds-dh3_2b or 8b e.bin",  0x0000, 0x2000, CRC(0c52ec28) SHA1(c8fb6a5d4c13a7075d313326e2da9ce88780a88d) )
19802067   ROM_LOAD( "mds-dh3_2a or 8a e.bin",  0x2000, 0x2000, CRC(3d238df3) SHA1(e868ef3d5357ef5294e4faeecc9dbf801c5253e8) )
2068
2069   PALETTE_STANDARD
19812070ROM_END
19822071
19832072ROM_START( hogalley )
r7882r7883
19902079   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
19912080   ROM_LOAD( "mds-ha4-1_2b or 8b e-1.bin",  0x0000, 0x2000, CRC(fc5a91ad) SHA1(7ce6c64d81a9626d0b34bdc0a2a28fee457ebcb1) ) // there is another dump ( CRC 0x7623e954 ) where 0xFE1 = 04, the dump we use is probably the correct one
19922081   ROM_LOAD( "mds-ha4-1_2a or 8a e-1.bin",  0x2000, 0x2000, CRC(78c842b6) SHA1(39f2a7fc1f1cbe2378a369e45b5cbb05057db3f0) )
2082
2083   PALETTE_2C04_0001
19932084ROM_END
19942085
19952086ROM_START( vsgshoe )
r7882r7883
20032094   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
20042095   ROM_LOAD( "mds-gm5.2b",  0x0000, 0x2000, CRC(192c3360) SHA1(5ddbe007d8bc693a0b7c92f33e6ed6b27dc1c08e) )
20052096   ROM_LOAD( "mds-gm5.2a",  0x2000, 0x2000, CRC(823dd178) SHA1(77578a48ded0c244d1ae30aafaa9259b7dd0dfc4) )
2097
2098   PALETTE_STANDARD
20062099ROM_END
20072100
20082101ROM_START( vsfdf )
r7882r7883
20122105
20132106   ROM_REGION( 0x10000,"gfx1", 0 ) /* PPU memory */
20142107   ROM_LOAD( "cha2.1",  0x00000, 0x10000, CRC(a2f88df0) SHA1(10ef432d3132b01a1fcb38d8f521edd2a029ac5e) )
2108
2109   PALETTE_2C04_0001
20152110ROM_END
20162111
20172112ROM_START( goonies )
r7882r7883
20202115
20212116   ROM_REGION( 0x10000,"gfx1", 0 ) /* PPU memory */
20222117   ROM_LOAD( "chr.u4",  0x0000, 0x10000, CRC(4c4b61b0) SHA1(7221c2499531e591a5a99e2cb339ae3a76b662c2) )
2118
2119   PALETTE_2C04_0003
20232120ROM_END
20242121
20252122ROM_START( vsgradus )
r7882r7883
20282125
20292126   ROM_REGION( 0x10000,"gfx1", 0 ) /* PPU memory */
20302127   ROM_LOAD( "chr.u4",  0x0000, 0x10000, CRC(23cf2fc3) SHA1(0a3f48aec529b92abc261952e632af7ff766b1ef) )
2128
2129   PALETTE_2C04_0001
20312130ROM_END
20322131
20332132ROM_START( btlecity )
r7882r7883
20402139   ROM_REGION( 0x4000, "gfx1", 0 ) /* PPU memory */
20412140   ROM_LOAD( "bc.2b",  0x0000, 0x2000, CRC(634f68bd) SHA1(db1a18083667fdaf6cdd9ed7666bec6bf6e39f29) )
20422141   ROM_LOAD( "bc.2a",  0x2000, 0x2000, CRC(a9b49a05) SHA1(c14706e6a5524f81e79c101e32deef9f3d60de3f) )
2142
2143   /* also compatible with 2C04-0002, 2C04-0003, 2C04-0004 via dipswitches */
2144   PALETTE_2C04_0001
20432145ROM_END
20442146
20452147ROM_START( cluclu )
r7882r7883
20522154   ROM_REGION( 0x4000, "gfx1", 0 ) /* PPU memory */
20532155   ROM_LOAD( "cl.8b",  0x0000, 0x2000, CRC(960d9a6c) SHA1(2569d59fd880cfc2eb4638294d1429ba749f5dcb) )
20542156   ROM_LOAD( "cl.8a",  0x2000, 0x2000, CRC(e3139791) SHA1(33d9e6d2a3233ee311c2cef2d0a425ded2cf3b0f) )
2157
2158   PALETTE_2C04_0004
20552159ROM_END
20562160
20572161ROM_START( excitebk )
r7882r7883
20642168   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
20652169   ROM_LOAD( "mds-eb4.2b",  0x0000, 0x2000, CRC(80be1f50) SHA1(d8544b9a0a9d8719ab601fa9c68c4305385b14c7) )
20662170   ROM_LOAD( "mds-eb4.2a",  0x2000, 0x2000, CRC(a9b49a05) SHA1(c14706e6a5524f81e79c101e32deef9f3d60de3f) )
2171
2172   PALETTE_2C04_0003
20672173ROM_END
20682174
20692175ROM_START( excitebkj )
r7882r7883
20762182   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
20772183   ROM_LOAD( "mds-eb4-4_8b a.bin",  0x0000, 0x2000, CRC(62a76c52) SHA1(7ebd0dac976abe8636f4f75a3b2a473d7a54934d) )
20782184   ROM_LOAD( "mds-eb4-4_8a a.bin",  0x2000, 0x2000, CRC(a9b49a05) SHA1(c14706e6a5524f81e79c101e32deef9f3d60de3f) )
2185
2186   PALETTE_2C04_0004
20792187ROM_END
20802188
20812189ROM_START( jajamaru )
r7882r7883
20882196   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
20892197   ROM_LOAD( "12.bin",  0x0000, 0x2000, CRC(c91d536a) SHA1(8cb4b0819652df484553b9dd1f82391d51c90fcc) )
20902198   ROM_LOAD( "11.bin",  0x2000, 0x2000, CRC(f0034c04) SHA1(402dcf6ad443baeee3038ecab12db008a1ad2787) )
2199
2200   PALETTE_STANDARD
20912201ROM_END
20922202
20932203ROM_START( ladygolf )
r7882r7883
21002210   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
21012211   ROM_LOAD( "lg-2b",  0x0000, 0x2000, CRC(95618947) SHA1(e8f09bffa3fa1a1cac8fa25df9fba962951c1fb3) )
21022212   ROM_LOAD( "lg-2a",  0x2000, 0x2000, CRC(d07407b1) SHA1(b998b46fe83e76fac3d7b71495d1da8580a731f9) )
2213
2214   PALETTE_2C04_0002
21032215ROM_END
21042216
21052217ROM_START( smgolfj )
r7882r7883
21122224   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
21132225   ROM_LOAD( "mds-gf3_8b b.bin",  0x0000, 0x2000, CRC(7ef68029) SHA1(a639e463fd0abfb1bff0dd17aa0c9f70a72ee139) )
21142226   ROM_LOAD( "mds-gf3_8a b.bin",  0x2000, 0x2000, CRC(f2285878) SHA1(e0d34161a1879975f51c12222cf366228170b0e3) )
2227
2228   PALETTE_STANDARD
21152229ROM_END
21162230
21172231ROM_START( machridr )
r7882r7883
21242238   ROM_REGION( 0x4000,"gfx1" , 0) /* PPU memory */
21252239   ROM_LOAD( "mr-2b",  0x0000, 0x2000, CRC(33a2b41a) SHA1(671f37bce742e63250296e62c143f8a82f860b04) )
21262240   ROM_LOAD( "mr-2a",  0x2000, 0x2000, CRC(685899d8) SHA1(02b6a9bc21367c481d0091fa8a8f2d1b841244bf) )
2241
2242   PALETTE_2C04_0002
21272243ROM_END
21282244
21292245ROM_START( machridrj )
r7882r7883
21362252   ROM_REGION( 0x4000,"gfx1" , 0) /* PPU memory */
21372253   ROM_LOAD( "mds-mr4-1_2b or 8b a.bin",  0x0000, 0x2000, CRC(59867e36) SHA1(2b5546aa9f140277d611d6d5516b1343e5e672a0) )
21382254   ROM_LOAD( "mds-mr4-1_2a or 8a a.bin",  0x2000, 0x2000, CRC(ccfedc5a) SHA1(3d6321681fbe256d7c71037205d45d22fc264569) )
2255
2256   PALETTE_2C04_0001
21392257ROM_END
21402258
21412259ROM_START( smgolf )
r7882r7883
21482266   ROM_REGION( 0x4000, "gfx1", 0 ) /* PPU memory */
21492267   ROM_LOAD( "golf-2b",  0x0000, 0x2000, CRC(2782a3e5) SHA1(4e57aab58fb250da951a9aecd21d6aa79e697bcb) )
21502268   ROM_LOAD( "golf-2a",  0x2000, 0x2000, CRC(6e93fdef) SHA1(44f46421adabbc40135c681592cb5226b7c9012a) )
2269
2270   PALETTE_2C04_0002
21512271ROM_END
21522272
21532273ROM_START( smgolfb )
r7882r7883
21602280   ROM_REGION( 0x4000, "gfx1", 0 ) /* PPU memory */
21612281   ROM_LOAD( "gf4-2.2bf",  0x0000, 0x2000, NO_DUMP )
21622282   ROM_LOAD( "gf4-2.2af",  0x2000, 0x2000, CRC(47e9b8c6) SHA1(2eee6eaf7d15e215816363c7bb7142a2bdc2d530) )
2283
2284   PALETTE_2C04_0002
21632285ROM_END
21642286
21652287ROM_START( vspinbal )
r7882r7883
21722294   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
21732295   ROM_LOAD( "pb-8b",  0x0000, 0x2000, CRC(8822ee9e) SHA1(950113952e6d356e45e03479ba5dd5a8cb131609) )
21742296   ROM_LOAD( "pb-8a",  0x2000, 0x2000, CRC(cbe98a28) SHA1(c00c5f15a33611bfe3ad420b93b1cc2cae011c3e) )
2297
2298   PALETTE_2C04_0001
21752299ROM_END
21762300
21772301ROM_START( vspinbalj )
r7882r7883
21842308   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
21852309   ROM_LOAD( "mds-pn3_8b b.bin",  0x0000, 0x2000, CRC(1e3fec3e) SHA1(aef18cee358af202ec48c1c36986e42e134466b1) )
21862310   ROM_LOAD( "mds-pn3_8a b.bin",  0x2000, 0x2000, CRC(6f963a65) SHA1(af69564b51aa42ef0815c952e0d0d0d928651685) )
2311
2312   PALETTE_STANDARD
21872313ROM_END
21882314
21892315ROM_START( vsslalom )
r7882r7883
21952321
21962322   ROM_REGION( 0x2000,"gfx1", 0 ) /* PPU memory */
21972323   ROM_LOAD( "mds-sl4.2a",  0x0000, 0x2000, CRC(977bb126) SHA1(9b12cd37246237c24a8077c6184a2f71d342ac47) )
2324
2325   PALETTE_2C04_0002
21982326ROM_END
21992327
22002328ROM_START( vssoccer )
r7882r7883
22072335   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
22082336   ROM_LOAD( "soccer2b",  0x0000, 0x2000, CRC(307b19ab) SHA1(b35ef4c2cf071db77cec1b4529b43a20cfcce172) )
22092337   ROM_LOAD( "soccer2a",  0x2000, 0x2000, CRC(7263613a) SHA1(aa5673b57833d1f32c2cb0230a809397ec6103b4) )
2338
2339   PALETTE_2C04_0003
22102340ROM_END
22112341
22122342ROM_START( vssoccerj )
r7882r7883
22192349   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
22202350   ROM_LOAD( "mds-sc4-2_2b or 8b a.bin",  0x0000, 0x2000, CRC(307b19ab) SHA1(b35ef4c2cf071db77cec1b4529b43a20cfcce172) )
22212351   ROM_LOAD( "mds-sc4-2_2a or 8a a.bin",  0x2000, 0x2000, CRC(7263613a) SHA1(aa5673b57833d1f32c2cb0230a809397ec6103b4) )
2352
2353   PALETTE_2C04_0002
22222354ROM_END
22232355
22242356ROM_START( starlstr )
r7882r7883
22312363   ROM_REGION( 0x4000,"gfx1", 0 ) /* PPU memory */
22322364   ROM_LOAD( "sl_06.2b",  0x0000, 0x2000, CRC(25f0e027) SHA1(4fcbe4bb959689948cb8f505d5c495dabb893f7b) )
22332365   ROM_LOAD( "sl_05.2a",  0x2000, 0x2000, CRC(2bbb45fd) SHA1(53c3588bd25baa6b8ff41f4755db9e0e806c9719) )
2366
2367   /* also compatible with 2C04-0001, 2C04-0002, 2C04-0003, 2C04-0004 via dipswitches */
2368   PALETTE_STANDARD
22342369ROM_END
22352370
22362371ROM_START( vstetris )
r7882r7883
22412376
22422377   ROM_REGION( 0x2000,"gfx1", 0 ) /* PPU memory */
22432378   ROM_LOAD( "char.8b",  0x0000, 0x2000, CRC(51e8d403) SHA1(ed734994d164c4b59794249a13bce333896b3ee5) )
2379
2380   /* also compatible with 2C03, 2C04-0002, 2C04-0003, 2C04-0004 via dipswitches */
2381   PALETTE_2C04_0001
22442382ROM_END
22452383
22462384ROM_START( drmario )
r7882r7883
22492387
22502388   ROM_REGION( 0x8000,"gfx1", 0 ) /* PPU memory */
22512389   ROM_LOAD( "dm-u3chr",  0x0000, 0x8000, CRC(91871aa5) SHA1(32a4299ead7b37f49877dc9597653b07a73ddbf3) )
2390
2391   PALETTE_2C04_0003
22522392ROM_END
22532393
22542394ROM_START( cstlevna )
r7882r7883
22562396   ROM_LOAD( "mds-cv.prg",  0x10000, 0x20000, CRC(ffbef374) SHA1(9eb3b75e7b45df51b8bcd29df84689a7e8557f4f) )
22572397
22582398   /* No cart gfx - uses vram */
2399
2400   PALETTE_2C04_0002
22592401ROM_END
22602402
22612403ROM_START( topgun )
r7882r7883
22632405   ROM_LOAD( "rc-003",  0x10000, 0x20000, CRC(8c0c2df5) SHA1(d9b1b87204e025a637821a0168475e1209ce0c8a) )
22642406
22652407   /* No cart gfx - uses vram */
2408
2409   PALETTE_STANDARD
22662410ROM_END
22672411
22682412ROM_START( tkoboxng )
r7882r7883
22712415
22722416   ROM_REGION( 0x10000,"gfx1", 0 ) /* PPU memory */
22732417   ROM_LOAD( "tkochr.bin",  0x0000, 0x10000, CRC(21275ba5) SHA1(160131586aeeca848deabff258a2ce5f62b17c5f) )
2418
2419   /* also compatible with 2C03 via dipswitches */
2420   PALETTE_2C04_0003
22742421ROM_END
22752422
22762423ROM_START( rbibb )
r7882r7883
22792426
22802427   ROM_REGION( 0x8000,"gfx1", 0 ) /* PPU memory */
22812428   ROM_LOAD( "rbi-cha",  0x0000, 0x8000, CRC(a3c14889) SHA1(ef00f4fbf21cf34e946957b9b6825b8e2cb16536) )
2429
2430   /* also compatible with 2C03, 2C04-0002, 2C04-0003, 2C04-0004 via dipswitches */
2431   PALETTE_2C04_0001
22822432ROM_END
22832433
22842434ROM_START( rbibba )
r7882r7883
22872437
22882438   ROM_REGION( 0x8000,"gfx1", 0 ) /* PPU memory */
22892439   ROM_LOAD( "rbi-cha",  0x0000, 0x8000, CRC(a3c14889) SHA1(ef00f4fbf21cf34e946957b9b6825b8e2cb16536) )
2440
2441   /* also compatible with 2C03, 2C04-0002, 2C04-0003, 2C04-0004 via dipswitches */
2442   PALETTE_2C04_0001
22902443ROM_END
22912444
22922445ROM_START( vsskykid )
r7882r7883
22952448
22962449   ROM_REGION( 0x8000,"gfx1" , 0) /* PPU memory */
22972450   ROM_LOAD( "sk-cha",  0x0000, 0x8000, CRC(9bd44dad) SHA1(bf33d175b6ab991d63a0acaf83ba22d5b7ab11b9) )
2451
2452   /* also compatible with 2C03, 2C04-0002, 2C04-0003, 2C04-0004 via dipswitches */
2453   PALETTE_2C04_0001
22982454ROM_END
22992455
23002456ROM_START( platoon )
r7882r7883
23032459
23042460   ROM_REGION( 0x20000,"gfx1", 0 ) /* PPU memory */
23052461   ROM_LOAD( "chrver0.ic6",  0x00000, 0x20000, CRC(689df57d) SHA1(854aaa9feb16e3f239fba6069fbf65e69858fe73) )
2462
2463   PALETTE_2C04_0001
23062464ROM_END
23072465
23082466ROM_START( bnglngby )
r7882r7883
23182476
23192477   ROM_REGION( 0x2000, "user1", 0 ) /* unknown */
23202478   ROM_LOAD( "mds-rb4-2_1a b.bin", 0x0000, 0x2000, CRC(b49939ad) SHA1(ebaab2864d9ff9876e9d2666746c4bab57e49ec3) ) /* Unknown, maps at 0xe000, maybe from another set, but we have other roms? */
2479
2480   PALETTE_2C04_0002
23212481ROM_END
23222482
23232483ROM_START( supxevs )
r7882r7883
23272487
23282488   ROM_REGION( 0x8000,"gfx1", 0 ) /* PPU memory */
23292489   ROM_LOAD( "cha",   0x00000, 0x08000, CRC(e27c7434) SHA1(a033bbaf0c28504ed2a641dea28f016a88ef03ac) )
2490
2491   /* also compatible with 2C04-0002, 2C04-0003, 2C04-0004 via dipswitches */
2492   PALETTE_2C04_0001
23302493ROM_END
23312494
23322495ROM_START( mightybj )
r7882r7883
23382501
23392502   ROM_REGION( 0x2000, "gfx1", 0 ) /* PPU memory */
23402503   ROM_LOAD( "2b.bin",  0x0000, 0x2000, CRC(5425a4d0) SHA1(09eb9d93b680c9eefde5ee6e16cf81de931cccb9) )
2504
2505   PALETTE_STANDARD
23412506ROM_END
23422507
23432508/* Dual System */
r7882r7883
23622527   ROM_REGION( 0x4000,"gfx2", 0 ) /* PPU memory */
23632528   ROM_LOAD( "mds-bf4_8b a-3.bin",  0x0000, 0x2000, CRC(f27d9aa0) SHA1(429a1ad2a07947e4c4809495bfab55bf0f0e428f) )
23642529   ROM_LOAD( "mds-bf4_8a a-3.bin",  0x2000, 0x2000, CRC(76e6bbf8) SHA1(a4cae3a129a787162050187453b1583c8735fb46) )
2530
2531   PALETTE_2C04_0003
23652532ROM_END
23662533
23672534ROM_START( vsmahjng )
r7882r7883
23802547
23812548   ROM_REGION( 0x4000,"gfx2", 0 ) /* PPU memory */
23822549   ROM_LOAD( "mj.8b",  0x0000, 0x2000, CRC(9dae3502) SHA1(b7ffbc17af35eeac1b06c651f6c25f71827e9c3b) )
2550
2551   PALETTE_STANDARD
23832552ROM_END
23842553
23852554ROM_START( vsbball )
r7882r7883
24022571   ROM_REGION( 0x4000,"gfx2", 0 ) /* PPU memory */
24032572   ROM_LOAD( "bb-8b",  0x0000, 0x2000, CRC(3ff8bec3) SHA1(28c1bf89ed1046243ca8cf122cefa0752c242577) )
24042573   ROM_LOAD( "bb-8a",  0x2000, 0x2000, CRC(13b20cfd) SHA1(cb333cbea09557a9d2bdc351fabc61fc7760c35d) )
2574
2575   PALETTE_2C04_0001
24052576ROM_END
24062577
24072578ROM_START( vsbballj )
r7882r7883
24242595   ROM_REGION( 0x4000,"gfx2", 0 ) /* PPU memory */
24252596   ROM_LOAD( "mds-ba_8b a.bin",  0x0000, 0x2000, CRC(919147d0) SHA1(9fccdfccc2a3ec634e350880ded7053f36c377bc) )
24262597   ROM_LOAD( "mds-ba_8a a.bin",  0x2000, 0x2000, CRC(3f7edb00) SHA1(f59d24f15bdb8903187eabc1578dcb60443614ed) )
2598
2599   PALETTE_2C04_0001
24272600ROM_END
24282601
24292602ROM_START( vsbballja )
r7882r7883
24462619   ROM_REGION( 0x4000,"gfx2", 0 ) /* PPU memory */
24472620   ROM_LOAD( "mds-ba_8b a.bin",  0x0000, 0x2000, CRC(919147d0) SHA1(9fccdfccc2a3ec634e350880ded7053f36c377bc) )
24482621   ROM_LOAD( "mds-ba_8a a.bin",  0x2000, 0x2000, CRC(3f7edb00) SHA1(f59d24f15bdb8903187eabc1578dcb60443614ed) )
2622
2623   PALETTE_2C04_0001
24492624ROM_END
24502625
24512626ROM_START( vsbballjb )
r7882r7883
24682643   ROM_REGION( 0x4000,"gfx2", 0 ) /* PPU memory */
24692644   ROM_LOAD( "mds-ba_8b a.bin",    0x0000, 0x2000, CRC(919147d0) SHA1(9fccdfccc2a3ec634e350880ded7053f36c377bc) )
24702645   ROM_LOAD( "mds-ba_8a a.bin",    0x2000, 0x2000, CRC(3f7edb00) SHA1(f59d24f15bdb8903187eabc1578dcb60443614ed) )
2646
2647   PALETTE_2C04_0001
24712648ROM_END
24722649
24732650ROM_START( vstennis )
r7882r7883
24902667   ROM_REGION( 0x4000,"gfx2" , 0) /* PPU memory */
24912668   ROM_LOAD( "mds-te.8b",  0x0000, 0x2000, CRC(c81e9260) SHA1(6d4809a05364cc05485ee1add833428529af2be6) )
24922669   ROM_LOAD( "mds-te.8a",  0x2000, 0x2000, CRC(d91eb295) SHA1(6b69bcef5421a6bcde89a2d1f514853f9f7992c3) )
2670
2671   PALETTE_STANDARD
24932672ROM_END
24942673
24952674ROM_START( vstennisj )
r7882r7883
25122691   ROM_REGION( 0x4000,"gfx2" , 0) /* PPU memory */
25132692   ROM_LOAD( "mds-te_8b a.bin",  0x0000, 0x2000, CRC(c81e9260) SHA1(6d4809a05364cc05485ee1add833428529af2be6) )
25142693   ROM_LOAD( "mds-te_8a a.bin",  0x2000, 0x2000, CRC(d91eb295) SHA1(6b69bcef5421a6bcde89a2d1f514853f9f7992c3) )
2694
2695   PALETTE_STANDARD
25152696ROM_END
25162697
25172698ROM_START( wrecking )
r7882r7883
25342715   ROM_REGION( 0x4000,"gfx2", 0 ) /* PPU memory */
25352716   ROM_LOAD( "wr.8b",  0x0000, 0x2000, CRC(455d77ac) SHA1(fa09d0be51cc780f6c16cd314facc84043e1e69b) )
25362717   ROM_LOAD( "wr.8a",  0x2000, 0x2000, CRC(653350d8) SHA1(d9aa699394654deaf50fadd8a652f08a340377eb) )
2718
2719   PALETTE_2C04_0002
25372720ROM_END
25382721
25392722ROM_START( iceclmrj )
r7882r7883
25562739   ROM_REGION( 0x4000,"gfx2", 0 ) /* PPU memory */
25572740   ROM_LOAD( "mds-ic4-4_8b a.bin",  0x0000, 0x2000, CRC(331460b4) SHA1(4cf94d711cdb5715d14f1ab3cadec245e0adfb1e) )
25582741   ROM_LOAD( "mds-ic4-4_8a a.bin",  0x2000, 0x2000, CRC(4ec44fb3) SHA1(676e0ab574dec08df562c6f278e8a9cc7c8afa41) )
2742
2743   PALETTE_2C04_0004
25592744ROM_END
25602745
25612746/******************************************************************************/
25622747
2563/*    YEAR  NAME      PARENT    MACHINE  INPUT     INIT        MONITOR  */
2564GAME( 1985, btlecity, 0,        vsnes,   btlecity, btlecity, ROT0, "Namco",     "Vs. Battle City", 0 )
2748/*    YEAR  NAME      PARENT    MACHINE  INPUT     INIT      MONITOR  */
2749GAME( 1985, btlecity, 0,        vsnes,   btlecity, vsnormal, ROT0, "Namco",     "Vs. Battle City", 0 )
25652750GAME( 1985, starlstr, 0,        vsnes,   starlstr, vsnormal, ROT0, "Namco",     "Vs. Star Luster", 0 )
2566GAME( 1987, cstlevna, 0,        vsnes,   cstlevna, cstlevna, ROT0, "Konami",    "Vs. Castlevania", 0 )
2567GAME( 1984, cluclu,   0,        vsnes,   cluclu,   suprmrio, ROT0, "Nintendo",  "Vs. Clu Clu Land", 0 )
2751GAME( 1987, cstlevna, 0,        vsnes,   cstlevna, vsvram,   ROT0, "Konami",    "Vs. Castlevania", 0 )
2752GAME( 1984, cluclu,   0,        vsnes,   cluclu,   vsnormal, ROT0, "Nintendo",  "Vs. Clu Clu Land", 0 )
25682753GAME( 1990, drmario,  0,        vsnes,   drmario,  drmario,  ROT0, "Nintendo",  "Vs. Dr. Mario", 0 )
2569GAME( 1985, duckhunt, 0,        vsnes,   duckhunt, duckhunt, ROT0, "Nintendo",  "Vs. Duck Hunt", 0 )
2570GAME( 1984, excitebk, 0,        vsnes,   excitebk, excitebk, ROT0, "Nintendo",  "Vs. Excitebike", 0 )
2571GAME( 1984, excitebkj,excitebk, vsnes,   excitebk, excitbkj, ROT0, "Nintendo",  "Vs. Excitebike (Japan)", 0 )
2572GAME( 1986, goonies,  0,        vsnes,   goonies,  goonies,  ROT0, "Konami",    "Vs. The Goonies", 0 )
2573GAME( 1985, hogalley, 0,        vsnes,   hogalley, hogalley, ROT0, "Nintendo",  "Vs. Hogan's Alley", 0 )
2574GAME( 1984, iceclimb, 0,        vsnes,   iceclimb, suprmrio, ROT0, "Nintendo",  "Vs. Ice Climber", 0 )
2575GAME( 1984, iceclimbj,iceclimb, vsnes,   iceclmbj, suprmrio, ROT0, "Nintendo",  "Vs. Ice Climber (Japan)", 0 )
2576GAME( 1985, machridr, 0,        vsnes,   machridr, machridr, ROT0, "Nintendo",  "Vs. Mach Rider (Endurance Course Version)", GAME_IMPERFECT_GRAPHICS )
2577GAME( 1985, machridrj,machridr, vsnes,   machridj, vspinbal, ROT0, "Nintendo",  "Vs. Mach Rider (Japan, Fighting Course Version)", GAME_IMPERFECT_GRAPHICS )
2754GAME( 1985, duckhunt, 0,        vsnes,   duckhunt, vsgun,    ROT0, "Nintendo",  "Vs. Duck Hunt", 0 )
2755GAME( 1984, excitebk, 0,        vsnes,   excitebk, vsnormal, ROT0, "Nintendo",  "Vs. Excitebike", 0 )
2756GAME( 1984, excitebkj,excitebk, vsnes,   excitebk, vsnormal, ROT0, "Nintendo",  "Vs. Excitebike (Japan)", 0 )
2757GAME( 1986, goonies,  0,        vsnes,   goonies,  vskonami, ROT0, "Konami",    "Vs. The Goonies", 0 )
2758GAME( 1985, hogalley, 0,        vsnes,   hogalley, vsgun,    ROT0, "Nintendo",  "Vs. Hogan's Alley", 0 )
2759GAME( 1984, iceclimb, 0,        vsnes,   iceclimb, vsnormal, ROT0, "Nintendo",  "Vs. Ice Climber", 0 )
2760GAME( 1984, iceclimbj,iceclimb, vsnes,   iceclmbj, vsnormal, ROT0, "Nintendo",  "Vs. Ice Climber (Japan)", 0 )
2761GAME( 1985, machridr, 0,        vsnes,   machridr, vsnormal, ROT0, "Nintendo",  "Vs. Mach Rider (Endurance Course Version)", GAME_IMPERFECT_GRAPHICS )
2762GAME( 1985, machridrj,machridr, vsnes,   machridj, vsnormal, ROT0, "Nintendo",  "Vs. Mach Rider (Japan, Fighting Course Version)", GAME_IMPERFECT_GRAPHICS )
25782763GAME( 1986, rbibb,    0,        vsnes,   rbibb,    rbibb,    ROT0, "Namco",     "Vs. Atari R.B.I. Baseball (set 1)", 0 )
25792764GAME( 1986, rbibba,   rbibb,    vsnes,   rbibb,    rbibb,    ROT0, "Namco",     "Vs. Atari R.B.I. Baseball (set 2)", 0 )
2580GAME( 1986, suprmrio, 0,        vsnes,   suprmrio, suprmrio, ROT0, "Nintendo",  "Vs. Super Mario Bros.", 0 )
2581GAME( 1986, suprmrioa,suprmrio, vsnes,   suprmrio, suprmrio, ROT0, "Nintendo",  "Vs. Super Mario Bros. (alt)", 0 )
2582GAME( 1986, suprmriobl,suprmrio,vsnes,   suprmrio, suprmrio, ROT0, "bootleg",   "Vs. Super Mario Bros. (bootleg with Z80, set 1)", GAME_NOT_WORKING )
2583GAME( 1986, suprmriobl2,suprmrio,vsnes,  suprmrio, suprmrio, ROT0, "bootleg",   "Vs. Super Mario Bros. (bootleg with Z80, set 2)", GAME_NOT_WORKING )
2584GAME( 1988, skatekds, suprmrio, vsnes,   suprmrio, suprmrio, ROT0, "hack",      "Vs. Skate Kids. (Graphic hack of Super Mario Bros.)", 0 )
2765GAME( 1986, suprmrio, 0,        vsnes,   suprmrio, vsnormal, ROT0, "Nintendo",  "Vs. Super Mario Bros.", 0 )
2766GAME( 1986, suprmrioa,suprmrio, vsnes,   suprmrio, vsnormal, ROT0, "Nintendo",  "Vs. Super Mario Bros. (alt)", 0 )
2767GAME( 1986, suprmriobl,suprmrio,vsnes,   suprmrio, vsnormal, ROT0, "bootleg",   "Vs. Super Mario Bros. (bootleg with Z80, set 1)", GAME_NOT_WORKING )
2768GAME( 1986, suprmriobl2,suprmrio,vsnes,  suprmrio, vsnormal, ROT0, "bootleg",   "Vs. Super Mario Bros. (bootleg with Z80, set 2)", GAME_NOT_WORKING )
2769GAME( 1988, skatekds, suprmrio, vsnes,   suprmrio, vsnormal, ROT0, "hack",      "Vs. Skate Kids. (Graphic hack of Super Mario Bros.)", 0 )
25852770GAME( 1985, vsskykid, 0,        vsnes,   vsskykid, MMC3,     ROT0, "Namco",     "Vs. Super SkyKid" , 0 )
2586GAME( 1987, tkoboxng, 0,        vsnes,   tkoboxng, tkoboxng, ROT0, "Namco LTD.","Vs. TKO Boxing", GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS )
2587GAME( 1984, smgolf,   0,        vsnes,   golf4s,   machridr, ROT0, "Nintendo",  "Vs. Stroke & Match Golf (Men Version, set 1)", 0 )
2771GAME( 1987, tkoboxng, 0,        vsnes,   tkoboxng, tkoboxng, ROT0, "Namco / Data East USA","Vs. T.K.O. Boxing", 0 )
2772GAME( 1984, smgolf,   0,        vsnes,   golf4s,   vsnormal, ROT0, "Nintendo",  "Vs. Stroke & Match Golf (Men Version, set 1)", 0 )
25882773GAME( 1984, smgolfj,  smgolf,   vsnes,   golf,     vsnormal, ROT0, "Nintendo",  "Vs. Stroke & Match Golf (Men Version) (Japan)", 0 )
2589GAME( 1984, ladygolf, smgolf,   vsnes,   golf,     machridr, ROT0, "Nintendo",  "Vs. Stroke & Match Golf (Ladies Version)", 0 )
2590GAME( 1984, vspinbal, 0,        vsnes,   vspinbal, vspinbal, ROT0, "Nintendo",  "Vs. Pinball", 0 )
2774GAME( 1984, ladygolf, smgolf,   vsnes,   golf,     vsnormal, ROT0, "Nintendo",  "Vs. Stroke & Match Golf (Ladies Version)", 0 )
2775GAME( 1984, vspinbal, 0,        vsnes,   vspinbal, vsnormal, ROT0, "Nintendo",  "Vs. Pinball", 0 )
25912776GAME( 1984, vspinbalj,vspinbal, vsnes,   vspinblj, vsnormal, ROT0, "Nintendo",  "Vs. Pinball (Japan)", 0 )
2592GAME( 1986, vsslalom, 0,        vsnes,   vsslalom, vsslalom, ROT0, "Rare LTD.", "Vs. Slalom", GAME_IMPERFECT_GRAPHICS )
2593GAME( 1985, vssoccer, 0,        vsnes,   vssoccer, excitebk, ROT0, "Nintendo",  "Vs. Soccer", 0 )
2777GAME( 1986, vsslalom, 0,        vsnes,   vsslalom, vsnormal, ROT0, "Rare LTD.", "Vs. Slalom", GAME_IMPERFECT_GRAPHICS )
2778GAME( 1985, vssoccer, 0,        vsnes,   vssoccer, vsnormal, ROT0, "Nintendo",  "Vs. Soccer", 0 )
25942779GAME( 1985, vssoccerj,vssoccer, vsnes,   vssoccer, bnglngby, ROT0, "Nintendo",  "Vs. Soccer (Japan)", 0 )
2595GAME( 1986, vsgradus, 0,        vsnes,   vsgradus, vsgradus, ROT0, "Konami",    "Vs. Gradius", 0 )
2596GAME( 1987, platoon,  0,        vsnes,   platoon,  platoon,  ROT0, "Ocean Software Limited", "Vs. Platoon", GAME_WRONG_COLORS )
2597GAME( 1987, vstetris, 0,        vsnes,   vstetris, vstetris, ROT0, "Academysoft-Elory", "Vs. Tetris" , GAME_IMPERFECT_COLORS )
2598GAME( 1986, mightybj, 0,        vsnes,   mightybj, mightybj, ROT0, "Tecmo",     "Vs. Mighty Bomb Jack (Japan)", 0 )
2599GAME( 1985, jajamaru, 0,        vsnes,   jajamaru, jajamaru, ROT0, "Jaleco",    "Vs. Ninja Jajamaru Kun (Japan)", GAME_IMPERFECT_GRAPHICS )
2600GAME( 1987, topgun,   0,        vsnes,   topgun,   topgun,   ROT0, "Konami",    "Vs. Top Gun", 0)
2780GAME( 1986, vsgradus, 0,        vsnes,   vsgradus, vskonami, ROT0, "Konami",    "Vs. Gradius", 0 )
2781GAME( 1987, platoon,  0,        vsnes,   platoon,  platoon,  ROT0, "Ocean Software Limited", "Vs. Platoon", 0 )
2782GAME( 1987, vstetris, 0,        vsnes,   vstetris, vsnormal, ROT0, "Academysoft-Elory", "Vs. Tetris" , 0 )
2783GAME( 1986, mightybj, 0,        mightybj,mightybj, vsnormal, ROT0, "Tecmo",     "Vs. Mighty Bomb Jack (Japan)", 0 )
2784GAME( 1985, jajamaru, 0,        jajamaru,jajamaru, vsnormal, ROT0, "Jaleco",    "Vs. Ninja Jajamaru Kun (Japan)", 0 )
2785GAME( 1987, topgun,   0,        topgun,  topgun,   vsvram,   ROT0, "Konami",    "Vs. Top Gun", 0)
26012786GAME( 1985, bnglngby, 0,        vsnes,   bnglngby, bnglngby, ROT0, "Nintendo / Broderbund Software Inc.",  "Vs. Raid on Bungeling Bay (Japan)", 0 )
26022787GAME( 1986, supxevs,  0,        vsnes,   supxevs,  supxevs,  ROT0, "Namco",      "Vs. Super Xevious", 0 )
26032788GAME( 1988, vsfdf,    0,        vsnes,   vsfdf,    vsfdf,    ROT0, "Sunsoft",   "Vs. Freedom Force", 0 )
2604GAME( 1986, vsgshoe,  0,        vsnes,  vsgshoe,  vsgshoe,  ROT0, "Nintendo",  "Vs. Gumshoe", 0 )
2789GAME( 1986, vsgshoe,  0,        vsgshoe, vsgshoe,  vsgshoe,  ROT0, "Nintendo",  "Vs. Gumshoe", 0 )
26052790
26062791/* Dual games */
2607GAME( 1984, vstennis, 0,        vsdual,  vstennis, vstennis, ROT0, "Nintendo",  "Vs. Tennis" , 0 )
2608GAME( 1984, vstennisj,vstennis, vsdual,  vstennis, vstennis, ROT0, "Nintendo",  "Vs. Tennis (Japan)" , 0 )
2609GAME( 1984, wrecking, 0,        vsdual,  wrecking, wrecking, ROT0, "Nintendo",  "Vs. Wrecking Crew", 0 )
2610GAME( 1984, balonfgt, 0,        vsdual,  balonfgt, balonfgt, ROT0, "Nintendo",  "Vs. Balloon Fight", 0 )
2611GAME( 1984, vsmahjng, 0,        vsdual,  vsmahjng, vstennis, ROT0, "Nintendo",  "Vs. Mahjang (Japan)" , 0 )
2612GAME( 1984, vsbball,  0,        vsdual,  vsbball,  vsbball,  ROT0, "Nintendo of America",  "Vs. BaseBall", 0 )
2613GAME( 1984, vsbballj, vsbball,  vsdual,  vsbballj, vsbball,  ROT0, "Nintendo",  "Vs. BaseBall (Japan set 1)", 0 )
2614GAME( 1984, vsbballja,vsbball,  vsdual,  vsbballj, vsbball,  ROT0, "Nintendo",  "Vs. BaseBall (Japan set 2)", 0 )
2615GAME( 1984, vsbballjb,vsbball,  vsdual,  vsbballj, vsbball,  ROT0, "Nintendo",  "Vs. BaseBall (Japan set 3)", 0 )
2616GAME( 1984, iceclmrj, 0,        vsdual,  iceclmrj, iceclmrj, ROT0, "Nintendo",  "Vs. Ice Climber Dual (Japan)" , 0 )
2792GAME( 1984, vstennis, 0,        vsdual,  vstennis, vsdual,   ROT0, "Nintendo",  "Vs. Tennis" , 0 )
2793GAME( 1984, vstennisj,vstennis, vsdual,  vstennis, vsdual,   ROT0, "Nintendo",  "Vs. Tennis (Japan)" , 0 )
2794GAME( 1984, wrecking, 0,        vsdual,  wrecking, vsdual,   ROT0, "Nintendo",  "Vs. Wrecking Crew", 0 )
2795GAME( 1984, balonfgt, 0,        vsdual,  balonfgt, vsdual,   ROT0, "Nintendo",  "Vs. Balloon Fight", 0 )
2796GAME( 1984, vsmahjng, 0,        vsdual,  vsmahjng, vsdual,   ROT0, "Nintendo",  "Vs. Mahjang (Japan)" , 0 )
2797GAME( 1984, vsbball,  0,        vsdual,  vsbball,  vsdual,   ROT0, "Nintendo of America",  "Vs. BaseBall", 0 )
2798GAME( 1984, vsbballj, vsbball,  vsdual,  vsbballj, vsdual,   ROT0, "Nintendo",  "Vs. BaseBall (Japan set 1)", 0 )
2799GAME( 1984, vsbballja,vsbball,  vsdual,  vsbballj, vsdual,   ROT0, "Nintendo",  "Vs. BaseBall (Japan set 2)", 0 )
2800GAME( 1984, vsbballjb,vsbball,  vsdual,  vsbballj, vsdual,   ROT0, "Nintendo",  "Vs. BaseBall (Japan set 3)", 0 )
2801GAME( 1984, iceclmrj, 0,        vsdual,  iceclmrj, vsdual,   ROT0, "Nintendo",  "Vs. Ice Climber Dual (Japan)" , 0 )
26172802
26182803/* Not Working (bad dumps) */
2619GAME( 1985, smgolfb,  smgolf,   vsnes,   golf,     machridr, ROT0, "Nintendo",   "Vs. Stroke & Match Golf (Men Version, set 2)", GAME_NOT_WORKING )
2804GAME( 1985, smgolfb,  smgolf,   vsnes,   golf,     vsnormal, ROT0, "Nintendo",   "Vs. Stroke & Match Golf (Men Version, set 2)", GAME_NOT_WORKING )
src/mame/drivers/midas.c
r7882r7883
4343
4444    size  220(x)mm * 210(y)mm
4545
46
47    Notes:
48
49    - hammer: keep test button pressed during boot for hardware tests
50
4651*************************************************************************************************************/
4752
4853#include "emu.h"
4954#include "cpu/m68000/m68000.h"
5055#include "sound/ymz280b.h"
5156#include "machine/eeprom.h"
57#include "machine/ticket.h"
5258
53#define MIDAS_DEBUG   0
59static UINT16 *midas_gfxram, *midas_gfxregs;
5460
55static UINT16 *livequiz_gfxram, *livequiz_gfxregs;
61static VIDEO_START( midas );
62static VIDEO_UPDATE( midas );
5663
57static VIDEO_START( livequiz );
58static VIDEO_UPDATE( livequiz );
59
6064static tilemap_t *tmap;
6165
6266static TILE_GET_INFO( get_tile_info )
6367{
64   UINT16 code = livequiz_gfxram[ tile_index + 0x7000 ];
68   UINT16 code = midas_gfxram[ tile_index + 0x7000 ];
6569   SET_TILE_INFO(1, code & 0xfff, (code >> 12) & 0xf, TILE_FLIPXY( 0 ));
6670}
6771
68static VIDEO_START( livequiz )
72static VIDEO_START( midas )
6973{
74   midas_gfxram = auto_alloc_array(machine, UINT16, 0x20000/2);
75
7076   tmap = tilemap_create(   machine, get_tile_info, tilemap_scan_cols,
7177                     8,8, 0x80,0x20   );
7278
r7882r7883
7581
7682static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
7783{
78   UINT16 *s      =   livequiz_gfxram + 0x8000;
79   UINT16 *codes   =   livequiz_gfxram;
84   UINT16 *s      =   midas_gfxram + 0x8000;
85   UINT16 *codes   =   midas_gfxram;
8086
8187   int sx_old = 0, sy_old = 0, ynum_old = 0, xzoom_old = 0;
8288   int xdim, ydim, xscale, yscale;
r7882r7883
156162   }
157163}
158164
159static VIDEO_UPDATE( livequiz )
165static VIDEO_UPDATE( midas )
160166{
161167   int layers_ctrl = -1;
162168
163#if MIDAS_DEBUG
169#ifdef MAME_DEBUG
164170   if ( input_code_pressed(screen->machine, KEYCODE_Z) )
165171   {
166172      int msk = 0;
r7882r7883
178184   return 0;
179185}
180186
181static WRITE16_DEVICE_HANDLER( livequiz_eeprom_w )
187static WRITE16_DEVICE_HANDLER( midas_eeprom_w )
182188{
183189   if (ACCESSING_BITS_0_7)
184190   {
r7882r7883
198204   return 0xffff;
199205}
200206
201static WRITE16_HANDLER( livequiz_gfxregs_w )
207static WRITE16_HANDLER( midas_gfxregs_w )
202208{
203   COMBINE_DATA( livequiz_gfxregs + offset );
209   COMBINE_DATA( midas_gfxregs + offset );
204210
205211   switch( offset )
206212   {
207213      case 1:
208214      {
209         UINT16 addr = livequiz_gfxregs[0];
210         livequiz_gfxram[addr] = data;
211         livequiz_gfxregs[0] += livequiz_gfxregs[2];
215         UINT16 addr = midas_gfxregs[0];
216         midas_gfxram[addr] = data;
217         midas_gfxregs[0] += midas_gfxregs[2];
212218
213219         if ( addr >= 0x7000 && addr <= 0x7fff )   tilemap_mark_tile_dirty(tmap, addr - 0x7000);
214220
r7882r7883
217223   }
218224}
219225
220static ADDRESS_MAP_START( mem_map, ADDRESS_SPACE_PROGRAM, 16 )
226/***************************************************************************************
227                                       Live Quiz Show
228***************************************************************************************/
229
230static WRITE16_HANDLER( livequiz_coin_w )
231{
232   if (ACCESSING_BITS_0_7)
233   {
234      coin_counter_w(space->machine, 0, data & 0x0001);
235   }
236#ifdef MAME_DEBUG
237//  popmessage("coin %04X", data);
238#endif
239}
240
241static ADDRESS_MAP_START( livequiz_map, ADDRESS_SPACE_PROGRAM, 16 )
221242   AM_RANGE(0x000000, 0x1fffff) AM_ROM
222243
223   AM_RANGE(0x900000, 0x900001) AM_READ_PORT("IN5")
224   AM_RANGE(0x920000, 0x920001) AM_READ_PORT("IN2")
244   AM_RANGE(0x900000, 0x900001) AM_READ_PORT("DSW_PLAYER1")
245   AM_RANGE(0x920000, 0x920001) AM_READ_PORT("SERVICE")
246   AM_RANGE(0x940000, 0x940001) AM_READ_PORT("PLAYER2")
247   AM_RANGE(0x980000, 0x980001) AM_READ_PORT("START")
248
249   AM_RANGE(0x980000, 0x980001) AM_WRITE( livequiz_coin_w )
250
251   AM_RANGE(0x9a0000, 0x9a0001) AM_DEVWRITE( "eeprom", midas_eeprom_w )
252
253   AM_RANGE(0x9c0000, 0x9c0005) AM_WRITE( midas_gfxregs_w ) AM_BASE( &midas_gfxregs )
254
255   AM_RANGE(0xa00000, 0xa3ffff) AM_RAM_WRITE( paletteram16_xrgb_word_be_w ) AM_BASE_GENERIC( paletteram )
256   AM_RANGE(0xa40000, 0xa7ffff) AM_RAM
257
258   AM_RANGE(0xb00000, 0xb00001) AM_READ( ret_ffff )
259   AM_RANGE(0xb20000, 0xb20001) AM_READ( ret_ffff )
260   AM_RANGE(0xb40000, 0xb40001) AM_READ( ret_ffff )
261   AM_RANGE(0xb60000, 0xb60001) AM_READ( ret_ffff )
262
263   AM_RANGE(0xb80008, 0xb8000b) AM_DEVREADWRITE8( "ymz", ymz280b_r, ymz280b_w, 0x00ff )
264
265   AM_RANGE(0xba0000, 0xba0001) AM_READ_PORT("START3")
266   AM_RANGE(0xbc0000, 0xbc0001) AM_READ_PORT("PLAYER3")
267
268   AM_RANGE(0xd00000, 0xd1ffff) AM_RAM   // zoom table?
269
270   AM_RANGE(0xe00000, 0xe3ffff) AM_RAM
271ADDRESS_MAP_END
272
273/***************************************************************************************
274                                          Hammer
275***************************************************************************************/
276
277static READ16_HANDLER( hammer_sensor_r )
278{
279   if (input_port_read(space->machine, "HAMMER") & 0x80)
280      return 0xffff;
281
282   return (input_port_read(space->machine, "SENSORY") << 8) | input_port_read(space->machine, "SENSORX");
283}
284
285static WRITE16_HANDLER( hammer_coin_w )
286{
287   if (ACCESSING_BITS_0_7)
288   {
289      coin_counter_w(space->machine, 0, data & 0x0001);
290      coin_counter_w(space->machine, 1, data & 0x0002);
291   }
292#ifdef MAME_DEBUG
293//  popmessage("coin %04X", data);
294#endif
295}
296
297static WRITE16_HANDLER( hammer_motor_w )
298{
299   if (ACCESSING_BITS_0_7)
300   {
301      ticket_dispenser_w(devtag_get_device(space->machine, "prize1"), 0, (data & 0x0001) << 7);
302      ticket_dispenser_w(devtag_get_device(space->machine, "prize2"), 0, (data & 0x0002) << 6);
303      ticket_dispenser_w(devtag_get_device(space->machine, "ticket"), 0, (data & 0x0010) << 3);
304      // data & 0x0080 ?
305   }
306#ifdef MAME_DEBUG
307//  popmessage("motor %04X", data);
308#endif
309}
310
311static WRITE16_HANDLER( hammer_led_w )
312{
313#ifdef MAME_DEBUG
314//  popmessage("led %04X", data);
315#endif
316}
317
318static ADDRESS_MAP_START( hammer_map, ADDRESS_SPACE_PROGRAM, 16 )
319   AM_RANGE(0x000000, 0x1fffff) AM_ROM
320
321   AM_RANGE(0x900000, 0x900001) AM_READ_PORT("DSW")
322   AM_RANGE(0x920000, 0x920001) AM_READ_PORT("SERVICE")
225323   AM_RANGE(0x940000, 0x940001) AM_READ_PORT("IN0")
226   AM_RANGE(0x980000, 0x980001) AM_READ_PORT("IN1")
324   AM_RANGE(0x980000, 0x980001) AM_READ_PORT("TILT")
227325
228   AM_RANGE(0x9a0000, 0x9a0001) AM_DEVWRITE( "eeprom", livequiz_eeprom_w )
326   AM_RANGE(0x980000, 0x980001) AM_WRITE( hammer_coin_w )
327   AM_RANGE(0x9c000c, 0x9c000d) AM_WRITENOP   // IRQ Ack
328   AM_RANGE(0x9c000e, 0x9c000f) AM_WRITE( hammer_led_w )
229329
230   AM_RANGE(0x9c0000, 0x9c0005) AM_WRITE( livequiz_gfxregs_w ) AM_BASE( &livequiz_gfxregs )
330   AM_RANGE(0x9a0000, 0x9a0001) AM_DEVWRITE( "eeprom", midas_eeprom_w )
231331
332   AM_RANGE(0x9c0000, 0x9c0005) AM_WRITE( midas_gfxregs_w ) AM_BASE( &midas_gfxregs )
333
232334   AM_RANGE(0xa00000, 0xa3ffff) AM_RAM_WRITE( paletteram16_xrgb_word_be_w ) AM_BASE_GENERIC( paletteram )
233335   AM_RANGE(0xa40000, 0xa7ffff) AM_RAM
234336
r7882r7883
239341
240342   AM_RANGE(0xb80008, 0xb8000b) AM_DEVREADWRITE8( "ymz", ymz280b_r, ymz280b_w, 0x00ff )
241343
242   AM_RANGE(0xba0000, 0xba0001) AM_READ_PORT("IN4")
243   AM_RANGE(0xbc0000, 0xbc0001) AM_READ_PORT("IN3")
344   AM_RANGE(0xba0000, 0xba0001) AM_READ_PORT("IN1")
345   AM_RANGE(0xbc0000, 0xbc0001) AM_READ_PORT("HAMMER")
244346
245   AM_RANGE(0xd00000, 0xd1ffff) AM_RAM
347   AM_RANGE(0xbc0002, 0xbc0003) AM_WRITE( hammer_motor_w )
246348
349   AM_RANGE(0xbc0004, 0xbc0005) AM_READ( hammer_sensor_r )
350
351   AM_RANGE(0xd00000, 0xd1ffff) AM_RAM   // zoom table?
352
247353   AM_RANGE(0xe00000, 0xe3ffff) AM_RAM
248
249   AM_RANGE(0xf90000, 0xfaffff) AM_RAM AM_BASE( &livequiz_gfxram )
250354ADDRESS_MAP_END
251355
252356
253static const gfx_layout layout16x16 =
357static const gfx_layout layout16x16x8 =
254358{
255359   16,16,
256360   RGN_FRAC(1,4),
257361   8,
258362   {
259363      RGN_FRAC(3,4)+8,RGN_FRAC(3,4)+0,
364      RGN_FRAC(2,4)+8,RGN_FRAC(2,4)+0,
260365      RGN_FRAC(1,4)+8,RGN_FRAC(1,4)+0,
261      RGN_FRAC(2,4)+8,RGN_FRAC(2,4)+0,
262366      RGN_FRAC(0,4)+8,RGN_FRAC(0,4)+0
263367   },
264368   { STEP8(8*16*2+7,-1), STEP8(7,-1) },
r7882r7883
266370   16*16*2
267371};
268372
269static const gfx_layout layout8x8_2 =
373static const gfx_layout layout8x8x8_2 =
270374{
271   8,8,         /* 8 x 8 chars */
375   8,8,
272376   RGN_FRAC(1,1),
273   8,            /* 4 bits per pixel */
274   { 8,9,10,11, 0,1,2,3    },    /* planes are packed in a nibble */
377   8,
378   { 8,9,10,11, 0,1,2,3    },
275379   { (32*2+1)*4, 32*2*4, (48*2+1)*4, 48*2*4, (0+1)*4, 0*4, (16*2+1)*4, 16*2*4 },
276380   { 0*8*2, 1*8*2, 2*8*2, 3*8*2, 4*8*2, 5*8*2, 6*8*2, 7*8*2 },
277   32*8*2   /* 32 bytes per char */
278
279
381   32*8*2
280382};
281383
282384static GFXDECODE_START( midas )
283   GFXDECODE_ENTRY( "gfx1", 0x000000, layout16x16,  0, 0x100 )
284   GFXDECODE_ENTRY( "gfx2", 0x000000, layout8x8_2,  0, 0x80 )
385   GFXDECODE_ENTRY( "sprites", 0, layout16x16x8, 0, 0x100 )
386   GFXDECODE_ENTRY( "tiles",   0, layout8x8x8_2, 0,  0x80 )
285387GFXDECODE_END
286388
287389
288390static INPUT_PORTS_START( livequiz )
289391
290   PORT_START("IN0")   // IN0
392   PORT_START("DSW_PLAYER1")   // 900000
393   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
394   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
395   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
396   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
397   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
398   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
399   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
400   PORT_DIPSETTING(   0x04, DEF_STR( Off ) )
401   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
402   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
403   PORT_DIPSETTING(   0x08, DEF_STR( Off ) )
404   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
405   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
406   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
407   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
408   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
409   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
410   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
411   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
412   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
413   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
414   PORT_DIPNAME( 0x80, 0x80, "Freeze" )
415   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
416   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
417
418   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
419   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
420   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
421   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
422   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
423   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
424   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
425   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
426
427   PORT_START("SERVICE")   // 920000
428   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN1   )
429   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
430   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
431   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit)   // EEPROM
432   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_UNKNOWN )
433   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_UNKNOWN )
434   PORT_SERVICE_NO_TOGGLE( 0x0040,   IP_ACTIVE_LOW )
435   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_UNKNOWN )
436
437   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
438   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
439   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
440   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
441   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
442   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
443   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
444   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
445
446   PORT_START("PLAYER2")   // 940000
291447   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
292448   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
293449   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
r7882r7883
306462   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
307463   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
308464
309   PORT_START("IN1")   // IN1
465   PORT_START("START")   // 980000
310466   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
311467   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
312468   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
r7882r7883
325481   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
326482   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
327483
328   PORT_START("IN2")   // IN2
329   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN1   )
330   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
331   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
332   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit)   // EEPROM
333   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_UNKNOWN )
334   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_UNKNOWN )
335   PORT_SERVICE_NO_TOGGLE( 0x0040,   IP_ACTIVE_LOW )
336   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_UNKNOWN )
484   PORT_START("START3")   // ba0000
485   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START3  )
486   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
487   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
488   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
489   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
490   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
491   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
492   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
337493
338494   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
339495   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
r7882r7883
344500   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
345501   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
346502
347   PORT_START("IN3")   // IN3
503   PORT_START("PLAYER3")   // bc0000
348504   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
349505   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
350506   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
r7882r7883
363519   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
364520   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
365521
366   PORT_START("IN4")   // IN4
367   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START3  )
368   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
369   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
370   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
371   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
372   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
373   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
374   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
522INPUT_PORTS_END
375523
376   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
377   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
378   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
379   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
380   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
381   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
382   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
383   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
524static INPUT_PORTS_START( hammer )
384525
385   PORT_START("IN5")   // IN5 - 900000
386   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
526   PORT_START("DSW")   // 900000
527   PORT_DIPNAME( 0x01, 0x01, "Debug Mode" )
387528   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
388529   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
389   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
390   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
391   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
392   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
393   PORT_DIPSETTING(   0x04, DEF_STR( Off ) )
394   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
395   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
530   PORT_DIPNAME( 0x06, 0x06, "Game Mode" )
531   PORT_DIPSETTING(   0x06, "Prize Game" )
532   PORT_DIPSETTING(   0x00, "Ticket Game 1" )   // not in manual, does not work (it requires a toggleable ticket dispenser)
533   PORT_DIPSETTING(   0x04, "Ticket Game 2" )
534   PORT_DIPSETTING(   0x02, "Generic Game" )
535   PORT_DIPNAME( 0x08, 0x08, "Warning Sound" )
396536   PORT_DIPSETTING(   0x08, DEF_STR( Off ) )
397537   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
398538   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
r7882r7883
408548   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
409549   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
410550
411   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
412   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
413   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
414   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
551   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
552   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
553   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
554   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
415555   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
416556   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
417557   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
418558   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
419559
560   PORT_START("SERVICE")   // 920000
561   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN1     )
562   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_COIN2     )
563   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_SERVICE1  )
564   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL   ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit)
565   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
566   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
567   PORT_SERVICE_NO_TOGGLE( 0x0040,   IP_ACTIVE_LOW )
568   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
569
570   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
571   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
572   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
573   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
574   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
575   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
576   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
577   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
578
579   PORT_START("IN0")   // 940000
580   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
581   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
582   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
583   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
584   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
585   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
586   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
587   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
588
589   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
590   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
591   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
592   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
593   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
594   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
595   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
596   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
597
598   PORT_START("TILT")   // 980000
599   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
600   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
601   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
602   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
603   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
604   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
605   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
606   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
607
608   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_TILT    )
609   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
610   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
611   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
612   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
613   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
614   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
615   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
616
617   PORT_START("IN1")   // ba0000
618   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
619   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
620   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
621   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
622   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
623   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
624   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
625   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
626
627   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
628   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
629   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
630   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
631   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
632   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
633   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
634   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
635
636   PORT_START("HAMMER")   // bc0000
637   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("prize1", ticket_dispenser_line_r)   // prize 1 sensor ("tejisw 1")
638   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("prize2", ticket_dispenser_line_r)   // prize 2 sensor ("tejisw 2")
639   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
640   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN )
641   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r)
642   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_UNKNOWN )
643   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_UNKNOWN )
644   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_IMPULSE(5)   PORT_NAME( "Hammer" )
645
646   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
647   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
648   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
649   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
650   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
651   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
652   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
653   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
654
655   PORT_START("SENSORX")
656   PORT_BIT( 0xff, 0x20, IPT_LIGHTGUN_X ) PORT_MINMAX(0x00, 0x3f+1) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(8)
657
658   PORT_START("SENSORY")
659   PORT_BIT( 0xff, 0x18, IPT_LIGHTGUN_Y ) PORT_MINMAX(0x00, 0x2f+1) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(8)
660
420661INPUT_PORTS_END
421662
422663
r7882r7883
433674static MACHINE_DRIVER_START( livequiz )
434675
435676   /* basic machine hardware */
436   MDRV_CPU_ADD("maincpu", M68000, 24000000 / 2)
437   MDRV_CPU_PROGRAM_MAP(mem_map)
677   MDRV_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2)
678   MDRV_CPU_PROGRAM_MAP(livequiz_map)
438679   MDRV_CPU_VBLANK_INT("screen", irq1_line_hold)
439680
440681   MDRV_EEPROM_93C46_ADD("eeprom")
r7882r7883
450691   MDRV_GFXDECODE(midas)
451692   MDRV_PALETTE_LENGTH(0x10000)
452693
453   MDRV_VIDEO_START(livequiz)
454   MDRV_VIDEO_UPDATE(livequiz)
694   MDRV_VIDEO_START(midas)
695   MDRV_VIDEO_UPDATE(midas)
455696
456697   /* sound hardware */
457698   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
458   MDRV_SOUND_ADD("ymz", YMZ280B, 16934400)
699   MDRV_SOUND_ADD("ymz", YMZ280B, XTAL_16_9344MHz)
459700   MDRV_SOUND_CONFIG(ymz280b_config)
460701   MDRV_SOUND_ROUTE(0, "lspeaker", 0.80)
461702   MDRV_SOUND_ROUTE(1, "rspeaker", 0.80)
462703MACHINE_DRIVER_END
463704
705static MACHINE_DRIVER_START( hammer )
464706
707   /* basic machine hardware */
708   MDRV_CPU_ADD("maincpu", M68000, XTAL_28MHz / 2)
709   MDRV_CPU_PROGRAM_MAP(hammer_map)
710   MDRV_CPU_VBLANK_INT("screen", irq1_line_hold)
711
712   MDRV_EEPROM_93C46_ADD("eeprom")
713
714   MDRV_TICKET_DISPENSER_ADD("prize1", 1000*5, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW )
715   MDRV_TICKET_DISPENSER_ADD("prize2", 1000*5, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW )
716   MDRV_TICKET_DISPENSER_ADD("ticket",    200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW )
717
718   /* video hardware */
719   MDRV_SCREEN_ADD("screen", RASTER)
720   MDRV_SCREEN_REFRESH_RATE(60)
721   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
722   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
723   MDRV_SCREEN_SIZE(320, 256)
724   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-16-1)
725
726   MDRV_GFXDECODE(midas)
727   MDRV_PALETTE_LENGTH(0x10000)
728
729   MDRV_VIDEO_START(midas)
730   MDRV_VIDEO_UPDATE(midas)
731
732   /* sound hardware */
733   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
734   MDRV_SOUND_ADD("ymz", YMZ280B, XTAL_16_9344MHz)
735   MDRV_SOUND_CONFIG(ymz280b_config)
736   MDRV_SOUND_ROUTE(0, "lspeaker", 0.80)
737   MDRV_SOUND_ROUTE(1, "rspeaker", 0.80)
738MACHINE_DRIVER_END
739
740
465741/***************************************************************************************
466742
467743Live Quiz Show
r7882r7883
554830   ROM_REGION( 0x200000, "maincpu", 0 )
555831   ROM_LOAD16_WORD_SWAP( "flash.u1", 0x000000, 0x200000, CRC(8ec44493) SHA1(a987886cb87ac0a744f01f2e4a7cc6d12efeaa04) )
556832
557   ROM_REGION( 0x200000, "user1", 0 )
833   ROM_REGION( 0x200000, "pic", 0 )
558834   ROM_LOAD( "main_pic12c508a.u27", 0x000000, 0x000400, CRC(a84f0a7e) SHA1(fb27c05fb27b98ca603697e1be214dc6c8d5f884) )
559835   ROM_LOAD( "sub_pic12c508a.u4",   0x000000, 0x000400, CRC(e52ebdc4) SHA1(0f3af66b5ea184e49188e74a873699324a3930f1) )
560836
561   ROM_REGION( 0x800000, "gfx1", 0 )
837   ROM_REGION( 0x800000, "sprites", 0 )
562838   ROM_LOAD( "flash.u15", 0x000000, 0x200000, CRC(d6eb56f1) SHA1(52d67bb25dd968c79eccb05159a578516b27e557) )
563   ROM_LOAD( "flash.u16", 0x200000, 0x200000, CRC(4c9fd873) SHA1(6e185304ce29771265d3c48b0ef0e840d8bed02d) )
564   ROM_LOAD( "flash.u19", 0x400000, 0x200000, CRC(daa81532) SHA1(9e66bb4639b92c3d76b7918535f55883f22f24b2) )
839   ROM_LOAD( "flash.u19", 0x200000, 0x200000, CRC(daa81532) SHA1(9e66bb4639b92c3d76b7918535f55883f22f24b2) )
840   ROM_LOAD( "flash.u16", 0x400000, 0x200000, CRC(4c9fd873) SHA1(6e185304ce29771265d3c48b0ef0e840d8bed02d) )
565841   ROM_LOAD( "flash.u20", 0x600000, 0x200000, CRC(b540a8c7) SHA1(25b9b30c7d5ff1e410ea30580017e45590542561) )
566842
567   ROM_REGION( 0x080000, "gfx2", 0 )
843   ROM_REGION( 0x080000, "tiles", 0 )
568844   ROM_LOAD( "27c4096.u23", 0x000000, 0x080000, CRC(25121de8) SHA1(edf24d87551639b871baf3243b452a4e2ba84107) )
569845
570846   ROM_REGION( 0x200000, "ymz", 0 )
r7882r7883
579855   rom[0x13345a/2]   =   0x4e75;
580856}
581857
582GAME( 1999, livequiz, 0, livequiz, livequiz, livequiz,   ROT0, "Andamiro", "Live Quiz Show", GAME_IMPERFECT_GRAPHICS )
858/***************************************************************************************
859
860Hammer
861Andamiro 2000
862
863PCB Layout
864----------
865
866|------------------------------|-------------------|
867|TDA1519 17358 YAC516 YMZ280B  |        CN1        |
868|   17558    16.9344MHz   ATMEL_ATF1500            |
869|  VOL   17358                 |                   |
870|                              |   S0.U25          |
871|                        MC68HC000CFN16            |
872|TD62064                       |   S1.U26          |
873|              MIDAS-2         |                   |
874| DSW(8)                       |   P.U22    A0L.U44|
875|J                             |  LP621024         |
876|A                 LP621024    |            A0H.U46|
877|M                             |  LP621024         |
878|M                 LP621024    |            A1L.U48|
879|A                             |  LP621024         |
880|                  LP621024    |            A1H.U50|
881|                              |                   |
882|                              |            A2L.U45|
883|                              |                   |
884| TESTSW                       |            A2H.U47|
885| 93C46        MIDAS-1     MIDAS-3                 |
886| LP621024            28MHz    |            A3L.U49|
887|           HM62H256           |                   |
888| LP621024          HM62H256   |            A3H.U51|
889|------------------------------|-------------------|
890Notes:
891      68000 @ 14MHz [28/2]
892      YMZ280B @ 16.9344MHz
893      CN1 - connector for top board
894
895Top board
896---------
897
898HAMMER TOP PCB VER1.2
899AMO30803
900|------------------------------------------|
901|CN19 CN14 CN15 CN13 CN22 CN23 CN20 CN21   |
902|                                          |
903|                                          |
904|                                 17558    |
905|   TD62064  TD62064              17393    |
906|                                          |
907|                            24MHz      CN2|
908|                     AT89C52     17558    |
909|PAL                              17393 CN1|
910|                                          |
911|                             MC7805       |
912|------------------------------------------|
913
914***************************************************************************************/
915
916ROM_START( hammer )
917   ROM_REGION( 0x200000, "maincpu", 0 )
918   ROM_LOAD16_WORD_SWAP( "p.u22", 0x000000, 0x200000, CRC(687f1596) SHA1(3dc5fb0af1e8c4f3a42ce4aad39635b1111831d8) )
919
920   ROM_REGION( 0x1000000, "sprites", 0 )
921   ROM_LOAD( "a0l.u44", 0x000000, 0x200000, CRC(b9cafd81) SHA1(24698970d1aea0907e2963c872ce61077f44c3af) )
922   ROM_LOAD( "a0h.u46", 0x200000, 0x200000, CRC(f60f188b) SHA1(486f26c473b46efb402662b2f374e361cd7b4284) )
923
924   ROM_LOAD( "a1l.u48", 0x400000, 0x200000, CRC(82129cf9) SHA1(6d68e943854bc9e8ea555bf03107dc9e836ca4d9) )
925   ROM_LOAD( "a1h.u50", 0x600000, 0x200000, CRC(76897c90) SHA1(aded60d3db834598cd54ad9140eee7be4129cb27) )
926
927   ROM_LOAD( "a2l.u45", 0x800000, 0x200000, CRC(d8086ee5) SHA1(9d5f2b3a0f903a69cfd1108ddf5ea61b571c3fe3) )
928   ROM_LOAD( "a2h.u47", 0xa00000, 0x200000, CRC(a64aa2df) SHA1(7e4eb049cd6a5971a455488a484f225763921614) )
929
930   ROM_LOAD( "a3l.u49", 0xc00000, 0x200000, CRC(4e83cf00) SHA1(e66a0b4eae0f46bf36126be3795cfac3ad3d4282) )
931   ROM_LOAD( "a3h.u51", 0xe00000, 0x200000, CRC(834de39f) SHA1(6e9867180ca20e64f60bad5cad82674ce8f45b7b) )
932
933   ROM_REGION( 0x080000, "tiles", ROMREGION_ERASE )
934   // Use the tiles rom from livequiz (not present in this set) to show some debug text
935//  ROM_LOAD( "27c4096.u23", 0x000000, 0x080000, CRC(25121de8) SHA1(edf24d87551639b871baf3243b452a4e2ba84107) )
936
937   ROM_REGION( 0x400000, "ymz", 0 )
938   ROM_LOAD( "s0.u25", 0x000000, 0x200000, CRC(c049a3e0) SHA1(0c7016c3128c170a84ad3f92fad1165775210e3d) )
939   ROM_LOAD( "s1.u26", 0x200000, 0x200000, CRC(9cc4b3ec) SHA1(b91a8747074a1032eb7f70a015d394fe8e896d7e) )
940ROM_END
941
942GAME( 1999, livequiz, 0, livequiz, livequiz, livequiz, ROT0, "Andamiro", "Live Quiz Show", GAME_IMPERFECT_GRAPHICS )
943GAME( 2000, hammer,   0, hammer,   hammer,   0,        ROT0, "Andamiro", "Hammer",         0 )
src/mame/drivers/ddragon.c
r7882r7883
13741374   ROM_LOAD( "21j-l-0",      0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) )   /* unknown */
13751375ROM_END
13761376
1377
1378ROM_START( ddragonub )
1379   ROM_REGION( 0x30000, "maincpu", 0 )   /* 64k for code + bankswitched memory */
1380   ROM_LOAD( "21a-1_6.bin",0x08000,0x08000, CRC(f354b0e1) SHA1(f2fe5d6102564691a0054d2b8dd98673fdc8a348) )
1381   ROM_LOAD( "21a-2_4",   0x10000, 0x08000, CRC(5cd67657) SHA1(96bc7a5354a76524bd43a4d7eb8b0053a89e39c4) ) /* banked at 0x4000-0x8000 */
1382   ROM_LOAD( "21a-3",     0x18000, 0x08000, CRC(dbf24897) SHA1(1504faaf07c541330cd43b72dc6846911dfd85a3) ) /* banked at 0x4000-0x8000 */
1383   ROM_LOAD( "21a-4_2",   0x20000, 0x08000, CRC(9b019598) SHA1(59f3aa15389f53c4646d21a39634cb1502e66ff6) ) /* banked at 0x4000-0x8000 */
1384
1385   ROM_REGION( 0x10000, "sub", 0 ) /* sprite cpu */
1386   ROM_LOAD( "63701.bin",    0xc000, 0x4000, CRC(f5232d03) SHA1(e2a194e38633592fd6587690b3cb2669d93985c7) )
1387
1388   ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */
1389   ROM_LOAD( "21j-0-1",      0x08000, 0x08000, CRC(9efa95bb) SHA1(da997d9cc7b9e7b2c70a4b6d30db693086a6f7d8) )
1390
1391   ROM_REGION( 0x08000, "gfx1", 0 )
1392   ROM_LOAD( "21j-5",        0x00000, 0x08000, CRC(7a8b8db4) SHA1(8368182234f9d4d763d4714fd7567a9e31b7ebeb) )   /* chars */
1393
1394   ROM_REGION( 0x80000, "gfx2", 0 )
1395   ROM_LOAD( "21j-a",        0x00000, 0x10000, CRC(574face3) SHA1(481fe574cb79d0159a65ff7486cbc945d50538c5) )   /* sprites */
1396   ROM_LOAD( "21j-b",        0x10000, 0x10000, CRC(40507a76) SHA1(74581a4b6f48100bddf20f319903af2fe36f39fa) )
1397   ROM_LOAD( "21j-c",        0x20000, 0x10000, CRC(bb0bc76f) SHA1(37b2225e0593335f636c1e5fded9b21fdeab2f5a) )
1398   ROM_LOAD( "21j-d",        0x30000, 0x10000, CRC(cb4f231b) SHA1(9f2270f9ceedfe51c5e9a9bbb00d6f43dbc4a3ea) )
1399   ROM_LOAD( "21j-e",        0x40000, 0x10000, CRC(a0a0c261) SHA1(25c534d82bd237386d447d72feee8d9541a5ded4) )
1400   ROM_LOAD( "21j-f",        0x50000, 0x10000, CRC(6ba152f6) SHA1(a301ff809be0e1471f4ff8305b30c2fa4aa57fae) )
1401   ROM_LOAD( "21j-g",        0x60000, 0x10000, CRC(3220a0b6) SHA1(24a16ea509e9aff82b9ddd14935d61bb71acff84) )
1402   ROM_LOAD( "21j-h",        0x70000, 0x10000, CRC(65c7517d) SHA1(f177ba9c1c7cc75ff04d5591b9865ee364788f94) )
1403
1404   ROM_REGION( 0x40000, "gfx3", 0 )
1405   ROM_LOAD( "21j-8",        0x00000, 0x10000, CRC(7c435887) SHA1(ecb76f2148fa9773426f05aac208eb3ac02747db) )   /* tiles */
1406   ROM_LOAD( "21j-9",        0x10000, 0x10000, CRC(c6640aed) SHA1(f156c337f48dfe4f7e9caee9a72c7ea3d53e3098) )
1407   ROM_LOAD( "21j-i",        0x20000, 0x10000, CRC(5effb0a0) SHA1(1f21acb15dad824e831ed9a42b3fde096bb31141) )
1408   ROM_LOAD( "21j-j",        0x30000, 0x10000, CRC(5fb42e7c) SHA1(7953316712c56c6f8ca6bba127319e24b618b646) )
1409
1410   ROM_REGION( 0x20000, "adpcm", 0 ) /* adpcm samples */
1411   ROM_LOAD( "21j-6",        0x00000, 0x10000, CRC(34755de3) SHA1(57c06d6ce9497901072fa50a92b6ed0d2d4d6528) )
1412   ROM_LOAD( "21j-7",        0x10000, 0x10000, CRC(904de6f8) SHA1(3623e5ea05fd7c455992b7ed87e605b87c3850aa) )
1413
1414   ROM_REGION( 0x0300, "proms", 0 )
1415   ROM_LOAD( "21j-k-0",      0x0000, 0x0100, CRC(fdb130a9) SHA1(4c4f214229b9fab2b5d69c745ec5428787b89e1f) )   /* unknown */
1416   ROM_LOAD( "21j-l-0",      0x0100, 0x0200, CRC(46339529) SHA1(64f4c42a826d67b7cbaa8a23a45ebc4eb6248891) )   /* unknown */
1417ROM_END
1418
1419
13771420ROM_START( ddragonb ) /* Same program roms as the World set */
13781421   ROM_REGION( 0x30000, "maincpu", 0 )   /* 64k for code + bankswitched memory */
13791422   ROM_LOAD( "21j-1.26",     0x08000, 0x08000, CRC(ae714964) SHA1(072522b97ca4edd099c6b48d7634354dc7088c53) )
r7882r7883
20552098GAME( 1987, ddragonw1,   ddragon,  ddragon,  ddragon,  ddragon,  ROT0, "[Technos Japan] (Taito license)", "Double Dragon (World Set 2)", GAME_SUPPORTS_SAVE )
20562099GAME( 1987, ddragonu,    ddragon,  ddragon,  ddragon,  ddragon,  ROT0, "[Technos Japan] (Taito America license)", "Double Dragon (US Set 1)", GAME_SUPPORTS_SAVE )
20572100GAME( 1987, ddragonua,   ddragon,  ddragon,  ddragon,  ddragon,  ROT0, "[Technos Japan] (Taito America license)", "Double Dragon (US Set 2)", GAME_SUPPORTS_SAVE )
2101GAME( 1987, ddragonub,   ddragon,  ddragon,  ddragon,  ddragon,  ROT0, "[Technos Japan] (Taito America license)", "Double Dragon (US Set 3)", GAME_SUPPORTS_SAVE )
20582102GAME( 1987, ddragonb2,   ddragon,  ddragon,  ddragon,  ddragon,  ROT0, "bootleg", "Double Dragon (bootleg)", GAME_SUPPORTS_SAVE )
20592103GAME( 1987, ddragonb,    ddragon,  ddragonb, ddragon,  ddragon,  ROT0, "bootleg", "Double Dragon (bootleg with HD6309)", GAME_SUPPORTS_SAVE ) // according to dump notes
20602104GAME( 1987, ddragonba,   ddragon,  ddragonba,   ddragon,  ddragon,  ROT0, "bootleg", "Double Dragon (bootleg with M6803)", GAME_SUPPORTS_SAVE )
src/mame/drivers/m58.c
r7882r7883
357357   ROM_LOAD( "yard.2m",      0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
358358ROM_END
359359
360ROM_START( vs10yardu )
361   ROM_REGION( 0x10000, "maincpu", 0 )
362   ROM_LOAD( "yf-a-3p-vu.3p",      0x0000, 0x2000, CRC(f5243513) SHA1(de3d2bbc07dd5532248e8335493e8d35d1de8003) )
363   ROM_LOAD( "yf-a-3n-h-vs.3n",    0x2000, 0x2000, CRC(a14d7a14) SHA1(1b900ed276dd2d918f82613399416cf399362405) )
364   ROM_LOAD( "yf-a-3m-h-vs.3m",    0x4000, 0x2000, CRC(dc4bb0ce) SHA1(9d9c960744720ffeddc7c9f1db4981fb6a0006d7) )
360365
366   ROM_REGION( 0x10000, "iremsound", 0 )
367   ROM_LOAD( "yf-s-3b.3b",      0x8000, 0x2000, CRC(0392a60c) SHA1(68030504eafc58db250099edd3c3323bdb9eff6b) )
368   ROM_LOAD( "yf-s-1b.1b",      0xa000, 0x2000, CRC(6588f41a) SHA1(209305efc68171886427216b9a0b37333f40daa8) )
369   ROM_LOAD( "yf-s-3a.3a",      0xc000, 0x2000, CRC(bd054e44) SHA1(f10c32c70d60680229fc0891d0e1308015fa69d6) )
370   ROM_LOAD( "yf-s-1a.1a",      0xe000, 0x2000, CRC(2490d4c3) SHA1(e4da7b01e8ad075b7e3c8beb6668faff72db9aa2) )
361371
372   ROM_REGION( 0x06000, "gfx1", 0 )
373   ROM_LOAD( "yf-a-3e-h-vs.3e",     0x00000, 0x2000, CRC(354d7330) SHA1(0dac87e502d5e9089c4e5ca87c7626940a17e9b2) )   /* chars */
374   ROM_LOAD( "yf-a-3c-h-vs.3c",     0x02000, 0x2000, CRC(f48eedca) SHA1(6aef3208de8b1dd4078de20c0b5ce96219c79d40) )
375   ROM_LOAD( "yf-a-3d-h-vs.3d",     0x04000, 0x2000, CRC(7d1b4d93) SHA1(9389de1230b93f529c492af6fb911c00280cae8a) )
376
377   ROM_REGION( 0x0c000, "gfx2", 0 )
378   ROM_LOAD( "yf-b-5b.5b",      0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) )   /* sprites */
379   ROM_LOAD( "yf-b-5c.5c",      0x02000, 0x2000, CRC(8708b888) SHA1(8c4f305a339f23ec8ed40dfd72fac0f62ee65378) )
380   ROM_LOAD( "yf-b-5f.5f",      0x04000, 0x2000, CRC(d9bb8ab8) SHA1(1325308b4c85355298fec4aa3e5fec1b4b13ad86) )
381   ROM_LOAD( "yf-b-5e.5e",      0x06000, 0x2000, CRC(47077e8d) SHA1(5f78b15fb360e9926ef11841d5d86f2bd9af04d1) )
382   ROM_LOAD( "yf-b-5j.5j",      0x08000, 0x2000, CRC(713ef31f) SHA1(b48df9ed4f26fded3c7eaac3a52b580b2dd60477) )
383   ROM_LOAD( "yf-b-5k.5k",      0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
384
385   ROM_REGION( 0x0520, "proms", 0 )
386   ROM_LOAD( "yf-a-5c.5c",      0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
387   ROM_LOAD( "yf-a-5d.5d",      0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
388   ROM_LOAD( "yf-b-2b.2b",      0x0200, 0x0020, CRC(fcd283ea) SHA1(6ebc3e966bb920685250f38edab5fe1f8a27c316) ) /* sprites palette */
389   ROM_LOAD( "yf-b-3l.3l",      0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
390   ROM_LOAD( "yf-b-2r.2r",      0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
391   ROM_LOAD( "yf-b-2p.2p",      0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
392ROM_END
393
394ROM_START( 10yard85 )
395   ROM_REGION( 0x10000, "maincpu", 0 )
396   ROM_LOAD( "yf-a-3p-h.3p",       0x0000, 0x2000, CRC(c83da5e3) SHA1(7f2dd11483158e389f5c39ee8de64be406501451) )
397   ROM_LOAD( "yf-a-3n-h.3n",       0x2000, 0x2000, CRC(8dc5f32f) SHA1(f550ed326711d1103711b99777f302f0d48e8eaf) )
398   ROM_LOAD( "yf-a-3m-h.3m",       0x4000, 0x2000, CRC(7d5d0c20) SHA1(38ada7a53881f7f812b02514d13fbf0fa013c0f1) )
399
400   ROM_REGION( 0x10000, "iremsound", 0 )
401   ROM_LOAD( "yf-s-3b.3b",      0x8000, 0x2000, CRC(0392a60c) SHA1(68030504eafc58db250099edd3c3323bdb9eff6b) )
402   ROM_LOAD( "yf-s-1b.1b",      0xa000, 0x2000, CRC(6588f41a) SHA1(209305efc68171886427216b9a0b37333f40daa8) )
403   ROM_LOAD( "yf-s-3a.3a",      0xc000, 0x2000, CRC(bd054e44) SHA1(f10c32c70d60680229fc0891d0e1308015fa69d6) )
404   ROM_LOAD( "yf-s-1a.1a",      0xe000, 0x2000, CRC(2490d4c3) SHA1(e4da7b01e8ad075b7e3c8beb6668faff72db9aa2) )
405
406   ROM_REGION( 0x06000, "gfx1", 0 )
407   ROM_LOAD( "yf-a-3e-h.3e",     0x00000, 0x2000, CRC(5fba9074) SHA1(aa9881315850e86b49712a4afb551778ee57ae75) )   /* chars */ // this rom changes to give the '85 text
408   ROM_LOAD( "yf-a-3c-h.3c",     0x02000, 0x2000, CRC(f48eedca) SHA1(6aef3208de8b1dd4078de20c0b5ce96219c79d40) )
409   ROM_LOAD( "yf-a-3d-h.3d",     0x04000, 0x2000, CRC(7d1b4d93) SHA1(9389de1230b93f529c492af6fb911c00280cae8a) )
410
411   ROM_REGION( 0x0c000, "gfx2", 0 )
412   ROM_LOAD( "yf-b-5b.5b",      0x00000, 0x2000, CRC(1299ae30) SHA1(07d47f827d8bc78a41011ec02ab64036fb8a7a18) )   /* sprites */
413   ROM_LOAD( "yf-b-5c.5c",      0x02000, 0x2000, CRC(8708b888) SHA1(8c4f305a339f23ec8ed40dfd72fac0f62ee65378) )
414   ROM_LOAD( "yf-b-5f.5f",      0x04000, 0x2000, CRC(d9bb8ab8) SHA1(1325308b4c85355298fec4aa3e5fec1b4b13ad86) )
415   ROM_LOAD( "yf-b-5e.5e",      0x06000, 0x2000, CRC(47077e8d) SHA1(5f78b15fb360e9926ef11841d5d86f2bd9af04d1) )
416   ROM_LOAD( "yf-b-5j.5j",      0x08000, 0x2000, CRC(713ef31f) SHA1(b48df9ed4f26fded3c7eaac3a52b580b2dd60477) )
417   ROM_LOAD( "yf-b-5k.5k",      0x0a000, 0x2000, CRC(f49651cc) SHA1(5b87d7360bcd5883ec265b2a01a3e02e10a85345) )
418
419   ROM_REGION( 0x0520, "proms", 0 )
420   ROM_LOAD( "yf-a-5c.5c",      0x0000, 0x0100, CRC(08fa5103) SHA1(98af48dafbbaa42f58232bf74ccbf5da41723e71) ) /* chars palette low 4 bits */
421   ROM_LOAD( "yf-a-5d.5d",      0x0100, 0x0100, CRC(7c04994c) SHA1(790bf1616335b9df4943cffcafa48d8e8aee009e) ) /* chars palette high 4 bits */
422   ROM_LOAD( "yf-b-2b.2b",      0x0200, 0x0020, CRC(fcd283ea) SHA1(6ebc3e966bb920685250f38edab5fe1f8a27c316) ) /* sprites palette */
423   ROM_LOAD( "yf-b-3l.3l",      0x0220, 0x0100, CRC(e1cdfb06) SHA1(a8cc3456cfc272e3faac80370b2298d8e1f8c2fe) ) /* sprites lookup table */
424   ROM_LOAD( "yf-b-2r.2r",      0x0320, 0x0100, CRC(cd85b646) SHA1(5268db705006058eec308afe474f4df3c15465bb) ) /* radar palette low 4 bits */
425   ROM_LOAD( "yf-b-2p.2p",      0x0420, 0x0100, CRC(45384397) SHA1(e4c662ee81aef63efd8b4a45f85c4a78dc2d419e) ) /* radar palette high 4 bits */
426ROM_END
427
362428/*************************************
363429 *
364430 *  Game drivers
365431 *
366432 *************************************/
367433
368GAME( 1983, 10yard,   0,        yard,     yard,     0, ROT0, "Irem", "10-Yard Fight (World)", GAME_SUPPORTS_SAVE )
434DRIVER_INIT( yard85 )
435{
436   // on these sets the content of the sprite color PROM needs reversing
437   //  are the proms on the other sets from bootleg boards, or hand modified?
438   UINT8* buffer = auto_alloc_array(machine, UINT8, 0x10);
439   UINT8* region = memory_region(machine,"proms");
440   int i;
441
442   for (i=0;i<0x10;i++)
443   {
444      buffer[i] = region[0x20f-i];
445   }
446   memcpy(region+0x200, buffer, 0x10);
447}
448
449GAME( 1983, 10yard,   0,        yard,     yard,     0, ROT0, "Irem", "10-Yard Fight (World, set 1)", GAME_SUPPORTS_SAVE ) // no copyright
369450GAME( 1983, 10yardj,  10yard,   yard,     yard,     0, ROT0, "Irem", "10-Yard Fight (Japan)", GAME_SUPPORTS_SAVE )
370451GAME( 1984, vs10yard, 10yard,   yard,     vs10yard, 0, ROT0, "Irem", "Vs 10-Yard Fight (World, 11/05/84)", GAME_SUPPORTS_SAVE )
371452GAME( 1984, vs10yardj,10yard,   yard,     vs10yarj, 0, ROT0, "Irem", "Vs 10-Yard Fight (Japan)", GAME_SUPPORTS_SAVE )
453GAME( 1984, vs10yardu,10yard,   yard,     vs10yard, yard85, ROT0, "[Irem] (Taito license)", "Vs 10-Yard Fight (US, Taito license)", GAME_SUPPORTS_SAVE ) // had '85 stickers, but doesn't have '85 on the title screen like the set below
454GAME( 1985, 10yard85, 10yard,   yard,     yard,     yard85, ROT0, "[Irem] (Taito license)", "10-Yard Fight '85 (US, Taito license)", GAME_SUPPORTS_SAVE )
455
src/mame/drivers/starwars.c
r7882r7883
352352   MDRV_SOUND_START(starwars)
353353   MDRV_SPEAKER_STANDARD_MONO("mono")
354354
355   MDRV_SOUND_ADD("pokey1", POKEY, 1500000)
355   MDRV_SOUND_ADD("pokey1", POKEY, MASTER_CLOCK / 8)
356356   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
357357
358   MDRV_SOUND_ADD("pokey2", POKEY, 1500000)
358   MDRV_SOUND_ADD("pokey2", POKEY, MASTER_CLOCK / 8)
359359   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
360360
361   MDRV_SOUND_ADD("pokey3", POKEY, 1500000)
361   MDRV_SOUND_ADD("pokey3", POKEY, MASTER_CLOCK / 8)
362362   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
363363
364   MDRV_SOUND_ADD("pokey4", POKEY, 1500000)
364   MDRV_SOUND_ADD("pokey4", POKEY, MASTER_CLOCK / 8)
365365   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
366366
367   MDRV_SOUND_ADD("tms", TMS5220, 640000)
367   MDRV_SOUND_ADD("tms", TMS5220, MASTER_CLOCK/2/9)
368368   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
369369MACHINE_DRIVER_END
370370
src/mame/drivers/sauro.c
r7882r7883
7171
7272Addition by Reip
7373
74
75Stephh's notes (based on the games Z80 code and some tests) :
76
771) 'sauro'
78
79  - Press START1 while in "test mode" to cycle through different screens
80    (colors, Dip Switches, Inputs)
81  - When "Freeze" Dip Switch is ON, press START1 to freeze and START2 to unfreeze.
82    This setting (as well as others) must be defined before reseting the games.
83  - "Test mode" crashes when trying to display "Difficult" ("Hard") because the full string
84    is 15 bytes long while other string are 14, so the 15th "char" is NOT 0x00 :
85      * 0xd49f : mask (0x30)
86      * 0xd4a0-0xd4a7 : offset of settings to display (4 x 2 bytes, LSB first) :
87        0xd58e, 0xd5a5, 0xd5bc, 0xd5d4
88  - Player 2 uses player 2 inputs only when "Cabinet" Dip Switch is set to "Cocktail"
89    (code at 0x2e40 : start reading inputs).
90
912) 'trckydoc' and clones
92
93  - Press START1 while in "test mode" to cycle through different screens
94    (colors, Dip Switches, Inputs)
95  - When "Freeze" Dip Switch is ON, press START1 to freeze and START2 to unfreeze.
96    This setting (as well as others) must be defined before reseting the games.
97
982a) 'trckydoc'
99
100  - Settings are the SAME as in 'sauro', but there is NO bug in the "test mode" :
101      * 0xcd19 : mask (0x30)
102      * 0xcd1a-0xcd22 : offset of settings to display (4 x 2 bytes, LSB first) :
103        0xce0a, 0xce21, 0xce38, 0xce4f
104  - Player 2 uses player 2 inputs only when "Cabinet" Dip Switch is set to "Cocktail"
105    (extra code at 0xdf10 - code at 0x3f80 : start reading inputs).
106  - You can't get any extra life nor extra credit.
107
1082b) 'trckydoca'
109
110  - Coinage B is slightly different : you have 1C_1C instead of 1C_5C (table at 0x02e1).
111    Such change isn't notified in the "test mode" though.
112  - Player 2 uses player 2 inputs regardless of "Cabinet" Dip Switch
113    (NO extra code at 0xdf10 - code at 0x3f80 : start reading inputs).
114  - You can get an extra life at 90000 points and an extra credit at 500000 points
115    but there is no music/sound to tell that to you (extra code at 0xdf30).
116    This is only possible if you continue a game and have already got the life or
117    the credit (extra code at 0xdf90 resets the flags if you don't continue).
118    This info is written in "attract mode" when you don't have any credits
119    instead of displaying the "INSERT COIN" message.
120
74121***************************************************************************/
75122
76123#include "emu.h"
r7882r7883
201248ADDRESS_MAP_END
202249
203250
251/* verified from Z80 code */
204252static INPUT_PORTS_START( tecfri )
205253   PORT_START("P1")
206254   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
207255   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
208256   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
209257   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
210   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
258   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
211259   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
212   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
213   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
260   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_8WAY
261   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_8WAY
214262
215   PORT_START("P2")
263   PORT_START("P2")                                                  /* see notes */
216264   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
217265   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
218266   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
219267   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
220   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
268   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
221269   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
222   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
223   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
270   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_8WAY PORT_COCKTAIL
271   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_8WAY PORT_COCKTAIL
224272
225273   PORT_START("DSW1")
226274   PORT_SERVICE( 0x01, IP_ACTIVE_HIGH )
r7882r7883
234282   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
235283   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
236284   PORT_DIPNAME( 0x30, 0x20, DEF_STR( Difficulty ) )
237   PORT_DIPSETTING(    0x30, DEF_STR( Very_Easy) )
285   PORT_DIPSETTING(    0x30, DEF_STR( Very_Easy ) )
238286   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
239   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )                         /* This crashes test mode!!! */
287   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )                      /* This crashes test mode in 'sauro' but not in other games !!! - see notes */
240288   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
241289   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )
242290   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
r7882r7883
261309   PORT_DIPSETTING(    0x20, "3" )
262310   PORT_DIPSETTING(    0x10, "4" )
263311   PORT_DIPSETTING(    0x00, "5" )
264   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
265   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
266   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
267   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
268   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
269   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
312   PORT_DIPUNUSED( 0x40, IP_ACTIVE_HIGH )
313   PORT_DIPUNUSED( 0x80, IP_ACTIVE_HIGH )
270314INPUT_PORTS_END
271315
272316
317/* verified from Z80 code */
318static INPUT_PORTS_START( trckydoca )
319   PORT_INCLUDE(tecfri)
320
321   PORT_MODIFY("DSW2")
322   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
323   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
324   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_2C ) )
325   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
326   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
327INPUT_PORTS_END
328
329
273330static const gfx_layout charlayout =
274331{
275332   8,8,   /* 8*8 chars */
r7882r7883
488545   RAM[0xe000] = 1;
489546}
490547
491GAME( 1987, sauro,    0,        sauro,    tecfri, tecfri, ROT0, "Tecfri", "Sauro", 0 )
492GAME( 1987, trckydoc, 0,        trckydoc, tecfri, tecfri, ROT0, "Tecfri", "Tricky Doc (Set 1)", 0 )
493GAME( 1987, trckydoca,trckydoc, trckydoc, tecfri, tecfri, ROT0, "Tecfri", "Tricky Doc (Set 2)", 0 )
494
548GAME( 1987, sauro,    0,        sauro,    tecfri,    tecfri, ROT0, "Tecfri", "Sauro", 0 )
549GAME( 1987, trckydoc, 0,        trckydoc, tecfri,    tecfri, ROT0, "Tecfri", "Tricky Doc (Set 1)", 0 )
550GAME( 1987, trckydoca,trckydoc, trckydoc, trckydoca, tecfri, ROT0, "Tecfri", "Tricky Doc (Set 2)", 0 )
src/mame/drivers/megadriv.c
r7882r7883
15331533   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_PLAYER(2) PORT_NAME("P2 MODE") // mode
15341534INPUT_PORTS_END
15351535
1536/* verified from M68000 code */
15361537INPUT_PORTS_START( ssf2ghw )
15371538   PORT_INCLUDE( md_common )
15381539
r7882r7883
15461547   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
15471548   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
15481549   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1549   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
1550   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 )
15501551
15511552   PORT_START("EXTRA1")   /* Extra buttons for Joypad 1 (6 button + start + mode) NOT READ DIRECTLY */
15521553   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
r7882r7883
16061607//  PORT_DIPSETTING(    0x00, "10 (Fastest)" )
16071608INPUT_PORTS_END
16081609
1609INPUT_PORTS_START(mk3ghw)
1610/* verified from M68000 code */
1611INPUT_PORTS_START( mk3ghw )
16101612   PORT_INCLUDE( md_common )
16111613
16121614   PORT_MODIFY("PAD1")
r7882r7883
16341636   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
16351637
16361638   PORT_START("IN0")
1637   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
1638   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1)
1639   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1640   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
16391641
16401642   PORT_START("DSWA")
16411643   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
r7882r7883
16461648   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
16471649   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
16481650   PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
1649   PORT_BIT( 0xf8, 0x00, IPT_UNUSED )
1651//  PORT_DIPSETTING(   0x00, DEF_STR( 1C_1C ) )
16501652
16511653   PORT_START("DSWB")
1652   PORT_DIPUNKNOWN( 0x01, 0x00 )
1653   PORT_DIPUNKNOWN( 0x02, 0x00 )
1654   PORT_DIPUNKNOWN( 0x04, 0x00 )
1655   PORT_DIPUNKNOWN( 0x08, 0x00 )
1656   PORT_DIPUNKNOWN( 0x10, 0x00 )
1657   PORT_DIPUNKNOWN( 0x20, 0x00 )
1654   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
1655   PORT_DIPSETTING(    0x07, DEF_STR( Easiest ) )
1656   PORT_DIPSETTING(    0x06, DEF_STR( Easy ) )
1657   PORT_DIPSETTING(    0x05, DEF_STR( Medium ) )
1658   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
1659   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
1660//  PORT_DIPSETTING(    0x02, DEF_STR( Hardest ) )
1661//  PORT_DIPSETTING(    0x01, DEF_STR( Hardest ) )
1662//  PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1663   PORT_DIPUNUSED( 0x08, IP_ACTIVE_HIGH )
1664   PORT_DIPUNUSED( 0x10, IP_ACTIVE_HIGH )
1665   PORT_DIPUNUSED( 0x20, IP_ACTIVE_HIGH )
16581666   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
16591667   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
16601668   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1661   PORT_DIPUNKNOWN( 0x80, 0x00 )
1669   PORT_DIPNAME( 0x80, 0x80, "Blood" )
1670   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1671   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1672
1673   PORT_START("DSWC")        /* not even read in this set */
16621674INPUT_PORTS_END
16631675
1664
1676/* verified from M68000 code */
16651677INPUT_PORTS_START( aladbl )
16661678   PORT_INCLUDE( md_common )
16671679
r7882r7883
16911703   PORT_DIPSETTING(    0x00, DEF_STR( Normal ) )           /* "NORMAL" */
16921704   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )             /* "DIFFICULT" */
16931705//  PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
1694   PORT_DIPUNUSED( 0x0040, IP_ACTIVE_HIGH )
1695   PORT_DIPUNUSED( 0x0080, IP_ACTIVE_HIGH )
1706   PORT_DIPUNUSED( 0x40, IP_ACTIVE_HIGH )
1707   PORT_DIPUNUSED( 0x80, IP_ACTIVE_HIGH )
16961708   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)     /* needed to avoid credits getting mad */
16971709INPUT_PORTS_END
16981710
1711/* verified from M68000 code */
1712INPUT_PORTS_START( ssgbl )
1713   PORT_INCLUDE( md_common )
1714
1715   PORT_MODIFY("PAD1")
1716   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Shoot") // a
1717   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Jump") // b
1718   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) // c (duplicate shoot button)
1719   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) // start
1720
1721   PORT_MODIFY("PAD2")
1722   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P1 Shoot") // a
1723   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P1 Jump") // b
1724   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) // c (duplicate shoot button)
1725   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 )
1726
1727   PORT_START("IN0")      /* 3rd I/O port */
1728   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1729   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1730
1731   PORT_START("DSWA")
1732   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
1733   PORT_DIPSETTING(    0x01, DEF_STR( 4C_1C ) )
1734   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
1735   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
1736   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1737   PORT_DIPSETTING(    0x07, DEF_STR( 1C_2C ) )
1738   PORT_DIPSETTING(    0x06, DEF_STR( 1C_3C ) )
1739   PORT_DIPSETTING(    0x05, DEF_STR( 1C_4C ) )
1740   PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
1741
1742   PORT_START("DSWB")
1743   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
1744   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
1745   PORT_DIPSETTING(    0x02, DEF_STR( Medium ) )
1746   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
1747   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1748
1749   PORT_START("DSWC")
1750   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
1751   PORT_DIPSETTING(    0x03, "3" )
1752   PORT_DIPSETTING(    0x02, "4" )
1753   PORT_DIPSETTING(    0x01, "5" )
1754   PORT_DIPSETTING(    0x00, "6" )
1755INPUT_PORTS_END
1756
16991757UINT8 megadrive_io_data_regs[3];
17001758UINT8 megadrive_io_ctrl_regs[3];
17011759static UINT8 megadrive_io_tx_regs[3];
src/mame/drivers/gaiden.c
r7882r7883
386386   AM_RANGE(0x074000, 0x075fff) AM_READWRITE(gaiden_videoram3_r, gaiden_videoram3_w) AM_BASE_MEMBER(gaiden_state, videoram3)
387387   AM_RANGE(0x076000, 0x077fff) AM_RAM AM_BASE_SIZE_MEMBER(gaiden_state, spriteram, spriteram_size)
388388   AM_RANGE(0x078000, 0x079fff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
389   AM_RANGE(0x078800, 0x079fff) AM_READNOP   /* extra portion of palette RAM, not really used */
390389   AM_RANGE(0x07a000, 0x07a001) AM_READ_PORT("SYSTEM")
391390   AM_RANGE(0x07a002, 0x07a003) AM_READ_PORT("P1_P2")
392391   AM_RANGE(0x07a004, 0x07a005) AM_READ_PORT("DSW")
r7882r7883
765764static GFXDECODE_START( gaiden )
766765   GFXDECODE_ENTRY( "gfx1", 0, tilelayout,        0x100, 16 )   /* tiles 8x8  */
767766   GFXDECODE_ENTRY( "gfx2", 0, tile2layout,       0x300, 16 )   /* tiles 16x16 */
768   GFXDECODE_ENTRY( "gfx3", 0, tile2layout,       0x200, 16 )   /* tiles 16x16 */
769   GFXDECODE_ENTRY( "gfx4", 0, spritelayout,      0x000, 16 )   /* sprites 8x8 */
767   GFXDECODE_ENTRY( "gfx3", 0, tile2layout,       0x200, 16+128 )   /* tiles 16x16 */
768   GFXDECODE_ENTRY( "gfx4", 0, spritelayout,      0x000, 16+128 )   /* sprites 8x8 */
770769GFXDECODE_END
771770
772771static GFXDECODE_START( raiga )
r7882r7883
872871   MDRV_SCREEN_ADD("screen", RASTER)
873872   MDRV_SCREEN_REFRESH_RATE(59.17)   /* verified on pcb */
874873   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
875   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
874   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
876875   MDRV_SCREEN_SIZE(32*8, 32*8)
877876   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
878877
r7882r7883
10561055   MDRV_SCREEN_ADD("screen", RASTER)
10571056   MDRV_SCREEN_REFRESH_RATE(59.17)   /* verified on pcb */
10581057   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1059   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1058   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
10601059   MDRV_SCREEN_SIZE(32*8, 32*8)
10611060   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
10621061
src/mame/drivers/finalizr.c
r7882r7883
336336   ROM_LOAD16_BYTE( "523h09.7f",    0x10001, 0x4000, CRC(8896dc85) SHA1(91493c6b69655de482f0c2a0cb3662fc0d1b6e45) )
337337   /* 18000-1ffff empty */
338338
339   ROM_REGION( 0x0240, "proms", 0 )
339   ROM_REGION( 0x0240, "proms", 0 ) /* PROMs at 2F & 3F are MMI 63S081N (or compatibles), PROMs at 10F & 11F are MMI 6301-1N (or compatibles) */
340340   ROM_LOAD( "523h10.2f",    0x0000, 0x0020, CRC(ec15dd15) SHA1(710384b154a9363fdc88edffda252f1d60e000dc) ) /* palette */
341341   ROM_LOAD( "523h11.3f",    0x0020, 0x0020, CRC(54be2e83) SHA1(3200abc7f2238d62d7204ef57a6daa2df150538d) ) /* palette */
342342   ROM_LOAD( "523h13.11f",   0x0040, 0x0100, CRC(4e0647a0) SHA1(fb87f878456b8b76bb2c028cb890d2a5c1c3e388) ) /* characters */
r7882r7883
360360   ROM_LOAD16_BYTE( "523h09.7f",    0x10001, 0x4000, CRC(8896dc85) SHA1(91493c6b69655de482f0c2a0cb3662fc0d1b6e45) )
361361   /* 18000-1ffff empty */
362362
363   ROM_REGION( 0x0240, "proms", 0 )
363   ROM_REGION( 0x0240, "proms", 0 ) /* PROMs at 2F & 3F are MMI 63S081N (or compatibles), PROMs at 10F & 11F are MMI 6301-1N (or compatibles) */
364364   ROM_LOAD( "523h10.2f",    0x0000, 0x0020, CRC(ec15dd15) SHA1(710384b154a9363fdc88edffda252f1d60e000dc) ) /* palette */
365365   ROM_LOAD( "523h11.3f",    0x0020, 0x0020, CRC(54be2e83) SHA1(3200abc7f2238d62d7204ef57a6daa2df150538d) ) /* palette */
366366   ROM_LOAD( "523h13.11f",   0x0040, 0x0100, CRC(4e0647a0) SHA1(fb87f878456b8b76bb2c028cb890d2a5c1c3e388) ) /* characters */
src/mame/drivers/tmnt.c
r7882r7883
31203120   ROM_LOAD( "963a25.d5",      0x00000, 0x80000, CRC(fca078c7) SHA1(3e1124d72c9db4cb11d8de6c44b7aeca967f44e1) )
31213121ROM_END
31223122
3123ROM_START( tmhta )
3124   ROM_REGION( 0x60000, "maincpu", 0 )   /* 2*128k and 2*64k for 68000 code */
3125   ROM_LOAD16_BYTE( "963-s23.j17",   0x00000, 0x20000, CRC(b5af7eee) SHA1(082c8faabb0d409f73a17d7d342c0afb0f936b91) )
3126   ROM_LOAD16_BYTE( "963-s24.k17",   0x00001, 0x20000, CRC(bcb8ce8b) SHA1(d9a74627598e29110002ea5d81a4f165d7566329) )
3127   ROM_LOAD16_BYTE( "963-s21.j15",   0x40000, 0x10000, CRC(0b88bfa6) SHA1(22d552c0aaab336cd7c36d57fde22a64257a0633) )
3128   ROM_LOAD16_BYTE( "963-s22.k15",   0x40001, 0x10000, CRC(44ce6d4b) SHA1(17e3baa33ab182f21b2686786ba570514830ed83) )
3129
3130   ROM_REGION( 0x10000, "audiocpu", 0 )
3131   ROM_LOAD( "963e20.g13",      0x00000, 0x08000, CRC(1692a6d6) SHA1(68c3419012b2863e91a7d7e479fce5ceabb10b88) )
3132
3133   ROM_REGION( 0x100000, "gfx1", 0 )   /* graphics (addressable by the main CPU) */
3134   ROM_LOAD( "963a28.h27",      0x000000, 0x80000, CRC(db4769a8) SHA1(810811914f9c1fbf2320d5a9030cbf124f6d78cf) )        /* 8x8 tiles */
3135   ROM_LOAD( "963a29.k27",      0x080000, 0x80000, CRC(8069cd2e) SHA1(54095d3546119ccd1e8814d692aceb1327c9369f) )        /* 8x8 tiles */
3136
3137   ROM_REGION( 0x200000, "gfx2", 0 )   /* graphics (addressable by the main CPU) */
3138   ROM_LOAD( "963a17.h4",      0x000000, 0x80000, CRC(b5239a44) SHA1(84e94807e7c51aa652b4e4b827b36be59a53d0d6) )        /* sprites */
3139   ROM_LOAD( "963a18.h6",      0x080000, 0x80000, CRC(dd51adef) SHA1(5010c0911b0b9e4f23a785e8a751a0bde5be5be0) )        /* sprites */
3140   ROM_LOAD( "963a15.k4",      0x100000, 0x80000, CRC(1f324eed) SHA1(971a675578518fffa341a943d0cc4fdea005fde0) )        /* sprites */
3141   ROM_LOAD( "963a16.k6",      0x180000, 0x80000, CRC(d4bd9984) SHA1(d780ae7f72e16767c3a492544f02f0f1a332ab22) )        /* sprites */
3142
3143   ROM_REGION( 0x0200, "proms", 0 )
3144   ROM_LOAD( "963a30.g7",      0x0000, 0x0100, CRC(abd82680) SHA1(945a71e6ec65202f13209b45d45b616372d6c0f5) )   /* sprite address decoder */
3145   ROM_LOAD( "963a31.g19",      0x0100, 0x0100, CRC(f8004a1c) SHA1(ed6694b8eebfe0238b50ebd05007d519f6e57b1b) )   /* priority encoder (not used) */
3146
3147   ROM_REGION( 0x20000, "k007232", 0 )   /* 128k for the samples */
3148   ROM_LOAD( "963a26.c13",      0x00000, 0x20000, CRC(e2ac3063) SHA1(5bb294c46fb5eaba9935a18c0aa5d3931168f474) ) /* samples for 007232 */
3149
3150   ROM_REGION( 0x20000, "upd", 0 )   /* 128k for the samples */
3151   ROM_LOAD( "963a27.d18",      0x00000, 0x20000, CRC(2dfd674b) SHA1(bbec5896c70056964fbc972a84bd5b0dfc6af257) ) /* samples for UPD7759C */
3152
3153   ROM_REGION( 0x80000, "title", 0 )   /* 512k for the title music sample */
3154   ROM_LOAD( "963a25.d5",      0x00000, 0x80000, CRC(fca078c7) SHA1(3e1124d72c9db4cb11d8de6c44b7aeca967f44e1) )
3155ROM_END
3156
31233157ROM_START( tmntj )
31243158   ROM_REGION( 0x60000, "maincpu", 0 )   /* 2*128k and 2*64k for 68000 code */
31253159   ROM_LOAD16_BYTE( "963_223.j17",  0x00000, 0x20000, CRC(0d34a5ff) SHA1(a387f3e7c727dc66ebb0e1f40e4ab8dc83f647e5) )
r7882r7883
43004334GAME( 1989, tmnt,        0,        tmnt,     tmnt,     tmnt,     ROT0,  "Konami", "Teenage Mutant Ninja Turtles (World 4 Players)", GAME_SUPPORTS_SAVE )
43014335GAME( 1989, tmntu,       tmnt,     tmnt,     tmnt,     tmnt,     ROT0,  "Konami", "Teenage Mutant Ninja Turtles (US 4 Players, set 1)", GAME_SUPPORTS_SAVE )
43024336GAME( 1989, tmntua,      tmnt,     tmnt,     tmnt,     tmnt,     ROT0,  "Konami", "Teenage Mutant Ninja Turtles (US 4 Players, set 2)", GAME_SUPPORTS_SAVE )
4303GAME( 1989, tmht,        tmnt,     tmnt,     tmnt,     tmnt,     ROT0,  "Konami", "Teenage Mutant Hero Turtles (UK 4 Players)", GAME_SUPPORTS_SAVE )
4337GAME( 1989, tmht,        tmnt,     tmnt,     tmnt,     tmnt,     ROT0,  "Konami", "Teenage Mutant Hero Turtles (UK 4 Players, set 1)", GAME_SUPPORTS_SAVE )
4338GAME( 1989, tmhta,       tmnt,     tmnt,     tmnt,     tmnt,     ROT0,  "Konami", "Teenage Mutant Hero Turtles (UK 4 Players, set 2)", GAME_SUPPORTS_SAVE )
43044339GAME( 1990, tmntj,       tmnt,     tmnt,     tmnt,     tmnt,     ROT0,  "Konami", "Teenage Mutant Ninja Turtles (Japan 4 Players)", GAME_SUPPORTS_SAVE )
43054340GAME( 1989, tmht2p,      tmnt,     tmnt,     tmnt2p,   tmnt,     ROT0,  "Konami", "Teenage Mutant Hero Turtles (UK 2 Players, set 1)", GAME_SUPPORTS_SAVE )
43064341GAME( 1989, tmht2pa,     tmnt,     tmnt,     tmnt2p,   tmnt,     ROT0,  "Konami", "Teenage Mutant Hero Turtles (UK 2 Players, set 2)", GAME_SUPPORTS_SAVE )
src/mame/drivers/subsino.c
r7882r7883
66   Additional work by   David Haywood, Angelo Salese and Roberto Fresca.
77
88
9  CPU:    Z180 (in a black box)
9  CPU: Black epoxy box containing:
10       1x CXK58257M (32768 x 8-Bit) High Speed CMOS SRAM.
11       1x HD647180X0P6, HD643180X0P6 or HD641180X0P6 Z180-CPU.
12       1x X-TAL (unknown frequency).
13       1x Battery.
14
1015  GFX:    1 Tilemap (8x8 tiles, no scrolling)
1116  CUSTOM: 2 x SUBSINO SS9100, SUBSINO SS9101
1217  SOUND:  M6295, YM2413 or YM3812
r7882r7883
146151  - Some clean-ups...
147152
148153
154  2010-04-20
155  ----------
156
157  Shark Party (English, Alpha license):
158
159  - Created complete inputs from the scratch.
160  - Added coin/keyin/keyout counters.
161  - Added main game and double-up rates DIP switches.
162  - Added minimum bet DIP switches.
163  - Added maximum bet DIP switches.
164  - Added complete coinage and remote credits DIP switches.
165  - Added jokers and demo sounds DIP switches.
166  - Figured out and documented all the game outputs.
167  - Created proper button-lamps layout.
168
169
149170***************************************************************************/
150171
151172#include "emu.h"
r7882r7883
158179#include "victor21.lh"
159180#include "crsbingo.lh"
160181#include "sharkpy.lh"
182#include "sharkpye.lh"
161183#include "smoto.lh"
162184#include "tisub.lh"
163185
186
164187/***************************************************************************
165188*                              Video Hardware                              *
166189***************************************************************************/
r7882r7883
176199static UINT8* reel1_scroll;
177200static UINT8* reel2_scroll;
178201static UINT8* reel3_scroll;
202static UINT8 subsino_out_c;
203static UINT8* reel1_attr;
204static UINT8* reel2_attr;
205static UINT8* reel3_attr;
179206
180
181207static WRITE8_HANDLER( subsino_tiles_offset_w )
182208{
183209   tiles_offset = (data & 1) ? 0x1000: 0;
r7882r7883
206232   SET_TILE_INFO(0, code, color, 0);
207233}
208234
235static TILE_GET_INFO( get_stisub_tile_info )
236{
237   UINT16 code = videoram[ tile_index ] + (colorram[ tile_index ] << 8);
238   code&= 0x3fff;
239   SET_TILE_INFO(0, code, 0, 0);
240}
209241
210242
211243static VIDEO_START( subsino )
r7882r7883
226258static TILE_GET_INFO( get_subsino_reel1_tile_info )
227259{
228260   int code = reel1_ram[tile_index];
261   int colour = (subsino_out_c&0x7) + 8;
229262
230263   SET_TILE_INFO(
231264         1,
232265         code,
266         colour,
267         0);
268}
269
270static TILE_GET_INFO( get_stisub_reel1_tile_info )
271{
272   int code = reel1_ram[tile_index];
273   int attr = reel1_attr[tile_index];
274
275   SET_TILE_INFO(
276         1,
277         code | (attr << 8),
233278         0,
234279         0);
235280}
r7882r7883
244289static TILE_GET_INFO( get_subsino_reel2_tile_info )
245290{
246291   int code = reel2_ram[tile_index];
292   int colour = (subsino_out_c&0x7) + 8;
247293
248294   SET_TILE_INFO(
249295         1,
250296         code,
297         colour,
298         0);
299}
300
301static TILE_GET_INFO( get_stisub_reel2_tile_info )
302{
303   int code = reel2_ram[tile_index];
304   int attr = reel2_attr[tile_index];
305
306   SET_TILE_INFO(
307         1,
308         code | (attr << 8),
251309         0,
252310         0);
253311}
r7882r7883
261319static TILE_GET_INFO( get_subsino_reel3_tile_info )
262320{
263321   int code = reel3_ram[tile_index];
322   int colour = (subsino_out_c&0x7) + 8;
264323
265324   SET_TILE_INFO(
266325         1,
267326         code,
327         colour,
328         0);
329}
330
331static TILE_GET_INFO( get_stisub_reel3_tile_info )
332{
333   int code = reel3_ram[tile_index];
334   int attr = reel3_attr[tile_index];
335
336   SET_TILE_INFO(
337         1,
338         code | (attr << 8),
268339         0,
269340         0);
270341}
271342
272343
273
274344static VIDEO_START( subsino_reels )
275345{
276346   VIDEO_START_CALL( subsino );
r7882r7883
285355
286356}
287357
358static VIDEO_START( stisub )
359{
360   tmap = tilemap_create(   machine, get_stisub_tile_info, tilemap_scan_rows, 8,8, 0x40,0x20 );
361   tilemap_set_transparent_pen( tmap, 0 );
362
363   reel1_tilemap = tilemap_create(machine,get_stisub_reel1_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
364   reel2_tilemap = tilemap_create(machine,get_stisub_reel2_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
365   reel3_tilemap = tilemap_create(machine,get_stisub_reel3_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
366
367   tilemap_set_scroll_cols(reel1_tilemap, 64);
368   tilemap_set_scroll_cols(reel2_tilemap, 64);
369   tilemap_set_scroll_cols(reel3_tilemap, 64);
370
371   subsino_out_c = 0x08;
372}
373
374
288375static VIDEO_UPDATE( subsino )
289376{
290377   bitmap_fill(bitmap,cliprect,0);
r7882r7883
309396      tilemap_set_scrolly(reel3_tilemap, i, reel3_scroll[i]);
310397   }
311398
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);
399   if (subsino_out_c&0x08)
400   {
401      tilemap_draw(bitmap, &visible1, reel1_tilemap, 0, 0);
402      tilemap_draw(bitmap, &visible2, reel2_tilemap, 0, 0);
403      tilemap_draw(bitmap, &visible3, reel3_tilemap, 0, 0);
404   }
315405
316406   tilemap_draw(bitmap,cliprect, tmap, 0, 0);
317407   return 0;
318408}
319409
410// areas based on d-up game in attract mode
411static const rectangle stisub_visible1 = { 0, 511,  0,  87 };
412static const rectangle stisub_visible2 = { 0, 511,  88, 143 };
413static const rectangle stisub_visible3 = { 0, 511,  144, 223 };
414
415
416static VIDEO_UPDATE( stisub_reels )
417{
418   int i;
419   bitmap_fill(bitmap,cliprect,0);
420
421   if (reel1_attr)
422   {
423      tilemap_mark_all_tiles_dirty (reel1_tilemap);
424      tilemap_mark_all_tiles_dirty (reel2_tilemap);
425      tilemap_mark_all_tiles_dirty (reel3_tilemap);
426   }
427
428   for (i= 0;i < 64;i++)
429   {
430      tilemap_set_scrolly(reel1_tilemap, i, reel1_scroll[i]);
431      tilemap_set_scrolly(reel2_tilemap, i, reel2_scroll[i]);
432      tilemap_set_scrolly(reel3_tilemap, i, reel3_scroll[i]);
433   }
434
435   if (subsino_out_c&0x08)
436   {
437      tilemap_draw(bitmap, &stisub_visible1, reel1_tilemap, 0, 0);
438      tilemap_draw(bitmap, &stisub_visible2, reel2_tilemap, 0, 0);
439      tilemap_draw(bitmap, &stisub_visible3, reel3_tilemap, 0, 0);
440   }
441
442   tilemap_draw(bitmap,cliprect, tmap, 0, 0);
443   return 0;
444}
445
446
447
320448static PALETTE_INIT( subsino_2proms )
321449{
322450   int i,r,g,b,val;
r7882r7883
380508/***** COIN PULSE: *****
381509
382510
383  * Victor 5, Victor 21, Poker Carnival (crsbingo).
511  * Victor 5, Victor 21, Poker Carnival (crsbingo), Shark Party (English, Alpha license).
384512
385513  7654 3210
386514  ---- ---x  Coin pulse.
r7882r7883
504632  -x-- ----  HOLD2.
505633  x--- ----  HOLD5 / SMALL.
506634
635
636  * Shark Party (English, Alpha license).
637
638  7654 3210
639  ---- ---x  ???.
640  ---- --x-  HOLD3 / D-UP.
641  ---- -x--  START.
642  ---- x---  HOLD1 / BET.
643  ---x ----  ???.
644  --x- ----  HOLD2 / TAKE.
645  -x-- ----  ???.
646  x--- ----  HOLD4 & HOLD5.
647
507648*/
508649
509650   output_set_lamp_value(0, (data) & 1);      /* Lamp 0 */
r7882r7883
715856
716857ADDRESS_MAP_END
717858
859WRITE8_HANDLER( subsino_out_c_w )
860{
861   // not 100% sure on this
862
863   // ???? eccc
864   // e = enable reels?
865   // c = reel colour bank?
866   subsino_out_c = data;
867
868   tilemap_mark_all_tiles_dirty (reel1_tilemap);
869   tilemap_mark_all_tiles_dirty (reel2_tilemap);
870   tilemap_mark_all_tiles_dirty (reel3_tilemap);
871//  popmessage("data %02x\n",data);
872}
873
718874static ADDRESS_MAP_START( tisub_map, ADDRESS_SPACE_PROGRAM, 8 )
719875   AM_RANGE( 0x09800, 0x09fff ) AM_RAM
720876
r7882r7883
727883   AM_RANGE( 0x09006, 0x09006 ) AM_READ_PORT( "INB" )
728884
729885   /* 0x09008: is marked as OUTPUT C in the test mode. */
886   AM_RANGE( 0x09008, 0x09008 ) AM_WRITE( subsino_out_c_w )
730887   AM_RANGE( 0x09009, 0x09009 ) AM_WRITE( subsino_out_b_w )
731888   AM_RANGE( 0x0900a, 0x0900a ) AM_WRITE( subsino_out_a_w )
732889
r7882r7883
755912   AM_RANGE( 0x15c00, 0x15dff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_BASE(&reel3_ram)
756913ADDRESS_MAP_END
757914
915static int colordac_offs;
916UINT8* stisub_colorram;
917
918static WRITE8_HANDLER(colordac_w)
919{
920   switch ( offset )
921   {
922      case 0:
923         colordac_offs = data * 3;
924         break;
925
926      case 1:
927         stisub_colorram[colordac_offs] = data;
928         palette_set_color_rgb(space->machine, colordac_offs/3,
929            pal6bit(stisub_colorram[(colordac_offs/3)*3+0]),
930            pal6bit(stisub_colorram[(colordac_offs/3)*3+1]),
931            pal6bit(stisub_colorram[(colordac_offs/3)*3+2])
932         );
933         colordac_offs = (colordac_offs+1) % (256*3);
934         break;
935
936      case 2:
937         // ff?
938         break;
939
940      case 3:
941         break;
942   }
943}
944
945UINT8 stisub_outc;
946
947WRITE8_HANDLER( stisub_out_c_w )
948{
949   stisub_outc = data;
950
951}
952
953// this stuff is banked..
954// not 100% sure on the bank bits.. other bits are also set
955WRITE8_HANDLER( reel_scrollattr_w )
956{
957   if (stisub_outc&0x20)
958   {
959      if (offset<0x200)
960      {
961         reel1_attr[offset&0x1ff] = data;
962      }
963      else if (offset<0x400)
964      {
965         reel2_attr[offset&0x1ff] = data;
966      }
967      else if (offset<0x600)
968      {
969         reel3_attr[offset&0x1ff] = data;
970      }
971      else
972      {
973         // ??
974      }
975   }
976   else
977   {
978      offset &=0xff;
979
980      if (offset<0x40)
981      {
982         // ??
983      }
984      else if (offset<0x80)
985      {
986         reel2_scroll[offset&0x3f] = data;
987      }
988      else if (offset<0xc0)
989      {
990         reel1_scroll[offset&0x3f] = data;
991      }
992      else
993      {
994         reel3_scroll[offset&0x3f] = data;
995      }
996   }
997}
998
999READ8_HANDLER( reel_scrollattr_r )
1000{
1001   return reel1_attr[offset];
1002}
1003
1004static ADDRESS_MAP_START( stisub_map, ADDRESS_SPACE_PROGRAM, 8 )
1005   AM_RANGE( 0x00000, 0x0bfff ) AM_ROM
1006
1007   AM_RANGE( 0x0c000, 0x0cfff ) AM_RAM
1008
1009   AM_RANGE( 0x0d000, 0x0d000 ) AM_READ_PORT( "SW1" )
1010   AM_RANGE( 0x0d001, 0x0d001 ) AM_READ_PORT( "SW2" )
1011   AM_RANGE( 0x0d002, 0x0d002 ) AM_READ_PORT( "SW3" )
1012
1013   AM_RANGE( 0x0d004, 0x0d004 ) AM_READ_PORT( "SW4" )
1014   AM_RANGE( 0x0d005, 0x0d005 ) AM_READ_PORT( "INB" )
1015   AM_RANGE( 0x0d006, 0x0d006 ) AM_READ_PORT( "INA" )
1016
1017   AM_RANGE( 0x0d008, 0x0d008 ) AM_WRITE( stisub_out_c_w )
1018
1019   AM_RANGE( 0x0d009, 0x0d009 ) AM_WRITE( subsino_out_b_w )
1020   AM_RANGE( 0x0d00a, 0x0d00a ) AM_WRITE( subsino_out_a_w )
1021
1022   AM_RANGE( 0x0d00c, 0x0d00c ) AM_READ_PORT( "INC" )
1023
1024   AM_RANGE( 0x0d010, 0x0d013 ) AM_WRITE(colordac_w)
1025
1026   AM_RANGE( 0x0d016, 0x0d017 ) AM_DEVWRITE( "ymsnd", ym3812_w )
1027
1028//  AM_RANGE( 0x0d01b, 0x0d01b ) AM_WRITE( subsino_tiles_offset_w )
1029
1030   AM_RANGE( 0x0e000, 0x0e7ff ) AM_RAM_WRITE( subsino_colorram_w ) AM_BASE( &colorram )
1031   AM_RANGE( 0x0e800, 0x0efff ) AM_RAM_WRITE( subsino_videoram_w ) AM_BASE( &videoram )
1032
1033   AM_RANGE( 0xf000, 0xf7ff ) AM_READWRITE(reel_scrollattr_r, reel_scrollattr_w)
1034
1035   AM_RANGE( 0xf800, 0xf9ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_BASE(&reel1_ram)
1036   AM_RANGE( 0xfa00, 0xfbff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_BASE(&reel2_ram)
1037   AM_RANGE( 0xfc00, 0xfdff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_BASE(&reel3_ram)
1038ADDRESS_MAP_END
1039
7581040static ADDRESS_MAP_START( subsino_iomap, ADDRESS_SPACE_IO, 8 )
7591041   AM_RANGE( 0x0000, 0x003f ) AM_RAM // internal regs
7601042ADDRESS_MAP_END
r7882r7883
11161398   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
11171399INPUT_PORTS_END
11181400
1401static INPUT_PORTS_START( stisub )
1402   PORT_START("SW1")
1403   PORT_DIPNAME( 0x01, 0x01, "SW1" )
1404   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1405   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1406   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1407   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1408   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1409   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1410   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1411   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1412   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1413   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1414   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1415   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1416   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1417   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1418   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1419   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1420   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1421   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1422   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1423   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1424   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1425   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1426   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
11191427
1428   PORT_START("SW2")
1429   PORT_DIPNAME( 0x01, 0x01, "SW2" )
1430   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1431   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1432   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1433   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1434   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1435   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1436   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1437   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1438   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1439   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1440   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1441   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1442   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1443   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1444   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1445   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1446   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1447   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1448   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1449   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1450   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1451   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1452   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1453
1454   PORT_START("SW3")
1455   PORT_DIPNAME( 0x01, 0x01, "SW3" )
1456   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1457   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1458   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1459   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1460   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1461   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1462   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1463   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1464   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1465   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1466   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1467   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1468   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1469   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1470   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1471   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1472   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1473   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1474   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1475   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1476   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1477   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1478   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1479
1480   PORT_START("SW4")
1481   PORT_DIPNAME( 0x01, 0x01, "SW4" )
1482   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1483   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1484   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1485   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1486   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1487   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1488   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1489   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1490   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1491   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1492   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1493   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1494   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1495   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1496   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1497   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1498   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1499   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1500   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1501   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1502   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1503   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1504   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1505
1506/*
1507    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )    PORT_NAME("Hold 1")
1508    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD2 )    PORT_NAME("Hold 2 / Big")
1509    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD3 )    PORT_NAME("Hold 3 / Small")
1510    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1511    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_BET )      PORT_IMPULSE(3)
1512    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1513*/
1514
1515   PORT_START("INA")
1516   PORT_DIPNAME( 0x01, 0x01, "INA" )
1517   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1518   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1519   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1520   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1521   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1522   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1523   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1524   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1525   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL )   PORT_NAME("Start")
1526   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_BET )      PORT_IMPULSE(3)
1527   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP )   PORT_NAME("Double / Info")
1528   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1529   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1530   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1531   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1532   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1533   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1534
1535   PORT_START( "INB" )
1536   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )         PORT_IMPULSE(3)   // coin
1537   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN )   // key in
1538   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1539   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1540   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )      PORT_CODE(KEYCODE_9)   PORT_NAME("Stats / Test")   // Bookkeeping.
1541   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE )      PORT_CODE(KEYCODE_0)   PORT_NAME("Settings")      // Current settings.
1542   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )   // payout
1543   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )   // key out
1544
1545   PORT_START("INC")
1546   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH )   PORT_NAME("Black")
1547   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1548   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1549   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1550   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE )      PORT_CODE(KEYCODE_R)   PORT_NAME("Reset")   // hard reset
1551   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_LOW )      PORT_NAME("Red")
1552   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1553   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1554   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1555   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1556   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1557   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1558   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE )
1559   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1560   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1561   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1562INPUT_PORTS_END
1563
11201564static INPUT_PORTS_START( crsbingo )
11211565
11221566   PORT_START( "SW1" )
r7882r7883
13441788INPUT_PORTS_END
13451789
13461790
1791static INPUT_PORTS_START( sharkpye )
1792
1793   PORT_START( "SW1" )
1794   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
1795   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
1796   PORT_DIPSETTING(    0x05, DEF_STR( 1C_2C ) )
1797   PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
1798   PORT_DIPSETTING(    0x07, "1 Coin / 10 Credits" )
1799   PORT_DIPSETTING(    0x03, "1 Coin / 20 Credits" )
1800   PORT_DIPSETTING(    0x02, "1 Coin / 25 Credits" )
1801   PORT_DIPSETTING(    0x01, "1 Coin / 50 Credits" )
1802   PORT_DIPSETTING(    0x00, "1 Coin / 100 Credits" )
1803   PORT_DIPNAME( 0x38, 0x38, "Remote Credits" )
1804   PORT_DIPSETTING(    0x30, "1 Pulse / 1 Credits" )
1805   PORT_DIPSETTING(    0x28, "1 Pulse / 2 Credits" )
1806   PORT_DIPSETTING(    0x20, "1 Pulse / 5 Credits" )
1807   PORT_DIPSETTING(    0x18, "1 Pulse / 10 Credits" )
1808   PORT_DIPSETTING(    0x10, "1 Pulse / 50 Credits" )
1809   PORT_DIPSETTING(    0x38, "1 Pulse / 100 Credits" )
1810   PORT_DIPSETTING(    0x08, "1 Pulse / 200 Credits" )
1811   PORT_DIPSETTING(    0x00, "1 Pulse / 500 Credits" )
1812   PORT_DIPUNKNOWN( 0x40, 0x40 )
1813   PORT_DIPUNKNOWN( 0x80, 0x80 )
1814
1815   PORT_START( "SW2" )
1816   PORT_DIPNAME( 0x03, 0x03, "Minimum Bet" )
1817   PORT_DIPSETTING(    0x03, "1" )
1818   PORT_DIPSETTING(    0x02, "5" )
1819   PORT_DIPSETTING(    0x01, "10" )
1820   PORT_DIPSETTING(    0x00, "20" )
1821   PORT_DIPNAME( 0x0c, 0x0c, "Max Bet" )
1822   PORT_DIPSETTING(    0x08, "10" )
1823   PORT_DIPSETTING(    0x04, "40" )
1824   PORT_DIPSETTING(    0x0c, "50" )
1825   PORT_DIPSETTING(    0x00, "80" )
1826   PORT_DIPNAME( 0x10, 0x10, "Jokers" )
1827   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
1828   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1829   PORT_DIPUNKNOWN( 0x20, 0x20 )
1830   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
1831   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1832   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1833   PORT_DIPUNKNOWN( 0x80, 0x80 )
1834
1835   PORT_START( "SW3" )
1836   PORT_DIPNAME( 0x07, 0x07, "Main Game Rate" )
1837   PORT_DIPSETTING(    0x00, "92%" )
1838   PORT_DIPSETTING(    0x01, "93%" )
1839   PORT_DIPSETTING(    0x02, "94%" )
1840   PORT_DIPSETTING(    0x03, "95%" )
1841   PORT_DIPSETTING(    0x04, "96%" )
1842   PORT_DIPSETTING(    0x07, "97%" )
1843   PORT_DIPSETTING(    0x05, "98%" )
1844   PORT_DIPSETTING(    0x06, "99%" )
1845   PORT_DIPNAME( 0x38, 0x38, "Double-Up Rate" )
1846   PORT_DIPSETTING(    0x00, "82" )
1847   PORT_DIPSETTING(    0x08, "84" )
1848   PORT_DIPSETTING(    0x10, "86" )
1849   PORT_DIPSETTING(    0x18, "88" )
1850   PORT_DIPSETTING(    0x20, "90" )
1851   PORT_DIPSETTING(    0x38, "92" )
1852   PORT_DIPSETTING(    0x28, "94" )
1853   PORT_DIPSETTING(    0x30, "96" )
1854   PORT_DIPUNKNOWN( 0x40, 0x40 )
1855   PORT_DIPUNKNOWN( 0x80, 0x80 )
1856
1857   PORT_START( "SW4" )
1858   PORT_DIPUNKNOWN( 0x01, 0x01 )
1859   PORT_DIPUNKNOWN( 0x02, 0x02 )
1860   PORT_DIPUNKNOWN( 0x04, 0x04 )
1861   PORT_DIPUNKNOWN( 0x08, 0x08 )
1862   PORT_DIPUNKNOWN( 0x10, 0x10 )
1863   PORT_DIPUNKNOWN( 0x20, 0x20 )
1864   PORT_DIPUNKNOWN( 0x40, 0x40 )
1865   PORT_DIPUNKNOWN( 0x80, 0x80 )
1866
1867   PORT_START( "INA" )
1868   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1869   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1870   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1871   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL )   PORT_NAME("Start")
1872   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )   PORT_NAME("Hold 1 / Bet")
1873   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD3 )   PORT_NAME("Hold 3 / Double-Up")
1874   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1875   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1876
1877   PORT_START( "INB" )
1878   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )         PORT_IMPULSE(3)   // coin
1879   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN )
1880   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1881   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1882   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )      PORT_CODE(KEYCODE_9)   PORT_NAME("Stats / Test")   // Bookkeeping.
1883   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE )      PORT_CODE(KEYCODE_0)   PORT_NAME("Settings")   // Game Rate & others.
1884   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1885   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )
1886
1887   PORT_START( "INC" )
1888   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD4 )   PORT_NAME("Hold 4 / Small")
1889   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1890   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE )      PORT_CODE(KEYCODE_R)   PORT_NAME("Reset Switch")   // hard reset
1891   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD5 )   PORT_NAME("Hold 5 / Big")
1892   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1893   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1894   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD2 )   PORT_NAME("Hold 2 / Take")
1895   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1896INPUT_PORTS_END
1897
1898
13471899static INPUT_PORTS_START( smoto16 )
13481900
13491901   PORT_START( "SW1" )
r7882r7883
15312083   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
15322084INPUT_PORTS_END
15332085
1534
15352086/***************************************************************************
15362087*                             Graphics Layout                              *
15372088***************************************************************************/
r7882r7883
15692120   8*8*4
15702121};
15712122
2123static const gfx_layout layout_8x8x8 =
2124{
2125   8, 8,
2126   RGN_FRAC(1,4),
2127   8,
2128   { 0,1,2,3,4,5,6,7 },
2129   { RGN_FRAC(0,4), RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4), RGN_FRAC(0,4)+8, RGN_FRAC(1,4)+8, RGN_FRAC(2,4)+8, RGN_FRAC(3,4)+8 },
2130   { 0*16,1*16,2*16,3*16,4*16,5*16,6*16,7*16 },
2131   8*16
2132};
15722133
2134static const gfx_layout layout_8x32x8 =
2135{
2136   8, 32,
2137   RGN_FRAC(1,4),
2138   8,
2139   { 0,1,2,3,4,5,6,7 },
2140   { RGN_FRAC(0,4), RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4), RGN_FRAC(0,4)+8, RGN_FRAC(1,4)+8, RGN_FRAC(2,4)+8, RGN_FRAC(3,4)+8 },
2141   { 0*16,1*16,2*16,3*16,4*16,5*16,6*16,7*16, 8*16,9*16,10*16,11*16,12*16,13*16,14*16,15*16,
2142    16*16,17*16,18*16,19*16,20*16,21*16,22*16,23*16,24*16,25*16,26*16,27*16,28*16,29*16,30*16,31*16},
2143   32*16
2144};
2145
2146
15732147static GFXDECODE_START( subsino_depth3 )
15742148   GFXDECODE_ENTRY( "tilemap", 0, layout_8x8x3, 0, 16 )
15752149GFXDECODE_END
r7882r7883
15832157   GFXDECODE_ENTRY( "reels", 0, layout_8x32x4, 0, 16 )
15842158GFXDECODE_END
15852159
2160static GFXDECODE_START( subsino_stisub )
2161   GFXDECODE_ENTRY( "tilemap", 0, layout_8x8x8, 0, 1 )
2162   GFXDECODE_ENTRY( "reels", 0, layout_8x32x8, 0, 1 )
2163GFXDECODE_END
2164
15862165/***************************************************************************
15872166*                             Machine Drivers                              *
15882167***************************************************************************/
r7882r7883
17312310   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
17322311MACHINE_DRIVER_END
17332312
2313static MACHINE_DRIVER_START( stisub )
2314   /* basic machine hardware */
2315   MDRV_CPU_ADD("maincpu", Z180, XTAL_12MHz / 8)   /* Unknown clock */
2316   MDRV_CPU_PROGRAM_MAP(stisub_map)
2317   MDRV_CPU_IO_MAP(subsino_iomap)
17342318
2319   /* video hardware */
2320   MDRV_SCREEN_ADD("screen", RASTER)
2321   MDRV_SCREEN_REFRESH_RATE(60)
2322   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
2323   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
2324   MDRV_SCREEN_SIZE(512, 256)
2325   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0+16, 256-16-1)
2326
2327   MDRV_GFXDECODE(subsino_stisub)
2328
2329   MDRV_PALETTE_LENGTH(0x100)
2330   //MDRV_PALETTE_INIT(subsino_3proms)
2331
2332   MDRV_VIDEO_START(stisub)
2333   MDRV_VIDEO_UPDATE(stisub_reels)
2334
2335   /* sound hardware */
2336   MDRV_SPEAKER_STANDARD_MONO("mono")
2337
2338   MDRV_SOUND_ADD("ymsnd", YM3812, XTAL_3_579545MHz)
2339   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2340MACHINE_DRIVER_END
2341
2342
17352343/***************************************************************************
17362344*                               ROMs Loading                               *
17372345***************************************************************************/
r7882r7883
18572465   ROM_COPY( "maincpu", 0x09000, 0x14000, 0x1000)
18582466
18592467   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) )
2468   ROM_LOAD( "rom_6.bin", 0x00000, 0x10000, CRC(c2c226df) SHA1(39762b390d6b271c3252342e843a181dd152a0cc) )
2469   ROM_LOAD( "rom_4.bin", 0x10000, 0x10000, CRC(37724fda) SHA1(084653662c9f77afef2a77c607e1fb093aaf3adf) )
2470   ROM_LOAD( "rom_5.bin", 0x20000, 0x10000, CRC(3d18acd8) SHA1(179545c18ad880097366c07c8e2fa821701a2758) )
18632471   ROM_LOAD( "rom_7.bin", 0x30000, 0x10000, CRC(9d7d99d8) SHA1(a3df5e023c2102028a5186101dc0b19d91e8965e) )
18642472
18652473   ROM_REGION( 0x8000, "reels", 0 )
r7882r7883
18692477   ROM_IGNORE(0x4000)
18702478
18712479   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 )
2480   ROM_LOAD( "n82s129n.u39", 0x000, 0x100, CRC(971843e5) SHA1(4cb5fc1085503dae2f2f02eb49cca051ac84b890) )
2481   ROM_LOAD( "n82s129n.u40", 0x100, 0x100, CRC(b4bd872c) SHA1(c0f9fe68186636d6d6bc6f81415459631cf38edd) )
2482   ROM_LOAD( "n82s129n.u41", 0x200, 0x100, CRC(db99f6da) SHA1(d281a2fa06f1890ef0b1c4d099e6828827db14fd) )
18752483ROM_END
18762484
2485/*
2486
2487  Treasure Island (Alt version)...
2488
2489  ROMs 4 & 5 are missing. ROMs 6 & 7 are identical to parent set.
2490  So... Assuming that 4 & 5 should have the same bitplanes.
2491
2492  ROM 3 is bad, but ROM 2 only has the first byte different,
2493  getting different values in each dump. The rest remains identical.
2494
2495  Program ROM is different.
2496
2497  Color PROMs are from this set.
2498
2499*/
2500
2501ROM_START( tisuba )
2502   ROM_REGION( 0x18000, "maincpu", 0 )
2503   ROM_LOAD( "01.bin", 0x10000, 0x4000,  CRC(9967dd38) SHA1(63b74bc0c0952114b7321e8f399bd64dc293aade) )
2504   ROM_CONTINUE(0x0000,0xc000)
2505   ROM_COPY( "maincpu", 0x09000, 0x14000, 0x1000)
2506
2507   ROM_REGION( 0x40000, "tilemap", 0 )
2508   ROM_LOAD( "rom_6.bin", 0x00000, 0x10000, CRC(c2c226df) SHA1(39762b390d6b271c3252342e843a181dd152a0cc) )
2509   ROM_LOAD( "rom_4.bin", 0x10000, 0x10000, CRC(37724fda) SHA1(084653662c9f77afef2a77c607e1fb093aaf3adf) )
2510   ROM_LOAD( "rom_5.bin", 0x20000, 0x10000, CRC(3d18acd8) SHA1(179545c18ad880097366c07c8e2fa821701a2758) )
2511   ROM_LOAD( "rom_7.bin", 0x30000, 0x10000, CRC(9d7d99d8) SHA1(a3df5e023c2102028a5186101dc0b19d91e8965e) )
2512
2513   ROM_REGION( 0x8000, "reels", 0 )
2514   ROM_LOAD( "rom_2.bin", 0x0000, 0x4000, CRC(836c756d) SHA1(fca1d5b600861eea30ed73ee13be735e7d167097) )
2515   ROM_IGNORE(0x4000)
2516   ROM_LOAD( "rom_3.bin", 0x4000, 0x4000, CRC(2ad82222) SHA1(68780b9528393b28eaa2f90501efb5a8c39bed63) )
2517   ROM_IGNORE(0x4000)
2518
2519   ROM_REGION( 0x300, "proms", 0 )
2520   ROM_LOAD( "n82s129n.u39", 0x000, 0x100, CRC(971843e5) SHA1(4cb5fc1085503dae2f2f02eb49cca051ac84b890) )
2521   ROM_LOAD( "n82s129n.u40", 0x100, 0x100, CRC(b4bd872c) SHA1(c0f9fe68186636d6d6bc6f81415459631cf38edd) )
2522   ROM_LOAD( "n82s129n.u41", 0x200, 0x100, CRC(db99f6da) SHA1(d281a2fa06f1890ef0b1c4d099e6828827db14fd) )
2523ROM_END
2524
18772525/***************************************************************************
18782526
18792527Cross Bingo
r7882r7883
20602708ROM_END
20612709
20622710
2711/***************************************************************************
2712
2713  Shark Party (English, Alpha license)
2714
2715  - Different inputs system.
2716  - Different DIP Switches.
2717  - Different Button-Lamps outputs.
2718
2719***************************************************************************/
2720
20632721ROM_START( sharkpye )
20642722   ROM_REGION( 0x14000, "maincpu", 0 )
20652723   ROM_LOAD( "sharkpye.u18", 0x0a000, 0x6000, CRC(12473814) SHA1(9c24ed41781aefee0161add912e730ba0d4f4d3e) )
r7882r7883
20682726
20692727   ROM_REGION( 0x40000, "tilemap", 0 )
20702728   ROM_LOAD( "sharkpye.u16", 0x00000, 0x08000, CRC(90862185) SHA1(9d632bfa707d3449a87d7f370eb2b5c36e61aadd) )
2071   ROM_CONTINUE(              0x10000, 0x08000 )
2072   ROM_CONTINUE(              0x08000, 0x08000 )
2073   ROM_CONTINUE(              0x18000, 0x08000 )
2729   ROM_CONTINUE(             0x10000, 0x08000 )
2730   ROM_CONTINUE(             0x08000, 0x08000 )
2731   ROM_CONTINUE(             0x18000, 0x08000 )
20742732   ROM_LOAD( "sharkpye.u17", 0x20000, 0x08000, CRC(b7b6119a) SHA1(b61c77d2170d96fcb39ea31c4136387441b9037f) )
2075   ROM_CONTINUE(              0x30000, 0x08000 )
2076   ROM_CONTINUE(              0x28000, 0x08000 )
2077   ROM_CONTINUE(              0x38000, 0x08000 )
2733   ROM_CONTINUE(             0x30000, 0x08000 )
2734   ROM_CONTINUE(             0x28000, 0x08000 )
2735   ROM_CONTINUE(             0x38000, 0x08000 )
20782736
20792737   ROM_REGION( 0x40000, "oki", 0 )
20802738   ROM_LOAD( "sharkpye.u54", 0x00000, 0x20000, CRC(9f384c59) SHA1(d2b087b8370b40b6f0944de661ea6aebaebea06f) )
r7882r7883
22172875   ROM_LOAD( "82s129.u13", 0x200, 0x100, CRC(9cb4a5c0) SHA1(0e0a368329c6d1cb685ed655d699a4894988fdb1) )
22182876ROM_END
22192877
2878/* Super Treasure Island
2879 - is this better here or in bishjan.c?
2880*/
22202881
2882ROM_START( stisub )
2883   ROM_REGION( 0x18000, "maincpu", 0 )
2884   ROM_LOAD( "trbon-rlu16.u12", 0x00000, 0x10000, CRC(07771290) SHA1(c485943045396d8580271504a1fec7c88579f4a2) )
2885
2886   ROM_REGION( 0x100000, "tilemap", 0 )
2887   ROM_LOAD( "sti-alpha_2-ver1.1.u30", 0x00000, 0x40000, CRC(3bc4c8c5) SHA1(12e868f4b4d4df6b59befcd785ab1fe5c1def58d) )
2888   ROM_LOAD( "sti-alpha_3-ver1.1.u29", 0x40000, 0x40000, CRC(5473c41a) SHA1(94294887af8ffc4f2edbcbde1c51797f20c44efe) )
2889   ROM_LOAD( "sti-alpha_4-ver1.1.u28", 0x80000, 0x40000, CRC(ccf895e1) SHA1(c12ecf0577b5b856d8202474f084003cc95da51c) )
2890   ROM_LOAD( "sti-alpha_5-ver1.1.u27", 0xc0000, 0x40000, CRC(98eed855) SHA1(89291b1b143924caa79a6d694f10c14d93c57eac) )
2891
2892   ROM_REGION( 0x80000, "reels", 0 )
2893   ROM_LOAD( "sti-alpha_6-ver1.1.u25", 0x00000, 0x20000, CRC(83471a70) SHA1(c63e4c1a8cfb6e7feae4fd97f7d77feaf63c949b) )
2894   ROM_LOAD( "sti-alpha_7-ver1.1.u24", 0x20000, 0x20000, CRC(05bc7ed2) SHA1(23ae716cd149ee940ac4bdc114fbfeb290e91b11) )
2895   ROM_LOAD( "sti-alpha_8-ver1.1.u23", 0x40000, 0x20000, CRC(d3c11545) SHA1(0383358d223c9bfe67c3b5de7a9cc3e43a9769b2) )
2896   ROM_LOAD( "sti-alpha_9-ver1.1.u22", 0x60000, 0x20000, CRC(9710a223) SHA1(76ef6bd77ae33d91a9b6a9a615d07caee3356dfb) )
2897ROM_END
2898
22212899/***************************************************************************
22222900*                        Driver Init / Decryption                          *
22232901***************************************************************************/
r7882r7883
23623040   rom[0x64cf] = 0x00;
23633041}
23643042
3043static DRIVER_INIT( tisuba )
3044{
3045   UINT8 *rom = memory_region( machine, "maincpu" );
23653046
3047   DRIVER_INIT_CALL(victor5);
3048
3049   /* this trips a z180 MMU core bug? It unmaps a region then the program code jumps to that region... */
3050   rom[0x6491] = 0x00;
3051   rom[0x6492] = 0x00;
3052   rom[0x6493] = 0x00;
3053   rom[0x6496] = 0x00;
3054   rom[0x6497] = 0x00;
3055   rom[0x6498] = 0x00;
3056}
3057
3058DRIVER_INIT( stisub )
3059{
3060   UINT8 *rom = memory_region( machine, "maincpu" );
3061   rom[0x1005] = 0x1d; //patch protection check
3062   rom[0x7ab] = 0x18; //patch "winning protection" check
3063   rom[0x957] = 0x18; //patch "losing protection" check
3064   stisub_colorram = auto_alloc_array(machine, UINT8, 256*3);
3065
3066   reel1_scroll = auto_alloc_array(machine, UINT8, 0x40);
3067   reel2_scroll = auto_alloc_array(machine, UINT8, 0x40);
3068   reel3_scroll = auto_alloc_array(machine, UINT8, 0x40);
3069
3070   reel1_attr = auto_alloc_array(machine, UINT8, 0x200);
3071   reel2_attr = auto_alloc_array(machine, UINT8, 0x200);
3072   reel3_attr = auto_alloc_array(machine, UINT8, 0x200);
3073
3074}
3075
23663076/***************************************************************************
23673077*                               Game Drivers                               *
23683078***************************************************************************/
23693079
2370/*     YEAR  NAME      PARENT    MACHINE   INPUT     INIT      ROT    COMPANY            FULLNAME                    FLAGS              LAYOUT      */
2371GAMEL( 1990, victor21, 0,        victor21, victor21, victor21, ROT0, "Subsino / Buffy", "Victor 21",                 0,                 layout_victor21 )
2372GAMEL( 1991, victor5,  0,        victor5,  victor5,  victor5,  ROT0, "Subsino",         "G.E.A.",                  0,                 layout_victor5 ) // PCB black-box was marked 'victor 5' - in-game says G.E.A with no manufacturer info?
2373GAMEL( 1991, tisub,    0,        tisub,    tisub,    tisub,    ROT0, "Subsino",         "Treasure Island (Subsino)", GAME_WRONG_COLORS, layout_tisub )
2374GAMEL( 1991, crsbingo, 0,        crsbingo, crsbingo, crsbingo, ROT0, "Subsino",         "Poker Carnival",            0,                 layout_crsbingo )
2375GAMEL( 1996, sharkpy,  0,        sharkpy,  sharkpy,  sharkpy,  ROT0, "Subsino",         "Shark Party (Italy, v1.3)", 0,                 layout_sharkpy ) // missing POST messages?
2376GAMEL( 1996, sharkpya, sharkpy,  sharkpy,  sharkpy,  sharkpy,  ROT0, "Subsino",         "Shark Party (Italy, v1.6)", 0,                 layout_sharkpy ) // missing POST messages?
2377GAMEL( 1995, sharkpye, sharkpy,  sharkpy,  sharkpy,  sharkpye,  ROT0, "Alpha",           "Shark Party (English, Alpha license)", 0,                     layout_sharkpy ) // PCB black-box was marked 'victor 6'
2378GAMEL( 1996, smoto20,  0,        srider,   smoto20,  smoto20,  ROT0, "Subsino",         "Super Rider (Italy, v2.0)", 0,                 layout_smoto )
2379GAMEL( 1996, smoto16,  smoto20,  srider,   smoto16,  smoto16,  ROT0, "Subsino",         "Super Moto (Italy, v1.6)",  0,                 layout_smoto )
3080/*     YEAR  NAME      PARENT    MACHINE   INPUT     INIT      ROT    COMPANY            FULLNAME                               FLAGS   LAYOUT      */
3081GAMEL( 1990, victor21, 0,        victor21, victor21, victor21, ROT0, "Subsino / Buffy", "Victor 21",                            0,      layout_victor21 )
3082GAMEL( 1991, victor5,  0,        victor5,  victor5,  victor5,  ROT0, "Subsino",         "G.E.A.",                               0,      layout_victor5 ) // PCB black-box was marked 'victor 5' - in-game says G.E.A with no manufacturer info?
3083GAMEL( 1992, tisub,    0,        tisub,    tisub,    tisub,    ROT0, "Subsino",         "Treasure Island (Subsino, set 1)",     0,      layout_tisub )
3084GAMEL( 1992, tisuba,   tisub,    tisub,    tisub,    tisuba,   ROT0, "Subsino",         "Treasure Island (Subsino, set 2)",     0,      layout_tisub )
3085GAMEL( 1991, crsbingo, 0,        crsbingo, crsbingo, crsbingo, ROT0, "Subsino",         "Poker Carnival",                       0,      layout_crsbingo )
3086GAME(  1995, stisub,   0,        stisub,   stisub,   stisub,   ROT0, "Alpha",           "Treasure Bonus (Subsino)",           0 ) // board CPU module marked 'Super Treasure Island' (alt title?)
3087GAMEL( 1996, sharkpy,  0,        sharkpy,  sharkpy,  sharkpy,  ROT0, "Subsino",         "Shark Party (Italy, v1.3)",            0,      layout_sharkpy ) // missing POST messages?
3088GAMEL( 1996, sharkpya, sharkpy,  sharkpy,  sharkpy,  sharkpy,  ROT0, "Subsino",         "Shark Party (Italy, v1.6)",            0,      layout_sharkpy ) // missing POST messages?
3089GAMEL( 1995, sharkpye, sharkpy,  sharkpy,  sharkpye, sharkpye, ROT0, "Alpha",           "Shark Party (English, Alpha license)", 0,      layout_sharkpye ) // PCB black-box was marked 'victor 6'
3090GAMEL( 1996, smoto20,  0,        srider,   smoto20,  smoto20,  ROT0, "Subsino",         "Super Rider (Italy, v2.0)",            0,      layout_smoto )
3091GAMEL( 1996, smoto16,  smoto20,  srider,   smoto16,  smoto16,  ROT0, "Subsino",         "Super Moto (Italy, v1.6)",             0,      layout_smoto )
src/mame/drivers/tmaster.c
r7882r7883
10481048by Midway (c) 1996
10491049touchscreen game
10501050
1051All chips are ST M27C4001
1052---------------------------
1053
10511054Name_Board Location        Version               Use             Checksum
10521055-------------------------------------------------------------------------
1053TM2K_v402.u51              4.02 Game Program & Cpu instructions   c625
1054TM2K_v402.u52              4.02 Game Program & Cpu instructions   e8a7
1056TM2K_v402.u51              4.02 Game Program & Cpu instructions   c517
1057TM2K_v402.u52              4.02 Game Program & Cpu instructions   e82c
10551058
1056TM2K_graphic.u36           4.0  Video Images & Graphics           20cb
1057TM2K_graphic.u37           4.0  Video Images & Graphics           f5cf
1058TM2K_graphic.u38           4.0  Video Images & Graphics           14c7
1059TM2K_graphic.u39           4.0  Video Images & Graphics           043e
1060TM2K_sound.u8              4.0  Audio Program & sounds            9307
1061u62 (NOT INCLUDED)         N/A  Battery Memory Module             N/A
1059TM2K_v400.u51              4.00 Game Program & Cpu instructions   a49b
1060TM2K_v400.u52              4.00 Game Program & Cpu instructions   7c2f
10621061
1062TM2K_graphic.u36           4.00 Video Images & Graphics           20cb
1063TM2K_graphic.u37           4.00 Video Images & Graphics           f5cf
1064TM2K_graphic.u38           4.00 Video Images & Graphics           14c7
1065TM2K_graphic.u39           4.00 Video Images & Graphics           043e
1066TM2K_sound.u8              1.0  Audio Program & sounds            9307
1067
10631068Does not require a security key
10641069
10651070***************************************************************************/
10661071
10671072ROM_START( tm2k )
10681073   ROM_REGION( 0x200000, "maincpu", 0 ) // 68000 Code
1069   ROM_LOAD16_BYTE( "tm2k_v402.u51", 0x000000, 0x100000, CRC(fa6d168c) SHA1(c458d1114c658ac963a22cdb74ee5ea489ddcbba) ) /* Ver: 4.02 Standard 5-30-97 */
1070   ROM_LOAD16_BYTE( "tm2k_v402.u52", 0x000001, 0x100000, CRC(4e9c2d42) SHA1(67e34778f21010c43c1247179faa3f7ede5ad8d0) ) /* Ver: 4.02 Standard 5-30-97 */
1074   ROM_LOAD16_BYTE( "tm2k_v402.u51", 0x000000, 0x080000, CRC(47269aeb) SHA1(6b7ebfde290f7d21a36a72b00dc6523490581edb) ) /* Ver: 4.02 Standard 5-30-97 */
1075   ROM_LOAD16_BYTE( "tm2k_v402.u52", 0x000001, 0x080000, CRC(2e3564ac) SHA1(9a71f38841bc17c291cb3f513b18ebe50fc18d9f) ) /* Ver: 4.02 Standard 5-30-97 */
10711076
10721077   ROM_REGION( 0x400000, "blitter", ROMREGION_ERASE )   // Blitter gfx
1073   ROM_LOAD16_BYTE( "tm2k_graphic.u38", 0x100000, 0x080000, CRC(22bb6cc5) SHA1(fc6cfd4e1e6e1455d648a7b63f2c8e37cdfe86d6) )
1078   ROM_LOAD16_BYTE( "tm2k_graphic.u38", 0x100000, 0x080000, CRC(22bb6cc5) SHA1(fc6cfd4e1e6e1455d648a7b63f2c8e37cdfe86d6) ) /* All 4 graphic roms marked as Rev 4.00 */
10741079   ROM_LOAD16_BYTE( "tm2k_graphic.u36", 0x100001, 0x080000, CRC(7f0840ac) SHA1(1c3af419d571579a3f2c561617d55914d28ef22b) )
10751080   ROM_LOAD16_BYTE( "tm2k_graphic.u39", 0x300000, 0x080000, CRC(059e1bd8) SHA1(7451c1cfa0d090b0566e353738a1ffba732a8ad2) )
10761081   ROM_LOAD16_BYTE( "tm2k_graphic.u37", 0x300001, 0x080000, CRC(4cf65950) SHA1(74d49166da19ecc4b8fc1e8e3f01361dfb645eea) )
10771082
10781083   ROM_REGION( 0x100000, "oki", 0 ) // Samples
1079   ROM_LOAD( "tm2k_sound.u8", 0x40000, 0x040000, CRC(f39ad4cf) SHA1(9bcb9a5dd3636d6541eeb3e737c7253ab0ed4e8d) )
1084   ROM_LOAD( "tm2k_sound.u8", 0x40000, 0x040000, CRC(f39ad4cf) SHA1(9bcb9a5dd3636d6541eeb3e737c7253ab0ed4e8d) ) /* Marked as Rev 1.0 */
10801085   ROM_CONTINUE(              0xc0000, 0x040000 )
10811086ROM_END
10821087
1088ROM_START( tm2ka )
1089   ROM_REGION( 0x200000, "maincpu", 0 ) // 68000 Code
1090   ROM_LOAD16_BYTE( "tm2k_v400.u51", 0x000000, 0x080000, CRC(c110502b) SHA1(e9415ed23b9bb0851548e75c208ebcbe6ac2a708) ) /* Ver: 4.00 Standard 5-16-97 */
1091   ROM_LOAD16_BYTE( "tm2k_v400.u52", 0x000001, 0x080000, CRC(a17c1d6e) SHA1(5ecb8f27f75469ab9600b3f640eb1acc7a3980e0) ) /* Ver: 4.00 Standard 5-16-97 */
1092
1093   ROM_REGION( 0x400000, "blitter", ROMREGION_ERASE )   // Blitter gfx
1094   ROM_LOAD16_BYTE( "tm2k_graphic.u38", 0x100000, 0x080000, CRC(22bb6cc5) SHA1(fc6cfd4e1e6e1455d648a7b63f2c8e37cdfe86d6) ) /* All 4 graphic roms marked as Rev 4.00 */
1095   ROM_LOAD16_BYTE( "tm2k_graphic.u36", 0x100001, 0x080000, CRC(7f0840ac) SHA1(1c3af419d571579a3f2c561617d55914d28ef22b) )
1096   ROM_LOAD16_BYTE( "tm2k_graphic.u39", 0x300000, 0x080000, CRC(059e1bd8) SHA1(7451c1cfa0d090b0566e353738a1ffba732a8ad2) )
1097   ROM_LOAD16_BYTE( "tm2k_graphic.u37", 0x300001, 0x080000, CRC(4cf65950) SHA1(74d49166da19ecc4b8fc1e8e3f01361dfb645eea) )
1098
1099   ROM_REGION( 0x100000, "oki", 0 ) // Samples
1100   ROM_LOAD( "tm2k_sound.u8", 0x40000, 0x040000, CRC(f39ad4cf) SHA1(9bcb9a5dd3636d6541eeb3e737c7253ab0ed4e8d) ) /* Marked as Rev 1.0 */
1101   ROM_CONTINUE(              0xc0000, 0x040000 )
1102ROM_END
1103
10831104/***************************************************************************
10841105
10851106Touchmaster 3000
r7882r7883
11041125TM3K_graphic.u40           5.0  Video Images & Graphics           ccb4
11051126TM3K_graphic.u41           5.0  Video Images & Graphics           e9ab
11061127TM3K_sound.u8              5.0  Audio Program & sounds            64d5
1107u62 (NOT INCLUDED)         N/A  Battery Memory Module             N/A
11081128
11091129Does not require a security key
11101130
r7882r7883
11131133TMSTR 3000 UPGRADE KIT USA-DBV
1114113463373100870
11151135
1116-------------------------------------------------------------------------
1117
1118SCN68681c1n40
1119xc3042A      www.xilinx.com
1120
11211136***************************************************************************/
11221137
11231138ROM_START( tm3k )
r7882r7883
11781193TM4K_graphic.u40           6.0  Video Images & Graphics         208A
11791194TM4K_graphic.u41           6.0  Video Images & Graphics         385D
11801195TM4K_sound.u8              6.0  Audio Program & sounds          DE0B
1181u62 (NOT INCLUDED)         N/A  Battery Memory Module           N/A
1196
11821197J12 DALLAS DS1204V         N/A  Security Key (required for this Version) - Labeled A-21657-003
1183-----------------------------------------------------------------------------------
11841198
1185SCN68681c1n40
1186xc3042A      www.xilinx.com
1187
11881199***************************************************************************/
11891200
11901201ROM_START( tm4k )
r7882r7883
13281339J12 DALLAS DS1204V         N/A  Security Key (required for this Version) - Labeled A-21657-005
13291340-----------------------------------------------------------------------------------
13301341
1331
13321342***************************************************************************/
13331343
13341344ROM_START( tm7k )
r7882r7883
14071417J12 DALLAS DS1204V         N/A  Security Key (required for this Version) - Labeled A-21657-007
14081418-----------------------------------------------------------------------------------
14091419
1410
14111420***************************************************************************/
14121421
1413// " According to the Distributor notice from Midway, the only thing updated was the "Power Cell" game to 'improve the performance'. "
1422/* According to the Distributor notice from Midway, the only thing updated for v9.04 was the "Power Cell" game to 'improve the performance'. */
14141423ROM_START( tm8k )
14151424   ROM_REGION( 0x200000, "maincpu", 0 ) // 68000 Code
14161425   ROM_LOAD16_BYTE( "tm8k_v904.u51", 0x000000, 0x100000, CRC(28864ec8) SHA1(e703f9ee350dd915102e784bbd04445a95b7d0a5) ) /* TOUCHMASTER 8000 U51 DOMESTIC 9.04 (Standard 04/25/00) */
r7882r7883
17911800GAME( 1996, tm,       0,        tm,       tm,       0,        ROT0, "CES Inc., Midway Games Inc.",             "Touchmaster (v3.00 Euro)",            0 )
17921801GAME( 1996, tmdo,     tm,       tm,       tm,       0,        ROT0, "CES Inc., Midway Games Inc.",             "Touchmaster (v2.2-01 Standard)",      0 )
17931802GAME( 1996, tm2k,     0,        tm3k,     tmaster,  0,        ROT0, "Midway Games Inc.",                       "Touchmaster 2000 (v4.02 Standard)",   0 )
1803GAME( 1996, tm2ka,    tm2k,     tm3k,     tmaster,  0,        ROT0, "Midway Games Inc.",                       "Touchmaster 2000 (v4.00 Standard)",   0 )
17941804GAME( 1997, tm3k,     0,        tm3k,     tmaster,  0,        ROT0, "Midway Games Inc.",                       "Touchmaster 3000 (v5.02 Standard)",   0 )
17951805GAME( 1997, tm3ka,    tm3k,     tm3k,     tmaster,  0,        ROT0, "Midway Games Inc.",                       "Touchmaster 3000 (v5.01 Standard)",   0 )
17961806GAME( 1998, tm4k,     0,        tm3k,     tmaster,  tm4k,     ROT0, "Midway Games Inc.",                       "Touchmaster 4000 (v6.03 Standard)",   0 )
src/mame/drivers/atarisy1.c
r7882r7883
204204   state_save_register_global(machine, state->joystick_int);
205205   state_save_register_global(machine, state->joystick_int_enable);
206206   state_save_register_global(machine, state->joystick_value);
207   state_save_register_global(machine, state->tms5220_out_data);
208   state_save_register_global(machine, state->tms5220_in_data);
209   state_save_register_global(machine, state->tms5220_ctl);
210207}
211208
212209
r7882r7883
392389
393390static WRITE8_DEVICE_HANDLER( via_pa_w )
394391{
395   atarisy1_state *state = (atarisy1_state *)device->machine->driver_data;
396   state->tms5220_out_data = data;
392   tms5220_data_w(devtag_get_device(device->machine, "tms"), 0, data);
397393}
398394
399395
400396static READ8_DEVICE_HANDLER( via_pa_r )
401397{
402   atarisy1_state *state = (atarisy1_state *)device->machine->driver_data;
403   return state->tms5220_in_data;
398   return tms5220_status_r(devtag_get_device(device->machine, "tms"), 0);
404399}
405400
406401
407402static WRITE8_DEVICE_HANDLER( via_pb_w )
408403{
409   atarisy1_state *state = (atarisy1_state *)device->machine->driver_data;
410   UINT8 old = state->tms5220_ctl;
411   state->tms5220_ctl = data;
412
413404   /* write strobe */
414   if (!(old & 1) && (state->tms5220_ctl & 1))
415      tms5220_data_w(device, 0, state->tms5220_out_data);
405   tms5220_wsq_w(devtag_get_device(device->machine, "tms"), data & 1);
416406
417407   /* read strobe */
418   if (!(old & 2) && (state->tms5220_ctl & 2))
419      state->tms5220_in_data = tms5220_status_r(device, 0);
408   tms5220_rsq_w(devtag_get_device(device->machine, "tms"), (data & 2)>>1);
420409
421410   /* bit 4 is connected to an up-counter, clocked by SYCLKB */
422411   data = 5 | ((data >> 3) & 2);
423   tms5220_set_frequency(device, ATARI_CLOCK_14MHz/2 / (16 - data));
412   tms5220_set_frequency(devtag_get_device(device->machine, "tms"), ATARI_CLOCK_14MHz/2 / (16 - data));
424413}
425414
426415
427416static READ8_DEVICE_HANDLER( via_pb_r )
428417{
429   return (tms5220_readyq_r(device) << 2) | (tms5220_intq_r(device) << 3);
418   return (tms5220_readyq_r(devtag_get_device(device->machine, "tms")) << 2) | (tms5220_intq_r(devtag_get_device(device->machine, "tms")) << 3);
430419}
431420
432421
r7882r7883
798787   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.40)
799788   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.40)
800789
801   MDRV_SOUND_ADD("tms", TMS5220, ATARI_CLOCK_14MHz/2/11)
790   MDRV_SOUND_ADD("tms", TMS5220C, ATARI_CLOCK_14MHz/2/11)
802791   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
803792   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
804793
src/mame/drivers/ssgbl.c
r7882r7883
33
44/* Sunset Riders bootleg - based on Genesis / Megadrive version
55
6 - coinage system is protected?  (by what?)
7
86 - title raster effect is broken (bug in megadrive code, happens with normal set too)
97
108 */
r7882r7883
1816ROM_END
1917
2018
21static READ16_HANDLER( sunsetbl_r )
19static READ16_HANDLER( ssgbl_dsw_r )
2220{
23   return mame_rand(space->machine);
21   static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
22   return input_port_read(space->machine, dswname[offset]);
2423}
2524
26static READ16_HANDLER( sunsetbl2_r )
25static DRIVER_INIT( ssgbl )
2726{
28   return 0x0000;//mame_rand(space->machine);
29}
30
31static DRIVER_INIT( sunsetbl )
32{
33   int i;
27   int x;
3428   UINT8* rom = memory_region(machine, "maincpu");
3529
3630   /* todo, reduce bitswaps to single swap */
37   for (i=0x00001;i<0x40000;i+=2)
31   for (x=0x00001;x<0x40000;x+=2)
3832   {
39      rom[i] = rom[i] ^ 0xff;
40      rom[i] = BITSWAP8(rom[i], 7,6,5,4,3,2,1,0 );
41      rom[i] = BITSWAP8(rom[i], 1,6,5,4,3,2,7,0 );
42      rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0 );
43      rom[i] = BITSWAP8(rom[i], 7,6,5,2,3,4,1,0 );
44      rom[i] = BITSWAP8(rom[i], 5,6,7,4,3,2,1,0 );
45      rom[i] = BITSWAP8(rom[i], 7,5,6,4,3,2,1,0 );
33      rom[x] = rom[x] ^ 0xff;
34      rom[x] = BITSWAP8(rom[x], 7,6,5,4,3,2,1,0 );
35      rom[x] = BITSWAP8(rom[x], 1,6,5,4,3,2,7,0 );
36      rom[x] = BITSWAP8(rom[x], 7,6,5,3,4,2,1,0 );
37      rom[x] = BITSWAP8(rom[x], 7,6,5,2,3,4,1,0 );
38      rom[x] = BITSWAP8(rom[x], 5,6,7,4,3,2,1,0 );
39      rom[x] = BITSWAP8(rom[x], 7,5,6,4,3,2,1,0 );
4640   }
4741
48   for (i=0x40001;i<0x80000;i+=2)
42   for (x=0x40001;x<0x80000;x+=2)
4943   {
50      rom[i] = BITSWAP8(rom[i], 7,6,5,4,3,2,1,0 );
51      rom[i] = BITSWAP8(rom[i], 7,6,1,4, 3,2,5,0);
52      rom[i] = BITSWAP8(rom[i], 7,6,5,4,0,2,1,3 );
53      rom[i] = BITSWAP8(rom[i], 2,6,5,4,3,7,1,0 );
54      rom[i] = BITSWAP8(rom[i], 7,6,5,0,3,2,1,4 );
55      rom[i] = BITSWAP8(rom[i], 7,6,5,1,3,2,4,0 );
44      rom[x] = BITSWAP8(rom[x], 7,6,5,4,3,2,1,0 );
45      rom[x] = BITSWAP8(rom[x], 7,6,1,4,3,2,5,0 );
46      rom[x] = BITSWAP8(rom[x], 7,6,5,4,0,2,1,3 );
47      rom[x] = BITSWAP8(rom[x], 2,6,5,4,3,7,1,0 );
48      rom[x] = BITSWAP8(rom[x], 7,6,5,0,3,2,1,4 );
49      rom[x] = BITSWAP8(rom[x], 7,6,5,1,3,2,4,0 );
5650
5751   }
5852
59   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770070, 0x77007f, 0, 0, sunsetbl_r);
60   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa10006, 0xa10007, 0, 0, sunsetbl2_r); // coins??
61
62   /* patch the startup and boot vector?! */
63   rom[0x01] = 0x00;
64   rom[0x00] = 0xff;
65   rom[0x03] = 0xff;
53   // boot vectors don't seem to be valid, so they are patched...
54   rom[0x01] = 0x01;
55   rom[0x00] = 0x00;
56   rom[0x03] = 0x00;
6657   rom[0x02] = 0x00;
6758
6859   rom[0x06] = 0xd2;
6960   rom[0x07] = 0x00;
7061
62   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770070, 0x770075, 0, 0, ssgbl_dsw_r );
63
7164   DRIVER_INIT_CALL(megadriv);
7265}
7366
74GAME( 1993, ssgbl ,  0,   megadriv,    megadriv,       sunsetbl,  ROT0,   "bootleg", "Sunset Riders (bootleg of Megadrive version)", GAME_NOT_WORKING) // playable, but coin system is broken
67GAME( 1993, ssgbl,    0, megadriv, ssgbl,    ssgbl,    ROT0, "bootleg", "Sunset Riders (bootleg of Megadrive version)", 0)
src/mame/drivers/mpu4drvr.c
r7882r7883
1414The VIDEO BOARD is driven by a 10mhz 68000 processor, and contains a 6840PTM, 6850 serial IO
1515(the other end of the communications), an SAA1099 for stereo sound and SCN2674 gfx chip.
1616
17The VIDEO CARTRIDGE plugs into the video board, and contains the program roms for the video based game.
17The VIDEO CARTRIDGE plugs into the video board, and contains the program ROMs for the video based game.
1818Like the MPU4 game card, in some cases an extra OKI sound chip is added to the video board's game card,
1919as well as extra RAM.
2020There is a protection chip similar to and replacing the MPU4 Characteriser, which is often fed question
r7882r7883
2626
2727Additional: 68k HALT line is tied to the reset circuit of the MPU4.
2828
29Everything here is preliminary...  the boards are quite fussy with regards their self tests
30and the timing may have to be perfect for them to function correctly.  (as the comms are
31timer driven, the video is capable of various raster effects etc.)
32
33Datasheets are available for the main components, The AGEMAME site mirrors a few of the harder-to-find ones.
34
3529--- Preliminary MPU4 Video Interface Card Memorymap  ---
3630
3731   hex     |r/w| D D D D D D D D |
r7882r7883
173167 C000-FFFF | R | D D D D D D D D | ROM
174168-----------+---+-----------------+--------------------------------------------------------------------------
175169TODO:
176      - MPU4 Master clock value taken from schematic, but 68k value is not.
170      - Correctly implement characteriser protection for each game.
171      - Hook up trackball control for The Crystal Maze and The Mating Game
172      - Improve AVDC implementation, adding split-screen interrupts (needed for mid-screen palette changes)
173      - Hook up OKIM6376 sound in The Mating Game
174      - Get the BwB games running
175        * They have a slightly different 68k memory map. The 6850 is at e00000 and the 6840 is at e01000
176      - Find out what causes the games to reset in service mode (see jump taken at CPU1:c8e8)
177177      - Deal 'Em lockouts vary on certain cabinets (normally connected to AUX2, but not there?)
178178      - Deal 'Em has bad tiles (apostrophe, logo, bottom corner), black should actually be transparent
179179        to give black on green.
180180***********************************************************************************************************/
181/* MPU4 Video */
181
182182#include "cpu/m68000/m68000.h"
183183#include "machine/6850acia.h"
184184#include "sound/saa1099.h"
r7882r7883
193193
194194#define LOGSTUFF(x) do { if (MPU4VIDVERBOSE) logerror x; } while (0)
195195
196#define VIDEO_MASTER_CLOCK (XTAL_10MHz)
197196
197#define VIDEO_MASTER_CLOCK         XTAL_10MHz
198
198199/* IRQ states for 68k */
199200static UINT8 m6840_irq_state;
200201static UINT8 m6850_irq_state;
r7882r7883
222223static UINT8 scn2674_screen2_l;
223224static UINT8 scn2674_screen2_h;
224225
226static READ16_HANDLER( characteriser16_r );
227static WRITE16_HANDLER( characteriser16_w );
225228
226/* called if board is reset */
227static MACHINE_RESET( mpu4_vid )
228{
229   ROC10937_reset(0);
230229
231/*  cputag_set_input_line(machine, "video", INPUT_LINE_HALT, ASSERT_LINE); */
232   mpu4_stepper_reset();
233
234   lamp_strobe    = 0;
235   lamp_strobe2   = 0;
236   lamp_data      = 0;
237
238   IC23GC    = 0;
239   IC23GB    = 0;
240   IC23GA    = 0;
241   IC23G1    = 1;
242   IC23G2A   = 0;
243   IC23G2B   = 0;
244
245   prot_col  = 0;
246}
247
248
249230/*************************************
250231 *
251232 *  Interrupt system
r7882r7883
270251static void update_mpu68_interrupts(running_machine *machine)
271252{
272253   cputag_set_input_line(machine, "video", 1, m6840_irq_state ? ASSERT_LINE : CLEAR_LINE);
273   cputag_set_input_line(machine, "video", 2, m6850_irq_state ? ASSERT_LINE : CLEAR_LINE);
254   cputag_set_input_line(machine, "video", 2, m6850_irq_state ? CLEAR_LINE : ASSERT_LINE);
274255   cputag_set_input_line(machine, "video", 3, scn2674_irq_state ? ASSERT_LINE : CLEAR_LINE);
275256}
276257
r7882r7883
304285
305286static WRITE_LINE_DEVICE_HANDLER( m6809_acia_irq )
306287{
307   m68k_acia_cts = state;
308   cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, state?ASSERT_LINE:CLEAR_LINE);
288   m68k_acia_cts = !state;
289   cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE);
309290}
310291
311292static ACIA6850_INTERFACE( m6809_acia_if )
312293{
313294   0,
314295   0,
315   DEVCB_LINE(m6809_acia_rx_r),/*&m68k_m6809_line,*/
316   DEVCB_LINE(m6809_acia_tx_w),/*&m6809_m68k_line,*/
317   DEVCB_LINE(m6809_acia_cts_r),/*&m6809_acia_cts,*/
318   DEVCB_LINE(m6809_acia_rts_w),/*&m6809_acia_rts,*/
319   DEVCB_LINE(m6809_acia_dcd_r),/*&m6809_acia_dcd,*/
296   DEVCB_LINE(m6809_acia_rx_r),
297   DEVCB_LINE(m6809_acia_tx_w),
298   DEVCB_LINE(m6809_acia_cts_r),
299   DEVCB_LINE(m6809_acia_rts_w),
300   DEVCB_LINE(m6809_acia_dcd_r),
320301   DEVCB_LINE(m6809_acia_irq)
321302};
322303
r7882r7883
347328
348329static WRITE_LINE_DEVICE_HANDLER( m68k_acia_irq )
349330{
350   m6809_acia_cts = state;
331   m6809_acia_cts = !state;
351332   m6850_irq_state = state;
352333   update_mpu68_interrupts(device->machine);
353334}
r7882r7883
356337{
357338   0,
358339   0,
359   DEVCB_LINE(m68k_acia_rx_r),/*&m6809_m68k_line,*/
360   DEVCB_LINE(m68k_acia_tx_w),/*&m68k_m6809_line,*/
361   DEVCB_LINE(m68k_acia_cts_r),/*&m68k_acia_cts,*/
362   DEVCB_LINE(m68k_acia_rts_w),/*&m6809_acia_dcd,*/
363   DEVCB_LINE(m68k_acia_dcd_r),/*&m6809_acia_rts,*/
340   DEVCB_LINE(m68k_acia_rx_r),
341   DEVCB_LINE(m68k_acia_tx_w),
342   DEVCB_LINE(m68k_acia_cts_r),
343   DEVCB_LINE(m68k_acia_rts_w),
344   DEVCB_LINE(m68k_acia_dcd_r),
364345   DEVCB_LINE(m68k_acia_irq)
365346};
366347
r7882r7883
411392};
412393
413394
414/* SCN2674 AVDC emulation */
395/*************************************
396 *
397 *  SCN2674 AVDC
398 *
399 *************************************/
400
415401/* the chip is actually more complex than this.. character aren't limited to 8 rows high... but I
416402   don't *think* the MPU4 stuff needs otherwise.. yet .. */
417403
r7882r7883
420406   8,8,
421407   0x1000, /* 0x1000 tiles (128k of GFX RAM, 0x20 bytes per tile) */
422408   4,
423   { 0,8,16,24 },
409   { 8,0,24,16 },
424410   { 0,1,2,3,4,5,6,7 },
425411   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32},
426412   8*32
r7882r7883
433419   8,16,
434420   0x1000, /* 0x1000 tiles (128k of GFX RAM, 0x20 bytes per tile) */
435421   4,
436   { 0,8,16,24 },
422   { 8,0,24,16 },
437423   { 0,1,2,3,4,5,6,7 },
438424   { 0*32, 0*32, 1*32, 1*32, 2*32, 2*32, 3*32, 3*32, 4*32, 4*32, 5*32, 5*32, 6*32, 6*32, 7*32, 7*32},
439425   8*32
r7882r7883
446432   16,8,
447433   0x1000, /* 0x1000 tiles (128k of GFX RAM, 0x20 bytes per tile) */
448434   4,
449   { 0,8,16,24 },
435   { 8,0,24,16 },
450436   { 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 },
451437   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32},
452438   8*32
r7882r7883
459445   16,16,
460446   0x1000,  /* 0x1000 tiles (128k of GFX RAM, 0x20 bytes per tile) */
461447   4,
462   { 0,8,16,24 },
448   { 8,0,24,16 },
463449   { 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 },
464450   { 0*32, 0*32, 1*32, 1*32, 2*32, 2*32, 3*32, 3*32, 4*32, 4*32, 5*32, 5*32, 6*32, 6*32, 7*32, 7*32},
465451   8*32
r7882r7883
505491   /* we're in row table mode...thats why */
506492   for(y = 0; y <= IR4_scn2674_rows_per_screen; y++)
507493   {
508      int screen2_base = (scn2674_screen2_h<<8)|(scn2674_screen2_l);
494      int screen2_base = (scn2674_screen2_h << 8) | scn2674_screen2_l;
509495
510496      UINT16 rowbase = (mpu4_vid_mainram[1+screen2_base+(y*2)]<<8)|mpu4_vid_mainram[screen2_base+(y*2)];
511497      int dbl_size;
r7882r7883
518504      for(x = 0; x <= IR5_scn2674_character_per_row; x++)
519505      {
520506         UINT16 tiledat;
521         UINT16 colattr;
507         UINT16 attr;
522508
523509         tiledat = mpu4_vid_mainram[(rowbase+x)&0x7fff];
524         colattr = tiledat >>12;
525         tiledat &= 0x0fff;
510         attr = tiledat >>12;
526511
527         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[gfxregion],tiledat,colattr,0,0,x*8,y*8);
512         if (attr)
513            drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[gfxregion],tiledat,0,0,0,x*8,y*8);
528514
529515         //count++;
530516      }
r7882r7883
533519
534520   }
535521
536   popmessage("%02x %02x %02x %02x %02x %02x",scn2674_screen1_l,scn2674_screen1_h,scn2674_cursor_l, scn2674_cursor_h,scn2674_screen2_l,scn2674_screen2_h);
537
538522   for (i = 0; i < 8; i++)
539523      mpu4_draw_led(i, led_segs[i]);
540524
r7882r7883
10401024   scn2675_IR_pointer = 0;
10411025}
10421026
1027static INTERRUPT_GEN( mpu4_vid_irq )
1028{
1029   LOGSTUFF(("scn2674_irq_mask %02x\n",scn2674_irq_mask));
1030   if (cpu_getiloops(device)==0) /* vbl */
1031   {
1032   /*  if (scn2674_display_enabled) ? */
1033      {
1034         if (scn2674_irq_mask&0x10)
1035         {
1036            LOGSTUFF(("vblank irq\n"));
1037            scn2674_irq_state = 1;
1038            update_mpu68_interrupts(device->machine);
10431039
1040            scn2674_irq_register |= 0x10;
1041         }
1042      }
1043      scn2674_status_register |= 0x10;
1044   }
1045}
10441046
1047
10451048/****************************
10461049 *  EF9369 color palette IC
10471050 *  (16 colors from 4096)
r7882r7883
10861089         col = pal.clut[entry] & 0xfff;
10871090
10881091         /* Update the MAME palette */
1089         palette_set_color_rgb(space->machine, entry, pal4bit(col >> 0), pal4bit(col >> 4), pal4bit(col >> 8));
1092         palette_set_color_rgb(space->machine, entry, pal4bit(col >> 8), pal4bit(col >> 4), pal4bit(col >> 0));
10901093      }
10911094
10921095         /* Address register auto-increment */
r7882r7883
11141117   }
11151118}
11161119
1120
1121/*************************************
1122 *
1123 *  Input defintions
1124 *
1125 *************************************/
1126
11171127static INPUT_PORTS_START( crmaze )
11181128   PORT_START("ORANGE1")
1129//  PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00")
1130//  PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("01")
1131//  PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("02")
1132//  PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("03")
1133//  PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("04")
1134//  PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("05")
1135//  PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("06")
1136//  PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("07")
1137
1138   PORT_START("ORANGE2")
1139//  PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("08")
1140//  PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("09")
1141//  PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("10")
1142//  PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("11")
1143//  PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("12")
1144//  PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("13")
1145//  PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("14")
1146//  PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("200p?")
1147
1148   PORT_START("BLACK1")
1149//  PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("16")
1150//  PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("17")
1151//  PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("18")
1152//  PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("19")
1153//  PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("20")
1154   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Switch")
1155   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
1156   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Door Switch?") PORT_TOGGLE
1157
1158   PORT_START("BLACK2")
1159   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right Yellow")
1160   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right Red")
1161   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("26")
1162   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left Yellow")
1163   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left Red")
1164   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Getout Yellow")
1165   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Getout Red")/* Labelled Escape on cabinet */
1166   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("100p Service?")PORT_IMPULSE(100)
1167
1168   PORT_START("DIL1")
1169   PORT_DIPNAME( 0x01, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01")
1170   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1171   PORT_DIPSETTING(    0x01, DEF_STR( On  ) )
1172   PORT_DIPNAME( 0x02, 0x00, "DIL102" ) PORT_DIPLOCATION("DIL1:02")
1173   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1174   PORT_DIPSETTING(    0x02, DEF_STR( On  ) )
1175   PORT_DIPNAME( 0x04, 0x00, "DIL103" ) PORT_DIPLOCATION("DIL1:03")
1176   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1177   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
1178   PORT_DIPNAME( 0x08, 0x00, "DIL104" ) PORT_DIPLOCATION("DIL1:04")
1179   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1180   PORT_DIPSETTING(    0x08, DEF_STR( On  ) )
1181   PORT_DIPNAME( 0x10, 0x00, "DIL105" ) PORT_DIPLOCATION("DIL1:05")
1182   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1183   PORT_DIPSETTING(    0x10, DEF_STR( On  ) )
1184   PORT_DIPNAME( 0x20, 0x00, "DIL106" ) PORT_DIPLOCATION("DIL1:06")
1185   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1186   PORT_DIPSETTING(    0x20, DEF_STR( On  ) )
1187   PORT_DIPNAME( 0x40, 0x00, "DIL107" ) PORT_DIPLOCATION("DIL1:07")
1188   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1189   PORT_DIPSETTING(    0x40, DEF_STR( On  ) )
1190   PORT_DIPNAME( 0x80, 0x00, "DIL108" ) PORT_DIPLOCATION("DIL1:08")
1191   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1192   PORT_DIPSETTING(    0x80, DEF_STR( On  ) )
1193
1194   PORT_START("DIL2")
1195   PORT_DIPNAME( 0x01, 0x00, "DIL201" ) PORT_DIPLOCATION("DIL2:01")
1196   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1197   PORT_DIPSETTING(    0x01, DEF_STR( On  ) )
1198   PORT_DIPNAME( 0x02, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02")
1199   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1200   PORT_DIPSETTING(    0x02, DEF_STR( On  ) )
1201   PORT_DIPNAME( 0x04, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03")
1202   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1203   PORT_DIPSETTING(    0x04, DEF_STR( On  ) )
1204   PORT_DIPNAME( 0x08, 0x00, "DIL204" ) PORT_DIPLOCATION("DIL2:04")
1205   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1206   PORT_DIPSETTING(    0x08, DEF_STR( On  ) )
1207   PORT_DIPNAME( 0x10, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05")
1208   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1209   PORT_DIPSETTING(    0x10, DEF_STR( On  ) )
1210   PORT_DIPNAME( 0x20, 0x00, "DIL206" ) PORT_DIPLOCATION("DIL2:06")
1211   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1212   PORT_DIPSETTING(    0x20, DEF_STR( On  ) )
1213   PORT_DIPNAME( 0x40, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07")
1214   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1215   PORT_DIPSETTING(    0x40, DEF_STR( On  ) )
1216   PORT_DIPNAME( 0x80, 0x00, "DIL208" ) PORT_DIPLOCATION("DIL2:08")
1217   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1218   PORT_DIPSETTING(    0x80, DEF_STR( On  ) )
1219
1220   PORT_START("AUX1")
1221   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("0")
1222   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("1")
1223   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2")
1224   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("3")
1225   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("4")
1226   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5")
1227   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("6")
1228   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("7")
1229
1230   PORT_START("AUX2")
1231   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SPECIAL)
1232   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL)
1233   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL)
1234   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL)
1235   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")
1236   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")
1237   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")
1238   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")
1239INPUT_PORTS_END
1240
1241static INPUT_PORTS_START( mating )
1242   PORT_START("ORANGE1")
11191243   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00")
11201244   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("01")
11211245   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("02")
r7882r7883
11411265   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("18")
11421266   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("19")
11431267   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("20")
1144   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Switch")
1268   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W) PORT_TOGGLE
11451269   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
1146   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Door Switch?") PORT_TOGGLE
1270   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Cashbox Door")  PORT_CODE(KEYCODE_Q) PORT_TOGGLE
11471271
11481272   PORT_START("BLACK2")
11491273   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right Yellow")
r7882r7883
11531277   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left Red")
11541278   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Getout Yellow")
11551279   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Getout Red")/* Labelled Escape on cabinet */
1156   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("100p Service?")PORT_IMPULSE(100)
1280   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("100p Service?")
11571281
11581282   PORT_START("DIL1")
11591283   PORT_DIPNAME( 0x01, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01")
r7882r7883
12221346   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL)
12231347   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL)
12241348   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL)
1225   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5)
1226   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5)
1227   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5)
1228   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5)
1349   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")
1350   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")
1351   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")
1352   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")
12291353INPUT_PORTS_END
12301354
1355
12311356static INPUT_PORTS_START( dealem )
12321357   PORT_START("ORANGE1")
12331358   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
r7882r7883
13571482INPUT_PORTS_END
13581483
13591484
1360static INTERRUPT_GEN(mpu4_vid_irq)
1485/* OKI M6376 (for Mating Game) FIXME */
1486static READ16_DEVICE_HANDLER( oki_r )
13611487{
1362   LOGSTUFF(("scn2674_irq_mask %02x\n",scn2674_irq_mask));
1363   if (cpu_getiloops(device)==0) /* vbl */
1364   {
1365   /*  if (scn2674_display_enabled) ? */
1366      {
1367         if (scn2674_irq_mask&0x10)
1368         {
1369            LOGSTUFF(("vblank irq\n"));
1370            scn2674_irq_state = 1;
1371            update_mpu68_interrupts(device->machine);
1488   return mame_rand(device->machine);
1489}
13721490
1373            scn2674_irq_register |= 0x10;
1374         }
1375      }
1376      scn2674_status_register |= 0x10;
1377   }
1491static WRITE16_DEVICE_HANDLER( oki_w )
1492{
1493   // 0x10: .xxx xxxx      OKIM6736 I6-I0
1494   // 0x12: .... ...x      OKIM6736 /ST
13781495}
13791496
1497static void video_reset(running_device *device)
1498{
1499   devtag_get_device(device->machine, "6840ptm_68k")->reset();
1500   devtag_get_device(device->machine, "acia6850_1")->reset();
1501}
13801502
13811503/* machine start (called only once) */
13821504static MACHINE_START( mpu4_vid )
r7882r7883
13901512   Mechmtr_init(8);
13911513
13921514   /* setup 4 reels (for hybrid machines) */
1393
13941515   stepper_config(machine, 0, &barcrest_reel_interface);
13951516   stepper_config(machine, 1, &barcrest_reel_interface);
13961517   stepper_config(machine, 2, &barcrest_reel_interface);
13971518   stepper_config(machine, 3, &barcrest_reel_interface);
13981519
13991520   /* setup the standard oki MSC1937 display */
1521   ROC10937_init(0, MSC1937, 0);
14001522
1401   ROC10937_init(0, MSC1937, 0);
1523   /* Hook the reset line */
1524   m68k_set_reset_callback(devtag_get_device(machine, "video"), video_reset);
14021525}
14031526
1404/*
1405Characteriser (CHR)
1406Despite the potential to radically overhaul the design, the 68k version of the chip appears to just be a
140716-bit version of the previous design, with some endian-swapping necessary. It is unclear, however, if it has any
1408capacity to affect lamp matrices in the same way as before, as no software seen makes any request for the 'lamp' row.
1409It has been left in the table, as it clearly exists, but is unused.
1410The 'quiz' games on the board did use an address-scrambling PAL for encryption, and the very last mod of this board had
1411a characteriser capable of scrambling the ROM address lines.
1412*/
1413
1414static WRITE16_HANDLER( characteriser16_w )
1527static MACHINE_RESET( mpu4_vid )
14151528{
1416   int x;
1417   int call=data;
1418   LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", cpu_get_previouspc(space->cpu),offset,data));
1419   for (x = prot_col; x < 64; x++)
1420   {
1421      if (call == 0)
1422      {
1423         prot_col = 0;
1424      }
1425      else
1426      {
1427         if   (MPU4_chr_lut[(x)] == call)
1428         {
1429            prot_col = x;
1430            LOG_CHR(("Characteriser find column %02X\n",prot_col));
1431            break;
1432         }
1433      }
1434   }
1435}
1529   ROC10937_reset(0);
14361530
1531   mpu4_stepper_reset();
14371532
1438static READ16_HANDLER( characteriser16_r )
1439{
1440   LOG_CHR_FULL(("%04x Characteriser read offset %02X,data %02X", cpu_get_previouspc(space->cpu),offset,MPU4_chr_data[prot_col]));
1441   LOG_CHR(("Characteriser read offset %02X \n",offset));
1442   LOG_CHR(("Characteriser read data %02X \n",MPU4_chr_data[prot_col]));
1443   return MPU4_chr_data[prot_col];
1533   lamp_strobe    = 0;
1534   lamp_strobe2   = 0;
1535   lamp_data      = 0;
1536
1537   IC23GC    = 0;
1538   IC23GB    = 0;
1539   IC23GA    = 0;
1540   IC23G1    = 1;
1541   IC23G2A   = 0;
1542   IC23G2B   = 0;
1543
1544   prot_col  = 0;
14441545}
14451546
1446
14471547static ADDRESS_MAP_START( mpu4_68k_map, ADDRESS_SPACE_PROGRAM, 16 )
14481548   AM_RANGE(0x000000, 0x7fffff) AM_ROM
1449
1450/*  AM_RANGE(0x600000, 0x63ffff) AM_RAM? In expanded games (mating) */
1451
1452   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&mpu4_vid_mainram) /* mainram / char address ram? */
1453
1454   /* what is here, the sound chip? Assume so */
1455   AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_control_w, 0x00ff)
1456   AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_data_w, 0x00ff)
1457
1458   AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(ef9369_r, ef9369_w) /* the palette chip */
1549   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&mpu4_vid_mainram)
1550   AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_data_w, 0x00ff)
1551   AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_control_w, 0x00ff)
1552   AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(ef9369_r, ef9369_w)
14591553/*  AM_RANGE(0xa00004, 0xa0000f) AM_READWRITE(mpu4_vid_unmap_r, mpu4_vid_unmap_w) */
1460
14611554   AM_RANGE(0xb00000, 0xb0000f) AM_READWRITE(mpu4_vid_scn2674_r, mpu4_vid_scn2674_w)
1462
14631555   AM_RANGE(0xc00000, 0xc1ffff) AM_READWRITE(mpu4_vid_vidram_r, mpu4_vid_vidram_w)
1464
1465   /* comms with the MPU4 */
1466    AM_RANGE(0xff8000, 0xff8001) AM_DEVREADWRITE8("acia6850_1", acia6850_stat_r, acia6850_ctrl_w, 0xff)
1467    AM_RANGE(0xff8002, 0xff8003) AM_DEVREADWRITE8("acia6850_1", acia6850_data_r, acia6850_data_w, 0xff)
1468
1469   /* 6840PTM */
1556   AM_RANGE(0xff8000, 0xff8001) AM_DEVREADWRITE8("acia6850_1", acia6850_stat_r, acia6850_ctrl_w, 0xff)
1557   AM_RANGE(0xff8002, 0xff8003) AM_DEVREADWRITE8("acia6850_1", acia6850_data_r, acia6850_data_w, 0xff)
14701558   AM_RANGE(0xff9000, 0xff900f) AM_DEVREADWRITE8("6840ptm_68k", ptm6840_read, ptm6840_write, 0xff)
1471
1472   AM_RANGE(0xffd000, 0xffd00f) AM_READWRITE(characteriser16_r, characteriser16_w) /* characterizer */
1559   AM_RANGE(0xffd000, 0xffd00f) AM_READWRITE(characteriser16_r, characteriser16_w)
14731560ADDRESS_MAP_END
14741561
14751562/* TODO: Fix up MPU4 map*/
14761563static ADDRESS_MAP_START( mpu4_6809_map, ADDRESS_SPACE_PROGRAM, 8 )
14771564   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE_SIZE_GENERIC(nvram)
1478
14791565   AM_RANGE(0x0800, 0x0800) AM_DEVREADWRITE("acia6850_0", acia6850_stat_r, acia6850_ctrl_w)
14801566   AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("acia6850_0", acia6850_data_r, acia6850_data_w)
1481
14821567   AM_RANGE(0x0880, 0x0881) AM_NOP /* Could be a UART datalogger is here. */
1483
1484   AM_RANGE(0x0900, 0x0907) AM_DEVREADWRITE("6840ptm", ptm6840_read, ptm6840_write) /* 6840PTM */
1485
1486   AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("pia_ic3", pia6821_r, pia6821_w)      /* PIA6821 IC3 */
1487   AM_RANGE(0x0b00, 0x0b03) AM_DEVREADWRITE("pia_ic4", pia6821_r, pia6821_w)      /* PIA6821 IC4 */
1488   AM_RANGE(0x0c00, 0x0c03) AM_DEVREADWRITE("pia_ic5", pia6821_r, pia6821_w)      /* PIA6821 IC5 */
1489   AM_RANGE(0x0d00, 0x0d03) AM_DEVREADWRITE("pia_ic6", pia6821_r, pia6821_w)      /* PIA6821 IC6 */
1490   AM_RANGE(0x0e00, 0x0e03) AM_DEVREADWRITE("pia_ic7", pia6821_r, pia6821_w)      /* PIA6821 IC7 */
1491   AM_RANGE(0x0f00, 0x0f03) AM_DEVREADWRITE("pia_ic8", pia6821_r, pia6821_w)      /* PIA6821 IC8 */
1492
1493   AM_RANGE(0x4000, 0x40ff) AM_RAM /* it actually runs code from here... */
1494
1495   AM_RANGE(0xbe00, 0xbfff) AM_RAM /* 00 written on startup */
1568   AM_RANGE(0x0900, 0x0907) AM_DEVREADWRITE("6840ptm", ptm6840_read, ptm6840_write)
1569   AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("pia_ic3", pia6821_r, pia6821_w)
1570   AM_RANGE(0x0b00, 0x0b03) AM_DEVREADWRITE("pia_ic4", pia6821_r, pia6821_w)
1571   AM_RANGE(0x0c00, 0x0c03) AM_DEVREADWRITE("pia_ic5", pia6821_r, pia6821_w)
1572   AM_RANGE(0x0d00, 0x0d03) AM_DEVREADWRITE("pia_ic6", pia6821_r, pia6821_w)
1573   AM_RANGE(0x0e00, 0x0e03) AM_DEVREADWRITE("pia_ic7", pia6821_r, pia6821_w)
1574   AM_RANGE(0x0f00, 0x0f03) AM_DEVREADWRITE("pia_ic8", pia6821_r, pia6821_w)
1575   AM_RANGE(0x4000, 0x7fff) AM_RAM
1576   AM_RANGE(0xbe00, 0xbfff) AM_RAM
14961577   AM_RANGE(0xc000, 0xffff) AM_ROM   AM_REGION("maincpu",0)  /* 64k EPROM on board, only this region read */
14971578ADDRESS_MAP_END
14981579
14991580static ADDRESS_MAP_START( vp_68k_map, ADDRESS_SPACE_PROGRAM, 16 )
15001581   AM_RANGE(0x000000, 0x7fffff) AM_ROM
1501
1502/*  AM_RANGE(0x600000, 0x63ffff) AM_RAM? In expanded games (mating) */
1503
1504   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&mpu4_vid_mainram) /* mainram / char address ram? */
1505
1582   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&mpu4_vid_mainram)
15061583   AM_RANGE(0x810000, 0x81ffff) AM_RAM /* ? */
1507
1508   /* what is here, the sound chip? Assume so */
1509   AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_control_w, 0x00ff)
1510   AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_data_w, 0x00ff)
1511
1512   /* the palette chip */
1513   AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(ef9369_r, ef9369_w) /* the palette chip */
1584   AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_data_w, 0x00ff)
1585   AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_control_w, 0x00ff)
1586   AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(ef9369_r, ef9369_w)
15141587/*  AM_RANGE(0xa00004, 0xa0000f) AM_READWRITE(mpu4_vid_unmap_r, mpu4_vid_unmap_w) */
1515
15161588   AM_RANGE(0xb00000, 0xb0000f) AM_READWRITE(mpu4_vid_scn2674_r, mpu4_vid_scn2674_w)
1517
15181589   AM_RANGE(0xc00000, 0xc1ffff) AM_READWRITE(mpu4_vid_vidram_r, mpu4_vid_vidram_w)
1519
15201590/*  AM_RANGE(0xe05000, 0xe05001) AM_READWRITE(adpcm_r, adpcm_w) */
1521
1522   /* comms with the MPU4 */
1523    AM_RANGE(0xff8000, 0xff8001) AM_DEVREADWRITE8("acia6850_1", acia6850_stat_r, acia6850_ctrl_w, 0xff)
1524    AM_RANGE(0xff8002, 0xff8003) AM_DEVREADWRITE8("acia6850_1", acia6850_data_r, acia6850_data_w, 0xff)
1525
1526   /* 6840PTM */
1591   AM_RANGE(0xff8000, 0xff8001) AM_DEVREADWRITE8("acia6850_1", acia6850_stat_r, acia6850_ctrl_w, 0xff)
1592   AM_RANGE(0xff8002, 0xff8003) AM_DEVREADWRITE8("acia6850_1", acia6850_data_r, acia6850_data_w, 0xff)
15271593   AM_RANGE(0xff9000, 0xff900f) AM_DEVREADWRITE8("6840ptm_68k", ptm6840_read, ptm6840_write, 0xff)
1528
1529   /* characterizer */
15301594/*  AM_RANGE(0xffd000, 0xffd00f) AM_READWRITE(characteriser16_r, characteriser16_w) Word-based version of old CHR??? */
15311595ADDRESS_MAP_END
15321596
1597
15331598/* Deal 'Em */
15341599/* Deal 'Em was designed as an enhanced gamecard, to fit into an existing MPU4 cabinet
15351600It's an unoffical addon, and does all its work through the existing 6809 CPU.
r7882r7883
16381703   cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, state);
16391704}
16401705
1706
16411707/*************************************
16421708 *
16431709 *  Machine driver
r7882r7883
17181784
17191785   MDRV_PALETTE_LENGTH(16)
17201786
1721   /* 6840 PTM */
17221787   MDRV_PTM6840_ADD("6840ptm_68k", ptm_vid_intf)
17231788
17241789   MDRV_SPEAKER_STANDARD_MONO("mono")
r7882r7883
17261791   MDRV_SOUND_CONFIG(ay8910_config)
17271792   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
17281793
1729   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")/* Present on all video cards */
1794   /* Present on all video cards */
1795   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
17301796   MDRV_SOUND_ADD("saa", SAA1099, 8000000)
1731   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
1732   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
1797   MDRV_SOUND_ROUTE(0, "lspeaker", 0.5)
1798   MDRV_SOUND_ROUTE(1, "rspeaker", 0.5)
17331799
1734   /* ACIAs */
17351800   MDRV_ACIA6850_ADD("acia6850_0", m6809_acia_if)
17361801   MDRV_ACIA6850_ADD("acia6850_1", m68k_acia_if)
17371802MACHINE_DRIVER_END
17381803
1804static MACHINE_DRIVER_START( mating )
1805   MDRV_IMPORT_FROM( mpu4_vid )
1806
1807   MDRV_SOUND_ADD("oki", OKIM6376, 64000) //?
1808   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1809MACHINE_DRIVER_END
1810
17391811static MACHINE_DRIVER_START( vgpoker )
17401812   MDRV_IMPORT_FROM( mpu4_vid )
17411813   MDRV_CPU_MODIFY("video")
r7882r7883
17431815MACHINE_DRIVER_END
17441816
17451817
1818
17461819/* machine driver for Zenitone Deal 'Em board */
17471820static MACHINE_DRIVER_START( dealem )
17481821   MDRV_MACHINE_START(mpu4mod2)                     /* main mpu4 board initialisation */
r7882r7883
17521825
17531826   MDRV_TIMER_ADD_PERIODIC("50hz",gen_50hz, HZ(100))
17541827
1755   /* 6840 PTM */
17561828   MDRV_PTM6840_ADD("6840ptm", ptm_ic2_intf)
17571829
17581830   MDRV_PIA6821_ADD("pia_ic3", pia_ic3_intf)
r7882r7883
17861858MACHINE_DRIVER_END
17871859
17881860
1789static DRIVER_INIT (crmaze)
1861
1862/*
1863Characteriser (CHR)
1864Despite the potential to radically overhaul the design, the 68k version of the chip appears to just be a
186516-bit version of the previous design, with some endian-swapping necessary. It is unclear, however, if it has any
1866capacity to affect lamp matrices in the same way as before, as no software seen makes any request for the 'lamp' row.
1867It has been left in the table, as it clearly exists, but is unused.
1868The 'quiz' games on the board did use an address-scrambling PAL for encryption, and the very last mod of this board had
1869a characteriser capable of scrambling the ROM address lines.
1870
1871^^ I think this is wrong (DH)
1872
1873 The question data on the quiz games gets passed through the characterizer, the tables tested at startup are just a
1874 very specific test with known responses to make sure the device functions properly.  Unless there is extra encryption
1875 applied to just the question ROMs then the assumptions made here are wrong, because the questions don't decode.
1876
1877 It seems more likely that the Characterizer (PAL) acts as a challenge / response system, but various writes cause
1878 'latching' behavior because if you study the sequence written at startup you can see that the same write value should
1879 generate different responses.
1880
1881 Note:
1882 the 'challenge' part of the startup check is always the same
1883
1884
1885*/
1886
1887struct mpu4_chr_table
17901888{
1889   UINT8 call;
1890   UINT8 response;
1891};
1892
1893mpu4_chr_table* mpu4_current_chr_table;
1894
1895static WRITE16_HANDLER( characteriser16_w )
1896{
17911897   int x;
1792   static const UINT8 chr_table[72]={0x00,0x84,0x94,0x3C,0xEC,0x5C,0xEC,0x50,
1793                             0x2C,0x68,0x60,0xAC,0x74,0x00,0xAC,0x58,
1794                             0xEC,0x7C,0xEC,0x58,0xE0,0x90,0x18,0xEC,
1795                             0x54,0x28,0x68,0x44,0x84,0xB4,0x10,0x20,
1796                             0x84,0xBC,0xE8,0x70,0x24,0x84,0xB8,0xE0,
1797                             0x94,0x14,0x2C,0x64,0x8C,0x50,0x28,0x4C,
1798                             0x6C,0x60,0xA0,0xBC,0xCC,0x78,0xE8,0x50,
1799                             0x20,0xAC,0x74,0x04,0xA4,0x94,0x3C,0x00,
1800                             0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
1898   int call=data;
1899   LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", cpu_get_previouspc(space->cpu),offset,data));
1900   //printf("%04x Characteriser write offset %02X data %02X\n", cpu_get_previouspc(space->cpu),offset,data);
18011901
1802   for (x = 0; x < 72; x++)
1902   if (!mpu4_current_chr_table)
1903      fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(space->cpu));
1904
1905   for (x = prot_col; x < 64; x++)
18031906   {
1804      MPU4_chr_data[(x)] = chr_table[(x)];
1907      if (call == 0)
1908      {
1909         prot_col = 0;
1910      }
1911      else
1912      {
1913         if   (mpu4_current_chr_table[(x)].call == call)
1914         {
1915            prot_col = x;
1916            LOG_CHR(("Characteriser find column %02X\n",prot_col));
1917            //printf("Characteriser find column %02X\n",prot_col);
1918
1919            break;
1920         }
1921      }
18051922   }
18061923}
18071924
18081925
1809static DRIVER_INIT (mating)
1926static READ16_HANDLER( characteriser16_r )
18101927{
1811   int x;
1812   static const UINT8 chr_table[72]={0x00,0x18,0xC8,0xA4,0x0C,0x80,0x0C,0x90,
1813                             0x34,0x30,0x00,0x58,0xC8,0x84,0x4C,0xA0,
1814                             0x4C,0xC0,0x3C,0xC8,0xA4,0x4C,0x80,0x0C,
1815                             0x80,0x0C,0xE0,0x1C,0x88,0xA4,0x0C,0xA0,
1816                             0x0C,0x80,0x4C,0xA0,0x3C,0x98,0xEC,0x84,
1817                             0x0C,0xC0,0x1C,0xA8,0x84,0x0C,0xA0,0x5C,
1818                             0xE8,0xA4,0x0C,0xD0,0x04,0x38,0xA8,0xC4,
1819                             0x2C,0x90,0x44,0x18,0xE8,0x84,0x3C,0x00,
1820                             0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
1928   LOG_CHR_FULL(("%04x Characteriser read offset %02X,data %02X", cpu_get_previouspc(space->cpu),offset,mpu4_current_chr_table[prot_col].response));
1929   LOG_CHR(("Characteriser read offset %02X \n",offset));
1930   LOG_CHR(("Characteriser read data %02X \n",mpu4_current_chr_table[prot_col].response));
18211931
1822   for (x = 0; x < 72; x++)
1932//  printf("%04x Characteriser read offset %02X,data %02X\n", cpu_get_previouspc(space->cpu),offset,mpu4_current_chr_table[prot_col].response);
1933//  printf("Characteriser read offset %02X \n",offset);
1934//  printf("Characteriser read data %02X \n",mpu4_current_chr_table[prot_col].response);
1935
1936   if (!mpu4_current_chr_table)
1937      fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(space->cpu));
1938
1939
1940   /* hack for 'invalid questions' error on time machine.. I guess it wants them to decode properly for startup check? */
1941   if (cpu_get_previouspc(space->cpu)==0x283a)
18231942   {
1824      MPU4_chr_data[(x)] = chr_table[(x)];
1943      return 0x00;
18251944   }
1945
1946   return mpu4_current_chr_table[prot_col].response;
18261947}
18271948
18281949
1950
1951
1952mpu4_chr_table adders_data[64] = {
1953   {0x00, 0x00}, {0x1A, 0x8C}, {0x04, 0x64}, {0x10, 0x84}, {0x18, 0x84}, {0x0F, 0xC4}, {0x13, 0x84}, {0x1B, 0x84},
1954   {0x03, 0x9C}, {0x07, 0xF4}, {0x17, 0x04}, {0x1D, 0xCC}, {0x36, 0x24}, {0x35, 0x84}, {0x2B, 0xC4}, {0x28, 0x94},
1955   {0x39, 0x54}, {0x21, 0x0C}, {0x22, 0x74}, {0x25, 0x0C}, {0x2C, 0x34}, {0x29, 0x04}, {0x31, 0x84}, {0x34, 0x84},
1956   {0x0A, 0xC4}, {0x1F, 0x84}, {0x06, 0x9C}, {0x0E, 0xE4}, {0x1C, 0x84}, {0x12, 0x84}, {0x1E, 0x84}, {0x0D, 0xD4},
1957   {0x14, 0x44}, {0x0A, 0x84}, {0x19, 0xC4}, {0x15, 0x84}, {0x06, 0x9C}, {0x0F, 0xE4}, {0x08, 0x84}, {0x1B, 0x84},
1958   {0x1E, 0x84}, {0x04, 0x8C}, {0x01, 0x60}, {0x0C, 0x84}, {0x18, 0x84}, {0x1A, 0x84}, {0x11, 0x84}, {0x0B, 0xC4},
1959   {0x03, 0x9C}, {0x17, 0xF4}, {0x10, 0x04}, {0x1D, 0xCC}, {0x0E, 0x24}, {0x07, 0x9C}, {0x12, 0xF4}, {0x09, 0x04},
1960   {0x0D, 0x94}, {0x1F, 0x14}, {0x16, 0x44}, {0x05, 0x8C}, {0x13, 0x34}, {0x1C, 0x04}, {0x02, 0x9C}, {0x00, 0x00}
1961};
1962
1963mpu4_chr_table crmaze_data[64] = {
1964   {0x00, 0x00}, {0x1A, 0x84}, {0x04, 0x94}, {0x10, 0x3C}, {0x18, 0xEC}, {0x0F, 0x5C}, {0x13, 0xEC}, {0x1B, 0x50},
1965   {0x03, 0x2C}, {0x07, 0x68}, {0x17, 0x60}, {0x1D, 0xAC}, {0x36, 0x74}, {0x35, 0x00}, {0x2B, 0xAC}, {0x28, 0x58},
1966   {0x39, 0xEC}, {0x21, 0x7C}, {0x22, 0xEC}, {0x25, 0x58}, {0x2C, 0xE0}, {0x29, 0x90}, {0x31, 0x18}, {0x34, 0xEC},
1967   {0x0A, 0x54}, {0x1F, 0x28}, {0x06, 0x68}, {0x0E, 0x44}, {0x1C, 0x84}, {0x12, 0xB4}, {0x1E, 0x10}, {0x0D, 0x20},
1968   {0x14, 0x84}, {0x0A, 0xBC}, {0x19, 0xE8}, {0x15, 0x70}, {0x06, 0x24}, {0x0F, 0x84}, {0x08, 0xB8}, {0x1B, 0xE0},
1969   {0x1E, 0x94}, {0x04, 0x14}, {0x01, 0x2C}, {0x0C, 0x64}, {0x18, 0x8C}, {0x1A, 0x50}, {0x11, 0x28}, {0x0B, 0x4C},
1970   {0x03, 0x6C}, {0x17, 0x60}, {0x10, 0xA0}, {0x1D, 0xBC}, {0x0E, 0xCC}, {0x07, 0x78}, {0x12, 0xE8}, {0x09, 0x50},
1971   {0x0D, 0x20}, {0x1F, 0xAC}, {0x16, 0x74}, {0x05, 0x04}, {0x13, 0xA4}, {0x1C, 0x94}, {0x02, 0x3C}, {0x00, 0x00}
1972};
1973
1974mpu4_chr_table crmazea_data[64] = {
1975   {0x00, 0x00}, {0x1A, 0x0C}, {0x04, 0x90}, {0x10, 0xE0}, {0x18, 0xA4}, {0x0F, 0xAC}, {0x13, 0x78}, {0x1B, 0x5C},
1976   {0x03, 0xDC}, {0x07, 0xD4}, {0x17, 0xA0}, {0x1D, 0xEC}, {0x36, 0x78}, {0x35, 0x54}, {0x2B, 0x48}, {0x28, 0x50},
1977   {0x39, 0xC8}, {0x21, 0xF8}, {0x22, 0xDC}, {0x25, 0x94}, {0x2C, 0xE0}, {0x29, 0x24}, {0x31, 0x0C}, {0x34, 0xD8},
1978   {0x0A, 0x5C}, {0x1F, 0xD4}, {0x06, 0x68}, {0x0E, 0x18}, {0x1C, 0x14}, {0x12, 0xC8}, {0x1E, 0x38}, {0x0D, 0x5C},
1979   {0x14, 0xDC}, {0x0A, 0x5C}, {0x19, 0xDC}, {0x15, 0xD4}, {0x06, 0x68}, {0x0F, 0x18}, {0x08, 0xD4}, {0x1B, 0x60},
1980   {0x1E, 0x0C}, {0x04, 0x90}, {0x01, 0xE8}, {0x0C, 0xF8}, {0x18, 0xD4}, {0x1A, 0x60}, {0x11, 0x44}, {0x0B, 0x4C},
1981   {0x03, 0xD8}, {0x17, 0xD4}, {0x10, 0xE8}, {0x1D, 0xF8}, {0x0E, 0x9C}, {0x07, 0xD4}, {0x12, 0xE8}, {0x09, 0x30},
1982   {0x0D, 0x48}, {0x1F, 0xD8}, {0x16, 0xDC}, {0x05, 0x94}, {0x13, 0xE8}, {0x1C, 0x38}, {0x02, 0xDC}, {0x00, 0x00}
1983};
1984
1985mpu4_chr_table mating_data[64] = {
1986   {0x00, 0x00}, {0x1A, 0x18}, {0x04, 0xC8}, {0x10, 0xA4}, {0x18, 0x0C}, {0x0F, 0x80}, {0x13, 0x0C}, {0x1B, 0x90},
1987   {0x03, 0x34}, {0x07, 0x30}, {0x17, 0x00}, {0x1D, 0x58}, {0x36, 0xC8}, {0x35, 0x84}, {0x2B, 0x4C}, {0x28, 0xA0},
1988   {0x39, 0x4C}, {0x21, 0xC0}, {0x22, 0x3C}, {0x25, 0xC8}, {0x2C, 0xA4}, {0x29, 0x4C}, {0x31, 0x80}, {0x34, 0x0C},
1989   {0x0A, 0x80}, {0x1F, 0x0C}, {0x06, 0xE0}, {0x0E, 0x1C}, {0x1C, 0x88}, {0x12, 0xA4}, {0x1E, 0x0C}, {0x0D, 0xA0},
1990   {0x14, 0x0C}, {0x0A, 0x80}, {0x19, 0x4C}, {0x15, 0xA0}, {0x06, 0x3C}, {0x0F, 0x98}, {0x08, 0xEC}, {0x1B, 0x84},
1991   {0x1E, 0x0C}, {0x04, 0xC0}, {0x01, 0x1C}, {0x0C, 0xA8}, {0x18, 0x84}, {0x1A, 0x0C}, {0x11, 0xA0}, {0x0B, 0x5C},
1992   {0x03, 0xE8}, {0x17, 0xA4}, {0x10, 0x0C}, {0x1D, 0xD0}, {0x0E, 0x04}, {0x07, 0x38}, {0x12, 0xA8}, {0x09, 0xC4},
1993   {0x0D, 0x2C}, {0x1F, 0x90}, {0x16, 0x44}, {0x05, 0x18}, {0x13, 0xE8}, {0x1C, 0x84}, {0x02, 0x3C}, {0x00, 0x00}
1994};
1995
1996mpu4_chr_table skiltrek_data[64] = {
1997   {0x00, 0x00}, {0x1A, 0x1C}, {0x04, 0xCC}, {0x10, 0x64}, {0x18, 0x1C}, {0x0F, 0x4C}, {0x13, 0x64}, {0x1B, 0x1C},
1998   {0x03, 0xEC}, {0x07, 0xE4}, {0x17, 0x0C}, {0x1D, 0xD4}, {0x36, 0x84}, {0x35, 0x0C}, {0x2B, 0x44}, {0x28, 0x2C},
1999   {0x39, 0xD4}, {0x21, 0x14}, {0x22, 0x34}, {0x25, 0x14}, {0x2C, 0x24}, {0x29, 0x0C}, {0x31, 0x44}, {0x34, 0x0C},
2000   {0x0A, 0x44}, {0x1F, 0x1C}, {0x06, 0xEC}, {0x0E, 0x54}, {0x1C, 0x04}, {0x12, 0x0C}, {0x1E, 0x54}, {0x0D, 0x24},
2001   {0x14, 0x0C}, {0x0A, 0x44}, {0x19, 0x9C}, {0x15, 0xEC}, {0x06, 0xE4}, {0x0F, 0x1C}, {0x08, 0x6C}, {0x1B, 0x54},
2002   {0x1E, 0x04}, {0x04, 0x1C}, {0x01, 0xC8}, {0x0C, 0x64}, {0x18, 0x1C}, {0x1A, 0x4C}, {0x11, 0x64}, {0x0B, 0x1C},
2003   {0x03, 0xEC}, {0x17, 0x64}, {0x10, 0x0C}, {0x1D, 0xD4}, {0x0E, 0x04}, {0x07, 0x3C}, {0x12, 0x6C}, {0x09, 0x44},
2004   {0x0D, 0x2C}, {0x1F, 0x54}, {0x16, 0x84}, {0x05, 0x1C}, {0x13, 0xEC}, {0x1C, 0x44}, {0x02, 0x3C}, {0x00, 0x00}
2005};
2006
2007mpu4_chr_table timemchn_data[64] = {
2008   {0x00, 0x00}, {0x1A, 0x2C}, {0x04, 0x94}, {0x10, 0x14}, {0x18, 0x04}, {0x0F, 0x0C}, {0x13, 0xC4}, {0x1B, 0x0C},
2009   {0x03, 0xD4}, {0x07, 0x64}, {0x17, 0x0C}, {0x1D, 0xB4}, {0x36, 0x04}, {0x35, 0x0C}, {0x2B, 0x84}, {0x28, 0x5C},
2010   {0x39, 0xDC}, {0x21, 0x9C}, {0x22, 0xDC}, {0x25, 0x9C}, {0x2C, 0xDC}, {0x29, 0xCC}, {0x31, 0x84}, {0x34, 0x0C},
2011   {0x0A, 0x84}, {0x1F, 0x0C}, {0x06, 0xD4}, {0x0E, 0x04}, {0x1C, 0x2C}, {0x12, 0xC4}, {0x1E, 0x0C}, {0x0D, 0xC4},
2012   {0x14, 0x0C}, {0x0A, 0x84}, {0x19, 0x1C}, {0x15, 0xDC}, {0x06, 0xDC}, {0x0F, 0x8C}, {0x08, 0xD4}, {0x1B, 0x44},
2013   {0x1E, 0x2C}, {0x04, 0x94}, {0x01, 0x20}, {0x0C, 0x0C}, {0x18, 0xA4}, {0x1A, 0x0C}, {0x11, 0xC4}, {0x0B, 0x0C},
2014   {0x03, 0xD4}, {0x17, 0x14}, {0x10, 0x14}, {0x1D, 0x54}, {0x0E, 0x04}, {0x07, 0x6C}, {0x12, 0xC4}, {0x09, 0x4C},
2015   {0x0D, 0xC4}, {0x1F, 0x0C}, {0x16, 0xC4}, {0x05, 0x2C}, {0x13, 0xC4}, {0x1C, 0x0C}, {0x02, 0xD4}, {0x00, 0x00}
2016};
2017
2018mpu4_chr_table strikeit_data[64] = {
2019   {0x00, 0x00}, {0x1A, 0xC4}, {0x04, 0xC4}, {0x10, 0x44}, {0x18, 0xC4}, {0x0F, 0x44}, {0x13, 0x44}, {0x1B, 0xC4},
2020   {0x03, 0xCC}, {0x07, 0x3C}, {0x17, 0x5C}, {0x1D, 0x7C}, {0x36, 0x54}, {0x35, 0x24}, {0x2B, 0xC4}, {0x28, 0x4C},
2021   {0x39, 0xB4}, {0x21, 0x84}, {0x22, 0xCC}, {0x25, 0x34}, {0x2C, 0x04}, {0x29, 0x4C}, {0x31, 0x14}, {0x34, 0x24},
2022   {0x0A, 0xC4}, {0x1F, 0x44}, {0x06, 0xCC}, {0x0E, 0x14}, {0x1C, 0x04}, {0x12, 0x44}, {0x1E, 0xC4}, {0x0D, 0x4C},
2023   {0x14, 0x1C}, {0x0A, 0x54}, {0x19, 0x2C}, {0x15, 0x1C}, {0x06, 0x7C}, {0x0F, 0xD4}, {0x08, 0x0C}, {0x1B, 0x94},
2024   {0x1E, 0x04}, {0x04, 0xC4}, {0x01, 0xC0}, {0x0C, 0x4C}, {0x18, 0x94}, {0x1A, 0x04}, {0x11, 0x44}, {0x0B, 0x44},
2025   {0x03, 0xCC}, {0x17, 0x1C}, {0x10, 0x7C}, {0x1D, 0x7C}, {0x0E, 0xD4}, {0x07, 0x8C}, {0x12, 0x1C}, {0x09, 0x5C},
2026   {0x0D, 0x5C}, {0x1F, 0x5C}, {0x16, 0x7C}, {0x05, 0x74}, {0x13, 0x04}, {0x1C, 0xC4}, {0x02, 0xCC}, {0x00, 0x00}
2027};
2028
2029mpu4_chr_table turnover_data[64] = {
2030   {0x00, 0x00}, {0x1A, 0x1C}, {0x04, 0x6C}, {0x10, 0xA4}, {0x18, 0x0C}, {0x0F, 0x24}, {0x13, 0x0C}, {0x1B, 0x34},
2031   {0x03, 0x94}, {0x07, 0x94}, {0x17, 0x44}, {0x1D, 0x5C}, {0x36, 0x6C}, {0x35, 0x24}, {0x2B, 0x1C}, {0x28, 0xAC},
2032   {0x39, 0x64}, {0x21, 0x1C}, {0x22, 0xEC}, {0x25, 0x64}, {0x2C, 0x0C}, {0x29, 0xA4}, {0x31, 0x0C}, {0x34, 0x24},
2033   {0x0A, 0x1C}, {0x1F, 0xAC}, {0x06, 0xE4}, {0x0E, 0x1C}, {0x1C, 0x2C}, {0x12, 0xA4}, {0x1E, 0x0C}, {0x0D, 0xA4},
2034   {0x14, 0x0C}, {0x0A, 0x24}, {0x19, 0x5C}, {0x15, 0xEC}, {0x06, 0xE4}, {0x0F, 0x1C}, {0x08, 0xAC}, {0x1B, 0x24},
2035   {0x1E, 0x1C}, {0x04, 0x6C}, {0x01, 0x60}, {0x0C, 0x0C}, {0x18, 0x34}, {0x1A, 0x04}, {0x11, 0x0C}, {0x0B, 0x24},
2036   {0x03, 0x9C}, {0x17, 0xEC}, {0x10, 0xA4}, {0x1D, 0x4C}, {0x0E, 0x24}, {0x07, 0x9C}, {0x12, 0xEC}, {0x09, 0x24},
2037   {0x0D, 0x0C}, {0x1F, 0x34}, {0x16, 0x04}, {0x05, 0x1C}, {0x13, 0xEC}, {0x1C, 0x24}, {0x02, 0x9C}, {0x00, 0x00}
2038};
2039
2040mpu4_chr_table eyesdown_data[64] = {
2041   {0x00, 0x00}, {0x1A, 0x8C}, {0x04, 0x64}, {0x10, 0x0C}, {0x18, 0xC4}, {0x0F, 0x0C}, {0x13, 0x54}, {0x1B, 0x14},
2042   {0x03, 0x94}, {0x07, 0x94}, {0x17, 0x24}, {0x1D, 0xAC}, {0x36, 0x44}, {0x35, 0x0C}, {0x2B, 0x44}, {0x28, 0x1C},
2043   {0x39, 0x7C}, {0x21, 0x6C}, {0x22, 0x74}, {0x25, 0x84}, {0x2C, 0x3C}, {0x29, 0x4C}, {0x31, 0x44}, {0x34, 0x0C},
2044   {0x0A, 0x44}, {0x1F, 0x8C}, {0x06, 0x74}, {0x0E, 0x84}, {0x1C, 0x0C}, {0x12, 0x54}, {0x1E, 0x04}, {0x0D, 0x1C},
2045   {0x14, 0x7C}, {0x0A, 0xCC}, {0x19, 0x64}, {0x15, 0x0C}, {0x06, 0x74}, {0x0F, 0x84}, {0x08, 0x3C}, {0x1B, 0x5C},
2046   {0x1E, 0x4C}, {0x04, 0x64}, {0x01, 0x88}, {0x0C, 0x74}, {0x18, 0x04}, {0x1A, 0x8C}, {0x11, 0x54}, {0x0B, 0x04},
2047   {0x03, 0x9C}, {0x17, 0x7C}, {0x10, 0x5C}, {0x1D, 0x7C}, {0x0E, 0xCC}, {0x07, 0x74}, {0x12, 0x04}, {0x09, 0x1C},
2048   {0x0D, 0x5C}, {0x1F, 0x5C}, {0x16, 0x7C}, {0x05, 0x6C}, {0x13, 0x54}, {0x1C, 0x04}, {0x02, 0x9C}, {0x00, 0x00}
2049};
2050
2051mpu4_chr_table quidgrid_data[64] = {
2052   {0x00, 0x00}, {0x1A, 0x64}, {0x04, 0x64}, {0x10, 0x24}, {0x18, 0x64}, {0x0F, 0x64}, {0x13, 0x24}, {0x1B, 0x64},
2053   {0x03, 0x74}, {0x07, 0x54}, {0x17, 0x84}, {0x1D, 0xA4}, {0x36, 0x24}, {0x35, 0x24}, {0x2B, 0x64}, {0x28, 0x24},
2054   {0x39, 0xE4}, {0x21, 0x64}, {0x22, 0x74}, {0x25, 0x44}, {0x2C, 0x34}, {0x29, 0x04}, {0x31, 0x24}, {0x34, 0x24},
2055   {0x0A, 0x64}, {0x1F, 0x64}, {0x06, 0x74}, {0x0E, 0x44}, {0x1C, 0x64}, {0x12, 0x24}, {0x1E, 0x64}, {0x0D, 0x24},
2056   {0x14, 0x24}, {0x0A, 0x64}, {0x19, 0xE4}, {0x15, 0x24}, {0x06, 0x74}, {0x0F, 0x44}, {0x08, 0x34}, {0x1B, 0x14},
2057   {0x1E, 0x04}, {0x04, 0x64}, {0x01, 0x60}, {0x0C, 0x24}, {0x18, 0x64}, {0x1A, 0x64}, {0x11, 0x24}, {0x0B, 0x64},
2058   {0x03, 0x74}, {0x17, 0x04}, {0x10, 0x24}, {0x1D, 0xE4}, {0x0E, 0x64}, {0x07, 0x74}, {0x12, 0x04}, {0x09, 0x34},
2059   {0x0D, 0x04}, {0x1F, 0x64}, {0x16, 0x24}, {0x05, 0x64}, {0x13, 0x24}, {0x1C, 0x64}, {0x02, 0x74}, {0x00, 0x00}
2060};
2061
2062static DRIVER_INIT (adders)
2063{
2064   mpu4_current_chr_table = adders_data;
2065}
2066
2067
2068static DRIVER_INIT (crmaze)
2069{
2070   mpu4_current_chr_table = crmaze_data;
2071}
2072
2073
2074static DRIVER_INIT (crmazea)
2075{
2076   mpu4_current_chr_table = crmazea_data;
2077}
2078
2079
2080static DRIVER_INIT (mating)
2081{
2082   const address_space *space = cputag_get_address_space(machine, "video", ADDRESS_SPACE_PROGRAM);
2083   running_device *device = devtag_get_device(machine, "oki");
2084
2085   /* The Mating Game has an extra 256kB RAM on the program card */
2086   memory_install_ram(space, 0x600000, 0x63ffff, 0, 0, NULL);
2087
2088   /* There is also an OKIM6376 present on the program card */
2089   memory_install_readwrite16_device_handler(space, device, 0xffa040, 0xffa0ff, 0, 0, oki_r, oki_w );
2090
2091   mpu4_current_chr_table = mating_data;
2092}
2093
2094
2095static DRIVER_INIT (skiltrek)
2096{
2097   mpu4_current_chr_table = skiltrek_data;
2098}
2099
2100static DRIVER_INIT (timemchn)
2101{
2102   mpu4_current_chr_table = timemchn_data;
2103}
2104
2105static DRIVER_INIT (strikeit)
2106{
2107   mpu4_current_chr_table = strikeit_data;
2108}
2109
2110static DRIVER_INIT (turnover)
2111{
2112   mpu4_current_chr_table = turnover_data;
2113}
2114
2115static DRIVER_INIT (eyesdown)
2116{
2117   mpu4_current_chr_table = eyesdown_data;
2118}
2119
2120static DRIVER_INIT (quidgrid)
2121{
2122   mpu4_current_chr_table = quidgrid_data;
2123}
2124
2125
2126
18292127ROM_START( dealem )
18302128   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00  )
18312129   ROM_LOAD( "zenndlem.u6",   0x8000, 0x8000,  CRC(571e5c05) SHA1(89b4c331407a04eae34bb187b036791e0a671533) )
r7882r7883
18542152   VID_BIOS
18552153ROM_END
18562154
2155ROM_START( prizeinv )
2156   ROM_REGION( 0x10000, "maincpu", 0 )
2157   ROM_LOAD("in220mpu4.p1",  0x00000, 0x04000,  CRC(75ff4b1f) SHA1(a3adaad9a91c30fe6ff42dc2003c34a199b28807) )
2158
2159   ROM_REGION( 0x800000, "video", 0 )
2160   ROM_LOAD16_BYTE( "in2-20p1.1",  0x000000, 0x10000, CRC(f34d9001) SHA1(2bae06f4a5a5510b15b918261ecb0de9e34a6b53) )
2161   ROM_LOAD16_BYTE( "in2-20p1.2",  0x000001, 0x10000, CRC(1dc931b4) SHA1(c46626183edd52c7938c5edee2395aacb49e0730) )
2162   ROM_LOAD16_BYTE( "in2-20p1.3",  0x020000, 0x10000, CRC(107aa448) SHA1(7b3d4053aaae3b97136cddefbc9edd5e61713ff7) )
2163   ROM_LOAD16_BYTE( "in2-20p1.4",  0x020001, 0x10000, CRC(04933278) SHA1(97462aef782f7fe82b60f4bddcad0e6a6b50f3df) )
2164ROM_END
2165
2166ROM_START( blox )
2167   ROM_REGION( 0x10000, "maincpu", 0 )
2168   ROM_LOAD("blxv___2.0_0",  0x00000, 0x04000, CRC(b399b85e) SHA1(d36391fee4e3126754d6a0fa5f52fe05bc676930) )
2169
2170   ROM_REGION( 0x800000, "video", 0 )
2171   ROM_LOAD16_BYTE( "blxv___2.0_1",  0x000000, 0x10000, CRC(68134eda) SHA1(b324ae1243164c7be7f5eced7ff93760e2176a4e) )
2172   ROM_LOAD16_BYTE( "blxv___2.0_2",  0x000001, 0x10000, CRC(6b1f8588) SHA1(e8a443f062555f1ed228e1bfed2031927bcd7015) )
2173   ROM_LOAD16_BYTE( "blxv___2.0_3",  0x020000, 0x10000, CRC(c62d704b) SHA1(bea0c9519063f1601f70372ccb49fb892fbd6e76) )
2174   ROM_LOAD16_BYTE( "blxv___2.0_4",  0x020001, 0x10000, CRC(e431471a) SHA1(cf90dc48be3bc5e3c5a8efea5818dbc15fa442e9) )
2175   ROM_LOAD16_BYTE( "blxv___2.0_5",  0x040001, 0x10000, CRC(98ac6bc7) SHA1(9575014ba21fa4330138a34f53e13d30d312bc8b) )
2176   ROM_LOAD16_BYTE( "blxv___2.0_6",  0x040001, 0x10000, CRC(a3d92b5b) SHA1(1e7042d5eae4a19a01a3ef7d806c434886dc9f4d) )
2177ROM_END
2178
2179ROM_START( bloxd )
2180   ROM_REGION( 0x10000, "maincpu", 0 )
2181   ROM_LOAD("blxv_d_2.0_0",  0x00000, 0x04000, CRC(2e0891e1) SHA1(3e8ffd0d41227a8a1e311ca0c0bde7590e06dfbd) )
2182
2183   ROM_REGION( 0x800000, "video", 0 )
2184   ROM_LOAD16_BYTE( "blxv___2.0_1",  0x000000, 0x10000, CRC(68134eda) SHA1(b324ae1243164c7be7f5eced7ff93760e2176a4e) )
2185   ROM_LOAD16_BYTE( "blxv___2.0_2",  0x000001, 0x10000, CRC(6b1f8588) SHA1(e8a443f062555f1ed228e1bfed2031927bcd7015) )
2186   ROM_LOAD16_BYTE( "blxv___2.0_3",  0x020000, 0x10000, CRC(c62d704b) SHA1(bea0c9519063f1601f70372ccb49fb892fbd6e76) )
2187   ROM_LOAD16_BYTE( "blxv___2.0_4",  0x020001, 0x10000, CRC(e431471a) SHA1(cf90dc48be3bc5e3c5a8efea5818dbc15fa442e9) )
2188   ROM_LOAD16_BYTE( "blxv___2.0_5",  0x040001, 0x10000, CRC(98ac6bc7) SHA1(9575014ba21fa4330138a34f53e13d30d312bc8b) )
2189   ROM_LOAD16_BYTE( "blxv___2.0_6",  0x040001, 0x10000, CRC(a3d92b5b) SHA1(1e7042d5eae4a19a01a3ef7d806c434886dc9f4d) )
2190ROM_END
2191
2192
18572193ROM_START( crmaze )
18582194   ROM_REGION( 0x10000, "maincpu", 0 )
18592195   VID_BIOS
r7882r7883
19752311   VID_BIOS
19762312
19772313   ROM_REGION( 0x800000, "video", 0 )
1978   ROM_LOAD16_BYTE( "matd.p1",  0x000000, 0x080000,  CRC(e660909f) SHA1(0acd990264fd7faf1f91a796d2438e8c2c7b83d1) )
1979   ROM_LOAD16_BYTE( "matd.p2",  0x000001, 0x080000,  CRC(a4c7e9b4) SHA1(30148c0257181bb88159e02d2b7cd79995ee84a7) )
2314   ROM_LOAD16_BYTE( "mats.p1",  0x000000, 0x080000,  CRC(ebc7ea7e) SHA1(11015489a803ba5c8dbdafd632424bbd6080aece) )
2315   ROM_LOAD16_BYTE( "mats.p2",  0x000001, 0x080000,  CRC(a4c7e9b4) SHA1(30148c0257181bb88159e02d2b7cd79995ee84a7) )
19802316   ROM_LOAD16_BYTE( "matg.p3",  0x100000, 0x080000,  CRC(571f4e8e) SHA1(51babacb5d9fb1cc9e1e56a3b2a355597d04f178) )
19812317   ROM_LOAD16_BYTE( "matg.p4",  0x100001, 0x080000,  CRC(52d8657b) SHA1(e44e1db13c4abd4fedcd72df9dce1df594f74e44) )
19822318   ROM_LOAD16_BYTE( "matg.p5",  0x200000, 0x080000,  CRC(9f0c9552) SHA1(8b1197f20853e18841a8f64fd5ff58cdd0bd1dbd) )
r7882r7883
19942330   ROM_LOAD( "matsnd.p4",  0x180000, 0x080000,  CRC(d7e65c5b) SHA1(5575fb9f948158f2e94c986bf4bca9c9ee66a489) )
19952331ROM_END
19962332
1997ROM_START( matinga )
2333ROM_START( matingd )
19982334   ROM_REGION( 0x10000, "maincpu", 0 )
19992335   VID_BIOS
20002336
20012337   ROM_REGION( 0x800000, "video", 0 )
2002   ROM_LOAD16_BYTE( "mats.p1",  0x000000, 0x080000,  CRC(ebc7ea7e) SHA1(11015489a803ba5c8dbdafd632424bbd6080aece) ) /* 3 bytes changed from above set...*/
2003   ROM_LOAD16_BYTE( "mats.p2",  0x000001, 0x080000,  CRC(a4c7e9b4) SHA1(30148c0257181bb88159e02d2b7cd79995ee84a7) ) /* Just enough to disable the data logger */
2338   ROM_LOAD16_BYTE( "matd.p1",  0x000000, 0x080000,  CRC(e660909f) SHA1(0acd990264fd7faf1f91a796d2438e8c2c7b83d1) )
2339   ROM_LOAD16_BYTE( "matd.p2",  0x000001, 0x080000,  CRC(a4c7e9b4) SHA1(30148c0257181bb88159e02d2b7cd79995ee84a7) )
20042340   ROM_LOAD16_BYTE( "matg.p3",  0x100000, 0x080000,  CRC(571f4e8e) SHA1(51babacb5d9fb1cc9e1e56a3b2a355597d04f178) )
20052341   ROM_LOAD16_BYTE( "matg.p4",  0x100001, 0x080000,  CRC(52d8657b) SHA1(e44e1db13c4abd4fedcd72df9dce1df594f74e44) )
20062342   ROM_LOAD16_BYTE( "matg.p5",  0x200000, 0x080000,  CRC(9f0c9552) SHA1(8b1197f20853e18841a8f64fd5ff58cdd0bd1dbd) )
r7882r7883
20182354   ROM_LOAD( "matsnd.p4",  0x180000, 0x080000,  CRC(d7e65c5b) SHA1(5575fb9f948158f2e94c986bf4bca9c9ee66a489) )
20192355ROM_END
20202356
2021/* Vegas Poker Protoype dumped by HIGHWAYMAN */
2357ROM_START( adders )
2358   ROM_REGION( 0x10000, "maincpu", 0 )
2359   VID_BIOS
2360
2361   ROM_REGION( 0x800000, "video", 0 )
2362   ROM_LOAD16_BYTE( "al.p1",  0x000000, 0x10000,  CRC(97579eb2) SHA1(68f08ab73e0c8044de32f7eea1b3abc1fefff830) )
2363   ROM_LOAD16_BYTE( "al.p2",  0x000001, 0x10000,  CRC(ca877046) SHA1(7d0e1bb471b7acc89d04953ee5e0b34f64d58325) )
2364   ROM_LOAD16_BYTE( "al.p3",  0x020000, 0x10000,  CRC(92b5e1c4) SHA1(910126527ddb9d83f5c9c29caf2424ae4ebbc640) )
2365   ROM_LOAD16_BYTE( "al.p4",  0x020001, 0x10000,  CRC(5e0e3b23) SHA1(3862e7b873a1e2762032151289ce2ad886a8cc3c) )
2366   ROM_LOAD16_BYTE( "al.q1",  0x040000, 0x10000,  CRC(b9b50b70) SHA1(1887ab00ee004e3f27902d6880fa31277a981891) )
2367   ROM_LOAD16_BYTE( "al.q2",  0x040001, 0x10000,  CRC(1bed86ac) SHA1(8e6563b5441ad9ddd468a3d9ae906733fed7912a) )
2368   ROM_LOAD16_BYTE( "al.q3",  0x060000, 0x10000,  CRC(294d8f28) SHA1(9f9aca491ba6c4dc5cfb91da867990a9610c3a28) )
2369   ROM_LOAD16_BYTE( "al.q4",  0x060001, 0x10000,  CRC(aa3e9fbd) SHA1(59d0868f4c8b3f56ca31a11d2e6af83b202bb735) )
2370   ROM_LOAD16_BYTE( "al.q5",  0x080000, 0x10000,  CRC(503f4193) SHA1(86df379c736598ba59446961bf0666e155164e1d) )
2371   ROM_LOAD16_BYTE( "al.q6",  0x080001, 0x10000,  CRC(9fd77e52) SHA1(d8fdebb0fd57ab9ea9797dd386168581a45ebc62) )
2372   ROM_LOAD16_BYTE( "al.q7",  0x0a0000, 0x10000,  CRC(cf3fa7c7) SHA1(fa1edf09c6d3a8b5737474117b0306ef64f7741c) )
2373   ROM_LOAD16_BYTE( "al.q8",  0x0a0001, 0x10000,  CRC(55058a63) SHA1(cf9edef5264f4301be4ee11f221ab67a5183a603) )
2374   ROM_LOAD16_BYTE( "al.q9",  0x0c0000, 0x10000,  CRC(22274191) SHA1(9bee5709edcd853e96408f37447c0f5324610903) )
2375   ROM_LOAD16_BYTE( "al.qa",  0x0c0001, 0x10000,  CRC(1fe98b4d) SHA1(533afeaea42903905f6f1206bba1a023b141bdd9) )
2376ROM_END
2377
2378
2379ROM_START( strikeit )
2380   ROM_REGION( 0x10000, "maincpu", 0 )
2381   VID_BIOS
2382
2383   ROM_REGION( 0x800000, "video", 0 )
2384   ROM_LOAD16_BYTE( "sils.p1", 0x000000, 0x020000,  CRC(66ed6696) SHA1(a6aa68eb212254213db5573dfb9da1e9e06a8e39) )
2385   ROM_LOAD16_BYTE( "sil.p2",  0x000001, 0x020000,  CRC(1afc07b7) SHA1(38777d56192b640b003d8dbf4b793cee0c81d9b2) )
2386   ROM_LOAD16_BYTE( "sil.p3",  0x040000, 0x020000,  CRC(40f5851c) SHA1(0e3dc0dd2a257a955a1f250556d047481ae87269) )
2387   ROM_LOAD16_BYTE( "sil.p4",  0x040001, 0x020000,  CRC(657e297e) SHA1(306f40376115ca40099a0010650b5edc183a2c57) )
2388   ROM_LOAD16_BYTE( "sil.p5",  0x080000, 0x020000,  CRC(28bced09) SHA1(7ba5013f1e0f4e921581b23c4a1d4c005a043b66) )
2389   ROM_LOAD16_BYTE( "sil.p6",  0x080001, 0x020000,  CRC(6f5fc296) SHA1(bd32a937581df6b5a4f08e6ef40c37a2b4278936) )
2390
2391   ROM_LOAD( "strikeitlucky_questions",  0x0c0000, 0x020000,  NO_DUMP ) // no dumps of question ROMs for this game..
2392ROM_END
2393
2394ROM_START( strikeitd )
2395   ROM_REGION( 0x10000, "maincpu", 0 )
2396   VID_BIOS
2397
2398   ROM_REGION( 0x800000, "video", 0 )
2399   ROM_LOAD16_BYTE( "sild.p1", 0x000000, 0x020000,  CRC(6886e7c8) SHA1(9ef0895c9a8df762d17a3ea036bf0c6c2a440582) )
2400   ROM_LOAD16_BYTE( "sil.p2",  0x000001, 0x020000,  CRC(1afc07b7) SHA1(38777d56192b640b003d8dbf4b793cee0c81d9b2) )
2401   ROM_LOAD16_BYTE( "sil.p3",  0x040000, 0x020000,  CRC(40f5851c) SHA1(0e3dc0dd2a257a955a1f250556d047481ae87269) )
2402   ROM_LOAD16_BYTE( "sil.p4",  0x040001, 0x020000,  CRC(657e297e) SHA1(306f40376115ca40099a0010650b5edc183a2c57) )
2403   ROM_LOAD16_BYTE( "sil.p5",  0x080000, 0x020000,  CRC(28bced09) SHA1(7ba5013f1e0f4e921581b23c4a1d4c005a043b66) )
2404   ROM_LOAD16_BYTE( "sil.p6",  0x080001, 0x020000,  CRC(6f5fc296) SHA1(bd32a937581df6b5a4f08e6ef40c37a2b4278936) )
2405
2406   ROM_LOAD( "strikeitlucky_questions",  0x0c0000, 0x020000,  NO_DUMP ) // no dumps of question ROMs for this game..
2407ROM_END
2408
2409ROM_START( strikeit2 )
2410   ROM_REGION( 0x10000, "maincpu", 0 )
2411   VID_BIOS
2412
2413   ROM_REGION( 0x800000, "video", 0 )
2414   ROM_LOAD16_BYTE( "sil3.p1", 0x000000, 0x020000,  CRC(51c22f94) SHA1(dbdd30e67df4662d13b32a1df6cfabef2cf9471f) )
2415   ROM_LOAD16_BYTE( "sil.p2",  0x000001, 0x020000,  CRC(1afc07b7) SHA1(38777d56192b640b003d8dbf4b793cee0c81d9b2) )
2416   ROM_LOAD16_BYTE( "sil.p3",  0x040000, 0x020000,  CRC(40f5851c) SHA1(0e3dc0dd2a257a955a1f250556d047481ae87269) )
2417   ROM_LOAD16_BYTE( "sil.p4",  0x040001, 0x020000,  CRC(657e297e) SHA1(306f40376115ca40099a0010650b5edc183a2c57) )
2418   ROM_LOAD16_BYTE( "sil.p5",  0x080000, 0x020000,  CRC(28bced09) SHA1(7ba5013f1e0f4e921581b23c4a1d4c005a043b66) )
2419   ROM_LOAD16_BYTE( "sil.p6",  0x080001, 0x020000,  CRC(6f5fc296) SHA1(bd32a937581df6b5a4f08e6ef40c37a2b4278936) )
2420
2421   ROM_LOAD( "strikeitlucky_questions",  0x0c0000, 0x020000,  NO_DUMP ) // no dumps of question ROMs for this game..
2422ROM_END
2423
2424ROM_START( strikeit2d )
2425   ROM_REGION( 0x10000, "maincpu", 0 )
2426   VID_BIOS
2427
2428   ROM_REGION( 0x800000, "video", 0 )
2429   ROM_LOAD16_BYTE( "sil3d.p1", 0x000000, 0x020000,  CRC(82def1b5) SHA1(d3e90e8e4e905a3779889305bb6441907d9169f1) )
2430   ROM_LOAD16_BYTE( "sil.p2",  0x000001, 0x020000,  CRC(1afc07b7) SHA1(38777d56192b640b003d8dbf4b793cee0c81d9b2) )
2431   ROM_LOAD16_BYTE( "sil.p3",  0x040000, 0x020000,  CRC(40f5851c) SHA1(0e3dc0dd2a257a955a1f250556d047481ae87269) )
2432   ROM_LOAD16_BYTE( "sil.p4",  0x040001, 0x020000,  CRC(657e297e) SHA1(306f40376115ca40099a0010650b5edc183a2c57) )
2433   ROM_LOAD16_BYTE( "sil.p5",  0x080000, 0x020000,  CRC(28bced09) SHA1(7ba5013f1e0f4e921581b23c4a1d4c005a043b66) )
2434   ROM_LOAD16_BYTE( "sil.p6",  0x080001, 0x020000,  CRC(6f5fc296) SHA1(bd32a937581df6b5a4f08e6ef40c37a2b4278936) )
2435
2436   ROM_LOAD( "strikeitlucky_questions",  0x0c0000, 0x020000,  NO_DUMP ) // no dumps of question ROMs for this game..
2437ROM_END
2438
2439ROM_START( eyesdown )
2440   ROM_REGION( 0x10000, "maincpu", 0 )
2441   VID_BIOS
2442
2443   ROM_REGION( 0x800000, "video", 0 )
2444   ROM_LOAD16_BYTE( "eds.p1", 0x000000, 0x010000, CRC(bd4f4c5d) SHA1(4ad34d92d45c0b8c70af8454525dd669cab94c5c) )
2445   ROM_LOAD16_BYTE( "ed.p2",  0x000001, 0x010000, CRC(8804b926) SHA1(cf9d49ca090a435819f2cd2d32dec3a6767f9e10) )
2446   ROM_LOAD16_BYTE( "ed.p3",  0x020000, 0x010000, CRC(969d2264) SHA1(b55f6881852f81ec9fb2c57c8137c872f4714710) )
2447   ROM_LOAD16_BYTE( "ed.p4",  0x020001, 0x010000, CRC(80d9addd) SHA1(f6359354c928e69a90cdf6d4f514c4992d3fa64c) )
2448
2449   ROM_LOAD( "eyesdown_questions",  0x040000, 0x020000,  NO_DUMP ) // no dumps of question ROMs for this game..
2450ROM_END
2451
2452ROM_START( eyesdownd )
2453   ROM_REGION( 0x10000, "maincpu", 0 )
2454   VID_BIOS
2455
2456   ROM_REGION( 0x800000, "video", 0 )
2457   ROM_LOAD16_BYTE( "edd.p1", 0x000000, 0x010000, CRC(369a145c) SHA1(c54305690798086b4f809f38d1a6454d1d34fd0c) )
2458   ROM_LOAD16_BYTE( "ed.p2",  0x000001, 0x010000, CRC(8804b926) SHA1(cf9d49ca090a435819f2cd2d32dec3a6767f9e10) )
2459   ROM_LOAD16_BYTE( "ed.p3",  0x020000, 0x010000, CRC(969d2264) SHA1(b55f6881852f81ec9fb2c57c8137c872f4714710) )
2460   ROM_LOAD16_BYTE( "ed.p4",  0x020001, 0x010000, CRC(80d9addd) SHA1(f6359354c928e69a90cdf6d4f514c4992d3fa64c) )
2461
2462   ROM_LOAD( "eyesdown_questions",  0x040000, 0x020000,  NO_DUMP ) // no dumps of question ROMs for this game..
2463ROM_END
2464
2465ROM_START( quidgrid )
2466   ROM_REGION( 0x10000, "maincpu", 0 )
2467   VID_BIOS
2468
2469   ROM_REGION( 0x800000, "video", 0 )
2470   ROM_LOAD16_BYTE( "qgs.p1", 0x000000, 0x010000, CRC(e6d072a9) SHA1(b2d656818c2fb12a26ef8a170152087336c00c66) )
2471   ROM_LOAD16_BYTE( "qg.p2",  0x000001, 0x010000, CRC(e4d74b11) SHA1(d23ccc57c54823ffaa7869ca824e049dc80f8945) )
2472   ROM_LOAD16_BYTE( "qg.p3",  0x020000, 0x010000, CRC(5dda7cd8) SHA1(246a801e862990aade98fa358477e53707714b42) )
2473   ROM_LOAD16_BYTE( "qg.p4",  0x020001, 0x010000, CRC(2106cf5d) SHA1(2073589775139ad92daef05a67afb2c70ece168c) )
2474
2475   ROM_LOAD( "quidgrid_questions",  0x040000, 0x020000,  NO_DUMP ) // no dumps of question ROMs for this game..
2476ROM_END
2477
2478ROM_START( quidgridd )
2479   ROM_REGION( 0x10000, "maincpu", 0 )
2480   VID_BIOS
2481
2482   ROM_REGION( 0x800000, "video", 0 )
2483   ROM_LOAD16_BYTE( "qgd.p1", 0x000000, 0x010000, CRC(c8d37bdf) SHA1(e39a41015dd551fd62efa52faf2c5106bf7d23ac) )
2484   ROM_LOAD16_BYTE( "qg.p2",  0x000001, 0x010000, CRC(e4d74b11) SHA1(d23ccc57c54823ffaa7869ca824e049dc80f8945) )
2485   ROM_LOAD16_BYTE( "qg.p3",  0x020000, 0x010000, CRC(5dda7cd8) SHA1(246a801e862990aade98fa358477e53707714b42) )
2486   ROM_LOAD16_BYTE( "qg.p4",  0x020001, 0x010000, CRC(2106cf5d) SHA1(2073589775139ad92daef05a67afb2c70ece168c) )
2487
2488   ROM_LOAD( "quidgrid_questions",  0x040000, 0x020000,  NO_DUMP ) // no dumps of question ROMs for this game..
2489ROM_END
2490
2491ROM_START( quidgrid2 )
2492   ROM_REGION( 0x10000, "maincpu", 0 )
2493   VID_BIOS
2494
2495   ROM_REGION( 0x800000, "video", 0 )
2496   ROM_LOAD16_BYTE( "q2gs.p1", 0x000000, 0x010000, CRC(6d4b92c0) SHA1(05777e0ecc8bf9f3564d8395bb7bfa245498d132) )
2497   ROM_LOAD16_BYTE( "q2g.p2",  0x000001, 0x010000, CRC(9bf74ae3) SHA1(11e75acad496a9304f612714afbef90e48d1b9cb) )
2498   ROM_LOAD16_BYTE( "q2g.p3",  0x020000, 0x010000, CRC(78555155) SHA1(e1218fc00f08c19a0cafb203e46044efa617ac16) )
2499   ROM_LOAD16_BYTE( "q2g.p4",  0x020001, 0x010000, CRC(2a4295b6) SHA1(2aa0b5dbe6b934a7a4c8069c91fd6d85cae02836) )
2500
2501   ROM_LOAD( "quidgrid_questions",  0x040000, 0x020000,  NO_DUMP ) // no dumps of question ROMs for this game..
2502ROM_END
2503
2504ROM_START( quidgrid2d )
2505   ROM_REGION( 0x10000, "maincpu", 0 )
2506   VID_BIOS
2507
2508   ROM_REGION( 0x800000, "video", 0 )
2509   ROM_LOAD16_BYTE( "q2gd.p1", 0x000000, 0x010000, CRC(26185449) SHA1(921d355020788d53e8ffa83af44223dbe5a2dd5e) )
2510   ROM_LOAD16_BYTE( "q2g.p2",  0x000001, 0x010000, CRC(9bf74ae3) SHA1(11e75acad496a9304f612714afbef90e48d1b9cb) )
2511   ROM_LOAD16_BYTE( "q2g.p3",  0x020000, 0x010000, CRC(78555155) SHA1(e1218fc00f08c19a0cafb203e46044efa617ac16) )
2512   ROM_LOAD16_BYTE( "q2g.p4",  0x020001, 0x010000, CRC(2a4295b6) SHA1(2aa0b5dbe6b934a7a4c8069c91fd6d85cae02836) )
2513
2514   ROM_LOAD( "quidgrid_questions",  0x040000, 0x020000,  NO_DUMP ) // no dumps of question ROMs for this game..
2515ROM_END
2516
2517
2518/* Vegas Poker Prototype dumped by HIGHWAYMAN */
20222519ROM_START( vgpoker )
20232520   ROM_REGION( 0x10000, "maincpu", 0 )
20242521   ROM_LOAD("comms-v2.0.bin",  0x00000, 0x10000,  CRC(1717581f) SHA1(40f8cae39a2ab0c89d2bbfd8a37725aaae229c96))
r7882r7883
20652562The real Deal 'Em ran on Summit Coin hardware, and was made by someone else.
20662563A further different release was made in 2000, running on the Barcrest MPU4 Video, rather than this one. */
20672564
2068GAME( 1987, dealem,    0,        dealem,   dealem,   0,    ROT0,  "Zenitone",      "Deal 'Em (MPU4 Conversion Kit, v7.0)",                        GAME_IMPERFECT_GRAPHICS )
2565GAME( 1987, dealem,    0,        dealem,   dealem,   0,        ROT0, "Zenitone",      "Deal 'Em (MPU4 Conversion Kit, v7.0)",                        GAME_IMPERFECT_GRAPHICS )
20692566
2070GAME( 199?, bctvidbs,0,       mpu4mod2, mpu4,     0,    ROT0,  "Barcrest",      "MPU4 Video Firmware",                                    GAME_IS_BIOS_ROOT )
2567GAME( 199?, bctvidbs,  0,        mpu4mod2, mpu4,     0,        ROT0, "Barcrest",      "MPU4 Video Firmware",                                    GAME_IS_BIOS_ROOT )
20712568
2072GAME( 1994?,crmaze,  bctvidbs,mpu4_vid, crmaze,   crmaze,ROT0,   "Barcrest",      "The Crystal Maze Team Challenge (SWP)",                     GAME_NOT_WORKING|GAME_NO_SOUND )
2073GAME( 1992?,crmazea, crmaze,  mpu4_vid, crmaze,   crmaze,ROT0,   "Barcrest",      "The Crystal Maze (AMLD Version)",                           GAME_NOT_WORKING|GAME_NO_SOUND )
2074GAME( 1993?,crmazeb, crmaze,  mpu4_vid, crmaze,   0,     ROT0,   "Barcrest",      "The New Crystal Maze Featuring Ocean Zone (AMLD Version)",         GAME_NOT_WORKING|GAME_NO_SOUND ) /* unprotected? */
2075GAME( 1990, turnover,bctvidbs,mpu4_vid, mpu4,     0,     ROT0,   "Barcrest",      "Turnover",                                             GAME_NOT_WORKING|GAME_NO_SOUND ) /* unprotected? */
2076GAME( 1992, skiltrek,bctvidbs,mpu4_vid, mpu4,     0,     ROT0,   "Barcrest",      "Skill Trek",                                          GAME_NOT_WORKING|GAME_NO_SOUND ) /* unprotected? */
2077GAME( 1990, timemchn,bctvidbs,mpu4_vid, mpu4,     0,     ROT0,   "Barcrest",      "Time Machine (v2.0)",                                    GAME_NOT_WORKING|GAME_NO_SOUND ) /* unprotected? */
2078GAME( 199?, mating,  bctvidbs,mpu4_vid, mpu4,     mating,ROT0,   "Barcrest",      "The Mating Game (Datapak)",                              GAME_NOT_WORKING|GAME_NO_SOUND )
2079GAME( 199?, matinga, mating,  mpu4_vid, mpu4,     mating,ROT0,   "Barcrest",      "The Mating Game (Standard)",                              GAME_NOT_WORKING|GAME_NO_SOUND )
2080GAME( 199?, vgpoker, 0,        vgpoker,   mpu4,     0,    ROT0,   "BwB",            "Vegas Poker (Prototype)",                                 GAME_NOT_WORKING|GAME_NO_SOUND )
2569/* Complete sets */
2570GAME( 1994,  crmaze,    bctvidbs, mpu4_vid, crmaze,   crmaze,   ROT0, "Barcrest",      "The Crystal Maze Team Challenge (SWP)",                     GAME_NOT_WORKING )
2571GAME( 1993,  crmazea,   crmaze,   mpu4_vid, crmaze,   crmazea,  ROT0, "Barcrest",      "The Crystal Maze (AMLD Version)",                           GAME_NOT_WORKING )
2572GAME( 1993,  crmazeb,   crmaze,   mpu4_vid, crmaze,   0,        ROT0, "Barcrest",      "The New Crystal Maze Featuring Ocean Zone (AMLD Version)",         GAME_NOT_WORKING ) /* unprotected? bootleg? */
20812573
2082GAMEL(1989?,connect4,0,       mpu4mod2, connect4, connect4, ROT0,"Dolbeck Systems", "Connect 4",                                          GAME_IMPERFECT_GRAPHICS|GAME_REQUIRES_ARTWORK,layout_connect4 )
2083GAME( 198?, mpu4utst,0,        mpu4mod2, mpu4,          0,   ROT0,"Barcrest",      "MPU4 Unit Test (Program 4)",                              0 )
2084GAME( 198?, mpu4tst2,0,        mpu4mod2, mpu4,          0,   ROT0,"Barcrest",      "MPU4 Unit Test (Program 2)",                              0 )
2085GAME( 198?, mpu4met0,0,        mpu4mod2, mpu4,          0, ROT0,"Barcrest",      "MPU4 Meter Clear ROM",                                    0 )
2574GAME( 199?,  turnover,  bctvidbs, mpu4_vid, mpu4,     turnover, ROT0, "Barcrest",      "Turnover (v2.3)",                                       GAME_NOT_WORKING )
2575
2576GAME( 1990,  skiltrek,  bctvidbs, mpu4_vid, mpu4,     skiltrek, ROT0, "Barcrest",      "Skill Trek (v1.1)",                                    GAME_NOT_WORKING )
2577
2578GAME( 1989,  adders,    bctvidbs, mpu4_vid, mpu4,     adders,   ROT0, "Barcrest",      "Adders and Ladders (v2.0)",                              GAME_NOT_WORKING )
2579
2580GAME( 1989,  timemchn,  bctvidbs, mpu4_vid, mpu4,     timemchn, ROT0, "Barcrest",      "Time Machine (v2.0)",                                    GAME_NOT_WORKING )
2581
2582GAME( 199?,  mating,    bctvidbs, mating,   mpu4,     mating,   ROT0, "Barcrest",      "The Mating Game (v0.2)",                                 GAME_NOT_WORKING )
2583GAME( 199?,  matingd,   mating,   mating,   mpu4,     mating,   ROT0, "Barcrest",      "The Mating Game (v0.2d)",                                 GAME_NOT_WORKING )
2584
2585/* Barquest */
2586/* Barquest II */
2587/* Wize Move */
2588
2589/* Games below are missing question ROMs */
2590GAME( 199?,  strikeit,  bctvidbs, mpu4_vid, mpu4,     strikeit, ROT0, "Barcrest",      "Strike it Lucky (v0.5)",                                 GAME_NOT_WORKING )
2591GAME( 199?,  strikeitd, strikeit, mpu4_vid, mpu4,     strikeit, ROT0, "Barcrest",      "Strike it Lucky (v0.5d)",                                 GAME_NOT_WORKING )
2592GAME( 199?,  strikeit2, strikeit, mpu4_vid, mpu4,     strikeit, ROT0, "Barcrest",      "Strike it Lucky (v0.53)",                                 GAME_NOT_WORKING )
2593GAME( 199?,  strikeit2d,strikeit, mpu4_vid, mpu4,     strikeit, ROT0, "Barcrest",      "Strike it Lucky (v0.53d)",                                 GAME_NOT_WORKING )
2594
2595GAME( 199?,  eyesdown,  bctvidbs, mpu4_vid, mpu4,     eyesdown, ROT0, "Barcrest",      "Eyes Down (v1.3)",                                       GAME_NOT_WORKING )
2596GAME( 199?,  eyesdownd, eyesdown, mpu4_vid, mpu4,     eyesdown, ROT0, "Barcrest",      "Eyes Down (v1.3d)",                                    GAME_NOT_WORKING )
2597
2598GAME( 199?,  quidgrid,  bctvidbs, mpu4_vid, mpu4,     quidgrid, ROT0, "Barcrest",      "Ten Quid Grid (v1.2)",                                       GAME_NOT_WORKING )
2599GAME( 199?,  quidgridd, quidgrid, mpu4_vid, mpu4,     quidgrid, ROT0, "Barcrest",      "Ten Quid Grid (v1.2d)",                                    GAME_NOT_WORKING )
2600GAME( 199?,  quidgrid2, quidgrid, mpu4_vid, mpu4,     quidgrid, ROT0, "Barcrest",      "Ten Quid Grid (v2.4)",                                       GAME_NOT_WORKING )
2601GAME( 199?,  quidgrid2d,quidgrid, mpu4_vid, mpu4,     quidgrid, ROT0, "Barcrest",      "Ten Quid Grid (v2.4d)",                                    GAME_NOT_WORKING )
2602
2603/* Games below are newer BwB games and use their own BIOS ROMs */
2604GAME( 199?,  vgpoker,   0,        vgpoker,  mpu4,     0,        ROT0, "BwB",         "Vegas Poker (prototype, release 2)",                        GAME_NOT_WORKING )
2605GAME( 199?,  prizeinv,  0,        mpu4_vid, mpu4,     0,        ROT0, "BwB",         "Prize Space Invaders (20\" v1.1)",                           GAME_NOT_WORKING )
2606GAME( 199?,  blox,      0,        mpu4_vid, mpu4,     0,        ROT0, "BwB",         "Blox (v2.0)",                                          GAME_NOT_WORKING )
2607GAME( 199?,  bloxd,     blox,     mpu4_vid, mpu4,     0,        ROT0, "BwB",         "Blox (v2.0, datapak)",                                    GAME_NOT_WORKING )
2608
2609/* Games below are non-video (why are they in this file? not mpu4.c?) */
2610GAMEL(1989?, connect4,  0,        mpu4mod2, connect4, connect4, ROT0, "Dolbeck Systems","Connect 4",                                          GAME_IMPERFECT_GRAPHICS|GAME_REQUIRES_ARTWORK,layout_connect4 )
2611GAME( 198?,  mpu4utst,  0,        mpu4mod2, mpu4,     0,        ROT0, "Barcrest",      "MPU4 Unit Test (Program 4)",                              0 )
2612GAME( 198?,  mpu4tst2,  0,        mpu4mod2, mpu4,     0,        ROT0, "Barcrest",      "MPU4 Unit Test (Program 2)",                              0 )
2613GAME( 198?,  mpu4met0,  0,        mpu4mod2, mpu4,     0,        ROT0, "Barcrest",      "MPU4 Meter Clear ROM",                                    0 )
src/mame/drivers/ghosteo.c
r7882r7883
572572   ROM_LOAD( "qs1001a.u17",  0x000000, 0x80000, CRC(d13c6407) SHA1(57b14f97c7d4f9b5d9745d3571a0b7115fbe3176) )
573573ROM_END
574574
575ROM_START( hapytour ) /* Same hardware: GHOST Ver1.1 2003.03.28 */
576   ROM_REGION( 0x2000000, "user1", 0 ) /* ARM 32 bit code */
577   ROM_LOAD( "flash.u1",     0x000000, 0x2000000, CRC(49deb7f9) SHA1(708a27d7177cf6261a49ded975c2bbb6c2427742) )
578
579   // banked every 0x10000 bytes ?
580   ROM_REGION( 0x080000, "user2", 0 )
581   ROM_LOAD( "ht.u20",       0x000000, 0x080000, CRC(c0581fce) SHA1(dafce679002534ffabed249a92e6b83301b8312b) )
582
583   ROM_REGION( 0x100000, "sfx", 0 ) /* QDSP samples (SFX) */
584   ROM_LOAD( "ht.u16",       0x000000, 0x100000, CRC(6a590a3a) SHA1(c1140f70c919661162334db66c6aa0ad656bfc47) )
585
586   ROM_REGION( 0x080000, "wavetable", 0 ) /* QDSP wavetable rom */
587   ROM_LOAD( "qs1001a.u17",  0x000000, 0x80000, CRC(d13c6407) SHA1(57b14f97c7d4f9b5d9745d3571a0b7115fbe3176) )
588ROM_END
589
575590static DRIVER_INIT( bballoon )
576591{
577592   UINT8 *flash = (UINT8 *)memory_region(machine, "user1");
r7882r7883
600615}
601616
602617GAME( 2003, bballoon, 0, bballoon, bballoon, bballoon, ROT0, "Eolith", "Balloon & Balloon", GAME_NO_SOUND | GAME_NOT_WORKING )
618GAME( 2005, hapytour, 0, bballoon, bballoon, 0,        ROT0, "GAV Company", "Happy Tour", GAME_NO_SOUND | GAME_NOT_WORKING ) /* Likely will need simular flash ECC check patches */
src/mame/drivers/powerbal.c
r7882r7883
1919#include "sound/okim6295.h"
2020#include "includes/playmark.h"
2121
22static tilemap_t *bg_tilemap;
23static UINT16 *magicstk_videoram;
24static int magicstk_tilebank;
25
26static int bg_yoffset;
27static int xoffset;
28static int yoffset;
29
3022static const eeprom_interface eeprom_intf =
3123{
3224   6,            /* address bits */
r7882r7883
4436{
4537   if (ACCESSING_BITS_0_7)
4638   {
47      coin_counter_w(device->machine, 0,data & 0x20);
39      coin_counter_w(device->machine, 0, data & 0x20);
4840
4941      eeprom_set_cs_line(device, (data & 8) ? CLEAR_LINE : ASSERT_LINE);
5042      eeprom_write_bit(device, data & 2);
r7882r7883
5446
5547static WRITE16_HANDLER( magicstk_bgvideoram_w )
5648{
57   COMBINE_DATA(&magicstk_videoram[offset]);
58   tilemap_mark_tile_dirty(bg_tilemap,offset);
49   playmark_state *state = (playmark_state *)space->machine->driver_data;
50
51   COMBINE_DATA(&state->videoram1[offset]);
52   tilemap_mark_tile_dirty(state->bg_tilemap, offset);
5953}
6054
6155static WRITE16_HANDLER( tile_banking_w )
6256{
63   if(((data >> 12) & 0x0f) != magicstk_tilebank)
57   playmark_state *state = (playmark_state *)space->machine->driver_data;
58
59   if (((data >> 12) & 0x0f) != state->tilebank)
6460   {
65      magicstk_tilebank = (data >> 12) & 0x0f;
66      tilemap_mark_all_tiles_dirty(bg_tilemap);
61      state->tilebank = (data >> 12) & 0x0f;
62      tilemap_mark_all_tiles_dirty(state->bg_tilemap);
6763   }
6864}
6965
7066static WRITE16_DEVICE_HANDLER( oki_banking )
7167{
72   if(data & 3)
68   if (data & 3)
7369   {
7470      int addr = 0x40000 * ((data & 3) - 1);
7571
76      if(addr < memory_region_length(device->machine, "oki"))
72      if (addr < memory_region_length(device->machine, "oki"))
7773         okim6295_set_bank_base(device, addr);
7874   }
7975}
r7882r7883
8480   AM_RANGE(0x094000, 0x094001) AM_WRITENOP
8581   AM_RANGE(0x094002, 0x094003) AM_WRITENOP
8682   AM_RANGE(0x094004, 0x094005) AM_WRITE(tile_banking_w)
87   AM_RANGE(0x098180, 0x09917f) AM_RAM_WRITE(magicstk_bgvideoram_w) AM_BASE(&magicstk_videoram)
83   AM_RANGE(0x098180, 0x09917f) AM_RAM_WRITE(magicstk_bgvideoram_w) AM_BASE_MEMBER(playmark_state, videoram1)
8884   AM_RANGE(0x0c2010, 0x0c2011) AM_READ_PORT("IN0")
8985   AM_RANGE(0x0c2012, 0x0c2013) AM_READ_PORT("IN1")
9086   AM_RANGE(0x0c2014, 0x0c2015) AM_READ_PORT("IN2") AM_DEVWRITE("eeprom", magicstk_coin_eeprom_w)
r7882r7883
9490   AM_RANGE(0x0c201e, 0x0c201f) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff)
9591   AM_RANGE(0x0c4000, 0x0c4001) AM_WRITENOP
9692   AM_RANGE(0x0e0000, 0x0fffff) AM_RAM
97   AM_RANGE(0x100000, 0x100fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
93   AM_RANGE(0x100000, 0x100fff) AM_RAM AM_BASE_SIZE_MEMBER(playmark_state, spriteram, spriteram_size)
9894ADDRESS_MAP_END
9995
10096static ADDRESS_MAP_START( powerbal_main_map, ADDRESS_SPACE_PROGRAM, 16 )
r7882r7883
10399   AM_RANGE(0x094000, 0x094001) AM_WRITENOP
104100   AM_RANGE(0x094002, 0x094003) AM_WRITENOP
105101   AM_RANGE(0x094004, 0x094005) AM_WRITE(tile_banking_w)
106   AM_RANGE(0x098000, 0x098fff) AM_RAM_WRITE(magicstk_bgvideoram_w) AM_BASE(&magicstk_videoram)
102   AM_RANGE(0x098000, 0x098fff) AM_RAM_WRITE(magicstk_bgvideoram_w) AM_BASE_MEMBER(playmark_state, videoram1)
107103   AM_RANGE(0x099000, 0x09bfff) AM_RAM // not used
108104   AM_RANGE(0x0c2010, 0x0c2011) AM_READ_PORT("IN0")
109105   AM_RANGE(0x0c2012, 0x0c2013) AM_READ_PORT("IN1")
r7882r7883
114110   AM_RANGE(0x0c201e, 0x0c201f) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff)
115111   AM_RANGE(0x0c4000, 0x0c4001) AM_WRITENOP
116112   AM_RANGE(0x0f0000, 0x0fffff) AM_RAM
117   AM_RANGE(0x101000, 0x101fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
113   AM_RANGE(0x101000, 0x101fff) AM_RAM AM_BASE_SIZE_MEMBER(playmark_state, spriteram, spriteram_size)
118114   AM_RANGE(0x102000, 0x10200d) AM_WRITENOP // not used scroll regs?
119115   AM_RANGE(0x103000, 0x103fff) AM_RAM
120116ADDRESS_MAP_END
r7882r7883
381377
382378static TILE_GET_INFO( powerbal_get_bg_tile_info )
383379{
384   int code = (magicstk_videoram[tile_index] & 0x07ff) + magicstk_tilebank * 0x800;
385   int colr = magicstk_videoram[tile_index] & 0xf000;
380   playmark_state *state = (playmark_state *)machine->driver_data;
381   int code = (state->videoram1[tile_index] & 0x07ff) + state->tilebank * 0x800;
382   int colr = state->videoram1[tile_index] & 0xf000;
386383
387   if (magicstk_videoram[tile_index] & 0x800) code |= 0x8000;
384   if (state->videoram1[tile_index] & 0x800)
385      code |= 0x8000;
388386
389   SET_TILE_INFO(1,code,colr >> 12,0);
387   SET_TILE_INFO(1, code, colr >> 12, 0);
390388}
391389
392static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
390static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
393391{
394   UINT16 *spriteram16 = machine->generic.spriteram.u16;
392   playmark_state *state = (playmark_state *)machine->driver_data;
393   UINT16 *spriteram = state->spriteram;
395394   int offs;
396395   int height = machine->gfx[0]->height;
397396
398   for (offs = 4;offs < machine->generic.spriteram_size/2;offs += 4)
397   for (offs = 4; offs < state->spriteram_size / 2; offs += 4)
399398   {
400      int sx,sy,code,color,flipx;
399      int sx, sy, code, color, flipx;
401400
402      sy = spriteram16[offs+3-4];   /* typical Playmark style... */
403      if (sy & 0x8000) return;   /* end of list marker */
401      sy = spriteram[offs + 3 - 4];   /* typical Playmark style... */
402      if (sy & 0x8000)
403         return;   /* end of list marker */
404404
405405      flipx = sy & 0x4000;
406      sx = (spriteram16[offs+1] & 0x01ff) - 16-7;
407      sy = (256-8-height - sy) & 0xff;
408      code = spriteram16[offs+2];
409      color = (spriteram16[offs+1] & 0xf000) >> 12;
406      sx = (spriteram[offs + 1] & 0x01ff) - 16 - 7;
407      sy = (256 - 8 - height - sy) & 0xff;
408      code = spriteram[offs + 2];
409      color = (spriteram[offs + 1] & 0xf000) >> 12;
410410
411411      drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
412412            code,
413413            color,
414414            flipx,0,
415            sx + xoffset,sy + yoffset,0);
415            sx + state->xoffset,sy + state->yoffset,0);
416416   }
417417}
418418
419419static VIDEO_START( powerbal )
420420{
421   bg_tilemap = tilemap_create(machine, powerbal_get_bg_tile_info,tilemap_scan_rows,8, 8,64,32);
421   playmark_state *state = (playmark_state *)machine->driver_data;
422422
423   xoffset = -20;
423   state->bg_tilemap = tilemap_create(machine, powerbal_get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
424424
425   tilemap_set_scrolly(bg_tilemap, 0, bg_yoffset);
425   state->xoffset = -20;
426
427   tilemap_set_scrolly(state->bg_tilemap, 0, state->bg_yoffset);
426428}
427429
428430static VIDEO_UPDATE( powerbal )
429431{
430   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
431   draw_sprites(screen->machine,bitmap,cliprect);
432   playmark_state *state = (playmark_state *)screen->machine->driver_data;
433
434   tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
435   draw_sprites(screen->machine, bitmap, cliprect);
432436   return 0;
433437}
434438
r7882r7883
463467   GFXDECODE_ENTRY( "gfx1", 0, magicstk_charlayout, 0x000, 16 )   /* colors 0x000-0x0ff */
464468GFXDECODE_END
465469
470
471
472static MACHINE_START( powerbal )
473{
474   playmark_state *state = (playmark_state *)machine->driver_data;
475
476   state_save_register_global(machine, state->tilebank);
477}
478
479static MACHINE_RESET( powerbal )
480{
481   playmark_state *state = (playmark_state *)machine->driver_data;
482
483   state->tilebank = 0;
484}
485
466486static MACHINE_DRIVER_START( powerbal )
487
488   /* driver data */
489   MDRV_DRIVER_DATA(playmark_state)
490
467491   /* basic machine hardware */
468492   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
469493   MDRV_CPU_PROGRAM_MAP(powerbal_main_map)
470494   MDRV_CPU_VBLANK_INT("screen", irq2_line_hold)
471495
496   MDRV_MACHINE_START(powerbal)
497   MDRV_MACHINE_RESET(powerbal)
498
472499   /* video hardware */
473500   MDRV_SCREEN_ADD("screen", RASTER)
474501   MDRV_SCREEN_REFRESH_RATE(61)
r7882r7883
492519MACHINE_DRIVER_END
493520
494521static MACHINE_DRIVER_START( magicstk )
522
523   /* driver data */
524   MDRV_DRIVER_DATA(playmark_state)
525
495526   /* basic machine hardware */
496527   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
497528   MDRV_CPU_PROGRAM_MAP(magicstk_main_map)
r7882r7883
500531   MDRV_EEPROM_ADD("eeprom", eeprom_intf)
501532   MDRV_EEPROM_DEFAULT_VALUE(0)
502533
534   MDRV_MACHINE_START(powerbal)
535   MDRV_MACHINE_RESET(powerbal)
536
503537   /* video hardware */
504538   MDRV_SCREEN_ADD("screen", RASTER)
505539   MDRV_SCREEN_REFRESH_RATE(61)
r7882r7883
656690
657691static DRIVER_INIT( powerbal )
658692{
659   bg_yoffset = 16;
660   yoffset = -8;
693   playmark_state *state = (playmark_state *)machine->driver_data;
694
695   state->bg_yoffset = 16;
696   state->yoffset = -8;
661697}
662698
663699static DRIVER_INIT( magicstk )
664700{
665   bg_yoffset = 0;
666   yoffset = -5;
701   playmark_state *state = (playmark_state *)machine->driver_data;
702
703   state->bg_yoffset = 0;
704   state->yoffset = -5;
667705}
668706
669707/*************************
r7882r7883
671709*************************/
672710
673711/*    YEAR  NAME      PARENT   MACHINE   INPUT     INIT      ROT    COMPANY     FULLNAME                      FLAGS */
674GAME( 1994, powerbal, 0,       powerbal, powerbal, powerbal, ROT0, "Playmark", "Power Balls",                 0 )
675GAME( 1995, magicstk, 0,       magicstk, magicstk, magicstk, ROT0, "Playmark", "Magic Sticks",                0 )
676GAME( 1995, hotminda, hotmind, magicstk, hotminda, magicstk, ROT0, "Playmark", "Hot Mind (adjustable prize)", 0 )
712GAME( 1994, powerbal, 0,       powerbal, powerbal, powerbal, ROT0, "Playmark", "Power Balls",                 GAME_SUPPORTS_SAVE )
713GAME( 1995, magicstk, 0,       magicstk, magicstk, magicstk, ROT0, "Playmark", "Magic Sticks",                GAME_SUPPORTS_SAVE )
714GAME( 1995, hotminda, hotmind, magicstk, hotminda, magicstk, ROT0, "Playmark", "Hot Mind (adjustable prize)", GAME_SUPPORTS_SAVE )
src/mame/drivers/lasso.c
r7882r7883
157157   AM_RANGE(0x1805, 0x1805) AM_READ_PORT("1805")
158158   AM_RANGE(0x1806, 0x1806) AM_READ_PORT("1806")
159159   AM_RANGE(0x1807, 0x1807) AM_READ_PORT("1807")
160   AM_RANGE(0x1c00, 0x1c03) AM_WRITEONLY AM_BASE_MEMBER(lasso_state, last_colors)
160   AM_RANGE(0x1c00, 0x1c02) AM_WRITEONLY AM_BASE_MEMBER(lasso_state, last_colors)
161161   AM_RANGE(0x1c04, 0x1c07) AM_WRITEONLY AM_BASE_MEMBER(lasso_state, track_scroll)
162162   AM_RANGE(0x4000, 0xbfff) AM_ROM
163163   AM_RANGE(0xc000, 0xffff) AM_ROM AM_REGION("maincpu", 0x8000)
src/mame/drivers/merit.c
r7882r7883
17091709   ROM_REGION( 0x10000, "maincpu", 0 )
17101710   ROM_LOAD( "phrz.11",      0x00000, 0x8000, CRC(ccd33a0c) SHA1(869b66af4369f3b4bc19336ca2b8104c7f652de7) )
17111711
1712   // probably over-dumped, 1st and 2nd half identical
17131712   ROM_REGION( 0x18000, "gfx1", 0 )
1714   ROM_LOAD( "phrz_u37.u37", 0x00000, 0x8000, CRC(237e221a) SHA1(7aa69375c2b9a9e73e0e4ed207bf595368b2deb2) )
1713   ROM_LOAD( "phrz_u37.u37", 0x00000, 0x8000, CRC(237e221a) SHA1(7aa69375c2b9a9e73e0e4ed207bf595368b2deb2) ) /* 1st & 2nd half identical, but correct and verified */
17151714   ROM_LOAD( "phrz_u38.u38", 0x08000, 0x8000, CRC(bfa78b67) SHA1(1b51c0e00240f798fe717624e706cb15700bc2f9) )
17161715   ROM_LOAD( "phrz_u39.u39", 0x10000, 0x8000, CRC(9ce22cb3) SHA1(b653afb8f13decd993e434aaad69a6e09ab65f83) )
17171716
1718   // probably over-dumped
17191717   ROM_REGION( 0x08000, "gfx2", 0 )
1720   ROM_LOAD( "phrz_u40.u40",0x00000, 0x8000, CRC(17dcddd4) SHA1(51682bdbfb67cd0ccf20b97e8fa12d72f0fe82ed) )
1718   ROM_LOAD( "phrz_u40.u40", 0x00000, 0x8000, CRC(17dcddd4) SHA1(51682bdbfb67cd0ccf20b97e8fa12d72f0fe82ed) ) /* 1st & 2nd half identical, but correct and verified */
17211719
17221720   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) // questions
17231721   ROM_LOAD( "phrz1-07_std-1", 0x00000, 0x8000, CRC(0a016c5e) SHA1(1a24ecd7fe59b08c75a1b4575c7fe467cc7f0cf8) )
r7882r7883
17301728
17311729ROM_START( phrcrazea )
17321730   ROM_REGION( 0x10000, "maincpu", 0 )
1731   ROM_LOAD( "pc_u5.bin", 0x00000, 0x8000, CRC(f9642d0a) SHA1(6e9b9929bc28f6c26c70a8b762a2755dc097dbc4) ) /* Horizontal version */
1732
1733   ROM_REGION( 0x18000, "gfx1", 0 )
1734   ROM_LOAD( "phrz_u37.u37", 0x00000, 0x8000, CRC(237e221a) SHA1(7aa69375c2b9a9e73e0e4ed207bf595368b2deb2) ) /* 1st & 2nd half identical, but correct and verified */
1735   ROM_LOAD( "phrz_u38.u38", 0x08000, 0x8000, CRC(bfa78b67) SHA1(1b51c0e00240f798fe717624e706cb15700bc2f9) )
1736   ROM_LOAD( "phrz_u39.u39", 0x10000, 0x8000, CRC(9ce22cb3) SHA1(b653afb8f13decd993e434aaad69a6e09ab65f83) )
1737
1738   ROM_REGION( 0x08000, "gfx2", 0 )
1739   ROM_LOAD( "phrz_u40.u40", 0x00000, 0x8000, CRC(17dcddd4) SHA1(51682bdbfb67cd0ccf20b97e8fa12d72f0fe82ed) ) /* 1st & 2nd half identical, but correct and verified */
1740
1741   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
1742   ROM_LOAD( "phrz1-07_std-1", 0x00000, 0x8000, CRC(0a016c5e) SHA1(1a24ecd7fe59b08c75a1b4575c7fe467cc7f0cf8) )
1743   ROM_LOAD( "phrz1-07_std-2", 0x10000, 0x8000, CRC(e67dc49e) SHA1(5265af228531dc16db7f7ee78da6e51ef9a1d772) )
1744   ROM_LOAD( "phrz1-07_std-3", 0x20000, 0x8000, CRC(5c79a653) SHA1(85a904465b347564e937074e2b18159604c83e51) )
1745   ROM_LOAD( "phrz1-07_std-4", 0x30000, 0x8000, CRC(9837f757) SHA1(01106114b6997fe6432e519101f95c83a1f7cc1e) )
1746   ROM_LOAD( "phrz1-07_std-5", 0x40000, 0x8000, CRC(dc9d8682) SHA1(46973da4298d0ed149c651498527c91b8ba57e0a) )
1747   ROM_LOAD( "phrz1-07_std-6", 0x50000, 0x8000, CRC(48e24f17) SHA1(f50c85505f6ab2360f0885494001f174224f8575) )
1748ROM_END
1749
1750ROM_START( phrcrazeb )
1751   ROM_REGION( 0x10000, "maincpu", 0 )
17331752   ROM_LOAD( "5281-40_u5-3a.u5",0x00000, 0x8000, CRC(d04c7657) SHA1(0b59fbf553eb5b68544ee2f94cf8106ab30ff1ed) )
17341753
17351754   ROM_REGION( 0x18000, "gfx1", 0 )
1736   ROM_LOAD( "phrz_u27.u37", 0x00000, 0x8000, CRC(237e221a) SHA1(7aa69375c2b9a9e73e0e4ed207bf595368b2deb2) )
1755   ROM_LOAD( "phrz_u37.u37", 0x00000, 0x8000, CRC(237e221a) SHA1(7aa69375c2b9a9e73e0e4ed207bf595368b2deb2) ) /* 1st & 2nd half identical, but correct and verified */
17371756   ROM_LOAD( "phrz_u38.u38", 0x08000, 0x8000, CRC(bfa78b67) SHA1(1b51c0e00240f798fe717624e706cb15700bc2f9) )
17381757   ROM_LOAD( "phrz_u39.u39", 0x10000, 0x8000, CRC(9ce22cb3) SHA1(b653afb8f13decd993e434aaad69a6e09ab65f83) )
17391758
17401759   ROM_REGION( 0x08000, "gfx2", 0 )
1741   ROM_LOAD( "phrz_u40.u40",0x00000, 0x8000, CRC(17dcddd4) SHA1(51682bdbfb67cd0ccf20b97e8fa12d72f0fe82ed) )
1760   ROM_LOAD( "phrz_u40.u40", 0x00000, 0x8000, CRC(17dcddd4) SHA1(51682bdbfb67cd0ccf20b97e8fa12d72f0fe82ed) ) /* 1st & 2nd half identical, but correct and verified */
17421761
17431762   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
17441763   ROM_LOAD( "phrz1-07_sex-2a", 0x00000, 0x8000, CRC(7ef3bca7) SHA1(f25cd01f996882a500e1a800d924759cd1de255d) )
r7882r7883
17531772   ROM_LOAD( "phrz1-07_std-1a", 0x90000, 0x8000, CRC(367f1dfa) SHA1(01d69004c365acefb0e52ac12593a3874c16ab9d) )
17541773ROM_END
17551774
1756ROM_START( phrcrazes )
1775ROM_START( phrcrazec )
17571776   ROM_REGION( 0x10000, "maincpu", 0 )
1758   ROM_LOAD( "u5.bin",       0x00000, 0x8000, CRC(6122b5bb) SHA1(9952b14334287a992eefefbdc887b9a9215304ef) )
1777   ROM_LOAD( "6221-40_u5-1a.u5",0x00000, 0x8000, CRC(bd8b5612) SHA1(614436da4ed45e0d974b565c5c765bcc1b9d94b5) )
17591778
1779   ROM_REGION( 0x18000, "gfx1", 0 )
1780   ROM_LOAD( "phrz_u37.u37", 0x00000, 0x8000, CRC(237e221a) SHA1(7aa69375c2b9a9e73e0e4ed207bf595368b2deb2) ) /* 1st & 2nd half identical, but correct and verified */
1781   ROM_LOAD( "phrz_u38.u38", 0x08000, 0x8000, CRC(bfa78b67) SHA1(1b51c0e00240f798fe717624e706cb15700bc2f9) )
1782   ROM_LOAD( "phrz_u39.u39", 0x10000, 0x8000, CRC(9ce22cb3) SHA1(b653afb8f13decd993e434aaad69a6e09ab65f83) )
1783
1784   ROM_REGION( 0x08000, "gfx2", 0 )
1785   ROM_LOAD( "phrz_u40.u40", 0x00000, 0x8000, CRC(17dcddd4) SHA1(51682bdbfb67cd0ccf20b97e8fa12d72f0fe82ed) ) /* 1st & 2nd half identical, but correct and verified */
1786
1787   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
1788   ROM_LOAD( "phrz1-07_sex-2a", 0x00000, 0x8000, CRC(7ef3bca7) SHA1(f25cd01f996882a500e1a800d924759cd1de255d) )
1789   ROM_LOAD( "phrz1-07_sex-1a", 0x10000, 0x8000, CRC(ed7604b8) SHA1(b1e841b50b8ef6ae95fafac1c34b6d0337a05d18) )
1790   ROM_LOAD( "phrz1-07_std-8a", 0x20000, 0x8000, CRC(423eecd6) SHA1(ca8d181ccba05acba8ebc57f20e0542eda00c917) )
1791   ROM_LOAD( "phrz1-07_std-7a", 0x30000, 0x8000, CRC(05dd3900) SHA1(bb13a3c5f84771c450fa88560cc74c5a1be1b876) )
1792   ROM_LOAD( "phrz1-07_std-6a", 0x40000, 0x8000, CRC(c5980f24) SHA1(a3b665c74aaa704ffa382f95adac70c7c46fb446) )
1793   ROM_LOAD( "phrz1-07_std-5a", 0x50000, 0x8000, CRC(7cb395a9) SHA1(48b3ac524e6ae23f885b9b767e77930a89a81f5f) )
1794   ROM_LOAD( "phrz1-07_std-4a", 0x60000, 0x8000, CRC(effc811b) SHA1(2479539965ed541be417bbe48a5e66a58a6294aa) )
1795   ROM_LOAD( "phrz1-07_std-3a", 0x70000, 0x8000, CRC(c4c7dcee) SHA1(81d879df3da0fbe1cf2247d92b3853104a99689d) )
1796   ROM_LOAD( "phrz1-07_std-2a", 0x80000, 0x8000, CRC(527b3025) SHA1(36dc129d2276909643e90ae3810c8341076fd88c) )
1797   ROM_LOAD( "phrz1-07_std-1a", 0x90000, 0x8000, CRC(367f1dfa) SHA1(01d69004c365acefb0e52ac12593a3874c16ab9d) )
1798ROM_END
1799
1800ROM_START( phrcrazev )
1801   ROM_REGION( 0x10000, "maincpu", 0 )
1802   ROM_LOAD( "u5.bin",       0x00000, 0x8000, CRC(6122b5bb) SHA1(9952b14334287a992eefefbdc887b9a9215304ef) ) /* Vertical version */
1803
17601804   ROM_REGION( 0xc000, "gfx1", 0 )
17611805   ROM_LOAD( "u39.bin",      0x00000, 0x4000, BAD_DUMP CRC(adbd2cdc) SHA1(a1e9481bd6ee0f8915cea43eaad3ebdd54438eed) )
17621806   ROM_LOAD( "u38.bin",      0x04000, 0x4000, BAD_DUMP CRC(3578f00d) SHA1(c6780a6ee1b5eb00258a89bceabbbe380d79d299) )
r7882r7883
17661810   ROM_LOAD( "u40.bin",      0x00000, 0x4000, BAD_DUMP CRC(493172c8) SHA1(a76ff5d0d3dd56b0ee4352f03c9ce92f107d34ec) )
17671811
17681812   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
1769   ROM_LOAD( "std1.bin",     0x00000, 0x8000, CRC(0a016c5e) SHA1(1a24ecd7fe59b08c75a1b4575c7fe467cc7f0cf8) )
1770   ROM_LOAD( "std2.bin",     0x10000, 0x8000, CRC(e67dc49e) SHA1(5265af228531dc16db7f7ee78da6e51ef9a1d772) )
1771   ROM_LOAD( "std3.bin",     0x20000, 0x8000, CRC(5c79a653) SHA1(85a904465b347564e937074e2b18159604c83e51) )
1772   ROM_LOAD( "std4.bin",     0x30000, 0x8000, CRC(9837f757) SHA1(01106114b6997fe6432e519101f95c83a1f7cc1e) )
1773   ROM_LOAD( "std5.bin",     0x40000, 0x8000, CRC(dc9d8682) SHA1(46973da4298d0ed149c651498527c91b8ba57e0a) )
1774   ROM_LOAD( "std6.bin",     0x50000, 0x8000, CRC(48e24f17) SHA1(f50c85505f6ab2360f0885494001f174224f8575) )
1813   ROM_LOAD( "phrz1-07_std-1", 0x00000, 0x8000, CRC(0a016c5e) SHA1(1a24ecd7fe59b08c75a1b4575c7fe467cc7f0cf8) )
1814   ROM_LOAD( "phrz1-07_std-2", 0x10000, 0x8000, CRC(e67dc49e) SHA1(5265af228531dc16db7f7ee78da6e51ef9a1d772) )
1815   ROM_LOAD( "phrz1-07_std-3", 0x20000, 0x8000, CRC(5c79a653) SHA1(85a904465b347564e937074e2b18159604c83e51) )
1816   ROM_LOAD( "phrz1-07_std-4", 0x30000, 0x8000, CRC(9837f757) SHA1(01106114b6997fe6432e519101f95c83a1f7cc1e) )
1817   ROM_LOAD( "phrz1-07_std-5", 0x40000, 0x8000, CRC(dc9d8682) SHA1(46973da4298d0ed149c651498527c91b8ba57e0a) )
1818   ROM_LOAD( "phrz1-07_std-6", 0x50000, 0x8000, CRC(48e24f17) SHA1(f50c85505f6ab2360f0885494001f174224f8575) )
17751819   /* empty space as per instructions for other "sex" category roms */
17761820   /* "Sex" questions revision A */
17771821   ROM_LOAD( "phrz1-07_sex-2a", 0x80000, 0x8000, CRC(7ef3bca7) SHA1(f25cd01f996882a500e1a800d924759cd1de255d) )
r7882r7883
19301974
19311975GAME( 1986, phrcraze, 0,       phrcraze, phrcraze, key_7,  ROT0,  "Merit", "Phraze Craze (set 1)",                        GAME_SUPPORTS_SAVE )
19321976GAME( 1986, phrcrazea,phrcraze,phrcraze, phrcraze, key_7,  ROT0,  "Merit", "Phraze Craze (set 2)",                        GAME_SUPPORTS_SAVE )
1933GAME( 1986, phrcrazes,phrcraze,phrcraze, phrcrazs, key_7,  ROT90, "Merit", "Phraze Craze (Sex Kit)",                      GAME_SUPPORTS_SAVE )
1977GAME( 1986, phrcrazeb,phrcraze,phrcraze, phrcrazs, key_7,  ROT0,  "Merit", "Phraze Craze (Expanded Questions, set 1)",    GAME_SUPPORTS_SAVE )
1978GAME( 1986, phrcrazec,phrcraze,phrcraze, phrcrazs, key_7,  ROT0,  "Merit", "Phraze Craze (Expanded Questions, set 2)",    GAME_SUPPORTS_SAVE )
1979GAME( 1986, phrcrazev,phrcraze,phrcraze, phrcrazs, key_7,  ROT90, "Merit", "Phraze Craze (Sex Kit, Vertical)",            GAME_SUPPORTS_SAVE )
19341980
19351981GAME( 1986, bigappg,  0,       bigappg,  bigappg,  0,      ROT0,  "Merit", "Big Apple Games",                             GAME_SUPPORTS_SAVE )
19361982
src/mame/drivers/funworld.c
r7882r7883
3636  * Bottle 10 (italian, set 2),                       C.M.C.,             1996.
3737  * Royal Card (austrian, set 1),                     TAB-Austria,        1991.
3838  * Royal Card (austrian, set 2),                     TAB-Austria,        1991.
39  * Royal Card (austrian/polish, set 3),              TAB-Austria,        1991.
40  * Royal Card (austrian, set 4),                     TAB-Austria,        1991.
41  * Royal Card (austrian, set 5),                     TAB-Austria,        1991.
42  * Royal Card (austrian, set 6),                     TAB-Austria,        1991.
3943  * Royal Card (slovak, encrypted),                   Evona Electronic,   1991.
4044  * Royal Card Professional 2.0,                      Digital Dreams,     1993.
4145  * Lucky Lady (3x3 deal),                            TAB-Austria,        1991.
r7882r7883
701705  - Replaced the jolyc980 default NVRAM with one totally clean.
702706     Temporal and total meters are cleared to zero.
703707
708  [2010/04/18]
709  - Replaced the Fun World Quiz bad ROMs with good ones.
710  - Fixed the Fun World Quiz graphics and colors.
711  - Cleaned-up the flags for non working games.
712  - Modified the default lamps layout to include the bet lamp.
713  - Cleaned-up the Fun World Quiz inputs.
714  - Added 4 new Royal Card sets. Reworked parent/clone relationship.
715     (delete the old .cfg and .nv files to have them working properly).
716  - Splitted the Royal Card machine driver. This is needed to access
717     different halves of the bipolar PROM.
718  - Now principal Royal Card sets have a working bet button.
719  - Added default NVRAM to the new sets.
704720
705721
722
706723  *** TO DO ***
707724
708725  - Figure out the royalcdc, jokercrd and multiwin encryption.
r7882r7883
13581375   PORT_DIPNAME( 0x01, 0x01, "State" )            PORT_DIPLOCATION("SW1:8")
13591376   PORT_DIPSETTING(    0x00, "Keyboard Test" )
13601377   PORT_DIPSETTING(    0x01, "Play" )
1361   PORT_DIPNAME( 0x02, 0x00, "Remote" )         PORT_DIPLOCATION("SW1:7")   /* listed as 'Coin-C' in some sources */
1378   PORT_DIPNAME( 0x02, 0x02, "Remote" )         PORT_DIPLOCATION("SW1:7")   /* listed as 'Coin-C' in some sources */
13621379   PORT_DIPSETTING(    0x00, "10 Points/Pulse" )
1363   PORT_DIPSETTING(    0x02, "50 Points/Pulse" )
1364   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:6")
1380   PORT_DIPSETTING(    0x02, "100 Points/Pulse" )
1381   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:6")
13651382   PORT_DIPSETTING(    0x00, "5 Points/Coin" )
13661383   PORT_DIPSETTING(    0x04, "10 Points/Coin" )
1367   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:5")
1384   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:5")
13681385   PORT_DIPSETTING(    0x00, "5 Points/Coin" )
13691386   PORT_DIPSETTING(    0x08, "10 Points/Coin" )
1370   PORT_DIPNAME( 0x10, 0x00, "Insert" )         PORT_DIPLOCATION("SW1:4")
1387   PORT_DIPNAME( 0x10, 0x10, "Insert" )         PORT_DIPLOCATION("SW1:4")
13711388   PORT_DIPSETTING(    0x00, "Dattl Insert" )
13721389   PORT_DIPSETTING(    0x10, "TAB Insert" )
13731390   PORT_DIPNAME( 0x20, 0x00, "Joker" )            PORT_DIPLOCATION("SW1:3")
r7882r7883
13791396
13801397   /* after nvram init, set the following one to 'manual'
13811398    to allow the remote credits mode to work */
1382   PORT_DIPNAME( 0x80, 0x00, "Payout" )         PORT_DIPLOCATION("SW1:1")
1399   PORT_DIPNAME( 0x80, 0x80, "Payout" )         PORT_DIPLOCATION("SW1:1")
13831400   PORT_DIPSETTING(    0x00, "Hopper" )
13841401   PORT_DIPSETTING(    0x80, "Manual Payout SW" )
13851402INPUT_PORTS_END
r7882r7883
18801897
18811898static INPUT_PORTS_START( funquiz )
18821899   PORT_START("IN0")
1883   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-1") PORT_CODE(KEYCODE_Q)
1900   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
18841901   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )   // start?
18851902   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )   // start?
18861903   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START3 )   // start?
18871904   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START4 )   // start or clear?
1888   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-6") PORT_CODE(KEYCODE_W)
1889   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-7") PORT_CODE(KEYCODE_E)
1890   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY   // joystick right, enter & exit bookkeeping???
1905   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1906   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1907   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY   // joystick right
18911908
18921909   PORT_START("IN1")
18931910   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY   // joystick left
18941911   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY      // joystick up
18951912   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY   // joystick down
1896   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-4") PORT_CODE(KEYCODE_R)
1897   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-5") PORT_CODE(KEYCODE_T)
1898   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )                                 // coin 2
1899   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-7") PORT_CODE(KEYCODE_Y)
1900   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-8") PORT_CODE(KEYCODE_U)
1913   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1914   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1915   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )      // coin 2
1916   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1917   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
19011918
19021919   PORT_START("IN2")
1903   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )                                 // coin 1
1904   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-2") PORT_CODE(KEYCODE_A)
1905   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-3") PORT_CODE(KEYCODE_S)
1906   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-4") PORT_CODE(KEYCODE_D)
1907   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-5") PORT_CODE(KEYCODE_F)
1908   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-6") PORT_CODE(KEYCODE_G)
1909   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-7") PORT_CODE(KEYCODE_H)
1910   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-8") PORT_CODE(KEYCODE_J)
1920   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )      // coin 1
1921   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1922   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1923   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1924   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1925   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1926   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1927   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
19111928
19121929   PORT_START("DSW")
19131930/*
r7882r7883
21482165
21492166static MACHINE_DRIVER_START( funquiz )
21502167   MDRV_IMPORT_FROM(fw1stpal)
2168//  MDRV_IMPORT_FROM(fw2ndpal)
21512169
21522170   MDRV_CPU_REPLACE("maincpu", M65C02, MASTER_CLOCK/8)   /* 2MHz */
21532171   MDRV_CPU_PROGRAM_MAP(funquiz_map)
r7882r7883
21712189   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.5)   /* analyzed to avoid clips */
21722190MACHINE_DRIVER_END
21732191
2174static MACHINE_DRIVER_START( royalcrd )
2192static MACHINE_DRIVER_START( royalcd1 )
21752193   MDRV_IMPORT_FROM(fw1stpal)
21762194
21772195   MDRV_CPU_REPLACE("maincpu", M65C02, MASTER_CLOCK/8)   /* (G65SC02P in pro version) 2MHz */
21782196   MDRV_CPU_PROGRAM_MAP(magicrd2_map)
21792197MACHINE_DRIVER_END
21802198
2199static MACHINE_DRIVER_START( royalcd2 )
2200   MDRV_IMPORT_FROM(fw2ndpal)
2201
2202   MDRV_CPU_REPLACE("maincpu", M65C02, MASTER_CLOCK/8)   /* 2MHz */
2203   MDRV_CPU_PROGRAM_MAP(magicrd2_map)
2204MACHINE_DRIVER_END
2205
21812206static MACHINE_DRIVER_START( cuoreuno )
21822207   MDRV_IMPORT_FROM(fw1stpal)
21832208
r7882r7883
21982223*        Rom Load        *
21992224*************************/
22002225
2226/******************************** Jolly Card sets ************************************/
2227
22012228/*
22022229    Jolly Card, TAB Austria
22032230    -----------------------
r7882r7883
25842611ROM_END
25852612
25862613
2614/******************************** Big Deal sets ************************************/
2615
25872616/*
25882617    Big Deal (hungarian)
25892618    ------------------
r7882r7883
26512680ROM_END
26522681
26532682
2683/******************************** C.M.C. sets ************************************/
2684
26542685/*
26552686    Cuore Uno (italian)
26562687    -----------------------------------
r7882r7883
30653096ROM_END
30663097
30673098
3099/******************************** Royal Card sets ************************************/
3100
30683101/*
3069    Royal Card (set 1)
3102    1.bin   NO MATCH
3103    2.bin   = 1.bin              royalcrdd   Royal Card (austrian, set 5)
3104            = u4_nmc27c256.bin   royalcrdp   Royal Card v2.0 Professional
3105    3.bin   NO MATCH
3106
3107  This one works properly. Also Bet with Hold 5.
3108
3109*/
3110
3111ROM_START( royalcrd )
3112   ROM_REGION( 0x10000, "maincpu", 0 )
3113   ROM_LOAD( "1.bin", 0x8000, 0x8000, CRC(7f920318) SHA1(acbfed8d0a0984fd0c572a4de42d8dc08fb99a82) )
3114
3115   ROM_REGION( 0x10000, "gfx1", 0 )
3116   ROM_LOAD( "3.bin", 0x0000, 0x8000, CRC(c46d804f) SHA1(b089821c7dae6714b49401d787f8bed859815763) )
3117   ROM_LOAD( "2.bin", 0x8000, 0x8000, CRC(41f7a0b3) SHA1(9aff2b8832d2a4f868daa9849a0bfe5e44f88fc0) )
3118
3119   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
3120   ROM_LOAD( "royalcrd_nvram.bin", 0x0000, 0x0800, CRC(1c775f61) SHA1(c810421eaa31a72e3f2fe9a1d82858e7cc2f6b93) )
3121
3122   ROM_REGION( 0x0200, "proms", 0 )
3123   ROM_LOAD( "prom2.bin",    0x0000, 0x0200, CRC(7e5839e6) SHA1(5e8401d2b236f73cc017a73a369b3b3b821a1deb) )
3124ROM_END
3125
3126/*
3127    r.1   NO MATCH
3128    r.2   = 1a.bin   royalcrde   Royal Card (austrian, set 6)
3129    r.3   = 2a.bin   royalcrde   Royal Card (austrian, set 6)
3130
3131    All ROMs are double sized, with identical halves.
3132    The set is working properly, with Bet (Hold 5) and normal payout. No Remote.
3133*/
3134ROM_START( royalcrda )
3135   ROM_REGION( 0x10000, "maincpu", 0 )
3136   ROM_LOAD( "r.1", 0x0000, 0x10000, CRC(761021ec) SHA1(3a00a1d2f74dbb06a0ab6605c32bef8013c93874) )
3137
3138   ROM_REGION( 0x10000, "gfx1", 0 )
3139   ROM_LOAD( "r.3", 0x0000, 0x8000, CRC(3af71cf8) SHA1(3a0ce0d0abebf386573c5936545dada1d3558e55) )
3140   ROM_IGNORE(              0x8000)
3141   ROM_LOAD( "r.2", 0x8000, 0x8000, CRC(8a66f22c) SHA1(67d6e8f8f5a0fd979dc498ba2cc67cf707ccdf95) )
3142   ROM_IGNORE(              0x8000)
3143
3144   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
3145   ROM_LOAD( "royalcrda_nvram.bin", 0x0000, 0x0800, CRC(c42dbad4) SHA1(b38552192e3f5f6bc2a4b92bddd2f95ac17ecc8c) )
3146
3147   ROM_REGION( 0x0200, "proms", 0 )
3148   ROM_LOAD( "prom3_r.bin",    0x0000, 0x0200, CRC(7e5839e6) SHA1(5e8401d2b236f73cc017a73a369b3b3b821a1deb) )
3149ROM_END
3150
3151/*
3152    rc_1_pl.bin   NO MATCH
3153    rc_2_pl.bin   = 1.bin              royalcrdd   Royal Card (austrian, set 5)
3154                  = u4_nmc27c256.bin   royalcrdp   Royal Card v2.0 Professional
3155    rc_3_pl.bin   = 2.bin              royalcrdd   Royal Card (austrian, set 5)
3156
3157    Working properly, with Bet (Hold 5) and Hold 2 shown a credit screen that allow payout or clear.
3158*/
3159ROM_START( royalcrdb )
3160   ROM_REGION( 0x10000, "maincpu", 0 )
3161   ROM_LOAD( "rc_1_pl.bin", 0x8000, 0x8000, CRC(7a0ad63c) SHA1(7a1f6e0fd6e31f6950eeffc6a9ef073e909d85f9) )
3162
3163   ROM_REGION( 0x10000, "gfx1", 0 )
3164   ROM_LOAD( "rc_3_pl.bin", 0x0000, 0x8000, CRC(85e77661) SHA1(7d7a765c1bfcfeb9eb91d2519b22d734f20eab24) )
3165   ROM_LOAD( "rc_2_pl.bin", 0x8000, 0x8000, CRC(41f7a0b3) SHA1(9aff2b8832d2a4f868daa9849a0bfe5e44f88fc0) )
3166
3167   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
3168   ROM_LOAD( "royalcrdb_nvram.bin", 0x0000, 0x0800, CRC(19bb3dea) SHA1(0965fbcec48ded99c5f6793efffb1d9329cc00eb) )
3169
3170   ROM_REGION( 0x0200, "proms", 0 )
3171   ROM_LOAD( "prom_epoxy.bin",    0x0000, 0x0200, CRC(b1e15441) SHA1(eb9318dd08e12281bef27a75bfdf54ec5d97fad6) )
3172ROM_END
3173
3174/*
3175    roj.ic12   NO MATCH
3176    roj.ic25   NO MATCH
3177    roj.ic26   NO MATCH
3178*/
3179ROM_START( royalcrdc )
3180   ROM_REGION( 0x10000, "maincpu", 0 )
3181   ROM_LOAD( "roj.ic12", 0x8000, 0x8000, CRC(16923d58) SHA1(e865b91246ae5a21bdc9787e6e6e22be5182cabb) )
3182
3183   ROM_REGION( 0x20000, "gfx1", 0 )
3184   ROM_LOAD( "roj.ic26", 0x0000, 0x10000, CRC(3883cdcb) SHA1(b71a786822fe8fcb2c6fcdc463facb2738ec8c01) )
3185//  ROM_IGNORE(                   0x8000)
3186   ROM_LOAD( "roj.ic25", 0x8000, 0x10000, CRC(c5b787e8) SHA1(be88aa901c1f96d171af45c3602e0ce72b8fff34) )
3187//  ROM_IGNORE(                   0x8000)
3188
3189   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
3190   ROM_LOAD( "royalcrdc_nvram.bin", 0x0000, 0x0800, CRC(eacb0c7b) SHA1(513816623aa3843dd5d0416fc012060c7a9f6c71) )
3191
3192   ROM_REGION( 0x0200, "proms", 0 )
3193   ROM_LOAD( "prom1.bin",    0x0000, 0x0200, CRC(8f6a33b1) SHA1(3a2f97563b7f094ef8b13a4e47a18e4a1fcf51c3) )
3194ROM_END
3195
3196/*
3197    Royal Card (set 5)
30703198    ------------------
30713199
30723200    - 1x HM6264LP
r7882r7883
30903218    - 1x trimmer (volume)
30913219*/
30923220
3093ROM_START( royalcrd )
3221ROM_START( royalcrdd )
30943222   ROM_REGION( 0x10000, "maincpu", 0 )
30953223   ROM_LOAD( "r2.bin", 0x8000, 0x8000, CRC(25dfe0dc) SHA1(1a857a910d0c34b6b5bfc2b6ea2e08ed8ed0cae0) )
30963224
r7882r7883
30993227   ROM_LOAD( "1.bin", 0x8000, 0x8000, CRC(41f7a0b3) SHA1(9aff2b8832d2a4f868daa9849a0bfe5e44f88fc0) )
31003228
31013229   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
3102   ROM_LOAD( "royalcrd_nvram.bin", 0x0000, 0x0800, CRC(335bfa5a) SHA1(7e9cbb502f450c515ea03ffcf4b7fbae60af4e73) )
3230   ROM_LOAD( "royalcrdd_nvram.bin", 0x0000, 0x0800, CRC(335bfa5a) SHA1(7e9cbb502f450c515ea03ffcf4b7fbae60af4e73) )
31033231
31043232   ROM_REGION( 0x0200, "proms", 0 )
31053233   ROM_LOAD( "n82s147.bin", 0x0000, 0x0200, CRC(8bc86f48) SHA1(4c677ab9314a1f571e35104b22659e6811aeb194) )
r7882r7883
31123240
31133241
31143242/*
3115    Royal Card (set 2)
3243    Royal Card (set 6)
31163244    ------------------
31173245
31183246    - CPU 1x R65C02P2 (main)
r7882r7883
31303258    - 1x trimmer (volume)
31313259*/
31323260
3133ROM_START( royalcdb ) /* both halves have different programs. we're using the 2nd one */
3261ROM_START( royalcrde ) /* both halves have different programs. we're using the 2nd one */
31343262   ROM_REGION( 0x10000, "maincpu", 0 )   /* 1st half prg is testing RAM in offset $8600-$BF00...?? */
31353263   ROM_LOAD( "rc.bin", 0x0000, 0x10000, CRC(8a9a6dd6) SHA1(04c3f9f17d5404ac1414c51ef8f930df54530e72) )
31363264
r7882r7883
31413269   ROM_IGNORE(                 0x8000 )   /* Identical halves. Discarding 2nd half */
31423270
31433271   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
3144   ROM_LOAD( "royalcdb_nvram.bin", 0x0000, 0x0800, CRC(3b03440f) SHA1(49e51b8c9e1404d39c479a2d0619aab43f1a6529) )
3272   ROM_LOAD( "royalcrde_nvram.bin", 0x0000, 0x0800, CRC(3b03440f) SHA1(49e51b8c9e1404d39c479a2d0619aab43f1a6529) )
31453273
31463274   ROM_REGION( 0x0200, "proms", 0 )
31473275   ROM_LOAD( "n82s147.bin", 0x0000, 0x0200, CRC(8bc86f48) SHA1(4c677ab9314a1f571e35104b22659e6811aeb194) )
r7882r7883
31523280
31533281
31543282/*
3155    Royal Card (set 3, encrypted)
3283    Royal Card (set 7, encrypted)
31563284    -----------------------------
31573285
31583286    - Custom/encrypted CPU (epoxy block labelled "EVONA EX9511" -> www.evona.sk )
r7882r7883
31743302    - 2x 27256 - gfx - "2.bin", "3.bin"
31753303*/
31763304
3177ROM_START( royalcdc )   /* encrypted program rom */
3305ROM_START( royalcrdf )   /* encrypted program rom */
31783306   ROM_REGION( 0x10000*2, "maincpu", 0 ) // *2 for decrypted opcodes (see init)
31793307   ROM_LOAD( "rc_1.bin", 0x8000, 0x8000, CRC(8cdcc978) SHA1(489b58760a7c8646399c8cdfb86ec4341823e7dd) )
31803308
r7882r7883
31923320ROM_END
31933321
31943322
3195ROM_START( royalcdp )
3323ROM_START( royalcrdp )
31963324   ROM_REGION( 0x10000, "maincpu", 0 )
31973325   ROM_LOAD( "u16_m27c256b.bin", 0x8000, 0x8000, CRC(162996ff) SHA1(122c13ee9842e692d31490f216eb972df2321b7f) )
31983326
r7882r7883
32083336ROM_END
32093337
32103338
3339/******************************** Lucky Lady sets ************************************/
3340
32113341ROM_START( lluck3x3 )
32123342   ROM_REGION( 0x10000, "maincpu", 0 )
32133343   ROM_LOAD( "l3x3.bin", 0x8000, 0x8000, CRC(dbdb07ff) SHA1(6be43aa0b2c10d83373f20f477606cb031bc6dd9) )
r7882r7883
32403370ROM_END
32413371
32423372
3373/******************************** Magic Card II sets ************************************/
3374
32433375/*
32443376    Magic Card II (bulgarian)
32453377    ---------------------------------
r7882r7883
33163448ROM_END
33173449
33183450
3451/******************************** Royal Vegas Joker Card sets ************************************/
3452
33193453ROM_START( vegasslw )
33203454   ROM_REGION( 0x10000, "maincpu", 0 )
33213455   ROM_LOAD( "vslow.bin", 0x8000, 0x8000, CRC(9cb7861a) SHA1(f934eacd5b3573a6bbeaa827f521b4a498e5bcdf) )
r7882r7883
33793513   ROM_LOAD( "jokercrd_prom.bin", 0x0000, 0x0200, CRC(e59fc06e) SHA1(88a3bb89f020fe2b20f768ca010a082e0b974831) )
33803514ROM_END
33813515
3516
3517/******************************** Jolly Joker sets ************************************/
3518
33823519/*
33833520
33843521  Impera - Jolly Joker
r7882r7883
35293666ROM_END
35303667
35313668
3669/******************************** Other sets ************************************/
3670
35323671/*
35333672    Title:    MULTI WIN
35343673    Company:  FUN WORLD
r7882r7883
38243963   ROM_REGION( 0x10000, "maincpu", 0 )
38253964   ROM_LOAD( "kqu_6.bin", 0xc000, 0x4000, CRC(50f0e586) SHA1(85ce5b95283113e2ac94fd882c57ce1b26135ed0) )
38263965
3966
38273967   ROM_REGION( 0x10000, "gfx1", 0 )
3828   ROM_FILL(                0x0000, 0x4000, 0xff)
3829   ROM_LOAD( "q_3.bin",     0x4000, 0x4000, CRC(0dafa07a) SHA1(5d6fa842c617f92fad14a597396249d5a4d28c9a) )
3830   ROM_FILL(                0x8000, 0x4000, 0xff)
3831//  ROM_LOAD( "q_2_nec.bin", 0xc000, 0x4000, BAD_DUMP CRC(8e3bfcc7) SHA1(81b35e786fab088a439a4423becf08a78a0b2df0) )
3968   ROM_FILL(              0x0000, 0x4000, 0xff)
3969   ROM_LOAD( "q_3.bin",   0x4000, 0x4000, CRC(0dafa07a) SHA1(5d6fa842c617f92fad14a597396249d5a4d28c9a) )
3970   ROM_FILL(              0x8000, 0x4000, 0xff)
3971   ROM_LOAD( "q_2.bin",   0xc000, 0x4000, CRC(ce07c6e1) SHA1(6b77a9198e29c195d983b856e8826e8174945321) )
38323972
3833   ROM_REGION( 0x10000, "badgfx", 0 ) /* just a temporal container */
3834   ROM_LOAD( "q_2_nec.bin", 0xc000, 0x4000, BAD_DUMP CRC(8e3bfcc7) SHA1(81b35e786fab088a439a4423becf08a78a0b2df0) )
38353973
38363974   /* One unpopulated questions socket... Maybe sport_1 is missing */
38373975   ROM_REGION( 0x100000, "questions", ROMREGION_ERASEFF )
r7882r7883
38613999   ROM_LOAD( "pop_1.bin",   0x58000, 0x8000, CRC(5c74781e) SHA1(0a50a706fd397bb220e31f1a7adaa4204b242888) )
38624000   ROM_LOAD( "pop_2.bin",   0x60000, 0x8000, CRC(10103648) SHA1(6fdc1aa4dcc8919e46def1c19adc2b9686c0f72d) )
38634001
4002
38644003   ROM_REGION( 0x0200, "proms", 0 )
3865   ROM_LOAD( "82s147.bin",    0x0000, 0x0200, BAD_DUMP CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
4004   ROM_LOAD( "82s147.bin", 0x0000, 0x0200, CRC(f990a9ae) SHA1(f7133798b5f20dd5b8dbe5d1a6876341710d93a8) )
38664005ROM_END
38674006
38684007
r7882r7883
41624301*************************/
41634302
41644303/*     YEAR  NAME       PARENT    MACHINE   INPUT      INIT      ROT    COMPANY            FULLNAME                                          FLAGS                  LAYOUT */
4165GAMEL( 1985, jollycrd,  0,        fw1stpal, funworld,  0,        ROT0, "TAB-Austria",     "Jolly Card (austrian)",                           0,                     layout_jollycrd )
4166GAMEL( 1985, jolyc3x3,  jollycrd, fw1stpal, funworld,  0,        ROT0, "TAB-Austria",     "Jolly Card (3x3 deal)",                           0,                     layout_jollycrd )
4167GAMEL( 1993, jolycmzs,  jollycrd, cuoreuno, jolyc980,  0,        ROT0, "MZS Tech",        "Jolly Card Professional 2.0 (MZS Tech)",          0,                     layout_jollycrd )
4168GAMEL( 2000, jolyc980,  jollycrd, cuoreuno, jolyc980,  0,        ROT0, "Spale-Soft",      "Jolly Card Professional 2.0 (Spale Soft)",        0,                     layout_jollycrd )
4169GAMEL( 1998, jolycdev,  jollycrd, fw1stpal, funworld,  0,        ROT0, "TAB/Evona",       "Jolly Card (Evona Electronic)",                   0,                     layout_jollycrd )
4170GAMEL( 1985, jolyccra,  jollycrd, cuoreuno, jolycdcr,  0,        ROT0, "TAB-Austria",     "Jolly Card (croatian, set 1)",                    0,                     layout_jollycrd )
4171GAMEL( 1993, jolyccrb,  jollycrd, cuoreuno, jolycdcr,  0,        ROT0, "Soft Design",     "Jolly Card (croatian, set 2)",                    0,                     layout_jollycrd )
4172GAMEL( 199?, jolycdit,  jollycrd, cuoreuno, jolycdit,  tabblue,  ROT0, "bootleg",         "Jolly Card (italian, blue TAB board, encrypted)", 0,                     layout_royalcrd )
4173GAMEL( 1990, jolycdib,  jollycrd, cuoreuno, jolycdib,  tabblue,  ROT0, "bootleg",         "Jolly Card (italian, encrypted bootleg)",         0,                     layout_jollycrd )   /* not a real TAB blue PCB */
4174GAMEL( 1985, sjcd2kx3,  jollycrd, fw1stpal, funworld,  0,        ROT0, "M.P.",            "Super Joly 2000 - 3x",                            0,                     layout_jollycrd )
4304GAMEL( 1985, jollycrd,  0,        fw1stpal, funworld,  0,        ROT0, "TAB-Austria",     "Jolly Card (austrian)",                           0,                       layout_jollycrd )
4305GAMEL( 1985, jolyc3x3,  jollycrd, fw1stpal, funworld,  0,        ROT0, "TAB-Austria",     "Jolly Card (3x3 deal)",                           0,                       layout_jollycrd )
4306GAMEL( 1993, jolycmzs,  jollycrd, cuoreuno, jolyc980,  0,        ROT0, "MZS Tech",        "Jolly Card Professional 2.0 (MZS Tech)",          0,                       layout_jollycrd )
4307GAMEL( 2000, jolyc980,  jollycrd, cuoreuno, jolyc980,  0,        ROT0, "Spale-Soft",      "Jolly Card Professional 2.0 (Spale Soft)",        0,                       layout_jollycrd )
4308GAMEL( 1998, jolycdev,  jollycrd, fw1stpal, funworld,  0,        ROT0, "TAB/Evona",       "Jolly Card (Evona Electronic)",                   0,                       layout_jollycrd )
4309GAMEL( 1985, jolyccra,  jollycrd, cuoreuno, jolycdcr,  0,        ROT0, "TAB-Austria",     "Jolly Card (croatian, set 1)",                    0,                       layout_jollycrd )
4310GAMEL( 1993, jolyccrb,  jollycrd, cuoreuno, jolycdcr,  0,        ROT0, "Soft Design",     "Jolly Card (croatian, set 2)",                    0,                       layout_jollycrd )
4311GAMEL( 199?, jolycdit,  jollycrd, cuoreuno, jolycdit,  tabblue,  ROT0, "bootleg",         "Jolly Card (italian, blue TAB board, encrypted)", 0,                       layout_royalcrd )
4312GAMEL( 1990, jolycdib,  jollycrd, cuoreuno, jolycdib,  tabblue,  ROT0, "bootleg",         "Jolly Card (italian, encrypted bootleg)",         0,                       layout_jollycrd )   /* not a real TAB blue PCB */
4313GAMEL( 1985, sjcd2kx3,  jollycrd, fw1stpal, funworld,  0,        ROT0, "M.P.",            "Super Joly 2000 - 3x",                            0,                       layout_jollycrd )
41754314GAME(  1986, jolycdab,  jollycrd, fw1stpal, funworld,  0,        ROT0, "Inter Games",     "Jolly Card (austrian, Funworld, bootleg)",        GAME_NOT_WORKING )
4176GAMEL( 1986, bigdeal,   0,        fw2ndpal, bigdeal,   0,        ROT0, "Funworld",        "Big Deal (hungarian, set 1)",                     GAME_IMPERFECT_COLORS, layout_bigdeal  )
4177GAMEL( 1986, bigdealb,  bigdeal,  fw2ndpal, bigdeal,   0,        ROT0, "Funworld",        "Big Deal (hungarian, set 2)",                     GAME_IMPERFECT_COLORS, layout_bigdeal  )
4178GAMEL( 1986, jolycdat,  bigdeal,  fw2ndpal, bigdeal,   0,        ROT0, "Funworld",        "Jolly Card (austrian, Funworld)",                 GAME_IMPERFECT_COLORS, layout_bigdeal  )
4179GAMEL( 1996, cuoreuno,  0,        cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Cuore 1 (italian)",                               0,                     layout_jollycrd )
4180GAMEL( 1997, elephfam,  0,        cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Elephant Family (italian, new)",                  0,                     layout_jollycrd )
4181GAMEL( 1996, elephfmb,  elephfam, cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Elephant Family (italian, old)",                  0,                     layout_jollycrd )
4182GAMEL( 1996, pool10,    0,        cuoreuno, pool10,    0,        ROT0, "C.M.C.",          "Pool 10 (italian, set 1)",                        0,                     layout_jollycrd )
4183GAMEL( 1996, pool10b,   pool10,   cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Pool 10 (italian, set 2)",                        0,                     layout_jollycrd )
4184GAMEL( 1996, pool10c,   pool10,   cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Pool 10 (italian, set 3)",                        0,                     layout_jollycrd )
4185GAMEL( 1997, pool10d,   pool10,   cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Pool 10 (italian, set 4)",                        0,                     layout_jollycrd )
4186GAMEL( 1997, tortufam,  0,        cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Tortuga Family (italian)",                        0,                     layout_jollycrd )
4187GAMEL( 1996, potgame,   0,        cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Pot Game (italian)",                              0,                     layout_jollycrd )
4188GAMEL( 1996, bottle10,  0,        cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Bottle 10 (italian, set 1)",                      0,                     layout_jollycrd )
4189GAMEL( 1996, bottl10b,  bottle10, cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Bottle 10 (italian, set 2)",                      0,                     layout_jollycrd )
4190GAMEL( 1991, royalcrd,  0,        royalcrd, royalcrd,  0,        ROT0, "TAB-Austria",     "Royal Card (austrian, set 1)",                    0,                     layout_royalcrd )
4191GAMEL( 1991, royalcdb,  royalcrd, royalcrd, royalcrd,  0,        ROT0, "TAB-Austria",     "Royal Card (austrian, set 2)",                    0,                     layout_jollycrd )
4192GAME(  1991, royalcdc,  royalcrd, royalcrd, royalcrd,  royalcdc, ROT0, "Evona Electronic","Royal Card (slovak, encrypted)",                  GAME_WRONG_COLORS | GAME_NOT_WORKING )
4193GAME(  1993, royalcdp,  royalcrd, cuoreuno, royalcrd,  0,        ROT0, "Digital Dreams",  "Royal Card v2.0 Professional",                    GAME_NOT_WORKING )
4194GAMEL( 1991, lluck3x3,  royalcrd, cuoreuno, royalcrd,  0,        ROT0, "TAB-Austria",     "Lucky Lady (3x3 deal)",                           0,                     layout_jollycrd )
4195GAMEL( 1991, lluck4x1,  royalcrd, royalcrd, royalcrd,  0,        ROT0, "TAB-Austria",     "Lucky Lady (4x1 aces)",                           0,                     layout_jollycrd )
4196GAMEL( 1996, magicrd2,  0,        magicrd2, magicrd2,  0,        ROT0, "Impera",          "Magic Card II (bulgarian)",                       GAME_IMPERFECT_SOUND,  layout_jollycrd )
4315GAMEL( 1986, bigdeal,   0,        fw2ndpal, bigdeal,   0,        ROT0, "Funworld",        "Big Deal (hungarian, set 1)",                     GAME_IMPERFECT_COLORS,   layout_bigdeal  )
4316GAMEL( 1986, bigdealb,  bigdeal,  fw2ndpal, bigdeal,   0,        ROT0, "Funworld",        "Big Deal (hungarian, set 2)",                     GAME_IMPERFECT_COLORS,   layout_bigdeal  )
4317GAMEL( 1986, jolycdat,  bigdeal,  fw2ndpal, bigdeal,   0,        ROT0, "Funworld",        "Jolly Card (austrian, Funworld)",                 GAME_IMPERFECT_COLORS,   layout_bigdeal  )
4318GAMEL( 1996, cuoreuno,  0,        cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Cuore 1 (italian)",                               0,                       layout_jollycrd )
4319GAMEL( 1997, elephfam,  0,        cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Elephant Family (italian, new)",                  0,                       layout_jollycrd )
4320GAMEL( 1996, elephfmb,  elephfam, cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Elephant Family (italian, old)",                  0,                       layout_jollycrd )
4321GAMEL( 1996, pool10,    0,        cuoreuno, pool10,    0,        ROT0, "C.M.C.",          "Pool 10 (italian, set 1)",                        0,                       layout_jollycrd )
4322GAMEL( 1996, pool10b,   pool10,   cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Pool 10 (italian, set 2)",                        0,                       layout_jollycrd )
4323GAMEL( 1996, pool10c,   pool10,   cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Pool 10 (italian, set 3)",                        0,                       layout_jollycrd )
4324GAMEL( 1997, pool10d,   pool10,   cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Pool 10 (italian, set 4)",                        0,                       layout_jollycrd )
4325GAMEL( 1997, tortufam,  0,        cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Tortuga Family (italian)",                        0,                       layout_jollycrd )
4326GAMEL( 1996, potgame,   0,        cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Pot Game (italian)",                              0,                       layout_jollycrd )
4327GAMEL( 1996, bottle10,  0,        cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Bottle 10 (italian, set 1)",                      0,                       layout_jollycrd )
4328GAMEL( 1996, bottl10b,  bottle10, cuoreuno, cuoreuno,  0,        ROT0, "C.M.C.",          "Bottle 10 (italian, set 2)",                      0,                       layout_jollycrd )
4329GAMEL( 1991, royalcrd,  0,        royalcd2, royalcrd,  0,        ROT0, "TAB Austria",     "Royal Card (austrian, set 1)",                    0,                       layout_jollycrd )
4330GAMEL( 1991, royalcrda, royalcrd, royalcd2, royalcrd,  0,        ROT0, "TAB Austria",     "Royal Card (austrian, set 2)",                    0,                       layout_jollycrd )
4331GAMEL( 1991, royalcrdb, royalcrd, royalcd1, royalcrd,  0,        ROT0, "TAB Austria",     "Royal Card (austrian/polish, set 3)",             0,                       layout_jollycrd )
4332GAMEL( 1991, royalcrdc, royalcrd, royalcd2, royalcrd,  0,        ROT0, "TAB Austria",     "Royal Card (austrian, set 4)",                    GAME_IMPERFECT_GRAPHICS, layout_jollycrd )
4333GAMEL( 1991, royalcrdd, royalcrd, royalcd1, royalcrd,  0,        ROT0, "TAB-Austria",     "Royal Card (austrian, set 5)",                    0,                       layout_royalcrd )
4334GAMEL( 1991, royalcrde, royalcrd, royalcd1, royalcrd,  0,        ROT0, "TAB-Austria",     "Royal Card (austrian, set 6)",                    0,                       layout_jollycrd )
4335GAME(  1991, royalcrdf, royalcrd, royalcd1, royalcrd,  royalcdc, ROT0, "Evona Electronic","Royal Card (slovak, encrypted)",                  GAME_NOT_WORKING )
4336GAME(  1993, royalcrdp, royalcrd, cuoreuno, royalcrd,  0,        ROT0, "Digital Dreams",  "Royal Card v2.0 Professional",                    GAME_NOT_WORKING )
4337GAMEL( 1991, lluck3x3,  royalcrd, cuoreuno, royalcrd,  0,        ROT0, "TAB-Austria",     "Lucky Lady (3x3 deal)",                           0,                       layout_jollycrd )
4338GAMEL( 1991, lluck4x1,  royalcrd, royalcd1, royalcrd,  0,        ROT0, "TAB-Austria",     "Lucky Lady (4x1 aces)",                           0,                       layout_jollycrd )
4339GAMEL( 1996, magicrd2,  0,        magicrd2, magicrd2,  0,        ROT0, "Impera",          "Magic Card II (bulgarian)",                       GAME_IMPERFECT_SOUND,    layout_jollycrd )
41974340GAME(  1996, magicd2a,  magicrd2, magicrd2, magicrd2,  magicd2a, ROT0, "Impera",          "Magic Card II (green TAB or Impera board)",       GAME_NOT_WORKING )
41984341GAME(  1996, magicd2b,  magicrd2, magicrd2, magicrd2,  magicd2b, ROT0, "Impera",          "Magic Card II (blue TAB board, encrypted)",       GAME_NOT_WORKING )
4199GAMEL( 1993, vegasslw,  0,        fw2ndpal, vegasslw,  0,        ROT0, "Funworld",        "Royal Vegas Joker Card (slow deal)",              0,                     layout_jollycrd )
4200GAMEL( 1993, vegasfst,  vegasslw, fw2ndpal, vegasfst,  0,        ROT0, "Soft Design",     "Royal Vegas Joker Card (fast deal)",              0,                     layout_jollycrd )
4201GAMEL( 1993, vegasfte,  vegasslw, fw2ndpal, vegasfte,  0,        ROT0, "Soft Design",     "Royal Vegas Joker Card (fast deal, english gfx)", 0,                     layout_jollycrd )
4202GAMEL( 1993, vegasmil,  vegasslw, fw2ndpal, vegasmil,  0,        ROT0, "Mile",            "Royal Vegas Joker Card (fast deal, Mile)",        0,                     layout_jollycrd )
4203GAMEL( 198?, jolyjokr,  0,        fw1stpal, funworld,  0,        ROT0, "Impera",          "Jolly Joker (98bet, set 1)",                      0,                     layout_jollycrd )
4204GAMEL( 198?, jolyjokra, jolyjokr, fw1stpal, jolyjokra, 0,        ROT0, "Impera",          "Jolly Joker (98bet, set 2)",                      0,                     layout_jollycrd )
4205GAMEL( 198?, jolyjokrb, jolyjokr, fw1stpal, funworld,  0,        ROT0, "Impera",          "Jolly Joker (40bet, croatian hack)",              0,                     layout_jollycrd )
4206GAME(  1992, multiwin,  0,        fw1stpal, funworld,  multiwin, ROT0, "Funworld",        "Multi Win (Ver.0167, encrypted)",                 GAME_WRONG_COLORS | GAME_NOT_WORKING )
4207GAME(  1993, jokercrd,  0,        fw2ndpal, funworld,  0,        ROT0, "Vesely Svet",     "Joker Card (Ver.A267BC, encrypted)",              GAME_WRONG_COLORS | GAME_NOT_WORKING )
4208GAME(  199?, mongolnw,  0,        royalcrd, royalcrd,  0,        ROT0, "bootleg",         "Mongolfier New (italian)",                        GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
4209GAME(  199?, soccernw,  0,        royalcrd, royalcrd,  soccernw, ROT0, "bootleg",         "Soccer New (italian)",                            GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
4210GAME(  198?, saloon,    0,        saloon,   saloon,    saloon,   ROT0, "<unknown>",       "Saloon (french, encrypted)",                      GAME_NO_SOUND | GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
4211GAME(  198?, funquiz,   0,        funquiz,  funquiz,   0,        ROT0, "Funworld",        "Fun World Quiz (austrian)",                       GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS )
4342GAMEL( 1993, vegasslw,  0,        fw2ndpal, vegasslw,  0,        ROT0, "Funworld",        "Royal Vegas Joker Card (slow deal)",              0,                       layout_jollycrd )
4343GAMEL( 1993, vegasfst,  vegasslw, fw2ndpal, vegasfst,  0,        ROT0, "Soft Design",     "Royal Vegas Joker Card (fast deal)",              0,                       layout_jollycrd )
4344GAMEL( 1993, vegasfte,  vegasslw, fw2ndpal, vegasfte,  0,        ROT0, "Soft Design",     "Royal Vegas Joker Card (fast deal, english gfx)", 0,                       layout_jollycrd )
4345GAMEL( 1993, vegasmil,  vegasslw, fw2ndpal, vegasmil,  0,        ROT0, "Mile",            "Royal Vegas Joker Card (fast deal, Mile)",        0,                       layout_jollycrd )
4346GAMEL( 198?, jolyjokr,  0,        fw1stpal, funworld,  0,        ROT0, "Impera",          "Jolly Joker (98bet, set 1)",                      0,                       layout_jollycrd )
4347GAMEL( 198?, jolyjokra, jolyjokr, fw1stpal, jolyjokra, 0,        ROT0, "Impera",          "Jolly Joker (98bet, set 2)",                      0,                       layout_jollycrd )
4348GAMEL( 198?, jolyjokrb, jolyjokr, fw1stpal, funworld,  0,        ROT0, "Impera",          "Jolly Joker (40bet, croatian hack)",              0,                       layout_jollycrd )
4349GAME(  1992, multiwin,  0,        fw1stpal, funworld,  multiwin, ROT0, "Funworld",        "Multi Win (Ver.0167, encrypted)",                 GAME_NOT_WORKING )
4350GAME(  1993, jokercrd,  0,        fw2ndpal, funworld,  0,        ROT0, "Vesely Svet",     "Joker Card (Ver.A267BC, encrypted)",              GAME_NOT_WORKING )
4351GAME(  199?, mongolnw,  0,        royalcd1, royalcrd,  0,        ROT0, "bootleg",         "Mongolfier New (italian)",                        GAME_NOT_WORKING )
4352GAME(  199?, soccernw,  0,        royalcd1, royalcrd,  soccernw, ROT0, "bootleg",         "Soccer New (italian)",                            GAME_NOT_WORKING )
4353GAME(  198?, saloon,    0,        saloon,   saloon,    saloon,   ROT0, "<unknown>",       "Saloon (french, encrypted)",                      GAME_NOT_WORKING )
4354GAME(  198?, funquiz,   0,        funquiz,  funquiz,   0,        ROT0, "Funworld",        "Fun World Quiz (austrian)",                       0 )
42124355
src/mame/drivers/playch10.c
r7882r7883
777777    ROM_REGION( 0x0300, "proms", 0 )                  \
778778    ROM_LOAD( "pch1-c.6f",    0x0000, 0x0100, CRC(e5414ca3) SHA1(d2878411cda84ffe0afb2e538a67457f51bebffb) )   \
779779    ROM_LOAD( "pch1-c.6e",    0x0100, 0x0100, CRC(a2625c6e) SHA1(a448b47c9289902e26a3d3c4c7d5a7968c385e81) )   \
780    ROM_LOAD( "pch1-c.6d",    0x0200, 0x0100, CRC(1213ebd4) SHA1(0ad386fc3eab5e53c0288ad1de33639a9e461b7c) )
780    ROM_LOAD( "pch1-c.6d",    0x0200, 0x0100, CRC(1213ebd4) SHA1(0ad386fc3eab5e53c0288ad1de33639a9e461b7c) )   \
781   ROM_REGION( 0xc0, "palette", 0 )                  \
782   ROM_LOAD( "rp2c0x.pal", 0x00, 0xc0, CRC(48de65dc) SHA1(d10acafc8da9ff479c270ec01180cca61efe62f5) )
781783
782784/******************************************************************************/
783785
src/mame/drivers/cojag.c
r7882r7883
11681168
11691169ROM_START( area51t ) /* 68020 based, Area51 Time Warner License  Date: Nov 15, 1995 */
11701170   ROM_REGION32_BE( 0x200000, "user1", 0 )   /* 2MB for 68020 code */
1171   ROM_LOAD32_BYTE( "3h.bin", 0x00000, 0x80000, CRC(e70a97c4) SHA1(39dabf6bf3dc6f717a587f362d040bfb332be9e1) )
1172   ROM_LOAD32_BYTE( "3p.bin", 0x00001, 0x80000, CRC(e9c9f4bd) SHA1(7c6c50372d45dca8929767241b092339f3bab4d2) )
1173   ROM_LOAD32_BYTE( "3m.bin", 0x00002, 0x80000, CRC(6f135a81) SHA1(2d9660f240b14481e8c46bc98713e9dc12035063) )
1174   ROM_LOAD32_BYTE( "3k.bin", 0x00003, 0x80000, CRC(94f50c14) SHA1(a54552e3ac5c4f481ba4f2fc7d724534576fe76c) )
1171   ROM_LOAD32_BYTE( "136105-0003c.3h", 0x00000, 0x80000, CRC(e70a97c4) SHA1(39dabf6bf3dc6f717a587f362d040bfb332be9e1) )
1172   ROM_LOAD32_BYTE( "136105-0002c.3p", 0x00001, 0x80000, CRC(e9c9f4bd) SHA1(7c6c50372d45dca8929767241b092339f3bab4d2) )
1173   ROM_LOAD32_BYTE( "136105-0001c.3m", 0x00002, 0x80000, CRC(6f135a81) SHA1(2d9660f240b14481e8c46bc98713e9dc12035063) )
1174   ROM_LOAD32_BYTE( "136105-0000c.3k", 0x00003, 0x80000, CRC(94f50c14) SHA1(a54552e3ac5c4f481ba4f2fc7d724534576fe76c) )
11751175
11761176   DISK_REGION( "ide" )
11771177   DISK_IMAGE( "area51t", 0, SHA1(d2865cc7b1bb08a4393a72013a90e18d8a8f9860) )
src/mame/drivers/pzletime.c
r7882r7883
1919#include "sound/okim6295.h"
2020#include "machine/eeprom.h"
2121
22static UINT16 *bg_videoram, *mid_videoram, *txt_videoram, *tilemap_regs, *video_regs;
23static tilemap_t *mid_tilemap, *txt_tilemap;
24static int ticket = 0;
22class pzletime_state
23{
24public:
25   static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, pzletime_state(machine)); }
2526
27   pzletime_state(running_machine &machine) { }
28
29   /* memory pointers */
30   UINT16 *       bg_videoram;
31   UINT16 *       mid_videoram;
32   UINT16 *       txt_videoram;
33   UINT16 *       tilemap_regs;
34   UINT16 *       video_regs;
35   UINT16 *       spriteram;
36//  UINT16 *       paletteram;    // currently this uses generic palette handling
37
38   /* video-related */
39   tilemap_t      *mid_tilemap, *txt_tilemap;
40
41   /* misc */
42   int            ticket;
43};
44
45
2646static TILE_GET_INFO( get_mid_tile_info )
2747{
28   int tileno,colour;
29
30   tileno = mid_videoram[tile_index] & 0x0fff;
31   colour = mid_videoram[tile_index] & 0xf000;
48   pzletime_state *state = (pzletime_state *)machine->driver_data;
49   int tileno = state->mid_videoram[tile_index] & 0x0fff;
50   int colour = state->mid_videoram[tile_index] & 0xf000;
3251   colour = colour >> 12;
33   SET_TILE_INFO(2,tileno,colour,0);
52   SET_TILE_INFO(2, tileno, colour, 0);
3453}
3554
3655static TILE_GET_INFO( get_txt_tile_info )
3756{
38   int tileno,colour;
39
40   tileno = txt_videoram[tile_index] & 0x0fff;
41   colour = txt_videoram[tile_index] & 0xf000;
57   pzletime_state *state = (pzletime_state *)machine->driver_data;
58   int tileno = state->txt_videoram[tile_index] & 0x0fff;
59   int colour = state->txt_videoram[tile_index] & 0xf000;
4260   colour = colour >> 12;
4361
44   SET_TILE_INFO(0,tileno,colour,0);
62   SET_TILE_INFO(0, tileno, colour, 0);
4563
46   tileinfo->category = (colour & 8) ? 1 : 0;
64   tileinfo->category = BIT(colour, 3);
4765}
4866
4967static VIDEO_START( pzletime )
5068{
51   mid_tilemap = tilemap_create(machine, get_mid_tile_info,tilemap_scan_cols, 16,16,64,16);
52   txt_tilemap = tilemap_create(machine, get_txt_tile_info,tilemap_scan_rows,  8, 8,64,32);
69   pzletime_state *state = (pzletime_state *)machine->driver_data;
5370
54   tilemap_set_transparent_pen(mid_tilemap,0);
55   tilemap_set_transparent_pen(txt_tilemap,0);
71   state->mid_tilemap = tilemap_create(machine, get_mid_tile_info, tilemap_scan_cols, 16, 16, 64, 16);
72   state->txt_tilemap = tilemap_create(machine, get_txt_tile_info, tilemap_scan_rows,  8, 8, 64, 32);
73
74   tilemap_set_transparent_pen(state->mid_tilemap, 0);
75   tilemap_set_transparent_pen(state->txt_tilemap, 0);
5676}
5777
5878static VIDEO_UPDATE( pzletime )
5979{
80   pzletime_state *state = (pzletime_state *)screen->machine->driver_data;
6081   int count;
61   int y,x;
82   int y, x;
6283
6384   bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); //bg pen
6485
65   tilemap_set_scrolly(txt_tilemap, 0, tilemap_regs[0]-3);
66   tilemap_set_scrollx(txt_tilemap, 0, tilemap_regs[1]);
86   tilemap_set_scrolly(state->txt_tilemap, 0, state->tilemap_regs[0] - 3);
87   tilemap_set_scrollx(state->txt_tilemap, 0, state->tilemap_regs[1]);
6788
68   tilemap_set_scrolly(mid_tilemap, 0, tilemap_regs[2]-3);
69   tilemap_set_scrollx(mid_tilemap, 0, tilemap_regs[3]-7);
89   tilemap_set_scrolly(state->mid_tilemap, 0, state->tilemap_regs[2] - 3);
90   tilemap_set_scrollx(state->mid_tilemap, 0, state->tilemap_regs[3] - 7);
7091
71   if(video_regs[2] & 1)
92   if (state->video_regs[2] & 1)
7293   {
7394      count = 0;
7495
75      for(y=255;y>=0;y--)
96      for (y = 255; y >= 0; y--)
7697      {
77         for(x=0;x<512;x++)
98         for (x = 0; x < 512; x++)
7899         {
79            if(bg_videoram[count] & 0x8000)
80            {
81               *BITMAP_ADDR16(bitmap, (y - 18) & 0xff, (x - 32) & 0x1ff) = 0x300 + (bg_videoram[count] & 0x7fff);
82            }
100            if (state->bg_videoram[count] & 0x8000)
101               *BITMAP_ADDR16(bitmap, (y - 18) & 0xff, (x - 32) & 0x1ff) = 0x300 + (state->bg_videoram[count] & 0x7fff);
83102
84103            count++;
85104         }
86105      }
87106   }
88107
89   tilemap_draw(bitmap,cliprect,mid_tilemap, 0,0);
108   tilemap_draw(bitmap, cliprect, state->mid_tilemap, 0, 0);
90109
91110   {
92      UINT16 *spriteram16 = screen->machine->generic.spriteram.u16;
93      int offs,spr_offs,colour,sx,sy;
111      UINT16 *spriteram = state->spriteram;
112      int offs, spr_offs, colour, sx, sy;
94113
95      for(offs = 0; offs < 0x2000/2; offs += 4)
114      for(offs = 0; offs < 0x2000 / 2; offs += 4)
96115      {
97         if(spriteram16[offs+0] == 8)
116         if(spriteram[offs + 0] == 8)
98117            break;
99118
100         spr_offs = spriteram16[offs+3] & 0x0fff;
101         sy = 0x200-(spriteram16[offs+0] & 0x1ff)-35;
102         sx = (spriteram16[offs+1] & 0x1ff)-30;
103         colour = (spriteram16[offs+0] & 0xf000)>>12;
119         spr_offs = spriteram[offs + 3] & 0x0fff;
120         sy = 0x200 - (spriteram[offs + 0] & 0x1ff) - 35;
121         sx = (spriteram[offs + 1] & 0x1ff) - 30;
122         colour = (spriteram[offs + 0] & 0xf000) >> 12;
104123
105         // is spriteram16[offs+0] & 0x200 flipy? it's always set
124         // is spriteram[offs + 0] & 0x200 flipy? it's always set
106125
107         drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],spr_offs,colour,0,1,sx,sy,0);
126         drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], spr_offs, colour, 0, 1, sx, sy, 0);
108127      }
109128   }
110129
111   tilemap_draw(bitmap,cliprect,txt_tilemap,0,0);
112   if((video_screen_get_frame_number(screen) % 16) != 0)
113      tilemap_draw(bitmap,cliprect,txt_tilemap,1,0);
130   tilemap_draw(bitmap, cliprect, state->txt_tilemap, 0, 0);
131   if ((video_screen_get_frame_number(screen) % 16) != 0)
132      tilemap_draw(bitmap, cliprect, state->txt_tilemap, 1, 0);
114133
115134   return 0;
116135}
117136
118137static WRITE16_HANDLER( mid_videoram_w )
119138{
120   COMBINE_DATA(&mid_videoram[offset]);
121   tilemap_mark_tile_dirty(mid_tilemap,offset);
139   pzletime_state *state = (pzletime_state *)space->machine->driver_data;
140   COMBINE_DATA(&state->mid_videoram[offset]);
141   tilemap_mark_tile_dirty(state->mid_tilemap, offset);
122142}
123143
124144static WRITE16_HANDLER( txt_videoram_w )
125145{
126   COMBINE_DATA(&txt_videoram[offset]);
127   tilemap_mark_tile_dirty(txt_tilemap,offset);
146   pzletime_state *state = (pzletime_state *)space->machine->driver_data;
147   COMBINE_DATA(&state->txt_videoram[offset]);
148   tilemap_mark_tile_dirty(state->txt_tilemap, offset);
128149}
129150
130151static WRITE16_DEVICE_HANDLER( eeprom_w )
131152{
132   if( ACCESSING_BITS_0_7 )
153   if (ACCESSING_BITS_0_7)
133154   {
134155      eeprom_write_bit(device, data & 0x01);
135156      eeprom_set_cs_line(device, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE );
r7882r7883
139160
140161static WRITE16_HANDLER( ticket_w )
141162{
142   if( ACCESSING_BITS_0_7 )
143   {
144      ticket = data & 1;
145   }
163   pzletime_state *state = (pzletime_state *)space->machine->driver_data;
164
165   if (ACCESSING_BITS_0_7)
166      state->ticket = data & 1;
146167}
147168
148169static WRITE16_HANDLER( video_regs_w )
149170{
171   pzletime_state *state = (pzletime_state *)space->machine->driver_data;
150172   int i;
151173
152   COMBINE_DATA(&video_regs[offset]);
174   COMBINE_DATA(&state->video_regs[offset]);
153175
154   if(offset == 0)
176   if (offset == 0)
155177   {
156      if(video_regs[0] > 0)
178      if (state->video_regs[0] > 0)
157179      {
158         for (i=0;i<0x300;i++)
180         for (i = 0; i < 0x300; i++)
159181         {
160            palette_set_pen_contrast(space->machine, i, (double)0x8000/(double)video_regs[0]);
182            palette_set_pen_contrast(space->machine, i, (double)0x8000/(double)state->video_regs[0]);
161183         }
162184      }
163185   }
164   else if(offset == 1)
186   else if (offset == 1)
165187   {
166      if(video_regs[1] > 0)
188      if (state->video_regs[1] > 0)
167189      {
168         for (i=0x300;i<32768 + 0x300;i++)
190         for (i = 0x300; i < 32768 + 0x300; i++)
169191         {
170            palette_set_pen_contrast(space->machine, i, (double)0x8000/(double)video_regs[1]);
192            palette_set_pen_contrast(space->machine, i, (double)0x8000/(double)state->video_regs[1]);
171193         }
172194      }
173195   }
r7882r7883
180202
181203static CUSTOM_INPUT( ticket_status_r )
182204{
183   return ticket && !(video_screen_get_frame_number(field->port->machine->primary_screen)%128);
205   pzletime_state *state = (pzletime_state *)field->port->machine->driver_data;
206   return (state->ticket && !(video_screen_get_frame_number(field->port->machine->primary_screen) % 128));
184207}
185208
186209static ADDRESS_MAP_START( pzletime_map, ADDRESS_SPACE_PROGRAM, 16 )
187210   AM_RANGE(0x000000, 0x3fffff) AM_ROM
188   AM_RANGE(0x700000, 0x700005) AM_RAM_WRITE(video_regs_w) AM_BASE(&video_regs)
211   AM_RANGE(0x700000, 0x700005) AM_RAM_WRITE(video_regs_w) AM_BASE_MEMBER(pzletime_state, video_regs)
189212   AM_RANGE(0x800000, 0x800001) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff)
190213   AM_RANGE(0x900000, 0x9005ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram)
191   AM_RANGE(0xa00000, 0xa00007) AM_RAM AM_BASE(&tilemap_regs)
192   AM_RANGE(0xb00000, 0xb3ffff) AM_RAM AM_BASE(&bg_videoram)
193   AM_RANGE(0xc00000, 0xc00fff) AM_RAM_WRITE(mid_videoram_w) AM_BASE(&mid_videoram)
194   AM_RANGE(0xc01000, 0xc01fff) AM_RAM_WRITE(txt_videoram_w) AM_BASE(&txt_videoram)
195   AM_RANGE(0xd00000, 0xd01fff) AM_RAM AM_BASE_GENERIC(spriteram)
214   AM_RANGE(0xa00000, 0xa00007) AM_RAM AM_BASE_MEMBER(pzletime_state, tilemap_regs)
215   AM_RANGE(0xb00000, 0xb3ffff) AM_RAM AM_BASE_MEMBER(pzletime_state, bg_videoram)
216   AM_RANGE(0xc00000, 0xc00fff) AM_RAM_WRITE(mid_videoram_w) AM_BASE_MEMBER(pzletime_state, mid_videoram)
217   AM_RANGE(0xc01000, 0xc01fff) AM_RAM_WRITE(txt_videoram_w) AM_BASE_MEMBER(pzletime_state, txt_videoram)
218   AM_RANGE(0xd00000, 0xd01fff) AM_RAM AM_BASE_MEMBER(pzletime_state, spriteram)
196219   AM_RANGE(0xe00000, 0xe00001) AM_READ_PORT("INPUT") AM_DEVWRITE("eeprom", eeprom_w)
197220   AM_RANGE(0xe00002, 0xe00003) AM_READ_PORT("SYSTEM") AM_WRITE(ticket_w)
198221   AM_RANGE(0xe00004, 0xe00005) AM_DEVWRITE("oki", oki_bank_w)
r7882r7883
266289   /* first 0x300 colors are dynamic */
267290
268291   /* initialize 555 RGB lookup */
269   for (i = 0;i < 32768;i++)
270      palette_set_color_rgb(machine,i+0x300,pal5bit(i >> 10),pal5bit(i >> 5),pal5bit(i >> 0));
292   for (i = 0; i < 32768; i++)
293      palette_set_color_rgb(machine, i + 0x300, pal5bit(i >> 10), pal5bit(i >> 5), pal5bit(i >> 0));
271294}
272295
296static MACHINE_START( pzletime )
297{
298   pzletime_state *state = (pzletime_state *)machine->driver_data;
299
300   state_save_register_global(machine, state->ticket);
301}
302
303static MACHINE_RESET( pzletime )
304{
305   pzletime_state *state = (pzletime_state *)machine->driver_data;
306
307   state->ticket = 0;
308}
309
273310static MACHINE_DRIVER_START( pzletime )
274311
312   /* driver data */
313   MDRV_DRIVER_DATA(pzletime_state)
314
275315   /* basic machine hardware */
276316   MDRV_CPU_ADD("maincpu",M68000,10000000)
277317   MDRV_CPU_PROGRAM_MAP(pzletime_map)
278318   MDRV_CPU_VBLANK_INT("screen",irq4_line_hold)
279319
320   MDRV_MACHINE_START(pzletime)
321   MDRV_MACHINE_RESET(pzletime)
322
280323   /* video hardware */
281324   MDRV_SCREEN_ADD("screen", RASTER)
282325   MDRV_SCREEN_REFRESH_RATE(60)
r7882r7883
342385   ROM_LOAD( "pzletime.nv", 0x0000, 0x0080, CRC(e5ed3d40) SHA1(8c163a6e5839e5c82d52f046d3268202fdf9f4d1) )
343386ROM_END
344387
345GAME( 199?, pzletime, 0, pzletime,  pzletime,  0, ROT0, "Elettronica Video-Games S.R.L.", "Puzzle Time (Prototype)", 0 )
388GAME( 199?, pzletime, 0, pzletime,  pzletime,  0, ROT0, "Elettronica Video-Games S.R.L.", "Puzzle Time (Prototype)", GAME_SUPPORTS_SAVE )
src/mame/drivers/cave.c
r7882r7883
41104110/***************************************************************************
41114111
41124112  Tobikose! Jumpman by Namco, 1999
4113  PCB TJ0476
4113  Namco EMG4 platform, PCB TJ0476
41144114
41154115  TMP 68HC000P-16
41164116
r7882r7883
41414141   ROM_REGION( 0x40000, "oki1", 0 )   /* OKIM6295 #1 Samples */
41424142   ROM_LOAD( "tj1_voi-0a.u27", 0x00000, 0x40000, CRC(b5693aae) SHA1(8887ae98030cb5d184e3d57d2b4e48bf1e76a232) )
41434143
4144    ROM_REGION( 0x0002, "plds", 0 )
4145    ROM_LOAD( "tj1_gal.uxx", 0x0000, 0x0001, NO_DUMP )   // GAL16V8D-15LP
4146    ROM_LOAD( "tj1_gal.uyy", 0x0000, 0x0001, NO_DUMP )   // GAL16V8D-15LP
4144   ROM_REGION( 0x0002, "plds", 0 )
4145   ROM_LOAD( "tj1_gal.uxx", 0x0000, 0x0001, NO_DUMP )   // GAL16V8D-15LP
4146   ROM_LOAD( "tj1_gal.uyy", 0x0000, 0x0001, NO_DUMP )   // GAL16V8D-15LP
41474147ROM_END
41484148
41494149
src/tools/chdman.c
r7882r7883
33073307    main - entry point
33083308-------------------------------------------------*/
33093309
3310int CLIB_DECL main(int argc, char *argv[])
3310int CLIB_DECL main(int argc, char **argv)
33113311{
33123312   static const struct
33133313   {
src/tools/romcmp.c
r7882r7883
553553}
554554
555555
556int CLIB_DECL main(int argc,char *argv[])
556int CLIB_DECL main(int argc,char **argv)
557557{
558558   int   err;
559559   int total_modes = MODE_NIB2;   /* by default, use only MODE_A, MODE_NIB1 and MODE_NIB2 */
src/emu/machine/6840ptm.c
r7882r7883
7878typedef struct _ptm6840_state ptm6840_state;
7979struct _ptm6840_state
8080{
81   int internal_clock;
82   int external_clock[3];
81   double internal_clock;
82   double external_clock[3];
8383   devcb_resolved_write8 out_func[3];   // function to call when output[idx] changes
8484   devcb_resolved_write_line irq_func;   // function called if IRQ line changes
8585
r7882r7883
157157static void subtract_from_counter( running_device *device, int counter, int count )
158158{
159159   ptm6840_state *ptm6840 = get_safe_token(device);
160   int clock;
160   double clock;
161161   attotime duration;
162162
163163   /* Determine the clock frequency for this timer */
r7882r7883
264264            ((ptm6840->status_reg & 0x02) && (ptm6840->control_reg[1] & 0x40)) ||
265265            ((ptm6840->status_reg & 0x04) && (ptm6840->control_reg[2] & 0x40));
266266
267//  if (new_state != ptm6840->IRQ)
267   if (new_state != ptm6840->IRQ)
268268   {
269269      ptm6840->IRQ = new_state;
270270
r7882r7883
284284static UINT16 compute_counter( running_device *device, int counter )
285285{
286286   ptm6840_state *ptm6840 = get_safe_token(device);
287   int clock;
287   double clock;
288288   int remaining = 0;
289289
290290   /* If there's no timer, return the count */
r7882r7883
298298   if (ptm6840->control_reg[counter] & 0x02)
299299   {
300300      clock = ptm6840->internal_clock;
301      PLOG(("MC6840 #%s: %d internal clock freq %d \n", device->tag(), counter, clock));
301      PLOG(("MC6840 #%s: %d internal clock freq %f \n", device->tag(), counter, clock));
302302   }
303303   else
304304   {
305305      clock = ptm6840->external_clock[counter];
306      PLOG(("MC6840 #%s: %d external clock freq %d \n", device->tag(), counter, clock));
306      PLOG(("MC6840 #%s: %d external clock freq %f \n", device->tag(), counter, clock));
307307   }
308308   /* See how many are left */
309309   remaining = attotime_to_double(attotime_mul(timer_timeleft(ptm6840->timer[counter]), clock));
r7882r7883
327327static void reload_count( running_device *device, int idx )
328328{
329329   ptm6840_state *ptm6840 = get_safe_token(device);
330   int clock;
330   double clock;
331331   int count;
332332   attotime duration;
333333
r7882r7883
338338   if (ptm6840->control_reg[idx] & 0x02)
339339   {
340340      clock = ptm6840->internal_clock;
341      PLOG(("MC6840 #%s: %d internal clock freq %d \n", device->tag(), idx, clock));
341      PLOG(("MC6840 #%s: %d internal clock freq %f \n", device->tag(), idx, clock));
342342   }
343343   else
344344   {
345345      clock = ptm6840->external_clock[idx];
346      PLOG(("MC6840 #%s: %d external clock freq %d \n", device->tag(), idx, clock));
346      PLOG(("MC6840 #%s: %d external clock freq %f \n", device->tag(), idx, clock));
347347   }
348348
349349   /* Determine the number of clock periods before we expire */
r7882r7883
363363   }
364364
365365   /* Set the timer */
366   PLOG(("MC6840 #%s: reload_count(%d): clock = %d  count = %d\n", device->tag(), idx, clock, count));
366   PLOG(("MC6840 #%s: reload_count(%d): clock = %f  count = %d\n", device->tag(), idx, clock, count));
367367
368368   duration = attotime_mul(ATTOTIME_IN_HZ(clock), count);
369369   if (idx == 2)
r7882r7883
371371
372372   PLOG(("MC6840 #%s: reload_count(%d): output = %lf\n", device->tag(), idx, attotime_to_double(duration)));
373373
374#if 0
374375   if (!(ptm6840->control_reg[idx] & 0x02))
375376   {
376377      if (!ptm6840->external_clock[idx])
r7882r7883
380381      }
381382   }
382383   else
384#endif
383385   {
384386      ptm6840->enabled[idx] = 1;
385387      timer_adjust_oneshot(ptm6840->timer[idx], duration, 0);
r7882r7883
555557
556558   PLOG(("**ptm6840 %s t%d timeout**\n", device->tag(), idx + 1));
557559
558   if ( ptm6840->control_reg[idx] & 0x40 )
559   {
560      /* Interrupt enabled */
561      ptm6840->status_reg |= (1 << idx);
562      ptm6840->status_read_since_int &= ~(1 << idx);
563      update_interrupts(device);
564   }
560   /* Set the interrupt flag */
561   ptm6840->status_reg |= (1 << idx);
562   ptm6840->status_read_since_int &= ~(1 << idx);
563   update_interrupts(device);
565564
566565   if ( ptm6840->control_reg[idx] & 0x80 )
567566   {
r7882r7883
700699    ptm6840_set_ext_clock - set external clock frequency
701700------------------------------------------------------------*/
702701
703void ptm6840_set_ext_clock( running_device *device, int counter, int clock )
702void ptm6840_set_ext_clock( running_device *device, int counter, double clock )
704703{
705704   ptm6840_state *ptm6840 = get_safe_token(device);
706705
src/emu/machine/6840ptm.h
r7882r7883
2929typedef struct _ptm6840_interface ptm6840_interface;
3030struct _ptm6840_interface
3131{
32   int internal_clock;
33   int external_clock[3];
32   double internal_clock;
33   double external_clock[3];
3434
3535   devcb_write8 out_func[3];   // function to call when output[idx] changes
3636   devcb_write_line irq_func;   // function called if IRQ line changes
r7882r7883
4747int ptm6840_get_status( running_device *device, int clock );   // get whether timer is enabled
4848int ptm6840_get_irq( running_device *device );               // get IRQ state
4949UINT16 ptm6840_get_count( running_device *device, int counter );// get counter value
50void ptm6840_set_ext_clock( running_device *device, int counter, int clock ); // set clock frequency
50void ptm6840_set_ext_clock( running_device *device, int counter, double clock ); // set clock frequency
5151int ptm6840_get_ext_clock( running_device *device, int counter );// get clock frequency
5252
5353WRITE8_DEVICE_HANDLER( ptm6840_set_g1 );   // set gate1 state
src/emu/machine/6850acia.c
r7882r7883
2525#define RTS(_data) \
2626   devcb_call_write_line(&acia_p->out_rts_func, _data)
2727
28static void acia6850_check_interrupts(running_device *device);
29
2830/***************************************************************************
2931    TYPE DEFINITIONS
3032***************************************************************************/
r7882r7883
5658   devcb_resolved_read_line   in_dcd_func;
5759   devcb_resolved_write_line   out_irq_func;
5860
59   UINT8   ctrl;
60   UINT8   status;
61   UINT8      ctrl;
62   UINT8      status;
6163
62   UINT8   tdr;
63   UINT8   rdr;
64   UINT8   rx_shift;
65   UINT8   tx_shift;
64   UINT8      tdr;
65   UINT8      rdr;
66   UINT8      rx_shift;
67   UINT8      tx_shift;
6668
67   UINT8   rx_counter;
68   UINT8   tx_counter;
69   UINT8      rx_counter;
70   UINT8      tx_counter;
6971
70   int   rx_clock;
71   int   tx_clock;
72   int         rx_clock;
73   int         tx_clock;
7274
73   int   divide;
75   int         divide;
7476
7577   /* Counters */
76   int   tx_bits;
77   int   rx_bits;
78   int   tx_parity;
79   int   rx_parity;
78   int         tx_bits;
79   int         rx_bits;
80   int         tx_parity;
81   int         rx_parity;
8082
8183   /* TX/RX state */
82   int   bits;
83   parity_type parity;
84   int   stopbits;
85   int tx_int;
84   int         bits;
85   parity_type   parity;
86   int         stopbits;
87   int         tx_int;
8688
8789   /* Signals */
88   int   overrun;
89   int   reset;
90   int rts;
91   int brk;
92   int first_reset;
93   int status_read;
94   enum   serial_state rx_state;
95   enum   serial_state tx_state;
90   int         overrun;
91   int         reset;
92   int         rts;
93   int         brk;
94   int         first_reset;
95   int         status_read;
96   enum      serial_state rx_state;
97   enum      serial_state tx_state;
98   int         irq;
9699
97   emu_timer *rx_timer;
98   emu_timer *tx_timer;
100   emu_timer   *rx_timer;
101   emu_timer   *tx_timer;
99102};
100103
101104
r7882r7883
176179
177180   acia_p->rx_state = START;
178181   acia_p->tx_state = START;
182   acia_p->irq = 0;
179183
180184   devcb_call_write_line(&acia_p->out_irq_func, 1);
181185
r7882r7883
255259
256260READ8_DEVICE_HANDLER( acia6850_stat_r )
257261{
262   UINT8 status;
263
258264   acia6850_t *acia_p = get_token(device);
259265
260266   acia_p->status_read = 1;
267   status = acia_p->status;
261268
262   return acia_p->status;
269   if (status & ACIA6850_STATUS_CTS)
270      status &= ~ACIA6850_STATUS_TDRE;
271
272   return status;
263273}
264274
265275
r7882r7883
274284   int wordsel;
275285   int divide;
276286
277
278287   // Counter Divide Select Bits
279288
280289   divide = data & CR1_0;
r7882r7883
335344      break;
336345   }
337346
347   acia6850_check_interrupts(device);
348
338349   // After writing the word type, set the rx/tx clocks (provided the divide values have changed)
339350
340351   if ((acia_p->ctrl ^ data) & CR1_0)
r7882r7883
366377{
367378   acia6850_t *acia_p = get_token(device);
368379
369   int irq = (acia_p->tx_int && (acia_p->status & ACIA6850_STATUS_TDRE)) ||
380   int irq = (acia_p->tx_int && (acia_p->status & ACIA6850_STATUS_TDRE) && (~acia_p->status & ACIA6850_STATUS_CTS)) ||
370381      ((acia_p->ctrl & 0x80) && ((acia_p->status & (ACIA6850_STATUS_RDRF|ACIA6850_STATUS_DCD)) || acia_p->overrun));
371382
372   if (irq)
383   if (irq != acia_p->irq)
373384   {
374      acia_p->status |= ACIA6850_STATUS_IRQ;
375      devcb_call_write_line(&acia_p->out_irq_func, 0);
385      acia_p->irq = irq;
386
387      if (irq)
388      {
389         acia_p->status |= ACIA6850_STATUS_IRQ;
390         devcb_call_write_line(&acia_p->out_irq_func, 0);
391      }
392      else
393      {
394         acia_p->status &= ~ACIA6850_STATUS_IRQ;
395         devcb_call_write_line(&acia_p->out_irq_func, 1);
396      }
376397   }
377   else
378   {
379      acia_p->status &= ~ACIA6850_STATUS_IRQ;
380      devcb_call_write_line(&acia_p->out_irq_func, 1);
381   }
382398}
383399
384400
r7882r7883
446462{
447463   acia6850_t *acia_p = get_token(device);
448464
449   int cts = devcb_call_read_line(&acia_p->in_cts_func);
450
451   if (cts)
452   {
453      acia_p->status |= ACIA6850_STATUS_CTS;
454   }
455   else
456   {
457      acia_p->status &= ~ACIA6850_STATUS_CTS;
458   }
459
460465   switch (acia_p->tx_state)
461466   {
462467      case START:
r7882r7883
469474         }
470475         else
471476         {
477            int _cts = devcb_call_read_line(&acia_p->in_cts_func);
478
479            if (_cts)
480               acia_p->status |= ACIA6850_STATUS_CTS;
481            else
482               acia_p->status &= ~ACIA6850_STATUS_CTS;
483
484            acia6850_check_interrupts(device);
485
472486            if (acia_p->status & ACIA6850_STATUS_TDRE)
473487            {
474488               // transmitter idle
475
476489               TXD(1);
477490            }
478491            else
r7882r7883
486499
487500               acia_p->tx_bits = acia_p->bits;
488501               acia_p->tx_shift = acia_p->tdr;
489
490               // inhibit TDRE bit if Clear-to-Send is high
491
492               if (!(acia_p->status & ACIA6850_STATUS_CTS))
493               {
494                  acia_p->status |= ACIA6850_STATUS_TDRE;
495               }
496
497               acia6850_check_interrupts(device);
498
502               acia_p->tx_parity = 0;
499503               acia_p->tx_state = DATA;
500504            }
501505         }
r7882r7883
511515         acia_p->tx_shift >>= 1;
512516
513517         if (--(acia_p->tx_bits) == 0)
514         {
515518            acia_p->tx_state = (acia_p->parity == NONE) ? STOP : PARITY;
516         }
517519
518520         break;
519521      }
520522      case PARITY:
521523      {
522524         if (acia_p->parity == EVEN)
523         {
524525            TXD((acia_p->tx_parity & 1) ? 1 : 0);
525         }
526526         else
527         {
528527            TXD((acia_p->tx_parity & 1) ? 0 : 1);
529         }
530528
531529         //logerror("ACIA6850 #%u: TX PARITY BIT %x\n", which, *acia_p->tx_pin);
532         acia_p->tx_parity = 0;
533530         acia_p->tx_state = STOP;
534531         break;
535532      }
r7882r7883
541538         if (acia_p->stopbits == 1)
542539         {
543540            acia_p->tx_state = START;
541            acia_p->status |= ACIA6850_STATUS_TDRE;
544542         }
545543         else
546544         {
r7882r7883
553551         //logerror("ACIA6850 #%u: TX STOP BIT\n", which);
554552         TXD(1);
555553         acia_p->tx_state = START;
554         acia_p->status |= ACIA6850_STATUS_TDRE;
556555         break;
557556      }
558557   }
r7882r7883
580579{
581580   acia6850_t *acia_p = get_token(device);
582581
583   int cts = devcb_call_read_line(&acia_p->in_cts_func);
582   int _cts = devcb_call_read_line(&acia_p->in_cts_func);
584583
585   if (cts)
586   {
584   if (_cts)
587585      acia_p->status |= ACIA6850_STATUS_CTS;
588   }
589586   else
590   {
591587      acia_p->status &= ~ACIA6850_STATUS_CTS;
592   }
593588
594589   acia_p->tx_counter ++;
595590
src/emu/sound/tms5110r.c
r7882r7883
413413   6,
414414   { 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
415415   /* E   */
416   { 1,   2,   3,   4,   6,   8,   11,    16,
416   { 0,   2,   3,   4,   6,   8,   11,   16, // first value is really 1, but must be 0 for zero energy frames to work properly
417417    23,  33,  47,  63,  85,  114, 152, 511 }, /* last value is actually 0 in ROM, but 511 is stop sentinel */
418   //{ 0x0d,  0x16,  0x20,  0x2d,  0x40,  0x5b,  0x81,  0xb6,
419   // 0x101, 0x16c, 0x202, 0x2d6, 0x402, 0x5a9, 0x7ff, 511 }, /* last value is actually 0 in ROM, but 511 is stop sentinel */
418420   /* P   */
419   {16,  16,  17,  18,  19,  20,  21,  22,
421   { 0,  16,  17,  18,  19,  20,  21,  22, // first value is 16 in QV5220.COD but must be 0 for unvoiced speech to work properly
420422    23,  24,  25,  26,  27,  28,  29,  30,
421423    31,  32,  33,  34,  35,  36,  37,  38,
422424    39,  40,  41,  42,  43,  45,  47,  49,
src/emu/sound/tms5220.c
r7882r7883
1111     Various fixes by Lord Nightmare
1212     Modularization by Lord Nightmare
1313     Sub-interpolation-cycle parameter updating added by Lord Nightmare
14     Preliminary MASSIVE merge of tms5110 and tms5220 cores by Lord Nightmare
15     Lattice Filter, Multiplier, and clipping redone by Lord Nightmare
16     TMS5220C multi-rate feature added by Lord Nightmare
1417
1518     Much information regarding these lpc encoding comes from US patent 4,209,844
1619     US patent 4,331,836 describes the complete 51xx chip
r7882r7883
4548      cpu cores.
4649    If a command is still executing, /READY will be kept high until the command has
4750    finished if the next command is written.
48    TMS5220C: see below.
4951    tomcat has a 5220 which is not hooked up at all
5052
53Progress list for drivers using old vs new interface:
54starwars: uses new interface (couriersud)
55gauntlet: uses new interface (couriersud
56atarisy1: uses new interface (Lord Nightmare)
57atarisy2: uses new interface (Lord Nightmare)
58atarijsa: uses new interface (Lord Nightmare)
59firefox: uses new interface (couriersud)
60mhavoc: uses old interface, and is in the machine file instead of the driver.
61monymony(zaccaria.c): uses new interface (couriersud)
62victory(audio/exidy.c): uses new interface (couriersud)
63looping: uses old interface
64portraits: uses *NO* interface; the i/o cpu hasn't been hooked to anything!
65dotron and midwayfb(mcr.c): uses old interface
66
5167Notes:
5268    Looping has the tms5220 hookep up directly to the cpu. However currently the
5369    tms9900 cpu core does not support a ready line.
r7882r7883
113129serial chips); Street Electronics Corp.'s Apple II 'Echo 2' Speech
114130synthesizer (early cards only)
115131
116TMS5220: (mostly on things made between 1982 and 1984-1985 when supplies
117ran low)
132TMS5220: (mostly on things made between 1982 and 1984-1985)
118133    Arcade: Bally/Midway's 'NFL Football'; Atari's 'Star Wars',
119134'Firefox', 'Return of the Jedi', 'Road Runner', 'The Empire Strikes
120135Back' (all verified with schematics); Venture Line's 'Looping' and 'Sky
r7882r7883
136151module (6511 based), IBM PS/2 Speech adapter (parallel port connection
137152device), PES Speech adapter (serial port connection)
138153
154  Changes by R. Nabet (from 2001)
155   * added Speech ROM support
156   * modified code so that the beast only start speaking at the start of next frame, like the data
157     sheet says
139158
140159***********************************************************************************************/
141160
r7882r7883
143162#include "streams.h"
144163#include "tms5220.h"
145164
165/* *****optional defines***** */
146166
147#define VERBOSE (0)
148#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
167/* this ignores pitch, and uses a sawtooth wave for the voiced and unvoiced waveforms as a test, if not set */
168#define NORMALMODE 1
149169
150#define MAX_SAMPLE_CHUNK   512
151#define FIFO_SIZE 16
170/* if not defined, output the waveform as if it was tapped on the i/o pin */
171#define DO_CLIP_AND_WRAP 1
152172
173/* if defined, interpolation is only using the said slot of the 8,8,8,4,4,4,2,1 slots
174   i.e. setting to 7 effectively disables interpolation, as it adds 1/1 of the difference
175   between current and target to the current each frame */
176#undef OVERRIDE_INTERPOLATION
153177
154enum _tms5220_variant
155{
156   variant_tms5220c,   /* TMS5220_IS_TMS5220C  TMS5220_IS_TSP5220C */
157   variant_tms5220,   /* TMS5220_IS_TMS5220 */
158   variant_tmc0285      /* TMS5220_IS_TMS5200, TMS5220_IS_CD2501 */
159};
160typedef enum _tms5220_variant tms5220_variant;
178/* defines how many times to leftshift the chirp rom before feeding to the lattice filter. default is 0 */
179#define CHIRPROM_LEFTSHIFT 0
161180
181/* *****debugging defines***** */
182#undef VERBOSE
183// above is general, somewhat obsolete
184#undef DEBUG_FIFO
185// above debugs fifo stuff: writes, reads and flag updates
186#undef DEBUG_FRAME_DUMP
187// above dumps the contents of each decoded speech frame as hex
188#undef DEBUG_FRAME_INFO
189// above dumps information about each decoded speech frame
190#undef DEBUG_FRAME_ERRORS
191// above dumps info if a frame ran out of data
192#undef DEBUG_COMMAND_DUMP
193// above dumps all non-speech-data command writes
194#undef DEBUG_PIN_READS
195// above spams the errorlog with i/o ready messages whenever the ready or irq pin is read
196#undef DEBUG_GENERATION
197// above dumps some debug information related to the sample generation loop, i.e. when ramp frames happen
198#undef DEBUG_IO_READY
199// above debugs the io ready callback
200#undef DEBUG_RS_WS
201// above debugs the new up-and-coming tms5220_data_r and data_w access methods which actually respect rs and ws
162202
203#define MAX_SAMPLE_CHUNK   512
204#define FIFO_SIZE 16
163205
164/* Pull in the ROM tables */
165#include "tms5220r.c"
206/* Variants */
166207
167/*
168  Changes by R. Nabet
169   * added Speech ROM support
170   * modified code so that the beast only start speaking at the start of next frame, like the data
171     sheet says
172*/
208#define TMS5220_IS_5220C   (4)
209#define TMS5220_IS_5200      (5)
210#define TMS5220_IS_5220      (6)
173211
212#define TMS5220_IS_TMC0285   TMS5220_IS_5200
174213
214UINT8 reload_table[4] = { 0, 50, 100, 150 }; //is the sample count reload for 5220c only; 5200 and 5220 always reload with 0
215
175216typedef struct _tms5220_state tms5220_state;
176217struct _tms5220_state
177218{
219   /* coefficient tables */
220   int variant;            /* Variant of the 5xxx - see tms5110r.h */
221
222   /* coefficient tables */
223   const struct tms5100_coeffs *coeff;
224
178225   /* callbacks */
179226   devcb_resolved_write_line   irq_func;
180227
r7882r7883
189236   /* these contain global status bits */
190237   /*
191238        R Nabet : speak_external is only set when a speak external command is going on.
192        tms5220_speaking is set whenever a speak or speak external command is going on.
239        speaking_now is set whenever a speak or speak external command is going on.
193240        Note that we really need to do anything in tms5220_process and play samples only when
194        tms5220_speaking is true.  Else, we can play nothing as well, which is a
241        speaking_now is true.  Else, we can play nothing as well, which is a
195242        speed-up...
196243    */
197   UINT8 tms5220_speaking;   /* Speak or Speak External command in progress */
198   UINT8 speak_external;   /* Speak External command in progress */
199   UINT8 talk_status;      /* tms5220 is really currently speaking */
200   UINT8 first_frame;      /* we have just started speaking, and we are to parse the first frame */
201   UINT8 last_frame;      /* we are doing the frame of sound */
244   UINT8 speaking_now;      /* Speak or Speak External command in progress */
245   UINT8 speak_external;   /* Speak External command in progress, writes go to FIFO. */
246   UINT8 talk_status;      /* TS status bit is 1, i.e. speak or speak external is in progress and we have not encountered a stop frame yet; talk_status differs from speaking_now in that speaking_now is set as soon as a speak or speak external command is started; talk_status does NOT go active until after 8 bytes are written to the fifo on a speak external command, otherwise the two are the same. TS is cleared when a STOP command has just been processed in the speech stream, and a new command is about to be processed. */
202247   UINT8 buffer_low;      /* FIFO has less than 8 bytes in it */
203248   UINT8 buffer_empty;      /* FIFO is empty*/
204249   UINT8 irq_pin;         /* state of the IRQ pin (output) */
205250
206251   /* these contain data describing the current and previous voice frames */
207   UINT16 old_energy;
208   UINT16 old_pitch;
209   INT32 old_k[10];
252#define OLD_FRAME_STOP_FLAG (tms->old_frame_energy == COEFF_ENERGY_SENTINEL) // 1 if this was a stop (E = 0xF) frame
253#define OLD_FRAME_SILENCE_FLAG (tms->old_frame_energy == 0) // 1 if this was a silence (E=0) frame
254#define OLD_FRAME_UNVOICED_FLAG (tms->old_frame_pitch == 0) // 1 if unvoiced, 0 if voiced
255   UINT16 old_frame_energy;
256   UINT16 old_frame_pitch;
257   INT32 old_frame_k[10];
210258
211   UINT16 new_energy;
212   UINT16 new_pitch;
213   INT32 new_k[10];
259#define NEW_FRAME_STOP_FLAG (tms->new_frame_energy == COEFF_ENERGY_SENTINEL)  // ditto as above
260#define NEW_FRAME_SILENCE_FLAG (tms->new_frame_energy == 0) // ditto as above
261#define NEW_FRAME_UNVOICED_FLAG (tms->new_frame_pitch == 0) // ditto as above
262   UINT16 new_frame_energy;
263   UINT16 new_frame_pitch;
264   INT32 new_frame_k[10];
214265
215266
216267   /* these are all used to contain the current state of the sound generation */
r7882r7883
224275
225276   UINT16 previous_energy;         /* needed for lattice filter to match patent */
226277
278   //UINT8 interp_period; /* TODO: the current interpolation period, counts 1,2,3,4,5,6,7,0 for divide by 8,8,8,4,4,4,2,1 */
227279   UINT8 interp_count;      /* number of samples within each sub-interpolation period, ranges from 0-24 */
228280   UINT8 sample_count;      /* number of samples within the ENTIRE interpolation period, ranges from 0-199 */
281   UINT8 tms5220c_rate; /* only relevant for tms5220C's multi frame rate feature; is the actual 4 bit value written on a 0x2* or 0x0* command */
229282   UINT16 pitch_count;      /* pitch counter; provides chirp rom address */
230283
231284   INT32 u[11];
232285   INT32 x[10];
233286
234287   INT32 RNG;      /* the random noise generator configuration is: 1 + x + x^3 + x^4 + x^13 */
235   INT8 excitation_data;
288   INT16 excitation_data;
236289
237290   /* R Nabet : These have been added to emulate speech Roms */
238291   UINT8 schedule_dummy_read;         /* set after each load address, so that next read operation
r7882r7883
256309   UINT8 read_latch;
257310   UINT8 write_latch;
258311
259   /* flag for variant tmc0285/tms5200 emulation */
260   /* The TMC0285 AKA TMS5200 is an earlier variant of the TMS5220 used in
261       the early releases of the Speech Module for the TI-99/4(a) computer,
262       in Zaccaria's 'Money Money', and in a few other places.
263       The TMS5200 has a different set of LPC coefficients, and a different
264       chirp table than the 5220 (which is not yet dumped)
265       Due to the vast superiority of the quality of the TMS5220, TI may have
266       sold the remaining stocks of TMS5200s at a discount, and provided a
267       special encoder to use the older tables.
268       Other than those differences, the two chips are identical.
269       Another variant of the TMS5220 is the TMS5220C/TSP5220C, which replaces
270       the X0X0 'NOP' opcode with an opcode to select the number of
271       interpolations per frame to either be defined at each frame, or be fixed
272       at either 8, 6, 4, or 2. The TMS5200/5220 is always fixed at 8.
273     */
274   tms5220_variant variant;
275312    /* The TMS52xx has two different ways of providing output data: the
276313       analog speaker pin (which was usually used) and the Digital I/O pin.
277314       The internal DAC used to feed the analog pin is only 8 bits, and has the
r7882r7883
287324};
288325
289326
327/* Pull in the ROM tables */
328#include "tms5110r.c"
329
330
290331INLINE tms5220_state *get_safe_token(running_device *device)
291332{
292333   assert(device != NULL);
r7882r7883
299340   return (tms5220_state *)device->token;
300341}
301342
302
303
304343/* Static function prototypes */
305static void process_command(tms5220_state *tms);
306static int parse_frame(tms5220_state *tms, int the_first_frame);
307static void check_buffer_low(tms5220_state *tms);
344static void process_command(tms5220_state *tms, unsigned char data);
345static void parse_frame(tms5220_state *tms);
346static void update_status_and_ints(tms5220_state *tms);
308347static void set_interrupt_state(tms5220_state *tms, int state);
309348static INT16 lattice_filter(tms5220_state *tms);
310349static INT16 clip_and_wrap(INT16 cliptemp);
311350static STREAM_UPDATE( tms5220_update );
312351
352void tms5220_set_variant(tms5220_state *tms, int variant)
353{
354   switch (variant)
355   {
356      case TMS5220_IS_5220C:
357         tms->coeff = &tms5220c_coeff;
358         break;
359      case TMS5220_IS_5200:
360         tms->coeff = &tms5200_coeff;
361         break;
362      case TMS5220_IS_5220:
363         tms->coeff = &tms5220_coeff;
364         break;
365      default:
366         fatalerror("Unknown variant in tms5220_set_variant\n");
367   }
313368
369   tms->variant = variant;
370}
371
372
314373static void register_for_save_states(tms5220_state *tms)
315374{
316375   state_save_register_device_item_array(tms->device, 0, tms->fifo);
r7882r7883
319378   state_save_register_device_item(tms->device, 0, tms->fifo_count);
320379   state_save_register_device_item(tms->device, 0, tms->fifo_bits_taken);
321380
322   state_save_register_device_item(tms->device, 0, tms->tms5220_speaking);
381   state_save_register_device_item(tms->device, 0, tms->speaking_now);
323382   state_save_register_device_item(tms->device, 0, tms->speak_external);
324383   state_save_register_device_item(tms->device, 0, tms->talk_status);
325   state_save_register_device_item(tms->device, 0, tms->first_frame);
326   state_save_register_device_item(tms->device, 0, tms->last_frame);
327384   state_save_register_device_item(tms->device, 0, tms->buffer_low);
328385   state_save_register_device_item(tms->device, 0, tms->buffer_empty);
329386   state_save_register_device_item(tms->device, 0, tms->irq_pin);
330387
331   state_save_register_device_item(tms->device, 0, tms->old_energy);
332   state_save_register_device_item(tms->device, 0, tms->old_pitch);
333   state_save_register_device_item_array(tms->device, 0, tms->old_k);
388   state_save_register_device_item(tms->device, 0, tms->old_frame_energy);
389   state_save_register_device_item(tms->device, 0, tms->old_frame_pitch);
390   state_save_register_device_item_array(tms->device, 0, tms->old_frame_k);
334391
335   state_save_register_device_item(tms->device, 0, tms->new_energy);
336   state_save_register_device_item(tms->device, 0, tms->new_pitch);
337   state_save_register_device_item_array(tms->device, 0, tms->new_k);
392   state_save_register_device_item(tms->device, 0, tms->new_frame_energy);
393   state_save_register_device_item(tms->device, 0, tms->new_frame_pitch);
394   state_save_register_device_item_array(tms->device, 0, tms->new_frame_k);
338395
339396   state_save_register_device_item(tms->device, 0, tms->current_energy);
340397   state_save_register_device_item(tms->device, 0, tms->current_pitch);
r7882r7883
348405
349406   state_save_register_device_item(tms->device, 0, tms->interp_count);
350407   state_save_register_device_item(tms->device, 0, tms->sample_count);
408   state_save_register_device_item(tms->device, 0, tms->tms5220c_rate);
351409   state_save_register_device_item(tms->device, 0, tms->pitch_count);
352410
353411   state_save_register_device_item_array(tms->device, 0, tms->u);
r7882r7883
373431
374432static void tms5220_data_write(tms5220_state *tms, int data)
375433{
376    /* add this byte to the FIFO */
377    if (tms->fifo_count < FIFO_SIZE)
378    {
379        tms->fifo[tms->fifo_tail] = data;
380        tms->fifo_tail = (tms->fifo_tail + 1) % FIFO_SIZE;
381        tms->fifo_count++;
434   if (tms->speak_external) // If we're in speak external mode
435   {
436      /* add this byte to the FIFO */
437      if (tms->fifo_count < FIFO_SIZE)
438      {
439         tms->fifo[tms->fifo_tail] = data;
440         tms->fifo_tail = (tms->fifo_tail + 1) % FIFO_SIZE;
441         tms->fifo_count++;
382442
383      /* if we were speaking, then we're no longer empty */
384      if (tms->speak_external)
385         tms->buffer_empty = 0;
443         /* if we were speaking, then we're no longer empty */
444         if (tms->speak_external)
445            tms->buffer_empty = 0;
446#ifdef DEBUG_FIFO
447         logerror("data_write: Added byte to FIFO (current count=%2d)\n", tms->fifo_count);
448      }
449      else
450      {
386451
387        LOG(("Added byte to FIFO (size=%2d)\n", tms->fifo_count));
388    }
389    else
452         logerror("data_write: Ran out of room in the FIFO!\n");
453         // at this point, /READY should remain HIGH/inactive until the fifo has at least one byte open in it.
454#endif
455      }
456
457      update_status_and_ints(tms);
458   }
459   else //(! tms->speak_external)
460      /* R Nabet : we parse commands at once.  It is necessary for such commands as read. */
461      process_command(tms,data);
462}
463
464/**********************************************************************************************
465
466     update_status_and_ints -- check to see if the buffer low flag should be on or off
467
468***********************************************************************************************/
469
470static void update_status_and_ints(tms5220_state *tms)
471{
472   /* update flags and set ints if needed */
473   /* BL is set if neither byte 9 nor 8 of the fifo are in use; this
474    translates to having fifo_count (which ranges from 0 bytes in use to 16
475    bytes used) being less than or equal to 8. Victory/Victorba depends on this. */
476    if (tms->fifo_count <= 8)
390477    {
391        LOG(("Ran out of room in the FIFO!\n"));
478        /* generate an interrupt if necessary; if /BL was inactive and is now active, set int. */
479        if (!tms->buffer_low)
480            set_interrupt_state(tms, 1);
481        tms->buffer_low = 1;
482   }
483   else
484      tms->buffer_low = 0;
485
486   /* BE is set if neither byte 15 nor 14 of the fifo are in use; this
487    translates to having fifo_count equal to exactly 0 */
488   if (tms->fifo_count == 0)
489   {
490       /* generate an interrupt if necessary; if /BE was inactive and is now active, set int. */
491        if (!tms->buffer_empty)
492            set_interrupt_state(tms, 1);
493        tms->buffer_empty = 1;
392494    }
495   else
496      tms->buffer_empty = 0;
393497
394    /* update the buffer low state */
395    check_buffer_low(tms);
498   /* TS is talk status and is set elsewhere in the fifo parser and in
499    the SPEAK command handler; however, if /BE is true during speak external
500    mode, it is immediately unset here. */
501   if ((tms->speak_external == 1) && (tms->buffer_empty == 1))
502   {
503      /* generate an interrupt if necessary; if /TS was active and is now inactive, set int. */
504        if (tms->talk_status == 1)
505            set_interrupt_state(tms, 1);
506      tms->talk_status = 0;
507   }
508   /* Note that TS being unset will also generate an interrupt when a STOP
509    frame is encountered; this is handled in the sample generator code and not here */
510}
396511
397   if (! tms->speak_external)
398      /* R Nabet : we parse commands at once.  It is necessary for such commands as read. */
399      process_command (tms/*data*/);
512/**********************************************************************************************
513
514     extract_bits -- extract a specific number of bits from the current input stream (FIFO or VSM)
515
516***********************************************************************************************/
517
518static int extract_bits(tms5220_state *tms, int count)
519{
520    int val = 0;
521
522   if (tms->speak_external)
523   {
524      /* extract from FIFO */
525      while (count--)
526      {
527         val = (val << 1) | ((tms->fifo[tms->fifo_head] >> tms->fifo_bits_taken) & 1);
528         tms->fifo_bits_taken++;
529         if (tms->fifo_bits_taken >= 8)
530         {
531            tms->fifo_count--;
532            tms->fifo[tms->fifo_head] = 0; // zero the newly depleted fifo head byte
533            tms->fifo_head = (tms->fifo_head + 1) % FIFO_SIZE;
534            tms->fifo_bits_taken = 0;
535            update_status_and_ints(tms);
536         }
537      }
538   }
539   else
540   {
541      /* extract from VSM (speech ROM) */
542      if (tms->intf->read)
543         val = (* tms->intf->read)(tms->device, count);
544   }
545
546    return val;
400547}
401548
402
403549/**********************************************************************************************
404550
405551     tms5220_status_read -- read status or data from the TMS5220
r7882r7883
433579   else
434580   {   /* read status */
435581
436      /* clear the interrupt pin */
582      /* clear the interrupt pin on status read */
437583      set_interrupt_state(tms, 0);
584#ifdef DEBUG_PIN_READS
585      logerror("Status read: TS=%d BL=%d BE=%d\n", tms->talk_status, tms->buffer_low, tms->buffer_empty);
586#endif
438587
439      LOG(("Status read: TS=%d BL=%d BE=%d\n", tms->talk_status, tms->buffer_low, tms->buffer_empty));
440
441588      return (tms->talk_status << 7) | (tms->buffer_low << 6) | (tms->buffer_empty << 5);
442589   }
443590}
r7882r7883
452599
453600static int tms5220_ready_read(tms5220_state *tms)
454601{
455   LOG(("io_ready %d\n", tms->io_ready));
456    return (tms->fifo_count < FIFO_SIZE-1) && tms->io_ready;
602#ifdef DEBUG_PIN_READS
603   logerror("ready_read: ready pin read, io_ready is %d, fifo count is %d\n", tms->io_ready, tms->fifo_count);
604#endif
605    return ((tms->fifo_count < FIFO_SIZE)||(!tms->speak_external)) && tms->io_ready;
457606}
458607
459608
r7882r7883
506655
507656static int tms5220_int_read(tms5220_state *tms)
508657{
658#ifdef DEBUG_PIN_READS
659   logerror("int_read: irq pin read, state is %d\n", tms->irq_pin);
660#endif
509661    return tms->irq_pin;
510662}
511663
r7882r7883
522674    int buf_count=0;
523675    int i, interp_period, bitout;
524676
525tryagain:
677//tryagain:
526678
527    /* if we're not speaking, parse commands */
528   /*while (!tms->speak_external && tms->fifo_count > 0)
529        process_command(tms);*/
530
531679    /* if we're empty and still not speaking, fill with nothingness */
532   if ((!tms->tms5220_speaking) && (!tms->last_frame))
680   if (!tms->speaking_now)
533681        goto empty;
534682
535    /* if we're to speak, but haven't started, wait for the 9th byte */
683    /* if speak external is set, but talk status is not (yet) set,
684    wait for buffer low to clear */
536685   if (!tms->talk_status && tms->speak_external)
537686    {
538        if (tms->fifo_count < 9)
687        if (tms->buffer_low == 1)
539688           goto empty;
540689
690      /* we now have enough bytes; clear out the new frame parameters (it will become old frame just before the first call to parse_frame() ) */
691      tms->new_frame_energy = 0;
692      tms->new_frame_pitch = 0;
693      for (i = 0; i < tms->coeff->num_k; i++)
694         tms->new_frame_k[i] = 0;
695
541696        tms->talk_status = 1;
542      tms->first_frame = 1;   /* will cause the first frame to be parsed */
543      tms->buffer_empty = 0;
544697   }
545698
546699    /* loop until the buffer is full or we've stopped speaking */
r7882r7883
550703        /* if we're ready for a new frame */
551704        if ((tms->interp_count == 0) && (tms->sample_count == 0))
552705        {
553            /* Parse a new frame */
554         if (!parse_frame(tms, tms->first_frame))
555            break;
556         tms->first_frame = 0;
557706
558            /* Set old target as new start of frame */
559            tms->current_energy = tms->old_energy;
560            tms->current_pitch = tms->old_pitch;
561            for (i = 0; i < 10; i++)
562                tms->current_k[i] = tms->old_k[i];
707         /* remember previous frame energy, pitch, and coefficients */
708         tms->old_frame_energy = tms->new_frame_energy;
709         tms->old_frame_pitch = tms->new_frame_pitch;
710         for (i = 0; i < tms->coeff->num_k; i++)
711            tms->old_frame_k[i] = tms->new_frame_k[i];
563712
564            /* is this a zero energy frame? */
565            if (tms->current_energy == 0)
566            {
567                /*mame_printf_debug("processing frame: zero energy\n");*/
568                tms->target_energy = 0;
569                tms->target_pitch = tms->current_pitch;
570                for (i = 0; i < 10; i++)
571                    tms->target_k[i] = tms->current_k[i];
572            }
713         /* if the old frame was a stop frame, exit and do not process any more frames */
714         if (OLD_FRAME_STOP_FLAG)
715         {
716#ifdef DEBUG_GENERATION
717            logerror("tms5220_process: processing frame: stop frame\n");
718#endif
719            tms->speaking_now = tms->talk_status = tms->speak_external = 0;
720            set_interrupt_state(tms, 1); // TS went inactive, so int is raised
721            tms->sample_count = reload_table[tms->tms5220c_rate&0x3];
722            update_status_and_ints(tms);
723            goto empty;
724         }
573725
574            /* is this a stop frame? */
575            else if (tms->current_energy == (energytable[15] >> 6))
576            {
577                /*mame_printf_debug("processing frame: stop frame\n");*/
578                tms->current_energy = energytable[0] >> 6;
579                tms->target_energy = tms->current_energy;
580            /*tms->interp_count = tms->sample_count =*/ tms->pitch_count = 0;
581            tms->last_frame = 0;
582            if (tms->tms5220_speaking)
583               /* new speech command in progress */
584               tms->first_frame = 1;
585            else
586            {
587               /* really stop speaking */
588               tms->talk_status = 0;
589726
590               /* generate an interrupt if necessary */
591               set_interrupt_state(tms, 1);
592            }
727         /* Parse a new frame into the new_target_energy, new_target_pitch and new_target_k[] */
728         parse_frame(tms);
593729
594                /* try to fetch commands again */
595                goto tryagain;
596            }
597            else
598            {
599                /* is this the ramp down frame? */
600                if (tms->new_energy == (energytable[15] >> 6))
601                {
602                    /*mame_printf_debug("processing frame: ramp down\n");*/
603                    tms->target_energy = 0;
604                    tms->target_pitch = tms->current_pitch;
605                    for (i = 0; i < 10; i++)
606                        tms->target_k[i] = tms->current_k[i];
607                }
608                /* Reset the step size */
609                else
610                {
611                    /*mame_printf_debug("processing frame: Normal\n");*/
612                    /*mame_printf_debug("*** Energy = %d\n",tms->current_energy);*/
613                    /*mame_printf_debug("proc: %d %d\n",last_fbuf_head,fbuf_head);*/
614730
615                    tms->target_energy = tms->new_energy;
616                    tms->target_pitch = tms->new_pitch;
731         /* Set old frame targets as starting point of new frame */
732         tms->current_energy = tms->old_frame_energy;
733         tms->current_pitch = tms->old_frame_pitch;
734         for (i = 0; i < tms->coeff->num_k; i++)
735            tms->current_k[i] = tms->old_frame_k[i];
617736
618                    for (i = 0; i < 4; i++)
619                        tms->target_k[i] = tms->new_k[i];
620                    if (tms->current_pitch == 0)
621                        for (i = 4; i < 10; i++)
622                        {
623                            tms->target_k[i] = tms->current_k[i] = 0;
624                        }
625                    else
626                        for (i = 4; i < 10; i++)
627                            tms->target_k[i] = tms->new_k[i];
628                }
629            }
737
738         /* in all cases where interpolation would be inhibited, set the target
739               value equal to the current value.
740               Interpolation inhibit cases:
741               * Old frame was voiced, new is unvoiced
742               * Old frame was silence/zero energy, new is unvoiced
743               * Old frame was unvoiced, new is voiced
744               * New frame is a silence/zero energy frame - ? not sure
745               * New frame is a stop frame - ? not sure
746            */
747         if ( ((NEW_FRAME_SILENCE_FLAG == 0) && (NEW_FRAME_STOP_FLAG == 0))
748         && ( ((OLD_FRAME_UNVOICED_FLAG == 0) && (NEW_FRAME_UNVOICED_FLAG == 1))
749            || ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 1))
750            || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0)) )
751            )
752         {
753#ifdef DEBUG_GENERATION
754            logerror("processing frame: interpolation inhibited\n");
755            logerror("*** current Energy = %d\n",tms->current_energy);
756            logerror("*** next frame Energy = %d\n",tms->new_frame_energy);
757#endif
758            tms->target_energy = tms->current_energy;
759            tms->target_pitch = tms->current_pitch;
760            for (i = 0; i < tms->coeff->num_k; i++)
761               tms->target_k[i] = tms->current_k[i];
762         }
763         /* in cases where the new frame is a STOP or SILENCE frame,
764               ramp the energy down to 0, leaving everything else alone. */
765         else if ((NEW_FRAME_SILENCE_FLAG == 1) || (NEW_FRAME_STOP_FLAG == 1))
766         {
767#ifdef DEBUG_GENERATION
768            logerror("processing frame: ramp-down (energy = 0 or STOP)\n";
769#endif
770            tms->target_energy = 0;
771            tms->target_pitch = tms->current_pitch;
772            for (i = 0; i < tms->coeff->num_k; i++)
773               tms->target_k[i] = tms->current_k[i];
774         }
775         else // normal frame, normal interpolation
776         {
777#ifdef DEBUG_GENERATION
778            logerror("processing frame: Normal\n");
779            logerror("*** current Energy = %d\n",tms->current_energy);
780            logerror("*** new (target) Energy = %d\n",tms->new_frame_energy);
781#endif
782
783            tms->target_energy = tms->new_frame_energy;
784            tms->target_pitch = tms->new_frame_pitch;
785            for (i = 0; i < tms->coeff->num_k; i++)
786               tms->target_k[i] = tms->new_frame_k[i];
787         }
788      }
789      else // Not a new frame, just interpolate the existing frame.
790      {
791#ifdef OVERRIDE_INTERPOLATION
792         interp_period = OVERRIDE_INTERPOLATION;
793#else
794         interp_period = tms->sample_count / 25;
795#endif
796      switch(tms->interp_count)
797         {
798            /*         PC=X  X cycle, rendering change (change for next cycle which chip is actually doing) */
799            case 0: /* PC=0, A cycle, nothing happens (calc energy) */
800            break;
801            case 1: /* PC=0, B cycle, nothing happens (update energy) */
802            break;
803            case 2: /* PC=1, A cycle, update energy (calc pitch) */
804            tms->current_energy += ((tms->target_energy - tms->current_energy) >> tms->coeff->interp_coeff[interp_period]);
805            break;
806            case 3: /* PC=1, B cycle, nothing happens (update pitch) */
807            break;
808            case 4: /* PC=2, A cycle, update pitch (calc K1) */
809            tms->current_pitch += ((tms->target_pitch - tms->current_pitch) >> tms->coeff->interp_coeff[interp_period]);
810            break;
811            case 5: /* PC=2, B cycle, nothing happens (update K1) */
812            break;
813            case 6: /* PC=3, A cycle, update K1 (calc K2) */
814            tms->current_k[0] += ((tms->target_k[0] - tms->current_k[0]) >> tms->coeff->interp_coeff[interp_period]);
815            break;
816            case 7: /* PC=3, B cycle, nothing happens (update K2) */
817            break;
818            case 8: /* PC=4, A cycle, update K2 (calc K3) */
819            tms->current_k[1] += ((tms->target_k[1] - tms->current_k[1]) >> tms->coeff->interp_coeff[interp_period]);
820            break;
821            case 9: /* PC=4, B cycle, nothing happens (update K3) */
822            break;
823            case 10: /* PC=5, A cycle, update K3 (calc K4) */
824            tms->current_k[2] += ((tms->target_k[2] - tms->current_k[2]) >> tms->coeff->interp_coeff[interp_period]);
825            break;
826            case 11: /* PC=5, B cycle, nothing happens (update K4) */
827            break;
828            case 12: /* PC=6, A cycle, update K4 (calc K5) */
829            tms->current_k[3] += ((tms->target_k[3] - tms->current_k[3]) >> tms->coeff->interp_coeff[interp_period]);
830            break;
831            case 13: /* PC=6, B cycle, nothing happens (update K5) */
832            break;
833            case 14: /* PC=7, A cycle, update K5 (calc K6) */
834            tms->current_k[4] += ((tms->target_k[4] - tms->current_k[4]) >> tms->coeff->interp_coeff[interp_period]);
835            break;
836            case 15: /* PC=7, B cycle, nothing happens (update K6) */
837            break;
838            case 16: /* PC=8, A cycle, update K6 (calc K7) */
839            tms->current_k[5] += ((tms->target_k[5] - tms->current_k[5]) >> tms->coeff->interp_coeff[interp_period]);
840            break;
841            case 17: /* PC=8, B cycle, nothing happens (update K7) */
842            break;
843            case 18: /* PC=9, A cycle, update K7 (calc K8) */
844            tms->current_k[6] += ((tms->target_k[6] - tms->current_k[6]) >> tms->coeff->interp_coeff[interp_period]);
845            break;
846            case 19: /* PC=9, B cycle, nothing happens (update K8) */
847            break;
848            case 20: /* PC=10, A cycle, update K8 (calc K9) */
849            tms->current_k[7] += ((tms->target_k[7] - tms->current_k[7]) >> tms->coeff->interp_coeff[interp_period]);
850            break;
851            case 21: /* PC=10, B cycle, nothing happens (update K9) */
852            break;
853            case 22: /* PC=11, A cycle, update K9 (calc K10) */
854            tms->current_k[8] += ((tms->target_k[8] - tms->current_k[8]) >> tms->coeff->interp_coeff[interp_period]);
855            break;
856            case 23: /* PC=11, B cycle, nothing happens (update K10) */
857            break;
858            case 24: /* PC=12, A cycle, update K10 (do nothing) */
859            tms->current_k[9] += ((tms->target_k[9] - tms->current_k[9]) >> tms->coeff->interp_coeff[interp_period]);
860            break;
861         }
630862        }
631        else
632        {
633            interp_period = tms->sample_count / 25;
634       switch(tms->interp_count)
635       {
636                /*         PC=X  X cycle, rendering change (change for next cycle which chip is actually doing) */
637      case 0: /* PC=0, A cycle, nothing happens (calc energy) */
638                  break;
639      case 1: /* PC=0, B cycle, nothing happens (update energy) */
640        break;
641      case 2: /* PC=1, A cycle, update energy (calc pitch) */
642        tms->current_energy += ((tms->target_energy - tms->current_energy) >> interp_coeff[interp_period]);
643                 break;
644                case 3: /* PC=1, B cycle, nothing happens (update pitch) */
645        break;
646                case 4: /* PC=2, A cycle, update pitch (calc K1) */
647                 if (tms->old_pitch != 0)
648                  tms->current_pitch += ((tms->target_pitch - tms->current_pitch) >> interp_coeff[interp_period]);
649        break;
650                case 5: /* PC=2, B cycle, nothing happens (update K1) */
651        break;
652      case 6: /* PC=3, A cycle, update K1 (calc K2) */
653        tms->current_k[0] += ((tms->target_k[0] - tms->current_k[0]) >> interp_coeff[interp_period]);
654                 break;
655                case 7: /* PC=3, B cycle, nothing happens (update K2) */
656        break;
657      case 8: /* PC=4, A cycle, update K2 (calc K3) */
658        tms->current_k[1] += ((tms->target_k[1] - tms->current_k[1]) >> interp_coeff[interp_period]);
659                 break;
660                case 9: /* PC=4, B cycle, nothing happens (update K3) */
661        break;
662      case 10: /* PC=5, A cycle, update K3 (calc K4) */
663        tms->current_k[2] += ((tms->target_k[2] - tms->current_k[2]) >> interp_coeff[interp_period]);
664                 break;
665                case 11: /* PC=5, B cycle, nothing happens (update K4) */
666        break;
667      case 12: /* PC=6, A cycle, update K4 (calc K5) */
668        tms->current_k[3] += ((tms->target_k[3] - tms->current_k[3]) >> interp_coeff[interp_period]);
669                 break;
670                case 13: /* PC=6, B cycle, nothing happens (update K5) */
671        break;
672      case 14: /* PC=7, A cycle, update K5 (calc K6) */
673        tms->current_k[4] += ((tms->target_k[4] - tms->current_k[4]) >> interp_coeff[interp_period]);
674                 break;
675                case 15: /* PC=7, B cycle, nothing happens (update K6) */
676        break;
677      case 16: /* PC=8, A cycle, update K6 (calc K7) */
678        tms->current_k[5] += ((tms->target_k[5] - tms->current_k[5]) >> interp_coeff[interp_period]);
679                 break;
680                case 17: /* PC=8, B cycle, nothing happens (update K7) */
681        break;
682      case 18: /* PC=9, A cycle, update K7 (calc K8) */
683        tms->current_k[6] += ((tms->target_k[6] - tms->current_k[6]) >> interp_coeff[interp_period]);
684                 break;
685                case 19: /* PC=9, B cycle, nothing happens (update K8) */
686        break;
687      case 20: /* PC=10, A cycle, update K8 (calc K9) */
688        tms->current_k[7] += ((tms->target_k[7] - tms->current_k[7]) >> interp_coeff[interp_period]);
689                 break;
690                case 21: /* PC=10, B cycle, nothing happens (update K9) */
691        break;
692      case 22: /* PC=11, A cycle, update K9 (calc K10) */
693        tms->current_k[8] += ((tms->target_k[8] - tms->current_k[8]) >> interp_coeff[interp_period]);
694                 break;
695                case 23: /* PC=11, B cycle, nothing happens (update K10) */
696        break;
697      case 24: /* PC=12, A cycle, update K10 (do nothing) */
698        tms->current_k[9] += ((tms->target_k[9] - tms->current_k[9]) >> interp_coeff[interp_period]);
699                 break;
700       }
701        }
702863
703        if (tms->old_pitch == 0)
704        {
705            /* generate unvoiced samples here */
864        /* calculate the output */
865      if (OLD_FRAME_UNVOICED_FLAG == 1)
866      {
867         /* generate unvoiced samples here */
706868         if (tms->RNG & 1)
707869            tms->excitation_data = -0x40; /* according to the patent it is (either + or -) half of the maximum value in the chirp table, so +-64 */
708870         else
r7882r7883
718880             * disabled, forcing all samples beyond 50d to be == 50d
719881             * (address 50d holds zeroes)
720882             */
883#ifdef NORMALMODE
721884          if (tms->pitch_count > 50)
722              tms->excitation_data = chirptable[50];
885              tms->excitation_data = tms->coeff->chirptable[50]<<CHIRPROM_LEFTSHIFT;
723886          else /*tms->pitch_count <= 50*/
724              tms->excitation_data = chirptable[tms->pitch_count];
887              tms->excitation_data = tms->coeff->chirptable[tms->pitch_count]<<CHIRPROM_LEFTSHIFT;
888#else
889          tms->excitation_data = tms->pitch_count - 64;
890#endif
725891        }
726892
727893        /* Update LFSR *20* times every sample, like patent shows */
r7882r7883
737903
738904      buffer[buf_count] = clip_and_wrap(lattice_filter(tms)); /* execute lattice filter and clipping/wrapping */
739905
740        if (tms->digital_select == 0) /* if digital is NOT selected... */
741        buffer[buf_count] &= 0xff00; /* mask out all but the 8 dac bits */
906        //if (tms->digital_select == 0) /* if digital is NOT selected... */
907      //  buffer[buf_count] &= 0xff00; /* mask out all but the 8 dac bits */
742908
743909        /* Update all counts */
744910
745911        size--;
746912        tms->sample_count = (tms->sample_count + 1) % 200;
747
913#ifdef NORMALMODE
748914        if (tms->current_pitch != 0)
749915            tms->pitch_count = (tms->pitch_count + 1) % tms->current_pitch;
750916        else
751            tms->pitch_count = 0;
917            tms->pitch_count = 51; // blank spot in the chirp rom
918#else
919          tms->pitch_count = (tms->pitch_count + 1) % 128;
920#endif
752921
753922        tms->interp_count = (tms->interp_count + 1) % 25;
754923        buf_count++;
r7882r7883
774943
775944static INT16 clip_and_wrap(INT16 cliptemp)
776945{
777        /* clipping & wrapping, just like the patent shows */
946    /* clipping & wrapping, just like the patent shows:
947       first of all the result should be clamped to 14 bits, between -16384 and 16383
948    */
949   while (cliptemp > 16383) cliptemp -= 32768;
950   while (cliptemp < -16384) cliptemp += 32768;
951   /* the top 10 bits of this result are visible on the digital output IO pin.
952       next, if the top 3 bits of the 14 bit result are all the same, the lowest of those 3 bits plus the next 7 bits are the signed analog output, otherwise the low bits are all forced to match the inverse of the topmost bit, i.e.:
953       1x xxxx xxxx xxxx -> 0b10000000
954       11 1bcd efgh xxxx -> 0b1bcdefgh
955       00 0bcd efgh xxxx -> 0b0bcdefgh
956       0x xxxx xxxx xxxx -> 0b01111111
957       */
958#ifdef DO_CLIP_AND_WRAP
959   if (cliptemp > 2047) cliptemp = 2047;
960   else if (cliptemp < -2048) cliptemp = -2048;
961   /* at this point the analog output is tapped*/
962   return cliptemp << 4;
963#else
964   return cliptemp << 1;
965#endif
966}
778967
779   if (cliptemp > 2047) cliptemp = -2048 + (cliptemp-2047);
780   else if (cliptemp < -2048) cliptemp = 2047 - (cliptemp+2048);
781968
782   if (cliptemp > 511) {
783      mame_printf_debug ("cliptemp > 511\n");
784      return 127<<8;
785   }
786   else if (cliptemp < -512) {
787      mame_printf_debug ("cliptemp < -512\n");
788      return -128<<8;
789   }
790   else
791       return cliptemp << 6;
969/**********************************************************************************************
970
971     ti_matrix_multiply -- does the proper multiply and shift as the TI chips do.
972     a is the k coefficient and is clamped to 10 bits (9 bits plus a sign)
973     b is the running result and is clamped to 14 bits.
974     output is 14 bits, but note the result LSB bit is always 1.
975
976**********************************************************************************************/
977static INT16 matrix_multiply(INT16 a, INT16 b)
978{
979   INT16 result;
980   while (a>511) { a-=1024; }
981   while (a<-512) { a+=1024; }
982   while (b>16383) { b-=32768; }
983   while (b<-16384) { b+=32768; }
984   result = ((a*b)>>9)|1;
985#ifdef VERBOSE
986   if (result>16383) fprintf(stderr,"matrix multiplier overflowed! a: %x, b: %x", a, b);
987   if (result<-16384) fprintf(stderr,"matrix multiplier underflowed! a: %x, b: %x", a, b);
988#endif
989   return result;
792990}
793991
794
795992/**********************************************************************************************
796993
797994     lattice_filter -- executes one 'full run' of the lattice filter on a specific byte of
798995     excitation data, and specific values of all the current k constants,  and returns the
799996     resulting sample.
800     Note: the current_k processing here by dividing the result by 32768 is necessary, as the stored
801     parameters in the lookup table are the 10 bit coefficients but are pre-multiplied by 512 for
802     ease of storage. This is undone on the real chip by a shifter here, after the multiply.
803997
804998***********************************************************************************************/
805999
r7882r7883
8131007      Kn = tms->current_k[n-1]
8141008      bn = tms->x[n-1]
8151009    */
816        tms->u[10] = (tms->excitation_data * tms->previous_energy) >> 8; /* Y(11) */
817        tms->u[9] = tms->u[10] - ((tms->current_k[9] * tms->x[9]) / 32768);
818        tms->u[8] = tms->u[9] - ((tms->current_k[8] * tms->x[8]) / 32768);
819        tms->x[9] = tms->x[8] + ((tms->current_k[8] * tms->u[8]) / 32768);
820        tms->u[7] = tms->u[8] - ((tms->current_k[7] * tms->x[7]) / 32768);
821        tms->x[8] = tms->x[7] + ((tms->current_k[7] * tms->u[7]) / 32768);
822        tms->u[6] = tms->u[7] - ((tms->current_k[6] * tms->x[6]) / 32768);
823        tms->x[7] = tms->x[6] + ((tms->current_k[6] * tms->u[6]) / 32768);
824        tms->u[5] = tms->u[6] - ((tms->current_k[5] * tms->x[5]) / 32768);
825        tms->x[6] = tms->x[5] + ((tms->current_k[5] * tms->u[5]) / 32768);
826        tms->u[4] = tms->u[5] - ((tms->current_k[4] * tms->x[4]) / 32768);
827        tms->x[5] = tms->x[4] + ((tms->current_k[4] * tms->u[4]) / 32768);
828        tms->u[3] = tms->u[4] - ((tms->current_k[3] * tms->x[3]) / 32768);
829        tms->x[4] = tms->x[3] + ((tms->current_k[3] * tms->u[3]) / 32768);
830        tms->u[2] = tms->u[3] - ((tms->current_k[2] * tms->x[2]) / 32768);
831        tms->x[3] = tms->x[2] + ((tms->current_k[2] * tms->u[2]) / 32768);
832        tms->u[1] = tms->u[2] - ((tms->current_k[1] * tms->x[1]) / 32768);
833        tms->x[2] = tms->x[1] + ((tms->current_k[1] * tms->u[1]) / 32768);
834        tms->u[0] = tms->u[1] - ((tms->current_k[0] * tms->x[0]) / 32768);
835        tms->x[1] = tms->x[0] + ((tms->current_k[0] * tms->u[0]) / 32768);
1010      tms->u[10] = matrix_multiply(tms->current_energy, (tms->excitation_data*64));  //Y(11)
1011      //tms->u[10] = matrix_multiply((tms->excitation_data*64), tms->current_energy); // wrong but sounds better
1012        tms->u[9] = tms->u[10] - matrix_multiply(tms->current_k[9], tms->x[9]);
1013        tms->u[8] = tms->u[9] - matrix_multiply(tms->current_k[8], tms->x[8]);
1014        tms->x[9] = tms->x[8] + matrix_multiply(tms->current_k[8], tms->u[8]);
1015        tms->u[7] = tms->u[8] - matrix_multiply(tms->current_k[7], tms->x[7]);
1016        tms->x[8] = tms->x[7] + matrix_multiply(tms->current_k[7], tms->u[7]);
1017        tms->u[6] = tms->u[7] - matrix_multiply(tms->current_k[6], tms->x[6]);
1018        tms->x[7] = tms->x[6] + matrix_multiply(tms->current_k[6], tms->u[6]);
1019        tms->u[5] = tms->u[6] - matrix_multiply(tms->current_k[5], tms->x[5]);
1020        tms->x[6] = tms->x[5] + matrix_multiply(tms->current_k[5], tms->u[5]);
1021        tms->u[4] = tms->u[5] - matrix_multiply(tms->current_k[4], tms->x[4]);
1022        tms->x[5] = tms->x[4] + matrix_multiply(tms->current_k[4], tms->u[4]);
1023        tms->u[3] = tms->u[4] - matrix_multiply(tms->current_k[3], tms->x[3]);
1024        tms->x[4] = tms->x[3] + matrix_multiply(tms->current_k[3], tms->u[3]);
1025        tms->u[2] = tms->u[3] - matrix_multiply(tms->current_k[2], tms->x[2]);
1026        tms->x[3] = tms->x[2] + matrix_multiply(tms->current_k[2], tms->u[2]);
1027        tms->u[1] = tms->u[2] - matrix_multiply(tms->current_k[1], tms->x[1]);
1028        tms->x[2] = tms->x[1] + matrix_multiply(tms->current_k[1], tms->u[1]);
1029        tms->u[0] = tms->u[1] - matrix_multiply(tms->current_k[0], tms->x[0]);
1030        tms->x[1] = tms->x[0] + matrix_multiply(tms->current_k[0], tms->u[0]);
8361031        tms->x[0] = tms->u[0];
8371032        tms->previous_energy = tms->current_energy;
8381033        return tms->u[0];
r7882r7883
8451040
8461041***********************************************************************************************/
8471042
848static void process_command(tms5220_state *tms)
1043static void process_command(tms5220_state *tms, unsigned char cmd)
8491044{
850    unsigned char cmd;
851
852    /* if there are stray bits, ignore them */
853   if (tms->fifo_bits_taken)
854   {
855      tms->fifo_bits_taken = 0;
856        tms->fifo_count--;
857        tms->fifo_head = (tms->fifo_head + 1) % FIFO_SIZE;
858    }
859
860    /* grab a full byte from the FIFO */
861    if (tms->fifo_count > 0)
862    {
863      cmd = tms->fifo[tms->fifo_head];
864      tms->fifo_count--;
865      tms->fifo_head = (tms->fifo_head + 1) % FIFO_SIZE;
866
1045#ifdef DEBUG_COMMAND_DUMP
1046      logerror("process_command called with parameter %02X\n",cmd);
1047#endif
8671048      /* parse the command */
8681049      switch (cmd & 0x70)
8691050      {
8701051      case 0x10 : /* read byte */
871         if (tms->schedule_dummy_read)
1052         if (tms->talk_status == 0) /* TALKST must be clear for RDBY */
8721053         {
873            tms->schedule_dummy_read = FALSE;
1054            if (tms->schedule_dummy_read)
1055            {
1056               tms->schedule_dummy_read = FALSE;
1057               if (tms->intf->read)
1058                  (*tms->intf->read)(tms->device, 1);
1059            }
8741060            if (tms->intf->read)
875               (*tms->intf->read)(tms->device, 1);
1061               tms->data_register = (*tms->intf->read)(tms->device, 8);   /* read one byte from speech ROM... */
1062            tms->RDB_flag = TRUE;
8761063         }
877         if (tms->intf->read)
878            tms->data_register = (*tms->intf->read)(tms->device, 8);   /* read one byte from speech ROM... */
879         tms->RDB_flag = TRUE;
8801064         break;
8811065
1066      case 0x00: case 0x20: /* set rate (tms5220c only), otherwise NOP */
1067         if (tms->variant == SUBTYPE_TMS5220C)
1068         {
1069            tms->tms5220c_rate = cmd&0x0F;
1070         }
1071      break;
1072
8821073      case 0x30 : /* read and branch */
883         LOG(("read and branch command received\n"));
884         tms->RDB_flag = FALSE;
885         if (tms->intf->read_and_branch)
886            (*tms->intf->read_and_branch)(tms->device);
1074         if (tms->talk_status == 0) /* TALKST must be clear for RB */
1075         {
1076#ifdef VERBOSE
1077            logerror("read and branch command received\n");
1078#endif
1079            tms->RDB_flag = FALSE;
1080            if (tms->intf->read_and_branch)
1081               (*tms->intf->read_and_branch)(tms->device);
1082         }
8871083         break;
8881084
8891085      case 0x40 : /* load address */
890         /* tms5220 data sheet says that if we load only one 4-bit nibble, it won't work.
891              This code does not care about this. */
892         if (tms->intf->load_address)
893            (*tms->intf->load_address)(tms->device, cmd & 0x0f);
894         tms->schedule_dummy_read = TRUE;
1086         if (tms->talk_status == 0) /* TALKST must be clear for LA */
1087         {
1088            /* tms5220 data sheet says that if we load only one 4-bit nibble, it won't work.
1089                  This code does not care about this. */
1090            if (tms->intf->load_address)
1091               (*tms->intf->load_address)(tms->device, cmd & 0x0f);
1092            tms->schedule_dummy_read = TRUE;
1093         }
8951094         break;
8961095
8971096      case 0x50 : /* speak */
r7882r7883
9011100            if (tms->intf->read)
9021101               (*tms->intf->read)(tms->device, 1);
9031102         }
904         tms->tms5220_speaking = 1;
1103         tms->speaking_now = 1;
9051104         tms->speak_external = 0;
906         if (! tms->last_frame)
907         {
908            tms->first_frame = 1;
909         }
9101105         tms->talk_status = 1;  /* start immediately */
9111106         break;
9121107
9131108      case 0x60 : /* speak external */
914         tms->tms5220_speaking = tms->speak_external = 1;
915         tms->RDB_flag = FALSE;
916
917            /* according to the datasheet, this will cause an interrupt due to a BE condition */
918            if (!tms->buffer_empty)
919            {
920                tms->buffer_empty = 1;
921                set_interrupt_state(tms, 1);
922            }
923
924         tms->talk_status = 0;   /* wait to have 8 bytes in buffer before starting */
1109         if (tms->talk_status == 0) /* TALKST must be clear for SPKEXT */
1110         {
1111            //SPKEXT going active activates SPKEE which clears the fifo
1112            tms->fifo_head = tms->fifo_tail = tms->fifo_count = tms->fifo_bits_taken = 0;
1113            tms->speaking_now = tms->speak_external = 1;
1114            tms->RDB_flag = FALSE;
1115         }
9251116         break;
9261117
9271118      case 0x70 : /* reset */
r7882r7883
9331124         }
9341125         tms->device->reset();
9351126         break;
936        }
9371127    }
9381128
9391129    /* update the buffer low state */
940    check_buffer_low(tms);
1130    update_status_and_ints(tms);
9411131}
9421132
1133/******************************************************************************************
9431134
1135     parse_frame -- parse a new frame's worth of data; returns 0 if not enough bits in buffer
9441136
945/**********************************************************************************************
1137******************************************************************************************/
9461138
947     extract_bits -- extract a specific number of bits from the FIFO
948
949***********************************************************************************************/
950
951static int extract_bits(tms5220_state *tms, int count)
1139static void parse_frame(tms5220_state *tms)
9521140{
953    int val = 0;
1141   int bits, indx, i, rep_flag;
1142#ifdef DEBUG_FRAME_DUMP
1143   int ene;
1144#endif
9541145
1146   // todo: we actually don't care how many bits are left in the fifo here; the frame subpart will be processed normally, and any bits extracted 'past the end' of the fifo will be read as zeroes; the fifo being emptied will set the /BE latch which will halt speech exactly as if a stop frame had been encountered (instead of whatever partial frame was read); the same exact circuitry is used for both on the real chip, see us patent 4335277 sheet 16, gates 232a (decode stop frame) and 232b (decode /BE plus DDIS (decode disable) which is active during speak external).
9551147   if (tms->speak_external)
9561148   {
957      /* extract from FIFO */
958       while (count--)
959       {
960           val = (val << 1) | ((tms->fifo[tms->fifo_head] >> tms->fifo_bits_taken) & 1);
961           tms->fifo_bits_taken++;
962           if (tms->fifo_bits_taken >= 8)
963           {
964               tms->fifo_count--;
965               tms->fifo_head = (tms->fifo_head + 1) % FIFO_SIZE;
966               tms->fifo_bits_taken = 0;
967           }
968       }
969    }
1149      /* count the total number of bits available */
1150      bits = ((tms->fifo_count)*8)-tms->fifo_bits_taken;
1151   }
9701152   else
9711153   {
972      /* extract from speech ROM */
973      if (tms->intf->read)
974         val = (* tms->intf->read)(tms->device, count);
1154      /* we're talking out of a vsm rom, hence we have an effectively infinite number of bits which are pullable. extract_bits will toggle M0 for us and grab what bits are needed */
1155      bits = 131072; // == arbitrary large number
9751156   }
1157   /* if the chip is a tms5220C, and the rate mode is set to that each frame (0x04 bit set)
1158    has a 2 bit rate preceeding it, grab two bits here and store them as the rate; */
1159   if ((tms->variant == SUBTYPE_TMS5220C) && (tms->tms5220c_rate & 0x04))
1160   {
1161      bits -= 2;
1162      if (bits < 0) goto ranout;
1163      indx = extract_bits(tms, 2);
1164      tms->sample_count = reload_table[indx];
1165   }
1166   else // non-5220C and 5220C in fixed rate mode
1167   tms->sample_count = reload_table[tms->tms5220c_rate&0x3];
9761168
977    return val;
978}
1169   /* attempt to extract the energy index */
1170   bits -= tms->coeff->energy_bits;
1171   if (bits < 0) goto ranout;
1172   indx = extract_bits(tms,tms->coeff->energy_bits);
1173   tms->new_frame_energy = tms->coeff->energytable[indx];
1174#ifdef DEBUG_FRAME_DUMP
1175   ene = indx;
1176#endif
9791177
1178   /* if the energy index is 0 or 15, we're done */
9801179
981
982/**********************************************************************************************
983
984     parse_frame -- parse a new frame's worth of data; returns 0 if not enough bits in buffer
985
986***********************************************************************************************/
987
988static int parse_frame(tms5220_state *tms, int the_first_frame)
989{
990   int bits = 0;   /* number of bits in FIFO (speak external only) */
991   int indx, i, rep_flag;
992
993   if (! the_first_frame)
1180   if ((indx == 0) || (indx == 15))
9941181   {
995    /* remember previous frame */
996    tms->old_energy = tms->new_energy;
997    tms->old_pitch = tms->new_pitch;
998    for (i = 0; i < 10; i++)
999        tms->old_k[i] = tms->new_k[i];
1182#ifdef DEBUG_FRAME_INFO
1183      logerror("  (4-bit energy=%d frame)\n",tms->new_frame_energy);
1184#endif
1185      return;
10001186   }
10011187
1002    /* clear out the new frame */
1003    tms->new_energy = 0;
1004    tms->new_pitch = 0;
1005    for (i = 0; i < 10; i++)
1006        tms->new_k[i] = 0;
1188   /* attempt to extract the repeat flag */
1189   bits -= 1;
1190   if (bits < 0) goto ranout;
1191   rep_flag = extract_bits(tms,1);
10071192
1008    /* if the previous frame was a stop frame, don't do anything */
1009   if ((! the_first_frame) && (tms->old_energy == (energytable[15] >> 6)))
1010      return 1;
1011//  WARNING: This code below breaks Victory's power-on test! If you change it
1012//  make sure you test Victory.
1013//  {
1014//      LOG(("Buffer Empty set - Last frame stop frame\n");
1193   /* attempt to extract the pitch */
1194   bits -= tms->coeff->pitch_bits;
1195   if (bits < 0) goto ranout;
1196   indx = extract_bits(tms,tms->coeff->pitch_bits);
1197   tms->new_frame_pitch = tms->coeff->pitchtable[indx];
10151198
1016//      tms->buffer_empty = 1;
1017//      return 1;
1018//  }
1199   /* if this is a repeat frame, just copy the k's */
1200   if (rep_flag)
1201   {
1202   //actually, we do nothing because the k's were already loaded (on parsing the previous frame)
10191203
1020   if (tms->speak_external)
1021       /* count the total number of bits available */
1022      bits = tms->fifo_count * 8 - tms->fifo_bits_taken;
1023
1024    /* attempt to extract the energy index */
1025   if (tms->speak_external)
1026   {
1027    bits -= 4;
1028    if (bits < 0)
1029        goto ranout;
1204#ifdef DEBUG_FRAME_INFO
1205      logerror("  (10-bit energy=%d pitch=%d rep=%d frame)\n", tms->new_frame_energy, tms->new_frame_pitch, rep_flag);
1206#endif
1207      return;
10301208   }
1031    indx = extract_bits(tms, 4);
1032    tms->new_energy = energytable[indx] >> 6;
10331209
1034   /* if the index is 0 or 15, we're done */
1035   if (indx == 0 || indx == 15)
1210
1211   /* if the pitch index was zero, we need 4 k's */
1212   if (indx == 0)
10361213   {
1037      LOG(("  (4-bit energy=%d frame)\n",tms->new_energy));
1214      /* attempt to extract 4 K's */
1215      bits -= 18;
1216      if (bits < 0) goto ranout;
1217      for (i = 0; i < 4; i++)
1218         tms->new_frame_k[i] = tms->coeff->ktable[i][extract_bits(tms,tms->coeff->kbits[i])];
10381219
1039      /* clear tms->fifo if stop frame encountered */
1040      if (indx == 15)
1041      {
1042         tms->fifo_head = tms->fifo_tail = tms->fifo_count = tms->fifo_bits_taken = 0;
1043         tms->speak_external = tms->tms5220_speaking = 0;
1044         tms->last_frame = 1;
1045      }
1046      goto done;
1220   /* and clear the rest of the new_frame_k[] */
1221      for (i = 4; i < tms->coeff->num_k; i++)
1222         tms->new_frame_k[i] = 0;
1223#ifdef DEBUG_FRAME_INFO
1224      logerror("  (29-bit energy=%d pitch=%d rep=%d 4K frame)\n", tms->new_frame_energy, tms->new_frame_pitch, rep_flag);
1225#endif
1226      return;
10471227   }
10481228
1049    /* attempt to extract the repeat flag */
1050   if (tms->speak_external)
1229   /* else we need 10 K's */
1230   bits -= 39;
1231   if (bits < 0) goto ranout;
1232#ifdef DEBUG_FRAME_DUMP
1233   logerror("FrameDump %02d ", ene);
1234   for (i = 0; i < tms->coeff->num_k; i++)
10511235   {
1052    bits -= 1;
1053    if (bits < 0)
1054        goto ranout;
1236      int x;
1237      x = extract_bits(tms, tms->coeff->kbits[i]);
1238      tms->new_frame_k[i] = tms->coeff->ktable[i][x];
1239      logerror("%02d ", x);
10551240   }
1056    rep_flag = extract_bits(tms, 1);
1057
1058    /* attempt to extract the pitch */
1059   if (tms->speak_external)
1241   logerror("\n");
1242#else
1243   for (i = 0; i < tms->coeff->num_k; i++)
10601244   {
1061    bits -= 6;
1062    if (bits < 0)
1063        goto ranout;
1245      int x;
1246      x = extract_bits(tms, tms->coeff->kbits[i]);
1247      tms->new_frame_k[i] = tms->coeff->ktable[i][x];
10641248   }
1065    indx = extract_bits(tms, 6);
1066    tms->new_pitch = pitchtable[indx] / 256;
1067
1068    /* if this is a repeat frame, just copy the k's */
1069    if (rep_flag)
1070    {
1071        for (i = 0; i < 10; i++)
1072            tms->new_k[i] = tms->old_k[i];
1073
1074        LOG(("  (11-bit energy=%d pitch=%d rep=%d frame)\n", tms->new_energy, tms->new_pitch, rep_flag));
1075        goto done;
1076    }
1077
1078    /* if the pitch index was zero, we need 4 k's */
1079    if (indx == 0)
1080    {
1081        /* attempt to extract 4 K's */
1082      if (tms->speak_external)
1083      {
1084        bits -= 18;
1085        if (bits < 0)
1086            goto ranout;
1087      }
1088        tms->new_k[0] = k1table[extract_bits(tms, 5)];
1089        tms->new_k[1] = k2table[extract_bits(tms, 5)];
1090        tms->new_k[2] = k3table[extract_bits(tms, 4)];
1091      if (tms->variant == variant_tmc0285)
1092         tms->new_k[3] = k3table[extract_bits(tms, 4)];   /* ??? */
1093      else
1094         tms->new_k[3] = k4table[extract_bits(tms, 4)];
1095
1096        LOG(("  (29-bit energy=%d pitch=%d rep=%d 4K frame)\n", tms->new_energy, tms->new_pitch, rep_flag));
1097        goto done;
1098    }
1099
1100    /* else we need 10 K's */
1249#endif
1250#ifdef DEBUG_FRAME_INFO
1251   logerror("  (50-bit energy=%d pitch=%d rep=%d 10K frame))\n", tms->new_frame_energy, tms->new_frame_pitch, rep_flag);
11011252   if (tms->speak_external)
1102   {
1103    bits -= 39;
1104    if (bits < 0)
1105        goto ranout;
1106   }
1107
1108    tms->new_k[0] = k1table[extract_bits(tms, 5)];
1109    tms->new_k[1] = k2table[extract_bits(tms, 5)];
1110    tms->new_k[2] = k3table[extract_bits(tms, 4)];
1111   if (tms->variant == variant_tmc0285)
1112      tms->new_k[3] = k3table[extract_bits(tms, 4)];   /* ??? */
1253      logerror("Parsed a frame successfully in FIFO - %d bits remaining\n", bits);
11131254   else
1114      tms->new_k[3] = k4table[extract_bits(tms, 4)];
1115    tms->new_k[4] = k5table[extract_bits(tms, 4)];
1116    tms->new_k[5] = k6table[extract_bits(tms, 4)];
1117    tms->new_k[6] = k7table[extract_bits(tms, 4)];
1118    tms->new_k[7] = k8table[extract_bits(tms, 3)];
1119    tms->new_k[8] = k9table[extract_bits(tms, 3)];
1120    tms->new_k[9] = k10table[extract_bits(tms, 3)];
1255      logerror("Parsed a frame successfully in ROM\n");
1256#endif
1257   return;
11211258
1122    LOG(("  (50-bit energy=%d pitch=%d rep=%d 10K frame)\n", tms->new_energy, tms->new_pitch, rep_flag));
1123
1124done:
1125   if (tms->speak_external)
1126      LOG(("Parsed a frame successfully in FIFO - %d bits remaining\n", bits));
1127   else
1128      LOG(("Parsed a frame successfully in ROM\n"));
1129
1130   if (the_first_frame)
1131   {
1132      /* if this is the first frame, no previous frame to take as a starting point */
1133      tms->old_energy = tms->new_energy;
1134      tms->old_pitch = tms->new_pitch;
1135      for (i = 0; i < 10; i++)
1136         tms->old_k[i] = tms->new_k[i];
1137    }
1138
1139    /* update the tms->buffer_low status */
1140    check_buffer_low(tms);
1141    return 1;
1142
1143ranout:
1144
1145    LOG(("Ran out of bits on a parse!\n"));
1146
1259   ranout:
1260#ifdef DEBUG_FRAME_ERRORS
1261    logerror("Ran out of bits on a parse!\n");
1262#endif
11471263    /* this is an error condition; mark the buffer empty and turn off speaking */
11481264    tms->buffer_empty = 1;
1149   tms->talk_status = tms->speak_external = tms->tms5220_speaking = the_first_frame = tms->last_frame = 0;
1265   tms->talk_status = tms->speak_external = tms->speaking_now = 0;
11501266    tms->fifo_count = tms->fifo_head = tms->fifo_tail = 0;
11511267
11521268   tms->RDB_flag = FALSE;
11531269
1154    /* generate an interrupt if necessary */
1270    /* generate an interrupt since TS went low */
11551271    set_interrupt_state(tms, 1);
1156    return 0;
1157}
1272    return;
11581273
1159
1160
1161/**********************************************************************************************
1162
1163     check_buffer_low -- check to see if the buffer low flag should be on or off
1164
1165***********************************************************************************************/
1166
1167static void check_buffer_low(tms5220_state *tms)
1168{
1169    /* did we just become low? */
1170    if (tms->fifo_count <= 8)
1171    {
1172        /* generate an interrupt if necessary */
1173        if (!tms->buffer_low)
1174            set_interrupt_state(tms, 1);
1175        tms->buffer_low = 1;
1176
1177        LOG(("Buffer low set\n"));
1178    }
1179
1180    /* did we just become full? */
1181    else
1182    {
1183        tms->buffer_low = 0;
1184
1185        LOG(("Buffer low cleared\n"));
1186    }
11871274}
11881275
1189
1190
11911276/**********************************************************************************************
11921277
11931278     set_interrupt_state -- generate an interrupt
r7882r7883
11961281
11971282static void set_interrupt_state(tms5220_state *tms, int state)
11981283{
1284#ifdef DEBUG_PIN_READS
1285   logerror("irq pin set to state %d\n", state);
1286#endif
11991287    if (tms->irq_func.write && state != tms->irq_pin)
12001288       devcb_call_write_line(&tms->irq_func, !state);
12011289    tms->irq_pin = state;
r7882r7883
12131301   static const tms5220_interface dummy = { DEVCB_NULL };
12141302   tms5220_state *tms = get_safe_token(device);
12151303
1216   /* set the interface and device */
12171304   tms->intf = device->baseconfig().static_config ? (const tms5220_interface *)device->baseconfig().static_config : &dummy;
1305   //tms->table = *device->region;
1306
12181307   tms->device = device;
1308   tms5220_set_variant(tms, TMS5220_IS_5220);
12191309   tms->clock = device->clock;
12201310
1221   /* resolve */
1311   assert_always(tms != NULL, "Error creating TMS5220 chip");
12221312
1313   /* resolve irq line */
12231314   devcb_resolve_write_line(&tms->irq_func, &tms->intf->irq_func, device);
12241315
12251316   /* initialize a stream */
12261317   tms->stream = stream_create(device, 0, 1, device->clock / 80, tms, tms5220_update);
12271318
1319   /*if (tms->table == NULL)
1320    {
1321        assert_always(tms->intf->M0_callback != NULL, "Missing _mandatory_ 'M0_callback' function pointer in the TMS5110 interface\n  This function is used by TMS5220 to call for a new single bit\n  needed to generate the speech when in VSM mode\n  Aborting startup...\n");
1322        tms->M0_callback = tms->intf->M0_callback;
1323        tms->set_load_address = tms->intf->load_address;
1324    }
1325    else
1326    {
1327        tms->M0_callback = speech_rom_read_bit;
1328        tms->set_load_address = speech_rom_set_addr;
1329    }*/
1330
12281331   /* not during reset which is called frm within a write! */
12291332   tms->io_ready = 1;
12301333   tms->true_timing = 0;
1334   tms->rs_ws = 0x03; // rs and ws are assumed to be inactive on device startup
12311335
1232   tms->variant = variant_tms5220;
12331336   register_for_save_states(tms);
12341337}
12351338
r7882r7883
12371340{
12381341   tms5220_state *tms = get_safe_token(device);
12391342   DEVICE_START_CALL( tms5220 );
1240   tms->variant = variant_tms5220c;
1343   tms5220_set_variant(tms, TMS5220_IS_5220C);
12411344}
12421345
12431346static DEVICE_START( tmc0285 )
12441347{
12451348   tms5220_state *tms = get_safe_token(device);
12461349   DEVICE_START_CALL( tms5220 );
1247   tms->variant = variant_tmc0285;
1350   tms5220_set_variant(tms, TMS5220_IS_TMC0285);
12481351}
12491352
12501353
r7882r7883
12521355{
12531356   tms5220_state *tms = get_safe_token(device);
12541357   DEVICE_START_CALL( tms5220 );
1255   tms->variant = variant_tmc0285;
1358   tms5220_set_variant(tms, TMS5220_IS_5200);
12561359}
12571360
12581361
r7882r7883
12661369
12671370   /* initialize the chip state */
12681371   /* Note that we do not actually clear IRQ on start-up : IRQ is even raised if tms->buffer_empty or tms->buffer_low are 0 */
1269   tms->tms5220_speaking = tms->speak_external = tms->talk_status = tms->first_frame = tms->last_frame = tms->irq_pin = 0;
1372   tms->speaking_now = tms->speak_external = tms->talk_status = tms->irq_pin = 0;
12701373   set_interrupt_state(tms, 0);
12711374   tms->buffer_empty = tms->buffer_low = 1;
12721375
12731376   tms->RDB_flag = FALSE;
12741377
12751378   /* initialize the energy/pitch/k states */
1276   tms->old_energy = tms->new_energy = tms->current_energy = tms->target_energy = 0;
1277   tms->old_pitch = tms->new_pitch = tms->current_pitch = tms->target_pitch = 0;
1278   memset(tms->old_k, 0, sizeof(tms->old_k));
1279   memset(tms->new_k, 0, sizeof(tms->new_k));
1379   tms->old_frame_energy = tms->new_frame_energy = tms->current_energy = tms->target_energy = 0;
1380   tms->old_frame_pitch = tms->new_frame_pitch = tms->current_pitch = tms->target_pitch = 0;
1381   memset(tms->old_frame_k, 0, sizeof(tms->old_frame_k));
1382   memset(tms->new_frame_k, 0, sizeof(tms->new_frame_k));
12801383   memset(tms->current_k, 0, sizeof(tms->current_k));
12811384   memset(tms->target_k, 0, sizeof(tms->target_k));
12821385
12831386   /* initialize the sample generators */
1284   tms->interp_count = tms->sample_count = tms->pitch_count = 0;
1285        tms->RNG = 0x1FFF;
1387   tms->interp_count = tms->tms5220c_rate = tms->pitch_count = 0;
1388   tms->sample_count = reload_table[tms->tms5220c_rate&0x3];
1389    tms->RNG = 0x1FFF;
12861390   memset(tms->u, 0, sizeof(tms->u));
12871391   memset(tms->x, 0, sizeof(tms->x));
12881392
r7882r7883
13081412      case 0x02:
13091413         /* Write */
13101414          /* bring up to date first */
1311         LOG(("Service write %02x\n", tms->write_latch));
1415#ifdef DEBUG_IO_READY
1416         logerror("Serviced write: %02x\n", tms->write_latch);
1417         //fprintf(stderr, "Processed write data: %02X\n", tms->write_latch);
1418#endif
13121419          stream_update(tms->stream);
13131420          tms5220_data_write(tms, tms->write_latch);
13141421          break;
r7882r7883
13351442
13361443   tms->true_timing = 1;
13371444   state &= 0x01;
1338
1445#ifdef DEBUG_RS_WS
1446   logerror("/RS written with data: %d\n", state);
1447#endif
13391448   new_val = (tms->rs_ws & 0x01) | (state<<1);
13401449   if (new_val != tms->rs_ws)
13411450   {
13421451      tms->rs_ws = new_val;
13431452      if (new_val == 0)
13441453      {
1345         if (tms->variant == variant_tms5220c)
1454         if (tms->variant == SUBTYPE_TMS5220C)
13461455            device->reset();
1456#ifdef DEBUG_RS_WS
13471457         else
13481458            /* illegal */
1349            LOG(("tms5220_rs_w: illegal\n"));
1459            logerror("tms5220_rs_w: illegal\n");
1460#endif
13501461         return;
13511462      }
13521463      else if ( new_val == 3)
r7882r7883
13621473      else
13631474      {
13641475         /* high to low - schedule ready cycle*/
1365         LOG(("Schedule write ready\n"));
1366         tms->io_ready = 1;
1367         /* 100 nsec from data sheet */
1368         timer_set(tms->device->machine, ATTOTIME_IN_NSEC(100), tms, 0, io_ready_cb);
1476#ifdef DEBUG_RS_WS
1477         logerror("Schedule write ready\n");
1478#endif
1479         //tms->io_ready = 1;
1480         ///* 100 nsec from data sheet */
1481         //timer_set(tms->device->machine, ATTOTIME_IN_NSEC(100), tms, 0, io_ready_cb);
1482         tms->io_ready = 0;
13691483         /* 25 usec in datasheet, but zaccaria won't work */
13701484         timer_set(tms->device->machine, ATTOTIME_IN_USEC(100), tms, 1, io_ready_cb);
13711485      }
r7882r7883
13791493
13801494   tms->true_timing = 1;
13811495   state &= 0x01;
1496#ifdef DEBUG_RS_WS
1497   logerror("/WS written with data: %d\n", state);
1498#endif
13821499   new_val = (tms->rs_ws & 0x02) | (state<<0);
13831500   if (new_val != tms->rs_ws)
13841501   {
13851502      tms->rs_ws = new_val;
13861503      if (new_val == 0)
13871504      {
1388         if (tms->variant == variant_tms5220c)
1505         if (tms->variant == SUBTYPE_TMS5220C)
13891506            device->reset();
1507#ifdef DEBUG_RS_WS
13901508         else
13911509            /* illegal */
1392            LOG(("tms5220_ws_w: illegal\n"));
1510            logerror("tms5220_ws_w: illegal\n");
1511#endif
13931512         return;
13941513      }
13951514      else if ( new_val == 3)
r7882r7883
14041523      }
14051524      else
14061525      {
1407         /* high to low - schedule ready cycle*/
1408         tms->io_ready = 1;
1409         timer_set(tms->device->machine, ATTOTIME_IN_NSEC(100), tms, 0, io_ready_cb);
1526         ///* high to low - schedule ready cycle*/
1527         //tms->io_ready = 1;
1528         //timer_set(tms->device->machine, ATTOTIME_IN_NSEC(100), tms, 0, io_ready_cb);
1529         tms->io_ready = 0;
14101530         timer_set(tms->device->machine, ATTOTIME_IN_USEC(25), tms, 1, io_ready_cb);
14111531      }
14121532   }
r7882r7883
14211541WRITE8_DEVICE_HANDLER( tms5220_data_w )
14221542{
14231543   tms5220_state *tms = get_safe_token(device);
1424
1544#ifdef DEBUG_RS_WS
1545   logerror("tms5220_data_w: data %02x\n", data);
1546#endif
14251547   if (!tms->true_timing)
14261548   {
14271549      /* bring up to date first */
r7882r7883
14311553   else
14321554   {
14331555      /* actually in a write ? */
1556#ifdef DEBUG_RS_WS
14341557      if (!(tms->rs_ws == 0x02))
1435         LOG(("tms5220_data_w: data written outside ws, status: %02x!\n", tms->rs_ws));
1558         logerror("tms5220_data_w: data written outside ws, status: %02x!\n", tms->rs_ws);
1559#endif
14361560      tms->write_latch = data;
14371561   }
14381562}
r7882r7883
14591583      /* actually in a read ? */
14601584      if (tms->rs_ws == 0x01)
14611585         return tms->read_latch;
1586#ifdef DEBUG_RS_WS
14621587      else
1463         LOG(("tms5220_status_r: data read outside rs!\n"));
1588         logerror("tms5220_status_r: data read outside rs!\n");
1589#endif
14641590      return 0xff;
14651591   }
14661592}
docs/messnew.txt
r7882r7883
7070
7171Source Changes:
7272----------------
73- The core is based on MAME 0.137u2.  This incorporates all features of the
73- The core is based on MAME 0.137u3.  This incorporates all features of the
7474  update to this core.  [MAME team]
7575
7676- [AMSTRAD CPC Family] Updated Hashes to GoodCPC V3.1415 [Cowering]
makefile
r7882r7883
105105ifeq ($(firstword $(filter amd64,$(UNAME))),amd64)
106106PTR64 = 1
107107endif
108ifeq ($(firstword $(filter ppc64,$(UNAME))),ppc64)
109PTR64 = 1
108110endif
111endif
109112
110113# Autodetect BIGENDIAN
111114# MacOSX

Previous 15994 Revisions Next


© 1998-2018 The MESS Team